[network-manager-vpnc/th/vpn-editor-split-bgo766170: 12/20] build: cleanup configure.ac



commit b9ddc08bff5c10aa8f8e8f514e21207b9ed0de63
Author: Thomas Haller <thaller redhat com>
Date:   Mon May 9 12:13:47 2016 +0200

    build: cleanup configure.ac
    
    Make configure.ac more like done for nm-openvpn.
    
    - print options after ./configure
    - better handle invalid/conflicting options
    - bump required NetworkManager library versions to 1.2.0

 Makefile.am  |    6 ++--
 configure.ac |   71 ++++++++++++++++++++++++++++++++++++++++++---------------
 2 files changed, 55 insertions(+), 22 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 1c8c232..6ae251b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,7 +19,7 @@ install-data-hook:
        mkdir -p $(DESTDIR)$(sysconfdir)/NetworkManager/VPN
        sed -e "1s|^|# This file is obsoleted by a file in $(NM_VPN_SERVICE_DIR)\n\n|" \
            -e 's|[ ]LIBEXECDIR[@]|$(libexecdir)|g' \
-           -e 's|[ ]PLUGINDIR[@]|$(libdir)/NetworkManager|g' \
+           -e 's|[ ]PLUGINDIR[@]|@NM_PLUGIN_DIR@|g' \
            <$(srcdir)/nm-vpnc-service.name.in \
            >$(DESTDIR)$(sysconfdir)/NetworkManager/VPN/nm-vpnc-service.name
 
@@ -34,8 +34,8 @@ appdata_in_files = appdata/network-manager-vpnc.metainfo.xml.in
 
 nm-vpnc-service.name: $(srcdir)/nm-vpnc-service.name.in
        sed -e 's|[ ]LIBEXECDIR[@]|$(libexecdir)|g' \
-           -e 's|[ ]PLUGINDIR[@]/|@NM_PLUGIN_DIR@|g' \
-           $< >$@
+           -e 's|[ ]PLUGINDIR[@]/|@NM_PLUGIN_DIR_NAME_FILE@|g' \
+           $^ >$@
 
 DISTCHECK_CONFIGURE_FLAGS = \
        --with-tests=yes \
diff --git a/configure.ac b/configure.ac
index 1ccb16e..72735ba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,23 +39,38 @@ AC_PROG_GCC_TRADITIONAL
 AC_FUNC_MEMCMP
 AC_CHECK_FUNCS(select socket uname)
 
-dnl
-dnl GNOME support
-dnl
-AC_ARG_WITH(gnome, AS_HELP_STRING([--without-gnome], [Build NetworkManager-vpnc without GNOME support, e.g. 
vpn service only]))
-AM_CONDITIONAL(WITH_GNOME, test x"$with_gnome" != xno)
-AC_ARG_WITH(libnm-glib, AS_HELP_STRING([--without-libnm-glib], [Build NetworkManager-vpnc without libnm-glib 
comatibility]))
-AM_CONDITIONAL(WITH_LIBNM_GLIB, test x"$with_libnm_glib" != xno)
-AC_ARG_ENABLE(absolute-paths, AS_HELP_STRING([--enable-absolute-paths], [Use absolute paths to in .name 
files. Useful for development. (default is no)]))
-
 dnl ensure that when the Automake generated makefile calls aclocal,
 dnl it honours the $ACLOCAL_FLAGS environment variable
 ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
 if test -n "$ac_macro_dir"; then
-       ACLOCAL_AMFLAGS="-I $ac_macro_dir $ACLOCAL_AMFLAGS"
+    ACLOCAL_AMFLAGS="-I $ac_macro_dir $ACLOCAL_AMFLAGS"
 fi
 AC_SUBST([ACLOCAL_AMFLAGS])
 
+dnl
+dnl GNOME support
+dnl
+AC_ARG_WITH(gnome, AS_HELP_STRING([--without-gnome], [Build NetworkManager-vpnc without GNOME support, e.g. 
vpn service only]), [], [with_gnome_specified=no])
+AC_ARG_WITH(libnm-glib, AS_HELP_STRING([--without-libnm-glib], [Build NetworkManager-vpnc without libnm-glib 
comatibility]), [], [with_libnm_glib_specified=no])
+if test "$with_libnm_glib_specified" != no -a "$with_libnm_glib" != no; then
+       if test "$with_gnome_specified" != no -a "$with_gnome" == no; then
+               AC_MSG_ERROR(Building --with-libnm-glib conflicts with --without-gnome)
+       fi
+fi
+if test "$with_gnome" != no; then
+       with_gnome=yes
+fi
+if test "$with_libnm_glib_specified" == no; then
+       with_libnm_glib="$with_gnome"
+fi
+if test "$with_libnm_glib" != no; then
+       with_libnm_glib=yes
+fi
+AM_CONDITIONAL(WITH_GNOME, test "$with_gnome" != no)
+AM_CONDITIONAL(WITH_LIBNM_GLIB, test "$with_libnm_glib" != no)
+
+AC_ARG_ENABLE(absolute-paths, AS_HELP_STRING([--enable-absolute-paths], [Use absolute paths to in .name 
files. Useful for development. (default is no)]))
+
 GETTEXT_PACKAGE=NetworkManager-vpnc
 AC_SUBST(GETTEXT_PACKAGE)
 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
