Fix building against liblttng-ust-dev 2.8+
authorBrian Robbins <brianrob@microsoft.com>
Mon, 5 Dec 2016 04:16:29 +0000 (20:16 -0800)
committerBrian Robbins <brianrob@microsoft.com>
Tue, 6 Dec 2016 23:59:06 +0000 (15:59 -0800)
src/pal/src/configure.cmake

index f4b83bc..a53e0db 100644 (file)
@@ -33,7 +33,15 @@ check_include_files(sys/lwp.h HAVE_SYS_LWP_H)
 check_include_files(lwp.h HAVE_LWP_H)
 check_include_files(libunwind.h HAVE_LIBUNWIND_H)
 check_include_files(runetype.h HAVE_RUNETYPE_H)
+
+if(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD AND NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
+  set(CMAKE_REQUIRED_FLAGS "-ldl")
+endif()
 check_include_files(lttng/tracepoint.h HAVE_LTTNG_TRACEPOINT_H)
+if(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD AND NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
+  unset(CMAKE_REQUIRED_FLAGS)
+endif()
+
 check_include_files(uuid/uuid.h HAVE_LIBUUID_H)
 check_include_files(sys/sysctl.h HAVE_SYS_SYSCTL_H)
 check_include_files(gnu/lib-names.h HAVE_GNU_LIBNAMES_H)