build: improve documentation and test configure options

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.
This commit is contained in:
Pavel Šimerda
2012-11-05 11:35:34 +01:00
parent e19ef483b7
commit faa1bcb540
24 changed files with 67 additions and 84 deletions

View File

@@ -1,4 +1,4 @@
SUBDIRS=. tests SUBDIRS = . tests
########################################### ###########################################
# Test libraries # Test libraries

View File

@@ -1,3 +1,5 @@
if ENABLE_TESTS
INCLUDES = \ INCLUDES = \
-I$(top_srcdir)/include \ -I$(top_srcdir)/include \
-I${top_builddir}/include \ -I${top_builddir}/include \
@@ -25,16 +27,13 @@ test_dispatcher_envp_LDADD = \
########################################### ###########################################
if WITH_TESTS
check-local: test-dispatcher-envp check-local: test-dispatcher-envp
$(abs_builddir)/test-dispatcher-envp $(abs_srcdir) $(abs_builddir)/test-dispatcher-envp $(abs_srcdir)
endif
EXTRA_DIST= \ EXTRA_DIST= \
dispatcher-old-down \ dispatcher-old-down \
dispatcher-old-up \ dispatcher-old-up \
dispatcher-old-vpn-down \ dispatcher-old-vpn-down \
dispatcher-old-vpn-up dispatcher-old-vpn-up
endif

View File

