From 47361c6f2681b09009a4ec07e36149047a99b3b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Thu, 22 Mar 2007 22:34:28 +0000 Subject: Add the gas.m4 macro file, at least :) CVS patchset: 8741 CVS date: 2007/03/22 22:34:28 --- m4/gas.m4 | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 m4/gas.m4 (limited to 'm4') diff --git a/m4/gas.m4 b/m4/gas.m4 new file mode 100644 index 000000000..925c99092 --- /dev/null +++ b/m4/gas.m4 @@ -0,0 +1,120 @@ +dnl Copyright 2007 xine project +dnl Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 +dnl Free Software Foundation, Inc. +dnl Originally by Gordon Matzigkeit , 1996 +dnl +dnl This file is free software; the Free Software Foundation gives +dnl unlimited permission to copy and/or distribute it, with or without +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], + [AC_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([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 &1