Use both macros as in some cases using AC_CHECK_FUNCS alone may fail.
Thus HAVE_DLADDR will not be defined, and as a result most of the code
in megadriver_stub.c will not be compiled. Breaking the backwards
compatibility between older libGL/xserver(s) and DRI megadrivers.
Cc: Jon TURNEY <jon.turney@dronecode.org.uk>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
[Emil Velikov] Commit message.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
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"
+AC_CHECK_FUNC([dladdr], [DEFINES="$DEFINES -DHAVE_DLADDR"],
+ [AC_CHECK_LIB([dl], [dladdr],
+ [DEFINES="$DEFINES -DHAVE_DLADDR"])])
case "$host_os" in
darwin*|mingw*)