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
This commit is contained in:
Sebastian Dröge 2017-01-04 21:39:48 +02:00
parent 83c1b881fb
commit cc5e9f2362
2 changed files with 14 additions and 3 deletions

View File

@ -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,

View File

@ -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 */