1 | # Copyright (c) 1995, 1996 Cygnus Support |
---|
2 | # |
---|
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 |
---|
11 | # they apply. |
---|
12 | # |
---|
13 | # Process this file with autoconf to produce a configure script. |
---|
14 | # |
---|
15 | AC_PREREQ(2.59) |
---|
16 | AC_INIT(close.c) |
---|
17 | AC_CONFIG_HEADER(config.h) |
---|
18 | |
---|
19 | if test "${enable_shared}" = "yes" ; then |
---|
20 | echo "Shared libraries not supported for cross compiling, ignored" |
---|
21 | fi |
---|
22 | |
---|
23 | if test "$srcdir" = "." ; then |
---|
24 | if test "${with_target_subdir}" != "." ; then |
---|
25 | libgloss_topdir="${srcdir}/${with_multisrctop}../../.." |
---|
26 | else |
---|
27 | libgloss_topdir="${srcdir}/${with_multisrctop}../.." |
---|
28 | fi |
---|
29 | else |
---|
30 | libgloss_topdir="${srcdir}/../.." |
---|
31 | fi |
---|
32 | AC_CONFIG_AUX_DIR($libgloss_topdir) |
---|
33 | |
---|
34 | AC_CANONICAL_SYSTEM |
---|
35 | AC_ARG_PROGRAM |
---|
36 | |
---|
37 | AC_PROG_INSTALL |
---|
38 | |
---|
39 | AC_DEFINE(HAVE_GNU_LD) |
---|
40 | dnl Make sure syscall names match those being used by newlib |
---|
41 | case "${target}" in |
---|
42 | *-*-cygwin*) |
---|
43 | ;; |
---|
44 | a29k-amd-udi) |
---|
45 | ;; |
---|
46 | aarch64*-*-*) |
---|
47 | ;; |
---|
48 | arc-*-*) |
---|
49 | ;; |
---|
50 | arm*-*-*) |
---|
51 | ;; |
---|
52 | bfin-*-*) |
---|
53 | ;; |
---|
54 | cris-*-* | crisv32-*-*) |
---|
55 | ;; |
---|
56 | d10v*) |
---|
57 | ;; |
---|
58 | h8300*-*-*) |
---|
59 | ;; |
---|
60 | h8500-*-*) |
---|
61 | ;; |
---|
62 | i[3456]86-*-sco*) |
---|
63 | ;; |
---|
64 | lm32-*-*) |
---|
65 | ;; |
---|
66 | m32r-*-*) |
---|
67 | ;; |
---|
68 | mn10?00-*-*) |
---|
69 | ;; |
---|
70 | riscv*-*-*) |
---|
71 | ;; |
---|
72 | powerpcle-*-pe) |
---|
73 | ;; |
---|
74 | sh*-*-*) |
---|
75 | ;; |
---|
76 | sparc-sun-sunos*) |
---|
77 | ;; |
---|
78 | sparc64-*-*) |
---|
79 | ;; |
---|
80 | v850*-*-*) |
---|
81 | ;; |
---|
82 | w65-*-*) |
---|
83 | ;; |
---|
84 | xstormy16-*-*) |
---|
85 | ;; |
---|
86 | z8k-*-*) |
---|
87 | ;; |
---|
88 | *) |
---|
89 | AC_DEFINE(MISSING_SYSCALL_NAMES) |
---|
90 | ;; |
---|
91 | esac |
---|
92 | |
---|
93 | dnl Make sure we know if elf format used |
---|
94 | case "${target}" in |
---|
95 | *-*-elf) |
---|
96 | AC_DEFINE(HAVE_ELF) |
---|
97 | |
---|
98 | AC_CACHE_CHECK([for .previous assembler directive], |
---|
99 | libc_cv_asm_previous_directive, [dnl |
---|
100 | libc_cv_asm_previous_directive=no |
---|
101 | cat > conftest.s <<EOF |
---|
102 | .section foo_section |
---|
103 | .previous |
---|
104 | EOF |
---|
105 | if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AC_FD_CC); then |
---|
106 | libc_cv_asm_previous_directive=yes |
---|
107 | fi |
---|
108 | rm -f conftest*]) |
---|
109 | |
---|
110 | if test "x${libc_cv_asm_previous_directive}" = "xyes"; then |
---|
111 | AC_DEFINE(HAVE_ASM_PREVIOUS_DIRECTIVE) |
---|
112 | fi |
---|
113 | |
---|
114 | AC_CACHE_CHECK([for .popsection assembler directive], |
---|
115 | libc_cv_asm_popsection_directive, [dnl |
---|
116 | libc_cv_asm_popsection_directive=no |
---|
117 | cat > conftest.s <<EOF |
---|
118 | .pushsection foo_section |
---|
119 | .popsection |
---|
120 | EOF |
---|
121 | if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AC_FD_CC); then |
---|
122 | libc_cv_asm_popsection_directive=yes |
---|
123 | fi |
---|
124 | rm -f conftest*]) |
---|
125 | |
---|
126 | if test "x${libc_cv_asm_popsection_directive}" = "xyes"; then |
---|
127 | AC_DEFINE(HAVE_ASM_POPSECTION_DIRECTIVE) |
---|
128 | fi |
---|
129 | |
---|
130 | AC_CACHE_CHECK([for section attributes], |
---|
131 | libc_cv_section_attributes, [dnl |
---|
132 | libc_cv_section_attributes=no |
---|
133 | cat > conftest.c <<EOF |
---|
134 | int secttest __attribute__ ((section (".gnu.warning.secttest"))) = 10; |
---|
135 | int main() {} |
---|
136 | EOF |
---|
137 | if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.c 1>&AC_FD_CC); then |
---|
138 | libc_cv_section_attributes=yes |
---|
139 | fi |
---|
140 | rm -f conftest*]) |
---|
141 | if test "x${libc_cv_section_attributes}" = "xyes"; then |
---|
142 | AC_DEFINE(HAVE_SECTION_ATTRIBUTES) |
---|
143 | fi |
---|
144 | ;; |
---|
145 | esac |
---|
146 | |
---|
147 | AC_CACHE_CHECK([for symbol prefix], libc_cv_symbol_prefix, [dnl |
---|
148 | cat > conftest.c <<\EOF |
---|
149 | foo () { } |
---|
150 | EOF |
---|
151 | dnl |
---|
152 | libc_cv_symbol_prefix=none |
---|
153 | if AC_TRY_COMMAND([${CC-cc} -S conftest.c -o - | fgrep "\$foo" > /dev/null]); |
---|
154 | then |
---|
155 | libc_cv_symbol_prefix='$' |
---|
156 | else |
---|
157 | if AC_TRY_COMMAND([${CC-cc} -S conftest.c -o - | fgrep "_foo" > /dev/null]); |
---|
158 | then |
---|
159 | libc_cv_symbol_prefix=_ |
---|
160 | fi |
---|
161 | fi |
---|
162 | rm -f conftest* ]) |
---|
163 | if test $libc_cv_symbol_prefix != none; then |
---|
164 | AC_DEFINE_UNQUOTED(__SYMBOL_PREFIX, "$libc_cv_symbol_prefix") |
---|
165 | else |
---|
166 | AC_DEFINE(__SYMBOL_PREFIX, "") |
---|
167 | fi |
---|
168 | |
---|
169 | LIB_AC_PROG_CC |
---|
170 | AS=${AS-as} |
---|
171 | AC_SUBST(AS) |
---|
172 | AR=${AR-ar} |
---|
173 | AC_SUBST(AR) |
---|
174 | LD=${LD-ld} |
---|
175 | AC_SUBST(LD) |
---|
176 | AC_PROG_RANLIB |
---|
177 | LIB_AM_PROG_AS |
---|
178 | |
---|
179 | host_makefile_frag=${srcdir}/../config/default.mh |
---|
180 | |
---|
181 | dnl We have to assign the same value to other variables because autoconf |
---|
182 | dnl doesn't provide a mechanism to substitute a replacement keyword with |
---|
183 | dnl arbitrary data or pathnames. |
---|
184 | dnl |
---|
185 | host_makefile_frag_path=$host_makefile_frag |
---|
186 | AC_SUBST(host_makefile_frag_path) |
---|
187 | AC_SUBST_FILE(host_makefile_frag) |
---|
188 | |
---|
189 | AC_CONFIG_FILES(Makefile, |
---|
190 | ac_file=Makefile . ${libgloss_topdir}/config-ml.in, |
---|
191 | srcdir=${srcdir} |
---|
192 | target=${target} |
---|
193 | with_multisubdir=${with_multisubdir} |
---|
194 | ac_configure_args="${ac_configure_args} --enable-multilib" |
---|
195 | CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} |
---|
196 | libgloss_topdir=${libgloss_topdir} |
---|
197 | ) |
---|
198 | AC_OUTPUT |
---|
199 | |
---|
200 | |
---|