Force the ld "no-undefined" flag on Cygwin
[lttng-ust.git] / configure.ac
index de1c0c5fd18c1a9e5236641b596c4c651952cb2a..22d5ee5d6bd782ab8c0a836cfea843b85c89a4bd 100644 (file)
@@ -80,18 +80,22 @@ AC_CHECK_LIB([pthread], [pthread_create])
 AC_CHECK_LIB([uuid], [uuid_generate],
 [
        AC_DEFINE_UNQUOTED([LTTNG_UST_HAVE_LIBUUID], 1, [Has libuuid support.])
+       have_libuuid=yes
 ],
 [
        # libuuid not found, check for uuid_create in libc.
        AC_CHECK_LIB([c], [uuid_create],
        [
                AC_DEFINE_UNQUOTED([LTTNG_UST_HAVE_LIBC_UUID], 1, [Has libc uuid support.])
+               have_libc_uuid=yes
        ],
        [
                AC_MSG_ERROR([Cannot find libuuid uuid_generate nor libc uuid_create. Use [LDFLAGS]=-Ldir to specify its location.])
        ])
 ]
 )
+AM_CONDITIONAL([LTTNG_UST_BUILD_WITH_LIBUUID], [test "x$have_libuuid" = "xyes"])
+AM_CONDITIONAL([LTTNG_UST_BUILD_WITH_LIBC_UUID], [test "x$have_libc_uuid" = "xyes"])
 
 # Checks for header files.
 #AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
@@ -165,6 +169,10 @@ got it
                     [ust_cv_i386_is_x86_64=no])
                     CPPFLAGS="$save_CPPFLAGS"])
     ;;
+    # All symbols must be resolved at link time on Cygwin/MinGW/Windows,
+    # else libtool will not be able to build shared libraries.
+    *-*-cygwin*)
+    LDFLAGS="-Wl,-no-undefined $LDFLAGS";;
 esac
 
 AC_MSG_CHECKING([library format for the host system])
This page took 0.023995 seconds and 4 git commands to generate.