Compiling Open2x Libraries On Ubuntu Gives Me Problems ...


joyrider

Active Member
Joined
Mar 29, 2006
Messages
589
Age
43
Website
www.willemssoft.be
Hey,

i'm trying to compile the open2x libraries using my ubuntu gusty linux. but i run into a problem almost immediatly this is the error i'm getting :

CODE

In file included from /usr/include/linux/errno.h:4,
from /usr/include/bits/errno.h:25,
from /usr/include/errno.h:36,
from ./src/stdlib/SDL_iconv.c:31:
/usr/include/asm/errno.h:9:4: warning: #warning This machine appears to be neither x86_64 nor i386.
./src/stdlib/SDL_iconv.c: In function 'SDL_iconv':
./src/stdlib/SDL_iconv.c:40: error: 'E2BIG' undeclared (first use in this function)
./src/stdlib/SDL_iconv.c:40: error: (Each undeclared identifier is reported only once
./src/stdlib/SDL_iconv.c:40: error: for each function it appears in.)
./src/stdlib/SDL_iconv.c:42: error: 'EILSEQ' undeclared (first use in this function)
./src/stdlib/SDL_iconv.c:44: error: 'EINVAL' undeclared (first use in this function)



the problem lies with /usr/include/asm/errno.h which would normally include files where E2BIG EILSEQ etc are defined.
/usr/include/asm/errno.h looks like this :
CODE

#ifndef __ASM_STUB_ERRNO_H
#define __ASM_STUB_ERRNO_H
# if defined __x86_64__
# include <asm-x86_64/errno.h>
# elif defined __i386__
# include <asm-i386/errno.h>
# else
# warning This machine appears to be neither x86_64 nor i386.
# endif
#endif /* __ASM_STUB_ERRNO_H */



so it doesn't detect i'm running i386 or sumthing ?

could the problem be this :
uname -m returns i686

how would i solve this ?

thanks
 
Try moving this:
#include <asm-i386/errno.h>

just before the last #endif
 
i already tried that but it seems in every file where they check for the __i386__ thingie i get warnings about it so i'd have to change all the source code where they check for it. isn't there another way so that __i386__ gets detected correctly some kind of extra option or sumthing ?
 
joyrider said:
i already tried that but it seems in every file where they check for the __i386__ thingie i get warnings about it so i'd have to change all the source code where they check for it. isn't there another way so that __i386__ gets detected correctly some kind of extra option or sumthing ?
You can add -D__i386__ to your CFLAGS line in the Makefile, that's -D directly followed by __i386__, no space. This is just a quick kludge to try, I'm not familiar with how open2x compiles itself, I only use the pre-built version.

Lemme know if you want me to look into it more, a way to show appreciation for your great ports (I play sokoban and waternet a lot, did last night even).
 
Last edited by a moderator:
Hi,

thanks for your help already it seems to go a bit further now but then i run into troubles when it tries ti compile SDM_Mixer:

i can't use the prebuild packages cause i have made small changes to the gp2x SDL by paeryn to make my joysticks work with the cradle so i need to be able to compile them

CODE

/opt/open2x/gcc-4.1.1-glibc-2.3.6/bin/arm-open2x-linux-gcc -O3 -ffast-math -fomit-frame-pointer -mcpu=arm920t -DARM -D__i386__ -D_ARM_ASSEM_ -I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include -I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include/libxml2 -I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include/SDL -I./include -D_GNU_SOURCE=1 -fvisibility=hidden -I/usr/include -DXTHREADS -D_REENTRANT -DHAVE_LINUX_VERSION_H -c ./src/audio/SDL_mixer_MMX.c -fPIC -DPIC -o build/.libs/SDL_mixer_MMX.o
./src/audio/SDL_mixer_MMX.c: In function 'SDL_MixAudio_MMX_S16':
./src/audio/SDL_mixer_MMX.c:41: error: unknown register name 'edx' in 'asm'
./src/audio/SDL_mixer_MMX.c:41: error: unknown register name 'eax' in 'asm'
./src/audio/SDL_mixer_MMX.c: In function 'SDL_MixAudio_MMX_S8':
./src/audio/SDL_mixer_MMX.c:143: error: unknown register name 'edx' in 'asm'
./src/audio/SDL_mixer_MMX.c:143: error: unknown register name 'eax' in 'asm'
make[1]: *** [build/SDL_mixer_MMX.lo] Fout 1
make[1]: Map '/home/joyrider/open2xlibs/libs/SDL-1.2.11' wordt verlaten
make: *** [/opt/open2x/gcc-4.1.1-glibc-2.3.6/lib/libSDL.a] Fout 2
Done - Please check build logs.



is what get
 
OK, I just read the compile procedure and it involves using SVN and running scripts that will overwrite my current toolchain. I will get back to you later tonight once I am finished with all my current GP2X programming.

BTW, from what you showed me, there is a problem: That CFLAGS statement is too wide a fix, I believe, and I think you should wait until someone here can help you that is more familiar with it. Or until I can get to trying it myself, but that comes later.
 
Ok thanks already :)

i really don't get it though i tought it be easier to compile it all under linux then under windows. in windows under cygwin i had no problems what so ever well no real problems i couldn't solve myselve
 
i found the problem. configure did a test to see if X was present or not and included the -I/usr/include etc wich was totaly wrong it shouldn't use the linux headers (thanks to zottd & exophase for pointing me that out on #gp2xdev)

so in order to compile it i edited the makefile.o2x for the SDL entry like this :
CODE

cd SDL-1.2.11 && $(FLAGS) ./configure --prefix=$(PREFIX) --host=$(HOST) --enable-shared --enable-static --enable-pthreads --enable-pthreads-sem --enable-threads --without-x --disable-esd -enable-video --enable-video-gp2x --enable-video-fbcon=no && $(FLAGS) make && $(FLAGS) make install && $(FLAGS) make clean



notice i removed --build=bleh and i added --without-x and --disable-esd then sdl compiled fine.
i'm compiling the rest of the libraries now.

Some of the configure scripts need to be chmodded so it has an execute flag.

for libxml2 the svn trunk is incomplete, just download a new version of the web compile that it works, just tested it or compile the previous version.

if i find some more pointers on compiling the libs on a new linux system i'll let it know for users who'd like to do this as well !

edit:
libncurses5.5 woudln't compile because it compiles a program tic and tries to execute it but since tic was compiled for arm (gp2x) it's normal it couldn't run it. I just commented it out in the make file i don't think its needed anyway if you just write apps using SDL at least i didn't include this in windows on cygwin either and never had any problems running my games.
That was all i got every lib compiled and ready for usuage i'll test a simple program tommorow need to get some sleep now :)
 
I have _never_ been able to build the open2x libs. Toolchain is fine but building the libs, some build, some dont, then it snowballs.
 
well i just tested the build libs out with a game i'm currently working on and everything seems to work :) i had no problems compiling them on cygwin in windows but in linux i had some problems but they are all fixed now :) (except for libncurses but i don,t think i used that anyway)
 
Back
Top