--- trunk/configure 2007/10/08 16:17:48 2 +++ trunk/configure 2007/10/08 16:18:19 8 @@ -27,7 +27,7 @@ # SUCH DAMAGE. # # -# $Id: configure,v 1.119 2005/03/14 12:13:49 debug Exp $ +# $Id: configure,v 1.134 2005/06/11 20:59:10 debug Exp $ # # This is a minimal configure script, hardcoded for GXemul. This script # figures out which compiler flags will work, and creates Makefiles in @@ -54,12 +54,15 @@ # ############################################################################### -ENABLEALPHA=YES -ENABLEHPPA=YES +ENABLEALPHA=NO +ENABLEARM=NO +ENABLEHPPA=NO ENABLEMIPS=YES ENABLEPPC=YES -ENABLESPARC=YES +ENABLESPARC=NO ENABLEURISC=YES +ENABLEX86=NO +STABLE=YES if [ z"$*" != z ]; then # Parse command line options: @@ -68,57 +71,107 @@ NOX11=YES else if [ z$a = z--always32 ]; then ALWAYS32=YES + else if [ z$a = z--tracenull ]; then + TRACENULL=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)" + echo " --tracenull enable" \ + "TRACE_NULL_CRASHES (for bug hunting)" 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" + echo " --disable-x don't include X11 support" printf "\nCPU selection options:\n" - echo " --disable-alpha disable Alpha CPU emulation" - echo " --disable-hppa disable HPPA CPU emulation" - echo " --disable-mips disable MIPS CPU emulation" - echo " --disable-ppc disable PPC CPU emulation" - echo " --disable-sparc disable SPARC CPU emulation" - echo " --disable-urisc disable URISC CPU emulation" + 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 done fi @@ -162,33 +215,62 @@ fi if [ z$ENABLEALPHA = zYES ]; then printf "#define ENABLE_ALPHA\n" >> config.h -else - echo 'Disabling Alpha emulation support.' + 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 -else - echo 'Disabling HPPA emulation support.' + 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 -else - echo 'Disabling MIPS emulation support.' fi if [ z$ENABLEPPC = zYES ]; then printf "#define ENABLE_PPC\n" >> config.h -else - echo 'Disabling PPC emulation support.' fi if [ z$ENABLESPARC = zYES ]; then printf "#define ENABLE_SPARC\n" >> config.h -else - echo 'Disabling SPARC emulation support.' + 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 -else - echo 'Disabling URISC emulation support.' +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 @@ -199,7 +281,7 @@ fi -# Instruction delay/latency emulation: +# Development option: ALWAYS_SIGNEXTEND_32 if [ z$ALWAYS32 = zYES ]; then echo 'Enabling ALWAYS_SIGNEXTEND_32. (NOTE:' \ 'This slows down everything.)' @@ -207,6 +289,14 @@ fi +# Development option: TRACE_NULL_CRASHES +if [ z$TRACENULL = zYES ]; then + echo 'Enabling TRACE_NULL_CRASHES. (NOTE:' \ + 'This slows down the emulator.)' + printf "#define TRACE_NULL_CRASHES\n" >> config.h +fi + + # Cache emulation: if [ z$CACHES = zYES ]; then echo 'Enabling Cache emulation. (EXPERIMENTAL)' @@ -218,6 +308,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 @@ -682,24 +775,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 \ @@ -808,9 +883,24 @@ printf "missing, using mystrtoull\n" printf "#define strtoull mystrtoull\n" >> config.h else - printf "yes\n" + printf "found\n" fi -rm -f _testlong* _tests.[co] _tests +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 _tests.[co] _tests # fseeko missing? @@ -822,12 +912,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 @@ -845,7 +935,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 @@ -1039,13 +1129,15 @@ ############################################################################### -INCLUDE=-I../include/ +INCLUDE=-Iinclude/ +DINCLUDE=-I../include/ -echo C compiler flags: $CFLAGS $CWARNINGS $INCLUDE +echo C compiler flags: $CFLAGS $CWARNINGS echo Linker flags: $OTHERLIBS echo "CWARNINGS=$CWARNINGS" >> _Makefile.header echo "COPTIM=$CFLAGS" >> _Makefile.header echo "INCLUDE=$INCLUDE" >> _Makefile.header +echo "DINCLUDE=$DINCLUDE" >> _Makefile.header echo "CC=$CC" >> _Makefile.header echo "OTHERLIBS=$OTHERLIBS" >> _Makefile.header echo "" >> _Makefile.header @@ -1206,7 +1298,7 @@ # Create the Makefiles: -for a in . src devices devices/fonts tests; do +for a in . src src/devices src/devices/fonts tests; do echo "creating $a/Makefile" touch $a/Makefile cat _Makefile.header > $a/Makefile