1 Description: Fix linking with binutils-gold
2 1) commit:ddd5c96759c994dee2c8b0d20dff38b7e7853148
3 Fix bug #1870 GNU binutils-gold build failure.
5 Use some extra libtool magic to determine what lib to use
6 to get dlopen and friends for loading plugins from libbac.
8 2) commit:e72fe7a6a2b65b907f5a89f77117ffa28404a95a
9 Fix bug #1880 ltdl.m4 missing for new feature.
10 Bug-Debian: 553956
11 Bug: http://bugs.bacula.org/view.php?id=1870
12 Bug: http://bugs.bacula.org/view.php?id=1880
13 Origin: upstream
14 Author: Marco van Wieringen <mvw@planets.elm.net>
15 Reviewed-by: Luca Capello <luca@pca.it>
16 Reviewed-by: Alexander Golovko <alexandro@ankalagon.ru>
17 Last-Update: 2012-06-02
19 --- a/autoconf/Make.common.in
20 +++ b/autoconf/Make.common.in
21 @@ -90,6 +90,7 @@
22 PYTHON_LIBS = @PYTHON_LIBS@
23 PYTHON_INC = @PYTHON_INCDIR@
24 OPENSSL_LIBS = @OPENSSL_LIBS@
25 +DLLIBS = @LIBADD_DLOPEN@
28 # Windows (cygwin) flags
29 --- a/autoconf/aclocal.m4
30 +++ b/autoconf/aclocal.m4
31 @@ -16,6 +16,7 @@
32 m4_include([libtool/ltsugar.m4])
33 m4_include([libtool/ltversion.m4])
34 m4_include([libtool/lt~obsolete.m4])
35 +m4_include([libtool/ltdl.m4])
36 m4_include([gettext-macros/codeset.m4])
37 m4_include([gettext-macros/gettext.m4])
38 m4_include([gettext-macros/glibc2.m4])
39 --- a/autoconf/configure.in
40 +++ b/autoconf/configure.in
41 @@ -178,6 +178,7 @@
42 ]
43 )
44 LT_INIT([shared disable-static])
45 +LT_LIB_DLLOAD
46 LT_LANG([C++])
48 if test x$use_libtool != xno; then
49 --- a/src/lib/Makefile.in
50 +++ b/src/lib/Makefile.in
51 @@ -120,7 +120,7 @@
53 libbac.la: Makefile $(LIBBAC_LOBJS)
54 @echo "Making $@ ..."
55 - $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(LIBBAC_LOBJS) -export-dynamic -rpath $(libdir) -release $(LIBBAC_LT_RELEASE) $(WRAPLIBS) $(CAP_LIBS) $(ZLIBS) $(OPENSSL_LIBS) $(LIBS)
56 + $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(LIBBAC_LOBJS) -export-dynamic -rpath $(libdir) -release $(LIBBAC_LT_RELEASE) $(WRAPLIBS) $(CAP_LIBS) $(ZLIBS) $(OPENSSL_LIBS) $(LIBS) $(DLLIBS)
58 libbaccfg.a: $(LIBBACCFG_OBJS)
59 @echo "Making $@ ..."
60 --- /dev/null
61 +++ b/autoconf/libtool/ltdl.m4
62 @@ -0,0 +1,817 @@
63 +# ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*-
64 +#
65 +# Copyright (C) 1999-2006, 2007, 2008, 2011 Free Software Foundation, Inc.
66 +# Written by Thomas Tanner, 1999
67 +#
68 +# This file is free software; the Free Software Foundation gives
69 +# unlimited permission to copy and/or distribute it, with or without
70 +# modifications, as long as this notice is preserved.
71 +
72 +# serial 18 LTDL_INIT
73 +
74 +# LT_CONFIG_LTDL_DIR(DIRECTORY, [LTDL-MODE])
75 +# ------------------------------------------
76 +# DIRECTORY contains the libltdl sources. It is okay to call this
77 +# function multiple times, as long as the same DIRECTORY is always given.
78 +AC_DEFUN([LT_CONFIG_LTDL_DIR],
79 +[AC_BEFORE([$0], [LTDL_INIT])
80 +_$0($*)
81 +])# LT_CONFIG_LTDL_DIR
82 +
83 +# We break this out into a separate macro, so that we can call it safely
84 +# internally without being caught accidentally by the sed scan in libtoolize.
85 +m4_defun([_LT_CONFIG_LTDL_DIR],
86 +[dnl remove trailing slashes
87 +m4_pushdef([_ARG_DIR], m4_bpatsubst([$1], [/*$]))
88 +m4_case(_LTDL_DIR,
89 + [], [dnl only set lt_ltdl_dir if _ARG_DIR is not simply `.'
90 + m4_if(_ARG_DIR, [.],
91 + [],
92 + [m4_define([_LTDL_DIR], _ARG_DIR)
93 + _LT_SHELL_INIT([lt_ltdl_dir=']_ARG_DIR['])])],
94 + [m4_if(_ARG_DIR, _LTDL_DIR,
95 + [],
96 + [m4_fatal([multiple libltdl directories: `]_LTDL_DIR[', `]_ARG_DIR['])])])
97 +m4_popdef([_ARG_DIR])
98 +])# _LT_CONFIG_LTDL_DIR
99 +
100 +# Initialise:
101 +m4_define([_LTDL_DIR], [])
102 +
103 +
104 +# _LT_BUILD_PREFIX
105 +# ----------------
106 +# If Autoconf is new enough, expand to `${top_build_prefix}', otherwise
107 +# to `${top_builddir}/'.
108 +m4_define([_LT_BUILD_PREFIX],
109 +[m4_ifdef([AC_AUTOCONF_VERSION],
110 + [m4_if(m4_version_compare(m4_defn([AC_AUTOCONF_VERSION]), [2.62]),
111 + [-1], [m4_ifdef([_AC_HAVE_TOP_BUILD_PREFIX],
112 + [${top_build_prefix}],
113 + [${top_builddir}/])],
114 + [${top_build_prefix}])],
115 + [${top_builddir}/])[]dnl
116 +])
117 +
118 +
119 +# LTDL_CONVENIENCE
120 +# ----------------
121 +# sets LIBLTDL to the link flags for the libltdl convenience library and
122 +# LTDLINCL to the include flags for the libltdl header and adds
123 +# --enable-ltdl-convenience to the configure arguments. Note that
124 +# AC_CONFIG_SUBDIRS is not called here. LIBLTDL will be prefixed with
125 +# '${top_build_prefix}' if available, otherwise with '${top_builddir}/',
126 +# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single
127 +# quotes!). If your package is not flat and you're not using automake,
128 +# define top_build_prefix, top_builddir, and top_srcdir appropriately
129 +# in your Makefiles.
130 +AC_DEFUN([LTDL_CONVENIENCE],
131 +[AC_BEFORE([$0], [LTDL_INIT])dnl
132 +dnl Although the argument is deprecated and no longer documented,
133 +dnl LTDL_CONVENIENCE used to take a DIRECTORY orgument, if we have one
134 +dnl here make sure it is the same as any other declaration of libltdl's
135 +dnl location! This also ensures lt_ltdl_dir is set when configure.ac is
136 +dnl not yet using an explicit LT_CONFIG_LTDL_DIR.
137 +m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl
138 +_$0()
139 +])# LTDL_CONVENIENCE
140 +
141 +# AC_LIBLTDL_CONVENIENCE accepted a directory argument in older libtools,
142 +# now we have LT_CONFIG_LTDL_DIR:
143 +AU_DEFUN([AC_LIBLTDL_CONVENIENCE],
144 +[_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])])
145 +_LTDL_CONVENIENCE])
146 +
147 +dnl aclocal-1.4 backwards compatibility:
148 +dnl AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [])
149 +
150 +
151 +# _LTDL_CONVENIENCE
152 +# -----------------
153 +# Code shared by LTDL_CONVENIENCE and LTDL_INIT([convenience]).
154 +m4_defun([_LTDL_CONVENIENCE],
155 +[case $enable_ltdl_convenience in
156 + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
157 + "") enable_ltdl_convenience=yes
158 + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
159 +esac
160 +LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdlc.la"
161 +LTDLDEPS=$LIBLTDL
162 +LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}"
163 +
164 +AC_SUBST([LIBLTDL])
165 +AC_SUBST([LTDLDEPS])
166 +AC_SUBST([LTDLINCL])
167 +
168 +# For backwards non-gettext consistent compatibility...
169 +INCLTDL="$LTDLINCL"
170 +AC_SUBST([INCLTDL])
171 +])# _LTDL_CONVENIENCE
172 +
173 +
174 +# LTDL_INSTALLABLE
175 +# ----------------
176 +# sets LIBLTDL to the link flags for the libltdl installable library
177 +# and LTDLINCL to the include flags for the libltdl header and adds
178 +# --enable-ltdl-install to the configure arguments. Note that
179 +# AC_CONFIG_SUBDIRS is not called from here. If an installed libltdl
180 +# is not found, LIBLTDL will be prefixed with '${top_build_prefix}' if
181 +# available, otherwise with '${top_builddir}/', and LTDLINCL will be
182 +# prefixed with '${top_srcdir}/' (note the single quotes!). If your
183 +# package is not flat and you're not using automake, define top_build_prefix,
184 +# top_builddir, and top_srcdir appropriately in your Makefiles.
185 +# In the future, this macro may have to be called after LT_INIT.
186 +AC_DEFUN([LTDL_INSTALLABLE],
187 +[AC_BEFORE([$0], [LTDL_INIT])dnl
188 +dnl Although the argument is deprecated and no longer documented,
189 +dnl LTDL_INSTALLABLE used to take a DIRECTORY orgument, if we have one
190 +dnl here make sure it is the same as any other declaration of libltdl's
191 +dnl location! This also ensures lt_ltdl_dir is set when configure.ac is
192 +dnl not yet using an explicit LT_CONFIG_LTDL_DIR.
193 +m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl
194 +_$0()
195 +])# LTDL_INSTALLABLE
196 +
197 +# AC_LIBLTDL_INSTALLABLE accepted a directory argument in older libtools,
198 +# now we have LT_CONFIG_LTDL_DIR:
199 +AU_DEFUN([AC_LIBLTDL_INSTALLABLE],
200 +[_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])])
201 +_LTDL_INSTALLABLE])
202 +
203 +dnl aclocal-1.4 backwards compatibility:
204 +dnl AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [])
205 +
206 +
207 +# _LTDL_INSTALLABLE
208 +# -----------------
209 +# Code shared by LTDL_INSTALLABLE and LTDL_INIT([installable]).
210 +m4_defun([_LTDL_INSTALLABLE],
211 +[if test -f $prefix/lib/libltdl.la; then
212 + lt_save_LDFLAGS="$LDFLAGS"
213 + LDFLAGS="-L$prefix/lib $LDFLAGS"
214 + AC_CHECK_LIB([ltdl], [lt_dlinit], [lt_lib_ltdl=yes])
215 + LDFLAGS="$lt_save_LDFLAGS"
216 + if test x"${lt_lib_ltdl-no}" = xyes; then
217 + if test x"$enable_ltdl_install" != xyes; then
218 + # Don't overwrite $prefix/lib/libltdl.la without --enable-ltdl-install
219 + AC_MSG_WARN([not overwriting libltdl at $prefix, force with `--enable-ltdl-install'])
220 + enable_ltdl_install=no
221 + fi
222 + elif test x"$enable_ltdl_install" = xno; then
223 + AC_MSG_WARN([libltdl not installed, but installation disabled])
224 + fi
225 +fi
226 +
227 +# If configure.ac declared an installable ltdl, and the user didn't override
228 +# with --disable-ltdl-install, we will install the shipped libltdl.
229 +case $enable_ltdl_install in
230 + no) ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
231 + LIBLTDL="-lltdl"
232 + LTDLDEPS=
233 + LTDLINCL=
234 + ;;
235 + *) enable_ltdl_install=yes
236 + ac_configure_args="$ac_configure_args --enable-ltdl-install"
237 + LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdl.la"
238 + LTDLDEPS=$LIBLTDL
239 + LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}"
240 + ;;
241 +esac
242 +
243 +AC_SUBST([LIBLTDL])
244 +AC_SUBST([LTDLDEPS])
245 +AC_SUBST([LTDLINCL])
246 +
247 +# For backwards non-gettext consistent compatibility...
248 +INCLTDL="$LTDLINCL"
249 +AC_SUBST([INCLTDL])
250 +])# LTDL_INSTALLABLE
251 +
252 +
253 +# _LTDL_MODE_DISPATCH
254 +# -------------------
255 +m4_define([_LTDL_MODE_DISPATCH],
256 +[dnl If _LTDL_DIR is `.', then we are configuring libltdl itself:
257 +m4_if(_LTDL_DIR, [],
258 + [],
259 + dnl if _LTDL_MODE was not set already, the default value is `subproject':
260 + [m4_case(m4_default(_LTDL_MODE, [subproject]),
261 + [subproject], [AC_CONFIG_SUBDIRS(_LTDL_DIR)
262 + _LT_SHELL_INIT([lt_dlopen_dir="$lt_ltdl_dir"])],
263 + [nonrecursive], [_LT_SHELL_INIT([lt_dlopen_dir="$lt_ltdl_dir"; lt_libobj_prefix="$lt_ltdl_dir/"])],
264 + [recursive], [],
265 + [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])])dnl
266 +dnl Be careful not to expand twice:
267 +m4_define([$0], [])
268 +])# _LTDL_MODE_DISPATCH
269 +
270 +
271 +# _LT_LIBOBJ(MODULE_NAME)
272 +# -----------------------
273 +# Like AC_LIBOBJ, except that MODULE_NAME goes into _LT_LIBOBJS instead
274 +# of into LIBOBJS.
275 +AC_DEFUN([_LT_LIBOBJ], [
276 + m4_pattern_allow([^_LT_LIBOBJS$])
277 + _LT_LIBOBJS="$_LT_LIBOBJS $1.$ac_objext"
278 +])# _LT_LIBOBJS
279 +
280 +
281 +# LTDL_INIT([OPTIONS])
282 +# --------------------
283 +# Clients of libltdl can use this macro to allow the installer to
284 +# choose between a shipped copy of the ltdl sources or a preinstalled
285 +# version of the library. If the shipped ltdl sources are not in a
286 +# subdirectory named libltdl, the directory name must be given by
287 +# LT_CONFIG_LTDL_DIR.
288 +AC_DEFUN([LTDL_INIT],
289 +[dnl Parse OPTIONS
290 +_LT_SET_OPTIONS([$0], [$1])
291 +
292 +dnl We need to keep our own list of libobjs separate from our parent project,
293 +dnl and the easiest way to do that is redefine the AC_LIBOBJs macro while
294 +dnl we look for our own LIBOBJs.
295 +m4_pushdef([AC_LIBOBJ], m4_defn([_LT_LIBOBJ]))
296 +m4_pushdef([AC_LIBSOURCES])
297 +
298 +dnl If not otherwise defined, default to the 1.5.x compatible subproject mode:
299 +m4_if(_LTDL_MODE, [],
300 + [m4_define([_LTDL_MODE], m4_default([$2], [subproject]))
301 + m4_if([-1], [m4_bregexp(_LTDL_MODE, [\(subproject\|\(non\)?recursive\)])],
302 + [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])])
303 +
304 +AC_ARG_WITH([included_ltdl],
305 + [AS_HELP_STRING([--with-included-ltdl],
306 + [use the GNU ltdl sources included here])])
307 +
308 +if test "x$with_included_ltdl" != xyes; then
309 + # We are not being forced to use the included libltdl sources, so
310 + # decide whether there is a useful installed version we can use.
311 + AC_CHECK_HEADER([ltdl.h],
312 + [AC_CHECK_DECL([lt_dlinterface_register],
313 + [AC_CHECK_LIB([ltdl], [lt_dladvise_preload],
314 + [with_included_ltdl=no],
315 + [with_included_ltdl=yes])],
316 + [with_included_ltdl=yes],
317 + [AC_INCLUDES_DEFAULT
318 + #include <ltdl.h>])],
319 + [with_included_ltdl=yes],
320 + [AC_INCLUDES_DEFAULT]
321 + )
322 +fi
323 +
324 +dnl If neither LT_CONFIG_LTDL_DIR, LTDL_CONVENIENCE nor LTDL_INSTALLABLE
325 +dnl was called yet, then for old times' sake, we assume libltdl is in an
326 +dnl eponymous directory:
327 +AC_PROVIDE_IFELSE([LT_CONFIG_LTDL_DIR], [], [_LT_CONFIG_LTDL_DIR([libltdl])])
328 +
329 +AC_ARG_WITH([ltdl_include],
330 + [AS_HELP_STRING([--with-ltdl-include=DIR],
331 + [use the ltdl headers installed in DIR])])
332 +
333 +if test -n "$with_ltdl_include"; then
334 + if test -f "$with_ltdl_include/ltdl.h"; then :
335 + else
336 + AC_MSG_ERROR([invalid ltdl include directory: `$with_ltdl_include'])
337 + fi
338 +else
339 + with_ltdl_include=no
340 +fi
341 +
342 +AC_ARG_WITH([ltdl_lib],
343 + [AS_HELP_STRING([--with-ltdl-lib=DIR],
344 + [use the libltdl.la installed in DIR])])
345 +
346 +if test -n "$with_ltdl_lib"; then
347 + if test -f "$with_ltdl_lib/libltdl.la"; then :
348 + else
349 + AC_MSG_ERROR([invalid ltdl library directory: `$with_ltdl_lib'])
350 + fi
351 +else
352 + with_ltdl_lib=no
353 +fi
354 +
355 +case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in
356 + ,yes,no,no,)
357 + m4_case(m4_default(_LTDL_TYPE, [convenience]),
358 + [convenience], [_LTDL_CONVENIENCE],
359 + [installable], [_LTDL_INSTALLABLE],
360 + [m4_fatal([unknown libltdl build type: ]_LTDL_TYPE)])
361 + ;;
362 + ,no,no,no,)
363 + # If the included ltdl is not to be used, then use the
364 + # preinstalled libltdl we found.
365 + AC_DEFINE([HAVE_LTDL], [1],
366 + [Define this if a modern libltdl is already installed])
367 + LIBLTDL=-lltdl
368 + LTDLDEPS=
369 + LTDLINCL=
370 + ;;
371 + ,no*,no,*)
372 + AC_MSG_ERROR([`--with-ltdl-include' and `--with-ltdl-lib' options must be used together])
373 + ;;
374 + *) with_included_ltdl=no
375 + LIBLTDL="-L$with_ltdl_lib -lltdl"
376 + LTDLDEPS=
377 + LTDLINCL="-I$with_ltdl_include"
378 + ;;
379 +esac
380 +INCLTDL="$LTDLINCL"
381 +
382 +# Report our decision...
383 +AC_MSG_CHECKING([where to find libltdl headers])
384 +AC_MSG_RESULT([$LTDLINCL])
385 +AC_MSG_CHECKING([where to find libltdl library])
386 +AC_MSG_RESULT([$LIBLTDL])
387 +
388 +_LTDL_SETUP
389 +
390 +dnl restore autoconf definition.
391 +m4_popdef([AC_LIBOBJ])
392 +m4_popdef([AC_LIBSOURCES])
393 +
394 +AC_CONFIG_COMMANDS_PRE([
395 + _ltdl_libobjs=
396 + _ltdl_ltlibobjs=
397 + if test -n "$_LT_LIBOBJS"; then
398 + # Remove the extension.
399 + _lt_sed_drop_objext='s/\.o$//;s/\.obj$//'
400 + for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | sed "$_lt_sed_drop_objext" | sort -u`; do
401 + _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext"
402 + _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo"
403 + done
404 + fi
405 + AC_SUBST([ltdl_LIBOBJS], [$_ltdl_libobjs])
406 + AC_SUBST([ltdl_LTLIBOBJS], [$_ltdl_ltlibobjs])
407 +])
408 +
409 +# Only expand once:
410 +m4_define([LTDL_INIT])
411 +])# LTDL_INIT
412 +
413 +# Old names:
414 +AU_DEFUN([AC_LIB_LTDL], [LTDL_INIT($@)])
415 +AU_DEFUN([AC_WITH_LTDL], [LTDL_INIT($@)])
416 +AU_DEFUN([LT_WITH_LTDL], [LTDL_INIT($@)])
417 +dnl aclocal-1.4 backwards compatibility:
418 +dnl AC_DEFUN([AC_LIB_LTDL], [])
419 +dnl AC_DEFUN([AC_WITH_LTDL], [])
420 +dnl AC_DEFUN([LT_WITH_LTDL], [])
421 +
422 +
423 +# _LTDL_SETUP
424 +# -----------
425 +# Perform all the checks necessary for compilation of the ltdl objects
426 +# -- including compiler checks and header checks. This is a public
427 +# interface mainly for the benefit of libltdl's own configure.ac, most
428 +# other users should call LTDL_INIT instead.
429 +AC_DEFUN([_LTDL_SETUP],
430 +[AC_REQUIRE([AC_PROG_CC])dnl
431 +AC_REQUIRE([LT_SYS_MODULE_EXT])dnl
432 +AC_REQUIRE([LT_SYS_MODULE_PATH])dnl
433 +AC_REQUIRE([LT_SYS_DLSEARCH_PATH])dnl
434 +AC_REQUIRE([LT_LIB_DLLOAD])dnl
435 +AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl
436 +AC_REQUIRE([LT_FUNC_DLSYM_USCORE])dnl
437 +AC_REQUIRE([LT_SYS_DLOPEN_DEPLIBS])dnl
438 +AC_REQUIRE([gl_FUNC_ARGZ])dnl
439 +
440 +m4_require([_LT_CHECK_OBJDIR])dnl
441 +m4_require([_LT_HEADER_DLFCN])dnl
442 +m4_require([_LT_CHECK_DLPREOPEN])dnl
443 +m4_require([_LT_DECL_SED])dnl
444 +
445 +dnl Don't require this, or it will be expanded earlier than the code
446 +dnl that sets the variables it relies on:
447 +_LT_ENABLE_INSTALL
448 +
449 +dnl _LTDL_MODE specific code must be called at least once:
450 +_LTDL_MODE_DISPATCH
451 +
452 +# In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS
453 +# the user used. This is so that ltdl.h can pick up the parent projects
454 +# config.h file, The first file in AC_CONFIG_HEADERS must contain the
455 +# definitions required by ltdl.c.
456 +# FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility).
457 +AC_CONFIG_COMMANDS_PRE([dnl
458 +m4_pattern_allow([^LT_CONFIG_H$])dnl
459 +m4_ifset([AH_HEADER],
460 + [LT_CONFIG_H=AH_HEADER],
461 + [m4_ifset([AC_LIST_HEADERS],
462 + [LT_CONFIG_H=`echo "AC_LIST_HEADERS" | $SED 's,^[[ ]]*,,;s,[[ :]].*$,,'`],
463 + [])])])
464 +AC_SUBST([LT_CONFIG_H])
465 +
466 +AC_CHECK_HEADERS([unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h],
467 + [], [], [AC_INCLUDES_DEFAULT])
468 +
469 +AC_CHECK_FUNCS([closedir opendir readdir], [], [AC_LIBOBJ([lt__dirent])])
470 +AC_CHECK_FUNCS([strlcat strlcpy], [], [AC_LIBOBJ([lt__strl])])
471 +
472 +m4_pattern_allow([LT_LIBEXT])dnl
473 +AC_DEFINE_UNQUOTED([LT_LIBEXT],["$libext"],[The archive extension])
474 +
475 +name=
476 +eval "lt_libprefix=\"$libname_spec\""
477 +m4_pattern_allow([LT_LIBPREFIX])dnl
478 +AC_DEFINE_UNQUOTED([LT_LIBPREFIX],["$lt_libprefix"],[The archive prefix])
479 +
480 +name=ltdl
481 +eval "LTDLOPEN=\"$libname_spec\""
482 +AC_SUBST([LTDLOPEN])
483 +])# _LTDL_SETUP
484 +
485 +
486 +# _LT_ENABLE_INSTALL
487 +# ------------------
488 +m4_define([_LT_ENABLE_INSTALL],
489 +[AC_ARG_ENABLE([ltdl-install],
490 + [AS_HELP_STRING([--enable-ltdl-install], [install libltdl])])
491 +
492 +case ,${enable_ltdl_install},${enable_ltdl_convenience} in
493 + *yes*) ;;
494 + *) enable_ltdl_convenience=yes ;;
495 +esac
496 +
497 +m4_ifdef([AM_CONDITIONAL],
498 +[AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno)
499 + AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)])
500 +])# _LT_ENABLE_INSTALL
501 +
502 +
503 +# LT_SYS_DLOPEN_DEPLIBS
504 +# ---------------------
505 +AC_DEFUN([LT_SYS_DLOPEN_DEPLIBS],
506 +[AC_REQUIRE([AC_CANONICAL_HOST])dnl
507 +AC_CACHE_CHECK([whether deplibs are loaded by dlopen],
508 + [lt_cv_sys_dlopen_deplibs],
509 + [# PORTME does your system automatically load deplibs for dlopen?
510 + # or its logical equivalent (e.g. shl_load for HP-UX < 11)
511 + # For now, we just catch OSes we know something about -- in the
512 + # future, we'll try test this programmatically.
513 + lt_cv_sys_dlopen_deplibs=unknown
514 + case $host_os in
515 + aix3*|aix4.1.*|aix4.2.*)
516 + # Unknown whether this is true for these versions of AIX, but
517 + # we want this `case' here to explicitly catch those versions.
518 + lt_cv_sys_dlopen_deplibs=unknown
519 + ;;
520 + aix[[4-9]]*)
521 + lt_cv_sys_dlopen_deplibs=yes
522 + ;;
523 + amigaos*)
524 + case $host_cpu in
525 + powerpc)
526 + lt_cv_sys_dlopen_deplibs=no
527 + ;;
528 + esac
529 + ;;
530 + darwin*)
531 + # Assuming the user has installed a libdl from somewhere, this is true
532 + # If you are looking for one http://www.opendarwin.org/projects/dlcompat
533 + lt_cv_sys_dlopen_deplibs=yes
534 + ;;
535 + freebsd* | dragonfly*)
536 + lt_cv_sys_dlopen_deplibs=yes
537 + ;;
538 + gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu)
539 + # GNU and its variants, using gnu ld.so (Glibc)
540 + lt_cv_sys_dlopen_deplibs=yes
541 + ;;
542 + hpux10*|hpux11*)
543 + lt_cv_sys_dlopen_deplibs=yes
544 + ;;
545 + interix*)
546 + lt_cv_sys_dlopen_deplibs=yes
547 + ;;
548 + irix[[12345]]*|irix6.[[01]]*)
549 + # Catch all versions of IRIX before 6.2, and indicate that we don't
550 + # know how it worked for any of those versions.
551 + lt_cv_sys_dlopen_deplibs=unknown
552 + ;;
553 + irix*)
554 + # The case above catches anything before 6.2, and it's known that
555 + # at 6.2 and later dlopen does load deplibs.
556 + lt_cv_sys_dlopen_deplibs=yes
557 + ;;
558 + netbsd* | netbsdelf*-gnu)
559 + lt_cv_sys_dlopen_deplibs=yes
560 + ;;
561 + openbsd*)
562 + lt_cv_sys_dlopen_deplibs=yes
563 + ;;
564 + osf[[1234]]*)
565 + # dlopen did load deplibs (at least at 4.x), but until the 5.x series,
566 + # it did *not* use an RPATH in a shared library to find objects the
567 + # library depends on, so we explicitly say `no'.
568 + lt_cv_sys_dlopen_deplibs=no
569 + ;;
570 + osf5.0|osf5.0a|osf5.1)
571 + # dlopen *does* load deplibs and with the right loader patch applied
572 + # it even uses RPATH in a shared library to search for shared objects
573 + # that the library depends on, but there's no easy way to know if that
574 + # patch is installed. Since this is the case, all we can really
575 + # say is unknown -- it depends on the patch being installed. If
576 + # it is, this changes to `yes'. Without it, it would be `no'.
577 + lt_cv_sys_dlopen_deplibs=unknown
578 + ;;
579 + osf*)
580 + # the two cases above should catch all versions of osf <= 5.1. Read
581 + # the comments above for what we know about them.
582 + # At > 5.1, deplibs are loaded *and* any RPATH in a shared library
583 + # is used to find them so we can finally say `yes'.
584 + lt_cv_sys_dlopen_deplibs=yes
585 + ;;
586 + qnx*)
587 + lt_cv_sys_dlopen_deplibs=yes
588 + ;;
589 + solaris*)
590 + lt_cv_sys_dlopen_deplibs=yes
591 + ;;
592 + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
593 + libltdl_cv_sys_dlopen_deplibs=yes
594 + ;;
595 + esac
596 + ])
597 +if test "$lt_cv_sys_dlopen_deplibs" != yes; then
598 + AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1],
599 + [Define if the OS needs help to load dependent libraries for dlopen().])
600 +fi
601 +])# LT_SYS_DLOPEN_DEPLIBS
602 +
603 +# Old name:
604 +AU_ALIAS([AC_LTDL_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS])
605 +dnl aclocal-1.4 backwards compatibility:
606 +dnl AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], [])
607 +
608 +
609 +# LT_SYS_MODULE_EXT
610 +# -----------------
611 +AC_DEFUN([LT_SYS_MODULE_EXT],
612 +[m4_require([_LT_SYS_DYNAMIC_LINKER])dnl
613 +AC_CACHE_CHECK([which extension is used for runtime loadable modules],
614 + [libltdl_cv_shlibext],
615 +[
616 +module=yes
617 +eval libltdl_cv_shlibext=$shrext_cmds
618 +module=no
619 +eval libltdl_cv_shrext=$shrext_cmds
620 + ])
621 +if test -n "$libltdl_cv_shlibext"; then
622 + m4_pattern_allow([LT_MODULE_EXT])dnl
623 + AC_DEFINE_UNQUOTED([LT_MODULE_EXT], ["$libltdl_cv_shlibext"],
624 + [Define to the extension used for runtime loadable modules, say, ".so".])
625 +fi
626 +if test "$libltdl_cv_shrext" != "$libltdl_cv_shlibext"; then
627 + m4_pattern_allow([LT_SHARED_EXT])dnl
628 + AC_DEFINE_UNQUOTED([LT_SHARED_EXT], ["$libltdl_cv_shrext"],
629 + [Define to the shared library suffix, say, ".dylib".])
630 +fi
631 +])# LT_SYS_MODULE_EXT
632 +
633 +# Old name:
634 +AU_ALIAS([AC_LTDL_SHLIBEXT], [LT_SYS_MODULE_EXT])
635 +dnl aclocal-1.4 backwards compatibility:
636 +dnl AC_DEFUN([AC_LTDL_SHLIBEXT], [])
637 +
638 +
639 +# LT_SYS_MODULE_PATH
640 +# ------------------
641 +AC_DEFUN([LT_SYS_MODULE_PATH],
642 +[m4_require([_LT_SYS_DYNAMIC_LINKER])dnl
643 +AC_CACHE_CHECK([which variable specifies run-time module search path],
644 + [lt_cv_module_path_var], [lt_cv_module_path_var="$shlibpath_var"])
645 +if test -n "$lt_cv_module_path_var"; then
646 + m4_pattern_allow([LT_MODULE_PATH_VAR])dnl
647 + AC_DEFINE_UNQUOTED([LT_MODULE_PATH_VAR], ["$lt_cv_module_path_var"],
648 + [Define to the name of the environment variable that determines the run-time module search path.])
649 +fi
650 +])# LT_SYS_MODULE_PATH
651 +
652 +# Old name:
653 +AU_ALIAS([AC_LTDL_SHLIBPATH], [LT_SYS_MODULE_PATH])
654 +dnl aclocal-1.4 backwards compatibility:
655 +dnl AC_DEFUN([AC_LTDL_SHLIBPATH], [])
656 +
657 +
658 +# LT_SYS_DLSEARCH_PATH
659 +# --------------------
660 +AC_DEFUN([LT_SYS_DLSEARCH_PATH],
661 +[m4_require([_LT_SYS_DYNAMIC_LINKER])dnl
662 +AC_CACHE_CHECK([for the default library search path],
663 + [lt_cv_sys_dlsearch_path],
664 + [lt_cv_sys_dlsearch_path="$sys_lib_dlsearch_path_spec"])
665 +if test -n "$lt_cv_sys_dlsearch_path"; then
666 + sys_dlsearch_path=
667 + for dir in $lt_cv_sys_dlsearch_path; do
668 + if test -z "$sys_dlsearch_path"; then
669 + sys_dlsearch_path="$dir"
670 + else
671 + sys_dlsearch_path="$sys_dlsearch_path$PATH_SEPARATOR$dir"
672 + fi
673 + done
674 + m4_pattern_allow([LT_DLSEARCH_PATH])dnl
675 + AC_DEFINE_UNQUOTED([LT_DLSEARCH_PATH], ["$sys_dlsearch_path"],
676 + [Define to the system default library search path.])
677 +fi
678 +])# LT_SYS_DLSEARCH_PATH
679 +
680 +# Old name:
681 +AU_ALIAS([AC_LTDL_SYSSEARCHPATH], [LT_SYS_DLSEARCH_PATH])
682 +dnl aclocal-1.4 backwards compatibility:
683 +dnl AC_DEFUN([AC_LTDL_SYSSEARCHPATH], [])
684 +
685 +
686 +# _LT_CHECK_DLPREOPEN
687 +# -------------------
688 +m4_defun([_LT_CHECK_DLPREOPEN],
689 +[m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
690 +AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen],
691 + [libltdl_cv_preloaded_symbols],
692 + [if test -n "$lt_cv_sys_global_symbol_pipe"; then
693 + libltdl_cv_preloaded_symbols=yes
694 + else
695 + libltdl_cv_preloaded_symbols=no
696 + fi
697 + ])
698 +if test x"$libltdl_cv_preloaded_symbols" = xyes; then
699 + AC_DEFINE([HAVE_PRELOADED_SYMBOLS], [1],
700 + [Define if libtool can extract symbol lists from object files.])
701 +fi
702 +])# _LT_CHECK_DLPREOPEN
703 +
704 +
705 +# LT_LIB_DLLOAD
706 +# -------------
707 +AC_DEFUN([LT_LIB_DLLOAD],
708 +[m4_pattern_allow([^LT_DLLOADERS$])
709 +LT_DLLOADERS=
710 +AC_SUBST([LT_DLLOADERS])
711 +
712 +AC_LANG_PUSH([C])
713 +
714 +LIBADD_DLOPEN=
715 +AC_SEARCH_LIBS([dlopen], [dl],
716 + [AC_DEFINE([HAVE_LIBDL], [1],
717 + [Define if you have the libdl library or equivalent.])
718 + if test "$ac_cv_search_dlopen" != "none required" ; then
719 + LIBADD_DLOPEN="-ldl"
720 + fi
721 + libltdl_cv_lib_dl_dlopen="yes"
722 + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"],
723 + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_DLFCN_H
724 +# include <dlfcn.h>
725 +#endif
726 + ]], [[dlopen(0, 0);]])],
727 + [AC_DEFINE([HAVE_LIBDL], [1],
728 + [Define if you have the libdl library or equivalent.])
729 + libltdl_cv_func_dlopen="yes"
730 + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"],
731 + [AC_CHECK_LIB([svld], [dlopen],
732 + [AC_DEFINE([HAVE_LIBDL], [1],
733 + [Define if you have the libdl library or equivalent.])
734 + LIBADD_DLOPEN="-lsvld" libltdl_cv_func_dlopen="yes"
735 + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"])])])
736 +if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes
737 +then
738 + lt_save_LIBS="$LIBS"
739 + LIBS="$LIBS $LIBADD_DLOPEN"
740 + AC_CHECK_FUNCS([dlerror])
741 + LIBS="$lt_save_LIBS"
742 +fi
743 +AC_SUBST([LIBADD_DLOPEN])
744 +
745 +LIBADD_SHL_LOAD=
746 +AC_CHECK_FUNC([shl_load],
747 + [AC_DEFINE([HAVE_SHL_LOAD], [1],
748 + [Define if you have the shl_load function.])
749 + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"],
750 + [AC_CHECK_LIB([dld], [shl_load],
751 + [AC_DEFINE([HAVE_SHL_LOAD], [1],
752 + [Define if you have the shl_load function.])
753 + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"
754 + LIBADD_SHL_LOAD="-ldld"])])
755 +AC_SUBST([LIBADD_SHL_LOAD])
756 +
757 +case $host_os in
758 +darwin[[1567]].*)
759 +# We only want this for pre-Mac OS X 10.4.
760 + AC_CHECK_FUNC([_dyld_func_lookup],
761 + [AC_DEFINE([HAVE_DYLD], [1],
762 + [Define if you have the _dyld_func_lookup function.])
763 + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la"])
764 + ;;
765 +beos*)
766 + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la"
767 + ;;
768 +cygwin* | mingw* | os2* | pw32*)
769 + AC_CHECK_DECLS([cygwin_conv_path], [], [], [[#include <sys/cygwin.h>]])
770 + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la"
771 + ;;
772 +esac
773 +
774 +AC_CHECK_LIB([dld], [dld_link],
775 + [AC_DEFINE([HAVE_DLD], [1],
776 + [Define if you have the GNU dld library.])
777 + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la"])
778 +AC_SUBST([LIBADD_DLD_LINK])
779 +
780 +m4_pattern_allow([^LT_DLPREOPEN$])
781 +LT_DLPREOPEN=
782 +if test -n "$LT_DLLOADERS"
783 +then
784 + for lt_loader in $LT_DLLOADERS; do
785 + LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader "
786 + done
787 + AC_DEFINE([HAVE_LIBDLLOADER], [1],
788 + [Define if libdlloader will be built on this platform])
789 +fi
790 +AC_SUBST([LT_DLPREOPEN])
791 +
792 +dnl This isn't used anymore, but set it for backwards compatibility
793 +LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD"
794 +AC_SUBST([LIBADD_DL])
795 +
796 +AC_LANG_POP
797 +])# LT_LIB_DLLOAD
798 +
799 +# Old name:
800 +AU_ALIAS([AC_LTDL_DLLIB], [LT_LIB_DLLOAD])
801 +dnl aclocal-1.4 backwards compatibility:
802 +dnl AC_DEFUN([AC_LTDL_DLLIB], [])
803 +
804 +
805 +# LT_SYS_SYMBOL_USCORE
806 +# --------------------
807 +# does the compiler prefix global symbols with an underscore?
808 +AC_DEFUN([LT_SYS_SYMBOL_USCORE],
809 +[m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
810 +AC_CACHE_CHECK([for _ prefix in compiled symbols],
811 + [lt_cv_sys_symbol_underscore],
812 + [lt_cv_sys_symbol_underscore=no
813 + cat > conftest.$ac_ext <<_LT_EOF
814 +void nm_test_func(){}
815 +int main(){nm_test_func;return 0;}
816 +_LT_EOF
817 + if AC_TRY_EVAL(ac_compile); then
818 + # Now try to grab the symbols.
819 + ac_nlist=conftest.nm
820 + if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
821 + # See whether the symbols have a leading underscore.
822 + if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
823 + lt_cv_sys_symbol_underscore=yes
824 + else
825 + if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
826 + :
827 + else
828 + echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD
829 + fi
830 + fi
831 + else
832 + echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
833 + fi
834 + else
835 + echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
836 + cat conftest.c >&AS_MESSAGE_LOG_FD
837 + fi
838 + rm -rf conftest*
839 + ])
840 + sys_symbol_underscore=$lt_cv_sys_symbol_underscore
841 + AC_SUBST([sys_symbol_underscore])
842 +])# LT_SYS_SYMBOL_USCORE
843 +
844 +# Old name:
845 +AU_ALIAS([AC_LTDL_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE])
846 +dnl aclocal-1.4 backwards compatibility:
847 +dnl AC_DEFUN([AC_LTDL_SYMBOL_USCORE], [])
848 +
849 +
850 +# LT_FUNC_DLSYM_USCORE
851 +# --------------------
852 +AC_DEFUN([LT_FUNC_DLSYM_USCORE],
853 +[AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl
854 +if test x"$lt_cv_sys_symbol_underscore" = xyes; then
855 + if test x"$libltdl_cv_func_dlopen" = xyes ||
856 + test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then
857 + AC_CACHE_CHECK([whether we have to add an underscore for dlsym],
858 + [libltdl_cv_need_uscore],
859 + [libltdl_cv_need_uscore=unknown
860 + save_LIBS="$LIBS"
861 + LIBS="$LIBS $LIBADD_DLOPEN"
862 + _LT_TRY_DLOPEN_SELF(
863 + [libltdl_cv_need_uscore=no], [libltdl_cv_need_uscore=yes],
864 + [], [libltdl_cv_need_uscore=cross])
865 + LIBS="$save_LIBS"
866 + ])
867 + fi
868 +fi
869 +
870 +if test x"$libltdl_cv_need_uscore" = xyes; then
871 + AC_DEFINE([NEED_USCORE], [1],
872 + [Define if dlsym() requires a leading underscore in symbol names.])
873 +fi
874 +])# LT_FUNC_DLSYM_USCORE
875 +
876 +# Old name:
877 +AU_ALIAS([AC_LTDL_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE])
878 +dnl aclocal-1.4 backwards compatibility:
879 +dnl AC_DEFUN([AC_LTDL_DLSYM_USCORE], [])
