History

a cpu option of the configure script as a method to specify a target cpu

* don't setup a cpu before scanning for --cpu= * --cpu= option sets a 'cpu' variable, not a 'build_cpu', 'build_cpu' was not used anywhere. * if cpu="" and ARCH != "" then cpu=$ARCH else cpu=`uname -m` * replace "Build CPU" with "Target CPU" in the output of the configure script. output this value only when not builing a cross compilers. * remove a HOST_I386, ... defines from a config.h file. thise defines are not used anywhere and cpu is now used to define a target cpu

seyko committed 11 years ago

Commit 149c2a91 parent d9724721 file · +27 −29Browse files

Unified · Split

configure+27−29
@@ -46,8 +46,7 @@ tcc_crtprefix="" · 45 unmodified lines
46tcc_elfinterp=""46tcc_elfinterp=""
47tcc_lddir=47tcc_lddir=
48confvars=48confvars=
49 49cpu=
50cpu=`uname -m`
51 50
52# OS specific51# OS specific
53targetos=`uname -s`52targetos=`uname -s`
@@ -166,7 +165,7 @@ for opt do · 112 unmodified lines
166 ;;165 ;;
167 --extra-libs=*) extralibs=${opt#--extra-libs=}166 --extra-libs=*) extralibs=${opt#--extra-libs=}
168 ;;167 ;;
169 --cpu=*) build_cpu=`echo $opt | cut -d '=' -f 2`168 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
170 ;;169 ;;
171 --enable-gprof) gprof="yes"170 --enable-gprof) gprof="yes"
172 ;;171 ;;
@@ -195,6 +194,13 @@ for opt do · 22 unmodified lines
195 esac194 esac
196done195done
197 196
197if test -z "$cpu" ; then
198 if test -n "$ARCH" ; then
199 cpu="$ARCH"
200 else
201 cpu=`uname -m`
202 fi
203fi
198classify_cpu "$cpu"204classify_cpu "$cpu"
199 205
200# Checking for CFLAGS206# Checking for CFLAGS
@@ -357,24 +363,24 @@ else · 156 unmodified lines
357 esac363 esac
358fi364fi
359 365
360cat <<EOF366echo "Binary directory $bindir"
361Binary directory $bindir367echo "TinyCC directory $tccdir"
362TinyCC directory $tccdir368echo "Library directory $libdir"
363Library directory $libdir369echo "Include directory $includedir"
364Include directory $includedir370echo "Manual directory $mandir"
365Manual directory $mandir371echo "Info directory $infodir"
366Info directory $infodir372echo "Doc directory $docdir"
367Doc directory $docdir373echo "Target root prefix $sysroot"
368Target root prefix $sysroot374echo "Source path $source_path"
369Source path $source_path375echo "C compiler $cc"
370C compiler $cc376echo "cross compilers $build_cross"
371Build CPU $cpu377if test "$build_cross" = "no"; then
372Target OS $targetos378echo "Target CPU $cpu"
373Big Endian $bigendian379fi
374gprof enabled $gprof380echo "Target OS $targetos"
375cross compilers $build_cross381echo "Big Endian $bigendian"
376use libgcc $use_libgcc382echo "gprof enabled $gprof"
377EOF383echo "use libgcc $use_libgcc"
378 384
379echo "Creating config.mak and config.h"385echo "Creating config.mak and config.h"
380 386
@@ -430,29 +436,21 @@ echo "#define GCC_MINOR $gcc_minor" >> $TMPH · 49 unmodified lines
430 436
431if test "$cpu" = "x86" ; then437if test "$cpu" = "x86" ; then
432 echo "ARCH=i386" >> config.mak438 echo "ARCH=i386" >> config.mak
433 echo "#define HOST_I386 1" >> $TMPH
434elif test "$cpu" = "x86-64" ; then439elif test "$cpu" = "x86-64" ; then
435 echo "ARCH=x86-64" >> config.mak440 echo "ARCH=x86-64" >> config.mak
436 echo "#define HOST_X86_64 1" >> $TMPH
437elif test "$cpu" = "armv4l" ; then441elif test "$cpu" = "armv4l" ; then
438 echo "ARCH=arm" >> config.mak442 echo "ARCH=arm" >> config.mak
439 echo "#define HOST_ARM 1" >> $TMPH
440 echo "#define TCC_ARM_VERSION $cpuver" >> $TMPH443 echo "#define TCC_ARM_VERSION $cpuver" >> $TMPH
441elif test "$cpu" = "aarch64" ; then444elif test "$cpu" = "aarch64" ; then
442 echo "ARCH=arm64" >> config.mak445 echo "ARCH=arm64" >> config.mak
443 echo "#define HOST_ARM64 1" >> $TMPH
444elif test "$cpu" = "powerpc" ; then446elif test "$cpu" = "powerpc" ; then
445 echo "ARCH=ppc" >> config.mak447 echo "ARCH=ppc" >> config.mak
446 echo "#define HOST_PPC 1" >> $TMPH
447elif test "$cpu" = "mips" ; then448elif test "$cpu" = "mips" ; then
448 echo "ARCH=mips" >> config.mak449 echo "ARCH=mips" >> config.mak
449 echo "#define HOST_MIPS 1" >> $TMPH
450elif test "$cpu" = "s390" ; then450elif test "$cpu" = "s390" ; then
451 echo "ARCH=s390" >> config.mak451 echo "ARCH=s390" >> config.mak
452 echo "#define HOST_S390 1" >> $TMPH
453elif test "$cpu" = "alpha" ; then452elif test "$cpu" = "alpha" ; then
454 echo "ARCH=alpha" >> config.mak453 echo "ARCH=alpha" >> config.mak
455 echo "#define HOST_ALPHA 1" >> $TMPH
456else454else
457 echo "Unsupported CPU"455 echo "Unsupported CPU"
458 exit 1456 exit 1