dnl
-dnl The autoconf 1.107 version of this doesn't substitute variables
-dnl in the names of the links or their targets. This is a problem...
-dnl
-undefine([AC_OUTPUT_LINKS])dnl
-define(AC_OUTPUT_LINKS,
-[EOF
-
-cat >> ${CONFIG_STATUS} <<EOF
-ac_links="$1"
-ac_files="$2"
-EOF
-
-cat >> ${CONFIG_STATUS} <<\EOF
-while test -n "${ac_files}"; do
- set ${ac_links}; ac_link=[$]1; shift; ac_links=[$]*
- set ${ac_files}; ac_file=[$]1; shift; ac_files=[$]*
-
- echo "linking ${ac_link} to ${srcdir}/${ac_file}"
-
- if test ! -r ${srcdir}/${ac_file}; then
- AC_MSG_ERROR(${srcdir}/${ac_file}: File not found)
- fi
- rm -f ${ac_link}
- # Make a symlink if possible; otherwise try a hard link.
- if ln -s ${srcdir}/${ac_file} ${ac_link} 2>/dev/null ||
- ln ${srcdir}/${ac_file} ${ac_link}; then :
- else
- AC_MSG_ERROR(can not link ${ac_link} to ${srcdir}/${ac_file})
- fi
-done
-])dnl
-dnl
dnl This ugly hack is needed because the Cygnus configure script won't
dnl tell us what CC is going to be, and "cc" isn't always right. (The
dnl top-level Makefile will always override anything we choose here, so
dnl It knows where it is in the tree; don't try using it elsewhere.
dnl
undefine([AC_PROG_CC])dnl
-define(AC_PROG_CC,
+AC_DEFUN(AC_PROG_CC,
[AC_BEFORE([$0], [AC_PROG_CPP])dnl
-AC_PROVIDE([$0])dnl
dnl
dnl The ugly bit...
dnl
fi
rm -f conftest*
])dnl
+dnl
+dnl GAS_CHECK_DECL_NEEDED(name, typedefname, typedef, headers)
+AC_DEFUN(GAS_CHECK_DECL_NEEDED,[
+AC_MSG_CHECKING(whether declaration is required for $1)
+AC_CACHE_VAL(gas_cv_decl_needed_$1,
+AC_TRY_LINK([$4],
+[
+typedef $3;
+$2 x;
+x = ($2) $1;
+], gas_cv_decl_needed_$1=no, gas_cv_decl_needed_$1=yes))dnl
+AC_MSG_RESULT($gas_cv_decl_needed_$1)
+test $gas_cv_decl_needed_$1 = no || {
+ ifelse(index($1,[$]),-1,
+ [AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]))],
+ [gas_decl_name_upcase=`echo $1 | tr '[a-z]' '[A-Z]'`
+ AC_DEFINE_UNQUOTED(NEED_DECLARATION_$gas_decl_name_upcase)])
+}
+])dnl
+dnl
+dnl Some non-ANSI preprocessors botch requoting inside strings. That's bad
+dnl enough, but on some of those systems, the assert macro relies on requoting
+dnl working properly!
+dnl GAS_WORKING_ASSERT
+AC_DEFUN(GAS_WORKING_ASSERT,
+[AC_MSG_CHECKING([for working assert macro])
+AC_CACHE_VAL(gas_cv_assert_ok,
+AC_TRY_LINK([#include <assert.h>
+#include <stdio.h>], [
+/* check for requoting problems */
+static int a, b, c, d;
+static char *s;
+assert (!strcmp(s, "foo bar baz quux"));
+/* check for newline handling */
+assert (a == b
+ || c == d);
+], gas_cv_assert_ok=yes, gas_cv_assert_ok=no))dnl
+AC_MSG_RESULT($gas_cv_assert_ok)
+test $gas_cv_assert_ok = yes || AC_DEFINE(BROKEN_ASSERT)
+])dnl
+dnl
+dnl GAS_GDBINIT
+dnl Generates a .gdbinit file in the build directory pointing gdb to
+dnl srcdir, if srcdir != PWD.
+AC_DEFUN(GAS_GDBINIT,
+[if test `cd $srcdir;pwd` = `pwd` ; then
+ rm -f .gdbinit
+ cat > .gdbinit << EOF
+dir $srcdir
+dir .
+source $srcdir/.gdbinit
+EOF
+fi
+])dnl