]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gas/aclocal.m4
Conversion to autoconf:
[thirdparty/binutils-gdb.git] / gas / aclocal.m4
1 dnl
2 dnl The autoconf 1.107 version of this doesn't substitute variables
3 dnl in the names of the links or their targets. This is a problem...
4 dnl
5 undefine([AC_OUTPUT_LINKS])dnl
6 define(AC_OUTPUT_LINKS,
7 [EOF
8
9 cat >> ${CONFIG_STATUS} <<EOF
10 ac_links="$1"
11 ac_files="$2"
12 EOF
13
14 cat >> ${CONFIG_STATUS} <<\EOF
15 while test -n "${ac_files}"; do
16 set ${ac_links}; ac_link=[$]1; shift; ac_links=[$]*
17 set ${ac_files}; ac_file=[$]1; shift; ac_files=[$]*
18
19 echo "linking ${ac_link} to ${srcdir}/${ac_file}"
20
21 if test ! -r ${srcdir}/${ac_file}; then
22 AC_MSG_ERROR(${srcdir}/${ac_file}: File not found)
23 fi
24 rm -f ${ac_link}
25 # Make a symlink if possible; otherwise try a hard link.
26 if ln -s ${srcdir}/${ac_file} ${ac_link} 2>/dev/null ||
27 ln ${srcdir}/${ac_file} ${ac_link}; then :
28 else
29 AC_MSG_ERROR(can not link ${ac_link} to ${srcdir}/${ac_file})
30 fi
31 done
32 ])dnl
33 dnl
34 dnl This ugly hack is needed because the Cygnus configure script won't
35 dnl tell us what CC is going to be, and "cc" isn't always right. (The
36 dnl top-level Makefile will always override anything we choose here, so
37 dnl the usual gcc/cc selection is useless.)
38 dnl
39 dnl It knows where it is in the tree; don't try using it elsewhere.
40 dnl
41 undefine([AC_PROG_CC])dnl
42 define(AC_PROG_CC,
43 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
44 AC_PROVIDE([$0])dnl
45 dnl
46 dnl The ugly bit...
47 dnl
48 AC_MSG_CHECKING([for CC])
49 dnl Don't bother with cache.
50 test -z "$CC" && CC=`egrep '^CC *=' ../Makefile | tail -1 | sed 's/^CC *= *//'`
51 test -z "$CC" && CC=cc
52 AC_MSG_RESULT(setting CC to $CC)
53 AC_SUBST(CC)
54 dnl
55 dnl
56 # Find out if we are using GNU C, under whatever name.
57 cat > conftest.c <<EOF
58 #ifdef __GNUC__
59 yes
60 #endif
61 EOF
62 ${CC-cc} -E conftest.c > conftest.out 2>&1
63 if egrep yes conftest.out >/dev/null 2>&1; then
64 GCC=yes
65 else
66 GCC=
67 fi
68 rm -f conftest*
69 ])dnl