]>
Commit | Line | Data |
---|---|---|
f7934be8 RM |
1 | dnl We require that everyone use exactly the same Autoconf version so that |
2 | dnl the internal functions defined and used by the main configure script | |
2626c183 JM |
3 | dnl match those expected by the fragments. When changing this version, |
4 | dnl install.texi also needs to be updated. | |
f4a58f0d | 5 | m4_define([GLIBC_AUTOCONF_VERSION], [2.69]) |
f7934be8 RM |
6 | m4_if(m4_defn([AC_AUTOCONF_VERSION]), GLIBC_AUTOCONF_VERSION, [], |
7 | [m4_fatal(m4_flatten( | |
8 | Exactly version GLIBC_AUTOCONF_VERSION of Autoconf is required but you have | |
9 | m4_defn([AC_AUTOCONF_VERSION]) | |
10 | ), [63])])dnl | |
11 | dnl | |
28f540f4 | 12 | dnl We define the macro GLIBC_PROVIDES to do an AC_PROVIDE for each macro |
cb8a6dbd MF |
13 | dnl which appears in configure.ac before the sysdep configure scripts are run. |
14 | dnl Each sysdep configure.ac does GLIBC_PROVIDES first, to avoid any | |
28f540f4 RM |
15 | dnl AC_REQUIREs or AC_BEFOREs duplicating their code. |
16 | dnl | |
3a12e572 | 17 | define([GLIBC_PROVIDES], [dnl |
9632aaee | 18 | AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl |
7967983f | 19 | AC_PROVIDE([AC_CONFIG_SUBDIRS])dnl |
b9cb349f | 20 | AC_PROVIDE([_AS_ECHO_N_PREPARE])dnl |
7967983f | 21 | AC_PROVIDE([_AS_ECHO_PREPARE])dnl |
2d37ce0f RM |
22 | AC_PROVIDE([_AS_CR_PREPARE])dnl |
23 | AC_PROVIDE([_AS_TR_SH_PREPARE])dnl | |
b8493de0 | 24 | AC_PROVIDE([_AS_VAR_ARITH_PREPARE])dnl |
28f540f4 | 25 | AC_PROVIDE([AC_PROG_INSTALL])dnl |
28f540f4 RM |
26 | AC_PROVIDE([AC_PROG_CC])dnl |
27 | AC_PROVIDE([AC_PROG_CPP])dnl | |
45fba3df RM |
28 | AC_PROVIDE([_AS_PATH_SEPARATOR_PREPARE])dnl |
29 | AC_PROVIDE([_AS_TEST_PREPARE])dnl | |
b8493de0 RM |
30 | AC_PROVIDE([_AS_BASENAME_PREPARE])dnl |
31 | AC_PROVIDE([_AS_ME_PREPARE])dnl | |
32 | AC_PROVIDE([_AS_LINENO_PREPARE])dnl | |
33 | AC_PROVIDE([AS_SHELL_FN_as_fn_set_status])dnl | |
34 | AC_PROVIDE([AS_SHELL_FN_as_fn_exit])dnl | |
35 | AC_PROVIDE([AS_SHELL_FN_as_fn_arith])dnl | |
36 | AC_PROVIDE([AS_SHELL_FN_ac_fn_c_try_compile])dnl | |
3a12e572 UD |
37 | define([AS_MESSAGE_LOG_FD],5)dnl |
38 | define([AS_MESSAGE_FD],6)dnl | |
52a0d149 RM |
39 | dnl Ripped out of AS_INIT, which does more cruft we do not want. |
40 | m4_wrap([m4_divert_pop([BODY])[]]) | |
41 | m4_divert_push([BODY])[]dnl | |
42 | dnl End of ripped out of AS_INIT. | |
cb8a6dbd | 43 | # This file is generated from configure.ac by Autoconf. DO NOT EDIT! |
b9cb349f | 44 | define([_AC_LANG], [C])dnl |
28f540f4 RM |
45 | ])dnl |
46 | dnl | |
47 | dnl Check for a symbol | |
48 | dnl | |
3a12e572 | 49 | AC_DEFUN([AC_CHECK_SYMBOL], [dnl |
28f540f4 RM |
50 | AC_MSG_CHECKING(for $1) |
51 | AC_CACHE_VAL(ac_cv_check_symbol_$1, [dnl | |
7cfb2d8b | 52 | AC_TRY_LINK(, |
28f540f4 RM |
53 | changequote(,)dnl |
54 | extern char *$1[]; puts(*$1);, | |
55 | changequote([,])dnl | |
56 | ac_cv_check_symbol_$1=yes, ac_cv_check_symbol_$1=no)]) | |
57 | if test "$ac_cv_check_symbol_$1" = yes; then | |
58 | changequote(,)dnl | |
59 | ac_tr_symbol=`echo $1 | tr '[a-z]' '[A-Z]'` | |
60 | changequote([,])dnl | |
61 | AC_DEFINE_UNQUOTED(HAVE_${ac_tr_symbol}) | |
62 | fi | |
63 | AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl | |
64 | dnl | |
ebbad4cc | 65 | |
63bda0c1 UD |
66 | dnl Locate a program and check that its version is acceptable. |
67 | dnl AC_PROG_CHECK_VER(var, namelist, version-switch, | |
4bca4c17 | 68 | dnl [version-extract-regexp], version-glob [, do-if-fail]) |
3a12e572 | 69 | AC_DEFUN([AC_CHECK_PROG_VER], |
4bca4c17 UD |
70 | [AC_CHECK_PROGS([$1], [$2]) |
71 | if test -z "[$]$1"; then | |
72 | ac_verc_fail=yes | |
63bda0c1 | 73 | else |
4bca4c17 UD |
74 | # Found it, now check the version. |
75 | AC_MSG_CHECKING([version of [$]$1]) | |
63bda0c1 | 76 | changequote(<<,>>)dnl |
4bca4c17 | 77 | ac_prog_version=`<<$>>$1 $3 2>&1 ifelse(<<$4>>,,, |
e9433893 | 78 | <<| sed -n 's/^.*patsubst(<<$4>>,/,\/).*$/\1/p'>>)` |
4bca4c17 UD |
79 | case $ac_prog_version in |
80 | '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; | |
81 | <<$5>>) | |
63bda0c1 | 82 | changequote([,])dnl |
4bca4c17 UD |
83 | ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; |
84 | *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; | |
85 | ||
63bda0c1 | 86 | esac |
4bca4c17 | 87 | AC_MSG_RESULT([$ac_prog_version]) |
63bda0c1 | 88 | fi |
4bca4c17 UD |
89 | ifelse([$6],,, |
90 | [if test $ac_verc_fail = yes; then | |
91 | $6 | |
92 | fi]) | |
63bda0c1 UD |
93 | ]) |
94 | ||
ebbad4cc | 95 | dnl These modifications are to allow for an empty cross compiler tree. |
3a12e572 | 96 | define([_AC_COMPILER_EXEEXT], [EXEEXT= |
ebbad4cc | 97 | ]) |
650425ce | 98 | |
3a12e572 | 99 | AC_DEFUN([LIBC_PROG_FOO_GNU], |
650425ce UD |
100 | [# Most GNU programs take a -v and spit out some text including |
101 | # the word 'GNU'. Some try to read stdin, so give them /dev/null. | |
256705f4 | 102 | if $1 -o conftest -v </dev/null 2>&1 | grep GNU > /dev/null 2>&1; then |
650425ce UD |
103 | $2 |
104 | else | |
105 | $3 | |
256705f4 UD |
106 | fi |
107 | rm -fr contest*]) | |
650425ce | 108 | |
3a12e572 | 109 | AC_DEFUN([LIBC_PROG_BINUTILS], |
650425ce UD |
110 | [# Was a --with-binutils option given? |
111 | if test -n "$path_binutils"; then | |
112 | # Make absolute; ensure a single trailing slash. | |
113 | path_binutils=`(cd $path_binutils; pwd) | sed 's%/*$%/%'` | |
63bda0c1 | 114 | CC="$CC -B$path_binutils" |
650425ce | 115 | fi |
6916c5e1 UD |
116 | AS=`$CC -print-prog-name=as` |
117 | LD=`$CC -print-prog-name=ld` | |
5edb9387 UD |
118 | AR=`$CC -print-prog-name=ar` |
119 | AC_SUBST(AR) | |
6e3d59bc RM |
120 | OBJDUMP=`$CC -print-prog-name=objdump` |
121 | AC_SUBST(OBJDUMP) | |
1b74661a RM |
122 | OBJCOPY=`$CC -print-prog-name=objcopy` |
123 | AC_SUBST(OBJCOPY) | |
6014c65d FW |
124 | GPROF=`$CC -print-prog-name=gprof` |
125 | AC_SUBST(GPROF) | |
5edb9387 | 126 | |
650425ce UD |
127 | # Determine whether we are using GNU binutils. |
128 | AC_CACHE_CHECK(whether $AS is GNU as, libc_cv_prog_as_gnu, | |
129 | [LIBC_PROG_FOO_GNU($AS, libc_cv_prog_as_gnu=yes, libc_cv_prog_as_gnu=no)]) | |
a5a0310d | 130 | rm -f a.out |
650425ce UD |
131 | gnu_as=$libc_cv_prog_as_gnu |
132 | ||
133 | AC_CACHE_CHECK(whether $LD is GNU ld, libc_cv_prog_ld_gnu, | |
134 | [LIBC_PROG_FOO_GNU($LD, libc_cv_prog_ld_gnu=yes, libc_cv_prog_ld_gnu=no)]) | |
63bda0c1 UD |
135 | gnu_ld=$libc_cv_prog_ld_gnu |
136 | ]) | |
07037eeb JM |
137 | |
138 | dnl Run a static link test with -nostdlib -nostartfiles. | |
139 | dnl LIBC_TRY_LINK_STATIC([code], [action-if-true], [action-if-false]) | |
140 | AC_DEFUN([LIBC_TRY_LINK_STATIC], | |
141 | [cat > conftest.c <<EOF | |
142 | int _start (void) { return 0; } | |
143 | int __start (void) { return 0; } | |
144 | $1 | |
145 | EOF | |
66a704c4 | 146 | AS_IF([AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -o conftest |
07037eeb JM |
147 | conftest.c -static -nostartfiles -nostdlib |
148 | 1>&AS_MESSAGE_LOG_FD])], | |
149 | [$2], [$3]) | |
150 | rm -f conftest*]) | |
10a803e0 | 151 | |
40b601fb JM |
152 | dnl Test a compiler option or options with an empty input file. |
153 | dnl LIBC_TRY_CC_OPTION([options], [action-if-true], [action-if-false]) | |
154 | AC_DEFUN([LIBC_TRY_CC_OPTION], | |
155 | [AS_IF([AC_TRY_COMMAND([${CC-cc} $1 -xc /dev/null -S -o /dev/null])], | |
156 | [$2], [$3])]) | |
157 | ||
10a803e0 RM |
158 | dnl Find and source sysdeps/*/preconfigure. |
159 | dnl LIBC_PRECONFIGURE([$srcdir], [for]) | |
160 | AC_DEFUN([LIBC_PRECONFIGURE], [dnl | |
161 | if frags=`ls -d $1/sysdeps/*/preconfigure 2> /dev/null` | |
162 | then | |
163 | AC_MSG_CHECKING($2 preconfigure fragments) | |
164 | for frag in $frags; do | |
165 | name=`echo "$frag" | sed 's@/[[^/]]*[$]@@;s@^.*/@@'` | |
166 | echo $ECHO_N "$name $ECHO_C" >&AS_MESSAGE_FD | |
167 | . "$frag" | |
168 | done | |
169 | AC_MSG_RESULT() | |
170 | fi]) | |
8b748aed JM |
171 | |
172 | # These two macros are taken from GCC's config/acx.m4. | |
173 | dnl Support the --with-pkgversion configure option. | |
174 | dnl ACX_PKGVERSION(default-pkgversion) | |
175 | AC_DEFUN([ACX_PKGVERSION],[ | |
176 | AC_ARG_WITH(pkgversion, | |
177 | AS_HELP_STRING([--with-pkgversion=PKG], | |
178 | [Use PKG in the version string in place of "$1"]), | |
179 | [case "$withval" in | |
180 | yes) AC_MSG_ERROR([package version not specified]) ;; | |
181 | no) PKGVERSION= ;; | |
182 | *) PKGVERSION="($withval) " ;; | |
183 | esac], | |
184 | PKGVERSION="($1) " | |
185 | ) | |
186 | PKGVERSION_TEXI=`echo "$PKGVERSION" | sed 's/@/@@/g'` | |
187 | AC_SUBST(PKGVERSION) | |
188 | AC_SUBST(PKGVERSION_TEXI) | |
189 | ]) | |
190 | ||
191 | dnl Support the --with-bugurl configure option. | |
192 | dnl ACX_BUGURL(default-bugurl) | |
193 | AC_DEFUN([ACX_BUGURL],[ | |
194 | AC_ARG_WITH(bugurl, | |
195 | AS_HELP_STRING([--with-bugurl=URL], | |
196 | [Direct users to URL to report a bug]), | |
197 | [case "$withval" in | |
198 | yes) AC_MSG_ERROR([bug URL not specified]) ;; | |
199 | no) BUGURL= | |
200 | ;; | |
201 | *) BUGURL="$withval" | |
202 | ;; | |
203 | esac], | |
204 | BUGURL="$1" | |
205 | ) | |
206 | case ${BUGURL} in | |
207 | "") | |
208 | REPORT_BUGS_TO= | |
209 | REPORT_BUGS_TEXI= | |
210 | ;; | |
211 | *) | |
212 | REPORT_BUGS_TO="<$BUGURL>" | |
213 | REPORT_BUGS_TEXI=@uref{`echo "$BUGURL" | sed 's/@/@@/g'`} | |
214 | ;; | |
215 | esac; | |
216 | AC_SUBST(REPORT_BUGS_TO) | |
217 | AC_SUBST(REPORT_BUGS_TEXI) | |
218 | ]) | |
6bfea974 L |
219 | |
220 | dnl Check linker option support. | |
221 | dnl LIBC_LINKER_FEATURE([ld_option], [cc_option], [action-if-true], [action-if-false]) | |
222 | AC_DEFUN([LIBC_LINKER_FEATURE], | |
223 | [AC_MSG_CHECKING([for linker that supports $1]) | |
224 | libc_linker_feature=no | |
225 | if test x"$gnu_ld" = x"yes"; then | |
226 | libc_linker_check=`$LD -v --help 2>/dev/null | grep "\$1"` | |
227 | if test -n "$libc_linker_check"; then | |
228 | cat > conftest.c <<EOF | |
229 | int _start (void) { return 42; } | |
230 | EOF | |
66a704c4 | 231 | if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp |
6bfea974 L |
232 | $2 -nostdlib -nostartfiles |
233 | -fPIC -shared -o conftest.so conftest.c | |
234 | 1>&AS_MESSAGE_LOG_FD]) | |
235 | then | |
236 | libc_linker_feature=yes | |
237 | fi | |
238 | rm -f conftest* | |
239 | fi | |
240 | fi | |
241 | if test $libc_linker_feature = yes; then | |
242 | $3 | |
243 | else | |
244 | $4 | |
245 | fi | |
246 | AC_MSG_RESULT($libc_linker_feature)]) | |
bef0b507 JM |
247 | |
248 | dnl Add a makefile variable, with value set from a shell string | |
249 | dnl (expanded by the shell inside double quotes), to config.make. | |
250 | dnl LIBC_CONFIG_VAR(make-variable, shell-value) | |
251 | AC_DEFUN([LIBC_CONFIG_VAR], | |
252 | [config_vars="$config_vars | |
253 | $1 = $2"]) | |
a01f19c8 CD |
254 | |
255 | dnl Check that function FUNC was inlined as a builtin. The code fragment | |
256 | dnl CODE is compiled with additional options CC_OPTION. If FUNC is | |
257 | dnl not found in the assembly then it is assumed the compiler has support | |
258 | dnl for this builtin and has inlined the call. If the compiler has the | |
259 | dnl feature then ACTION-IF-TRUE is called, otherwise ACTION-IF-FALSE. | |
260 | dnl It is up to the caller to provide a CC_OPTION that ensures the | |
261 | dnl builtin is inlined if present. | |
262 | dnl Warning: This may not work for some machines. For example on ARM the | |
263 | dnl ABI dictates that some functions should not be inlined and instead | |
264 | dnl should be provided by a compiler helper library e.g. __aeabi_memcpy. | |
265 | dnl This is done to reduce code size. | |
266 | dnl LIBC_COMPILER_BUILTIN([func], [code], [cc_option], [action-if-true], [action-if-false]) | |
267 | AC_DEFUN([LIBC_COMPILER_BUILTIN_INLINED], | |
268 | [AC_MSG_CHECKING([for compiler support of inlined builtin function $1]) | |
269 | libc_compiler_builtin_inlined=no | |
270 | cat > conftest.c <<EOF | |
271 | int _start (void) { $2 return 0; } | |
272 | EOF | |
66a704c4 | 273 | if ! AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp |
a01f19c8 CD |
274 | $3 -nostdlib -nostartfiles |
275 | -S conftest.c -o - | fgrep "$1" | |
276 | 1>&AS_MESSAGE_LOG_FD]) | |
277 | then | |
278 | libc_compiler_builtin_inlined=yes | |
279 | fi | |
280 | rm -f conftest* | |
281 | if test $libc_compiler_builtin_inlined = yes; then | |
282 | $4 | |
283 | else | |
284 | $5 | |
285 | fi | |
286 | AC_MSG_RESULT($libc_compiler_builtin_inlined)]) | |
d95ffd4c JM |
287 | |
288 | dnl Default to slibdir named SLIBDIR instead of "lib", and rtlddir | |
289 | dnl named RTLDDIR instead of "lib". This is used to put 64-bit | |
290 | dnl libraries in /lib64. | |
291 | dnl LIBC_SLIBDIR_RTLDDIR([slibdir], [rtlddir]) | |
292 | AC_DEFUN([LIBC_SLIBDIR_RTLDDIR], | |
293 | [test -n "$libc_cv_slibdir" || | |
294 | case "$prefix" in | |
295 | /usr | /usr/) | |
128c43a2 AS |
296 | libc_cv_slibdir='/$1' |
297 | libc_cv_rtlddir='/$2' | |
d95ffd4c JM |
298 | if test "$libdir" = '${exec_prefix}/lib'; then |
299 | libdir='${exec_prefix}/$1'; | |
300 | # Locale data can be shared between 32-bit and 64-bit libraries. | |
90fe682d | 301 | libc_cv_complocaledir='${exec_prefix}/lib/locale' |
d95ffd4c JM |
302 | fi |
303 | ;; | |
304 | esac]) |