@@ -70,7 +85,7 @@ if test x"$with_gnome" != xno; then
        PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.4)
        GTK_CFLAGS="$GTK_CFLAGS -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_4"
 
-       PKG_CHECK_MODULES(LIBNMA, libnma >= 1.1.0)
+       PKG_CHECK_MODULES(LIBNMA, libnma >= 1.2.0)
        PKG_CHECK_MODULES(LIBSECRET, libsecret-1 >= 0.18, [], [
                dnl We use the secret service API that went stable in 0.18
                PKG_CHECK_MODULES(LIBSECRET, libsecret-unstable)
@@ -78,16 +93,19 @@ if test x"$with_gnome" != xno; then
        ])
 
        if test x"$with_libnm_glib" != xno; then
-               PKG_CHECK_MODULES(LIBNM_GTK, libnm-gtk >= 0.9.9.0)
+               PKG_CHECK_MODULES(LIBNM_GTK, libnm-gtk >= 1.2.0)
                PKG_CHECK_MODULES(LIBNM_GLIB,
-                                 NetworkManager >= 0.9.6
-                                 libnm-util >= 0.9.6
-                                 libnm-glib >= 0.9.6
-                                 libnm-glib-vpn >= 0.9.6)
+                       NetworkManager >= 1.2.0
+                       libnm-util >= 1.2.0
+                       libnm-glib >= 1.2.0
+                       libnm-glib-vpn >= 1.2.0);
+
+               LIBNM_GLIB_CFLAGS="$LIBNM_GLIB_CFLAGS -DNM_VERSION_MIN_REQUIRED=NM_VERSION_1_2"
+               LIBNM_GLIB_CFLAGS="$LIBNM_GLIB_CFLAGS -DNM_VERSION_MAX_ALLOWED=NM_VERSION_1_2"
        fi
 fi
 
-PKG_CHECK_MODULES(LIBNM, libnm >= 1.1.0)
+PKG_CHECK_MODULES(LIBNM, libnm >= 1.2.0)
 LIBNM_CFLAGS="$LIBNM_CFLAGS -DNM_VERSION_MIN_REQUIRED=NM_VERSION_1_2"
 LIBNM_CFLAGS="$LIBNM_CFLAGS -DNM_VERSION_MAX_ALLOWED=NM_VERSION_1_2"
 
@@ -96,8 +114,15 @@ AC_SUBST(NM_VPN_SERVICE_DIR)
 
 NM_COMPILER_WARNINGS
 
-test x"$enable_absolute_paths" = x"yes" && NM_PLUGIN_DIR='$(libdir)/NetworkManager/'
+NM_PLUGIN_DIR="$libdir/NetworkManager"
 AC_SUBST(NM_PLUGIN_DIR)
+if test x"$enable_absolute_paths" == x"yes"; then
+       NM_PLUGIN_DIR_NAME_FILE="$NM_PLUGIN_DIR/"
+else
+       enable_absolute_paths=no
+       NM_PLUGIN_DIR_NAME_FILE=""
+fi
+AC_SUBST(NM_PLUGIN_DIR_NAME_FILE)
 
 dnl
 dnl Tests
@@ -134,12 +159,20 @@ AC_DEFINE_UNQUOTED(NM_MORE_ASSERTS, $more_asserts, [Define if more asserts are e
 
 AC_CONFIG_FILES([
 Makefile
-shared/Makefile
 src/Makefile
 auth-dialog/Makefile
 properties/Makefile
 properties/tests/Makefile
 properties/tests/pcf/Makefile
 po/Makefile.in
+shared/Makefile
 ])
 AC_OUTPUT
+
+echo ""
+echo "Build configuration: "
+echo "  --with-gnome=$with_gnome"
+echo "  --with-libnm-glib=$with_libnm_glib"
+echo "  --enable-absolute-paths=$enable_absolute_paths"
+echo "  --enable-more-warnings=$set_more_warnings"
+echo "  --with-more-asserts=$more_asserts"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]