[lxc-devel] [PATCH] Use AC_SEARCH_LIBS instead of hardcoded lists
Serge Hallyn
serge.hallyn at ubuntu.com
Tue Feb 19 18:51:00 UTC 2013
Quoting Stéphane Graber (stgraber at ubuntu.com):
> 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 at alpinelinux.org>
> Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>
> ---
> configure.ac | 3 +++
> src/lxc/Makefile.am | 8 --------
> src/tests/Makefile.am | 4 ----
> 3 files changed, 3 insertions(+), 12 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 3de68ce..6e406bd 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -286,6 +286,9 @@ AC_CHECK_FUNCS([fgetln],
> 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
> diff --git a/src/lxc/Makefile.am b/src/lxc/Makefile.am
> index 8974ca9..aba2e67 100644
> --- a/src/lxc/Makefile.am
> +++ b/src/lxc/Makefile.am
> @@ -114,10 +114,6 @@ liblxc_so_LDFLAGS = \
>
> liblxc_so_LDADD = $(CAP_LIBS) $(APPARMOR_LIBS) $(SECCOMP_LIBS)
>
> -if !IS_BIONIC
> -liblxc_so_LDADD += -lutil -lrt
> -endif
> -
> bin_SCRIPTS = \
> lxc-ps \
> lxc-netstat \
> @@ -172,10 +168,6 @@ AM_LDFLAGS += -Wl,-rpath -Wl,$(libdir)
> 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
> diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
> index a883d36..0f4ee1d 100644
> --- a/src/tests/Makefile.am
> +++ b/src/tests/Makefile.am
> @@ -2,10 +2,6 @@ if ENABLE_TESTS
>
> 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
> --
> 1.8.1.2
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel
More information about the lxc-devel
mailing list