* 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
Unified · Split
| @@ -46,8 +46,7 @@ tcc_crtprefix="" · 45 unmodified lines | ||
| 46 | 46 | tcc_elfinterp="" |
| 47 | 47 | tcc_lddir= |
| 48 | 48 | confvars= |
| 49 | − | |
| 50 | −cpu=`uname -m` | |
| 49 | +cpu= | |
| 51 | 50 | |
| 52 | 51 | # OS specific |
| 53 | 52 | targetos=`uname -s` |
| @@ -166,7 +165,7 @@ for opt do · 112 unmodified lines | ||
| 166 | 165 | ;; |
| 167 | 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 | 170 | --enable-gprof) gprof="yes" |
| 172 | 171 | ;; |
| @@ -195,6 +194,13 @@ for opt do · 22 unmodified lines | ||
| 195 | 194 | esac |
| 196 | 195 | done |
| 197 | 196 | |
| 197 | +if test -z "$cpu" ; then | |
| 198 | + if test -n "$ARCH" ; then | |
| 199 | + cpu="$ARCH" | |
| 200 | + else | |
| 201 | + cpu=`uname -m` | |
| 202 | + fi | |
| 203 | +fi | |
| 198 | 204 | classify_cpu "$cpu" |
| 199 | 205 | |
| 200 | 206 | # Checking for CFLAGS |
| @@ -357,24 +363,24 @@ else · 156 unmodified lines | ||
| 357 | 363 | esac |
| 358 | 364 | fi |
| 359 | 365 | |
| 360 | −cat <<EOF | |
| 361 | −Binary directory $bindir | |
| 362 | −TinyCC directory $tccdir | |
| 363 | −Library directory $libdir | |
| 364 | −Include directory $includedir | |
| 365 | −Manual directory $mandir | |
| 366 | −Info directory $infodir | |
| 367 | −Doc directory $docdir | |
| 368 | −Target root prefix $sysroot | |
| 369 | −Source path $source_path | |
| 370 | −C compiler $cc | |
| 371 | −Build CPU $cpu | |
| 372 | −Target OS $targetos | |
| 373 | −Big Endian $bigendian | |
| 374 | −gprof enabled $gprof | |
| 375 | −cross compilers $build_cross | |
| 376 | −use libgcc $use_libgcc | |
| 377 | −EOF | |
| 366 | +echo "Binary directory $bindir" | |
| 367 | +echo "TinyCC directory $tccdir" | |
| 368 | +echo "Library directory $libdir" | |
| 369 | +echo "Include directory $includedir" | |
| 370 | +echo "Manual directory $mandir" | |
| 371 | +echo "Info directory $infodir" | |
| 372 | +echo "Doc directory $docdir" | |
| 373 | +echo "Target root prefix $sysroot" | |
| 374 | +echo "Source path $source_path" | |
| 375 | +echo "C compiler $cc" | |
| 376 | +echo "cross compilers $build_cross" | |
| 377 | +if test "$build_cross" = "no"; then | |
| 378 | +echo "Target CPU $cpu" | |
| 379 | +fi | |
| 380 | +echo "Target OS $targetos" | |
| 381 | +echo "Big Endian $bigendian" | |
| 382 | +echo "gprof enabled $gprof" | |
| 383 | +echo "use libgcc $use_libgcc" | |
| 378 | 384 | |
| 379 | 385 | echo "Creating config.mak and config.h" |
| 380 | 386 | |
| @@ -430,29 +436,21 @@ echo "#define GCC_MINOR $gcc_minor" >> $TMPH · 49 unmodified lines | ||
| 430 | 436 | |
| 431 | 437 | if test "$cpu" = "x86" ; then |
| 432 | 438 | echo "ARCH=i386" >> config.mak |
| 433 | − echo "#define HOST_I386 1" >> $TMPH | |
| 434 | 439 | elif test "$cpu" = "x86-64" ; then |
| 435 | 440 | echo "ARCH=x86-64" >> config.mak |
| 436 | − echo "#define HOST_X86_64 1" >> $TMPH | |
| 437 | 441 | elif test "$cpu" = "armv4l" ; then |
| 438 | 442 | echo "ARCH=arm" >> config.mak |
| 439 | − echo "#define HOST_ARM 1" >> $TMPH | |
| 440 | 443 | echo "#define TCC_ARM_VERSION $cpuver" >> $TMPH |
| 441 | 444 | elif test "$cpu" = "aarch64" ; then |
| 442 | 445 | echo "ARCH=arm64" >> config.mak |
| 443 | − echo "#define HOST_ARM64 1" >> $TMPH | |
| 444 | 446 | elif test "$cpu" = "powerpc" ; then |
| 445 | 447 | echo "ARCH=ppc" >> config.mak |
| 446 | − echo "#define HOST_PPC 1" >> $TMPH | |
| 447 | 448 | elif test "$cpu" = "mips" ; then |
| 448 | 449 | echo "ARCH=mips" >> config.mak |
| 449 | − echo "#define HOST_MIPS 1" >> $TMPH | |
| 450 | 450 | elif test "$cpu" = "s390" ; then |
| 451 | 451 | echo "ARCH=s390" >> config.mak |
| 452 | − echo "#define HOST_S390 1" >> $TMPH | |
| 453 | 452 | elif test "$cpu" = "alpha" ; then |
| 454 | 453 | echo "ARCH=alpha" >> config.mak |
| 455 | − echo "#define HOST_ALPHA 1" >> $TMPH | |
| 456 | 454 | else |
| 457 | 455 | echo "Unsupported CPU" |
| 458 | 456 | exit 1 |