diff --git a/configure b/configure index c75d4601..318b7887 100755 --- a/configure +++ b/configure @@ -46,8 +46,7 @@ tcc_crtprefix="" tcc_elfinterp="" tcc_lddir= confvars= - -cpu=`uname -m` +cpu= # OS specific targetos=`uname -s` @@ -166,7 +165,7 @@ for opt do ;; --extra-libs=*) extralibs=${opt#--extra-libs=} ;; - --cpu=*) build_cpu=`echo $opt | cut -d '=' -f 2` + --cpu=*) cpu=`echo $opt | cut -d '=' -f 2` ;; --enable-gprof) gprof="yes" ;; @@ -195,6 +194,13 @@ for opt do esac done +if test -z "$cpu" ; then + if test -n "$ARCH" ; then + cpu="$ARCH" + else + cpu=`uname -m` + fi +fi classify_cpu "$cpu" # Checking for CFLAGS @@ -357,24 +363,24 @@ else esac fi -cat <> $TMPH if test "$cpu" = "x86" ; then echo "ARCH=i386" >> config.mak - echo "#define HOST_I386 1" >> $TMPH elif test "$cpu" = "x86-64" ; then echo "ARCH=x86-64" >> config.mak - echo "#define HOST_X86_64 1" >> $TMPH elif test "$cpu" = "armv4l" ; then echo "ARCH=arm" >> config.mak - echo "#define HOST_ARM 1" >> $TMPH echo "#define TCC_ARM_VERSION $cpuver" >> $TMPH elif test "$cpu" = "aarch64" ; then echo "ARCH=arm64" >> config.mak - echo "#define HOST_ARM64 1" >> $TMPH elif test "$cpu" = "powerpc" ; then echo "ARCH=ppc" >> config.mak - echo "#define HOST_PPC 1" >> $TMPH elif test "$cpu" = "mips" ; then echo "ARCH=mips" >> config.mak - echo "#define HOST_MIPS 1" >> $TMPH elif test "$cpu" = "s390" ; then echo "ARCH=s390" >> config.mak - echo "#define HOST_S390 1" >> $TMPH elif test "$cpu" = "alpha" ; then echo "ARCH=alpha" >> config.mak - echo "#define HOST_ALPHA 1" >> $TMPH else echo "Unsupported CPU" exit 1