mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 22:10:10 +01:00
Check for dladdr(), rather than assuming we have it if we have RTLD_DEFAULT
Unfortunately, Cygwin defines RTLD_DEFAULT (for glibc compatibility), but can't provide dladdr(), so add a check for dladdr() Since I don't think scons is ever used to build for Cygwin, just set HAVE_DLADDR in SConscript, assuming that if we have RTLD_DEFAULT, we have dladdr(). Cc: Jonathan Gray <jsg@jsg.id.au> Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
parent
6c8f547f66
commit
ec8ebff342
3 changed files with 10 additions and 4 deletions
|
|
@ -480,6 +480,12 @@ AC_CHECK_FUNC([dlopen], [DEFINES="$DEFINES -DHAVE_DLOPEN"],
|
||||||
[DEFINES="$DEFINES -DHAVE_DLOPEN"; DLOPEN_LIBS="-ldl"])])
|
[DEFINES="$DEFINES -DHAVE_DLOPEN"; DLOPEN_LIBS="-ldl"])])
|
||||||
AC_SUBST([DLOPEN_LIBS])
|
AC_SUBST([DLOPEN_LIBS])
|
||||||
|
|
||||||
|
dnl Check if that library also has dladdr
|
||||||
|
save_LDFLAGS="$LDFLAGS"
|
||||||
|
LDFLAGS="$LDFLAGS $DLOPEN_LIBS"
|
||||||
|
AC_CHECK_FUNCS([dladdr])
|
||||||
|
LDFLAGS="$save_LDFLAGS"
|
||||||
|
|
||||||
case "$host_os" in
|
case "$host_os" in
|
||||||
darwin*|mingw*)
|
darwin*|mingw*)
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ drienv.Replace(CPPPATH = [
|
||||||
driswenv = drienv.Clone()
|
driswenv = drienv.Clone()
|
||||||
driswenv.Append(CPPDEFINES = [
|
driswenv.Append(CPPDEFINES = [
|
||||||
'__NOT_HAVE_DRM_H',
|
'__NOT_HAVE_DRM_H',
|
||||||
|
'HAVE_DLADDR',
|
||||||
])
|
])
|
||||||
|
|
||||||
drienv.PkgUseModules('DRM')
|
drienv.PkgUseModules('DRM')
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,9 @@
|
||||||
|
|
||||||
/* We need GNU extensions to dlfcn.h in order to provide backward
|
/* We need GNU extensions to dlfcn.h in order to provide backward
|
||||||
* compatibility for the older DRI driver loader mechanism. (dladdr,
|
* compatibility for the older DRI driver loader mechanism. (dladdr,
|
||||||
* Dl_info, and RTLD_DEFAULT are only defined when _GNU_SOURCE is
|
* Dl_info, and RTLD_DEFAULT)
|
||||||
* defined.)
|
|
||||||
*/
|
*/
|
||||||
#ifdef RTLD_DEFAULT
|
#if defined(RTLD_DEFAULT) && defined(HAVE_DLADDR)
|
||||||
|
|
||||||
#define MEGADRIVER_STUB_MAX_EXTENSIONS 10
|
#define MEGADRIVER_STUB_MAX_EXTENSIONS 10
|
||||||
#define LIB_PATH_SUFFIX "_dri.so"
|
#define LIB_PATH_SUFFIX "_dri.so"
|
||||||
|
|
@ -148,7 +147,7 @@ megadriver_stub_init(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* RTLD_DEFAULT */
|
#endif /* RTLD_DEFAULT && HAVE_DLADDR */
|
||||||
|
|
||||||
static const
|
static const
|
||||||
__DRIconfig **stub_error_init_screen(__DRIscreen *psp)
|
__DRIconfig **stub_error_init_screen(__DRIscreen *psp)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue