diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2017-01-04 21:39:48 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2017-05-09 15:58:15 +0200 |
commit | cc5e9f2362e2f0088766d150f3149afac29f0d95 (patch) | |
tree | 5451392fe7ddccf7efec33c307e3bc5e7f77add1 | |
parent | 83c1b881fb6402db71d1d2754e883efa457255b9 (diff) | |
download | glib-cc5e9f2362e2f0088766d150f3149afac29f0d95.tar.gz |
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
-rw-r--r-- | configure.ac | 10 | ||||
-rw-r--r-- | gmodule/gmodule-dl.c | 7 |
2 files changed, 14 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index 93e95d0c8..5c57044ef 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 20225df80..e452e3495 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 */ |