History

Make build CPU detection a tad more flexible

Thomas Preud'homme committed 12 years ago

Commit 0e3d2e01 parent 6e56bb31 file · +59 −50Browse files

Unified · Split

configure+59−50
@@ -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"
72fi72fi
73 73
74case "$cpu" in74classify_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" in82 x86_64|amd64)
83 arm|armv4l)83 cpu="x86-64"
84 cpuver=484 ;;
85 ;;85 arm*)
86 armv5tel|armv5tejl)86 case "$cpu" in
87 cpuver=587 arm|armv4l)
88 ;;88 cpuver=4
89 armv6j|armv6l)89 ;;
90 cpuver=690 armv5tel|armv5tejl)
91 ;;91 cpuver=5
92 armv7a|armv7l)92 ;;
93 cpuver=793 armv6j|armv6l)
94 ;;94 cpuver=6
95 esac95 ;;
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"
113esac113 ;;
114 *)
115 echo "Unsupported CPU: $cpu"
116 exit 1
117 ;;
118 esac
119}
114 120
115for opt do121for 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 esac192 esac
187done193done
188 194
195classify_cpu "$cpu"
196
189# Checking for CFLAGS197# Checking for CFLAGS
190if test -z "$CFLAGS"; then198if 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 binaries283 --strip-binaries strip symbol tables from resulting binaries
275 --disable-static make libtcc.so instead of libtcc.a284 --disable-static make libtcc.so instead of libtcc.a
276 --disable-rpath disable use of -rpath with the above285 --disable-rpath disable use of -rpath with the above
@@ -356,8 +365,8 @@ Doc directory $docdir · 79 unmodified lines
356Target root prefix $sysroot365Target root prefix $sysroot
357Source path $source_path366Source path $source_path
358C compiler $cc367C compiler $cc
368Build CPU $cpu
359Target OS $targetos369Target OS $targetos
360CPU $cpu
361Big Endian $bigendian370Big Endian $bigendian
362gprof enabled $gprof371gprof enabled $gprof
363cross compilers $build_cross372cross compilers $build_cross

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t