[network-manager-pptp/th/vpn-editor-split-bgo766623: 15/21] build: cleanup configure.ac



commit af00b62a6618f34760b890cc34a58b4aaa9d87bb
Author: Thomas Haller <thaller redhat com>
Date:   Wed May 18 18:49:04 2016 +0200

    build: cleanup configure.ac
    
    Make configure.ac more like done for nm-openvpn.
    
    - print options after ./configure
    - better handle invalid/conflicting options

 Makefile.am  |    4 ++--
 configure.ac |   48 +++++++++++++++++++++++++++++++++++++++---------
 2 files changed, 41 insertions(+), 11 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 66eaa9e..cac70ff 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-pptp-service.name.in \
            >$(DESTDIR)$(sysconfdir)/NetworkManager/VPN/nm-pptp-service.name
 
@@ -34,7 +34,7 @@ appdata_in_files = appdata/network-manager-pptp.metainfo.xml.in
 
 nm-pptp-service.name: $(srcdir)/nm-pptp-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 816848b..54d07e4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,10 +54,25 @@ AC_CHECK_FUNCS(select socket uname)
 dnl
 dnl GNOME support
 dnl
-AC_ARG_WITH(gnome, AS_HELP_STRING([--without-gnome], [Build NetworkManager-pptp 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-pptp 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-pptp 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-pptp 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-pptp
@@ -85,10 +100,11 @@ if test x"$with_gnome" != xno; then
        if test x"$with_libnm_glib" != xno; then
                PKG_CHECK_MODULES(LIBNM_GTK, libnm-gtk >= 1.2.0)
                PKG_CHECK_MODULES(LIBNM_GLIB,
-                                 NetworkManager >= 1.2.0
-                                 libnm-util >= 1.2.0
-                                 libnm-glib >= 1.2.0
-                                 libnm-glib-vpn >= 1.2.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
@@ -103,8 +119,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 Distribution version string
@@ -123,3 +146,10 @@ 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"


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