diff options
author | Gergely Nagy <algernon@balabit.hu> | 2012-03-24 16:06:05 +0100 |
---|---|---|
committer | Gergely Nagy <algernon@balabit.hu> | 2012-03-24 16:06:05 +0100 |
commit | edd3b75417caafeb1c6476c2958a970d8f799437 (patch) | |
tree | 982a1c7b39a4fd2c3062a81208e037d8058eb52d | |
parent | c515ced437047b459cfce6b6a34eb572558566f9 (diff) | |
download | libumberlog-edd3b75417caafeb1c6476c2958a970d8f799437.tar.gz libumberlog-edd3b75417caafeb1c6476c2958a970d8f799437.tar.xz libumberlog-edd3b75417caafeb1c6476c2958a970d8f799437.zip |
More portability fixes
While on glibc-based systems, we need -ldl (for dlopen) and -lrt (for
clock_gettime), FreeBSD has both in libc, and does not have these
extra libraries.
Teach configure about this.
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
-rw-r--r-- | configure.ac | 12 | ||||
-rw-r--r-- | lib/Makefile.am | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index f2c37b8..6879c3a 100644 --- a/configure.ac +++ b/configure.ac @@ -41,6 +41,18 @@ dnl *************************************************************************** dnl Checks for libraries AC_CHECK_FUNCS([gethostname strdup clock_gettime]) +dnl The dlopen() function is in the C library for *BSD and in +dnl libdl on GLIBC-based systems +AC_SEARCH_LIBS([dlopen], [dl dld], [], [ + AC_MSG_ERROR([unable to find the dlopen() function]) +]) + +dnl Similarly, clock_gettime is in the C library on *BSD, and in librt +dnl on GLIBC-based systems. +AC_SEARCH_LIBS([clock_gettime], [rt], [], [ + AC_MSG_ERROR([unable to find the clock_gettime() function]) +]) + dnl *************************************************************************** dnl JSON-C headers/libraries dnl *************************************************************************** diff --git a/lib/Makefile.am b/lib/Makefile.am index 030ae4e..768484e 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -4,7 +4,7 @@ LUL_AGE = 0 lib_LTLIBRARIES = libumberlog.la libumberlog_la_LDFLAGS = -Wl,--version-script,${srcdir}/libumberlog.ld -libumberlog_la_LIBADD = @JSON_LIBS@ -ldl -lrt +libumberlog_la_LIBADD = @JSON_LIBS@ libumberlog_la_CFLAGS = @JSON_CFLAGS@ libumberlog_la_SOURCES = umberlog.c umberlog.h |