Unified · Split
| @@ -71,46 +71,52 @@ if test -z "$source_path" -o "$source_path" = "." ; then · 70 unmodified lines | |||
| 71 | source_path_used="no" | 71 | source_path_used="no" |
| 72 | fi | 72 | fi |
| 73 | 73 | ||
| 74 | case "$cpu" in | 74 | classify_cpu () |
| 75 | i386|i486|i586|i686|i86pc|BePC|i686-AT386) | 75 | { |
| 76 | cpu="x86" | 76 | cpu="$1" |
| 77 | ;; | 77 | |
| 78 | x86_64|amd64) | 78 | case "$cpu" in |
| 79 | cpu="x86-64" | 79 | x86|i386|i486|i586|i686|i86pc|BePC|i686-AT386) |
| 80 | ;; | 80 | cpu="x86" |
| 81 | arm*) | 81 | ;; |
| 82 | case "$cpu" in | 82 | x86_64|amd64) |
| 83 | arm|armv4l) | 83 | cpu="x86-64" |
| 84 | cpuver=4 | 84 | ;; |
| 85 | ;; | 85 | arm*) |
| 86 | armv5tel|armv5tejl) | 86 | case "$cpu" in |
| 87 | cpuver=5 | 87 | arm|armv4l) |
| 88 | ;; | 88 | cpuver=4 |
| 89 | armv6j|armv6l) | 89 | ;; |
| 90 | cpuver=6 | 90 | armv5tel|armv5tejl) |
| 91 | ;; | 91 | cpuver=5 |
| 92 | armv7a|armv7l) | 92 | ;; |
| 93 | cpuver=7 | 93 | armv6j|armv6l) |
| 94 | ;; | 94 | cpuver=6 |
| 95 | esac | 95 | ;; |
| 96 | cpu="armv4l" | 96 | armv7a|armv7l) |
| 97 | ;; | 97 | cpuver=7 |
| 98 | alpha) | 98 | ;; |
| 99 | cpu="alpha" | 99 | esac |
| 100 | ;; | 100 | cpu="armv4l" |
| 101 | "Power Macintosh"|ppc|ppc64) | 101 | ;; |
| 102 | cpu="powerpc" | 102 | alpha) |
| 103 | ;; | 103 | cpu="alpha" |
| 104 | mips) | 104 | ;; |
| 105 | cpu="mips" | 105 | "Power Macintosh"|ppc|ppc64) |
| 106 | ;; | 106 | cpu="powerpc" |
| 107 | s390) | 107 | ;; |
| 108 | cpu="s390" | 108 | mips) |
| 109 | ;; | 109 | cpu="mips" |
| 110 | *) | 110 | ;; |
| 111 | cpu="unknown" | 111 | s390) |
| 112 | ;; | 112 | cpu="s390" |
| 113 | esac | 113 | ;; |
| 114 | *) | ||
| 115 | echo "Unsupported CPU: $cpu" | ||
| 116 | exit 1 | ||
| 117 | ;; | ||
| 118 | esac | ||
| 119 | } | ||
| 114 | 120 | ||
| 115 | for opt do | 121 | for opt do |
| 116 | eval opt=\"$opt\" | 122 | eval opt=\"$opt\" |
| @@ -141,14 +147,6 @@ for opt do · 24 unmodified lines | |||
| 141 | ;; | 147 | ;; |
| 142 | --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2` | 148 | --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2` |
| 143 | ;; | 149 | ;; |
| 144 | --cc=*) cc=`echo $opt | cut -d '=' -f 2` | ||
| 145 | ;; | ||
| 146 | --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}" | ||
| 147 | ;; | ||
| 148 | --extra-ldflags=*) LDFLAGS="${opt#--extra-ldflags=}" | ||
| 149 | ;; | ||
| 150 | --extra-libs=*) extralibs=${opt#--extra-libs=} | ||
| 151 | ;; | ||
| 152 | --sysincludepaths=*) tcc_sysincludepaths=`echo $opt | cut -d '=' -f 2` | 150 | --sysincludepaths=*) tcc_sysincludepaths=`echo $opt | cut -d '=' -f 2` |
| 153 | ;; | 151 | ;; |
| 154 | --libpaths=*) tcc_libpaths=`echo $opt | cut -d '=' -f 2` | 152 | --libpaths=*) tcc_libpaths=`echo $opt | cut -d '=' -f 2` |
| @@ -157,7 +155,15 @@ for opt do · 2 unmodified lines | |||
| 157 | ;; | 155 | ;; |
| 158 | --elfinterp=*) tcc_elfinterp=`echo $opt | cut -d '=' -f 2` | 156 | --elfinterp=*) tcc_elfinterp=`echo $opt | cut -d '=' -f 2` |
| 159 | ;; | 157 | ;; |
| 160 | --cpu=*) cpu=`echo $opt | cut -d '=' -f 2` | 158 | --cc=*) cc=`echo $opt | cut -d '=' -f 2` |
| 159 | ;; | ||
| 160 | --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}" | ||
| 161 | ;; | ||
| 162 | --extra-ldflags=*) LDFLAGS="${opt#--extra-ldflags=}" | ||
| 163 | ;; | ||
| 164 | --extra-libs=*) extralibs=${opt#--extra-libs=} | ||
| 165 | ;; | ||
| 166 | --cpu=*) build_cpu=`echo $opt | cut -d '=' -f 2` | ||
| 161 | ;; | 167 | ;; |
| 162 | --enable-gprof) gprof="yes" | 168 | --enable-gprof) gprof="yes" |
| 163 | ;; | 169 | ;; |
| @@ -186,6 +192,8 @@ for opt do · 22 unmodified lines | |||
| 186 | esac | 192 | esac |
| 187 | done | 193 | done |
| 188 | 194 | ||
| 195 | classify_cpu "$cpu" | ||
| 196 | |||
| 189 | # Checking for CFLAGS | 197 | # Checking for CFLAGS |
| 190 | if test -z "$CFLAGS"; then | 198 | if test -z "$CFLAGS"; then |
| 191 | CFLAGS="-Wall -g -O2" | 199 | CFLAGS="-Wall -g -O2" |
| @@ -271,6 +279,7 @@ Advanced options (experts only): · 79 unmodified lines | |||
| 271 | --cc=CC use C compiler CC [$cc] | 279 | --cc=CC use C compiler CC [$cc] |
| 272 | --extra-cflags= specify compiler flags [$CFLAGS] | 280 | --extra-cflags= specify compiler flags [$CFLAGS] |
| 273 | --extra-ldflags= specify linker options [] | 281 | --extra-ldflags= specify linker options [] |
| 282 | --cpu=CPU CPU [$cpu] | ||
| 274 | --strip-binaries strip symbol tables from resulting binaries | 283 | --strip-binaries strip symbol tables from resulting binaries |
| 275 | --disable-static make libtcc.so instead of libtcc.a | 284 | --disable-static make libtcc.so instead of libtcc.a |
| 276 | --disable-rpath disable use of -rpath with the above | 285 | --disable-rpath disable use of -rpath with the above |
| @@ -356,8 +365,8 @@ Doc directory $docdir · 79 unmodified lines | |||
| 356 | Target root prefix $sysroot | 365 | Target root prefix $sysroot |
| 357 | Source path $source_path | 366 | Source path $source_path |
| 358 | C compiler $cc | 367 | C compiler $cc |
| 368 | Build CPU $cpu | ||
| 359 | Target OS $targetos | 369 | Target OS $targetos |
| 360 | CPU $cpu | ||
| 361 | Big Endian $bigendian | 370 | Big Endian $bigendian |
| 362 | gprof enabled $gprof | 371 | gprof enabled $gprof |
| 363 | cross compilers $build_cross | 372 | cross compilers $build_cross |