]> git.lyx.org Git - lyx.git/blob - boost/acinclude.m4
simplify some, ws, begin minibuffer simplification
[lyx.git] / boost / acinclude.m4
1
2 dnl AC_VALIDATE_CACHE_SYSTEM_TYPE[(cmd)]
3 dnl if the cache file is inconsistent with the current host,
4 dnl target and build system types, execute CMD or print a default
5 dnl error message.
6 AC_DEFUN(AC_VALIDATE_CACHE_SYSTEM_TYPE, [
7     AC_REQUIRE([AC_CANONICAL_SYSTEM])
8     AC_MSG_CHECKING([config.cache system type])
9     if { test x"${ac_cv_host_system_type+set}" = x"set" &&
10          test x"$ac_cv_host_system_type" != x"$host"; } ||
11        { test x"${ac_cv_build_system_type+set}" = x"set" &&
12          test x"$ac_cv_build_system_type" != x"$build"; } ||
13        { test x"${ac_cv_target_system_type+set}" = x"set" &&
14          test x"$ac_cv_target_system_type" != x"$target"; }; then
15         AC_MSG_RESULT([different])
16         ifelse($#, 1, [$1],
17                 [AC_MSG_ERROR(["you must remove config.cache and restart configure"])])
18     else
19         AC_MSG_RESULT([same])
20     fi
21     ac_cv_host_system_type="$host"
22     ac_cv_build_system_type="$build"
23     ac_cv_target_system_type="$target"
24 ])
25
26 ## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
27 ## Copyright (C) 1996-1999 Free Software Foundation, Inc.
28 ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
29 ##
30 ## This program is free software; you can redistribute it and/or modify
31 ## it under the terms of the GNU General Public License as published by
32 ## the Free Software Foundation; either version 2 of the License, or
33 ## (at your option) any later version.
34 ##
35 ## This program is distributed in the hope that it will be useful, but
36 ## WITHOUT ANY WARRANTY; without even the implied warranty of
37 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
38 ## General Public License for more details.
39 ##
40 ## You should have received a copy of the GNU General Public License
41 ## along with this program; if not, write to the Free Software
42 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
43 ##
44 ## As a special exception to the GNU General Public License, if you
45 ## distribute this file as part of a program that contains a
46 ## configuration script generated by Autoconf, you may include it under
47 ## the same distribution terms that you use for the rest of that program.
48
49 # serial 40 AC_PROG_LIBTOOL
50 AC_DEFUN(AC_PROG_LIBTOOL,
51 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
52
53 # Save cache, so that ltconfig can load it
54 AC_CACHE_SAVE
55
56 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
57 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
58 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
59 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
60 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
61 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
62 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
63 || AC_MSG_ERROR([libtool configure failed])
64
65 # Reload cache, that may have been modified by ltconfig
66 AC_CACHE_LOAD
67
68 # This can be used to rebuild libtool when needed
69 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
70
71 # Always use our own libtool.
72 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
73 AC_SUBST(LIBTOOL)dnl
74
75 # Redirect the config.log output again, so that the ltconfig log is not
76 # clobbered by the next message.
77 exec 5>>./config.log
78 ])
79
80 AC_DEFUN(AC_LIBTOOL_SETUP,
81 [AC_PREREQ(2.13)dnl
82 AC_REQUIRE([AC_ENABLE_SHARED])dnl
83 AC_REQUIRE([AC_ENABLE_STATIC])dnl
84 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
85 AC_REQUIRE([AC_CANONICAL_HOST])dnl
86 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
87 AC_REQUIRE([AC_PROG_RANLIB])dnl
88 AC_REQUIRE([AC_PROG_CC])dnl
89 AC_REQUIRE([AC_PROG_LD])dnl
90 AC_REQUIRE([AC_PROG_NM])dnl
91 AC_REQUIRE([AC_PROG_LN_S])dnl
92 dnl
93
94 case "$target" in
95 NONE) lt_target="$host" ;;
96 *) lt_target="$target" ;;
97 esac
98
99 # Check for any special flags to pass to ltconfig.
100 libtool_flags="--cache-file=$cache_file"
101 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
102 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
103 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
104 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
105 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
106 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
107 [libtool_flags="$libtool_flags --enable-dlopen"])
108 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
109 [libtool_flags="$libtool_flags --enable-win32-dll"])
110 AC_ARG_ENABLE(libtool-lock,
111   [  --disable-libtool-lock  avoid locking (might break parallel builds)])
112 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
113 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
114
115 # Some flags need to be propagated to the compiler or linker for good
116 # libtool support.
117 case "$lt_target" in
118 *-*-irix6*)
119   # Find out which ABI we are using.
120   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
121   if AC_TRY_EVAL(ac_compile); then
122     case "`/usr/bin/file conftest.o`" in
123     *32-bit*)
124       LD="${LD-ld} -32"
125       ;;
126     *N32*)
127       LD="${LD-ld} -n32"
128       ;;
129     *64-bit*)
130       LD="${LD-ld} -64"
131       ;;
132     esac
133   fi
134   rm -rf conftest*
135   ;;
136
137 *-*-sco3.2v5*)
138   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
139   SAVE_CFLAGS="$CFLAGS"
140   CFLAGS="$CFLAGS -belf"
141   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
142     [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
143   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
144     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
145     CFLAGS="$SAVE_CFLAGS"
146   fi
147   ;;
148
149 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
150 [*-*-cygwin* | *-*-mingw*)
151   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
152   AC_CHECK_TOOL(AS, as, false)
153   AC_CHECK_TOOL(OBJDUMP, objdump, false)
154   ;;
155 ])
156 esac
157 ])
158
159 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
160 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
161
162 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
163 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
164
165 # AC_ENABLE_SHARED - implement the --enable-shared flag
166 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
167 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
168 #   `yes'.
169 AC_DEFUN(AC_ENABLE_SHARED, [dnl
170 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
171 AC_ARG_ENABLE(shared,
172 changequote(<<, >>)dnl
173 <<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
174 changequote([, ])dnl
175 [p=${PACKAGE-default}
176 case "$enableval" in
177 yes) enable_shared=yes ;;
178 no) enable_shared=no ;;
179 *)
180   enable_shared=no
181   # Look at the argument we got.  We use all the common list separators.
182   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
183   for pkg in $enableval; do
184     if test "X$pkg" = "X$p"; then
185       enable_shared=yes
186     fi
187   done
188   IFS="$ac_save_ifs"
189   ;;
190 esac],
191 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
192 ])
193
194 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
195 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
196 AC_ENABLE_SHARED(no)])
197
198 # AC_ENABLE_STATIC - implement the --enable-static flag
199 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
200 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
201 #   `yes'.
202 AC_DEFUN(AC_ENABLE_STATIC, [dnl
203 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
204 AC_ARG_ENABLE(static,
205 changequote(<<, >>)dnl
206 <<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
207 changequote([, ])dnl
208 [p=${PACKAGE-default}
209 case "$enableval" in
210 yes) enable_static=yes ;;
211 no) enable_static=no ;;
212 *)
213   enable_static=no
214   # Look at the argument we got.  We use all the common list separators.
215   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
216   for pkg in $enableval; do
217     if test "X$pkg" = "X$p"; then
218       enable_static=yes
219     fi
220   done
221   IFS="$ac_save_ifs"
222   ;;
223 esac],
224 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
225 ])
226
227 # AC_DISABLE_STATIC - set the default static flag to --disable-static
228 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
229 AC_ENABLE_STATIC(no)])
230
231
232 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
233 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
234 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
235 #   `yes'.
236 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
237 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
238 AC_ARG_ENABLE(fast-install,
239 changequote(<<, >>)dnl
240 <<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
241 changequote([, ])dnl
242 [p=${PACKAGE-default}
243 case "$enableval" in
244 yes) enable_fast_install=yes ;;
245 no) enable_fast_install=no ;;
246 *)
247   enable_fast_install=no
248   # Look at the argument we got.  We use all the common list separators.
249   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
250   for pkg in $enableval; do
251     if test "X$pkg" = "X$p"; then
252       enable_fast_install=yes
253     fi
254   done
255   IFS="$ac_save_ifs"
256   ;;
257 esac],
258 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
259 ])
260
261 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
262 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
263 AC_ENABLE_FAST_INSTALL(no)])
264
265 # AC_PROG_LD - find the path to the GNU or non-GNU linker
266 AC_DEFUN(AC_PROG_LD,
267 [AC_ARG_WITH(gnu-ld,
268 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
269 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
270 AC_REQUIRE([AC_PROG_CC])dnl
271 AC_REQUIRE([AC_CANONICAL_HOST])dnl
272 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
273 ac_prog=ld
274 if test "$ac_cv_prog_gcc" = yes; then
275   # Check if gcc -print-prog-name=ld gives a path.
276   AC_MSG_CHECKING([for ld used by GCC])
277   ac_prog=`($CC -print-prog-name=ld) 2>&5`
278   case "$ac_prog" in
279     # Accept absolute paths.
280 changequote(,)dnl
281     [\\/]* | [A-Za-z]:[\\/]*)
282       re_direlt='/[^/][^/]*/\.\./'
283 changequote([,])dnl
284       # Canonicalize the path of ld
285       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
286       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
287         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
288       done
289       test -z "$LD" && LD="$ac_prog"
290       ;;
291   "")
292     # If it fails, then pretend we aren't using GCC.
293     ac_prog=ld
294     ;;
295   *)
296     # If it is relative, then search for the first ld in PATH.
297     with_gnu_ld=unknown
298     ;;
299   esac
300 elif test "$with_gnu_ld" = yes; then
301   AC_MSG_CHECKING([for GNU ld])
302 else
303   AC_MSG_CHECKING([for non-GNU ld])
304 fi
305 AC_CACHE_VAL(ac_cv_path_LD,
306 [if test -z "$LD"; then
307   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
308   for ac_dir in $PATH; do
309     test -z "$ac_dir" && ac_dir=.
310     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
311       ac_cv_path_LD="$ac_dir/$ac_prog"
312       # Check to see if the program is GNU ld.  I'd rather use --version,
313       # but apparently some GNU ld's only accept -v.
314       # Break only if it was the GNU/non-GNU ld that we prefer.
315       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
316         test "$with_gnu_ld" != no && break
317       else
318         test "$with_gnu_ld" != yes && break
319       fi
320     fi
321   done
322   IFS="$ac_save_ifs"
323 else
324   ac_cv_path_LD="$LD" # Let the user override the test with a path.
325 fi])
326 LD="$ac_cv_path_LD"
327 if test -n "$LD"; then
328   AC_MSG_RESULT($LD)
329 else
330   AC_MSG_RESULT(no)
331 fi
332 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
333 AC_PROG_LD_GNU
334 ])
335
336 AC_DEFUN(AC_PROG_LD_GNU,
337 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
338 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
339 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
340   ac_cv_prog_gnu_ld=yes
341 else
342   ac_cv_prog_gnu_ld=no
343 fi])
344 ])
345
346 # AC_PROG_NM - find the path to a BSD-compatible name lister
347 AC_DEFUN(AC_PROG_NM,
348 [AC_MSG_CHECKING([for BSD-compatible nm])
349 AC_CACHE_VAL(ac_cv_path_NM,
350 [if test -n "$NM"; then
351   # Let the user override the test.
352   ac_cv_path_NM="$NM"
353 else
354   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
355   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
356     test -z "$ac_dir" && ac_dir=.
357     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
358       # Check to see if the nm accepts a BSD-compat flag.
359       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
360       #   nm: unknown option "B" ignored
361       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
362         ac_cv_path_NM="$ac_dir/nm -B"
363         break
364       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
365         ac_cv_path_NM="$ac_dir/nm -p"
366         break
367       else
368         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
369         continue # so that we can try to find one that supports BSD flags
370       fi
371     fi
372   done
373   IFS="$ac_save_ifs"
374   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
375 fi])
376 NM="$ac_cv_path_NM"
377 AC_MSG_RESULT([$NM])
378 ])
379
380 # AC_CHECK_LIBM - check for math library
381 AC_DEFUN(AC_CHECK_LIBM,
382 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
383 LIBM=
384 case "$lt_target" in
385 *-*-beos* | *-*-cygwin*)
386   # These system don't have libm
387   ;;
388 *-ncr-sysv4.3*)
389   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
390   AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
391   ;;
392 *)
393   AC_CHECK_LIB(m, main, LIBM="-lm")
394   ;;
395 esac
396 ])
397
398 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
399 # the libltdl convenience library, adds --enable-ltdl-convenience to
400 # the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
401 # is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
402 # to be `${top_builddir}/libltdl'.  Make sure you start DIR with
403 # '${top_builddir}/' (note the single quotes!) if your package is not
404 # flat, and, if you're not using automake, define top_builddir as
405 # appropriate in the Makefiles.
406 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
407   case "$enable_ltdl_convenience" in
408   no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
409   "") enable_ltdl_convenience=yes
410       ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
411   esac
412   LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
413   INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
414 ])
415
416 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
417 # the libltdl installable library, and adds --enable-ltdl-install to
418 # the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
419 # is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
420 # to be `${top_builddir}/libltdl'.  Make sure you start DIR with
421 # '${top_builddir}/' (note the single quotes!) if your package is not
422 # flat, and, if you're not using automake, define top_builddir as
423 # appropriate in the Makefiles.
424 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
425 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
426   AC_CHECK_LIB(ltdl, main,
427   [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
428   [if test x"$enable_ltdl_install" = xno; then
429      AC_MSG_WARN([libltdl not installed, but installation disabled])
430    else
431      enable_ltdl_install=yes
432    fi
433   ])
434   if test x"$enable_ltdl_install" = x"yes"; then
435     ac_configure_args="$ac_configure_args --enable-ltdl-install"
436     LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
437     INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
438   else
439     ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
440     LIBLTDL="-lltdl"
441     INCLTDL=
442   fi
443 ])
444
445 dnl old names
446 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
447 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
448 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
449 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
450 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
451 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
452 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
453
454 dnl This is just to silence aclocal about the macro not being used
455 ifelse([AC_DISABLE_FAST_INSTALL])dnl