build: improve documentation and test configure options
authorPavel Šimerda <psimerda@redhat.com>
Mon, 5 Nov 2012 10:35:34 +0000 (11:35 +0100)
committerPavel Šimerda <psimerda@redhat.com>
Tue, 13 Nov 2012 19:23:06 +0000 (20:23 +0100)
Use --enable-doc and --enable-tests instead of --with-docs and
--with-tests. This is consistent with other features and with
--enable-gtk-doc option. Support current variants as fallback.

Don't build tests unless --enable-tests is specified.

24 files changed:
callouts/Makefile.am
callouts/tests/Makefile.am
configure.ac
docs/Makefile.am
docs/api/Makefile.am
libnm-glib/Makefile.am
libnm-glib/tests/Makefile.am
libnm-util/Makefile.am
libnm-util/tests/Makefile.am
src/dhcp-manager/Makefile.am
src/dhcp-manager/tests/Makefile.am
src/settings/Makefile.am
src/settings/plugins/ifcfg-rh/Makefile.am
src/settings/plugins/ifcfg-rh/tests/Makefile.am
src/settings/plugins/ifnet/Makefile.am
src/settings/plugins/ifnet/tests/Makefile.am
src/settings/plugins/ifupdown/Makefile.am
src/settings/plugins/ifupdown/tests/Makefile.am
src/settings/plugins/keyfile/Makefile.am
src/settings/plugins/keyfile/tests/Makefile.am
src/settings/tests/Makefile.am
src/supplicant-manager/Makefile.am
src/supplicant-manager/tests/Makefile.am
src/tests/Makefile.am

index d7fbec0..b27fdd7 100644 (file)
@@ -1,4 +1,4 @@
-SUBDIRS=. tests
+SUBDIRS = . tests
 
 ###########################################
 # Test libraries
index 93d3fae..e8a13fc 100644 (file)
@@ -1,3 +1,5 @@
+if ENABLE_TESTS
+
 INCLUDES = \
        -I$(top_srcdir)/include \
        -I${top_builddir}/include \
@@ -25,16 +27,13 @@ test_dispatcher_envp_LDADD = \
 
 ###########################################
 
-if WITH_TESTS
-
 check-local: test-dispatcher-envp
        $(abs_builddir)/test-dispatcher-envp $(abs_srcdir)
 
-endif
-
 EXTRA_DIST= \
        dispatcher-old-down \
        dispatcher-old-up \
        dispatcher-old-vpn-down \
        dispatcher-old-vpn-up
 
+endif
index 887738f..c2b9f01 100644 (file)
@@ -80,20 +80,6 @@ GETTEXT_PACKAGE=NetworkManager
 AC_SUBST(GETTEXT_PACKAGE)
 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
 
-dnl
-dnl Documentation
-dnl
-AC_ARG_WITH(docs, AS_HELP_STRING([--with-docs], [Build NetworkManager documentation]))
-AM_CONDITIONAL(WITH_DOCS, test "x$with_docs" = "xyes")
-case $with_docs in
-    yes)
-        enable_gtk_doc=yes
-        ;;
-    *)
-        with_docs=no
-        ;;
-esac
-
 dnl
 dnl Make sha1.c happy on big endian systems
 dnl
@@ -658,29 +644,32 @@ AM_CONDITIONAL(WITH_CONCHECK, test "${enable_concheck}" = "yes")
 
 NM_COMPILER_WARNINGS
 
-GTK_DOC_CHECK(1.0)
-
-
 dnl -------------------------
 dnl Vala bindings
 dnl -------------------------
 
 VAPIGEN_CHECK(0.17.1.24)
 
