1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
# Written by Ren Seindal (rene@seindal.dk)
# Hacked by Denis Barbier for mp4h <barbier@engelschall.com>
#
# This file can be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
# serial 1
AC_DEFUN([MP4H_LOADABLE_MODULES],
[AC_MSG_CHECKING(if support for loadable modules is requested)
AC_ARG_WITH(modules,
[ --with-modules=x,y,z select loadable modules to compile],
[with_modules=$withval], [with_modules=yes])
AC_MSG_RESULT($with_modules)
if test ".$with_modules" != .no; then
dnl We might no have it anyway, after all.
select_modules=$with_modules
with_modules=no
dnl Test for dlopen in libc
AC_CHECK_FUNCS([dlopen])
if test "$ac_cv_func_dlopen" = yes; then
with_modules=yes
fi
dnl Test for dlopen in libdl
if test "$with_modules" = no; then
AC_CHECK_LIB(dl, dlopen)
if test "$ac_cv_lib_dl_dlopen" = yes; then
with_modules=yes
# LIBS="$LIBS -ldl"
AC_DEFINE(HAVE_DLOPEN,1,
[Define to 1 if the -ldl library should be used])
fi
fi
# dnl Test for dld_link in libdld
# if test "$with_modules" = no; then
# AC_CHECK_LIB(dld, dld_link)
# if test "$ac_cv_lib_dld_dld_link" = "yes"; then
# with_modules=yes
# AC_DEFINE(HAVE_DLD,1)
# fi
# fi
dnl Test for shl_load in libdld
if test "$with_modules" = no; then
AC_CHECK_LIB(dld, shl_load)
if test "$ac_cv_lib_dld_shl_load" = yes; then
with_modules=yes
# LIBS="$LIBS -ldld"
AC_DEFINE(HAVE_SHL_LOAD, 1,
[Define to 1 if the -ldld library should be used])
fi
fi
if test "$with_modules" != no; then
dnl This is for libtool
DLLDFLAGS=-export-dynamic
AC_DEFINE([WITH_MODULES], 1,
[Define to 1 if there is support for dynamic loading of modules.])
fi
if test "$with_modules" = no; then
AC_MSG_WARN([Loadable modules have not been found on your computer, this feature is disabled])
select_modules=
fi
AC_SUBST(DLLDFLAGS)
with_modules=$select_modules
fi
])
|