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
4646 tcc_elfinterp=""
4747 tcc_lddir=
4848 confvars=
49−
50−cpu=`uname -m`
49+cpu=
5150
5251 # OS specific
5352 targetos=`uname -s`
@@ -166,7 +165,7 @@ for opt do · 112 unmodified lines
166165 ;;
167166 --extra-libs=*) extralibs=${opt#--extra-libs=}
168167 ;;
169− --cpu=*) build_cpu=`echo $opt | cut -d '=' -f 2`
168+ --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
170169 ;;
171170 --enable-gprof) gprof="yes"
172171 ;;
@@ -195,6 +194,13 @@ for opt do · 22 unmodified lines
195194 esac
196195 done
197196
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
198204 classify_cpu "$cpu"
199205
200206 # Checking for CFLAGS
@@ -357,24 +363,24 @@ else · 156 unmodified lines
357363 esac
358364 fi
359365
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"
378384
379385 echo "Creating config.mak and config.h"
380386
@@ -430,29 +436,21 @@ echo "#define GCC_MINOR $gcc_minor" >> $TMPH · 49 unmodified lines
430436
431437 if test "$cpu" = "x86" ; then
432438 echo "ARCH=i386" >> config.mak
433− echo "#define HOST_I386 1" >> $TMPH
434439 elif test "$cpu" = "x86-64" ; then
435440 echo "ARCH=x86-64" >> config.mak
436− echo "#define HOST_X86_64 1" >> $TMPH
437441 elif test "$cpu" = "armv4l" ; then
438442 echo "ARCH=arm" >> config.mak
439− echo "#define HOST_ARM 1" >> $TMPH
440443 echo "#define TCC_ARM_VERSION $cpuver" >> $TMPH
441444 elif test "$cpu" = "aarch64" ; then
442445 echo "ARCH=arm64" >> config.mak
443− echo "#define HOST_ARM64 1" >> $TMPH
444446 elif test "$cpu" = "powerpc" ; then
445447 echo "ARCH=ppc" >> config.mak
446− echo "#define HOST_PPC 1" >> $TMPH
447448 elif test "$cpu" = "mips" ; then
448449 echo "ARCH=mips" >> config.mak
449− echo "#define HOST_MIPS 1" >> $TMPH
450450 elif test "$cpu" = "s390" ; then
451451 echo "ARCH=s390" >> config.mak
452− echo "#define HOST_S390 1" >> $TMPH
453452 elif test "$cpu" = "alpha" ; then
454453 echo "ARCH=alpha" >> config.mak
455− echo "#define HOST_ALPHA 1" >> $TMPH
456454 else
457455 echo "Unsupported CPU"
458456 exit 1