diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2023-05-03 16:53:25 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2023-05-03 16:53:25 +0200 |
commit | 2684f4b27f5ce16df00d2b3d13984c41ec9a5e5c (patch) | |
tree | 6df48b3c849998915a4123568e6ed32b43ba935d | |
parent | fc2ea65818a797166c3528fe8c5d36fd7021b311 (diff) |
build: Add options to disable compilation of tools, examples and tests
-rw-r--r-- | Makefile.am | 25 | ||||
-rw-r--r-- | configure.ac | 17 |
2 files changed, 31 insertions, 11 deletions
diff --git a/Makefile.am b/Makefile.am index 5281c01d..1d279e2c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -252,9 +252,11 @@ cert_checks = unit/cert-intca \ unit/cert-client \ unit/cert-no-keyid +if TESTS if MAINTAINER_MODE noinst_PROGRAMS += $(unit_tests) $(dbus_tests) $(cert_tests) endif +endif unit_test_unit_LDADD = ell/libell-private.la @@ -348,18 +350,18 @@ unit_test_net_LDADD = ell/libell-private.la unit_test_data_files = unit/settings.test unit/dbus.conf -examples = examples/dbus-service examples/https-client-test \ - examples/https-server-test examples/dbus-client \ - examples/dhcp-client examples/dhcp6-client \ - examples/dhcp-server examples/acd-client \ - examples/netconfig-test +if EXAMPLES +if MAINTAINER_MODE +noinst_PROGRAMS += examples/dbus-service examples/https-client-test \ + examples/https-server-test examples/dbus-client \ + examples/dhcp-client examples/dhcp6-client \ + examples/dhcp-server examples/acd-client \ + examples/netconfig-test if GLIB -examples += examples/glib-eventloop +noinst_PROGRAMS += examples/glib-eventloop +endif endif - -if MAINTAINER_MODE -noinst_PROGRAMS += $(examples) endif examples_dbus_service_LDADD = ell/libell-private.la @@ -374,8 +376,11 @@ examples_dhcp_server_LDADD = ell/libell-private.la examples_acd_client_LDADD = ell/libell-private.la examples_netconfig_test_LDADD = ell/libell-private.la +if TOOLS noinst_PROGRAMS += tools/certchain-verify tools/genl-discover \ tools/genl-watch tools/genl-request tools/gpio +endif + tools_certchain_verify_SOURCES = tools/certchain-verify.c tools_certchain_verify_LDADD = ell/libell-private.la @@ -676,11 +681,13 @@ unit/key-signature.dat: unit/plaintext.txt unit/cert-client-key-pkcs1.pem unit/key-signature.h: unit/key-signature.dat $(AM_V_GEN)xxd -i < $< > $@ +if TESTS if MAINTAINER_MODE BUILT_SOURCES = unit/key-plaintext.h unit/key-ciphertext.h unit/key-signature.h check-local: $(cert_checks) endif +endif clean-local: -rm -f unit/ec-cert*.pem unit/ec-cert-*.csr unit/cert-*.crt \ diff --git a/configure.ac b/configure.ac index 3b58271c..fb7a997b 100644 --- a/configure.ac +++ b/configure.ac @@ -114,14 +114,12 @@ AC_CHECK_HEADERS(linux/types.h linux/if_alg.h) AC_ARG_ENABLE(glib, AS_HELP_STRING([--enable-glib], [enable ell/glib main loop example]), [enable_glib=${enableval}]) - if (test "${enable_glib}" = "yes"); then PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.32, dummy=yes, AC_MSG_ERROR(GLib >= 2.32 is required)) AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) fi - AM_CONDITIONAL(GLIB, test "${enable_glib}" = "yes") if (test "$USE_MAINTAINER_MODE" = "yes"); then @@ -129,6 +127,21 @@ if (test "$USE_MAINTAINER_MODE" = "yes"); then AC_CHECK_PROG(have_xxd, [xxd], [yes], [no]) fi +AC_ARG_ENABLE(tests, AS_HELP_STRING([--disable-tests], + [disable unit tests compilation]), + [enable_tests=${enableval}]) +AM_CONDITIONAL(TESTS, test "${enable_tests}" != "no") + +AC_ARG_ENABLE(tools, AS_HELP_STRING([--disable-tools], + [disable extra tools compilation]), + [enable_tools=${enableval}]) +AM_CONDITIONAL(TOOLS, test "${enable_tools}" != "no") + +AC_ARG_ENABLE(examples, AS_HELP_STRING([--disable-examples], + [disable code examples compilation]), + [enable_examples=${enableval}]) +AM_CONDITIONAL(EXAMPLES, test "${enable_examples}" != "no") + AM_CONDITIONAL(DBUS_TESTS, test "${little_endian}" = "yes") AM_CONDITIONAL(CERT_TESTS, test "${have_openssl}" = "yes") AM_CONDITIONAL(OPENSSL_PROVIDER, test "${have_openssl}" = "yes" && |