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 AC_DEFINE(HAVE_GNU_LD)
40 dnl Make sure syscall names match those being used by newlib
54 cris-*-* | crisv32-*-*)
93 AC_DEFINE(MISSING_SYSCALL_NAMES)
97 dnl Make sure we know if elf format used
102 AC_CACHE_CHECK([for .previous assembler directive],
103 libc_cv_asm_previous_directive, [dnl
104 libc_cv_asm_previous_directive=no
105 cat > conftest.s <<EOF
109 if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AC_FD_CC); then
110 libc_cv_asm_previous_directive=yes
114 if test "x${libc_cv_asm_previous_directive}" = "xyes"; then
115 AC_DEFINE(HAVE_ASM_PREVIOUS_DIRECTIVE)
118 AC_CACHE_CHECK([for .popsection assembler directive],
119 libc_cv_asm_popsection_directive, [dnl
120 libc_cv_asm_popsection_directive=no
121 cat > conftest.s <<EOF
122 .pushsection foo_section
125 if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AC_FD_CC); then
126 libc_cv_asm_popsection_directive=yes
130 if test "x${libc_cv_asm_popsection_directive}" = "xyes"; then
131 AC_DEFINE(HAVE_ASM_POPSECTION_DIRECTIVE)
134 AC_CACHE_CHECK([for section attributes],
135 libc_cv_section_attributes, [dnl
136 libc_cv_section_attributes=no
137 cat > conftest.c <<EOF
138 int secttest __attribute__ ((section (".gnu.warning.secttest"))) = 10;
141 if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.c 1>&AC_FD_CC); then
142 libc_cv_section_attributes=yes
145 if test "x${libc_cv_section_attributes}" = "xyes"; then
146 AC_DEFINE(HAVE_SECTION_ATTRIBUTES)
151 AC_CACHE_CHECK([for symbol prefix], libc_symbol_prefix, [dnl
152 cat > conftest.c <<\EOF
156 libc_symbol_prefix=none
157 if AC_TRY_COMMAND([${CC-cc} -S conftest.c -o - | fgrep "\$foo" > /dev/null]);
159 libc_symbol_prefix='$'
161 if AC_TRY_COMMAND([${CC-cc} -S conftest.c -o - | fgrep "_foo" > /dev/null]);
167 if test $libc_symbol_prefix != none; then
168 AC_DEFINE_UNQUOTED(__SYMBOL_PREFIX, "$libc_symbol_prefix")
170 AC_DEFINE(__SYMBOL_PREFIX, "")
183 host_makefile_frag=${srcdir}/../config/default.mh
185 dnl We have to assign the same value to other variables because autoconf
186 dnl doesn't provide a mechanism to substitute a replacement keyword with
187 dnl arbitrary data or pathnames.
189 host_makefile_frag_path=$host_makefile_frag
190 AC_SUBST(host_makefile_frag_path)
191 AC_SUBST_FILE(host_makefile_frag)
193 AC_CONFIG_FILES(Makefile,
194 ac_file=Makefile . ${libgloss_topdir}/config-ml.in,
197 with_multisubdir=${with_multisubdir}
198 ac_configure_args="${ac_configure_args} --enable-multilib"
199 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
200 libgloss_topdir=${libgloss_topdir}