liballeg / allegro5

The official Allegro 5 git repository. Pull requests welcome!
https://liballeg.org
Other
1.9k stars 286 forks source link

Crosscompiling fails with error in src/i386/icsprite.c #140

Open allebot opened 16 years ago

allebot commented 16 years ago

Originally reported by: art1

Original Ticket: "alleg/bugs/119":https://sourceforge.net/p/alleg/bugs/119

Hi,

I want to crosscompile Allegro for using it with djgpp under Debian Gnu/Linux. I have a working crosscompiler ($ i386-pc-msdosdjgpp-gcc -v Using built-in specs. Target: i386-pc-msdosdjgpp Configured with: ./configure -v --prefix=/usr --target=i386-pc-msdosdjgpp --disable-nls --host=i686-pc-linux-gnu --enable-languages=c,c++,fortran --enable-version-specific-runtime-libs --with-headers=/usr/i386-pc-msdosdjgpp/include Thread model: single gcc version 4.2.2 ) and have executed "fix.sh djgpp", patched xmake.sh to use ff. values:

XC_PATH=/usr/local/i386-pc-msdosdjgpp/ XPREFIX=i386-pc-msdosdjgpp- INSTALL_BASE=/usr/local/i386-pc-msdosdjgpp .. CPATH=$CPATH:$XC_PATH/include export CROSSCOMPILE MINGDIR DJDIR NATIVEPATH PATH XPREFIX CPATH

Then the "xmake.sh depend" was processed successfully. But if I try to run "xmake.sh" or "xmake.sh all" there I got the errors: ... src/i386/icsprite.c: In function 'compile_sprite': src/i386/icsprite.c:71: warning: implicit declaration of function '_unix_get_page_size' src/i386/icsprite.c:71: warning: implicit declaration of function 'mmap' src/i386/icsprite.c:71: error: 'MAP_SHARED' undeclared (first use in this function) src/i386/icsprite.c:71: error: (Each undeclared identifier is reported only oncesrc/i386/icsprite.c:71: error: for each function it appears in.) src/i386/icsprite.c:71: warning: assignment makes pointer from integer without a cast src/i386/icsprite.c:71: warning: assignment makes pointer from integer without a cast src/i386/icsprite.c:71: warning: implicit declaration of function 'mremap' src/i386/icsprite.c:71: error: 'MREMAP_MAYMOVE' undeclared (first use in this function) src/i386/icsprite.c:71: warning: assignment makes pointer from integer without a cast ... make: *\ [obj/djgpp/alleg/icsprite.o] Error 1

I downloaded allegro as allegro-4.2.2.tar.gz from your Website.

Please could you help me to fix this possible bug?

My email-adress is: romeyke@cbs.mpg.de

Thanks,

Bye Andreas

allebot commented 16 years ago

Original comment by: mmimica

Logged In: YES user_id=1171214 Originator: NO

Since the problem is in ASM blitter code you can try to dissable ASM. I'm not sure how is that done for crosscompiling. I guess you should pass ALLEGRO_USE_C=1 (x)make.

The problem seem to be at the beginning of src/i386/opcodes.h. Apparently, gcc #defines linux even when crosscompiling for DOS. You can easily fix that until a solution is found.

allebot commented 16 years ago

Original comment by: mmimica

Logged In: YES user_id=1171214 Originator: NO

Since the problem is in ASM blitter code you can try to disable ASM. I'm not sure how is that done for crosscompiling. I guess you should pass ALLEGRO_USE_C=1 (x)make.

The problem seem to be at the beginning of src/i386/opcodes.h. Apparently, gcc #defines linux even when crosscompiling for DOS. You can easily fix that until a solution is found.