Sdl-config


Pickle

Mega GP Mania
Joined
May 30, 2006
Messages
5,527
Location
Detroit, Michigan
Website
Visit site
Ive been able to get around this with most programs but any source code that is based on autotools i.e ./configure uses this, and since most of the time the SDL lib is distributed without this I cant ever compile

I assume the only way to get sdl-config is to compile from source. In my setup im trying to use open2x in a opensuse running in vmware. My latest hit head against wall is with dosbox. Note: I have have not compilied SDL from source, if its that simple, what are the correct commands to do so?

1. Downloaded the toolchain and added my path as env GP2XDEV
2. Downloaded the pre-built libs package and the latest SDL lib from paeryn.
3. Ran ./autogen.sh, seemed to work.
4. Ran ./configure --prefix=$GP2XDEV --build=`uname -m` --host=gp2x CPPFLAGS="-I$GP2XDEV/include" CXXFLAGS="-O3 -fmerge-all-constants -ffast-math -funswitch-loops" LDFLAGS="-static -L$GP2XDEV/lib" --with-sdl-prefix=$GP2XDEV
Results In:
CODE

checking build system type... i686-pc-none
checking host system type... Invalid configuration `gp2x': machine `gp2x' not recognized
configure: error: /bin/sh ./config.sub gp2x failed



5. For kicks removed the host item and get my fav:
CODE

checking for sdl-config... /opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/bin/sdl-config
checking for SDL - version >= 1.2.0... ./configure: line 4489: /opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/bin/sdl-config: No such file or directory
./configure: line 4490: /opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/bin/sdl-config: No such file or directory
./configure: line 4493: /opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/bin/sdl-config: No such file or directory
./configure: line 4495: /opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/bin/sdl-config: No such file or directory
./configure: line 4497: /opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/bin/sdl-config: No such file or directory
no
*** Could not run SDL test program, checking why...
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occured. This usually means SDL was incorrectly installed
*** or that you have moved SDL since it was installed. In the latter case, you
*** may want to edit the sdl-config script: /opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/bin/sdl-config
configure: error: *** SDL version 1.2.0 not found!



Im asking anyone out there, help me out with this. Im tired of not being able to solve this and it getting in the way. I would like to learn what I need to know to handle these issues.
 
Try this instead:

./configure --host=arm-open2x-linux --target=arm-open2x-linux --build=`uname -m`

EDIT: /opt/open2x/gcc-4.1.1-glibc-2.3.6/bin must be in your PATH.
 
I'm going to assume you're talking about sdl-config, and not sdl_config as you wrote later on (two completely different things).

sdl-config is just a script that echos out the correct paths. Here's mine (from devkitgp2x)
CODE

#!/bin/sh

prefix=/c/devkitGP2X
exec_prefix=${prefix}
exec_prefix_set=no

usage="\
Usage: sdl-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs] [--static-libs]"

if test $# -eq 0; then
echo "${usage}" 1>&2
exit 1
fi

while test $# -gt 0; do
case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`;;
*) optarg=;;
esac

case $1 in
--prefix=*)
prefix=$optarg
if test $exec_prefix_set = no; then
exec_prefix=$optarg
fi
;;
--prefix)
echo $prefix
;;
--exec-prefix=*)
exec_prefix=$optarg
exec_prefix_set=yes
;;
--exec-prefix)
echo $exec_prefix
;;
--version)
echo 1.2.7
;;
--cflags)
echo -I${prefix}/include/SDL

# The portable way of including SDL is #include "SDL.h"
#if test ${prefix}/include != /usr/include; then
# # Handle oddities in Win32 path handling (assumes prefix)
# prefix=`echo ${prefix} | sed 's,^//([A-Z]),\1:,'`
#
# includes=-I${prefix}/include
#fi
#echo $includes -I${prefix}/include/SDL
;;
# --libs)
# libdirs="-L${exec_prefix}/lib -Wl,-rpath,${exec_prefix}/lib"
# echo $libdirs -lSDL
# ;;
# --static-libs)
--libs|--static-libs)
libdirs="-L${exec_prefix}/lib -Wl,-rpath,${exec_prefix}/lib"
echo $libdirs -lSDL -lm -ldl
;;
*)
echo "${usage}" 1>&2
exit 1
;;
esac
shift
done
 
Last edited by a moderator:
woogal said:
I'm going to assume you're talking about sdl-config, and not sdl_config as you wrote later on (two completely different things).
Yeah im doing backflips righ now, ok im not, but if i could i would.

Fixed my path to the bin, was looking at the wrong one
Got past the sdl-config. Thats tje file i needed.

Its starting to compile looks like I hit a spot where it couldnt find SDL.h, that should be fixed by adding the CCFLAGS to the ./configure i think?

Thanks for the quick feedback!
 
Last edited by a moderator:
Ok need a little more help.
I fixed the SDL include problem, pretty simple.
Looks like everything is compiling into the objects and now its trying to link.

Heres the configure command im using
CODE

./configure --host=arm-open2x-linux --target=arm-open2x-linux --build=`uname -m` CPPFLAGS="-I$GP2XDEV/arm-open2x-linux/include -I$GP2XDEV/arm-open2x-linux/include/SDL" CXXFLAGS="-O3 -fmerge-all-constants -ffast-math -funswitch-loops" LDFLAGS="-static -L$GP2XDEV/arm-open2x-linux/lib"


where
CODE
$GP2XDEV = /opt/open2x/gcc-4.1.1-glibc-2.3.6


Heres where it starts to break down:

CODE

make[3]: Entering directory `/opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/dosbox-0.72/src'
arm-open2x-linux-g++ -O3 -fmerge-all-constants -ffast-math -funswitch-loops -static -L/opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/lib -o dosbox dosbox.o cpu/libcpu.a debug/libdebug.a dos/libdos.a fpu/libfpu.a hardware/libhardware.a gui/libgui.a ints/libints.a misc/libmisc.a shell/libshell.a hardware/serialport/libserial.a -lm -L/c/devkitGP2X/lib -Wl,-rpath,/c/devkitGP2X/lib -lSDL -lm -ldl -lpng -lz
dos/libdos.a(dos_programs.o): In function `ResolveHomedir(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)':
dos_programs.cpp:(.text+0xde8): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/lib/libSDL.a(SDL_sysmutex.o): In function `SDL_mutexV':
/home/darius/svn/open2x/trunk/libs/SDL-1.2.9/src/thread/SDL_sysmutex.c:171: undefined reference to `pthread_mutex_unlock'



I dont know where ,/c/devkitGP2X/lib is coming from or where /home/darius/svn/open2x/trunk/libs/SDL-1.2.9/src/thread/ came from but they are not directories that I have.
 
/c/devkitGP2X/lib is getting into the makefile, ive manually replaced it.
Added -lpthread to the makefile

and looks like I have a binary! :lol: :lol: :lol: :lol:


fishybawb said:
Try adding -lpthread to the end of your linking options.
1 min too late
 
Last edited by a moderator:
Back
Top