From 9ee81bd8d98758d268a229c61c82d83ec75eeaa0 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Wed, 29 Jul 2015 15:37:43 -0400 Subject: build: make libnm-util/libnm-glib optional Add --without-libnm-glib, for people who don't want to build the legacy client libraries. When building with this option, dbus-glib and libdbus are not required. --- Makefile.am | 14 ++++++++++---- configure.ac | 20 +++++++++++++------- docs/Makefile.am | 7 ++++++- vapi/Makefile.am | 2 ++ 4 files changed, 31 insertions(+), 12 deletions(-) diff --git a/Makefile.am b/Makefile.am index 3ce59e1352..00e703cc1c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,8 +6,6 @@ SUBDIRS = \ introspection \ libnm-core \ libnm \ - libnm-util \ - libnm-glib \ src \ callouts \ clients \ @@ -15,9 +13,17 @@ SUBDIRS = \ policy \ data \ po \ - docs \ man \ - examples \ + examples + +if WITH_LEGACY_LIBRARIES +SUBDIRS += \ + libnm-util \ + libnm-glib +endif + +SUBDIRS += \ + docs \ vapi @GNOME_CODE_COVERAGE_RULES@ diff --git a/configure.ac b/configure.ac index e22ac8857d..6e1a64865f 100644 --- a/configure.ac +++ b/configure.ac @@ -268,13 +268,6 @@ dnl AC_CHECK_LIB([dl], [dladdr], LIBDL="-ldl", LIBDL="") AC_SUBST(LIBDL) -dnl -dnl Checks for dbus-glib -dnl -PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.1 dbus-glib-1 >= 0.94) -AC_SUBST(DBUS_CFLAGS) -AC_SUBST(DBUS_LIBS) - PKG_CHECK_MODULES(GLIB, [gio-unix-2.0 >= 2.37.6 gmodule-2.0], [AC_SUBST(LOG_DRIVER, '$(top_srcdir)/build-aux/tap-driver.sh'), AC_SUBST(AM_TESTS_FD_REDIRECT, '--tap')], @@ -290,6 +283,18 @@ GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32 -DGLIB_V AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) +AC_ARG_WITH(libnm-glib, AS_HELP_STRING([--without-libnm-glib], [don't build legacy libraries])) +if test "$with_libnm_glib" != "no"; then + PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.1 dbus-glib-1 >= 0.94, :, + [AC_MSG_FAILURE([$DBUS_PKG_ERRORS + +Configure with --without-libnm-glib if you do not need the legacy libraries])]) + AC_SUBST(DBUS_CFLAGS) + AC_SUBST(DBUS_LIBS) + with_libnm_glib=yes +fi +AM_CONDITIONAL(WITH_LEGACY_LIBRARIES, test "$with_libnm_glib" != "no") + PKG_CHECK_MODULES(GUDEV, gudev-1.0 >= 165) AC_SUBST(GUDEV_CFLAGS) AC_SUBST(GUDEV_LIBS) @@ -1132,6 +1137,7 @@ echo " ppp: $enable_ppp" echo " modemmanager-1: $with_modem_manager_1" echo " concheck: $enable_concheck" echo " libteamdctl: $enable_teamdctl" +echo " libnm-glib: $with_libnm_glib" echo " nmtui: $build_nmtui" echo diff --git a/docs/Makefile.am b/docs/Makefile.am index 5fdeff62b4..52cbe5286d 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -1,2 +1,7 @@ -SUBDIRS = libnm-glib libnm-util libnm api +SUBDIRS = libnm api +if WITH_LEGACY_LIBRARIES +SUBDIRS += \ + libnm-util \ + libnm-glib +endif diff --git a/vapi/Makefile.am b/vapi/Makefile.am index e154554893..4913d1a580 100644 --- a/vapi/Makefile.am +++ b/vapi/Makefile.am @@ -4,7 +4,9 @@ EXTRA_DIST = \ libnm-util.deps \ libnm-glib.deps +if WITH_LEGACY_LIBRARIES VAPIGEN_VAPIS = libnm-util.vapi libnm-glib.vapi +endif if ENABLE_VAPIGEN include Makefile.vapigen -- cgit v1.2.1