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