[network-manager-fortisslvpn/th/gtk-split-and-log-bgo771544: 10/25] build: cleanup configure.ac



commit 49e202b487ddfa17b765a37faa5c541d137e9b2a
Author: Thomas Haller <thaller redhat com>
Date:   Fri Sep 16 00:44:27 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 |   62 +++++++++++++++++++++++++++++++++++++++++++--------------
 2 files changed, 50 insertions(+), 18 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index d495f2c..690bed8 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-fortisslvpn-service.name.in \
            >$(DESTDIR)$(sysconfdir)/NetworkManager/VPN/nm-fortisslvpn-service.name
 
@@ -34,8 +34,8 @@ appdata_in_files = appdata/network-manager-fortisslvpn.metainfo.xml.in
 
 nm-fortisslvpn-service.name: $(srcdir)/nm-fortisslvpn-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 = --enable-more-warnings=yes
 
diff --git a/configure.ac b/configure.ac
index da87666..99f0141 100644
--- a/configure.ac
+++ b/configure.ac
@@ -53,13 +53,29 @@ AC_CHECK_FUNCS(select socket uname)
 
 GIT_SHA_RECORD(NM_GIT_SHA)
 
+
 dnl
 dnl GNOME support
 dnl
-AC_ARG_WITH(gnome, AS_HELP_STRING([--without-gnome], [Build NetworkManager-fortisslvpn 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-fortisslvpn without 
libnm-glib comatibility]))
-AM_CONDITIONAL(WITH_LIBNM_GLIB, test x"$with_libnm_glib" != xno)
+AC_ARG_WITH(gnome, AS_HELP_STRING([--without-gnome], [Build NetworkManager-fortisslvpn 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-fortisslvpn 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-fortisslvpn
@@ -75,15 +91,11 @@ AC_SUBST(GLIB_CFLAGS)
 AC_SUBST(GLIB_LIBS)
 GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32"
 
-PKG_CHECK_MODULES(LIBNM, libnm >= 1.1.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"
-
 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)
@@ -91,25 +103,36 @@ if test x"$with_gnome" != xno; then
        ])
 
        if test x"$with_libnm_glib" != xno; then
-               PKG_CHECK_MODULES(LIBNM_GTK, libnm-gtk >= 1.0.4)
+               PKG_CHECK_MODULES(LIBNM_GTK, libnm-gtk >= 1.2.0)
 
                PKG_CHECK_MODULES(LIBNM_GLIB,
-                               NetworkManager >= 1.1.0
-                               libnm-util >= 1.1.0
-                               libnm-glib >= 1.1.0
-                               libnm-glib-vpn >= 1.1.0)
+                               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.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"
+
 NM_VPN_SERVICE_DIR=`$PKG_CONFIG --define-variable prefix='\${prefix}' --variable vpnservicedir libnm`
 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 Distribution version string
@@ -128,3 +151,12 @@ po/Makefile.in
 shared/Makefile
 ])
 AC_OUTPUT
+
+echo ""
+echo "Build configuration: "
+echo "  --with-dist-version=$ac_distver"
+echo "  --with-gnome=$with_gnome"
+echo "  --with-libnm-glib=$with_libnm_glib"
+echo "  --with-pppd-plugin-dir=$PPPD_PLUGIN_DIR"
+echo "  --enable-absolute-paths=$enable_absolute_paths"
+echo "  --enable-more-warnings=$set_more_warnings"


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