[glib] gmodule – Check for RTLD_LAZY and others in configure



commit cc5e9f2362e2f0088766d150f3149afac29f0d95
Author: Sebastian Dröge <sebastian centricular com>
Date:   Wed Jan 4 21:39:48 2017 +0200

    gmodule – Check for RTLD_LAZY and others in configure
    
    They are no #defines on Android but enum values, and on 64 bit Android
    they have different values than what we would otherwise fall-back to.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=776876

 configure.ac         |   10 ++++++++++
 gmodule/gmodule-dl.c |    7 ++++---
 2 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 93e95d0..5c57044 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1489,6 +1489,16 @@ dnl *** check whether we need preceeding underscores
                G_MODULE_NEED_USCORE=0
        fi
 
+        AC_CHECK_DECL([RTLD_LAZY],
+                      [AC_DEFINE(HAVE_RTLD_LAZY, 1, [Define to 1 if RTLD_LAZY is available])],
+                      [], [[#include <dlfcn.h>]])
+        AC_CHECK_DECL([RTLD_NOW],
+                      [AC_DEFINE(HAVE_RTLD_NOW, 1, [Define to 1 if RTLD_NOW is available])],
+                      [], [[#include <dlfcn.h>]])
+        AC_CHECK_DECL([RTLD_GLOBAL],
+                      [AC_DEFINE(HAVE_RTLD_GLOBAL, 1, [Define to 1 if RTLD_GLOBAL is available])],
+                      [], [[#include <dlfcn.h>]])
+
        LDFLAGS="$LDFLAGS_orig"
 dnl *** check for having dlerror()
        AC_CHECK_FUNC(dlerror,
diff --git a/gmodule/gmodule-dl.c b/gmodule/gmodule-dl.c
index 20225df..e452e34 100644
--- a/gmodule/gmodule-dl.c
+++ b/gmodule/gmodule-dl.c
@@ -57,17 +57,18 @@
  * RTLD_GLOBAL - the external symbols defined in the library will be made
  *              available to subsequently loaded libraries.
  */
-#ifndef        RTLD_LAZY
+#ifndef        HAVE_RTLD_LAZY
 #define        RTLD_LAZY       1
 #endif /* RTLD_LAZY */
-#ifndef        RTLD_NOW
+#ifndef        HAVE_RTLD_NOW
 #define        RTLD_NOW        0
 #endif /* RTLD_NOW */
 /* some systems (OSF1 V5.0) have broken RTLD_GLOBAL linkage */
 #ifdef G_MODULE_BROKEN_RTLD_GLOBAL
 #undef RTLD_GLOBAL
+#undef HAVE_RTLD_GLOBAL
 #endif /* G_MODULE_BROKEN_RTLD_GLOBAL */
-#ifndef        RTLD_GLOBAL
+#ifndef        HAVE_RTLD_GLOBAL
 #define        RTLD_GLOBAL     0
 #endif /* RTLD_GLOBAL */
 


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