Use AC_SEARCH_LIBS to detect what library provides sem_*.
This allows us to stop hardcoding the ld arguments in the various MakeFiles.
Suggested-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
AC_DEFINE(HAVE_FGETLN,1,[Have fgetln]),
AM_CONDITIONAL(HAVE_FGETLN, false))
+# Check for some libraries
+AC_SEARCH_LIBS(sem_open, [rt pthread])
+
# Check for some standard binaries
AC_PROG_GCC_TRADITIONAL
AC_PROG_SED
liblxc_so_LDADD = $(CAP_LIBS) $(APPARMOR_LIBS) $(SECCOMP_LIBS)
-if !IS_BIONIC
-liblxc_so_LDADD += -lutil -lrt
-endif
-
bin_SCRIPTS = \
lxc-ps \
lxc-netstat \
endif
LDADD=liblxc.so @CAP_LIBS@ @APPARMOR_LIBS@ @SECCOMP_LIBS@
-if !IS_BIONIC
-LDADD += -lrt
-endif
-
lxc_attach_SOURCES = lxc_attach.c
lxc_cgroup_SOURCES = lxc_cgroup.c
lxc_checkpoint_SOURCES = lxc_checkpoint.c
LDADD = ../lxc/liblxc.so
-if !IS_BIONIC
-LDADD += -lpthread
-endif
-
lxc_test_containertests_SOURCES = containertests.c
lxc_test_locktests_SOURCES = locktests.c
lxc_test_startone_SOURCES = startone.c