GUACAMOLE-325: Explicitly check for libdl, using it if provided and warning if both libdl and dlopen() are absent.

This commit is contained in:
Michael Jumper 2017-06-10 14:39:03 -07:00
parent 9dcddd1947
commit 7b8d250bd5
2 changed files with 9 additions and 3 deletions

View File

@ -63,6 +63,13 @@ AC_CHECK_LIB([pthread], [pthread_create], [PTHREAD_LIBS=-lpthread
AC_DEFINE([HAVE_LIBPTHREAD],,
[Whether libpthread was found])])
# Include libdl for dlopen() if necessary
AC_CHECK_LIB([dl], [dlopen],
[DL_LIBS=-ldl],
[AC_CHECK_DECL([dlopen],,
AC_MSG_ERROR("libdl is required on systems which do not otherwise provide dlopen()"),
[#include <dlfcn.h>])])
# OSSP UUID
AC_CHECK_LIB([ossp-uuid], [uuid_make], [UUID_LIBS=-lossp-uuid],
AC_CHECK_LIB([uuid], [uuid_make], [UUID_LIBS=-luuid],
@ -85,7 +92,7 @@ AC_CHECK_LIB([cunit], [CU_run_test], [CUNIT_LIBS=-lcunit])
# WinSock
AC_CHECK_LIB([wsock32], [main])
AC_SUBST(LIBADD_DLOPEN)
AC_SUBST(DL_LIBS)
AC_SUBST(MATH_LIBS)
AC_SUBST(PNG_LIBS)
AC_SUBST(JPEG_LIBS)

View File

@ -114,6 +114,7 @@ libguac_la_CFLAGS = \
libguac_la_LDFLAGS = \
-version-info 14:0:2 \
@CAIRO_LIBS@ \
@DL_LIBS@ \
@JPEG_LIBS@ \
@PNG_LIBS@ \
@PTHREAD_LIBS@ \
@ -122,5 +123,3 @@ libguac_la_LDFLAGS = \
@VORBIS_LIBS@ \
@WEBP_LIBS@
libguac_la_LIBADD = \
@LIBADD_DLOPEN@