old-cross-binutils/gas/aclocal.m4

91 lines
2.4 KiB
Text
Raw Normal View History

Conversion to autoconf: * acconfig.h, aclocal.m4: New files. * configure.in: Rewritten (except for some target-specific code) for autoconf. * conf.in, configure: New files, generated from the above. * Makefile.in: Changed magic sequence indicating insertion of makefile fragments. (VPATH, srcdir, CC, LIBS, OBJS dependencies): Use @-substitutions from configure. (LINKED_HEADERS): Deleted a.out.gnu.h, a.out.h, and host.h. (config.status, configure): Rewrite rules. (config-stamp): Depend on conf. Skip variables that configure is now substituting itself. (*.o dependencies): Deleted host.h. (distclean, realclean): Don't delete host.h. * as.c: Don't include stdio.h, string.h, sys/types.h. Include signal.h after as.h. * as.h: Include alloca-conf.h first. Include ctype.h, string.h, strings.h, stdlib.h, unistd.h, sys/types.h, fopen-bin.h, fopen-same.h, as suggested by autoconf test results. [BROKEN_ASSERT]: Don't include assert.h. (strdup): Declare. (volatile, const): Define if not __STDC__ and not already defined. (malloc, realloc) [NEED_MALLOC_DECLARATION]: Declare. (free) [NEED_FREE_DECLARATION]: Declare. * gasp.c: Include config.h, stdlib.h (if HAVE_STDLIB_H). Don't include host.h. (malloc) [NEED_MALLOC_DECLARATION]: Declare. * messages.c: Include as.h first. Include errno.h only if HAVE_ERRNO_H. If HAVE_VARARGS_H and not __STDC__, undefine HAVE_STDARG_H. Set NO_STDARG and NO_VARARGS as appropriate. * doc/Makefile.in (srcdir, INSTALL, INSTALL_PROGRAM, INSTALL_DATA): Use autoconf @-substitutions.
1994-08-28 07:59:06 +00:00
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 the usual gcc/cc selection is useless.)
dnl
dnl It knows where it is in the tree; don't try using it elsewhere.
dnl
undefine([AC_PROG_CC])dnl
AC_DEFUN(AC_PROG_CC,
Conversion to autoconf: * acconfig.h, aclocal.m4: New files. * configure.in: Rewritten (except for some target-specific code) for autoconf. * conf.in, configure: New files, generated from the above. * Makefile.in: Changed magic sequence indicating insertion of makefile fragments. (VPATH, srcdir, CC, LIBS, OBJS dependencies): Use @-substitutions from configure. (LINKED_HEADERS): Deleted a.out.gnu.h, a.out.h, and host.h. (config.status, configure): Rewrite rules. (config-stamp): Depend on conf. Skip variables that configure is now substituting itself. (*.o dependencies): Deleted host.h. (distclean, realclean): Don't delete host.h. * as.c: Don't include stdio.h, string.h, sys/types.h. Include signal.h after as.h. * as.h: Include alloca-conf.h first. Include ctype.h, string.h, strings.h, stdlib.h, unistd.h, sys/types.h, fopen-bin.h, fopen-same.h, as suggested by autoconf test results. [BROKEN_ASSERT]: Don't include assert.h. (strdup): Declare. (volatile, const): Define if not __STDC__ and not already defined. (malloc, realloc) [NEED_MALLOC_DECLARATION]: Declare. (free) [NEED_FREE_DECLARATION]: Declare. * gasp.c: Include config.h, stdlib.h (if HAVE_STDLIB_H). Don't include host.h. (malloc) [NEED_MALLOC_DECLARATION]: Declare. * messages.c: Include as.h first. Include errno.h only if HAVE_ERRNO_H. If HAVE_VARARGS_H and not __STDC__, undefine HAVE_STDARG_H. Set NO_STDARG and NO_VARARGS as appropriate. * doc/Makefile.in (srcdir, INSTALL, INSTALL_PROGRAM, INSTALL_DATA): Use autoconf @-substitutions.
1994-08-28 07:59:06 +00:00
[AC_BEFORE([$0], [AC_PROG_CPP])dnl
dnl
dnl The ugly bit...
dnl
AC_MSG_CHECKING([for CC])
dnl Don't bother with cache.
test -z "$CC" && CC=`egrep '^CC *=' ../Makefile | tail -1 | sed 's/^CC *= *//'`
test -z "$CC" && CC=cc
AC_MSG_RESULT(setting CC to $CC)
AC_SUBST(CC)
dnl
dnl
# Find out if we are using GNU C, under whatever name.
cat > conftest.c <<EOF
#ifdef __GNUC__
yes
#endif
EOF
${CC-cc} -E conftest.c > conftest.out 2>&1
if egrep yes conftest.out >/dev/null 2>&1; then
GCC=yes
else
GCC=
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