--- tools/configure 2009-06-23 11:30:40.000000000 +0200 +++ tools/configure.asettico 2009-06-23 11:21:36.000000000 +0200 @@ -5,7 +5,7 @@ # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ # \/ \/ \/ \/ \/ -# $Id: configure 21409 2009-06-20 18:37:29Z amiconn $ +# $Id: configure 21228 2009-06-08 23:05:33Z funman $ # # global CC options for all platforms @@ -13,7 +13,7 @@ use_logf="#undef ROCKBOX_HAS_LOGF" -scriptver=`echo '$Revision: 21409 $' | sed -e 's:\\$::g' -e 's/Revision: //'` +scriptver=`echo '$Revision: 21228 $' | sed -e 's:\\$::g' -e 's/Revision: //'` rbdir=".rockbox" @@ -26,50 +26,50 @@ } prefixtools () { - prefix="$1" - CC=${prefix}gcc - WINDRES=${prefix}windres - DLLTOOL=${prefix}dlltool - DLLWRAP=${prefix}dllwrap - RANLIB=${prefix}ranlib - LD=${prefix}ld - AR=${prefix}ar - AS=${prefix}as - OC=${prefix}objcopy + prefix="$1" + CC=${prefix}gcc + WINDRES=${prefix}windres + DLLTOOL=${prefix}dlltool + DLLWRAP=${prefix}dllwrap + RANLIB=${prefix}ranlib + LD=${prefix}ld + AR=${prefix}ar + AS=${prefix}as + OC=${prefix}objcopy } crosswincc () { - # naive approach to selecting a mingw cross-compiler on linux/*nix - echo "Enabling win32 crosscompiling" - - prefixtools i586-mingw32msvc- - - # add cross-compiler option(s) - GCCOPTS="$GCCOPTS `sdl-config --cflags`" - LDOPTS="`sdl-config --libs` -mconsole" - - output="rockboxui.exe" # use this as output binary name - crosscompile="yes" - endian="little" # windows is little endian + # naive approach to selecting a mingw cross-compiler on linux/*nix + echo "Enabling win32 crosscompiling" + + prefixtools i586-mingw32msvc- + + # add cross-compiler option(s) + GCCOPTS="$GCCOPTS `sdl-config --cflags`" + LDOPTS="`sdl-config --libs` -mconsole" + + output="rockboxui.exe" # use this as output binary name + crosscompile="yes" + endian="little" # windows is little endian } # scan the $PATH for the given command -findtool(){ - file="$1" +findtool() { + file="$1" - IFS=":" - for path in $PATH - do - # echo "checks for $file in $path" >&2 - if test -f "$path/$file"; then - echo "$path/$file" - return - fi - done - # check whether caller wants literal return value if not found - if [ "$2" = "--lit" ]; then - echo "$file" - fi + IFS=":" + for path in $PATH + do + # echo "checks for $file in $path" >&2 + if test -f "$path/$file"; then + echo "$path/$file" + return + fi + done + # check whether caller wants literal return value if not found + if [ "$2" = "--lit" ]; then + echo "$file" + fi } # parse the argument list, returns the value after the = in case of a @@ -81,139 +81,138 @@ arg1=$1 arg2=$2 arg3=$3 arg4=$4 arg5=$5 arg6=$6 arg7=$7 arg8=$8 arg9=$9 parse_args() { - ret="1" - for i in "$arg1" "$arg2" "$arg3" "$arg4" "$arg5" "$arg6" "$arg7" "$arg8" "$arg9" - do - if [ "$1" = "--ccache" ]; then - if [ "$i" = "--ccache" ]; then - ret="0" - fi - elif [ "$1" = "--no-ccache" ]; then - if [ "$i" = "--no-ccache" ]; then - ret="0" - fi - elif [ "$1" = "`echo $i|cut -d'=' -f1`" ]; then - ret=`echo $i|cut -d'=' -f2` - fi - done - echo "$ret" + ret="1" + for i in "$arg1" "$arg2" "$arg3" "$arg4" "$arg5" "$arg6" "$arg7" "$arg8" "$arg9" + do + if [ "$1" = "--ccache" ]; then + if [ "$i" = "--ccache" ]; then + ret="0" + fi + elif [ "$1" = "--no-ccache" ]; then + if [ "$i" = "--no-ccache" ]; then + ret="0" + fi + elif [ "$1" = "`echo $i|cut -d'=' -f1`" ]; then + ret=`echo $i|cut -d'=' -f2` + fi + done + echo "$ret" } simcc () { + # default tool setup for native building + prefixtools "" + + simver=sdl + GCCOPTS='-W -Wall -g -fno-builtin' + + output="rockboxui" # use this as default output binary name + + # generic sdl-config checker + sdl=`findtool sdl-config` + + if [ -z "$sdl" ]; then + echo "configure didn't find sdl-config, which indicates that you" + echo "don't have SDL (properly) installed. Please correct and" + echo "re-run configure!" + exit 1 + fi + + # default share option, override below if needed + SHARED_FLAG="-shared" + + case $uname in + CYGWIN*) + echo "Cygwin host detected" - # default tool setup for native building - prefixtools "" + # sdl version + GCCOPTS="$GCCOPTS `sdl-config --cflags`" + LDOPTS="`sdl-config --libs` -mconsole" - simver=sdl - GCCOPTS='-W -Wall -g -fno-builtin' + output="rockboxui.exe" # use this as output binary name + ;; + + MINGW*) + echo "MinGW host detected" + + # sdl version + GCCOPTS="$GCCOPTS `sdl-config --cflags`" + LDOPTS="`sdl-config --libs` -mconsole" + + output="rockboxui.exe" # use this as output binary name + ;; + + Linux) + echo "Linux host detected" + if [ "0" != `sdl-config --libs |grep -c mwindows` ]; then + # Enable crosscompiling if sdl-config is from Windows SDL + crosswincc + else + GCCOPTS="$GCCOPTS `sdl-config --cflags`" + LDOPTS="`sdl-config --libs`" + fi + ;; + + FreeBSD) + echo "FreeBSD host detected" + # sdl version + GCCOPTS="$GCCOPTS `sdl-config --cflags`" + LDOPTS="`sdl-config --libs`" + ;; - output="rockboxui" # use this as default output binary name + Darwin) + echo "Darwin host detected" + # sdl version + GCCOPTS="$GCCOPTS `sdl-config --cflags`" + LDOPTS="`sdl-config --libs`" + SHARED_FLAG="-dynamiclib -Wl\,-single_module" + ;; + + *) + echo "Unsupported system: $uname, fix configure and retry" + exit 2 + ;; + esac - # generic sdl-config checker - sdl=`findtool sdl-config` - - if [ -z "$sdl" ]; then - echo "configure didn't find sdl-config, which indicates that you" - echo "don't have SDL (properly) installed. Please correct and" - echo "re-run configure!" - exit 1 - fi - - # default share option, override below if needed - SHARED_FLAG="-shared" - - case $uname in - CYGWIN*) - echo "Cygwin host detected" - - # sdl version - GCCOPTS="$GCCOPTS `sdl-config --cflags`" - LDOPTS="`sdl-config --libs` -mconsole" - - output="rockboxui.exe" # use this as output binary name - ;; - - MINGW*) - echo "MinGW host detected" - - # sdl version - GCCOPTS="$GCCOPTS `sdl-config --cflags`" - LDOPTS="`sdl-config --libs` -mconsole" - - output="rockboxui.exe" # use this as output binary name - ;; - - Linux) - echo "Linux host detected" - if [ "0" != `sdl-config --libs |grep -c mwindows` ]; then - # Enable crosscompiling if sdl-config is from Windows SDL - crosswincc - else - GCCOPTS="$GCCOPTS `sdl-config --cflags`" - LDOPTS="`sdl-config --libs`" - fi - ;; - - FreeBSD) - echo "FreeBSD host detected" - # sdl version - GCCOPTS="$GCCOPTS `sdl-config --cflags`" - LDOPTS="`sdl-config --libs`" - ;; - - Darwin) - echo "Darwin host detected" - # sdl version - GCCOPTS="$GCCOPTS `sdl-config --cflags`" - LDOPTS="`sdl-config --libs`" - SHARED_FLAG="-dynamiclib -Wl\,-single_module" - ;; - - *) - echo "Unsupported system: $uname, fix configure and retry" - exit 2 - ;; - esac - - GCCOPTS="$GCCOPTS -I\$(SIMDIR)" - - if test "X$crosscompile" != "Xyes"; then - if [ "`uname -m`" = "x86_64" ] || [ "`uname -m`" = "amd64" ]; then - # fPIC is needed to make shared objects link - # setting visibility to hidden is necessary to avoid strange crashes - # due to symbol clashing - GCCOPTS="$GCCOPTS -fPIC -fvisibility=hidden" - fi + GCCOPTS="$GCCOPTS -I\$(SIMDIR)" - id=$$ - cat >/tmp/conftest-$id.c <