--- trunk/configure 2007/10/08 16:18:19 8 +++ trunk/configure 2007/10/08 16:18:27 10 @@ -27,7 +27,7 @@ # SUCH DAMAGE. # # -# $Id: configure,v 1.134 2005/06/11 20:59:10 debug Exp $ +# $Id: configure,v 1.140 2005/06/27 17:31: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 @@ -52,17 +52,18 @@ # o) prefetch capability (TODO: this is assumed on Alpha, but not all # Alphas have it...) # +# TODO: +# o) do not enable prefetch on Alpha ev4 or ev5, only on pca56 and newer +# o) X11 libs and includes via command line options? +# ############################################################################### -ENABLEALPHA=NO -ENABLEARM=NO -ENABLEHPPA=NO +ENABLEARM=YES ENABLEMIPS=YES ENABLEPPC=YES -ENABLESPARC=NO ENABLEURISC=YES ENABLEX86=NO -STABLE=YES +STABLE=NO if [ z"$*" != z ]; then # Parse command line options: @@ -81,18 +82,10 @@ 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 @@ -101,10 +94,6 @@ 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 @@ -138,24 +127,9 @@ "latency/delay 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-arm disable ARM CPU emulation" 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 " @@ -172,7 +146,7 @@ "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 done fi @@ -196,7 +170,7 @@ # Figure out if VERSION should be defined. X=`basename \`pwd\`|cut -d \- -f 2-` if [ z"$X" = zgxemul ]; then - echo '# No VERSION defined.' >> _Makefile.header + echo '/* No VERSION defined. */' >> config.h else printf "#define VERSION \"$X\"\n" >> config.h fi @@ -213,35 +187,8 @@ printf 'NOTE: MIPS16 support is not really working yet.\n' printf "#define ENABLE_MIPS16\n" >> config.h 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 @@ -249,16 +196,6 @@ if [ z$ENABLEPPC = zYES ]; then printf "#define ENABLE_PPC\n" >> config.h 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 @@ -871,6 +808,23 @@ rm -f _testr.[co] _testr +# strlcpy missing? +printf "checking for strlcpy... " +printf "#include +int main(int argc, char *argv[]) { char *p; char *q; size_t x; + x = strlcpy(p, q, 50); return 0;}\n" > _tests.c +$CC $CFLAGS _tests.c -o _tests 2> /dev/null +if [ ! -x _tests ]; then + printf "missing, using mystrlcpy\n" + printf "#define strlcpy mystrlcpy\n" >> config.h + printf "#define strlcat mystrlcat\n" >> config.h + printf "#define USE_STRLCPY_REPLACEMENTS\n" >> config.h +else + printf "found\n" +fi +rm -f _tests.[co] _tests + + # strtoull missing? printf "checking for strtoull... " printf "#include @@ -1146,43 +1100,6 @@ printf "Regression test setup: (not really needed to build gxemul)\n" -## 64-bit HPPA cross-assembler: -# -#HPPA='' -#if [ z$ENABLEHPPA = zYES ]; then -# printf "Checking for a GNU cross-assembler for 64-bit HPPA... " -# echo 'nop' > _testprog.s -# -# for HPPA_TRY in hppa64-unknown-elf hppa64-elf; do -# printf '#!/bin/sh\n'$HPPA_TRY'-as _testprog.s' > _test.sh -# printf ' -o _testprog.o\n' >> _test.sh -# chmod 755 _test.sh -# rm -f _testprog.o -# ./_test.sh > /dev/null 2> /dev/null -# if [ -f _testprog.o ]; then -# HPPA=$HPPA_TRY -# break -# fi -# rm -f _testprog.o -# done -# -# if [ z$HPPA = z ]; then -# echo "none" -# else -# echo $HPPA"-gcc" -# fi -#fi -#rm -f _testprog* _test.sh -# -## TODO: are these ok? 64-bit mode! -##echo "HPPA_CC="$HPPA"-gcc -g -O2 -fno-builtin -fschedule-insns" \ -## >> _Makefile.header -#echo "HPPA_AS="$HPPA"-as " >> _Makefile.header -#echo "HPPA_LD="$HPPA"-ld -Ttext 0xa800000000030000 -e main" \ -# "--oformat=elf64-bigmips" >> _Makefile.header -#echo "" >> _Makefile.header - - # 64-bit MIPS cross-compiler: MIPS=''