[seed] Bug 722080 - Use -ldl is not portable



commit ae57b166a515b38b28bd04b00987588f196f09ba
Author: Ting-Wei Lan <lantw gmail com>
Date:   Tue Jan 14 11:21:55 2014 +0800

    Bug 722080 - Use -ldl is not portable
    
    Some systems do not have libdl, and functions such as dlsym() may already exist
    in libc. We should check whether it is required to link to libdl, or it will
    cause error on systems which does not have libdl.

 configure.ac        |    5 +++++
 libseed/Makefile.am |    1 +
 2 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 67a91d7..2313c09 100644
--- a/configure.ac
+++ b/configure.ac
@@ -271,6 +271,11 @@ AC_ARG_ENABLE(ffi-module,
 AM_CONDITIONAL(BUILD_FFI_MODULE, test "x$want_ffi_module" = "xyes")
 AC_SUBST(BUILD_FFI_MODULE)
 
+dnl ==== libdl ====
+AC_CHECK_LIB([c], [dlsym], [LIBDL=""],
+       [AC_CHECK_LIB([dl], [dlsym], [LIBDL="-ldl"])])
+AC_SUBST(LIBDL)
+
 dnl ==== libxml ====
 AC_ARG_ENABLE(libxml-module,
                          AC_HELP_STRING([--enable-libxml-module],
diff --git a/libseed/Makefile.am b/libseed/Makefile.am
index 5ff186b..19ce834 100644
--- a/libseed/Makefile.am
+++ b/libseed/Makefile.am
@@ -44,6 +44,7 @@ libseed SEED_GTK_VERSION@_la_LIBADD = \
        $(SEED_PROFILE_LIBS) \
        $(SEED_OSX_LIBS) \
        $(GIO_LIBS) \
+       $(GMODULE_LIBS) \
        $(FFI_LIBS) -ldl
 
 seedheaders_HEADERS = seed.h seed-debug.h seed-module.h


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]