-dnl
-dnl Tests
-dnl
-AC_ARG_WITH(tests, AS_HELP_STRING([--with-tests], [Build NetworkManager tests]))
-AM_CONDITIONAL(WITH_TESTS, test "x$with_tests" = "xyes")
-case $with_tests in
-    yes)
-        with_tests=yes
-        ;;
-    *)
-        with_tests=no
-        ;;
-esac
-
+# Tests, utilities and documentation
+AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests], [Build NetworkManager tests (default: yes)]))
+AC_ARG_ENABLE(doc, AS_HELP_STRING([--enable-doc], [Build NetworkManager documentation (default: no)]))
+# Fallback to --with-tests and with-docs
+AC_ARG_WITH(tests, AS_HELP_STRING([--with-tests], [Build NetworkManager tests (deprecated)]))
+AC_ARG_WITH(docs, AS_HELP_STRING([--with-docs], [Build NetworkManager documentation (deprecated)]))
+AS_IF([test -n "$with_tests"], enable_tests="$with_tests")
+AS_IF([test -n "$with_docs"], enable_doc="$with_docs")
+# Default to --enable-tests and --disable-docs
+AS_IF([test -z "$enable_tests"], enable_tests="yes")
+AS_IF([test -z "$enable_doc"], enable_doc="no")
+# Normalize values
+AS_IF([test "$enable_tests" != "yes"], enable_tests="no")
+AS_IF([test "$enable_doc" != "yes"], enable_doc="no")
+# Add conditionals
+AM_CONDITIONAL(ENABLE_TESTS, test "$enable_tests" = "yes")
+AM_CONDITIONAL(ENABLE_DOC, test "$enable_tests" = "yes")
+# Add gtk-doc conditionals
+enable_gtk_doc="$enable_doc"
+GTK_DOC_CHECK(1.0)
 
 AC_CONFIG_FILES([
 Makefile
@@ -848,9 +837,10 @@ if test "${ac_with_wext}" = "yes"; then
 else
        echo WEXT support: no
 fi
-
 echo
-echo Building documentation: ${with_docs}
-echo Building tests: ${with_tests}
+
+echo "Miscellaneous:"
+echo "  documentation: $enable_doc"
+echo "  tests: $enable_tests"
 echo
 
index a1d1b9b..ee88922 100644 (file)
@@ -1,6 +1,5 @@
-if WITH_DOCS
+if ENABLE_DOC
 
 SUBDIRS = api libnm-glib libnm-util
 
 endif
-
index 571926f..c12e84a 100644 (file)
@@ -2,7 +2,7 @@ GENERATE_SETTINGS_SPEC_SOURCE = generate-settings-spec.c
 
 AUTOMAKE_OPTIONS = 1.7
 
-if WITH_DOCS
+if ENABLE_DOC
 
 INCLUDES = \
        -I$(top_srcdir)/include \
@@ -85,6 +85,4 @@ CLEANFILES =
 endif
 
 EXTRA_DIST += version.xml.in
-
 CLEANFILES += html/* tmpl/* xml/*
-
index 9b6c1f5..89a5e99 100644 (file)
@@ -1,6 +1,6 @@
 include $(GLIB_MAKEFILE)
 
-SUBDIRS=. tests
+SUBDIRS = . tests
 
 INCLUDES = \
        -I$(top_srcdir)/include \
@@ -232,7 +232,7 @@ typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
 CLEANFILES += $(gir_DATA) $(typelib_DATA)
 endif
 
-if WITH_TESTS
+if ENABLE_TESTS
 
 check-local:
        $(top_srcdir)/tools/check-exports.sh $(builddir)/.libs/libnm-glib.so $(SYMBOL_VIS_FILE)
index 0dba079..5fda5bd 100644 (file)
@@ -1,3 +1,5 @@
+if ENABLE_TESTS
+
 INCLUDES = \
        -I$(top_srcdir)/include \
        -I$(top_builddir)/include \
@@ -28,10 +30,7 @@ TEST_RSS_BIN = test-remote-settings-service.py
 
 EXTRA_DIST = $(TEST_RSS_BIN)
 
-if WITH_TESTS
-
 check-local: test-remote-settings-client
        $(abs_builddir)/test-remote-settings-client $(abs_srcdir) $(TEST_RSS_BIN)
 
 endif
-
index 37d1f12..2367925 100644 (file)
@@ -1,6 +1,6 @@
 include $(GLIB_MAKEFILE)
 
-SUBDIRS=. tests
+SUBDIRS = . tests
 
 INCLUDES = -I${top_srcdir} -I${top_srcdir}/include -I${top_builddir}/include
 
@@ -164,7 +164,7 @@ typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
 CLEANFILES += $(gir_DATA) $(typelib_DATA)
 endif
 
-if WITH_TESTS
+if ENABLE_TESTS
 
 check-local:
        $(top_srcdir)/tools/check-exports.sh $(builddir)/.libs/libnm-util.so $(SYMBOL_VIS_FILE)
index 46a4d14..98f8aad 100644 (file)
@@ -1,3 +1,5 @@
+if ENABLE_TESTS
+
 SUBDIRS=certs
 
 INCLUDES = \
@@ -73,8 +75,6 @@ test_setting_8021x_LDADD = \
        $(GLIB_LIBS) \
        $(DBUS_LIBS)
 
-if WITH_TESTS
-
 check-local: test-settings-defaults test-crypto test-secrets
        $(abs_builddir)/test-settings-defaults
        $(abs_builddir)/test-secrets
@@ -137,4 +137,3 @@ check-local: test-settings-defaults test-crypto test-secrets
                "1234567890"
 
 endif
-
index 8f3d65e..49ab90d 100644 (file)
@@ -1,4 +1,4 @@
-SUBDIRS=. tests
+SUBDIRS = . tests
 
 INCLUDES = \
        -I${top_srcdir} \
index 1feade8..251aa22 100644 (file)
@@ -1,3 +1,5 @@
+if ENABLE_TESTS
+
 INCLUDES = \
        -I$(top_srcdir)/include \
        -I$(top_builddir)/include \
@@ -21,10 +23,7 @@ test_dhcp_dhclient_LDADD = \
        $(top_builddir)/libnm-util/libnm-util.la \
        $(GLIB_LIBS)
 
-if WITH_TESTS
-
 check-local: test-dhcp-dhclient
        $(abs_builddir)/test-dhcp-dhclient
 
 endif
-
index 215872b..6ca7633 100644 (file)
@@ -1,4 +1,4 @@
-SUBDIRS=plugins . tests
+SUBDIRS = plugins . tests
 
 INCLUDES = -I${top_srcdir} \
            -I${top_builddir}/include \
index e7c4aa6..a2c3f0f 100644 (file)
@@ -1,4 +1,4 @@
-SUBDIRS=. tests
+SUBDIRS = . tests
 
 nm-ifcfg-rh-glue.h: nm-ifcfg-rh.xml
        $(AM_V_GEN) dbus-binding-tool --prefix=nm_ifcfg_rh --mode=glib-server --output=$@ $<
index 34be7eb..9aec92f 100644 (file)
@@ -1,3 +1,5 @@
+if ENABLE_TESTS
+
 SUBDIRS=network-scripts
 
 INCLUDES = \
@@ -36,14 +38,10 @@ test_ifcfg_rh_utils_CPPFLAGS = \
 test_ifcfg_rh_utils_LDADD = \
        $(builddir)/../libifcfg-rh-io.la
 
-if WITH_TESTS
-
 check-local: test-ifcfg-rh
        $(abs_builddir)/test-ifcfg-rh-utils
        $(abs_builddir)/test-ifcfg-rh
 
-endif
-
 EXTRA_DIST = \
        iscsiadm-test-dhcp \
        iscsiadm-test-static \
@@ -54,4 +52,5 @@ EXTRA_DIST = \
        iscsiadm-test-bad-entry \
        iscsiadm-test-bad-record
 
+endif
 
index 98f9de9..b2be4de 100644 (file)
@@ -1,4 +1,5 @@
 SUBDIRS = . tests
+
 INCLUDES = \
        -I$(top_srcdir)/src/wifi \
        -I$(top_srcdir)/src/settings \
index 85d4238..32a5a2c 100644 (file)
@@ -1,3 +1,5 @@
+if ENABLE_TESTS
+
 INCLUDES=-I$(srcdir)/../ \
         -I$(top_srcdir)/libnm-glib \
         -I$(top_srcdir)/libnm-util \
@@ -17,3 +19,5 @@ EXTRA_DIST = hostname \
                         net.all \
                         nm-system-settings.conf \
                         wpa_supplicant.conf
+
+endif
index e1c67d3..852f722 100644 (file)
@@ -1,4 +1,4 @@
-SUBDIRS=. tests
+SUBDIRS = . tests
 
 INCLUDES = \
        -I$(top_srcdir)/src/logging \
index 54eeda7..6930e7a 100644 (file)
@@ -1,3 +1,5 @@
+if ENABLE_TESTS
+
 INCLUDES = \
        -I$(top_srcdir)/include \
        -I$(top_srcdir)/libnm-util \
@@ -20,14 +22,12 @@ test_ifupdown_LDADD = \
        $(builddir)/../libifupdown-io.la \
        $(DBUS_LIBS)
 
-if WITH_TESTS
-
 check-local: test-ifupdown
        $(abs_builddir)/test-ifupdown
 
-endif
-
 EXTRA_DIST = \
        test1 test2 test3 test4 test5 test6 test7 test8 test9 test11 test12 \
        test13 test14 test15 test16 test17-wired-static-verify-ip4 \
        test18-wired-static-verify-ip6 test19-wired-static-verify-ip4-plen
+
+endif
index dea92da..a9fbb66 100644 (file)
@@ -1,4 +1,4 @@
-SUBDIRS=. tests
+SUBDIRS = . tests
 
 INCLUDES = \
        -I$(top_srcdir)/src/settings \
index 2adbf87..26e8eaf 100644 (file)
@@ -1,3 +1,5 @@
+if ENABLE_TESTS
+
 SUBDIRS=keyfiles
 
 INCLUDES = \
@@ -25,10 +27,7 @@ test_keyfile_LDADD = \
        $(top_builddir)/libnm-util/libnm-util.la \
        $(DBUS_LIBS)
 
-if WITH_TESTS
-
 check-local: test-keyfile
        $(abs_builddir)/test-keyfile
 
 endif
-
index 57d56fc..5c0c456 100644 (file)
@@ -1,3 +1,5 @@
+if ENABLE_TESTS
+
 INCLUDES = \
        -I$(top_srcdir)/include \
        -I$(top_builddir)/include \
@@ -24,10 +26,7 @@ test_wired_defname_LDADD = \
 
 ###########################################
 
-if WITH_TESTS
-
 check-local: test-wired-defname
        $(abs_builddir)/test-wired-defname
 
 endif
-
index 1c24d0e..74ec9c3 100644 (file)
@@ -1,4 +1,4 @@
-SUBDIRS=. tests
+SUBDIRS = . tests
 
 INCLUDES = \
        -I${top_srcdir}/src \
index 47ae66c..20ba9cc 100644 (file)
@@ -1,3 +1,5 @@
+if ENABLE_TESTS
+
 INCLUDES = \
        -I$(top_srcdir)/include \
        -I$(top_builddir)/include \
@@ -20,10 +22,7 @@ test_supplicant_config_LDADD = \
        $(top_builddir)/src/supplicant-manager/libsupplicant-manager.la \
        $(DBUS_LIBS)
 
-if WITH_TESTS
-
 check-local: test-supplicant-config
        $(abs_builddir)/test-supplicant-config
 
 endif
-
index 61e2261..8f40636 100644 (file)
@@ -1,3 +1,5 @@
+if ENABLE_TESTS
+
 INCLUDES = \
        -I$(top_srcdir)/include \
        -I$(top_builddir)/include \
@@ -64,12 +66,9 @@ EXTRA_DIST = test-secret-agent.py
 
 ###########################################
 
-if WITH_TESTS
-
 check-local: test-dhcp-options test-policy-hosts test-wifi-ap-utils
        $(abs_builddir)/test-dhcp-options
        $(abs_builddir)/test-policy-hosts
        $(abs_builddir)/test-wifi-ap-utils
 
 endif
-