1 # Copyright (c) 1995, 1996 Cygnus Support
3 # The authors hereby grant permission to use, copy, modify, distribute,
4 # and license this software and its documentation for any purpose, provided
5 # that existing copyright notices are retained in all copies and that this
6 # notice is included verbatim in any distributions. No written agreement,
7 # license, or royalty fee is required for any of the authorized uses.
8 # Modifications to this software may be copyrighted by their authors
9 # and need not follow the licensing terms described here, provided that
10 # the new terms are clearly indicated on the first page of each file where
13 # Process this file with autoconf to produce a configure script.
17 AC_CONFIG_HEADER(config.h)
19 if test "${enable_shared}" = "yes" ; then
20 echo "Shared libraries not supported for cross compiling, ignored"
23 if test "$srcdir" = "." ; then
24 if test "${with_target_subdir}" != "." ; then
25 libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
27 libgloss_topdir="${srcdir}/${with_multisrctop}../.."
30 libgloss_topdir="${srcdir}/../.."
32 AC_CONFIG_AUX_DIR($libgloss_topdir)
39 # FIXME: We temporarily define our own version of AC_PROG_CC. This is
40 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
41 # are building a library that must be included in all links, so we
42 # can't link an executable until this lib is built.
43 # autoconf should provide a way to do this.
45 AC_DEFUN(LIB_AC_PROG_CC,
46 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
47 AC_CHECK_PROG(CC, gcc, gcc)
48 if test -z "$CC"; then
49 AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
50 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
55 if test $ac_cv_prog_gcc = yes; then
57 dnl Check whether -g works, even if CFLAGS is set, in case the package
58 dnl plays around with CFLAGS (such as to build both debugging and
59 dnl normal versions of a library), tasteless as that idea is.
60 ac_test_CFLAGS="${CFLAGS+set}"
61 ac_save_CFLAGS="$CFLAGS"
64 if test "$ac_test_CFLAGS" = set; then
65 CFLAGS="$ac_save_CFLAGS"
66 elif test $ac_cv_prog_cc_g = yes; then
73 test "${CFLAGS+set}" = set || CFLAGS="-g"
77 AC_DEFINE(HAVE_GNU_LD)
78 dnl Make sure syscall names match those being used by newlib
129 AC_DEFINE(MISSING_SYSCALL_NAMES)
133 dnl Make sure we know if elf format used
138 AC_CACHE_CHECK(for .previous assembler directive,
139 libc_cv_asm_previous_directive, [dnl
140 cat > conftest.s <<EOF
144 if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AC_FD_CC); then
145 AC_DEFINE(HAVE_ASM_PREVIOUS_DIRECTIVE)
149 AC_CACHE_CHECK(for .popsection assembler directive,
150 libc_cv_asm_popsection_directive, [dnl
151 cat > conftest.s <<EOF
152 .pushsection foo_section
155 if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AC_FD_CC); then
156 AC_DEFINE(HAVE_ASM_POPSECTION_DIRECTIVE)
160 AC_CACHE_CHECK(for section attributes,
161 libc_cv_section_attributes, [dnl
162 cat > conftest.c <<EOF
163 int secttest __attribute__ ((section (".gnu.warning.secttest"))) = 10;
166 if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.c 1>&AC_FD_CC); then
167 AC_DEFINE(HAVE_SECTION_ATTRIBUTES)
173 AC_CACHE_CHECK(for function prefix, libc_dollar_prefix, [dnl
174 cat > conftest.c <<\EOF
178 if AC_TRY_COMMAND([${CC-cc} -S conftest.c -o - | fgrep "\$foo" > /dev/null]);
180 libc_dollar_prefix=yes
182 libc_dollar_prefix=no
185 if test $libc_dollar_prefix = yes ; then
186 AC_DEFINE(__SYMBOL_PREFIX, "$")
188 AC_DEFINE(__SYMBOL_PREFIX, "")
200 host_makefile_frag=${srcdir}/../config/default.mh
202 dnl We have to assign the same value to other variables because autoconf
203 dnl doesn't provide a mechanism to substitute a replacement keyword with
204 dnl arbitrary data or pathnames.
206 host_makefile_frag_path=$host_makefile_frag
207 AC_SUBST(host_makefile_frag_path)
208 AC_SUBST_FILE(host_makefile_frag)
211 ac_file=Makefile . ${libgloss_topdir}/config-ml.in,
214 ac_configure_args="${ac_configure_args} --enable-multilib"
215 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
216 libgloss_topdir=${libgloss_topdir}