]> granicus.if.org Git - libnl/commitdiff
build: enable building cli during tests
authorThomas Haller <thaller@redhat.com>
Mon, 27 Feb 2017 11:02:43 +0000 (12:02 +0100)
committerThomas Haller <thaller@redhat.com>
Mon, 27 Feb 2017 12:36:03 +0000 (13:36 +0100)
The cli programs don't have any additional external dependencies.
So, during a `make check`, we should always build them, even if
they were disabled during configure and won't be installed.

Makefile.am

index 7cdd7d4b8e27d7c83d5f6053c89b03e11f90825a..81da1fc6a3f09b7d51b361977bc01ca11146a1f7 100644 (file)
@@ -3,6 +3,8 @@
 ACLOCAL_AMFLAGS = -I m4
 
 lib_LTLIBRARIES =
+noinst_LTLIBRARIES =
+check_LTLIBRARIES =
 
 check_PROGRAMS =
 check_programs =
@@ -487,8 +489,6 @@ EXTRA_lib_libnl_xfrm_3_la_DEPENDENCIES = \
 lib_libnl_xfrm_3_la_LIBADD = \
        lib/libnl-3.la
 
-if ENABLE_CLI
-
 lib_cli_ltlibraries_cls = \
        lib/cli/cls/basic.la \
        lib/cli/cls/cgroup.la
@@ -502,11 +502,15 @@ lib_cli_ltlibraries_qdisc = \
        lib/cli/qdisc/pfifo.la \
        lib/cli/qdisc/plug.la
 
+if ENABLE_CLI
 pkglib_clsdir = $(pkglibdir)/cli/cls
 pkglib_qdiscdir = $(pkglibdir)/cli/qdisc
 pkglib_cls_LTLIBRARIES = $(lib_cli_ltlibraries_cls)
 pkglib_qdisc_LTLIBRARIES = $(lib_cli_ltlibraries_qdisc)
-
+else
+noinst_LTLIBRARIES += \
+       $(lib_cli_ltlibraries_cls) \
+       $(lib_cli_ltlibraries_qdisc)
 endif
 
 lib_cli_ldflags = \
@@ -535,8 +539,13 @@ lib_cli_qdisc_plug_la_LDFLAGS       = $(lib_cli_ldflags)
 
 ###############################################################################
 
+src_lib_ldflags =
+
 if ENABLE_CLI
 lib_LTLIBRARIES += src/lib/libnl-cli-3.la
+src_lib_ldflags += -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
+else
+check_LTLIBRARIES += src/lib/libnl-cli-3.la
 endif
 
 src_lib_libnl_cli_3_la_SOURCES = \
@@ -563,7 +572,7 @@ src_lib_libnl_cli_3_la_CPPFLAGS = \
        -I$(srcdir)/include \
        -I$(builddir)/include
 src_lib_libnl_cli_3_la_LDFLAGS = \
-       -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
+       $(src_lib_ldflags) \
        -Wl,--version-script=$(srcdir)/libnl-cli-3.sym
 src_lib_libnl_cli_3_la_LIBADD = \
        lib/libnl-3.la \
@@ -648,6 +657,8 @@ else
 noinst_PROGRAMS += $(cli_programs)
 endif
 endif
+else
+check_PROGRAMS += $(cli_programs)
 endif
 
 src_genl_ctrl_list_CPPFLAGS =       $(src_cppflags)
@@ -825,12 +836,10 @@ tests_test_complex_HTB_with_hash_filters_LDADD    = $(tests_ldadd)
 tests_test_u32_filter_with_actions_CPPFLAGS       = $(tests_cppflags)
 tests_test_u32_filter_with_actions_LDADD          = $(tests_ldadd)
 
-if ENABLE_CLI
 check_PROGRAMS += \
        tests/test-cache-mngr \
        tests/test-genl \
        tests/test-nf-cache-mngr
-endif
 
 tests_cli_ldadd = \
        $(tests_ldadd) \