--- trunk/configure 2007/10/08 16:18:00 4 +++ trunk/configure 2007/10/08 16:18:11 6 @@ -27,7 +27,7 @@ # SUCH DAMAGE. # # -# $Id: configure,v 1.123 2005/04/17 01:42:21 debug Exp $ +# $Id: configure,v 1.132 2005/06/04 12:05:50 debug Exp $ # # This is a minimal configure script, hardcoded for GXemul. This script # figures out which compiler flags will work, and creates Makefiles in @@ -55,12 +55,14 @@ ############################################################################### ENABLEALPHA=NO +ENABLEARM=NO ENABLEHPPA=NO ENABLEMIPS=YES ENABLEPPC=YES ENABLESPARC=NO ENABLEURISC=YES ENABLEX86=NO +STABLE=YES if [ z"$*" != z ]; then # Parse command line options: @@ -71,60 +73,102 @@ ALWAYS32=YES else if [ z$a = z--disable-bintrans ]; then NOBINTRANS=YES + else if [ z$a = z--enable-bintrans ]; then + NOBINTRANS=NO + else if [ z$a = z--disable-mips16 ]; then + MIPS16=NO else if [ z$a = z--enable-mips16 ]; then MIPS16=YES + else if [ z$a = z--disable-alpha ]; then + ENABLEALPHA=NO else if [ z$a = z--enable-alpha ]; then ENABLEALPHA=YES + else if [ z$a = z--disable-arm ]; then + ENABLEARM=NO + else if [ z$a = z--enable-arm ]; then + ENABLEARM=YES + else if [ z$a = z--disable-hppa ]; then + ENABLEHPPA=NO else if [ z$a = z--enable-hppa ]; then ENABLEHPPA=YES else if [ z$a = z--disable-mips ]; then ENABLEMIPS=NO + else if [ z$a = z--enable-mips ]; then + ENABLEMIPS=YES else if [ z$a = z--disable-ppc ]; then ENABLEPPC=NO + else if [ z$a = z--enable-ppc ]; then + ENABLEPPC=YES + else if [ z$a = z--disable-sparc ]; then + ENABLESPARC=NO else if [ z$a = z--enable-sparc ]; then ENABLESPARC=YES else if [ z$a = z--disable-urisc ]; then ENABLEURISC=NO + else if [ z$a = z--enable-urisc ]; then + ENABLEURISC=YES + else if [ z$a = z--disable-x86 ]; then + ENABLEX86=NO else if [ z$a = z--enable-x86 ]; then ENABLEX86=YES + else if [ z$a = z--disable-delays ]; then + DELAYS=NO else if [ z$a = z--enable-delays ]; then DELAYS=YES + else if [ z$a = z--disable-caches ]; then + CACHES=NO else if [ z$a = z--enable-caches ]; then CACHES=YES else if [ z$a = z--help ]; then echo "usage: $0 [options]" printf "\nDevelopment (debug) options:\n" - echo " --always32 enable" \ + echo " --always32 enable" \ "ALWAYS_SIGNEXTEND_32 (for hunting down" - echo " 32/64-bit bugs)" + echo " 32/64-bit bugs)" printf "\nGeneral options:\n" - echo " --disable-bintrans configure without" \ + echo " --disable-bintrans configure without" \ "bintrans, even if the host supports it" - echo " --enable-caches enable cache emulation" \ - "(experimental)" - echo " --enable-delays enable instruction" \ + printf " --enable-caches enable cache emulation" + printf " (BUGGY)\n" + echo " --enable-delays enable instruction" \ "latency/delay emulation" - echo " --disable-x don't include X11 support" - printf "\nCPU selection options: (most of these" - printf " are experimental)\n" - echo " --enable-alpha enable Alpha CPU emulation" - echo " --enable-hppa enable HPPA CPU emulation" - echo " --disable-mips disable MIPS CPU emulation" - echo " --disable-ppc disable PPC CPU emulation" - echo " --enable-sparc enable SPARC CPU emulation" - echo " --disable-urisc disable URISC CPU emulation" - echo " --enable-x86 enable x86 CPU emulation" + echo " --disable-x don't include X11 support" + printf "\nCPU selection options:\n" + if [ z$STABLE = zNO ]; then + printf " --enable-alpha " + printf "enable Alpha CPU emulation" + printf " (NOT YET)\n" + printf " --enable-arm " + printf "enable ARM CPU emulation" + printf " (NOT YET)\n" + printf " --enable-hppa " + printf "enable HPPA CPU emulation" + printf " (NOT YET)\n" + fi + echo " --disable-mips disable MIPS CPU emulation" + echo " --disable-ppc disable PPC CPU emulation" + if [ z$STABLE = zNO ]; then + printf " --enable-sparc " + printf "enable SPARC CPU emulation" + printf " (NOT YET)\n" + fi + echo " --disable-urisc disable URISC CPU emulation" + if [ z$STABLE = zNO ]; then + printf " --enable-x86 " + printf "enable x86 CPU emulation" + printf " (NOT YET)\n" + fi printf "\nMIPS-specific options:\n" - echo " --enable-mips16 enable MIPS16 instruction" \ - "support (experimental)" - printf "\n" + printf " --enable-mips16 enable MIPS16 instruction" + printf " support (NOT YET)\n\n" exit else echo "Invalid option: $a" echo "Run $0 --help to get a list of" \ "available options." exit - fi; fi; fi; fi; fi; fi; fi; fi; fi; fi; fi; fi; fi; fi + fi; fi; fi; fi; fi; fi; fi; fi; fi; fi; fi; fi; fi; fi; fi + fi; fi; fi; fi; fi; fi; fi; fi; fi; fi; fi; fi done fi @@ -167,9 +211,33 @@ fi if [ z$ENABLEALPHA = zYES ]; then printf "#define ENABLE_ALPHA\n" >> config.h + if [ z$STABLE = zNO ]; then + printf "\nWARNING: Alpha emulation enabled, but it isn't really" + printf " implemented yet.\n\n" + else + printf "Not in the stable release.\n" + exit + fi +fi +if [ z$ENABLEARM = zYES ]; then + printf "#define ENABLE_ARM\n" >> config.h + if [ z$STABLE = zNO ]; then + printf "\nWARNING: ARM emulation enabled, but it isn't really" + printf " implemented yet.\n\n" + else + printf "Not in the stable release.\n" + exit + fi fi if [ z$ENABLEHPPA = zYES ]; then printf "#define ENABLE_HPPA\n" >> config.h + if [ z$STABLE = zNO ]; then + printf "\nWARNING: HPPA emulation enabled, but it isn't really" + printf " implemented yet.\n\n" + else + printf "Not in the stable release.\n" + exit + fi fi if [ z$ENABLEMIPS = zYES ]; then printf "#define ENABLE_MIPS\n" >> config.h @@ -179,12 +247,26 @@ fi if [ z$ENABLESPARC = zYES ]; then printf "#define ENABLE_SPARC\n" >> config.h + if [ z$STABLE = zNO ]; then + printf "\nWARNING: SPARC emulation enabled, but it isn't really" + printf " implemented yet.\n\n" + else + printf "Not in the stable release.\n" + exit + fi fi if [ z$ENABLEURISC = zYES ]; then printf "#define ENABLE_URISC\n" >> config.h fi if [ z$ENABLEX86 = zYES ]; then printf "#define ENABLE_X86\n" >> config.h + if [ z$STABLE = zNO ]; then + printf "\nWARNING: X86 emulation enabled, but it isn't really" + printf " working yet.\n\n" + else + printf "Not in the stable release.\n" + exit + fi fi @@ -214,6 +296,9 @@ printf ' (--delays) will not produce correct ' printf 'cache miss penalties and such.\n' fi + + printf "\nNOTE: Cache emulation enabled, but right now it triggers " + printf "weird bugs in the\n emulator. You have been warned.\n\n" fi @@ -678,24 +763,6 @@ rm -f _testprog _testprog.error _testprog.stdout -# -fmove-all-movables -printf "checking whether -fmove-all-movables can be used... " -$CC $CFLAGS -fmove-all-movables _testprog.c -o \ - _testprog > _testprog.stdout 2>&1 -cat _testprog.stdout >> _testprog.error -if grep movables _testprog.error > /dev/null 2>&1; then - printf "no\n" -else - if [ -x _testprog ]; then - CFLAGS="-fmove-all-movables $CFLAGS" - printf "yes\n" - else - printf "no\n" - fi -fi -rm -f _testprog _testprog.error _testprog.stdout - - # -fomit-frame-pointer printf "checking whether -fomit-frame-pointer can be used... " $CC $CFLAGS -fomit-frame-pointer _testprog.c -o \ @@ -804,9 +871,24 @@ printf "missing, using mystrtoull\n" printf "#define strtoull mystrtoull\n" >> config.h else - printf "yes\n" + printf "found\n" +fi +rm -f _tests.[co] _tests + + +# mkstemp missing? +printf "checking for mkstemp... " +printf "#include +int main(int argc, char *argv[]) { int x; char *y = \"abc\"; +x = mkstemp(y); return 0;}\n" > _tests.c +$CC $CFLAGS _tests.c -o _tests 2> /dev/null +if [ ! -x _tests ]; then + printf "missing, using workaround\n" + printf "#define mkstemp mymkstemp\n" >> config.h +else + printf "found\n" fi -rm -f _testlong* _tests.[co] _tests +rm -f _tests.[co] _tests # fseeko missing? @@ -818,12 +900,12 @@ int main(int argc, char *argv[]) { fseeko(NULL, 0, 0); return 0;}\n" > _tests.c $CC $CFLAGS _tests.c -o _tests 2> /dev/null if [ ! -x _tests ]; then - printf "no\n" + printf "missing\n" printf "WARNING! fseeko missing from libc. Using a hack, " printf "which probably doesn't work.\n" printf "#define HACK_FSEEKO\n" >> config.h else - printf "yes\n" + printf "found\n" fi rm -f _tests.[co] _tests @@ -841,7 +923,7 @@ printf "no, using int\n" CFLAGS="$CFLAGS -Dsocklen_t=int" else - printf "yes\n" + printf "socklen_t\n" fi rm -f _tests.[co] _tests