# Check libpopt
PKG_CHECK_MODULES([POPT], [popt],
- [LIBS="$LIBS $POPT_LIBS"],
- [
- AC_MSG_WARN([pkg-config was unable to find a valid .pc for libpopt. Set PKG_CONFIG_PATH to specify the pkgconfig configuration file location])
- AC_MSG_WARN([Finding libpopt without pkg-config.])
- AC_CHECK_LIB([popt],
- [poptGetContext],
- [],
- [
- AC_MSG_ERROR([Cannot find libpopt. Either set PKG_CONFIG_PATH to the configuration file location or use LDFLAGS=-Ldir to specify the library location])
- ]
- )
- ]
+ [
+ dnl PKG_CHECK_MODULES defines POPT_LIBS
+ ],
+ [
+ AC_MSG_WARN([pkg-config was unable to find a valid .pc for libpopt. Set PKG_CONFIG_PATH to specify the pkgconfig configuration file location])
+ AC_MSG_WARN([Finding libpopt without pkg-config.])
+ AC_CHECK_LIB([popt],
+ [poptGetContext],
+ [POPT_LIBS="-lpopt"],
+ [
+ AC_MSG_FAILURE([Cannot find libpopt. Either set PKG_CONFIG_PATH to the configuration file location or use LDFLAGS=-Ldir to specify the library location])
+ ]
+ )
+ ]
)
+AC_SUBST(POPT_LIBS)
PKG_CHECK_MODULES([libxml2], [libxml-2.0 >= 2.7.6])
lttng_LDADD = $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la \
$(top_builddir)/src/common/libcommon.la \
$(top_builddir)/src/common/config/libconfig.la \
- $(top_builddir)/src/common/string-utils/libstring-utils.la
+ $(top_builddir)/src/common/string-utils/libstring-utils.la \
+ $(POPT_LIBS)
noinst_PROGRAMS = select_poll_epoll
select_poll_epoll_SOURCES = select_poll_epoll.c
-select_poll_epoll_LDADD = -lpthread -lpopt
+select_poll_epoll_LDADD = $(POPT_LIBS)
select_poll_epoll_CFLAGS = -fno-stack-protector -D_FORTIFY_SOURCE=0 $(AM_CFLAGS)
all-local: