summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4')
-rw-r--r--m4/decoders.m41
-rw-r--r--m4/gas.m4196
2 files changed, 91 insertions, 106 deletions
diff --git a/m4/decoders.m4 b/m4/decoders.m4
index 5d2a3c37f..dda82f2d9 100644
--- a/m4/decoders.m4
+++ b/m4/decoders.m4
@@ -262,7 +262,6 @@ use internal ffmpeg.
enable_w32dll=no
;;
i?86-* | k?-* | athlon-* | pentium*-)
- CC_PROG_AS
test x"$with_gnu_as" = x"no" && enable_w32dll=no
;;
*)
diff --git a/m4/gas.m4 b/m4/gas.m4
index 923c3f90c..248057abd 100644
--- a/m4/gas.m4
+++ b/m4/gas.m4
@@ -10,111 +10,97 @@ dnl modifications, as long as this notice is preserved.
dnl AC_PROG_AS
dnl ----------
dnl find the pathname to the GNU or non-GNU assembler
-AC_DEFUN([CC_PROG_AS],
-[AC_ARG_WITH([gnu-as],
- [AS_HELP_STRING([--with-gnu-as],
- [assume the C compiler uses GNU as @<:@default=no@:>@])],
- [test "$withval" = no || with_gnu_as=yes],
- [with_gnu_as=no])
-AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-cc_prog=as
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=as gives a path.
- AC_MSG_CHECKING([for as used by $CC])
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=as) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=as) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [[\\/]]* | ?:[[\\/]]*)
- re_direlt='/[[^/]][[^/]]*/\.\./'
- # Canonicalize the pathname of as
- ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
- done
- test -z "$AS" && AS="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=as
- ;;
- *)
- # If it is relative, then search for the first as in PATH.
- with_gnu_as=unknown
- ;;
- esac
-elif test "$with_gnu_as" = yes; then
- AC_MSG_CHECKING([for GNU as])
-else
- AC_MSG_CHECKING([for non-GNU as])
-fi
-AC_CACHE_VAL(cc_cv_path_AS,
-[if test -z "$AS"; then
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_AS="$ac_dir/$ac_prog"
- # Check to see if the program is GNU as. I'd rather use --version,
- # but apparently some variants of GNU as only accept -v.
- # Break only if it was the GNU/non-GNU as that we prefer.
- case `"$cc_cv_path_AS" -v 2>&1 </dev/null` in
- dnl Apple's assembler reports itself as GNU as 1.38;
- dnl but it doesn't provide the functions we need.
- *Apple*)
- test "$with_gnu_as" != yes && break
- ;;
- *GNU* | *'with BFD'*)
- test "$with_gnu_as" != no && break
- ;;
- *)
- test "$with_gnu_as" != yes && break
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
-else
- cc_cv_path_AS="$AS" # Let the user override the test with a path.
-fi])
-AS="$cc_cv_path_AS"
-if test -n "$AS"; then
- AC_MSG_RESULT($AS)
-else
- AC_MSG_RESULT(no)
-fi
-test -z "$AS" && AC_MSG_ERROR([no acceptable as found in \$PATH])
-CC_PROG_AS_GNU
-])
+dnl based on AC_PROG_LD from libtool
+AC_DEFUN([CC_PROG_AS], [
+ AC_REQUIRE([LT_AC_PROG_SED])dnl
+ AC_REQUIRE([AC_PROG_CC])dnl
+ AC_REQUIRE([AM_PROG_AS])dnl
+ AC_REQUIRE([AC_CANONICAL_HOST])dnl
+ AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+
+ AC_ARG_WITH([gnu-as],
+ [AS_HELP_STRING([--with-gnu-as], [assume the C compiler uses GNU as @<:@default=no@:>@])],
+ [test "$withval" = no || with_gnu_as=yes], [with_gnu_as=unknown])
+ if test x"$with_gnu_as" = x"unknown"; then
+ dnl If CCAS is not the same as CC, check to see if it's GCC.
+ if test x"$CCAS" = x"$CC"; then
+ ccas_is_gnu="$GCC"
+ else
+ AC_CACHE_CHECK([whether $CCAS is a GNU compiler], [ac_cv_CCAS_compiler_gnu],
+ [saved_CC="$CC" CC="$CCAS"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[#ifndef __GNUC__
+ choke me
+ #endif]])],
+ [ac_cv_CCAS_compiler_gnu=yes], [ac_cv_CCAS_compiler_gnu=no])
+ CC="$saved_CC"])
+ ccas_is_gnu="$ac_cv_CCAS_compiler_gnu"
+ fi
+ dnl Try to figure out the assembler command. Fallback to as.
+ if test -z "$AS"; then
+ AC_MSG_CHECKING([for as used by $CCAS])
+ if test x"$ccas_is_gnu" != x"yes"; then
+ # Check if gcc -print-prog-name=as gives a path.
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CCAS -print-prog-name=as) 2>&5 | tr -d '\015'`
+ ;;
+ *)
+ ac_prog=`($CCAS -print-prog-name=as) 2>&5`
+ ;;
+ esac
+
+ case "$ac_prog" in
+ # Accept absolute paths.
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the pathname of as
+ ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ AC_MSG_RESULT([$ac_prog])
+ ;;
+ esac
+ fi
+ fi
+ if test x"$ac_prog" = x""; then
+ # If it fails, then pretend we aren't using GCC.
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ ac_prog="$ac_dir/$ac_prog"
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ fi
+ if test x"$ac_prog" = x""; then
+ AC_MSG_RESULT([unknown])
+ else
+ AS="$ac_prog"
+ AC_MSG_RESULT([$AS])
+ fi
+ fi
-dnl AC_PROG_AS_GNU
-dnl --------------
-AC_DEFUN([CC_PROG_AS_GNU],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_CACHE_CHECK([if the assembler ($AS) is GNU as], cc_cv_prog_gnu_as,
-[# I'd rather use --version here, but apparently some GNU as's only accept -v.
-case `$AS -v 2>&1 </dev/null` in
-dnl Apple's assembler reports itself as GNU as 1.38;
-dnl but it doesn't provide the functions we need.
-*Apple*)
- cc_cv_prog_gnu_as=no
- ;;
-*GNU* | *'with BFD'*)
- cc_cv_prog_gnu_as=yes
- ;;
-*)
- cc_cv_prog_gnu_as=no
- ;;
-esac])
-with_gnu_as=$cc_cv_prog_gnu_as
+ test -z "$AS" && AC_MSG_ERROR([no acceptable as found in \$PATH])
+ AC_CACHE_CHECK([if the assembler ($AS) is GNU as], [cc_cv_prog_gnu_as], [
+ # I'd rather use --version here, but apparently some GNU as's only accept -v.
+ case `"$AS" -v 2>&1 </dev/null` in
+ *Apple*)
+ # Apple's assembler reports itself as GNU as 1.38;
+ # but it doesn't provide the functions we need.
+ cc_cv_prog_gnu_as=no
+ ;;
+ *GNU* | *'with BFD'*)
+ cc_cv_prog_gnu_as=yes
+ ;;
+ *)
+ cc_cv_prog_gnu_as=no
+ ;;
+ esac])
+ with_gnu_as="$cc_cv_prog_gnu_as"
])