diff --git a/callouts/Makefile.am b/callouts/Makefile.am index d7fbec01eb..b27fdd79f2 100644 --- a/callouts/Makefile.am +++ b/callouts/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS=. tests +SUBDIRS = . tests ########################################### # Test libraries diff --git a/callouts/tests/Makefile.am b/callouts/tests/Makefile.am index 93d3fae7fc..e8a13fc6ea 100644 --- a/callouts/tests/Makefile.am +++ b/callouts/tests/Makefile.am @@ -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 diff --git a/configure.ac b/configure.ac index 887738f97d..c2b9f01fbd 100644 --- a/configure.ac +++ b/configure.ac @@ -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 + +echo "Miscellaneous:" +echo " documentation: $enable_doc" +echo " tests: $enable_tests" echo diff --git a/docs/Makefile.am b/docs/Makefile.am index a1d1b9b378..ee8892204f 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -1,6 +1,5 @@ -if WITH_DOCS +if ENABLE_DOC SUBDIRS = api libnm-glib libnm-util endif - diff --git a/docs/api/Makefile.am b/docs/api/Makefile.am index 571926f52c..c12e84a458 100644 --- a/docs/api/Makefile.am +++ b/docs/api/Makefile.am @@ -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/* - diff --git a/libnm-glib/Makefile.am b/libnm-glib/Makefile.am index 9b6c1f57d0..89a5e9937d 100644 --- a/libnm-glib/Makefile.am +++ b/libnm-glib/Makefile.am @@ -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) diff --git a/libnm-glib/tests/Makefile.am b/libnm-glib/tests/Makefile.am index 0dba0793c5..5fda5bd269 100644 --- a/libnm-glib/tests/Makefile.am +++ b/libnm-glib/tests/Makefile.am @@ -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 - diff --git a/libnm-util/Makefile.am b/libnm-util/Makefile.am index 37d1f1274b..2367925cc0 100644 --- a/libnm-util/Makefile.am +++ b/libnm-util/Makefile.am @@ -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) diff --git a/libnm-util/tests/Makefile.am b/libnm-util/tests/Makefile.am index 46a4d1429e..98f8aad85d 100644 --- a/libnm-util/tests/Makefile.am +++ b/libnm-util/tests/Makefile.am @@ -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 - diff --git a/src/dhcp-manager/Makefile.am b/src/dhcp-manager/Makefile.am index 8f3d65e0cc..49ab90d696 100644 --- a/src/dhcp-manager/Makefile.am +++ b/src/dhcp-manager/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS=. tests +SUBDIRS = . tests INCLUDES = \ -I${top_srcdir} \ diff --git a/src/dhcp-manager/tests/Makefile.am b/src/dhcp-manager/tests/Makefile.am index 1feade8693..251aa224e8 100644 --- a/src/dhcp-manager/tests/Makefile.am +++ b/src/dhcp-manager/tests/Makefile.am @@ -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 - diff --git a/src/settings/Makefile.am b/src/settings/Makefile.am index 215872be2e..6ca7633f7b 100644 --- a/src/settings/Makefile.am +++ b/src/settings/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS=plugins . tests +SUBDIRS = plugins . tests INCLUDES = -I${top_srcdir} \ -I${top_builddir}/include \ diff --git a/src/settings/plugins/ifcfg-rh/Makefile.am b/src/settings/plugins/ifcfg-rh/Makefile.am index e7c4aa6458..a2c3f0f008 100644 --- a/src/settings/plugins/ifcfg-rh/Makefile.am +++ b/src/settings/plugins/ifcfg-rh/Makefile.am @@ -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=$@ $< diff --git a/src/settings/plugins/ifcfg-rh/tests/Makefile.am b/src/settings/plugins/ifcfg-rh/tests/Makefile.am index 34be7eb8b5..9aec92fe73 100644 --- a/src/settings/plugins/ifcfg-rh/tests/Makefile.am +++ b/src/settings/plugins/ifcfg-rh/tests/Makefile.am @@ -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 diff --git a/src/settings/plugins/ifnet/Makefile.am b/src/settings/plugins/ifnet/Makefile.am index 98f9de9393..b2be4de2d2 100644 --- a/src/settings/plugins/ifnet/Makefile.am +++ b/src/settings/plugins/ifnet/Makefile.am @@ -1,4 +1,5 @@ SUBDIRS = . tests + INCLUDES = \ -I$(top_srcdir)/src/wifi \ -I$(top_srcdir)/src/settings \ diff --git a/src/settings/plugins/ifnet/tests/Makefile.am b/src/settings/plugins/ifnet/tests/Makefile.am index 85d42388a5..32a5a2c543 100644 --- a/src/settings/plugins/ifnet/tests/Makefile.am +++ b/src/settings/plugins/ifnet/tests/Makefile.am @@ -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 diff --git a/src/settings/plugins/ifupdown/Makefile.am b/src/settings/plugins/ifupdown/Makefile.am index e1c67d3357..852f722eca 100644 --- a/src/settings/plugins/ifupdown/Makefile.am +++ b/src/settings/plugins/ifupdown/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS=. tests +SUBDIRS = . tests INCLUDES = \ -I$(top_srcdir)/src/logging \ diff --git a/src/settings/plugins/ifupdown/tests/Makefile.am b/src/settings/plugins/ifupdown/tests/Makefile.am index 54eeda7e7a..6930e7aa5e 100644 --- a/src/settings/plugins/ifupdown/tests/Makefile.am +++ b/src/settings/plugins/ifupdown/tests/Makefile.am @@ -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 diff --git a/src/settings/plugins/keyfile/Makefile.am b/src/settings/plugins/keyfile/Makefile.am index dea92da14e..a9fbb6638f 100644 --- a/src/settings/plugins/keyfile/Makefile.am +++ b/src/settings/plugins/keyfile/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS=. tests +SUBDIRS = . tests INCLUDES = \ -I$(top_srcdir)/src/settings \ diff --git a/src/settings/plugins/keyfile/tests/Makefile.am b/src/settings/plugins/keyfile/tests/Makefile.am index 2adbf8739a..26e8eafd72 100644 --- a/src/settings/plugins/keyfile/tests/Makefile.am +++ b/src/settings/plugins/keyfile/tests/Makefile.am @@ -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 - diff --git a/src/settings/tests/Makefile.am b/src/settings/tests/Makefile.am index 57d56fc480..5c0c45658c 100644 --- a/src/settings/tests/Makefile.am +++ b/src/settings/tests/Makefile.am @@ -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 - diff --git a/src/supplicant-manager/Makefile.am b/src/supplicant-manager/Makefile.am index 1c24d0ef51..74ec9c38c2 100644 --- a/src/supplicant-manager/Makefile.am +++ b/src/supplicant-manager/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS=. tests +SUBDIRS = . tests INCLUDES = \ -I${top_srcdir}/src \ diff --git a/src/supplicant-manager/tests/Makefile.am b/src/supplicant-manager/tests/Makefile.am index 47ae66c573..20ba9cc573 100644 --- a/src/supplicant-manager/tests/Makefile.am +++ b/src/supplicant-manager/tests/Makefile.am @@ -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 - diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am index 61e2261fbc..8f40636174 100644 --- a/src/tests/Makefile.am +++ b/src/tests/Makefile.am @@ -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 -