]>
Commit | Line | Data |
---|---|---|
2e1a7175 TF |
1 | dnl aclocal.m4 generated automatically by aclocal 1.4 |
2 | ||
3 | dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. | |
4 | dnl This file is free software; the Free Software Foundation | |
5 | dnl gives unlimited permission to copy and/or distribute it, | |
6 | dnl with or without modifications, as long as this notice is preserved. | |
7 | ||
8 | dnl This program is distributed in the hope that it will be useful, | |
9 | dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without | |
10 | dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A | |
11 | dnl PARTICULAR PURPOSE. | |
12 | ||
13 | dnl This provides configure definitions used by all the newlib | |
14 | dnl configure.in files. | |
15 | ||
16 | dnl Basic newlib configury. This calls basic introductory stuff, | |
17 | dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs | |
18 | dnl configure.host. The only argument is the relative path to the top | |
19 | dnl newlib directory. | |
20 | ||
21 | AC_DEFUN(NEWLIB_CONFIGURE, | |
22 | [ | |
23 | dnl Default to --enable-multilib | |
24 | AC_ARG_ENABLE(multilib, | |
25 | [ --enable-multilib build many library versions (default)], | |
26 | [case "${enableval}" in | |
27 | yes) multilib=yes ;; | |
28 | no) multilib=no ;; | |
29 | *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; | |
30 | esac], [multilib=yes])dnl | |
31 | ||
32 | dnl Support --enable-target-optspace | |
33 | AC_ARG_ENABLE(target-optspace, | |
34 | [ --enable-target-optspace optimize for space], | |
35 | [case "${enableval}" in | |
36 | yes) target_optspace=yes ;; | |
37 | no) target_optspace=no ;; | |
38 | *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; | |
39 | esac], [target_optspace=])dnl | |
40 | ||
41 | dnl Support --enable-malloc-debugging - currently only supported for Cygwin | |
42 | AC_ARG_ENABLE(malloc-debugging, | |
43 | [ --enable-malloc-debugging indicate malloc debugging requested], | |
44 | [case "${enableval}" in | |
45 | yes) malloc_debugging=yes ;; | |
46 | no) malloc_debugging=no ;; | |
47 | *) AC_MSG_ERROR(bad value ${enableval} for malloc-debugging option) ;; | |
48 | esac], [malloc_debugging=])dnl | |
49 | ||
50 | dnl Support --enable-newlib-mb | |
51 | AC_ARG_ENABLE(newlib-mb, | |
52 | [ --enable-newlib-mb enable multibyte support], | |
53 | [case "${enableval}" in | |
54 | yes) newlib_mb=yes ;; | |
55 | no) newlib_mb=no ;; | |
56 | *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; | |
c9ccb1f2 | 57 | esac], [newlib_mb=])dnl |
2e1a7175 | 58 | |
786ab12c JJ |
59 | dnl Support --enable-newlib-iconv |
60 | AC_ARG_ENABLE(newlib-iconv, | |
61 | [ --enable-newlib-iconv enable iconv library support], | |
62 | [case "${enableval}" in | |
63 | yes) newlib_iconv=yes ;; | |
64 | no) newlib_iconv=no ;; | |
65 | *) AC_MSG_ERROR(bad value ${enableval} for newlib-iconv option) ;; | |
66 | esac], [newlib_iconv=])dnl | |
67 | ||
68 | dnl Support --enable-newlib-builtin-converters | |
69 | AC_ARG_ENABLE(newlib-builtin-converters, | |
70 | [ --enable-newlib-builtin-converters enable specific comma-separated list of iconv converters to be built-in], | |
71 | [if test x${enableval} = x; then | |
72 | AC_MSG_ERROR(bad value ${enableval} for newlib-builtin-converters option - use comma-separated list) | |
73 | fi | |
74 | builtin_converters=${enableval} | |
75 | ], [builtin_converters=])dnl | |
76 | ||
0c048a9a TF |
77 | dnl Support --enable-newlib-multithread |
78 | AC_ARG_ENABLE(newlib-multithread, | |
79 | [ --enable-newlib-multithread enable support for multiple threads], | |
80 | [case "${enableval}" in | |
81 | yes) newlib_multithread=yes ;; | |
82 | no) newlib_multithread=no ;; | |
83 | *) AC_MSG_ERROR(bad value ${enableval} for newlib-multithread option) ;; | |
84 | esac], [newlib_multithread=yes])dnl | |
85 | ||
c9ccb1f2 JJ |
86 | dnl Support --enable-newlib-elix-level |
87 | AC_ARG_ENABLE(newlib-elix-level, | |
88 | [ --enable-newlib-elix-level supply desired elix library level (1-4)], | |
89 | [case "${enableval}" in | |
90 | 0) newlib_elix_level=0 ;; | |
91 | 1) newlib_elix_level=1 ;; | |
92 | 2) newlib_elix_level=2 ;; | |
93 | 3) newlib_elix_level=3 ;; | |
94 | 4) newlib_elix_level=4 ;; | |
95 | *) AC_MSG_ERROR(bad value ${enableval} for newlib-elix-level option) ;; | |
96 | esac], [newlib_elix_level=0])dnl | |
97 | ||
afecf2fa JJ |
98 | dnl Support --disable-newlib-io-float |
99 | AC_ARG_ENABLE(newlib-io-float, | |
100 | [ --disable-newlib-io-float disable printf/scanf family float support], | |
101 | [case "${enableval}" in | |
102 | yes) newlib_io_float=yes ;; | |
103 | no) newlib_io_float=no ;; | |
104 | *) AC_MSG_ERROR(bad value ${enableval} for newlib-io-float option) ;; | |
105 | esac], [newlib_io_float=yes])dnl | |
106 | ||
313f1349 JJ |
107 | dnl Support --disable-newlib-supplied-syscalls |
108 | AC_ARG_ENABLE(newlib-supplied-syscalls, | |
109 | [ --disable-newlib-supplied-syscalls disable newlib from supplying syscalls], | |
110 | [case "${enableval}" in | |
111 | yes) newlib_may_supply_syscalls=yes ;; | |
112 | no) newlib_may_supply_syscalls=no ;; | |
113 | *) AC_MSG_ERROR(bad value ${enableval} for newlib-supplied-syscalls option) ;; | |
114 | esac], [newlib_may_supply_syscalls=yes])dnl | |
115 | ||
116 | AM_CONDITIONAL(MAY_SUPPLY_SYSCALLS, test x[$]{newlib_may_supply_syscalls} = xyes) | |
afecf2fa | 117 | |
2e1a7175 TF |
118 | dnl We may get other options which we don't document: |
119 | dnl --with-target-subdir, --with-multisrctop, --with-multisubdir | |
120 | ||
121 | test -z "[$]{with_target_subdir}" && with_target_subdir=. | |
122 | ||
123 | if test "[$]{srcdir}" = "."; then | |
124 | if test "[$]{with_target_subdir}" != "."; then | |
125 | newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" | |
126 | else | |
127 | newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" | |
128 | fi | |
129 | else | |
130 | newlib_basedir="[$]{srcdir}/$1" | |
131 | fi | |
132 | AC_SUBST(newlib_basedir) | |
133 | ||
eaa75b70 | 134 | AC_CANONICAL_SYSTEM |
2e1a7175 | 135 | |
60b0838f | 136 | AM_INIT_AUTOMAKE(newlib, 1.11.0) |
2e1a7175 TF |
137 | |
138 | # FIXME: We temporarily define our own version of AC_PROG_CC. This is | |
139 | # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We | |
140 | # are probably using a cross compiler, which will not be able to fully | |
141 | # link an executable. This should really be fixed in autoconf | |
142 | # itself. | |
143 | ||
144 | AC_DEFUN(LIB_AC_PROG_CC, | |
145 | [AC_BEFORE([$0], [AC_PROG_CPP])dnl | |
146 | AC_CHECK_PROG(CC, gcc, gcc) | |
147 | if test -z "$CC"; then | |
148 | AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) | |
149 | test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) | |
150 | fi | |
151 | ||
152 | AC_PROG_CC_GNU | |
153 | ||
154 | if test $ac_cv_prog_gcc = yes; then | |
155 | GCC=yes | |
156 | dnl Check whether -g works, even if CFLAGS is set, in case the package | |
157 | dnl plays around with CFLAGS (such as to build both debugging and | |
158 | dnl normal versions of a library), tasteless as that idea is. | |
159 | ac_test_CFLAGS="${CFLAGS+set}" | |
160 | ac_save_CFLAGS="$CFLAGS" | |
161 | CFLAGS= | |
162 | AC_PROG_CC_G | |
163 | if test "$ac_test_CFLAGS" = set; then | |
164 | CFLAGS="$ac_save_CFLAGS" | |
165 | elif test $ac_cv_prog_cc_g = yes; then | |
166 | CFLAGS="-g -O2" | |
167 | else | |
168 | CFLAGS="-O2" | |
169 | fi | |
170 | else | |
171 | GCC= | |
172 | test "${CFLAGS+set}" = set || CFLAGS="-g" | |
173 | fi | |
174 | ]) | |
175 | ||
176 | LIB_AC_PROG_CC | |
177 | ||
2e1a7175 TF |
178 | AC_CHECK_TOOL(AS, as) |
179 | AC_CHECK_TOOL(AR, ar) | |
180 | AC_CHECK_TOOL(RANLIB, ranlib, :) | |
181 | ||
182 | AC_PROG_INSTALL | |
183 | ||
184 | AM_MAINTAINER_MODE | |
185 | ||
186 | # We need AC_EXEEXT to keep automake happy in cygnus mode. However, | |
187 | # at least currently, we never actually build a program, so we never | |
188 | # need to use $(EXEEXT). Moreover, the test for EXEEXT normally | |
189 | # fails, because we are probably configuring with a cross compiler | |
190 | # which can't create executables. So we include AC_EXEEXT to keep | |
191 | # automake happy, but we don't execute it, since we don't care about | |
192 | # the result. | |
193 | if false; then | |
194 | AC_EXEEXT | |
195 | fi | |
196 | ||
197 | . [$]{newlib_basedir}/configure.host | |
198 | ||
2e1a7175 TF |
199 | newlib_cflags="[$]{newlib_cflags} -fno-builtin" |
200 | ||
201 | NEWLIB_CFLAGS=${newlib_cflags} | |
202 | AC_SUBST(NEWLIB_CFLAGS) | |
203 | ||
204 | LDFLAGS=${ldflags} | |
205 | AC_SUBST(LDFLAGS) | |
206 | ||
c9ccb1f2 JJ |
207 | AM_CONDITIONAL(ELIX_LEVEL_0, test x[$]{newlib_elix_level} = x0) |
208 | AM_CONDITIONAL(ELIX_LEVEL_1, test x[$]{newlib_elix_level} = x1) | |
209 | AM_CONDITIONAL(ELIX_LEVEL_2, test x[$]{newlib_elix_level} = x2) | |
210 | AM_CONDITIONAL(ELIX_LEVEL_3, test x[$]{newlib_elix_level} = x3) | |
211 | AM_CONDITIONAL(ELIX_LEVEL_4, test x[$]{newlib_elix_level} = x4) | |
212 | ||
2e1a7175 | 213 | AM_CONDITIONAL(USE_LIBTOOL, test x[$]{use_libtool} = xyes) |
0953fe64 TF |
214 | |
215 | # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we | |
216 | # use oext, which is set in configure.host based on the target platform. | |
217 | OBJEXT=${oext} | |
218 | ||
219 | AC_SUBST(OBJEXT) | |
2e1a7175 TF |
220 | AC_SUBST(oext) |
221 | AC_SUBST(aext) | |
222 | ||
223 | AC_SUBST(libm_machine_dir) | |
224 | AC_SUBST(machine_dir) | |
225 | AC_SUBST(sys_dir) | |
226 | ]) | |
227 | ||
228 | # Do all the work for Automake. This macro actually does too much -- | |
229 | # some checks are only needed if your package does certain things. | |
230 | # But this isn't really a big deal. | |
231 | ||
232 | # serial 1 | |
233 | ||
234 | dnl Usage: | |
235 | dnl AM_INIT_AUTOMAKE(package,version, [no-define]) | |
236 | ||
237 | AC_DEFUN(AM_INIT_AUTOMAKE, | |
238 | [AC_REQUIRE([AC_PROG_INSTALL]) | |
239 | PACKAGE=[$1] | |
240 | AC_SUBST(PACKAGE) | |
241 | VERSION=[$2] | |
242 | AC_SUBST(VERSION) | |
243 | dnl test to see if srcdir already configured | |
244 | if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then | |
245 | AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) | |
246 | fi | |
247 | ifelse([$3],, | |
248 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) | |
249 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) | |
250 | AC_REQUIRE([AM_SANITY_CHECK]) | |
251 | AC_REQUIRE([AC_ARG_PROGRAM]) | |
252 | dnl FIXME This is truly gross. | |
253 | missing_dir=`cd $ac_aux_dir && pwd` | |
254 | AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) | |
255 | AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) | |
256 | AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) | |
257 | AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) | |
258 | AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) | |
259 | AC_REQUIRE([AC_PROG_MAKE_SET])]) | |
260 | ||
261 | # | |
262 | # Check to make sure that the build environment is sane. | |
263 | # | |
264 | ||
265 | AC_DEFUN(AM_SANITY_CHECK, | |
266 | [AC_MSG_CHECKING([whether build environment is sane]) | |
267 | # Just in case | |
268 | sleep 1 | |
269 | echo timestamp > conftestfile | |
270 | # Do `set' in a subshell so we don't clobber the current shell's | |
271 | # arguments. Must try -L first in case configure is actually a | |
272 | # symlink; some systems play weird games with the mod time of symlinks | |
273 | # (eg FreeBSD returns the mod time of the symlink's containing | |
274 | # directory). | |
275 | if ( | |
276 | set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` | |
277 | if test "[$]*" = "X"; then | |
278 | # -L didn't work. | |
279 | set X `ls -t $srcdir/configure conftestfile` | |
280 | fi | |
281 | if test "[$]*" != "X $srcdir/configure conftestfile" \ | |
282 | && test "[$]*" != "X conftestfile $srcdir/configure"; then | |
283 | ||
284 | # If neither matched, then we have a broken ls. This can happen | |
285 | # if, for instance, CONFIG_SHELL is bash and it inherits a | |
286 | # broken ls alias from the environment. This has actually | |
287 | # happened. Such a system could not be considered "sane". | |
288 | AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken | |
289 | alias in your environment]) | |
290 | fi | |
291 | ||
292 | test "[$]2" = conftestfile | |
293 | ) | |
294 | then | |
295 | # Ok. | |
296 | : | |
297 | else | |
298 | AC_MSG_ERROR([newly created file is older than distributed files! | |
299 | Check your system clock]) | |
300 | fi | |
301 | rm -f conftest* | |
302 | AC_MSG_RESULT(yes)]) | |
303 | ||
304 | dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) | |
305 | dnl The program must properly implement --version. | |
306 | AC_DEFUN(AM_MISSING_PROG, | |
307 | [AC_MSG_CHECKING(for working $2) | |
308 | # Run test in a subshell; some versions of sh will print an error if | |
309 | # an executable is not found, even if stderr is redirected. | |
310 | # Redirect stdin to placate older versions of autoconf. Sigh. | |
311 | if ($2 --version) < /dev/null > /dev/null 2>&1; then | |
312 | $1=$2 | |
313 | AC_MSG_RESULT(found) | |
314 | else | |
315 | $1="$3/missing $2" | |
316 | AC_MSG_RESULT(missing) | |
317 | fi | |
318 | AC_SUBST($1)]) | |
319 | ||
313f1349 JJ |
320 | # Define a conditional. |
321 | ||
322 | AC_DEFUN(AM_CONDITIONAL, | |
323 | [AC_SUBST($1_TRUE) | |
324 | AC_SUBST($1_FALSE) | |
325 | if $2; then | |
326 | $1_TRUE= | |
327 | $1_FALSE='#' | |
328 | else | |
329 | $1_TRUE='#' | |
330 | $1_FALSE= | |
331 | fi]) | |
332 | ||
2e1a7175 TF |
333 | # Add --enable-maintainer-mode option to configure. |
334 | # From Jim Meyering | |
335 | ||
336 | # serial 1 | |
337 | ||
338 | AC_DEFUN(AM_MAINTAINER_MODE, | |
339 | [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) | |
340 | dnl maintainer-mode is disabled by default | |
341 | AC_ARG_ENABLE(maintainer-mode, | |
342 | [ --enable-maintainer-mode enable make rules and dependencies not useful | |
343 | (and sometimes confusing) to the casual installer], | |
344 | USE_MAINTAINER_MODE=$enableval, | |
345 | USE_MAINTAINER_MODE=no) | |
346 | AC_MSG_RESULT($USE_MAINTAINER_MODE) | |
347 | AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) | |
348 | MAINT=$MAINTAINER_MODE_TRUE | |
349 | AC_SUBST(MAINT)dnl | |
350 | ] | |
351 | ) | |
352 | ||
2e1a7175 | 353 | |
0953fe64 TF |
354 | # serial 46 AC_PROG_LIBTOOL |
355 | AC_DEFUN([AC_PROG_LIBTOOL], | |
356 | [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl | |
357 | dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX | |
358 | dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. | |
359 | AC_PROVIDE_IFELSE([AC_PROG_CXX], | |
360 | [AC_LIBTOOL_CXX], | |
361 | [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX | |
362 | ])]) | |
363 | ||
364 | dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. | |
365 | dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run | |
366 | dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. | |
367 | AC_PROVIDE_IFELSE([AC_PROG_GCJ], | |
368 | [AC_LIBTOOL_GCJ], | |
369 | [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], | |
370 | [AC_LIBTOOL_GCJ], | |
371 | [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], | |
372 | [AC_LIBTOOL_GCJ], | |
373 | [ifdef([AC_PROG_GCJ], | |
374 | [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ | |
375 | ])]) | |
376 | ifdef([A][M_PROG_GCJ], | |
377 | [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ | |
378 | ])]) | |
379 | ifdef([LT_AC_PROG_GCJ], | |
380 | [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ | |
381 | ])])])])])]) | |
382 | ||
383 | AC_DEFUN([_AC_PROG_LIBTOOL], | |
2e1a7175 | 384 | [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl |
0953fe64 TF |
385 | AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl |
386 | AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl | |
2e1a7175 TF |
387 | |
388 | # Save cache, so that ltconfig can load it | |
389 | AC_CACHE_SAVE | |
390 | ||
391 | # Actually configure libtool. ac_aux_dir is where install-sh is found. | |
0953fe64 TF |
392 | AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ |
393 | MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ | |
394 | LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \ | |
395 | AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \ | |
396 | objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \ | |
397 | deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \ | |
2e1a7175 | 398 | ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ |
0953fe64 | 399 | $libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \ |
2e1a7175 TF |
400 | || AC_MSG_ERROR([libtool configure failed]) |
401 | ||
402 | # Reload cache, that may have been modified by ltconfig | |
403 | AC_CACHE_LOAD | |
404 | ||
405 | # This can be used to rebuild libtool when needed | |
0953fe64 | 406 | LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh $ac_aux_dir/ltcf-c.sh" |
2e1a7175 TF |
407 | |
408 | # Always use our own libtool. | |
409 | LIBTOOL='$(SHELL) $(top_builddir)/libtool' | |
410 | AC_SUBST(LIBTOOL)dnl | |
411 | ||
412 | # Redirect the config.log output again, so that the ltconfig log is not | |
413 | # clobbered by the next message. | |
414 | exec 5>>./config.log | |
415 | ]) | |
416 | ||
0953fe64 | 417 | AC_DEFUN([AC_LIBTOOL_SETUP], |
2e1a7175 TF |
418 | [AC_PREREQ(2.13)dnl |
419 | AC_REQUIRE([AC_ENABLE_SHARED])dnl | |
420 | AC_REQUIRE([AC_ENABLE_STATIC])dnl | |
421 | AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl | |
422 | AC_REQUIRE([AC_CANONICAL_HOST])dnl | |
423 | AC_REQUIRE([AC_CANONICAL_BUILD])dnl | |
2e1a7175 TF |
424 | AC_REQUIRE([AC_PROG_CC])dnl |
425 | AC_REQUIRE([AC_PROG_LD])dnl | |
0953fe64 | 426 | AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl |
2e1a7175 TF |
427 | AC_REQUIRE([AC_PROG_NM])dnl |
428 | AC_REQUIRE([AC_PROG_LN_S])dnl | |
0953fe64 TF |
429 | AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl |
430 | # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! | |
431 | AC_REQUIRE([AC_OBJEXT])dnl | |
432 | AC_REQUIRE([AC_EXEEXT])dnl | |
2e1a7175 TF |
433 | dnl |
434 | ||
0953fe64 TF |
435 | # Only perform the check for file, if the check method requires it |
436 | case $deplibs_check_method in | |
437 | file_magic*) | |
438 | if test "$file_magic_cmd" = '$MAGIC_CMD'; then | |
439 | AC_PATH_MAGIC | |
440 | fi | |
441 | ;; | |
442 | esac | |
443 | ||
444 | AC_CHECK_TOOL(RANLIB, ranlib, :) | |
445 | AC_CHECK_TOOL(STRIP, strip, :) | |
446 | ||
2e1a7175 TF |
447 | # Check for any special flags to pass to ltconfig. |
448 | libtool_flags="--cache-file=$cache_file" | |
449 | test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" | |
450 | test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" | |
451 | test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" | |
0953fe64 TF |
452 | test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc" |
453 | test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" | |
2e1a7175 TF |
454 | ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], |
455 | [libtool_flags="$libtool_flags --enable-dlopen"]) | |
456 | ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], | |
457 | [libtool_flags="$libtool_flags --enable-win32-dll"]) | |
458 | AC_ARG_ENABLE(libtool-lock, | |
459 | [ --disable-libtool-lock avoid locking (might break parallel builds)]) | |
460 | test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" | |
461 | test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" | |
462 | ||
0953fe64 TF |
463 | AC_ARG_WITH(pic, |
464 | [ --with-pic try to use only PIC/non-PIC objects [default=use both]], | |
465 | pic_mode="$withval", pic_mode=default) | |
466 | test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic" | |
467 | test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" | |
468 | ||
2e1a7175 TF |
469 | # Some flags need to be propagated to the compiler or linker for good |
470 | # libtool support. | |
0953fe64 | 471 | case $host in |
2e1a7175 TF |
472 | *-*-irix6*) |
473 | # Find out which ABI we are using. | |
474 | echo '[#]line __oline__ "configure"' > conftest.$ac_ext | |
475 | if AC_TRY_EVAL(ac_compile); then | |
0953fe64 | 476 | case `/usr/bin/file conftest.$ac_objext` in |
2e1a7175 TF |
477 | *32-bit*) |
478 | LD="${LD-ld} -32" | |
479 | ;; | |
480 | *N32*) | |
481 | LD="${LD-ld} -n32" | |
482 | ;; | |
483 | *64-bit*) | |
484 | LD="${LD-ld} -64" | |
485 | ;; | |
486 | esac | |
487 | fi | |
488 | rm -rf conftest* | |
489 | ;; | |
490 | ||
0953fe64 TF |
491 | ia64-*-hpux*) |
492 | # Find out which ABI we are using. | |
493 | echo 'int i;' > conftest.$ac_ext | |
494 | if AC_TRY_EVAL(ac_compile); then | |
495 | case "`/usr/bin/file conftest.o`" in | |
496 | *ELF-32*) | |
497 | HPUX_IA64_MODE="32" | |
498 | ;; | |
499 | *ELF-64*) | |
500 | HPUX_IA64_MODE="64" | |
501 | ;; | |
502 | esac | |
503 | fi | |
504 | rm -rf conftest* | |
505 | ;; | |
506 | ||
2e1a7175 TF |
507 | *-*-sco3.2v5*) |
508 | # On SCO OpenServer 5, we need -belf to get full-featured binaries. | |
509 | SAVE_CFLAGS="$CFLAGS" | |
510 | CFLAGS="$CFLAGS -belf" | |
511 | AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, | |
0953fe64 TF |
512 | [AC_LANG_SAVE |
513 | AC_LANG_C | |
514 | AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) | |
515 | AC_LANG_RESTORE]) | |
2e1a7175 TF |
516 | if test x"$lt_cv_cc_needs_belf" != x"yes"; then |
517 | # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf | |
518 | CFLAGS="$SAVE_CFLAGS" | |
519 | fi | |
520 | ;; | |
521 | ||
522 | ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], | |
0953fe64 | 523 | [*-*-cygwin* | *-*-mingw* | *-*-pw32*) |
2e1a7175 TF |
524 | AC_CHECK_TOOL(DLLTOOL, dlltool, false) |
525 | AC_CHECK_TOOL(AS, as, false) | |
526 | AC_CHECK_TOOL(OBJDUMP, objdump, false) | |
0953fe64 TF |
527 | |
528 | # recent cygwin and mingw systems supply a stub DllMain which the user | |
529 | # can override, but on older systems we have to supply one | |
530 | AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain, | |
531 | [AC_TRY_LINK([], | |
532 | [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*); | |
533 | DllMain (0, 0, 0);], | |
534 | [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])]) | |
535 | ||
536 | case $host/$CC in | |
537 | *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*) | |
538 | # old mingw systems require "-dll" to link a DLL, while more recent ones | |
539 | # require "-mdll" | |
540 | SAVE_CFLAGS="$CFLAGS" | |
541 | CFLAGS="$CFLAGS -mdll" | |
542 | AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch, | |
543 | [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])]) | |
544 | CFLAGS="$SAVE_CFLAGS" ;; | |
545 | *-*-cygwin* | *-*-pw32*) | |
546 | # cygwin systems need to pass --dll to the linker, and not link | |
547 | # crt.o which will require a WinMain@16 definition. | |
548 | lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;; | |
549 | esac | |
2e1a7175 | 550 | ;; |
0953fe64 | 551 | ]) |
2e1a7175 TF |
552 | esac |
553 | ]) | |
554 | ||
555 | # AC_LIBTOOL_DLOPEN - enable checks for dlopen support | |
0953fe64 | 556 | AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) |
2e1a7175 TF |
557 | |
558 | # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's | |
0953fe64 | 559 | AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) |
2e1a7175 TF |
560 | |
561 | # AC_ENABLE_SHARED - implement the --enable-shared flag | |
562 | # Usage: AC_ENABLE_SHARED[(DEFAULT)] | |
563 | # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to | |
564 | # `yes'. | |
0953fe64 TF |
565 | AC_DEFUN([AC_ENABLE_SHARED], |
566 | [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl | |
2e1a7175 TF |
567 | AC_ARG_ENABLE(shared, |
568 | changequote(<<, >>)dnl | |
569 | << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], | |
570 | changequote([, ])dnl | |
571 | [p=${PACKAGE-default} | |
0953fe64 | 572 | case $enableval in |
2e1a7175 TF |
573 | yes) enable_shared=yes ;; |
574 | no) enable_shared=no ;; | |
575 | *) | |
576 | enable_shared=no | |
577 | # Look at the argument we got. We use all the common list separators. | |
578 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," | |
579 | for pkg in $enableval; do | |
580 | if test "X$pkg" = "X$p"; then | |
581 | enable_shared=yes | |
582 | fi | |
583 | done | |
584 | IFS="$ac_save_ifs" | |
585 | ;; | |
586 | esac], | |
587 | enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl | |
588 | ]) | |
589 | ||
590 | # AC_DISABLE_SHARED - set the default shared flag to --disable-shared | |
0953fe64 | 591 | AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl |
2e1a7175 TF |
592 | AC_ENABLE_SHARED(no)]) |
593 | ||
594 | # AC_ENABLE_STATIC - implement the --enable-static flag | |
595 | # Usage: AC_ENABLE_STATIC[(DEFAULT)] | |
596 | # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to | |
597 | # `yes'. | |
0953fe64 TF |
598 | AC_DEFUN([AC_ENABLE_STATIC], |
599 | [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl | |
2e1a7175 TF |
600 | AC_ARG_ENABLE(static, |
601 | changequote(<<, >>)dnl | |
602 | << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], | |
603 | changequote([, ])dnl | |
604 | [p=${PACKAGE-default} | |
0953fe64 | 605 | case $enableval in |
2e1a7175 TF |
606 | yes) enable_static=yes ;; |
607 | no) enable_static=no ;; | |
608 | *) | |
609 | enable_static=no | |
610 | # Look at the argument we got. We use all the common list separators. | |
611 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," | |
612 | for pkg in $enableval; do | |
613 | if test "X$pkg" = "X$p"; then | |
614 | enable_static=yes | |
615 | fi | |
616 | done | |
617 | IFS="$ac_save_ifs" | |
618 | ;; | |
619 | esac], | |
620 | enable_static=AC_ENABLE_STATIC_DEFAULT)dnl | |
621 | ]) | |
622 | ||
623 | # AC_DISABLE_STATIC - set the default static flag to --disable-static | |
0953fe64 TF |
624 | AC_DEFUN([AC_DISABLE_STATIC], |
625 | [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl | |
2e1a7175 TF |
626 | AC_ENABLE_STATIC(no)]) |
627 | ||
628 | ||
629 | # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag | |
630 | # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] | |
631 | # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to | |
632 | # `yes'. | |
0953fe64 TF |
633 | AC_DEFUN([AC_ENABLE_FAST_INSTALL], |
634 | [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl | |
2e1a7175 TF |
635 | AC_ARG_ENABLE(fast-install, |
636 | changequote(<<, >>)dnl | |
637 | << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], | |
638 | changequote([, ])dnl | |
639 | [p=${PACKAGE-default} | |
0953fe64 | 640 | case $enableval in |
2e1a7175 TF |
641 | yes) enable_fast_install=yes ;; |
642 | no) enable_fast_install=no ;; | |
643 | *) | |
644 | enable_fast_install=no | |
645 | # Look at the argument we got. We use all the common list separators. | |
646 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," | |
647 | for pkg in $enableval; do | |
648 | if test "X$pkg" = "X$p"; then | |
649 | enable_fast_install=yes | |
650 | fi | |
651 | done | |
652 | IFS="$ac_save_ifs" | |
653 | ;; | |
654 | esac], | |
655 | enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl | |
656 | ]) | |
657 | ||
0953fe64 TF |
658 | # AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install |
659 | AC_DEFUN([AC_DISABLE_FAST_INSTALL], | |
660 | [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl | |
2e1a7175 TF |
661 | AC_ENABLE_FAST_INSTALL(no)]) |
662 | ||
0953fe64 TF |
663 | # AC_LIBTOOL_PICMODE - implement the --with-pic flag |
664 | # Usage: AC_LIBTOOL_PICMODE[(MODE)] | |
665 | # Where MODE is either `yes' or `no'. If omitted, it defaults to | |
666 | # `both'. | |
667 | AC_DEFUN([AC_LIBTOOL_PICMODE], | |
668 | [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl | |
669 | pic_mode=ifelse($#,1,$1,default)]) | |
670 | ||
671 | ||
672 | # AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library | |
673 | AC_DEFUN([AC_PATH_TOOL_PREFIX], | |
674 | [AC_MSG_CHECKING([for $1]) | |
675 | AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, | |
676 | [case $MAGIC_CMD in | |
677 | /*) | |
678 | lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. | |
679 | ;; | |
680 | ?:/*) | |
681 | lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. | |
682 | ;; | |
683 | *) | |
684 | ac_save_MAGIC_CMD="$MAGIC_CMD" | |
685 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" | |
686 | dnl $ac_dummy forces splitting on constant user-supplied paths. | |
687 | dnl POSIX.2 word splitting is done only on the output of word expansions, | |
688 | dnl not every word. This closes a longstanding sh security hole. | |
689 | ac_dummy="ifelse([$2], , $PATH, [$2])" | |
690 | for ac_dir in $ac_dummy; do | |
691 | test -z "$ac_dir" && ac_dir=. | |
692 | if test -f $ac_dir/$1; then | |
693 | lt_cv_path_MAGIC_CMD="$ac_dir/$1" | |
694 | if test -n "$file_magic_test_file"; then | |
695 | case $deplibs_check_method in | |
696 | "file_magic "*) | |
697 | file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" | |
698 | MAGIC_CMD="$lt_cv_path_MAGIC_CMD" | |
699 | if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | | |
700 | egrep "$file_magic_regex" > /dev/null; then | |
701 | : | |
702 | else | |
703 | cat <<EOF 1>&2 | |
704 | ||
705 | *** Warning: the command libtool uses to detect shared libraries, | |
706 | *** $file_magic_cmd, produces output that libtool cannot recognize. | |
707 | *** The result is that libtool may fail to recognize shared libraries | |
708 | *** as such. This will affect the creation of libtool libraries that | |
709 | *** depend on shared libraries, but programs linked with such libtool | |
710 | *** libraries will work regardless of this problem. Nevertheless, you | |
711 | *** may want to report the problem to your system manager and/or to | |
712 | *** bug-libtool@gnu.org | |
713 | ||
714 | EOF | |
715 | fi ;; | |
716 | esac | |
717 | fi | |
718 | break | |
719 | fi | |
720 | done | |
721 | IFS="$ac_save_ifs" | |
722 | MAGIC_CMD="$ac_save_MAGIC_CMD" | |
723 | ;; | |
724 | esac]) | |
725 | MAGIC_CMD="$lt_cv_path_MAGIC_CMD" | |
726 | if test -n "$MAGIC_CMD"; then | |
727 | AC_MSG_RESULT($MAGIC_CMD) | |
728 | else | |
729 | AC_MSG_RESULT(no) | |
730 | fi | |
731 | ]) | |
732 | ||
733 | ||
734 | # AC_PATH_MAGIC - find a file program which can recognise a shared library | |
735 | AC_DEFUN([AC_PATH_MAGIC], | |
736 | [AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl | |
737 | AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH) | |
738 | if test -z "$lt_cv_path_MAGIC_CMD"; then | |
739 | if test -n "$ac_tool_prefix"; then | |
740 | AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH) | |
741 | else | |
742 | MAGIC_CMD=: | |
743 | fi | |
744 | fi | |
745 | ]) | |
746 | ||
747 | ||
2e1a7175 | 748 | # AC_PROG_LD - find the path to the GNU or non-GNU linker |
0953fe64 | 749 | AC_DEFUN([AC_PROG_LD], |
2e1a7175 TF |
750 | [AC_ARG_WITH(gnu-ld, |
751 | [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], | |
752 | test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) | |
753 | AC_REQUIRE([AC_PROG_CC])dnl | |
754 | AC_REQUIRE([AC_CANONICAL_HOST])dnl | |
755 | AC_REQUIRE([AC_CANONICAL_BUILD])dnl | |
756 | ac_prog=ld | |
0953fe64 | 757 | if test "$GCC" = yes; then |
2e1a7175 TF |
758 | # Check if gcc -print-prog-name=ld gives a path. |
759 | AC_MSG_CHECKING([for ld used by GCC]) | |
0953fe64 TF |
760 | case $host in |
761 | *-*-mingw*) | |
762 | # gcc leaves a trailing carriage return which upsets mingw | |
763 | ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; | |
764 | *) | |
765 | ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; | |
766 | esac | |
767 | case $ac_prog in | |
2e1a7175 | 768 | # Accept absolute paths. |
0953fe64 TF |
769 | [[\\/]* | [A-Za-z]:[\\/]*)] |
770 | re_direlt=['/[^/][^/]*/\.\./'] | |
2e1a7175 TF |
771 | # Canonicalize the path of ld |
772 | ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` | |
773 | while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do | |
774 | ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` | |
775 | done | |
776 | test -z "$LD" && LD="$ac_prog" | |
777 | ;; | |
778 | "") | |
779 | # If it fails, then pretend we aren't using GCC. | |
780 | ac_prog=ld | |
781 | ;; | |
782 | *) | |
783 | # If it is relative, then search for the first ld in PATH. | |
784 | with_gnu_ld=unknown | |
785 | ;; | |
786 | esac | |
787 | elif test "$with_gnu_ld" = yes; then | |
788 | AC_MSG_CHECKING([for GNU ld]) | |
789 | else | |
790 | AC_MSG_CHECKING([for non-GNU ld]) | |
791 | fi | |
0953fe64 | 792 | AC_CACHE_VAL(lt_cv_path_LD, |
2e1a7175 TF |
793 | [if test -z "$LD"; then |
794 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" | |
795 | for ac_dir in $PATH; do | |
796 | test -z "$ac_dir" && ac_dir=. | |
797 | if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then | |
0953fe64 | 798 | lt_cv_path_LD="$ac_dir/$ac_prog" |
2e1a7175 TF |
799 | # Check to see if the program is GNU ld. I'd rather use --version, |
800 | # but apparently some GNU ld's only accept -v. | |
801 | # Break only if it was the GNU/non-GNU ld that we prefer. | |
0953fe64 | 802 | if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then |
2e1a7175 TF |
803 | test "$with_gnu_ld" != no && break |
804 | else | |
805 | test "$with_gnu_ld" != yes && break | |
806 | fi | |
807 | fi | |
808 | done | |
809 | IFS="$ac_save_ifs" | |
810 | else | |
0953fe64 | 811 | lt_cv_path_LD="$LD" # Let the user override the test with a path. |
2e1a7175 | 812 | fi]) |
0953fe64 | 813 | LD="$lt_cv_path_LD" |
2e1a7175 TF |
814 | if test -n "$LD"; then |
815 | AC_MSG_RESULT($LD) | |
816 | else | |
817 | AC_MSG_RESULT(no) | |
818 | fi | |
819 | test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) | |
820 | AC_PROG_LD_GNU | |
821 | ]) | |
822 | ||
0953fe64 TF |
823 | AC_DEFUN([AC_PROG_LD_GNU], |
824 | [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, | |
2e1a7175 TF |
825 | [# I'd rather use --version here, but apparently some GNU ld's only accept -v. |
826 | if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then | |
0953fe64 | 827 | lt_cv_prog_gnu_ld=yes |
2e1a7175 | 828 | else |
0953fe64 | 829 | lt_cv_prog_gnu_ld=no |
2e1a7175 | 830 | fi]) |
0953fe64 | 831 | with_gnu_ld=$lt_cv_prog_gnu_ld |
2e1a7175 TF |
832 | ]) |
833 | ||
0953fe64 TF |
834 | # AC_PROG_LD_RELOAD_FLAG - find reload flag for linker |
835 | # -- PORTME Some linkers may need a different reload flag. | |
836 | AC_DEFUN([AC_PROG_LD_RELOAD_FLAG], | |
837 | [AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag, | |
838 | [lt_cv_ld_reload_flag='-r']) | |
839 | reload_flag=$lt_cv_ld_reload_flag | |
840 | test -n "$reload_flag" && reload_flag=" $reload_flag" | |
841 | ]) | |
842 | ||
843 | # AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies | |
844 | # -- PORTME fill in with the dynamic library characteristics | |
845 | AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], | |
846 | [AC_CACHE_CHECK([how to recognise dependant libraries], | |
847 | lt_cv_deplibs_check_method, | |
848 | [lt_cv_file_magic_cmd='$MAGIC_CMD' | |
849 | lt_cv_file_magic_test_file= | |
850 | lt_cv_deplibs_check_method='unknown' | |
851 | # Need to set the preceding variable on all platforms that support | |
852 | # interlibrary dependencies. | |
853 | # 'none' -- dependencies not supported. | |
854 | # `unknown' -- same as none, but documents that we really don't know. | |
855 | # 'pass_all' -- all dependencies passed with no checks. | |
856 | # 'test_compile' -- check by making test program. | |
857 | # 'file_magic [regex]' -- check by looking for files in library path | |
858 | # which responds to the $file_magic_cmd with a given egrep regex. | |
859 | # If you have `file' or equivalent on your system and you're not sure | |
860 | # whether `pass_all' will *always* work, you probably want this one. | |
861 | ||
862 | case $host_os in | |
863 | aix*) | |
864 | lt_cv_deplibs_check_method=pass_all | |
865 | ;; | |
866 | ||
867 | beos*) | |
868 | lt_cv_deplibs_check_method=pass_all | |
869 | ;; | |
870 | ||
871 | bsdi4*) | |
872 | lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'] | |
873 | lt_cv_file_magic_cmd='/usr/bin/file -L' | |
874 | lt_cv_file_magic_test_file=/shlib/libc.so | |
875 | ;; | |
876 | ||
877 | cygwin* | mingw* |pw32*) | |
878 | lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' | |
879 | lt_cv_file_magic_cmd='$OBJDUMP -f' | |
880 | ;; | |
881 | ||
882 | darwin* | rhapsody*) | |
883 | lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' | |
884 | lt_cv_file_magic_cmd='/usr/bin/file -L' | |
885 | case "$host_os" in | |
886 | rhapsody* | darwin1.[012]) | |
887 | lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System' | |
888 | ;; | |
889 | *) # Darwin 1.3 on | |
890 | lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' | |
891 | ;; | |
892 | esac | |
893 | ;; | |
894 | ||
895 | freebsd* ) | |
896 | if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then | |
897 | case $host_cpu in | |
898 | i*86 ) | |
899 | # Not sure whether the presence of OpenBSD here was a mistake. | |
900 | # Let's accept both of them until this is cleared up. | |
901 | lt_cv_deplibs_check_method=['file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'] | |
902 | lt_cv_file_magic_cmd=/usr/bin/file | |
903 | lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` | |
904 | ;; | |
905 | esac | |
906 | else | |
907 | lt_cv_deplibs_check_method=pass_all | |
908 | fi | |
909 | ;; | |
910 | ||
911 | gnu*) | |
912 | lt_cv_deplibs_check_method=pass_all | |
913 | ;; | |
914 | ||
915 | hpux10.20*|hpux11*) | |
916 | case $host_cpu in | |
917 | hppa*) | |
918 | [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'] | |
919 | lt_cv_file_magic_cmd=/usr/bin/file | |
920 | lt_cv_file_magic_test_file=/usr/lib/libc.sl | |
921 | ;; | |
922 | ia64*) | |
923 | [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'] | |
924 | lt_cv_file_magic_cmd=/usr/bin/file | |
925 | lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so | |
926 | ;; | |
927 | esac | |
928 | ;; | |
929 | ||
930 | irix5* | irix6*) | |
931 | case $host_os in | |
932 | irix5*) | |
933 | # this will be overridden with pass_all, but let us keep it just in case | |
934 | lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" | |
935 | ;; | |
936 | *) | |
937 | case $LD in | |
938 | *-32|*"-32 ") libmagic=32-bit;; | |
939 | *-n32|*"-n32 ") libmagic=N32;; | |
940 | *-64|*"-64 ") libmagic=64-bit;; | |
941 | *) libmagic=never-match;; | |
942 | esac | |
943 | # this will be overridden with pass_all, but let us keep it just in case | |
944 | lt_cv_deplibs_check_method=["file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"] | |
945 | ;; | |
946 | esac | |
947 | lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` | |
948 | lt_cv_deplibs_check_method=pass_all | |
949 | ;; | |
950 | ||
951 | # This must be Linux ELF. | |
952 | linux-gnu*) | |
953 | case $host_cpu in | |
954 | alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) | |
955 | lt_cv_deplibs_check_method=pass_all ;; | |
956 | *) | |
957 | # glibc up to 2.1.1 does not perform some relocations on ARM | |
958 | lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'] ;; | |
959 | esac | |
960 | lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` | |
961 | ;; | |
962 | ||
963 | netbsd*) | |
964 | if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then | |
965 | [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'] | |
966 | else | |
967 | [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'] | |
968 | fi | |
969 | ;; | |
970 | ||
971 | newsos6) | |
972 | [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'] | |
973 | lt_cv_file_magic_cmd=/usr/bin/file | |
974 | lt_cv_file_magic_test_file=/usr/lib/libnls.so | |
975 | ;; | |
976 | ||
977 | osf3* | osf4* | osf5*) | |
978 | # this will be overridden with pass_all, but let us keep it just in case | |
979 | lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' | |
980 | lt_cv_file_magic_test_file=/shlib/libc.so | |
981 | lt_cv_deplibs_check_method=pass_all | |
982 | ;; | |
983 | ||
984 | sco3.2v5*) | |
985 | lt_cv_deplibs_check_method=pass_all | |
986 | ;; | |
987 | ||
988 | solaris*) | |
989 | lt_cv_deplibs_check_method=pass_all | |
990 | lt_cv_file_magic_test_file=/lib/libc.so | |
991 | ;; | |
992 | ||
993 | [sysv5uw[78]* | sysv4*uw2*)] | |
994 | lt_cv_deplibs_check_method=pass_all | |
995 | ;; | |
996 | ||
997 | sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) | |
998 | case $host_vendor in | |
999 | ncr) | |
1000 | lt_cv_deplibs_check_method=pass_all | |
1001 | ;; | |
1002 | motorola) | |
1003 | lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'] | |
1004 | lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` | |
1005 | ;; | |
1006 | esac | |
1007 | ;; | |
1008 | esac | |
1009 | ]) | |
1010 | file_magic_cmd=$lt_cv_file_magic_cmd | |
1011 | deplibs_check_method=$lt_cv_deplibs_check_method | |
1012 | ]) | |
1013 | ||
1014 | ||
2e1a7175 | 1015 | # AC_PROG_NM - find the path to a BSD-compatible name lister |
0953fe64 | 1016 | AC_DEFUN([AC_PROG_NM], |
2e1a7175 | 1017 | [AC_MSG_CHECKING([for BSD-compatible nm]) |
0953fe64 | 1018 | AC_CACHE_VAL(lt_cv_path_NM, |
2e1a7175 TF |
1019 | [if test -n "$NM"; then |
1020 | # Let the user override the test. | |
0953fe64 | 1021 | lt_cv_path_NM="$NM" |
2e1a7175 TF |
1022 | else |
1023 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" | |
1024 | for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do | |
1025 | test -z "$ac_dir" && ac_dir=. | |
0953fe64 TF |
1026 | tmp_nm=$ac_dir/${ac_tool_prefix}nm |
1027 | if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then | |
2e1a7175 TF |
1028 | # Check to see if the nm accepts a BSD-compat flag. |
1029 | # Adding the `sed 1q' prevents false positives on HP-UX, which says: | |
1030 | # nm: unknown option "B" ignored | |
0953fe64 TF |
1031 | # Tru64's nm complains that /dev/null is an invalid object file |
1032 | if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then | |
1033 | lt_cv_path_NM="$tmp_nm -B" | |
2e1a7175 | 1034 | break |
0953fe64 TF |
1035 | elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then |
1036 | lt_cv_path_NM="$tmp_nm -p" | |
2e1a7175 TF |
1037 | break |
1038 | else | |
0953fe64 | 1039 | lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but |
2e1a7175 TF |
1040 | continue # so that we can try to find one that supports BSD flags |
1041 | fi | |
1042 | fi | |
1043 | done | |
1044 | IFS="$ac_save_ifs" | |
0953fe64 | 1045 | test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm |
2e1a7175 | 1046 | fi]) |
0953fe64 | 1047 | NM="$lt_cv_path_NM" |
2e1a7175 TF |
1048 | AC_MSG_RESULT([$NM]) |
1049 | ]) | |
1050 | ||
1051 | # AC_CHECK_LIBM - check for math library | |
0953fe64 | 1052 | AC_DEFUN([AC_CHECK_LIBM], |
2e1a7175 TF |
1053 | [AC_REQUIRE([AC_CANONICAL_HOST])dnl |
1054 | LIBM= | |
0953fe64 TF |
1055 | case $host in |
1056 | *-*-beos* | *-*-cygwin* | *-*-pw32*) | |
2e1a7175 TF |
1057 | # These system don't have libm |
1058 | ;; | |
1059 | *-ncr-sysv4.3*) | |
1060 | AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") | |
1061 | AC_CHECK_LIB(m, main, LIBM="$LIBM -lm") | |
1062 | ;; | |
1063 | *) | |
1064 | AC_CHECK_LIB(m, main, LIBM="-lm") | |
1065 | ;; | |
1066 | esac | |
1067 | ]) | |
1068 | ||
1069 | # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for | |
0953fe64 TF |
1070 | # the libltdl convenience library and INCLTDL to the include flags for |
1071 | # the libltdl header and adds --enable-ltdl-convenience to the | |
1072 | # configure arguments. Note that LIBLTDL and INCLTDL are not | |
1073 | # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not | |
1074 | # provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed | |
1075 | # with '${top_builddir}/' and INCLTDL will be prefixed with | |
1076 | # '${top_srcdir}/' (note the single quotes!). If your package is not | |
1077 | # flat and you're not using automake, define top_builddir and | |
1078 | # top_srcdir appropriately in the Makefiles. | |
1079 | AC_DEFUN([AC_LIBLTDL_CONVENIENCE], | |
1080 | [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl | |
1081 | case $enable_ltdl_convenience in | |
2e1a7175 TF |
1082 | no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; |
1083 | "") enable_ltdl_convenience=yes | |
1084 | ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; | |
1085 | esac | |
0953fe64 TF |
1086 | LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la |
1087 | INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) | |
2e1a7175 TF |
1088 | ]) |
1089 | ||
1090 | # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for | |
0953fe64 TF |
1091 | # the libltdl installable library and INCLTDL to the include flags for |
1092 | # the libltdl header and adds --enable-ltdl-install to the configure | |
1093 | # arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is | |
1094 | # AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed | |
1095 | # libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will | |
1096 | # be prefixed with '${top_builddir}/' and INCLTDL will be prefixed | |
1097 | # with '${top_srcdir}/' (note the single quotes!). If your package is | |
1098 | # not flat and you're not using automake, define top_builddir and | |
1099 | # top_srcdir appropriately in the Makefiles. | |
2e1a7175 | 1100 | # In the future, this macro may have to be called after AC_PROG_LIBTOOL. |
0953fe64 TF |
1101 | AC_DEFUN([AC_LIBLTDL_INSTALLABLE], |
1102 | [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl | |
2e1a7175 TF |
1103 | AC_CHECK_LIB(ltdl, main, |
1104 | [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], | |
1105 | [if test x"$enable_ltdl_install" = xno; then | |
1106 | AC_MSG_WARN([libltdl not installed, but installation disabled]) | |
1107 | else | |
1108 | enable_ltdl_install=yes | |
1109 | fi | |
1110 | ]) | |
1111 | if test x"$enable_ltdl_install" = x"yes"; then | |
1112 | ac_configure_args="$ac_configure_args --enable-ltdl-install" | |
0953fe64 TF |
1113 | LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la |
1114 | INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) | |
2e1a7175 TF |
1115 | else |
1116 | ac_configure_args="$ac_configure_args --enable-ltdl-install=no" | |
1117 | LIBLTDL="-lltdl" | |
1118 | INCLTDL= | |
1119 | fi | |
1120 | ]) | |
1121 | ||
0953fe64 TF |
1122 | # If this macro is not defined by Autoconf, define it here. |
1123 | ifdef([AC_PROVIDE_IFELSE], | |
1124 | [], | |
1125 | [define([AC_PROVIDE_IFELSE], | |
1126 | [ifdef([AC_PROVIDE_$1], | |
1127 | [$2], [$3])])]) | |
1128 | ||
1129 | # AC_LIBTOOL_CXX - enable support for C++ libraries | |
1130 | AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_AC_LIBTOOL_CXX])]) | |
1131 | ||
1132 | AC_DEFUN([_AC_LIBTOOL_CXX], | |
1133 | [AC_REQUIRE([AC_PROG_CXX]) | |
1134 | AC_REQUIRE([AC_PROG_CXXCPP]) | |
1135 | LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-cxx.sh" | |
1136 | lt_save_CC="$CC" | |
1137 | lt_save_CFLAGS="$CFLAGS" | |
1138 | dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC | |
1139 | dnl is set to the C++ compiler. | |
1140 | AR="$AR" LTCC="$CC" CC="$CXX" CXX="$CXX" CFLAGS="$CXXFLAGS" CPPFLAGS="$CPPFLAGS" \ | |
1141 | MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ | |
1142 | LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \ | |
1143 | AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \ | |
1144 | objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \ | |
1145 | deplibs_check_method="$deplibs_check_method" \ | |
1146 | file_magic_cmd="$file_magic_cmd" \ | |
1147 | ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \ | |
1148 | --build="$build" --add-tag=CXX $ac_aux_dir/ltcf-cxx.sh $host \ | |
1149 | || AC_MSG_ERROR([libtool tag configuration failed]) | |
1150 | CC="$lt_save_CC" | |
1151 | CFLAGS="$lt_save_CFLAGS" | |
1152 | ||
1153 | # Redirect the config.log output again, so that the ltconfig log is not | |
1154 | # clobbered by the next message. | |
1155 | exec 5>>./config.log | |
1156 | ]) | |
1157 | ||
1158 | # AC_LIBTOOL_GCJ - enable support for GCJ libraries | |
1159 | AC_DEFUN([AC_LIBTOOL_GCJ],[AC_REQUIRE([_AC_LIBTOOL_GCJ])]) | |
1160 | ||
1161 | AC_DEFUN([_AC_LIBTOOL_GCJ], | |
1162 | [AC_REQUIRE([AC_PROG_LIBTOOL]) | |
1163 | AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], | |
1164 | [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], | |
1165 | [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], | |
1166 | [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], | |
1167 | [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], | |
1168 | [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) | |
1169 | LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-gcj.sh" | |
1170 | lt_save_CC="$CC" | |
1171 | lt_save_CFLAGS="$CFLAGS" | |
1172 | dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC | |
1173 | dnl is set to the C++ compiler. | |
1174 | AR="$AR" LTCC="$CC" CC="$GCJ" CFLAGS="$GCJFLAGS" CPPFLAGS="$CPPFLAGS" \ | |
1175 | MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ | |
1176 | LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \ | |
1177 | AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \ | |
1178 | objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \ | |
1179 | deplibs_check_method="$deplibs_check_method" \ | |
1180 | file_magic_cmd="$file_magic_cmd" \ | |
1181 | ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \ | |
1182 | --build="$build" --add-tag=GCJ $ac_aux_dir/ltcf-gcj.sh $host \ | |
1183 | || AC_MSG_ERROR([libtool tag configuration failed]) | |
1184 | CC="$lt_save_CC" | |
1185 | CFLAGS="$lt_save_CFLAGS" | |
1186 | ||
1187 | # Redirect the config.log output again, so that the ltconfig log is not | |
1188 | # clobbered by the next message. | |
1189 | exec 5>>./config.log | |
1190 | ]) | |
1191 | ||
2e1a7175 | 1192 | dnl old names |
0953fe64 TF |
1193 | AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) |
1194 | AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) | |
1195 | AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) | |
1196 | AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) | |
1197 | AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) | |
1198 | AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) | |
1199 | AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) | |
2e1a7175 TF |
1200 | |
1201 | dnl This is just to silence aclocal about the macro not being used | |
1202 | ifelse([AC_DISABLE_FAST_INSTALL])dnl | |
1203 | ||
0953fe64 TF |
1204 | AC_DEFUN([LT_AC_PROG_GCJ], |
1205 | [AC_CHECK_TOOL(GCJ, gcj, no) | |
1206 | test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" | |
1207 | AC_SUBST(GCJFLAGS) | |
1208 | ]) | |
1209 |