configure.ac: fix static build
authorSamuel Martin <s.martin49@gmail.com>
Sun, 22 Nov 2015 22:38:00 +0000 (23:38 +0100)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 1 Dec 2015 12:16:54 +0000 (07:16 -0500)
For static build, some extra LDFLAGS may be needed.

Using PKG_CHECK_MODULES instead of AC_CHECK_LIB for librairy detection
allows to get all these flags. Then, the LIBS variable can be extended
with everything that is needed.

So, use PKG_CHECK_MODULES for popt and uuid detection; which both depend
on libintl.

This changes fixes build failures triggered with Buildroot, e.g.:
  http://autobuild.buildroot.net/results/0f1/0f1e015a0c5a5ac2beeb5011d31a1e0058a32a0d/build-end.log

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
configure.ac

index 4dee4b4bdd089c8a2cfa1d0701ef82a2e911be9f..9208cb35c4599cbaf6d2bb1bb4960593027ab1f0 100644 (file)
@@ -175,15 +175,17 @@ AC_CHECK_LIB([pthread], [pthread_create], [],
 )
 
 # Check libpopt
-AC_CHECK_LIB([popt], [poptGetContext], [],
+PKG_CHECK_MODULES([POPT], [popt],
+       [LIBS="$LIBS $POPT_LIBS"],
        [AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.])]
 )
 
 AM_PATH_XML2(2.7.6, true, AC_MSG_ERROR(No supported version of libxml2 found.))
 
 # Check for libuuid
-AC_CHECK_LIB([uuid], [uuid_generate],
+PKG_CHECK_MODULES([UUID], [uuid],
 [
+       LIBS="$LIBS $UUID_LIBS"
        AC_DEFINE_UNQUOTED([LTTNG_HAVE_LIBUUID], 1, [Has libuuid support.])
        have_libuuid=yes
 ],
This page took 0.026584 seconds and 4 git commands to generate.