Browse code

configure: improve GNU as checking

Check for GNU assembler only when asm is enabled. Show a warning for
ppc/altivec only, and fail on ARM.

Originally committed as revision 23964 to svn://svn.ffmpeg.org/ffmpeg/trunk

Måns Rullgård authored on 2010/07/02 11:03:20
Showing 1 changed files
... ...
@@ -1411,6 +1411,7 @@ objformat="elf"
1411 1411
 ranlib="ranlib"
1412 1412
 strip_default="strip"
1413 1413
 yasmexe="yasm"
1414
+nogas=":"
1414 1415
 
1415 1416
 nm_opts='-g'
1416 1417
 
... ...
@@ -2117,7 +2118,7 @@ case $target_os in
2117 2117
         ;;
2118 2118
     darwin)
2119 2119
         enable malloc_aligned
2120
-        as="gas-preprocessor.pl $cc"
2120
+        gas="gas-preprocessor.pl $cc"
2121 2121
         enabled ppc && add_asflags -force_cpusubtype_ALL
2122 2122
         SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR) -Wl,-read_only_relocs,suppress'
2123 2123
         strip="${strip} -x"
... ...
@@ -2309,9 +2310,6 @@ unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
2309 2309
 EOF
2310 2310
 od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
2311 2311
 
2312
-check_asm gnu_as '".macro m n\n\\n:.int 0\n.endm\nm x"' ||
2313
-    warn "GNU assembler not found, install gas-preprocessor"
2314
-
2315 2312
 if enabled alpha; then
2316 2313
 
2317 2314
     check_cflags -mieee
... ...
@@ -2319,6 +2317,7 @@ if enabled alpha; then
2319 2319
 elif enabled arm; then
2320 2320
 
2321 2321
     check_cflags -marm
2322
+    nogas=die
2322 2323
 
2323 2324
     check_ld <<EOF && enable vfp_args
2324 2325
 __asm__ (".eabi_attribute 28, 1");
... ...
@@ -2353,6 +2352,7 @@ elif enabled ppc; then
2353 2353
 
2354 2354
     # AltiVec flags: The FSF version of GCC differs from the Apple version
2355 2355
     if enabled altivec; then
2356
+        nogas=warn
2356 2357
         check_cflags -maltivec -mabi=altivec &&
2357 2358
         { check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } ||
2358 2359
         check_cflags -faltivec
... ...
@@ -2437,6 +2437,12 @@ EOF
2437 2437
 
2438 2438
 fi
2439 2439
 
2440
+if enabled asm; then
2441
+    as=${gas:=$as}
2442
+    check_asm gnu_as '".macro m n\n\\n:.int 0\n.endm\nm x"' ||
2443
+        $nogas "GNU assembler not found, install gas-preprocessor"
2444
+fi
2445
+
2440 2446
 if check_func dlopen; then
2441 2447
     ldl=
2442 2448
 elif check_func dlopen -ldl; then