diff options
author | Eric Anholt <[email protected]> | 2008-03-20 17:28:58 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2008-03-21 14:19:30 -0700 |
commit | 050c533cbfe957ba84b2c933b33f8f876010bf9b (patch) | |
tree | b8ea9cdb0e8b6e9e0eca24e71a7efd5ef641904f | |
parent | bcb61987fb7260894065e4fc5aa246317e1a3ff4 (diff) |
autoconf: automatically detect if -ldl is required.
This logic was copied from the xserver.
-rw-r--r-- | configure.ac | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 504d9acdc91..99657eb20a9 100644 --- a/configure.ac +++ b/configure.ac @@ -43,6 +43,11 @@ if test "x$GCC" = xyes; then fi AC_SUBST(MKDEP_OPTIONS) +dnl Check to see if dlopen is in default libraries (like Solaris, which +dnl has it in libc), or if libdl is needed to get it. +AC_CHECK_FUNC([dlopen], [], + AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl")) + dnl Make sure the pkg-config macros are defined m4_ifdef([PKG_PROG_PKG_CONFIG],,[ AC_MSG_ERROR([The pkg-config autoconf macros are not defined. @@ -399,7 +404,7 @@ dri) fi # need DRM libs, -lpthread, etc. - GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread -ldl" + GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS" ;; osmesa) # No libGL for osmesa @@ -550,7 +555,7 @@ if test "$mesa_driver" = dri; then AC_MSG_ERROR([Expat required for DRI.])) # put all the necessary libs together - DRI_LIB_DEPS="$SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread -ldl" + DRI_LIB_DEPS="$SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS" fi AC_SUBST(DRI_DIRS) AC_SUBST(EXPAT_INCLUDES) |