]>
Commit | Line | Data |
---|---|---|
3affd5f0 | 1 | dnl Process this file with autoconf to produce a configure script |
6599da04 | 2 | |
a4f74b58 KC |
3 | AC_PREREQ(2.59) |
4 | AC_INIT | |
5 | AC_CONFIG_SRCDIR([xmalloc.c]) | |
6599da04 | 6 | |
ad49d865 L |
7 | # FIXME: libiberty doesn't support --disable-static |
8 | enable_static=yes | |
9 | ||
6706f116 AO |
10 | # This works around the fact that libtool configuration may change LD |
11 | # for this particular configuration, but some shells, instead of | |
12 | # keeping the changes in LD private, export them just because LD is | |
13 | # exported. We don't use libtool yet, but some day we might, so... | |
14 | ORIGINAL_LD_FOR_MULTILIBS=$LD | |
15 | ||
3affd5f0 JL |
16 | dnl We use these options to decide which functions to include. |
17 | AC_ARG_WITH(target-subdir, | |
cd862df8 L |
18 | [ --with-target-subdir=SUBDIR Configuring in a subdirectory for target]) |
19 | AC_ARG_WITH(build-subdir, | |
20 | [ --with-build-subdir=SUBDIR Configuring in a subdirectory for build]) | |
ca6b370d JL |
21 | AC_ARG_WITH(cross-host, |
22 | [ --with-cross-host=HOST Configuring with a cross compiler]) | |
3affd5f0 JL |
23 | AC_ARG_WITH(newlib, |
24 | [ --with-newlib Configuring with newlib]) | |
6599da04 | 25 | |
3affd5f0 | 26 | if test "${srcdir}" = "."; then |
cd862df8 L |
27 | if test -n "${with_build_subdir}"; then |
28 | libiberty_topdir="${srcdir}/../.." | |
29 | with_target_subdir= | |
30 | elif test -z "${with_target_subdir}"; then | |
3affd5f0 JL |
31 | libiberty_topdir="${srcdir}/.." |
32 | else | |
33 | if test "${with_target_subdir}" != "."; then | |
34 | libiberty_topdir="${srcdir}/${with_multisrctop}../.." | |
35 | else | |
36 | libiberty_topdir="${srcdir}/${with_multisrctop}.." | |
37 | fi | |
38 | fi | |
39 | else | |
40 | libiberty_topdir="${srcdir}/.." | |
41 | fi | |
d8c22ce7 | 42 | AC_SUBST(libiberty_topdir) |
3affd5f0 JL |
43 | AC_CONFIG_AUX_DIR($libiberty_topdir) |
44 | ||
aaa5f039 DD |
45 | dnl Very limited version of automake's enable-maintainer-mode |
46 | ||
47 | AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) | |
48 | dnl maintainer-mode is disabled by default | |
49 | AC_ARG_ENABLE(maintainer-mode, | |
50 | [ --enable-maintainer-mode | |
51 | enable make rules and dependencies not useful | |
52 | (and sometimes confusing) to the casual installer], | |
53 | maintainer_mode=$enableval, | |
54 | maintainer_mode=no) | |
55 | ||
56 | AC_MSG_RESULT($maintainer_mode) | |
57 | ||
58 | if test "$maintainer_mode" = "yes"; then | |
59 | MAINT='' | |
60 | NOTMAINT='#' | |
61 | else | |
62 | MAINT='#' | |
63 | NOTMAINT='' | |
64 | fi | |
65 | AC_SUBST(MAINT)dnl | |
66 | AC_SUBST(NOTMAINT)dnl | |
67 | ||
ae9092da DD |
68 | # Do we have a single-tree copy of texinfo? Even if we do, we can't |
69 | # rely on it - libiberty is built before texinfo. | |
70 | AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, ) | |
f749bd83 AM |
71 | if test "x$MAKEINFO" = "x"; then |
72 | MAKEINFO="@echo makeinfo missing; true" | |
ae9092da | 73 | BUILD_INFO= |
f749bd83 AM |
74 | else |
75 | BUILD_INFO=info | |
c0590bfd L |
76 | case "$MAKEINFO" in |
77 | */missing\ makeinfo*) | |
f749bd83 AM |
78 | BUILD_INFO= |
79 | AC_MSG_WARN([ | |
c0590bfd L |
80 | *** Makeinfo is missing. Info documentation will not be built.]) |
81 | ;; | |
82 | *) | |
83 | case x"`$MAKEINFO --version | grep 'GNU texinfo'`" in | |
84 | x*\ [[1-3]].* ) | |
85 | MAKEINFO="@echo $MAKEINFO is too old, 4.0 or newer required; true" | |
86 | BUILD_INFO= | |
87 | AC_MSG_WARN([ | |
ae9092da | 88 | *** Makeinfo is too old. Info documentation will not be built.]) |
c0590bfd L |
89 | ;; |
90 | esac | |
f749bd83 AM |
91 | ;; |
92 | esac | |
93 | fi | |
ae9092da | 94 | AC_SUBST(MAKEINFO) |
aaa5f039 DD |
95 | AC_SUBST(BUILD_INFO) |
96 | ||
97 | AC_CHECK_PROG(PERL, perl, perl, ) | |
98 | if test x"$PERL" = x""; then | |
99 | HAVE_PERL='#' | |
100 | else | |
101 | HAVE_PERL='' | |
102 | fi | |
103 | AC_SUBST(HAVE_PERL) | |
104 | ||
3affd5f0 JL |
105 | AC_CANONICAL_HOST |
106 | ||
107 | dnl When we start using automake: | |
108 | dnl AM_INIT_AUTOMAKE(libiberty, 1.0) | |
109 | ||
110 | dnl These must be called before AM_PROG_LIBTOOL, because it may want | |
111 | dnl to call AC_CHECK_PROG. | |
112 | AC_CHECK_TOOL(AR, ar) | |
113 | AC_CHECK_TOOL(RANLIB, ranlib, :) | |
114 | ||
238235ef DJ |
115 | GCC_NO_EXECUTABLES |
116 | AC_PROG_CC | |
b033df90 | 117 | AC_PROG_CPP_WERROR |
238235ef DJ |
118 | |
119 | if test x$GCC = xyes; then | |
120 | ac_libiberty_warn_cflags='-W -Wall -Wtraditional -pedantic' | |
121 | fi | |
122 | AC_SUBST(ac_libiberty_warn_cflags) | |
3affd5f0 | 123 | |
d1209685 ZW |
124 | AC_C_CONST |
125 | AC_C_INLINE | |
5cc5a0d0 | 126 | AC_C_BIGENDIAN_CROSS |
3affd5f0 | 127 | |
3affd5f0 JL |
128 | dnl Default to a non shared library. This may be overridden by the |
129 | dnl configure option --enable-shared. | |
ad49d865 | 130 | AM_DISABLE_SHARED |
3affd5f0 | 131 | |
ad49d865 | 132 | AM_PROG_LIBTOOL |
3affd5f0 JL |
133 | |
134 | dnl When we start using automake: | |
135 | dnl AM_CONFIG_HEADER(config.h:config.in) | |
136 | AC_CONFIG_HEADER(config.h:config.in) | |
137 | ||
138 | dnl When we start using automake: | |
139 | dnl AM_MAINTAINER_MODE | |
dd8f3ed5 | 140 | dnl AC_EXEEXT |
3affd5f0 JL |
141 | |
142 | dnl When we start using automake: | |
143 | dnl AM_PROG_INSTALL | |
144 | AC_PROG_INSTALL | |
6599da04 JM |
145 | |
146 | . ${srcdir}/config.table | |
147 | host_makefile_frag=${frag} | |
3affd5f0 JL |
148 | AC_SUBST_FILE(host_makefile_frag) |
149 | ||
150 | # It's OK to check for header files. Although the compiler may not be | |
151 | # able to link anything, it had better be able to at least compile | |
152 | # something. | |
9bf3c9cc | 153 | AC_CHECK_HEADERS(sys/file.h sys/param.h limits.h stdlib.h malloc.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h stdint.h) |
a6458d1d | 154 | AC_HEADER_SYS_WAIT |
c6451ce1 | 155 | AC_HEADER_TIME |
6599da04 | 156 | |
3b58c099 MS |
157 | libiberty_AC_DECLARE_ERRNO |
158 | ||
d49d0907 BE |
159 | # Determine the size of an int for struct fibnode. |
160 | AC_CHECK_SIZEOF([int]) | |
161 | ||
fdfc290b | 162 | AC_CHECK_TYPE(uintptr_t, unsigned long) |
9bf3c9cc RH |
163 | |
164 | # Look for a 64-bit type. | |
165 | AC_MSG_CHECKING([for a 64-bit type]) | |
166 | AC_CACHE_VAL(liberty_cv_uint64, | |
167 | [AC_TRY_COMPILE( | |
168 | [#ifdef HAVE_STDINT_H | |
169 | #include <stdint.h> | |
170 | #endif], | |
171 | [extern uint64_t foo;], | |
172 | liberty_cv_uint64=uint64_t, | |
173 | [AC_TRY_COMPILE( | |
174 | [#ifdef HAVE_LIMITS_H | |
175 | #include <limits.h> | |
176 | #endif | |
177 | #ifndef CHAR_BIT | |
178 | #define CHAR_BIT 8 | |
179 | #endif], | |
180 | [extern char foo[sizeof(long) * CHAR_BIT >= 64 ? 1 : -1];], | |
181 | liberty_cv_uint64="unsigned long", | |
182 | [AC_TRY_COMPILE( | |
183 | [#ifdef HAVE_LIMITS_H | |
184 | #include <limits.h> | |
185 | #endif | |
186 | #ifndef CHAR_BIT | |
187 | #define CHAR_BIT 8 | |
188 | #endif], | |
189 | [extern char foo[sizeof(long long) * CHAR_BIT >= 64 ? 1 : -1];], | |
190 | liberty_cv_uint64="unsigned long long", liberty_cv_uint64=none)])])]) | |
191 | AC_MSG_RESULT($liberty_cv_uint64) | |
192 | if test "$liberty_cv_uint64" != none; then | |
6489430a MR |
193 | AC_DEFINE_UNQUOTED(UNSIGNED_64BIT_TYPE, $liberty_cv_uint64, |
194 | [Define to an unsigned 64-bit type available in the compiler.]) | |
9bf3c9cc RH |
195 | fi |
196 | ||
39e8d049 KG |
197 | # Given the above check, we always have uintptr_t or a fallback |
198 | # definition. So define HAVE_UINTPTR_T in case any imported code | |
199 | # relies on it. | |
200 | AC_DEFINE(HAVE_UINTPTR_T, 1, [Define if you have the \`uintptr_t' type.]) | |
d3982b71 | 201 | |
deae2ed9 MM |
202 | AC_TYPE_PID_T |
203 | ||
3affd5f0 JL |
204 | # This is the list of functions which libiberty will provide if they |
205 | # are not available on the host. | |
206 | ||
207 | funcs="asprintf" | |
208 | funcs="$funcs atexit" | |
209 | funcs="$funcs basename" | |
210 | funcs="$funcs bcmp" | |
211 | funcs="$funcs bcopy" | |
dac45916 | 212 | funcs="$funcs bsearch" |
3affd5f0 | 213 | funcs="$funcs bzero" |
a9acf741 | 214 | funcs="$funcs calloc" |
3affd5f0 | 215 | funcs="$funcs clock" |
29650b2b | 216 | funcs="$funcs ffs" |
3affd5f0 JL |
217 | funcs="$funcs getcwd" |
218 | funcs="$funcs getpagesize" | |
219 | funcs="$funcs index" | |
220 | funcs="$funcs insque" | |
221 | funcs="$funcs memchr" | |
222 | funcs="$funcs memcmp" | |
223 | funcs="$funcs memcpy" | |
224 | funcs="$funcs memmove" | |
029bcc09 | 225 | funcs="$funcs mempcpy" |
3affd5f0 | 226 | funcs="$funcs memset" |
687361c8 | 227 | funcs="$funcs mkstemps" |
9eb4080f | 228 | funcs="$funcs putenv" |
3affd5f0 JL |
229 | funcs="$funcs random" |
230 | funcs="$funcs rename" | |
231 | funcs="$funcs rindex" | |
9eb4080f | 232 | funcs="$funcs setenv" |
bd3fbc6b | 233 | funcs="$funcs snprintf" |
3affd5f0 | 234 | funcs="$funcs sigsetmask" |
029bcc09 KG |
235 | funcs="$funcs stpcpy" |
236 | funcs="$funcs stpncpy" | |
3affd5f0 JL |
237 | funcs="$funcs strcasecmp" |
238 | funcs="$funcs strchr" | |
239 | funcs="$funcs strdup" | |
240 | funcs="$funcs strncasecmp" | |
241 | funcs="$funcs strrchr" | |
242 | funcs="$funcs strstr" | |
243 | funcs="$funcs strtod" | |
244 | funcs="$funcs strtol" | |
245 | funcs="$funcs strtoul" | |
246 | funcs="$funcs tmpnam" | |
247 | funcs="$funcs vasprintf" | |
248 | funcs="$funcs vfprintf" | |
249 | funcs="$funcs vprintf" | |
bd3fbc6b | 250 | funcs="$funcs vsnprintf" |
3affd5f0 JL |
251 | funcs="$funcs vsprintf" |
252 | funcs="$funcs waitpid" | |
253 | ||
254 | # Also in the old function.def file: alloca, vfork, getopt. | |
255 | ||
aa9dc53d | 256 | vars="sys_errlist sys_nerr sys_siglist" |
3affd5f0 | 257 | |
90e72e20 | 258 | checkfuncs="getrusage on_exit psignal strerror strsignal sysconf times sbrk gettimeofday" |
64c7e556 | 259 | checkfuncs="$checkfuncs realpath canonicalize_file_name pstat_getstatic pstat_getdynamic sysmp" |
170230b7 | 260 | checkfuncs="$checkfuncs getsysinfo table sysctl" |
3affd5f0 JL |
261 | |
262 | # These are neither executed nor required, but they help keep | |
263 | # autoheader happy without adding a bunch of text to acconfig.h. | |
264 | if test "x" = "y"; then | |
05c30f22 KG |
265 | AC_CHECK_FUNCS(asprintf atexit basename bcmp bcopy bsearch bzero calloc clock \ |
266 | getcwd getpagesize index insque mkstemps memchr memcmp memcpy \ | |
267 | memmove mempcpy memset putenv random rename rindex sigsetmask \ | |
268 | strcasecmp setenv stpcpy stpncpy strchr strdup strncasecmp strrchr strstr \ | |
269 | strtod strtol strtoul tmpnam vasprintf vfprintf vprintf \ | |
270 | vsprintf waitpid getrusage on_exit psignal strerror strsignal \ | |
271 | sysconf times sbrk gettimeofday ffs snprintf vsnprintf \ | |
272 | pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl \ | |
273 | realpath canonicalize_file_name) | |
d1209685 ZW |
274 | AC_DEFINE(HAVE_SYS_ERRLIST, 1, [Define if you have the sys_errlist variable.]) |
275 | AC_DEFINE(HAVE_SYS_NERR, 1, [Define if you have the sys_nerr variable.]) | |
276 | AC_DEFINE(HAVE_SYS_SIGLIST, 1, [Define if you have the sys_siglist variable.]) | |
6599da04 JM |
277 | fi |
278 | ||
3affd5f0 JL |
279 | # For each of these functions, if the host does not provide the |
280 | # function we want to put FN.o in LIBOBJS, and if the host does | |
b548dffb | 281 | # provide the function, we want to define HAVE_FN in config.h. |
3affd5f0 JL |
282 | |
283 | setobjs= | |
7c72138a | 284 | CHECK= |
48d7db63 | 285 | target_header_dir= |
3affd5f0 JL |
286 | if test -n "${with_target_subdir}"; then |
287 | ||
ca6b370d | 288 | # We are being configured as a target library. AC_REPLACE_FUNCS |
3affd5f0 | 289 | # may not work correctly, because the compiler may not be able to |
ca6b370d JL |
290 | # link executables. Note that we may still be being configured |
291 | # native. | |
3affd5f0 JL |
292 | |
293 | # If we are being configured for newlib, we know which functions | |
294 | # newlib provide and which ones we will be expected to provide. | |
295 | ||
296 | if test "x${with_newlib}" = "xyes"; then | |
238235ef DJ |
297 | AC_LIBOBJ([asprintf]) |
298 | AC_LIBOBJ([basename]) | |
299 | AC_LIBOBJ([insque]) | |
300 | AC_LIBOBJ([random]) | |
301 | AC_LIBOBJ([strdup]) | |
302 | AC_LIBOBJ([vasprintf]) | |
3affd5f0 JL |
303 | |
304 | for f in $funcs; do | |
305 | case "$f" in | |
ca6b370d | 306 | asprintf | basename | insque | random | strdup | vasprintf) |
3affd5f0 JL |
307 | ;; |
308 | *) | |
309 | n=HAVE_`echo $f | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` | |
310 | AC_DEFINE_UNQUOTED($n) | |
311 | ;; | |
312 | esac | |
313 | done | |
314 | ||
315 | # newlib doesnt provide any of the variables in $vars, so we | |
316 | # dont have to check them here. | |
317 | ||
ca6b370d | 318 | # Of the functions in $checkfuncs, newlib only has strerror. |
d1209685 | 319 | AC_DEFINE_NOAUTOHEADER(HAVE_STRERROR) |
3affd5f0 JL |
320 | |
321 | setobjs=yes | |
322 | ||
323 | fi | |
7c72138a | 324 | |
48d7db63 PE |
325 | # We may wish to install the target headers somewhere. |
326 | AC_ARG_ENABLE(install-libiberty, | |
327 | [ --enable-install-libiberty Install headers for end users], | |
328 | enable_install_libiberty=$enableval, | |
329 | enable_install_libiberty=no)dnl | |
330 | ||
331 | # Option parsed, now set things appropriately. | |
332 | case x"$enable_install_libiberty" in | |
333 | xyes|x) | |
334 | target_header_dir=libiberty | |
335 | ;; | |
336 | xno) | |
337 | target_header_dir= | |
338 | ;; | |
339 | *) | |
340 | # This could be sanity-checked in various ways... | |
341 | target_header_dir="${enable_install_libiberty}" | |
342 | ;; | |
343 | esac | |
344 | ||
345 | ||
7c72138a TT |
346 | else |
347 | ||
348 | # Not a target library, so we set things up to run the test suite. | |
349 | CHECK=check-cplus-dem | |
350 | ||
3affd5f0 JL |
351 | fi |
352 | ||
7c72138a | 353 | AC_SUBST(CHECK) |
48d7db63 | 354 | AC_SUBST(target_header_dir) |
7c72138a | 355 | |
b1c45ae4 | 356 | case "${host}" in |
46af757b | 357 | *-*-cygwin* | *-*-mingw*) |
e490616e ZW |
358 | AC_DEFINE_NOAUTOHEADER(HAVE_SYS_ERRLIST) |
359 | AC_DEFINE_NOAUTOHEADER(HAVE_SYS_NERR) | |
b1c45ae4 CF |
360 | ;; |
361 | esac | |
362 | ||
3affd5f0 JL |
363 | if test -z "${setobjs}"; then |
364 | case "${host}" in | |
365 | ||
366 | *-*-vxworks*) | |
367 | # Handle VxWorks configuration specially, since on VxWorks the | |
368 | # libraries are actually on the target board, not in the file | |
369 | # system. | |
238235ef DJ |
370 | AC_LIBOBJ([basename]) |
371 | AC_LIBOBJ([getpagesize]) | |
372 | AC_LIBOBJ([insque]) | |
373 | AC_LIBOBJ([random]) | |
374 | AC_LIBOBJ([strcasecmp]) | |
375 | AC_LIBOBJ([strncasecmp]) | |
376 | AC_LIBOBJ([strdup]) | |
377 | AC_LIBOBJ([vfork]) | |
378 | AC_LIBOBJ([waitpid]) | |
379 | AC_LIBOBJ([vasprintf]) | |
3affd5f0 JL |
380 | for f in $funcs; do |
381 | case "$f" in | |
382 | basename | getpagesize | insque | random | strcasecmp) | |
383 | ;; | |
384 | strncasecmp | strdup | vfork | waitpid | vasprintf) | |
385 | ;; | |
386 | *) | |
387 | n=HAVE_`echo $f | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` | |
388 | AC_DEFINE_UNQUOTED($n) | |
389 | ;; | |
390 | esac | |
391 | done | |
392 | ||
393 | # VxWorks doesn't provide any of the variables in $vars, so we | |
394 | # don't have to check them here. | |
395 | ||
396 | # Of the functions in $checkfuncs, VxWorks only has strerror. | |
d1209685 | 397 | AC_DEFINE_NOAUTOHEADER(HAVE_STRERROR) |
3affd5f0 JL |
398 | |
399 | setobjs=yes | |
400 | ;; | |
401 | ||
402 | esac | |
403 | fi | |
404 | ||
405 | if test -z "${setobjs}"; then | |
406 | ||
407 | case "${host}" in | |
408 | ||
dd8f3ed5 GN |
409 | *-*-cygwin*) |
410 | # The Cygwin library actually uses a couple of files from | |
3affd5f0 | 411 | # libiberty when it is built. If we are building a native |
dd8f3ed5 | 412 | # Cygwin, and we run the tests, we will appear to have these |
3affd5f0 JL |
413 | # files. However, when we go on to build winsup, we will wind up |
414 | # with a library which does not have the files, since they should | |
415 | # have come from libiberty. | |
416 | ||
417 | # We handle this by removing the functions the winsup library | |
418 | # provides from our shell variables, so that they appear to be | |
419 | # missing. | |
420 | ||
2f31ed7e DD |
421 | # DJ - only if we're *building* cygwin, not just building *with* cygwin |
422 | ||
423 | if test -n "${with_target_subdir}" | |
424 | then | |
425 | funcs="`echo $funcs | sed -e 's/random//'`" | |
238235ef | 426 | AC_LIBOBJ([random]) |
2f31ed7e DD |
427 | vars="`echo $vars | sed -e 's/sys_siglist//'`" |
428 | checkfuncs="`echo $checkfuncs | sed -e 's/strsignal//' -e 's/psignal//'`" | |
429 | fi | |
3affd5f0 JL |
430 | ;; |
431 | ||
432 | *-*-mingw32*) | |
433 | # Under mingw32, sys_nerr and sys_errlist exist, but they are | |
434 | # macros, so the test below won't find them. | |
d1209685 ZW |
435 | libiberty_cv_var_sys_nerr=yes |
436 | libiberty_cv_var_sys_errlist=yes | |
3affd5f0 JL |
437 | ;; |
438 | ||
89f602a7 MK |
439 | *-*-uwin*) |
440 | # Under some versions of uwin, vfork is notoriously buggy and the test | |
441 | # can hang configure; on other versions, vfork exists just as a stub. | |
442 | # FIXME: This should be removed once vfork in uwin's runtime is fixed. | |
443 | ac_cv_func_vfork_works=no | |
62133b5e MK |
444 | # Under uwin 2.0+, sys_nerr and sys_errlist exist, but they are |
445 | # macros (actually, these are imported from a DLL, but the end effect | |
446 | # is the same), so the test below won't find them. | |
d1209685 ZW |
447 | libiberty_cv_var_sys_nerr=yes |
448 | libiberty_cv_var_sys_errlist=yes | |
89f602a7 MK |
449 | ;; |
450 | ||
ee262b6f DR |
451 | *-*-*vms*) |
452 | # Under VMS, vfork works very different than on Unix. The standard test | |
453 | # won't work, and it isn't easily adaptable. It makes more sense to | |
454 | # just force it. | |
455 | ac_cv_func_vfork_works=yes | |
456 | ;; | |
457 | ||
3affd5f0 JL |
458 | esac |
459 | ||
460 | # We haven't set the list of objects yet. Use the standard autoconf | |
461 | # tests. This will only work if the compiler works. | |
238235ef | 462 | AC_ISC_POSIX |
3affd5f0 | 463 | AC_REPLACE_FUNCS($funcs) |
b548dffb | 464 | libiberty_AC_FUNC_C_ALLOCA |
a4f74b58 | 465 | AC_FUNC_FORK |
3affd5f0 | 466 | if test $ac_cv_func_vfork_works = no; then |
238235ef | 467 | AC_LIBOBJ([vfork]) |
3affd5f0 | 468 | fi |
e490616e ZW |
469 | # We only need _doprnt if we might use it to implement v*printf. |
470 | if test $ac_cv_func_vprintf != yes \ | |
471 | || test $ac_cv_func_vfprintf != yes \ | |
472 | || test $ac_cv_func_vsprintf != yes; then | |
473 | AC_REPLACE_FUNCS(_doprnt) | |
9ce3f7e5 DD |
474 | else |
475 | AC_CHECK_FUNCS(_doprnt) | |
e490616e ZW |
476 | fi |
477 | ||
3affd5f0 JL |
478 | for v in $vars; do |
479 | AC_MSG_CHECKING([for $v]) | |
480 | AC_CACHE_VAL(libiberty_cv_var_$v, | |
a4f74b58 KC |
481 | [AC_LINK_IFELSE([AC_LANG_PROGRAM([[int *p;]],[[extern int $v []; p = $v;]])], |
482 | [eval "libiberty_cv_var_$v=yes"], | |
483 | [eval "libiberty_cv_var_$v=no"])]) | |
3affd5f0 JL |
484 | if eval "test \"`echo '$libiberty_cv_var_'$v`\" = yes"; then |
485 | AC_MSG_RESULT(yes) | |
486 | n=HAVE_`echo $v | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` | |
487 | AC_DEFINE_UNQUOTED($n) | |
6599da04 | 488 | else |
3affd5f0 | 489 | AC_MSG_RESULT(no) |
6599da04 | 490 | fi |
3affd5f0 | 491 | done |
aa9dc53d ACY |
492 | |
493 | # special check for _system_configuration because AIX <4.3.2 do not | |
494 | # contain the `physmem' member. | |
495 | AC_MSG_CHECKING([for external symbol _system_configuration]) | |
a4f74b58 KC |
496 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/systemcfg.h>]], |
497 | [[double x = _system_configuration.physmem;]])], | |
aa9dc53d ACY |
498 | [AC_MSG_RESULT([yes]) |
499 | AC_DEFINE(HAVE__SYSTEM_CONFIGURATION, 1, | |
a4f74b58 | 500 | [Define if you have the _system_configuration variable.])], |
aa9dc53d ACY |
501 | [AC_MSG_RESULT([no])]) |
502 | ||
3affd5f0 | 503 | AC_CHECK_FUNCS($checkfuncs) |
4876b2b4 | 504 | libiberty_NEED_DECLARATION(canonicalize_file_name) |
3affd5f0 JL |
505 | fi |
506 | ||
55d0e5e0 ZW |
507 | # Figure out which version of pexecute to use. |
508 | case "${host}" in | |
207db768 L |
509 | *-*-mingw* | *-*-winnt*) pex=./pex-win32 ;; |
510 | *-*-msdosdjgpp*) pex=./pex-djgpp ;; | |
511 | *-*-msdos*) pex=./pex-msdos ;; | |
512 | *-*-os2-emx*) pex=./pex-os2 ;; | |
513 | *) pex=./pex-unix ;; | |
55d0e5e0 | 514 | esac |
207db768 L |
515 | pexecute=${pex}.o |
516 | ltpexecute=${pex}.lo | |
55d0e5e0 | 517 | AC_SUBST(pexecute) |
207db768 | 518 | AC_SUBST(ltpexecute) |
55d0e5e0 | 519 | |
a9266bfa KG |
520 | libiberty_AC_FUNC_STRNCMP |
521 | ||
3affd5f0 JL |
522 | # Install a library built with a cross compiler in $(tooldir) rather |
523 | # than $(libdir). | |
ca6b370d | 524 | if test -z "${with_cross_host}"; then |
3affd5f0 JL |
525 | INSTALL_DEST=libdir |
526 | else | |
527 | INSTALL_DEST=tooldir | |
6599da04 | 528 | fi |
3affd5f0 JL |
529 | AC_SUBST(INSTALL_DEST) |
530 | ||
ad49d865 L |
531 | # Add `./' to avoid VPATH. |
532 | m4_pattern_allow(LIBOBJS) | |
533 | L="" | |
534 | for l in x $LIBOBJS; do | |
535 | case $l in | |
536 | x) ;; | |
537 | *) L="$L ./$l" ;; | |
538 | esac | |
539 | done | |
540 | LIBOBJS="$L" | |
541 | ||
542 | m4_pattern_allow(LTLIBOBJS) | |
543 | L="" | |
544 | for l in x $LTLIBOBJS; do | |
545 | case $l in | |
546 | x) ;; | |
547 | *) L="$L ./$l" ;; | |
548 | esac | |
549 | done | |
550 | LTLIBOBJS="$L" | |
551 | ||
552 | dnl Delete it when we start creating shared library with libtool. | |
553 | AC_SUBST(enable_shared) | |
554 | ||
3affd5f0 | 555 | # We need multilib support, but only if configuring for the target. |
a4f74b58 KC |
556 | AC_CONFIG_FILES([Makefile testsuite/Makefile]) |
557 | AC_CONFIG_COMMANDS([default], | |
558 | [[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h | |
3affd5f0 | 559 | if test -n "$CONFIG_FILES"; then |
27cfe310 | 560 | if test -n "${with_target_subdir}"; then |
3affd5f0 JL |
561 | # FIXME: We shouldn't need to set ac_file |
562 | ac_file=Makefile | |
6706f116 | 563 | LD="${ORIGINAL_LD_FOR_MULTILIBS}" |
3affd5f0 JL |
564 | . ${libiberty_topdir}/config-ml.in |
565 | fi | |
a4f74b58 KC |
566 | fi]], |
567 | [[srcdir=${srcdir} | |
3affd5f0 JL |
568 | host=${host} |
569 | target=${target} | |
570 | with_target_subdir=${with_target_subdir} | |
571 | with_multisubdir=${with_multisubdir} | |
572 | ac_configure_args="--enable-multilib ${ac_configure_args}" | |
573 | CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} | |
3343fdd2 | 574 | ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}" |
3affd5f0 | 575 | libiberty_topdir=${libiberty_topdir} |
a4f74b58 KC |
576 | ]]) |
577 | AC_OUTPUT |