--- trunk/configure 2007/10/08 16:18:38 12 +++ trunk/configure 2007/10/08 16:18:51 14 @@ -27,7 +27,7 @@ # SUCH DAMAGE. # # -# $Id: configure,v 1.155 2005/08/16 05:37:08 debug Exp $ +# $Id: configure,v 1.170 2005/10/07 15:09:59 debug Exp $ # # This is a minimal configure script, hardcoded for GXemul. This script # figures out which compiler flags will work, and creates Makefiles in @@ -62,17 +62,22 @@ X=`basename \`pwd\`|cut -d \- -f 2-|cut -c1-2` if [ z"$X" = z0. ]; then # Stable: + ENABLEARM=YES ENABLEMIPS=YES else # Development: ENABLEALPHA=YES ENABLEARM=YES - ENABLEIA64=YES - ENABLEM68K=YES + ENABLEAVR=NO + ENABLEHPPA=NO + ENABLEI960=NO + ENABLEIA64=NO + ENABLEM68K=NO ENABLEMIPS=YES ENABLEPPC=YES - ENABLESPARC=YES - ENABLEX86=YES + ENABLESH=NO + ENABLESPARC=NO + ENABLEX86=NO fi if [ z"$*" != z ]; then @@ -92,6 +97,19 @@ MIPS16=NO else if [ z$a = z--enable-mips16 ]; then MIPS16=YES + else if [ z$a = z--enable-all ]; then + ENABLEALPHA=YES + ENABLEARM=YES + ENABLEAVR=YES + ENABLEHPPA=YES + ENABLEI960=YES + ENABLEIA64=YES + ENABLEM68K=YES + ENABLEMIPS=YES + ENABLEPPC=YES + ENABLESH=YES + ENABLESPARC=YES + ENABLEX86=YES else if [ z$a = z--disable-alpha ]; then ENABLEALPHA=NO else if [ z$a = z--enable-alpha ]; then @@ -100,6 +118,18 @@ ENABLEARM=NO else if [ z$a = z--enable-arm ]; then ENABLEARM=YES + else if [ z$a = z--disable-avr ]; then + ENABLEAVR=NO + else if [ z$a = z--enable-avr ]; then + ENABLEAVR=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-i960 ]; then + ENABLEI960=NO + else if [ z$a = z--enable-i960 ]; then + ENABLEI960=YES else if [ z$a = z--disable-ia64 ]; then ENABLEIA64=NO else if [ z$a = z--enable-ia64 ]; then @@ -116,6 +146,10 @@ ENABLEPPC=NO else if [ z$a = z--enable-ppc ]; then ENABLEPPC=YES + else if [ z$a = z--disable-sh ]; then + ENABLESH=NO + else if [ z$a = z--enable-sh ]; then + ENABLESH=YES else if [ z$a = z--disable-sparc ]; then ENABLESPARC=NO else if [ z$a = z--enable-sparc ]; then @@ -154,6 +188,8 @@ echo " --enable-delays enable instruction" \ "latency/delay emulation" + printf " --enable-all enable everything\n" + if [ z$ENABLEALPHA = zYES ]; then printf " --disable-alpha disable " else @@ -168,6 +204,27 @@ fi printf "ARM CPU emulation\n" + if [ z$ENABLEAVR = zYES ]; then + printf " --disable-avr disable " + else + printf " --enable-avr enable " + fi + printf "Atmel AVR CPU emulation\n" + + if [ z$ENABLEHPPA = zYES ]; then + printf " --disable-hppa disable " + else + printf " --enable-hppa enable " + fi + printf "HPPA CPU emulation\n" + + if [ z$ENABLEI960 = zYES ]; then + printf " --disable-i960 disable " + else + printf " --enable-i960 enable " + fi + printf "i960 CPU emulation\n" + if [ z$ENABLEIA64 = zYES ]; then printf " --disable-ia64 disable " else @@ -196,6 +253,13 @@ fi printf "POWER/PPC CPU emulation\n" + if [ z$ENABLESH = zYES ]; then + printf " --disable-sh disable " + else + printf " --enable-sh enable " + fi + printf "SH CPU emulation\n" + if [ z$ENABLESPARC = zYES ]; then printf " --disable-sparc disable " else @@ -222,8 +286,9 @@ 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; 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 @@ -267,10 +332,25 @@ if [ z$ENABLEALPHA = zYES ]; then printf "#define ENABLE_ALPHA\n" >> config.h CPU_ARCHS="$CPU_ARCHS cpu_alpha.o cpu_alpha_palcode.o" + CPU_TOOLS="$CPU_TOOLS generate_alpha_misc" fi if [ z$ENABLEARM = zYES ]; then printf "#define ENABLE_ARM\n" >> config.h - CPU_ARCHS="$CPU_ARCHS cpu_arm.o" + CPU_ARCHS="$CPU_ARCHS cpu_arm.o cpu_arm_coproc.o memory_arm.o " + CPU_ARCHS="$CPU_ARCHS tmp_arm_dpi.o tmp_arm_loadstore.o" + CPU_TOOLS="$CPU_TOOLS generate_arm_loadstore generate_arm_dpi" +fi +if [ z$ENABLEAVR = zYES ]; then + printf "#define ENABLE_AVR\n" >> config.h + CPU_ARCHS="$CPU_ARCHS cpu_avr.o" +fi +if [ z$ENABLEHPPA = zYES ]; then + printf "#define ENABLE_HPPA\n" >> config.h + CPU_ARCHS="$CPU_ARCHS cpu_hppa.o" +fi +if [ z$ENABLEI960 = zYES ]; then + printf "#define ENABLE_I960\n" >> config.h + CPU_ARCHS="$CPU_ARCHS cpu_i960.o" fi if [ z$ENABLEIA64 = zYES ]; then printf "#define ENABLE_IA64\n" >> config.h @@ -286,6 +366,11 @@ if [ z$ENABLEPPC = zYES ]; then printf "#define ENABLE_PPC\n" >> config.h CPU_ARCHS="$CPU_ARCHS cpu_ppc.o" + CPU_TOOLS="$CPU_TOOLS generate_ppc_loadstore" +fi +if [ z$ENABLESH = zYES ]; then + printf "#define ENABLE_SH\n" >> config.h + CPU_ARCHS="$CPU_ARCHS cpu_sh.o" fi if [ z$ENABLESPARC = zYES ]; then printf "#define ENABLE_SPARC\n" >> config.h @@ -411,15 +496,15 @@ fi rm -f _testprog - # Try ccc (FreeBSD/Alpha): - printf "#!/bin/sh\nccc _testprog.c -o _testprog >" > _test.sh - printf " /dev/null 2> /dev/null\n" >> _test.sh - chmod 755 _test.sh - ./_test.sh > /dev/null 2> /dev/null - if [ -x _testprog ]; then - CC="ccc" - fi - rm -f _testprog +# # Try ccc (FreeBSD/Alpha): +# printf "#!/bin/sh\nccc _testprog.c -o _testprog >" > _test.sh +# printf " /dev/null 2> /dev/null\n" >> _test.sh +# chmod 755 _test.sh +# ./_test.sh > /dev/null 2> /dev/null +# if [ -x _testprog ]; then +# CC="ccc" +# fi +# rm -f _testprog rm -f _test.sh fi @@ -1016,6 +1101,8 @@ # Check for u_int8_t etc: +# These are needed because some header files in src/include/ use u_int* +# instead of uint*, and I don't have time to rewrite them all. printf "checking for u_int8_t... " printf "#include \n#include \n#include \n int main(int argc, char *argv[]){printf(\"%%i\\\n\", @@ -1037,13 +1124,37 @@ printf "typedef uint8_t u_int8_t;\n" >> config.h printf "typedef uint16_t u_int16_t;\n" >> config.h printf "typedef uint32_t u_int32_t;\n" >> config.h - printf "typedef uint64_t u_int64_t;\n" >> config.h printf "uint8_t\n" else printf "yes\n" fi rm -f _testuint.c _testuint +printf "checking for u_int64_t... " +printf "#include \n#include \n#include \n +int main(int argc, char *argv[]){printf(\"%%i\\\n\", + (int)sizeof(u_int64_t));return 0;}\n" > _testuint.c +$CC $CFLAGS _testuint.c -o _testuint 2> /dev/null +if [ ! -x _testuint ]; then + rm -f _testuint* + printf "#include \n#include + \n#include \nint main(int argc, char *argv[]) + {printf(\"%%i\\\n\", (int)sizeof(uint64_t));return 0;}\n" > _testuint.c + $CC $CFLAGS _testuint.c -o _testuint 2> /dev/null + if [ ! -x _testuint ]; then + printf "no\n\nERROR: No u_int64_t or uint64_t. Aborting\n" + # TODO: Automagically detect using various combinations + # of char, int, short, long etc. + exit + fi + + printf "typedef uint64_t u_int64_t;\n" >> config.h + printf "uint64_t\n" +else + printf "yes\n" +fi +rm -f _testuint.c _testuint + ############################################################################### # @@ -1177,12 +1288,13 @@ echo "CC=$CC" >> _Makefile.header echo "OTHERLIBS=$OTHERLIBS" >> _Makefile.header echo "CPU_ARCHS=$CPU_ARCHS" >> _Makefile.header +echo "CPU_TOOLS=$CPU_TOOLS" >> _Makefile.header echo "" >> _Makefile.header # Create the Makefiles: -for a in . src src/devices src/devices/fonts; do +for a in . src src/cpus src/devices src/devices/fonts src/promemul; do echo "creating $a/Makefile" touch $a/Makefile cat _Makefile.header > $a/Makefile