1 # ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*-
3 # Copyright (C) 1999-2008, 2011-2015 Free Software Foundation, Inc.
4 # Written by Thomas Tanner, 1999
6 # This file is free software; the Free Software Foundation gives
7 # unlimited permission to copy and/or distribute it, with or without
8 # modifications, as long as this notice is preserved.
12 # LT_CONFIG_LTDL_DIR(DIRECTORY, [LTDL-MODE])
13 # ------------------------------------------
14 # DIRECTORY contains the libltdl sources. It is okay to call this
15 # function multiple times, as long as the same DIRECTORY is always given.
16 AC_DEFUN([LT_CONFIG_LTDL_DIR],
17 [AC_BEFORE([$0], [LTDL_INIT])
19 ])# LT_CONFIG_LTDL_DIR
21 # We break this out into a separate macro, so that we can call it safely
22 # internally without being caught accidentally by the sed scan in libtoolize.
23 m4_defun([_LT_CONFIG_LTDL_DIR],
24 [dnl remove trailing slashes
25 m4_pushdef([_ARG_DIR], m4_bpatsubst([$1], [/*$]))
27 [], [dnl only set lt_ltdl_dir if _ARG_DIR is not simply '.'
30 [m4_define([_LTDL_DIR], _ARG_DIR)
31 _LT_SHELL_INIT([lt_ltdl_dir=']_ARG_DIR['])])],
32 [m4_if(_ARG_DIR, _LTDL_DIR,
34 [m4_fatal([multiple libltdl directories: ']_LTDL_DIR[', ']_ARG_DIR['])])])
36 ])# _LT_CONFIG_LTDL_DIR
39 m4_define([_LTDL_DIR], [])
44 # If Autoconf is new enough, expand to '$(top_build_prefix)', otherwise
45 # to '$(top_builddir)/'.
46 m4_define([_LT_BUILD_PREFIX],
47 [m4_ifdef([AC_AUTOCONF_VERSION],
48 [m4_if(m4_version_compare(m4_defn([AC_AUTOCONF_VERSION]), [2.62]),
49 [-1], [m4_ifdef([_AC_HAVE_TOP_BUILD_PREFIX],
50 [$(top_build_prefix)],
52 [$(top_build_prefix)])],
53 [$(top_builddir)/])[]dnl
59 # sets LIBLTDL to the link flags for the libltdl convenience library and
60 # LTDLINCL to the include flags for the libltdl header and adds
61 # --enable-ltdl-convenience to the configure arguments. Note that
62 # AC_CONFIG_SUBDIRS is not called here. LIBLTDL will be prefixed with
63 # '$(top_build_prefix)' if available, otherwise with '$(top_builddir)/',
64 # and LTDLINCL will be prefixed with '$(top_srcdir)/' (note the single
65 # quotes!). If your package is not flat and you're not using automake,
66 # define top_build_prefix, top_builddir, and top_srcdir appropriately
68 AC_DEFUN([LTDL_CONVENIENCE],
69 [AC_BEFORE([$0], [LTDL_INIT])dnl
70 dnl Although the argument is deprecated and no longer documented,
71 dnl LTDL_CONVENIENCE used to take a DIRECTORY orgument, if we have one
72 dnl here make sure it is the same as any other declaration of libltdl's
73 dnl location! This also ensures lt_ltdl_dir is set when configure.ac is
74 dnl not yet using an explicit LT_CONFIG_LTDL_DIR.
75 m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl
79 # AC_LIBLTDL_CONVENIENCE accepted a directory argument in older libtools,
80 # now we have LT_CONFIG_LTDL_DIR:
81 AU_DEFUN([AC_LIBLTDL_CONVENIENCE],
82 [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])])
85 dnl aclocal-1.4 backwards compatibility:
86 dnl AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [])
91 # Code shared by LTDL_CONVENIENCE and LTDL_INIT([convenience]).
92 m4_defun([_LTDL_CONVENIENCE],
93 [case $enable_ltdl_convenience in
94 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
95 "") enable_ltdl_convenience=yes
96 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
98 LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdlc.la"
100 LTDLINCL='-I$(top_srcdir)'"${lt_ltdl_dir+/$lt_ltdl_dir}"
106 # For backwards non-gettext consistent compatibility...
109 ])# _LTDL_CONVENIENCE
114 # sets LIBLTDL to the link flags for the libltdl installable library
115 # and LTDLINCL to the include flags for the libltdl header and adds
116 # --enable-ltdl-install to the configure arguments. Note that
117 # AC_CONFIG_SUBDIRS is not called from here. If an installed libltdl
118 # is not found, LIBLTDL will be prefixed with '$(top_build_prefix)' if
119 # available, otherwise with '$(top_builddir)/', and LTDLINCL will be
120 # prefixed with '$(top_srcdir)/' (note the single quotes!). If your
121 # package is not flat and you're not using automake, define top_build_prefix,
122 # top_builddir, and top_srcdir appropriately in your Makefiles.
123 # In the future, this macro may have to be called after LT_INIT.
124 AC_DEFUN([LTDL_INSTALLABLE],
125 [AC_BEFORE([$0], [LTDL_INIT])dnl
126 dnl Although the argument is deprecated and no longer documented,
127 dnl LTDL_INSTALLABLE used to take a DIRECTORY orgument, if we have one
128 dnl here make sure it is the same as any other declaration of libltdl's
129 dnl location! This also ensures lt_ltdl_dir is set when configure.ac is
130 dnl not yet using an explicit LT_CONFIG_LTDL_DIR.
131 m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl
135 # AC_LIBLTDL_INSTALLABLE accepted a directory argument in older libtools,
136 # now we have LT_CONFIG_LTDL_DIR:
137 AU_DEFUN([AC_LIBLTDL_INSTALLABLE],
138 [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])])
141 dnl aclocal-1.4 backwards compatibility:
142 dnl AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [])
147 # Code shared by LTDL_INSTALLABLE and LTDL_INIT([installable]).
148 m4_defun([_LTDL_INSTALLABLE],
149 [if test -f "$prefix/lib/libltdl.la"; then
150 lt_save_LDFLAGS=$LDFLAGS
151 LDFLAGS="-L$prefix/lib $LDFLAGS"
152 AC_CHECK_LIB([ltdl], [lt_dlinit], [lt_lib_ltdl=yes])
153 LDFLAGS=$lt_save_LDFLAGS
154 if test yes = "${lt_lib_ltdl-no}"; then
155 if test yes != "$enable_ltdl_install"; then
156 # Don't overwrite $prefix/lib/libltdl.la without --enable-ltdl-install
157 AC_MSG_WARN([not overwriting libltdl at $prefix, force with '--enable-ltdl-install'])
158 enable_ltdl_install=no
160 elif test no = "$enable_ltdl_install"; then
161 AC_MSG_WARN([libltdl not installed, but installation disabled])
165 # If configure.ac declared an installable ltdl, and the user didn't override
166 # with --disable-ltdl-install, we will install the shipped libltdl.
167 case $enable_ltdl_install in
168 no) ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
173 *) enable_ltdl_install=yes
174 ac_configure_args="$ac_configure_args --enable-ltdl-install"
175 LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdl.la"
177 LTDLINCL='-I$(top_srcdir)'"${lt_ltdl_dir+/$lt_ltdl_dir}"
185 # For backwards non-gettext consistent compatibility...
191 # _LTDL_MODE_DISPATCH
192 # -------------------
193 m4_define([_LTDL_MODE_DISPATCH],
194 [dnl If _LTDL_DIR is '.', then we are configuring libltdl itself:
197 dnl if _LTDL_MODE was not set already, the default value is 'subproject':
198 [m4_case(m4_default(_LTDL_MODE, [subproject]),
199 [subproject], [AC_CONFIG_SUBDIRS(_LTDL_DIR)
200 _LT_SHELL_INIT([lt_dlopen_dir=$lt_ltdl_dir])],
201 [nonrecursive], [_LT_SHELL_INIT([lt_dlopen_dir=$lt_ltdl_dir; lt_libobj_prefix=$lt_ltdl_dir/])],
203 [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])])dnl
204 dnl Be careful not to expand twice:
206 ])# _LTDL_MODE_DISPATCH
209 # _LT_LIBOBJ(MODULE_NAME)
210 # -----------------------
211 # Like AC_LIBOBJ, except that MODULE_NAME goes into _LT_LIBOBJS instead
213 AC_DEFUN([_LT_LIBOBJ], [
214 m4_pattern_allow([^_LT_LIBOBJS$])
215 _LT_LIBOBJS="$_LT_LIBOBJS $1.$ac_objext"
219 # LTDL_INIT([OPTIONS])
220 # --------------------
221 # Clients of libltdl can use this macro to allow the installer to
222 # choose between a shipped copy of the ltdl sources or a preinstalled
223 # version of the library. If the shipped ltdl sources are not in a
224 # subdirectory named libltdl, the directory name must be given by
225 # LT_CONFIG_LTDL_DIR.
226 AC_DEFUN([LTDL_INIT],
228 _LT_SET_OPTIONS([$0], [$1])
230 dnl We need to keep our own list of libobjs separate from our parent project,
231 dnl and the easiest way to do that is redefine the AC_LIBOBJs macro while
232 dnl we look for our own LIBOBJs.
233 m4_pushdef([AC_LIBOBJ], m4_defn([_LT_LIBOBJ]))
234 m4_pushdef([AC_LIBSOURCES])
236 dnl If not otherwise defined, default to the 1.5.x compatible subproject mode:
237 m4_if(_LTDL_MODE, [],
238 [m4_define([_LTDL_MODE], m4_default([$2], [subproject]))
239 m4_if([-1], [m4_bregexp(_LTDL_MODE, [\(subproject\|\(non\)?recursive\)])],
240 [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])])
242 AC_ARG_WITH([included_ltdl],
243 [AS_HELP_STRING([--with-included-ltdl],
244 [use the GNU ltdl sources included here])])
246 if test yes != "$with_included_ltdl"; then
247 # We are not being forced to use the included libltdl sources, so
248 # decide whether there is a useful installed version we can use.
249 AC_CHECK_HEADER([ltdl.h],
250 [AC_CHECK_DECL([lt_dlinterface_register],
251 [AC_CHECK_LIB([ltdl], [lt_dladvise_preload],
252 [with_included_ltdl=no],
253 [with_included_ltdl=yes])],
254 [with_included_ltdl=yes],
256 #include <ltdl.h>])],
257 [with_included_ltdl=yes],
258 [AC_INCLUDES_DEFAULT]
262 dnl If neither LT_CONFIG_LTDL_DIR, LTDL_CONVENIENCE nor LTDL_INSTALLABLE
263 dnl was called yet, then for old times' sake, we assume libltdl is in an
264 dnl eponymous directory:
265 AC_PROVIDE_IFELSE([LT_CONFIG_LTDL_DIR], [], [_LT_CONFIG_LTDL_DIR([libltdl])])
267 AC_ARG_WITH([ltdl_include],
268 [AS_HELP_STRING([--with-ltdl-include=DIR],
269 [use the ltdl headers installed in DIR])])
271 if test -n "$with_ltdl_include"; then
272 if test -f "$with_ltdl_include/ltdl.h"; then :
274 AC_MSG_ERROR([invalid ltdl include directory: '$with_ltdl_include'])
280 AC_ARG_WITH([ltdl_lib],
281 [AS_HELP_STRING([--with-ltdl-lib=DIR],
282 [use the libltdl.la installed in DIR])])
284 if test -n "$with_ltdl_lib"; then
285 if test -f "$with_ltdl_lib/libltdl.la"; then :
287 AC_MSG_ERROR([invalid ltdl library directory: '$with_ltdl_lib'])
293 case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in
295 m4_case(m4_default(_LTDL_TYPE, [convenience]),
296 [convenience], [_LTDL_CONVENIENCE],
297 [installable], [_LTDL_INSTALLABLE],
298 [m4_fatal([unknown libltdl build type: ]_LTDL_TYPE)])
301 # If the included ltdl is not to be used, then use the
302 # preinstalled libltdl we found.
303 AC_DEFINE([HAVE_LTDL], [1],
304 [Define this if a modern libltdl is already installed])
310 AC_MSG_ERROR(['--with-ltdl-include' and '--with-ltdl-lib' options must be used together])
312 *) with_included_ltdl=no
313 LIBLTDL="-L$with_ltdl_lib -lltdl"
315 LTDLINCL=-I$with_ltdl_include
320 # Report our decision...
321 AC_MSG_CHECKING([where to find libltdl headers])
322 AC_MSG_RESULT([$LTDLINCL])
323 AC_MSG_CHECKING([where to find libltdl library])
324 AC_MSG_RESULT([$LIBLTDL])
328 dnl restore autoconf definition.
329 m4_popdef([AC_LIBOBJ])
330 m4_popdef([AC_LIBSOURCES])
332 AC_CONFIG_COMMANDS_PRE([
335 if test -n "$_LT_LIBOBJS"; then
336 # Remove the extension.
337 _lt_sed_drop_objext='s/\.o$//;s/\.obj$//'
338 for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | sed "$_lt_sed_drop_objext" | sort -u`; do
339 _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext"
340 _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo"
343 AC_SUBST([ltdl_LIBOBJS], [$_ltdl_libobjs])
344 AC_SUBST([ltdl_LTLIBOBJS], [$_ltdl_ltlibobjs])
348 m4_define([LTDL_INIT])
352 AU_DEFUN([AC_LIB_LTDL], [LTDL_INIT($@)])
353 AU_DEFUN([AC_WITH_LTDL], [LTDL_INIT($@)])
354 AU_DEFUN([LT_WITH_LTDL], [LTDL_INIT($@)])
355 dnl aclocal-1.4 backwards compatibility:
356 dnl AC_DEFUN([AC_LIB_LTDL], [])
357 dnl AC_DEFUN([AC_WITH_LTDL], [])
358 dnl AC_DEFUN([LT_WITH_LTDL], [])
363 # Perform all the checks necessary for compilation of the ltdl objects
364 # -- including compiler checks and header checks. This is a public
365 # interface mainly for the benefit of libltdl's own configure.ac, most
366 # other users should call LTDL_INIT instead.
367 AC_DEFUN([_LTDL_SETUP],
368 [AC_REQUIRE([AC_PROG_CC])dnl
369 AC_REQUIRE([LT_SYS_MODULE_EXT])dnl
370 AC_REQUIRE([LT_SYS_MODULE_PATH])dnl
371 AC_REQUIRE([LT_SYS_DLSEARCH_PATH])dnl
372 AC_REQUIRE([LT_LIB_DLLOAD])dnl
373 AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl
374 AC_REQUIRE([LT_FUNC_DLSYM_USCORE])dnl
375 AC_REQUIRE([LT_SYS_DLOPEN_DEPLIBS])dnl
376 AC_REQUIRE([LT_FUNC_ARGZ])dnl
378 m4_require([_LT_CHECK_OBJDIR])dnl
379 m4_require([_LT_HEADER_DLFCN])dnl
380 m4_require([_LT_CHECK_DLPREOPEN])dnl
381 m4_require([_LT_DECL_SED])dnl
383 dnl Don't require this, or it will be expanded earlier than the code
384 dnl that sets the variables it relies on:
387 dnl _LTDL_MODE specific code must be called at least once:
390 # In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS
391 # the user used. This is so that ltdl.h can pick up the parent projects
392 # config.h file, The first file in AC_CONFIG_HEADERS must contain the
393 # definitions required by ltdl.c.
394 # FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility).
395 AC_CONFIG_COMMANDS_PRE([dnl
396 m4_pattern_allow([^LT_CONFIG_H$])dnl
397 m4_ifset([AH_HEADER],
398 [LT_CONFIG_H=AH_HEADER],
399 [m4_ifset([AC_LIST_HEADERS],
400 [LT_CONFIG_H=`echo "AC_LIST_HEADERS" | $SED 's|^[[ ]]*||;s|[[ :]].*$||'`],
402 AC_SUBST([LT_CONFIG_H])
404 AC_CHECK_HEADERS([unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h],
405 [], [], [AC_INCLUDES_DEFAULT])
407 AC_CHECK_FUNCS([closedir opendir readdir], [], [AC_LIBOBJ([lt__dirent])])
408 AC_CHECK_FUNCS([strlcat strlcpy], [], [AC_LIBOBJ([lt__strl])])
410 m4_pattern_allow([LT_LIBEXT])dnl
411 AC_DEFINE_UNQUOTED([LT_LIBEXT],["$libext"],[The archive extension])
414 eval "lt_libprefix=\"$libname_spec\""
415 m4_pattern_allow([LT_LIBPREFIX])dnl
416 AC_DEFINE_UNQUOTED([LT_LIBPREFIX],["$lt_libprefix"],[The archive prefix])
419 eval "LTDLOPEN=\"$libname_spec\""
426 m4_define([_LT_ENABLE_INSTALL],
427 [AC_ARG_ENABLE([ltdl-install],
428 [AS_HELP_STRING([--enable-ltdl-install], [install libltdl])])
430 case ,$enable_ltdl_install,$enable_ltdl_convenience in
432 *) enable_ltdl_convenience=yes ;;
435 m4_ifdef([AM_CONDITIONAL],
436 [AM_CONDITIONAL(INSTALL_LTDL, test no != "${enable_ltdl_install-no}")
437 AM_CONDITIONAL(CONVENIENCE_LTDL, test no != "${enable_ltdl_convenience-no}")])
438 ])# _LT_ENABLE_INSTALL
441 # LT_SYS_DLOPEN_DEPLIBS
442 # ---------------------
443 AC_DEFUN([LT_SYS_DLOPEN_DEPLIBS],
444 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
445 AC_CACHE_CHECK([whether deplibs are loaded by dlopen],
446 [lt_cv_sys_dlopen_deplibs],
447 [# PORTME does your system automatically load deplibs for dlopen?
448 # or its logical equivalent (e.g. shl_load for HP-UX < 11)
449 # For now, we just catch OSes we know something about -- in the
450 # future, we'll try test this programmatically.
451 lt_cv_sys_dlopen_deplibs=unknown
453 aix3*|aix4.1.*|aix4.2.*)
454 # Unknown whether this is true for these versions of AIX, but
455 # we want this 'case' here to explicitly catch those versions.
456 lt_cv_sys_dlopen_deplibs=unknown
459 lt_cv_sys_dlopen_deplibs=yes
464 lt_cv_sys_dlopen_deplibs=no
469 lt_cv_sys_dlopen_deplibs=yes
472 # Assuming the user has installed a libdl from somewhere, this is true
473 # If you are looking for one http://www.opendarwin.org/projects/dlcompat
474 lt_cv_sys_dlopen_deplibs=yes
476 freebsd* | dragonfly*)
477 lt_cv_sys_dlopen_deplibs=yes
479 gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu)
480 # GNU and its variants, using gnu ld.so (Glibc)
481 lt_cv_sys_dlopen_deplibs=yes
484 lt_cv_sys_dlopen_deplibs=yes
487 lt_cv_sys_dlopen_deplibs=yes
489 irix[[12345]]*|irix6.[[01]]*)
490 # Catch all versions of IRIX before 6.2, and indicate that we don't
491 # know how it worked for any of those versions.
492 lt_cv_sys_dlopen_deplibs=unknown
495 # The case above catches anything before 6.2, and it's known that
496 # at 6.2 and later dlopen does load deplibs.
497 lt_cv_sys_dlopen_deplibs=yes
500 lt_cv_sys_dlopen_deplibs=yes
503 lt_cv_sys_dlopen_deplibs=yes
506 # dlopen did load deplibs (at least at 4.x), but until the 5.x series,
507 # it did *not* use an RPATH in a shared library to find objects the
508 # library depends on, so we explicitly say 'no'.
509 lt_cv_sys_dlopen_deplibs=no
511 osf5.0|osf5.0a|osf5.1)
512 # dlopen *does* load deplibs and with the right loader patch applied
513 # it even uses RPATH in a shared library to search for shared objects
514 # that the library depends on, but there's no easy way to know if that
515 # patch is installed. Since this is the case, all we can really
516 # say is unknown -- it depends on the patch being installed. If
517 # it is, this changes to 'yes'. Without it, it would be 'no'.
518 lt_cv_sys_dlopen_deplibs=unknown
521 # the two cases above should catch all versions of osf <= 5.1. Read
522 # the comments above for what we know about them.
523 # At > 5.1, deplibs are loaded *and* any RPATH in a shared library
524 # is used to find them so we can finally say 'yes'.
525 lt_cv_sys_dlopen_deplibs=yes
528 lt_cv_sys_dlopen_deplibs=yes
531 lt_cv_sys_dlopen_deplibs=yes
533 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
534 libltdl_cv_sys_dlopen_deplibs=yes
538 if test yes != "$lt_cv_sys_dlopen_deplibs"; then
539 AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1],
540 [Define if the OS needs help to load dependent libraries for dlopen().])
542 ])# LT_SYS_DLOPEN_DEPLIBS
545 AU_ALIAS([AC_LTDL_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS])
546 dnl aclocal-1.4 backwards compatibility:
547 dnl AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], [])
552 AC_DEFUN([LT_SYS_MODULE_EXT],
553 [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl
554 AC_CACHE_CHECK([what extension is used for runtime loadable modules],
555 [libltdl_cv_shlibext],
558 eval libltdl_cv_shlibext=$shrext_cmds
560 eval libltdl_cv_shrext=$shrext_cmds
562 if test -n "$libltdl_cv_shlibext"; then
563 m4_pattern_allow([LT_MODULE_EXT])dnl
564 AC_DEFINE_UNQUOTED([LT_MODULE_EXT], ["$libltdl_cv_shlibext"],
565 [Define to the extension used for runtime loadable modules, say, ".so".])
567 if test "$libltdl_cv_shrext" != "$libltdl_cv_shlibext"; then
568 m4_pattern_allow([LT_SHARED_EXT])dnl
569 AC_DEFINE_UNQUOTED([LT_SHARED_EXT], ["$libltdl_cv_shrext"],
570 [Define to the shared library suffix, say, ".dylib".])
572 if test -n "$shared_archive_member_spec"; then
573 m4_pattern_allow([LT_SHARED_LIB_MEMBER])dnl
574 AC_DEFINE_UNQUOTED([LT_SHARED_LIB_MEMBER], ["($shared_archive_member_spec.o)"],
575 [Define to the shared archive member specification, say "(shr.o)".])
577 ])# LT_SYS_MODULE_EXT
580 AU_ALIAS([AC_LTDL_SHLIBEXT], [LT_SYS_MODULE_EXT])
581 dnl aclocal-1.4 backwards compatibility:
582 dnl AC_DEFUN([AC_LTDL_SHLIBEXT], [])
587 AC_DEFUN([LT_SYS_MODULE_PATH],
588 [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl
589 AC_CACHE_CHECK([what variable specifies run-time module search path],
590 [lt_cv_module_path_var], [lt_cv_module_path_var=$shlibpath_var])
591 if test -n "$lt_cv_module_path_var"; then
592 m4_pattern_allow([LT_MODULE_PATH_VAR])dnl
593 AC_DEFINE_UNQUOTED([LT_MODULE_PATH_VAR], ["$lt_cv_module_path_var"],
594 [Define to the name of the environment variable that determines the run-time module search path.])
596 ])# LT_SYS_MODULE_PATH
599 AU_ALIAS([AC_LTDL_SHLIBPATH], [LT_SYS_MODULE_PATH])
600 dnl aclocal-1.4 backwards compatibility:
601 dnl AC_DEFUN([AC_LTDL_SHLIBPATH], [])
604 # LT_SYS_DLSEARCH_PATH
605 # --------------------
606 AC_DEFUN([LT_SYS_DLSEARCH_PATH],
607 [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl
608 AC_CACHE_CHECK([for the default library search path],
609 [lt_cv_sys_dlsearch_path],
610 [lt_cv_sys_dlsearch_path=$sys_lib_dlsearch_path_spec])
611 if test -n "$lt_cv_sys_dlsearch_path"; then
613 for dir in $lt_cv_sys_dlsearch_path; do
614 if test -z "$sys_dlsearch_path"; then
615 sys_dlsearch_path=$dir
617 sys_dlsearch_path=$sys_dlsearch_path$PATH_SEPARATOR$dir
620 m4_pattern_allow([LT_DLSEARCH_PATH])dnl
621 AC_DEFINE_UNQUOTED([LT_DLSEARCH_PATH], ["$sys_dlsearch_path"],
622 [Define to the system default library search path.])
624 ])# LT_SYS_DLSEARCH_PATH
627 AU_ALIAS([AC_LTDL_SYSSEARCHPATH], [LT_SYS_DLSEARCH_PATH])
628 dnl aclocal-1.4 backwards compatibility:
629 dnl AC_DEFUN([AC_LTDL_SYSSEARCHPATH], [])
632 # _LT_CHECK_DLPREOPEN
633 # -------------------
634 m4_defun([_LT_CHECK_DLPREOPEN],
635 [m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
636 AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen],
637 [libltdl_cv_preloaded_symbols],
638 [if test -n "$lt_cv_sys_global_symbol_pipe"; then
639 libltdl_cv_preloaded_symbols=yes
641 libltdl_cv_preloaded_symbols=no
644 if test yes = "$libltdl_cv_preloaded_symbols"; then
645 AC_DEFINE([HAVE_PRELOADED_SYMBOLS], [1],
646 [Define if libtool can extract symbol lists from object files.])
648 ])# _LT_CHECK_DLPREOPEN
653 AC_DEFUN([LT_LIB_DLLOAD],
654 [m4_pattern_allow([^LT_DLLOADERS$])
656 AC_SUBST([LT_DLLOADERS])
659 lt_dlload_save_LIBS=$LIBS
662 AC_SEARCH_LIBS([dlopen], [dl],
663 [AC_DEFINE([HAVE_LIBDL], [1],
664 [Define if you have the libdl library or equivalent.])
665 if test "$ac_cv_search_dlopen" != "none required"; then
668 libltdl_cv_lib_dl_dlopen=yes
669 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"],
670 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_DLFCN_H
673 ]], [[dlopen(0, 0);]])],
674 [AC_DEFINE([HAVE_LIBDL], [1],
675 [Define if you have the libdl library or equivalent.])
676 libltdl_cv_func_dlopen=yes
677 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"],
678 [AC_CHECK_LIB([svld], [dlopen],
679 [AC_DEFINE([HAVE_LIBDL], [1],
680 [Define if you have the libdl library or equivalent.])
681 LIBADD_DLOPEN=-lsvld libltdl_cv_func_dlopen=yes
682 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"])])])
683 if test yes = "$libltdl_cv_func_dlopen" || test yes = "$libltdl_cv_lib_dl_dlopen"
686 LIBS="$LIBS $LIBADD_DLOPEN"
687 AC_CHECK_FUNCS([dlerror])
690 AC_SUBST([LIBADD_DLOPEN])
693 AC_CHECK_FUNC([shl_load],
694 [AC_DEFINE([HAVE_SHL_LOAD], [1],
695 [Define if you have the shl_load function.])
696 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"],
697 [AC_CHECK_LIB([dld], [shl_load],
698 [AC_DEFINE([HAVE_SHL_LOAD], [1],
699 [Define if you have the shl_load function.])
700 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"
701 LIBADD_SHL_LOAD=-ldld])])
702 AC_SUBST([LIBADD_SHL_LOAD])
706 # We only want this for pre-Mac OS X 10.4.
707 AC_CHECK_FUNC([_dyld_func_lookup],
708 [AC_DEFINE([HAVE_DYLD], [1],
709 [Define if you have the _dyld_func_lookup function.])
710 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la"])
713 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la"
715 cygwin* | mingw* | pw32*)
716 AC_CHECK_DECLS([cygwin_conv_path], [], [], [[#include <sys/cygwin.h>]])
717 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la"
721 AC_CHECK_LIB([dld], [dld_link],
722 [AC_DEFINE([HAVE_DLD], [1],
723 [Define if you have the GNU dld library.])
724 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la"])
725 AC_SUBST([LIBADD_DLD_LINK])
727 m4_pattern_allow([^LT_DLPREOPEN$])
729 if test -n "$LT_DLLOADERS"
731 for lt_loader in $LT_DLLOADERS; do
732 LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader "
734 AC_DEFINE([HAVE_LIBDLLOADER], [1],
735 [Define if libdlloader will be built on this platform])
737 AC_SUBST([LT_DLPREOPEN])
739 dnl This isn't used anymore, but set it for backwards compatibility
740 LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD"
741 AC_SUBST([LIBADD_DL])
743 LIBS=$lt_dlload_save_LIBS
748 AU_ALIAS([AC_LTDL_DLLIB], [LT_LIB_DLLOAD])
749 dnl aclocal-1.4 backwards compatibility:
750 dnl AC_DEFUN([AC_LTDL_DLLIB], [])
753 # LT_SYS_SYMBOL_USCORE
754 # --------------------
755 # does the compiler prefix global symbols with an underscore?
756 AC_DEFUN([LT_SYS_SYMBOL_USCORE],
757 [m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
758 AC_CACHE_CHECK([for _ prefix in compiled symbols],
759 [lt_cv_sys_symbol_underscore],
760 [lt_cv_sys_symbol_underscore=no
761 cat > conftest.$ac_ext <<_LT_EOF
762 void nm_test_func(){}
763 int main(){nm_test_func;return 0;}
765 if AC_TRY_EVAL(ac_compile); then
766 # Now try to grab the symbols.
768 if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
769 # See whether the symbols have a leading underscore.
770 if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
771 lt_cv_sys_symbol_underscore=yes
773 if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
776 echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD
780 echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
783 echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
784 cat conftest.c >&AS_MESSAGE_LOG_FD
788 sys_symbol_underscore=$lt_cv_sys_symbol_underscore
789 AC_SUBST([sys_symbol_underscore])
790 ])# LT_SYS_SYMBOL_USCORE
793 AU_ALIAS([AC_LTDL_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE])
794 dnl aclocal-1.4 backwards compatibility:
795 dnl AC_DEFUN([AC_LTDL_SYMBOL_USCORE], [])
798 # LT_FUNC_DLSYM_USCORE
799 # --------------------
800 AC_DEFUN([LT_FUNC_DLSYM_USCORE],
801 [AC_REQUIRE([_LT_COMPILER_PIC])dnl for lt_prog_compiler_wl
802 AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl for lt_cv_sys_symbol_underscore
803 AC_REQUIRE([LT_SYS_MODULE_EXT])dnl for libltdl_cv_shlibext
804 if test yes = "$lt_cv_sys_symbol_underscore"; then
805 if test yes = "$libltdl_cv_func_dlopen" || test yes = "$libltdl_cv_lib_dl_dlopen"; then
806 AC_CACHE_CHECK([whether we have to add an underscore for dlsym],
807 [libltdl_cv_need_uscore],
808 [libltdl_cv_need_uscore=unknown
809 dlsym_uscore_save_LIBS=$LIBS
810 LIBS="$LIBS $LIBADD_DLOPEN"
811 libname=conftmod # stay within 8.3 filename limits!
812 cat >$libname.$ac_ext <<_LT_EOF
813 [#line $LINENO "configure"
814 #include "confdefs.h"
815 /* When -fvisibility=hidden is used, assume the code has been annotated
816 correspondingly for the symbols needed. */
817 #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
818 int fnord () __attribute__((visibility("default")));
820 int fnord () { return 42; }]
823 # ltfn_module_cmds module_cmds
824 # Execute tilde-delimited MODULE_CMDS with environment primed for
825 # $module_cmds or $archive_cmds type content.
827 {( # subshell avoids polluting parent global environment
828 module_cmds_save_ifs=$IFS; IFS='~'
830 IFS=$module_cmds_save_ifs
831 libobjs=$libname.$ac_objext; lib=$libname$libltdl_cv_shlibext
832 rpath=/not-exists; soname=$libname$libltdl_cv_shlibext; output_objdir=.
833 major=; versuffix=; verstring=; deplibs=
834 ECHO=echo; wl=$lt_prog_compiler_wl; allow_undefined_flag=
837 IFS=$module_cmds_save_ifs
840 # Compile a loadable module using libtool macro expansion results.
841 $CC $pic_flag -c $libname.$ac_ext
842 ltfn_module_cmds "${module_cmds:-$archive_cmds}"
844 # Try to fetch fnord with dlsym().
845 libltdl_dlunknown=0; libltdl_dlnouscore=1; libltdl_dluscore=2
846 cat >conftest.$ac_ext <<_LT_EOF
847 [#line $LINENO "configure"
848 #include "confdefs.h"
855 # define RTLD_GLOBAL DL_GLOBAL
857 # define RTLD_GLOBAL 0
862 # define RTLD_NOW DL_NOW
868 void *handle = dlopen ("`pwd`/$libname$libltdl_cv_shlibext", RTLD_GLOBAL|RTLD_NOW);
869 int status = $libltdl_dlunknown;
871 if (dlsym (handle, "fnord"))
872 status = $libltdl_dlnouscore;
874 if (dlsym (handle, "_fnord"))
875 status = $libltdl_dluscore;
885 if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
886 (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
888 case x$libltdl_status in
889 x$libltdl_dlnouscore) libltdl_cv_need_uscore=no ;;
890 x$libltdl_dluscore) libltdl_cv_need_uscore=yes ;;
891 x*) libltdl_cv_need_uscore=unknown ;;
894 rm -rf conftest* $libname*
895 LIBS=$dlsym_uscore_save_LIBS
900 if test yes = "$libltdl_cv_need_uscore"; then
901 AC_DEFINE([NEED_USCORE], [1],
902 [Define if dlsym() requires a leading underscore in symbol names.])
904 ])# LT_FUNC_DLSYM_USCORE
907 AU_ALIAS([AC_LTDL_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE])
908 dnl aclocal-1.4 backwards compatibility:
909 dnl AC_DEFUN([AC_LTDL_DLSYM_USCORE], [])