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