comparison configure @ 30883:e5a2be988dfa

Introduce mak_enable function to set variables in config.mak. This avoids manually setting target architecture and CPU extensions.
author diego
date Wed, 17 Mar 2010 14:41:32 +0000
parents a5c190c3ce4d
children c9e9b7abdb20
comparison
equal deleted inserted replaced
30882:a5c190c3ce4d 30883:e5a2be988dfa
1769 subarch_all='X86_32 X86_64 PPC64' 1769 subarch_all='X86_32 X86_64 PPC64'
1770 case "$host_arch" in 1770 case "$host_arch" in
1771 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) 1771 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1772 arch='x86' 1772 arch='x86'
1773 subarch='x86_32' 1773 subarch='x86_32'
1774 target_arch="ARCH_X86 = yes"
1775 target_subarch="ARCH_X86_32 = yes"
1776 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1' 1774 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1777 def_local_aligned_8='#define HAVE_LOCAL_ALIGNED_8 1' 1775 def_local_aligned_8='#define HAVE_LOCAL_ALIGNED_8 1'
1778 def_local_aligned_16='#define HAVE_LOCAL_ALIGNED_16 1' 1776 def_local_aligned_16='#define HAVE_LOCAL_ALIGNED_16 1'
1779 iproc=486 1777 iproc=486
1780 proc=i486 1778 proc=i486
2010 echores "$proc" 2008 echores "$proc"
2011 ;; 2009 ;;
2012 2010
2013 ia64) 2011 ia64)
2014 arch='ia64' 2012 arch='ia64'
2015 target_arch='ARCH_IA64 = yes'
2016 def_fast_64bit='#define HAVE_FAST_64BIT 1' 2013 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2017 iproc='ia64' 2014 iproc='ia64'
2018 ;; 2015 ;;
2019 2016
2020 x86_64|amd64) 2017 x86_64|amd64)
2021 arch='x86' 2018 arch='x86'
2022 subarch='x86_64' 2019 subarch='x86_64'
2023 target_subarch='ARCH_X86_64 = yes'
2024 target_arch="ARCH_X86 = yes"
2025 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1' 2020 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2026 def_fast_64bit='#define HAVE_FAST_64BIT 1' 2021 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2027 iproc='x86_64' 2022 iproc='x86_64'
2028 2023
2029 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead 2024 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
2113 echores "$proc" 2108 echores "$proc"
2114 ;; 2109 ;;
2115 2110
2116 sparc|sparc64) 2111 sparc|sparc64)
2117 arch='sparc' 2112 arch='sparc'
2118 target_arch='ARCH_SPARC = yes'
2119 iproc='sparc' 2113 iproc='sparc'
2120 if test "$host_arch" = "sparc64" ; then 2114 if test "$host_arch" = "sparc64" ; then
2121 _vis='yes' 2115 _vis='yes'
2122 proc='ultrasparc' 2116 proc='ultrasparc'
2123 def_fast_64bit='#define HAVE_FAST_64BIT 1' 2117 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2141 _optimizing="$proc" 2135 _optimizing="$proc"
2142 ;; 2136 ;;
2143 2137
2144 arm*) 2138 arm*)
2145 arch='arm' 2139 arch='arm'
2146 target_arch='ARCH_ARM = yes'
2147 iproc='arm' 2140 iproc='arm'
2148 ;; 2141 ;;
2149 2142
2150 avr32) 2143 avr32)
2151 arch='avr32' 2144 arch='avr32'
2152 target_arch='ARCH_AVR32 = yes'
2153 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1' 2145 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2154 iproc='avr32' 2146 iproc='avr32'
2155 test $_fast_clz = "auto" && _fast_clz=yes 2147 test $_fast_clz = "auto" && _fast_clz=yes
2156 ;; 2148 ;;
2157 2149
2158 sh|sh4) 2150 sh|sh4)
2159 arch='sh4' 2151 arch='sh4'
2160 target_arch='ARCH_SH4 = yes'
2161 iproc='sh4' 2152 iproc='sh4'
2162 ;; 2153 ;;
2163 2154
2164 ppc|ppc64|powerpc|powerpc64) 2155 ppc|ppc64|powerpc|powerpc64)
2165 arch='ppc' 2156 arch='ppc'
2166 def_dcbzl='#define HAVE_DCBZL 0' 2157 def_dcbzl='#define HAVE_DCBZL 0'
2167 target_arch='ARCH_PPC = yes'
2168 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1' 2158 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2169 def_local_aligned_8='#define HAVE_LOCAL_ALIGNED_8 1' 2159 def_local_aligned_8='#define HAVE_LOCAL_ALIGNED_8 1'
2170 def_local_aligned_16='#define HAVE_LOCAL_ALIGNED_16 1' 2160 def_local_aligned_16='#define HAVE_LOCAL_ALIGNED_16 1'
2171 iproc='ppc' 2161 iproc='ppc'
2172 2162
2173 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then 2163 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
2174 subarch='ppc64' 2164 subarch='ppc64'
2175 target_subarch='ARCH_PPC64 = yes'
2176 def_fast_64bit='#define HAVE_FAST_64BIT 1' 2165 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2177 fi 2166 fi
2178 echocheck "CPU type" 2167 echocheck "CPU type"
2179 case $system_name in 2168 case $system_name in
2180 Linux) 2169 Linux)
2279 2268
2280 ;; 2269 ;;
2281 2270
2282 alpha*) 2271 alpha*)
2283 arch='alpha' 2272 arch='alpha'
2284 target_arch='ARCH_ALPHA = yes'
2285 iproc='alpha' 2273 iproc='alpha'
2286 2274
2287 echocheck "CPU type" 2275 echocheck "CPU type"
2288 cat > $TMPC << EOF 2276 cat > $TMPC << EOF
2289 int main(void) { 2277 int main(void) {
2322 _optimizing="$proc" 2310 _optimizing="$proc"
2323 ;; 2311 ;;
2324 2312
2325 mips) 2313 mips)
2326 arch='mips' 2314 arch='mips'
2327 target_arch='ARCH_MIPS = yes'
2328 iproc='mips' 2315 iproc='mips'
2329 2316
2330 if irix ; then 2317 if irix ; then
2331 echocheck "CPU type" 2318 echocheck "CPU type"
2332 proc=$(hinv -c processor | grep CPU | cut -d " " -f3) 2319 proc=$(hinv -c processor | grep CPU | cut -d " " -f3)
2349 2336
2350 ;; 2337 ;;
2351 2338
2352 hppa) 2339 hppa)
2353 arch='pa_risc' 2340 arch='pa_risc'
2354 target_arch='ARCH_PA_RISC = yes'
2355 iproc='PA-RISC' 2341 iproc='PA-RISC'
2356 ;; 2342 ;;
2357 2343
2358 s390) 2344 s390)
2359 arch='s390' 2345 arch='s390'
2360 target_arch='ARCH_S390 = yes'
2361 iproc='390' 2346 iproc='390'
2362 ;; 2347 ;;
2363 2348
2364 s390x) 2349 s390x)
2365 arch='s390x' 2350 arch='s390x'
2366 target_arch='ARCH_S390X = yes'
2367 iproc='390x' 2351 iproc='390x'
2368 ;; 2352 ;;
2369 2353
2370 vax) 2354 vax)
2371 arch='vax' 2355 arch='vax'
2372 target_arch='ARCH_VAX = yes'
2373 iproc='vax' 2356 iproc='vax'
2374 ;; 2357 ;;
2375 2358
2376 xtensa) 2359 xtensa)
2377 arch='xtensa' 2360 arch='xtensa'
2378 target_arch='ARCH_XTENSA = yes'
2379 iproc='xtensa' 2361 iproc='xtensa'
2380 ;; 2362 ;;
2381 2363
2382 generic) 2364 generic)
2383 arch='generic' 2365 arch='generic'
2384 target_arch='ARCH_GENERIC = yes'
2385 ;; 2366 ;;
2386 2367
2387 *) 2368 *)
2388 echo "The architecture of your CPU ($host_arch) is not supported by this configure script" 2369 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2389 echo "It seems nobody has ported MPlayer to your OS or CPU type yet." 2370 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
8424 echores "$_dvdnav" 8405 echores "$_dvdnav"
8425 8406
8426 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check). 8407 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
8427 # Read dvdnav comment above. 8408 # Read dvdnav comment above.
8428 8409
8410 mak_enable () {
8411 list=$(echo $1 | tr '[a-z]' '[A-Z]')
8412 item=$(echo $2 | tr '[a-z]' '[A-Z]')
8413 nprefix=$3;
8414 for part in $list; do
8415 if $(echo $item | grep -q -E "(^| )$part($| )"); then
8416 echo "${nprefix}_$part = yes"
8417 fi
8418 done
8419 }
8420
8429 ############################################################################# 8421 #############################################################################
8430 echo "Creating config.mak" 8422 echo "Creating config.mak"
8431 cat > config.mak << EOF 8423 cat > config.mak << EOF
8432 # -------- Generated by configure ----------- 8424 # -------- Generated by configure -----------
8433 8425
8490 8482
8491 EXESUF = $_exesuf 8483 EXESUF = $_exesuf
8492 EXESUFS_ALL = .exe 8484 EXESUFS_ALL = .exe
8493 8485
8494 ARCH = $arch 8486 ARCH = $arch
8495 $target_arch 8487 $(mak_enable "$arch_all" "$arch" ARCH)
8496 $target_subarch 8488 $(mak_enable "$subarch_all" "$subarch" ARCH)
8497 $(echo $cpuexts | tr '[a-z] ' '[A-Z]\n' | sed 's/^/HAVE_/;s/$/=yes/') 8489 $(mak_enable "$cpuexts_all" "$cpuexts" HAVE)
8498 8490
8499 MENCODER = $_mencoder 8491 MENCODER = $_mencoder
8500 MPLAYER = $_mplayer 8492 MPLAYER = $_mplayer
8501 8493
8502 NEED_GETTIMEOFDAY = $_need_gettimeofday 8494 NEED_GETTIMEOFDAY = $_need_gettimeofday