@@ -80,20 +80,6 @@ GETTEXT_PACKAGE=NetworkManager
AC_SUBST(GETTEXT_PACKAGE) AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [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
dnl Make sha1.c happy on big endian systems dnl Make sha1.c happy on big endian systems
dnl dnl
@@ -658,29 +644,32 @@ AM_CONDITIONAL(WITH_CONCHECK, test "${enable_concheck}" = "yes")
NM_COMPILER_WARNINGS NM_COMPILER_WARNINGS
GTK_DOC_CHECK(1.0)
dnl ------------------------- dnl -------------------------
dnl Vala bindings dnl Vala bindings
dnl ------------------------- dnl -------------------------
VAPIGEN_CHECK(0.17.1.24) VAPIGEN_CHECK(0.17.1.24)
dnl # Tests, utilities and documentation
dnl Tests AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests], [Build NetworkManager tests (default: yes)]))
dnl AC_ARG_ENABLE(doc, AS_HELP_STRING([--enable-doc], [Build NetworkManager documentation (default: no)]))
AC_ARG_WITH(tests, AS_HELP_STRING([--with-tests], [Build NetworkManager tests])) # Fallback to --with-tests and with-docs
AM_CONDITIONAL(WITH_TESTS, test "x$with_tests" = "xyes") AC_ARG_WITH(tests, AS_HELP_STRING([--with-tests], [Build NetworkManager tests (deprecated)]))
case $with_tests in AC_ARG_WITH(docs, AS_HELP_STRING([--with-docs], [Build NetworkManager documentation (deprecated)]))
yes) AS_IF([test -n "$with_tests"], enable_tests="$with_tests")
with_tests=yes 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")
with_tests=no AS_IF([test -z "$enable_doc"], enable_doc="no")
;; # Normalize values
esac 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([ AC_CONFIG_FILES([
Makefile Makefile
@@ -848,9 +837,10 @@ if test "${ac_with_wext}" = "yes"; then
else else
echo WEXT support: no echo WEXT support: no
fi fi
echo
echo
echo Building documentation: ${with_docs} echo "Miscellaneous:"
echo Building tests: ${with_tests} echo " documentation: $enable_doc"
echo " tests: $enable_tests"
echo echo

View File

@@ -1,6 +1,5 @@
if WITH_DOCS if ENABLE_DOC
SUBDIRS = api libnm-glib libnm-util SUBDIRS = api libnm-glib libnm-util
endif endif

View File

@@ -2,7 +2,7 @@ GENERATE_SETTINGS_SPEC_SOURCE = generate-settings-spec.c
AUTOMAKE_OPTIONS = 1.7 AUTOMAKE_OPTIONS = 1.7
if WITH_DOCS if ENABLE_DOC
INCLUDES = \ INCLUDES = \
-I$(top_srcdir)/include \ -I$(top_srcdir)/include \
@@ -85,6 +85,4 @@ CLEANFILES =
endif endif
EXTRA_DIST += version.xml.in EXTRA_DIST += version.xml.in
CLEANFILES += html/* tmpl/* xml/* CLEANFILES += html/* tmpl/* xml/*

View File

@@ -1,6 +1,6 @@
include $(GLIB_MAKEFILE) include $(GLIB_MAKEFILE)
SUBDIRS=. tests SUBDIRS = . tests
INCLUDES = \ INCLUDES = \
-I$(top_srcdir)/include \ -I$(top_srcdir)/include \
@@ -232,7 +232,7 @@ typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
CLEANFILES += $(gir_DATA) $(typelib_DATA) CLEANFILES += $(gir_DATA) $(typelib_DATA)
endif endif
if WITH_TESTS if ENABLE_TESTS
check-local: check-local:
$(top_srcdir)/tools/check-exports.sh $(builddir)/.libs/libnm-glib.so $(SYMBOL_VIS_FILE) $(top_srcdir)/tools/check-exports.sh $(builddir)/.libs/libnm-glib.so $(SYMBOL_VIS_FILE)

View File

@@ -1,3 +1,5 @@
if ENABLE_TESTS
INCLUDES = \ INCLUDES = \
-I$(top_srcdir)/include \ -I$(top_srcdir)/include \
-I$(top_builddir)/include \ -I$(top_builddir)/include \
@@ -28,10 +30,7 @@ TEST_RSS_BIN = test-remote-settings-service.py
EXTRA_DIST = $(TEST_RSS_BIN) EXTRA_DIST = $(TEST_RSS_BIN)
if WITH_TESTS
check-local: test-remote-settings-client check-local: test-remote-settings-client
$(abs_builddir)/test-remote-settings-client $(abs_srcdir) $(TEST_RSS_BIN) $(abs_builddir)/test-remote-settings-client $(abs_srcdir) $(TEST_RSS_BIN)
endif endif

View File

@@ -1,6 +1,6 @@
include $(GLIB_MAKEFILE) include $(GLIB_MAKEFILE)
SUBDIRS=. tests SUBDIRS = . tests
INCLUDES = -I${top_srcdir} -I${top_srcdir}/include -I${top_builddir}/include 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) CLEANFILES += $(gir_DATA) $(typelib_DATA)
endif endif
if WITH_TESTS if ENABLE_TESTS
check-local: check-local:
$(top_srcdir)/tools/check-exports.sh $(builddir)/.libs/libnm-util.so $(SYMBOL_VIS_FILE) $(top_srcdir)/tools/check-exports.sh $(builddir)/.libs/libnm-util.so $(SYMBOL_VIS_FILE)

View File

@@ -1,3 +1,5 @@
if ENABLE_TESTS
SUBDIRS=certs SUBDIRS=certs
INCLUDES = \ INCLUDES = \
@@ -73,8 +75,6 @@ test_setting_8021x_LDADD = \
$(GLIB_LIBS) \ $(GLIB_LIBS) \
$(DBUS_LIBS) $(DBUS_LIBS)
if WITH_TESTS
check-local: test-settings-defaults test-crypto test-secrets check-local: test-settings-defaults test-crypto test-secrets
$(abs_builddir)/test-settings-defaults $(abs_builddir)/test-settings-defaults
$(abs_builddir)/test-secrets $(abs_builddir)/test-secrets
@@ -137,4 +137,3 @@ check-local: test-settings-defaults test-crypto test-secrets
"1234567890" "1234567890"
endif endif

View File

@@ -1,4 +1,4 @@
SUBDIRS=. tests SUBDIRS = . tests
INCLUDES = \ INCLUDES = \
-I${top_srcdir} \ -I${top_srcdir} \

View File

@@ -1,3 +1,5 @@
if ENABLE_TESTS
INCLUDES = \ INCLUDES = \
-I$(top_srcdir)/include \ -I$(top_srcdir)/include \
-I$(top_builddir)/include \ -I$(top_builddir)/include \
@@ -21,10 +23,7 @@ test_dhcp_dhclient_LDADD = \
$(top_builddir)/libnm-util/libnm-util.la \ $(top_builddir)/libnm-util/libnm-util.la \
$(GLIB_LIBS) $(GLIB_LIBS)
if WITH_TESTS
check-local: test-dhcp-dhclient check-local: test-dhcp-dhclient
$(abs_builddir)/test-dhcp-dhclient $(abs_builddir)/test-dhcp-dhclient
endif endif

View File

@@ -1,4 +1,4 @@
SUBDIRS=plugins . tests SUBDIRS = plugins . tests
INCLUDES = -I${top_srcdir} \ INCLUDES = -I${top_srcdir} \
-I${top_builddir}/include \ -I${top_builddir}/include \

View File

@@ -1,4 +1,4 @@
SUBDIRS=. tests SUBDIRS = . tests
nm-ifcfg-rh-glue.h: nm-ifcfg-rh.xml nm-ifcfg-rh-glue.h: nm-ifcfg-rh.xml
$(AM_V_GEN) dbus-binding-tool --prefix=nm_ifcfg_rh --mode=glib-server --output=$@ $< $(AM_V_GEN) dbus-binding-tool --prefix=nm_ifcfg_rh --mode=glib-server --output=$@ $<

View File

@@ -1,3 +1,5 @@
if ENABLE_TESTS
SUBDIRS=network-scripts SUBDIRS=network-scripts
INCLUDES = \ INCLUDES = \
@@ -36,14 +38,10 @@ test_ifcfg_rh_utils_CPPFLAGS = \
test_ifcfg_rh_utils_LDADD = \ test_ifcfg_rh_utils_LDADD = \
$(builddir)/../libifcfg-rh-io.la $(builddir)/../libifcfg-rh-io.la
if WITH_TESTS
check-local: test-ifcfg-rh check-local: test-ifcfg-rh
$(abs_builddir)/test-ifcfg-rh-utils $(abs_builddir)/test-ifcfg-rh-utils
$(abs_builddir)/test-ifcfg-rh $(abs_builddir)/test-ifcfg-rh
endif
EXTRA_DIST = \ EXTRA_DIST = \
iscsiadm-test-dhcp \ iscsiadm-test-dhcp \
iscsiadm-test-static \ iscsiadm-test-static \
@@ -54,4 +52,5 @@ EXTRA_DIST = \
iscsiadm-test-bad-entry \ iscsiadm-test-bad-entry \
iscsiadm-test-bad-record iscsiadm-test-bad-record
endif

View File

@@ -1,4 +1,5 @@
SUBDIRS = . tests SUBDIRS = . tests
INCLUDES = \ INCLUDES = \
-I$(top_srcdir)/src/wifi \ -I$(top_srcdir)/src/wifi \
-I$(top_srcdir)/src/settings \ -I$(top_srcdir)/src/settings \

View File

@@ -1,3 +1,5 @@
if ENABLE_TESTS
INCLUDES=-I$(srcdir)/../ \ INCLUDES=-I$(srcdir)/../ \
-I$(top_srcdir)/libnm-glib \ -I$(top_srcdir)/libnm-glib \
-I$(top_srcdir)/libnm-util \ -I$(top_srcdir)/libnm-util \
@@ -17,3 +19,5 @@ EXTRA_DIST = hostname \
net.all \ net.all \
nm-system-settings.conf \ nm-system-settings.conf \
wpa_supplicant.conf wpa_supplicant.conf
endif

View File

@@ -1,4 +1,4 @@
SUBDIRS=. tests SUBDIRS = . tests
INCLUDES = \ INCLUDES = \
-I$(top_srcdir)/src/logging \ -I$(top_srcdir)/src/logging \

View File

@@ -1,3 +1,5 @@
if ENABLE_TESTS
INCLUDES = \ INCLUDES = \
-I$(top_srcdir)/include \ -I$(top_srcdir)/include \
-I$(top_srcdir)/libnm-util \ -I$(top_srcdir)/libnm-util \
@@ -20,14 +22,12 @@ test_ifupdown_LDADD = \
$(builddir)/../libifupdown-io.la \ $(builddir)/../libifupdown-io.la \
$(DBUS_LIBS) $(DBUS_LIBS)
if WITH_TESTS
check-local: test-ifupdown check-local: test-ifupdown
$(abs_builddir)/test-ifupdown $(abs_builddir)/test-ifupdown
endif
EXTRA_DIST = \ EXTRA_DIST = \
test1 test2 test3 test4 test5 test6 test7 test8 test9 test11 test12 \ test1 test2 test3 test4 test5 test6 test7 test8 test9 test11 test12 \
test13 test14 test15 test16 test17-wired-static-verify-ip4 \ test13 test14 test15 test16 test17-wired-static-verify-ip4 \
test18-wired-static-verify-ip6 test19-wired-static-verify-ip4-plen test18-wired-static-verify-ip6 test19-wired-static-verify-ip4-plen
endif

View File

@@ -1,4 +1,4 @@
SUBDIRS=. tests SUBDIRS = . tests
INCLUDES = \ INCLUDES = \
-I$(top_srcdir)/src/settings \ -I$(top_srcdir)/src/settings \

View File

@@ -1,3 +1,5 @@
if ENABLE_TESTS
SUBDIRS=keyfiles SUBDIRS=keyfiles
INCLUDES = \ INCLUDES = \
@@ -25,10 +27,7 @@ test_keyfile_LDADD = \
$(top_builddir)/libnm-util/libnm-util.la \ $(top_builddir)/libnm-util/libnm-util.la \
$(DBUS_LIBS) $(DBUS_LIBS)
if WITH_TESTS
check-local: test-keyfile check-local: test-keyfile
$(abs_builddir)/test-keyfile $(abs_builddir)/test-keyfile
endif endif

View File

@@ -1,3 +1,5 @@
if ENABLE_TESTS
INCLUDES = \ INCLUDES = \
-I$(top_srcdir)/include \ -I$(top_srcdir)/include \
-I$(top_builddir)/include \ -I$(top_builddir)/include \
@@ -24,10 +26,7 @@ test_wired_defname_LDADD = \
########################################### ###########################################
if WITH_TESTS
check-local: test-wired-defname check-local: test-wired-defname
$(abs_builddir)/test-wired-defname $(abs_builddir)/test-wired-defname
endif endif

View File

@@ -1,4 +1,4 @@
SUBDIRS=. tests SUBDIRS = . tests
INCLUDES = \ INCLUDES = \
-I${top_srcdir}/src \ -I${top_srcdir}/src \

View File

@@ -1,3 +1,5 @@
if ENABLE_TESTS
INCLUDES = \ INCLUDES = \
-I$(top_srcdir)/include \ -I$(top_srcdir)/include \
-I$(top_builddir)/include \ -I$(top_builddir)/include \
@@ -20,10 +22,7 @@ test_supplicant_config_LDADD = \
$(top_builddir)/src/supplicant-manager/libsupplicant-manager.la \ $(top_builddir)/src/supplicant-manager/libsupplicant-manager.la \
$(DBUS_LIBS) $(DBUS_LIBS)
if WITH_TESTS
check-local: test-supplicant-config check-local: test-supplicant-config
$(abs_builddir)/test-supplicant-config $(abs_builddir)/test-supplicant-config
endif endif

View File

@@ -1,3 +1,5 @@
if ENABLE_TESTS
INCLUDES = \ INCLUDES = \
-I$(top_srcdir)/include \ -I$(top_srcdir)/include \
-I$(top_builddir)/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 check-local: test-dhcp-options test-policy-hosts test-wifi-ap-utils
$(abs_builddir)/test-dhcp-options $(abs_builddir)/test-dhcp-options
$(abs_builddir)/test-policy-hosts $(abs_builddir)/test-policy-hosts
$(abs_builddir)/test-wifi-ap-utils $(abs_builddir)/test-wifi-ap-utils
endif endif