[PATCHES] misc (build-system) clean-ups / improvements



Hi,

attached is a series of patches for NetworkManager, which tries to clean up and
update the build system a little, replace deprecated macros, etc.

The more important patches are 0005 and 0007, which make use of a separate m4
macro directory and split out the compiler warnings check into a reusable macro
file (m4/compiler_warnings.m4), as I noticed that all NM projects more or less
have this check copied into their configure.ac, even if it has diverged a little
between them.

I'd be most interested if we could come up with a common set of -W flags, that
could/should be used for all NM projects.
The current compiler_warnings.m4 file is basically what I ripped out of NMs
configure.in and turned into a macro.

Having this macro in a separate file, makes it easier to keep it in sync between
the nm related projects, by
1.) simply copying it into the m4/ directory for all nm dependend projects
2.) letting the NetworkManager package install the macro file into
/usr/share/aclocal (we should then probably pick a less generic name as
compiler_warnings.m4). Running ./autogen.sh e.g. in network-manager-applet will
then automatically copy the file into the local m4/ directory
3.) using something like a common git submodule.

For now, I went with 1.)

I also have similar patches for network-manager-applet and network-manager-* vpn
modules. If the above changes are considered useful, I will post them too.

FWIW, network-manager-openconnect, network-manager-pptp and network-manager-vpnc
will fail to build with the set of warning flags we use for NetworkManager.
I think another good reason to unify those checks.

As a next step, I'd then like to look into how to properly use the *_DEPRECATED
defines.
Currently NMs configure.in has:

dnl maintainer mode stuff
if test $USE_MAINTAINER_MODE = yes; then
        DISABLE_DEPRECATED="-DG_DISABLE_DEPRECATED -DGCONF_DISABLE_DEPRECATED"
else
        DISABLE_DEPRECATED=""
fi
AC_SUBST(DISABLE_DEPRECATED)

Yet, we nowhere use that in the code. Some Makefile.amS have explicit
-DG_DISABLE_DEPRECATED in their *_CPPFLAGS.
Imho it would be worthwhile to unify that too, by pulling those define out of
the Makefile.amS and setting them globally via CFLAGS in configure.ac.

Thoughts and comments welcome.

Cheers,
Michael

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
From 3e8bbdbeed0825f2001ded3dcd8581d7c88012a1 Mon Sep 17 00:00:00 2001
From: Michael Biebl <biebl debian org>
Date: Mon, 20 Apr 2009 23:59:28 +0200
Subject: [PATCH 1/9] Remove DBUS_API_SUBJECT_TO_CHANGE

We require dbus 1.1 anyway
---
 callouts/Makefile.am               |    3 ---
 libnm-util/Makefile.am             |    1 -
 src/Makefile.am                    |    1 -
 src/backends/Makefile.am           |    1 -
 src/dhcp-manager/Makefile.am       |    1 -
 src/named-manager/Makefile.am      |    3 +--
 src/supplicant-manager/Makefile.am |    3 +--
 system-settings/src/Makefile.am    |    1 -
 test/Makefile.am                   |    1 -
 test/nm-online.c                   |    1 -
 10 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/callouts/Makefile.am b/callouts/Makefile.am
index 8e43c69..d77fea5 100644
--- a/callouts/Makefile.am
+++ b/callouts/Makefile.am
@@ -15,7 +15,6 @@ nm_dhcp_client_action_SOURCES = \
 nm_dhcp_client_action_CPPFLAGS = \
 	$(DBUS_CFLAGS) \
 	$(GLIB_CFLAGS) \
-	-DDBUS_API_SUBJECT_TO_CHANGE \
 	-DG_DISABLE_DEPRECATED \
 	-DSYSCONFDIR=\"$(sysconfdir)\" \
 	-DLIBEXECDIR=\"$(libexecdir)\"
@@ -31,7 +30,6 @@ nm_avahi_autoipd_action_SOURCES = \
 nm_avahi_autoipd_action_CPPFLAGS = 		\
 	$(DBUS_CFLAGS)						\
 	$(GLIB_CFLAGS)					\
-	-DDBUS_API_SUBJECT_TO_CHANGE		\
 	-DG_DISABLE_DEPRECATED				\
 	-DSYSCONFDIR=\"$(sysconfdir)\"		\
 	-DLIBEXECDIR=\"$(libexecdir)\"
@@ -51,7 +49,6 @@ nm_dispatcher_action_CPPFLAGS = \
 	-I${top_srcdir}/libnm-util \
 	$(DBUS_CFLAGS) \
 	$(GLIB_CFLAGS) \
-	-DDBUS_API_SUBJECT_TO_CHANGE \
 	-DG_DISABLE_DEPRECATED \
 	-DSYSCONFDIR=\"$(sysconfdir)\" \
 	-DLIBEXECDIR=\"$(libexecdir)\"
diff --git a/libnm-util/Makefile.am b/libnm-util/Makefile.am
index 177e3b3..225d4b5 100644
--- a/libnm-util/Makefile.am
+++ b/libnm-util/Makefile.am
@@ -8,7 +8,6 @@ libnm_util_la_CPPFLAGS = \
 	$(GLIB_CFLAGS) \
 	$(DBUS_CFLAGS) \
 	$(UUID_CFLAGS) \
-	-DDBUS_API_SUBJECT_TO_CHANGE \
 	-DG_DISABLE_DEPRECATED
 
 libnm_util_include_HEADERS = 		\
diff --git a/src/Makefile.am b/src/Makefile.am
index fe40711..be4431a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -139,7 +139,6 @@ NetworkManager_CPPFLAGS = 							\
 	$(HAL_CFLAGS)									\
 	$(OPENSSL_CFLAGS)								\
 	$(LIBNL_CFLAGS)								\
-	-DDBUS_API_SUBJECT_TO_CHANGE						\
 	-DG_DISABLE_DEPRECATED							\
 	-DBINDIR=\"$(bindir)\"							\
 	-DSBINDIR=\"$(sbindir)\"							\
diff --git a/src/backends/Makefile.am b/src/backends/Makefile.am
index 4674672..d32f635 100644
--- a/src/backends/Makefile.am
+++ b/src/backends/Makefile.am
@@ -53,7 +53,6 @@ libnmbackend_la_LIBADD += $(DBUS_LIBS) $(GLIB_LIBS)
 libnmbackend_la_CPPFLAGS =	$(DBUS_CFLAGS)				\
 					$(GLIB_CFLAGS)				\
 					$(HAL_CFLAGS)					\
-					-DDBUS_API_SUBJECT_TO_CHANGE		\
 					-DG_DISABLE_DEPRECATED			\
 					-DBINDIR=\"$(bindir)\"			\
 					-DDATADIR=\"$(datadir)\"			\
diff --git a/src/dhcp-manager/Makefile.am b/src/dhcp-manager/Makefile.am
index 15d23a9..409e5a3 100644
--- a/src/dhcp-manager/Makefile.am
+++ b/src/dhcp-manager/Makefile.am
@@ -17,7 +17,6 @@ libdhcp_manager_la_CPPFLAGS = \
 	$(DBUS_CFLAGS) \
 	$(GLIB_CFLAGS) \
 	$(HAL_CFLAGS) \
-	-DDBUS_API_SUBJECT_TO_CHANGE \
 	-DG_DISABLE_DEPRECATED \
 	-DBINDIR=\"$(bindir)\" \
 	-DDATADIR=\"$(datadir)\" \
diff --git a/src/named-manager/Makefile.am b/src/named-manager/Makefile.am
index 68857a0..fe1ec91 100644
--- a/src/named-manager/Makefile.am
+++ b/src/named-manager/Makefile.am
@@ -8,7 +8,6 @@ libnamed_manager_la_CPPFLAGS = \
 	$(DBUS_CFLAGS) \
 	$(GLIB_CFLAGS) \
 	-DNM_PKGDATADIR=\"$(pkgdatadir)\" \
-	-DNM_LOCALSTATEDIR=\"$(localstatedir)\" \
-	-DDBUS_API_SUBJECT_TO_CHANGE
+	-DNM_LOCALSTATEDIR=\"$(localstatedir)\"
 
 libnamed_manager_la_LIBADD = $(DBUS_LIBS) $(GLIB_LIBS)
diff --git a/src/supplicant-manager/Makefile.am b/src/supplicant-manager/Makefile.am
index 91150c9..df27d5c 100644
--- a/src/supplicant-manager/Makefile.am
+++ b/src/supplicant-manager/Makefile.am
@@ -23,8 +23,7 @@ libsupplicant_manager_la_CPPFLAGS = \
 	$(GLIB_CFLAGS) \
 	$(HAL_CFLAGS) \
 	-DNM_PKGDATADIR=\"$(pkgdatadir)\" \
-	-DNM_LOCALSTATEDIR=\"$(localstatedir)\" \
-	-DDBUS_API_SUBJECT_TO_CHANGE
+	-DNM_LOCALSTATEDIR=\"$(localstatedir)\"
 
 libsupplicant_manager_la_LIBADD = \
 	$(DBUS_LIBS) \
diff --git a/system-settings/src/Makefile.am b/system-settings/src/Makefile.am
index b444e9c..0b2a646 100644
--- a/system-settings/src/Makefile.am
+++ b/system-settings/src/Makefile.am
@@ -35,7 +35,6 @@ nm_system_settings_CPPFLAGS = \
 	$(GLIB_CFLAGS) \
 	$(GMODULE_CFLAGS) \
 	$(POLKIT_CFLAGS) \
-	-DDBUS_API_SUBJECT_TO_CHANGE \
 	-DG_DISABLE_DEPRECATED	\
 	-DBINDIR=\"$(bindir)\" \
 	-DSBINDIR=\"$(sbindir)\" \
diff --git a/test/Makefile.am b/test/Makefile.am
index 7b46f73..47bf2a5 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -8,7 +8,6 @@ AM_CPPFLAGS =						\
 	$(DBUS_CFLAGS)					\
 	$(GLIB_CFLAGS)				\
 	$(HAL_CFLAGS)					\
-	-DDBUS_API_SUBJECT_TO_CHANGE		\
 	-DBINDIR=\"$(bindir)\"			\
 	-DNM_RUN_DIR=\"$(rundir)\" \
 	-DDATADIR=\"$(datadir)\"
diff --git a/test/nm-online.c b/test/nm-online.c
index 2e40089..3827c74 100644
--- a/test/nm-online.c
+++ b/test/nm-online.c
@@ -30,7 +30,6 @@
  * Robert Love <rml novell com>
  */
 
-#define DBUS_API_SUBJECT_TO_CHANGE 1
 #define PROGRESS_STEPS 15
 
 #include <ctype.h>
-- 
1.6.2.4

From e9babbe965b9ac7f3b3c838e1bbc484ab4a66f01 Mon Sep 17 00:00:00 2001
From: Michael Biebl <biebl debian org>
Date: Tue, 21 Apr 2009 00:46:22 +0200
Subject: [PATCH 2/9] Rename configure.in to configure.ac

---
 configure.ac |  533 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 configure.in |  533 ----------------------------------------------------------
 2 files changed, 533 insertions(+), 533 deletions(-)
 create mode 100644 configure.ac
 delete mode 100644 configure.in

diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..97ab091
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,533 @@
+AC_PREREQ(2.52)
+
+AC_INIT(NetworkManager, 0.7.995, dcbw redhat com, NetworkManager)
+AM_INIT_AUTOMAKE([1.9 subdir-objects tar-ustar no-dist-gzip dist-bzip2])
+AM_MAINTAINER_MODE
+
+AC_CONFIG_HEADERS(config.h)
+
+dnl
+dnl Require programs
+dnl
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_INSTALL
+AC_PROG_LIBTOOL
+
+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"
+fi
+AC_SUBST([ACLOCAL_AMFLAGS])
+
+dnl maintainer mode stuff
+if test $USE_MAINTAINER_MODE = yes; then
+	DISABLE_DEPRECATED="-DG_DISABLE_DEPRECATED -DGCONF_DISABLE_DEPRECATED"
+else
+	DISABLE_DEPRECATED=""
+fi
+AC_SUBST(DISABLE_DEPRECATED)
+
+dnl
+dnl Required headers
+dnl
+AC_HEADER_STDC
+AC_CHECK_HEADERS(fcntl.h paths.h sys/ioctl.h sys/time.h syslog.h unistd.h)
+
+dnl
+dnl Checks for typedefs, structures, and compiler characteristics.
+dnl
+AC_TYPE_MODE_T
+AC_TYPE_PID_T
+AC_HEADER_TIME
+
+dnl
+dnl Checks for library functions.
+dnl
+AC_PROG_GCC_TRADITIONAL
+AC_FUNC_MEMCMP
+AC_CHECK_FUNCS(select socket uname)
+
+dnl
+dnl translation support
+dnl
+GETTEXT_PACKAGE=NetworkManager
+AC_SUBST(GETTEXT_PACKAGE)
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
+IT_PROG_INTLTOOL([0.35.0])
+AM_GLIB_GNU_GETTEXT
+
+dnl
+dnl Documentation
+dnl
+AC_ARG_WITH(docs, AC_HELP_STRING([--with-docs], [Build NetworkManager documentation]))
+AM_CONDITIONAL(WITH_DOCS, test "x$with_docs" = "xyes")
+case $with_docs in
+    yes)
+        enable_gtk_doc=yes
+        ;;
+    *)
+        with_docs=no
+        ;;
+esac
+
+dnl
+dnl Make sha1.c happy on big endian systems
+dnl
+AC_C_BIGENDIAN
+
+AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, suse, gentoo, debian, arch, slackware, paldo or mandriva]))
+if test "z$with_distro" = "z"; then
+	AC_CHECK_FILE(/etc/redhat-release,with_distro="redhat")
+	AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
+	AC_CHECK_FILE(/etc/fedora-release,with_distro="redhat")
+	AC_CHECK_FILE(/etc/gentoo-release,with_distro="gentoo")
+	AC_CHECK_FILE(/etc/debian_version,with_distro="debian")
+	AC_CHECK_FILE(/etc/arch-release,with_distro="arch")
+	AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware")
+	AC_CHECK_FILE(/etc/frugalware-release,with_distro="frugalware")
+	AC_CHECK_FILE(/etc/mandriva-release,with_distro="mandriva")
+	if test "z$with_distro" = "z"; then
+		with_distro=`lsb_release -is`
+	fi
+fi
+with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' `
+
+if test "z$with_distro" = "z"; then
+	echo "Linux distribution autodetection failed, you must specify the distribution to target using --with-distro=DISTRO"
+	exit 1
+else
+	case $with_distro in
+		redhat|suse|gentoo|debian|slackware|arch|paldo|frugalware|mandriva) ;;
+		*)
+			echo "Your distribution (${with_distro}) is not yet supported!  (patches welcome)"
+			exit 1
+			;;
+	esac
+fi
+
+AM_CONDITIONAL(TARGET_REDHAT, test x"$with_distro" = xredhat)
+if test x"$with_distro" = xredhat; then
+  AC_DEFINE(TARGET_REDHAT, 1, [Define if you have Fedora or RHEL])
+fi
+
+AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
+if test x"$with_distro" = xsuse; then
+  AC_DEFINE(TARGET_SUSE, 1, [Define if you have OpenSUSE or SLES])
+fi
+
+AM_CONDITIONAL(TARGET_GENTOO, test x"$with_distro" = xgentoo)
+if test x"$with_distro" = xgentoo; then
+  AC_DEFINE(TARGET_GENTOO, 1, [Define if you have Gentoo])
+fi
+
+AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
+if test x"$with_distro" = xdebian; then
+  AC_DEFINE(TARGET_DEBIAN, 1, [Define if you have Debian])
+fi
+
+AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware)
+if test x"$with_distro" = xslackware; then
+  AC_DEFINE(TARGET_SLACKWARE, 1, [Define if you have Slackware])
+fi
+
+AM_CONDITIONAL(TARGET_ARCH, test x"$with_distro" = xarch)
+if test x"$with_distro" = xarch; then
+  AC_DEFINE(TARGET_ARCH, 1, [Define if you have Arch])
+fi
+
+AM_CONDITIONAL(TARGET_PALDO, test x"$with_distro" = xpaldo)
+if test x"$with_distro" = xpaldo; then
+  AC_DEFINE(TARGET_PALDO, 1, [Define if you have Paldo])
+fi
+
+AM_CONDITIONAL(TARGET_FRUGALWARE, test x"$with_distro" = xfrugalware)
+if test x"$with_distro" = xfrugalware; then
+  AC_DEFINE(TARGET_FRUGALWARE, 1, [Define if you have Frugalware])
+fi
+
+AM_CONDITIONAL(TARGET_MANDRIVA, test x"$with_distro" = xmandriva)
+if test x"$with_distro" = xmandriva; then
+  AC_DEFINE(TARGET_MANDRIVA, 1, [Define if you have Mandriva])
+fi
+
+AC_MSG_CHECKING([Linux Wireless Extensions >= 18])
+AC_TRY_COMPILE([#ifndef __user
+                #define __user
+                #endif
+                #include <sys/types.h>
+                #include <linux/types.h>
+                #include <sys/socket.h>
+                #include <net/if.h>
+                #include <wireless.h>],
+               [#ifndef IWEVGENIE
+                #error "not found"
+                #endif],
+               [ac_have_iwevgenie=yes],
+               [ac_have_iwevgenie=no])
+AC_MSG_RESULT($ac_have_iwevgenie)
+if test "$ac_have_iwevgenie" = no; then
+	AC_MSG_ERROR(wireless-tools library and development headers >= 28pre9 not installed or not functional)
+fi
+
+PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.1 dbus-glib-1 >= 0.75)
+AC_SUBST(DBUS_CFLAGS)
+AC_SUBST(DBUS_LIBS)
+
+PKG_CHECK_MODULES(GLIB, gthread-2.0 glib-2.0 >= 2.10 gobject-2.0)
+AC_SUBST(GLIB_CFLAGS)
+AC_SUBST(GLIB_LIBS)
+
+PKG_CHECK_MODULES(GMODULE, gmodule-2.0)
+AC_SUBST(GMODULE_CFLAGS)
+AC_SUBST(GMODULE_LIBS)
+
+PKG_CHECK_EXISTS(gio-2.0,[have_gio=yes],[have_gio=no])
+if test x"$have_gio" = "xno"; then
+	AC_DEFINE([NO_GIO],[1],[Define if you don't have GIO])
+	echo "GIO not found; using private GFileMonitor library"
+else
+	PKG_CHECK_MODULES(GIO, gio-2.0)
+	AC_SUBST(GIO_CFLAGS)
+	AC_SUBST(GIO_LIBS)
+fi
+AM_CONDITIONAL(NO_GIO, test x"$have_gio" == "xno")
+
+PKG_CHECK_MODULES(HAL, hal >= 0.5.0)
+AC_SUBST(HAL_CFLAGS)
+AC_SUBST(HAL_LIBS)
+
+PKG_CHECK_MODULES(LIBNL, libnl-1 >= 1.0-pre8)
+AC_SUBST(LIBNL_CFLAGS)
+AC_SUBST(LIBNL_LIBS)
+
+PKG_CHECK_MODULES(UUID, uuid)
+AC_SUBST(UUID_CFLAGS)
+AC_SUBST(UUID_LIBS)
+
+PKG_CHECK_MODULES(POLKIT, polkit-dbus)
+
+##### Find out the version of PolicyKit we're using
+polkit_version=`pkg-config --modversion polkit`
+POLKIT_VERSION_MAJOR=`echo $polkit_version | awk -F. '{print $1}'`
+POLKIT_VERSION_MINOR=`echo $polkit_version | awk -F. '{print $2}'`
+POLKIT_VERSION_MICRO=`echo $polkit_version | awk -F. '{print $3}'`
+if test "z$POLKIT_VERSION_MAJOR" = "z"; then
+	POLKIT_VERSION_MAJOR="0"
+fi
+if test "z$POLKIT_VERSION_MINOR" = "z"; then
+	POLKIT_VERSION_MINOR="0"
+fi
+if test "z$POLKIT_VERSION_MICRO" = "z"; then
+	POLKIT_VERSION_MICRO="0"
+fi
+
+if test "z$POLKIT_VERSION_MAJOR" = "z0" -a "z$POLKIT_VERSION_MINOR" = "z0" -a "z$POLKIT_VERSION_MICRO" = "z0"; then
+	echo "Error: Couldn't determine the version of your PolicyKit package."
+	echo "  This is probably an error in this script, please report it"
+	echo "  along with the following information:"
+	echo "      Base PolicyKit version ='$polkit_version'"
+	echo "      POLKIT_VERSION_MAJOR='$POLKIT_VERSION_MAJOR'"
+	echo "      POLKIT_VERSION_MINOR='$POLKIT_VERSION_MINOR'"
+	echo "      POLKIT_VERSION_MICRO='$POLKIT_VERSION_MICRO'"
+	exit 1
+else
+	echo "Your PolicyKit version is $POLKIT_VERSION_MAJOR,$POLKIT_VERSION_MINOR,$POLKIT_VERSION_MICRO."
+	POLKIT_CFLAGS="$POLKIT_CFLAGS -DPOLKIT_VERSION_MAJOR=$POLKIT_VERSION_MAJOR"
+	POLKIT_CFLAGS="$POLKIT_CFLAGS -DPOLKIT_VERSION_MINOR=$POLKIT_VERSION_MINOR"
+	POLKIT_CFLAGS="$POLKIT_CFLAGS -DPOLKIT_VERSION_MICRO=$POLKIT_VERSION_MICRO"
+fi
+AC_SUBST(POLKIT_CFLAGS)
+
+AC_PATH_PROG([POLKIT_POLICY_FILE_VALIDATE], [polkit-policy-file-validate], [false])
+
+AC_ARG_WITH(crypto, AC_HELP_STRING([--with-crypto=nss | gnutls], [Cryptography library to use for certificate and key operations]),ac_crypto=$withval, ac_crypto=nss)
+
+with_nss=no
+with_gnutls=no
+if test x"$ac_crypto" = xnss; then
+  PKG_CHECK_MODULES(NSS, [nss >= 3.11])
+  AC_DEFINE(HAVE_NSS, 1, [Define if you have NSS])
+  with_nss=yes
+elif test x"$ac_crypto" = xgnutls; then
+  PKG_CHECK_MODULES(GNUTLS, [gnutls >= 1.2])
+  AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no)
+  if test x"$LIBGCRYPT_CONFIG" = xno; then
+    AC_MSG_ERROR([gnutls explicitly requested but gcrypt not found on system])
+  else
+    AC_DEFINE(HAVE_GNUTLS, 1, [Define if you have libgnutls])
+    LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
+    LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
+    AC_SUBST(LIBGCRYPT_CFLAGS)
+    AC_SUBST(LIBGCRYPT_LIBS)
+    with_gnutls=yes
+  fi
+else
+  AC_MSG_ERROR([Please choose either 'nss' or 'gnutls' for certificate and key operations])
+fi
+AM_CONDITIONAL(WITH_NSS, test x"$with_nss" != xno)
+AM_CONDITIONAL(WITH_GNUTLS, test x"$with_gnutls" != xno)
+
+# Shouldn't ever trigger this, but just in case...
+if test x"$ac_nss" = xno -a x"$ac_gnutls" = xno; then
+  AC_MSG_ERROR([Could not find required development headers and libraries for '$ac_crypto'])
+fi
+
+GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
+AC_SUBST(GLIB_GENMARSHAL)
+
+AC_ARG_WITH(dbus-sys-dir, AS_HELP_STRING([--with-dbus-sys-dir=DIR], [where D-BUS system.d directory is]))
+
+if test -n "$with_dbus_sys_dir" ; then
+    DBUS_SYS_DIR="$with_dbus_sys_dir"
+else
+    DBUS_SYS_DIR="${sysconfdir}/dbus-1/system.d"
+fi
+AC_SUBST(DBUS_SYS_DIR)
+
+# PPPD
+AC_CHECK_HEADERS(pppd/pppd.h,,
+  AC_MSG_ERROR(couldn't find pppd.h. pppd development headers are required.))
+
+AC_ARG_WITH([pppd-plugin-dir], AS_HELP_STRING([--with-pppd-plugin-dir=DIR], [path to the pppd plugins directory]))
+
+if test -n "$with_pppd_plugin_dir" ; then
+	PPPD_PLUGIN_DIR="$with_pppd_plugin_dir"
+else
+	PPPD_PLUGIN_DIR="${libdir}/pppd/2.4.4"
+fi
+AC_SUBST(PPPD_PLUGIN_DIR)
+
+# DHCP client
+AC_ARG_WITH([dhcp-client], AS_HELP_STRING([--with-dhcp-client=dhcpcd|dhclient], [path to the chosen dhcp client]))
+# If a full path is given, use that and do not test if it works or not.
+case "${with_dhcp_client}" in
+	/*)
+		DHCP_CLIENT_PATH="${with_dhcp_client}"
+		AC_MSG_NOTICE(using the DHCP client ${DHCP_CLIENT_PATH})
+		;;
+esac
+if test -z "$DHCP_CLIENT_PATH" -a \( -z "$with_dhcp_client" -o x`basename "$with_dhcp_client"` = "xdhclient" \); then
+	# We only work with ISC dhclient - the FreeBSD and OpenBSD derivatives don't have the same userland.
+	AC_MSG_CHECKING(for dhclient)
+	for client in "$with_dhcp_client" /sbin/dhclient /usr/pkg/sbin/dhclient /usr/local/sbin/dhclient; do
+		test -x "$client" || continue
+		case `"$client" --version 2>&1` in
+			"isc-dhclient-"*) DHCP_CLIENT_PATH="$client"; break;;
+		esac
+	done
+	if test -z "$DHCP_CLIENT_PATH"; then
+		AC_MSG_RESULT(no)
+		if test -n "$with_dhcp_client"; then
+			AC_MSG_ERROR([Could not find ISC dhclient])
+		fi
+	else
+		AC_MSG_RESULT($DHCP_CLIENT_PATH)
+	fi
+fi
+if test -z "$DHCP_CLIENT_PATH" -a \( -z "$with_dhcp_client" -o x`basename "$with_dhcp_client"` = "xdhcpcd" \); then
+	test -n "$DHCP_CLIENT_PATH" && echo bar
+	# We fully work with upstream dhcpcd-4
+	AC_MSG_CHECKING([for dhcpcd])
+	for client in "$with_dhcp_client" /sbin/dhcpcd /usr/pkg/sbin/dhcpcd /usr/local/sbin/dhcpcd; do
+		test -x "$client" || continue
+		case `"$client" --version 2>/dev/null` in
+			"dhcpcd "[123]*);;
+			"dhcpcd "*) DHCP_CLIENT_PATH="$client"; break;;
+		esac
+	done
+	if test -z "$DHCP_CLIENT_PATH"; then
+		AC_MSG_RESULT(no)
+		if test -n "$with_dhcp_client"; then
+			AC_MSG_ERROR([Could not find dhcpcd-4 or newer])
+		fi
+	else
+		AC_MSG_RESULT($DHCP_CLIENT_PATH)
+	fi
+fi
+if test -z "$DHCP_CLIENT_PATH"; then
+	# DHCP clients are not a build time dependency, only runtime.
+	# dhclient has been the longtime default for NM and it's in /sbin
+	# in most distros, so use it.
+	AC_MSG_WARN([Could not find a suitable DHCP client])
+	DHCP_CLIENT_PATH=/sbin/dhclient
+	AC_MSG_WARN([Falling back to ISC dhclient, ${DHCP_CLIENT_PATH}])
+fi
+AC_SUBST(DHCP_CLIENT_PATH)
+DHCP_CLIENT=`basename "$DHCP_CLIENT_PATH"`
+if test "$DHCP_CLIENT" != "dhclient" -a "$DHCP_CLIENT" != "dhcpcd"; then
+	AC_MSG_ERROR([No backend for the DHCP client ${DHCP_CLIENT}])
+fi
+AC_SUBST(DHCP_CLIENT)
+
+# resolvconf support
+AC_ARG_WITH([resolvconf],
+	    AS_HELP_STRING([--with-resolvconf=yes|no|path], [Enable resolvconf support]),
+	    with_resolvconf="$withval",with_resolvconf=no)
+# If a full path is given, use that and do not test if it works or not.
+case "${with_resolvconf}" in
+	/*)
+		RESOLVCONF_PATH="${with_resolvconf}"
+		AC_MSG_NOTICE(setting resolvconf path to ${RESOLVCONF_PATH})
+		;;
+	no)	AC_MSG_NOTICE(resolvconf support disabled)
+		;;
+	*)
+		AC_MSG_CHECKING(for resolvconf)
+		for path in /sbin /usr/sbin /usr/pkg/sbin /usr/local/sbin; do
+			if test -x "${path}/resolvconf"; then
+				RESOLVCONF_PATH="${path}/resolvconf"
+				break
+			fi
+		done
+		if test -n "${RESOLVCONF_PATH}"; then
+			AC_MSG_RESULT($RESOLVCONF_PATH)
+		else
+			AC_MSG_RESULT(no)
+		fi
+		;;
+esac
+AC_SUBST(RESOLVCONF_PATH)
+if test -n "${RESOLVCONF_PATH}"; then
+	AC_DEFINE_UNQUOTED(RESOLVCONF_PATH, "$RESOLVCONF_PATH", [Define if you have a resolvconf implementation])
+fi
+
+# system CA certificates path
+AC_ARG_WITH(system-ca-path, AS_HELP_STRING([--with-system-ca-path=/path/to/ssl/certs], [path to system CA certificates])) 
+if test "x${with_system_ca_path}" = x; then
+  SYSTEM_CA_PATH=/etc/ssl/certs
+else
+  SYSTEM_CA_PATH="$with_system_ca_path"
+fi
+AC_DEFINE_UNQUOTED(SYSTEM_CA_PATH, "$SYSTEM_CA_PATH", [Define to path to system CA certificates])
+AC_SUBST(SYSTEM_CA_PATH)
+
+
+AC_ARG_ENABLE(more-warnings,
+AS_HELP_STRING([--enable-more-warnings], [Maximum compiler warnings]), set_more_warnings="$enableval",set_more_warnings=yes)
+AC_MSG_CHECKING(for more warnings, including -Werror)
+if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
+	AC_MSG_RESULT(yes)
+	CFLAGS="-Wall -Werror -std=gnu89 $CFLAGS"
+
+	for option in -Wshadow -Wmissing-declarations -Wmissing-prototypes \
+		      -Wdeclaration-after-statement -Wstrict-prototypes \
+		      -Wfloat-equal -Wno-unused-parameter -Wno-sign-compare \
+		      -fno-strict-aliasing; do
+		SAVE_CFLAGS="$CFLAGS"
+		CFLAGS="$CFLAGS $option"
+		AC_MSG_CHECKING([whether gcc understands $option])
+		AC_TRY_COMPILE([], [],
+			has_option=yes,
+			has_option=no,)
+		if test $has_option = no; then
+			CFLAGS="$SAVE_CFLAGS"
+		fi
+		AC_MSG_RESULT($has_option)
+		unset has_option
+		unset SAVE_CFLAGS
+	done
+	unset option
+else
+	AC_MSG_RESULT(no)
+fi
+
+# Define _GNU_SOURCE for various things like strcasestr()
+CFLAGS="$CFLAGS -D_GNU_SOURCE"
+
+GTK_DOC_CHECK(1.0)
+
+dnl
+dnl Tests
+dnl
+AC_ARG_WITH(tests, AC_HELP_STRING([--with-tests], [Build NetworkManager tests]))
+AM_CONDITIONAL(WITH_TESTS, test "x$with_tests" = "xyes")
+case $with_tests in
+    yes)
+        with_tests=yes
+        ;;
+    *)
+        with_tests=no
+        ;;
+esac
+
+
+AC_CONFIG_FILES([
+Makefile
+include/Makefile
+src/Makefile
+src/tests/Makefile
+marshallers/Makefile
+src/named-manager/Makefile
+src/vpn-manager/Makefile
+src/dhcp-manager/Makefile
+src/supplicant-manager/Makefile
+src/ppp-manager/Makefile
+src/dnsmasq-manager/Makefile
+src/modem-manager/Makefile
+src/backends/Makefile
+libnm-util/libnm-util.pc
+libnm-util/Makefile
+libnm-util/tests/Makefile
+libnm-util/tests/certs/Makefile
+libnm-glib/libnm_glib.pc
+libnm-glib/libnm_glib_vpn.pc
+libnm-glib/Makefile
+gfilemonitor/Makefile
+callouts/Makefile
+tools/Makefile
+system-settings/Makefile
+system-settings/src/Makefile
+system-settings/plugins/Makefile
+system-settings/plugins/ifupdown/Makefile
+system-settings/plugins/ifcfg-rh/Makefile
+system-settings/plugins/ifcfg-rh/tests/Makefile
+system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile
+system-settings/plugins/ifcfg-suse/Makefile
+system-settings/plugins/keyfile/Makefile
+system-settings/plugins/keyfile/io/Makefile
+system-settings/plugins/keyfile/tests/Makefile
+system-settings/plugins/keyfile/tests/keyfiles/Makefile
+test/Makefile
+initscript/Makefile
+initscript/RedHat/Makefile
+initscript/RedHat/NetworkManager
+initscript/Gentoo/Makefile
+initscript/Gentoo/NetworkManager
+initscript/Debian/Makefile
+initscript/Debian/NetworkManager
+initscript/Slackware/Makefile
+initscript/Slackware/rc.networkmanager
+initscript/SUSE/Makefile
+initscript/SUSE/networkmanager
+initscript/Arch/Makefile
+initscript/Arch/networkmanager
+initscript/paldo/Makefile
+initscript/paldo/NetworkManager
+initscript/Mandriva/Makefile
+initscript/Mandriva/networkmanager
+introspection/Makefile
+man/Makefile
+man/NetworkManager.8
+man/nm-tool.1
+po/Makefile.in
+policy/Makefile
+docs/Makefile
+docs/libnm-glib/Makefile
+docs/libnm-util/Makefile
+NetworkManager.pc
+])
+AC_OUTPUT
+
+echo
+echo Distribution targeting: ${with_distro}
+echo 'if this is not correct, please specifiy your distro with --with-distro=DISTRO'
+
+echo
+echo Building documentation: ${with_docs}
+echo
+echo Building tests: ${with_tests}
+echo
+
diff --git a/configure.in b/configure.in
deleted file mode 100644
index 97ab091..0000000
--- a/configure.in
+++ /dev/null
@@ -1,533 +0,0 @@
-AC_PREREQ(2.52)
-
-AC_INIT(NetworkManager, 0.7.995, dcbw redhat com, NetworkManager)
-AM_INIT_AUTOMAKE([1.9 subdir-objects tar-ustar no-dist-gzip dist-bzip2])
-AM_MAINTAINER_MODE
-
-AC_CONFIG_HEADERS(config.h)
-
-dnl
-dnl Require programs
-dnl
-AC_PROG_CC
-AM_PROG_CC_C_O
-AC_PROG_INSTALL
-AC_PROG_LIBTOOL
-
-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"
-fi
-AC_SUBST([ACLOCAL_AMFLAGS])
-
-dnl maintainer mode stuff
-if test $USE_MAINTAINER_MODE = yes; then
-	DISABLE_DEPRECATED="-DG_DISABLE_DEPRECATED -DGCONF_DISABLE_DEPRECATED"
-else
-	DISABLE_DEPRECATED=""
-fi
-AC_SUBST(DISABLE_DEPRECATED)
-
-dnl
-dnl Required headers
-dnl
-AC_HEADER_STDC
-AC_CHECK_HEADERS(fcntl.h paths.h sys/ioctl.h sys/time.h syslog.h unistd.h)
-
-dnl
-dnl Checks for typedefs, structures, and compiler characteristics.
-dnl
-AC_TYPE_MODE_T
-AC_TYPE_PID_T
-AC_HEADER_TIME
-
-dnl
-dnl Checks for library functions.
-dnl
-AC_PROG_GCC_TRADITIONAL
-AC_FUNC_MEMCMP
-AC_CHECK_FUNCS(select socket uname)
-
-dnl
-dnl translation support
-dnl
-GETTEXT_PACKAGE=NetworkManager
-AC_SUBST(GETTEXT_PACKAGE)
-AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
-IT_PROG_INTLTOOL([0.35.0])
-AM_GLIB_GNU_GETTEXT
-
-dnl
-dnl Documentation
-dnl
-AC_ARG_WITH(docs, AC_HELP_STRING([--with-docs], [Build NetworkManager documentation]))
-AM_CONDITIONAL(WITH_DOCS, test "x$with_docs" = "xyes")
-case $with_docs in
-    yes)
-        enable_gtk_doc=yes
-        ;;
-    *)
-        with_docs=no
-        ;;
-esac
-
-dnl
-dnl Make sha1.c happy on big endian systems
-dnl
-AC_C_BIGENDIAN
-
-AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, suse, gentoo, debian, arch, slackware, paldo or mandriva]))
-if test "z$with_distro" = "z"; then
-	AC_CHECK_FILE(/etc/redhat-release,with_distro="redhat")
-	AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
-	AC_CHECK_FILE(/etc/fedora-release,with_distro="redhat")
-	AC_CHECK_FILE(/etc/gentoo-release,with_distro="gentoo")
-	AC_CHECK_FILE(/etc/debian_version,with_distro="debian")
-	AC_CHECK_FILE(/etc/arch-release,with_distro="arch")
-	AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware")
-	AC_CHECK_FILE(/etc/frugalware-release,with_distro="frugalware")
-	AC_CHECK_FILE(/etc/mandriva-release,with_distro="mandriva")
-	if test "z$with_distro" = "z"; then
-		with_distro=`lsb_release -is`
-	fi
-fi
-with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' `
-
-if test "z$with_distro" = "z"; then
-	echo "Linux distribution autodetection failed, you must specify the distribution to target using --with-distro=DISTRO"
-	exit 1
-else
-	case $with_distro in
-		redhat|suse|gentoo|debian|slackware|arch|paldo|frugalware|mandriva) ;;
-		*)
-			echo "Your distribution (${with_distro}) is not yet supported!  (patches welcome)"
-			exit 1
-			;;
-	esac
-fi
-
-AM_CONDITIONAL(TARGET_REDHAT, test x"$with_distro" = xredhat)
-if test x"$with_distro" = xredhat; then
-  AC_DEFINE(TARGET_REDHAT, 1, [Define if you have Fedora or RHEL])
-fi
-
-AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
-if test x"$with_distro" = xsuse; then
-  AC_DEFINE(TARGET_SUSE, 1, [Define if you have OpenSUSE or SLES])
-fi
-
-AM_CONDITIONAL(TARGET_GENTOO, test x"$with_distro" = xgentoo)
-if test x"$with_distro" = xgentoo; then
-  AC_DEFINE(TARGET_GENTOO, 1, [Define if you have Gentoo])
-fi
-
-AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
-if test x"$with_distro" = xdebian; then
-  AC_DEFINE(TARGET_DEBIAN, 1, [Define if you have Debian])
-fi
-
-AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware)
-if test x"$with_distro" = xslackware; then
-  AC_DEFINE(TARGET_SLACKWARE, 1, [Define if you have Slackware])
-fi
-
-AM_CONDITIONAL(TARGET_ARCH, test x"$with_distro" = xarch)
-if test x"$with_distro" = xarch; then
-  AC_DEFINE(TARGET_ARCH, 1, [Define if you have Arch])
-fi
-
-AM_CONDITIONAL(TARGET_PALDO, test x"$with_distro" = xpaldo)
-if test x"$with_distro" = xpaldo; then
-  AC_DEFINE(TARGET_PALDO, 1, [Define if you have Paldo])
-fi
-
-AM_CONDITIONAL(TARGET_FRUGALWARE, test x"$with_distro" = xfrugalware)
-if test x"$with_distro" = xfrugalware; then
-  AC_DEFINE(TARGET_FRUGALWARE, 1, [Define if you have Frugalware])
-fi
-
-AM_CONDITIONAL(TARGET_MANDRIVA, test x"$with_distro" = xmandriva)
-if test x"$with_distro" = xmandriva; then
-  AC_DEFINE(TARGET_MANDRIVA, 1, [Define if you have Mandriva])
-fi
-
-AC_MSG_CHECKING([Linux Wireless Extensions >= 18])
-AC_TRY_COMPILE([#ifndef __user
-                #define __user
-                #endif
-                #include <sys/types.h>
-                #include <linux/types.h>
-                #include <sys/socket.h>
-                #include <net/if.h>
-                #include <wireless.h>],
-               [#ifndef IWEVGENIE
-                #error "not found"
-                #endif],
-               [ac_have_iwevgenie=yes],
-               [ac_have_iwevgenie=no])
-AC_MSG_RESULT($ac_have_iwevgenie)
-if test "$ac_have_iwevgenie" = no; then
-	AC_MSG_ERROR(wireless-tools library and development headers >= 28pre9 not installed or not functional)
-fi
-
-PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.1 dbus-glib-1 >= 0.75)
-AC_SUBST(DBUS_CFLAGS)
-AC_SUBST(DBUS_LIBS)
-
-PKG_CHECK_MODULES(GLIB, gthread-2.0 glib-2.0 >= 2.10 gobject-2.0)
-AC_SUBST(GLIB_CFLAGS)
-AC_SUBST(GLIB_LIBS)
-
-PKG_CHECK_MODULES(GMODULE, gmodule-2.0)
-AC_SUBST(GMODULE_CFLAGS)
-AC_SUBST(GMODULE_LIBS)
-
-PKG_CHECK_EXISTS(gio-2.0,[have_gio=yes],[have_gio=no])
-if test x"$have_gio" = "xno"; then
-	AC_DEFINE([NO_GIO],[1],[Define if you don't have GIO])
-	echo "GIO not found; using private GFileMonitor library"
-else
-	PKG_CHECK_MODULES(GIO, gio-2.0)
-	AC_SUBST(GIO_CFLAGS)
-	AC_SUBST(GIO_LIBS)
-fi
-AM_CONDITIONAL(NO_GIO, test x"$have_gio" == "xno")
-
-PKG_CHECK_MODULES(HAL, hal >= 0.5.0)
-AC_SUBST(HAL_CFLAGS)
-AC_SUBST(HAL_LIBS)
-
-PKG_CHECK_MODULES(LIBNL, libnl-1 >= 1.0-pre8)
-AC_SUBST(LIBNL_CFLAGS)
-AC_SUBST(LIBNL_LIBS)
-
-PKG_CHECK_MODULES(UUID, uuid)
-AC_SUBST(UUID_CFLAGS)
-AC_SUBST(UUID_LIBS)
-
-PKG_CHECK_MODULES(POLKIT, polkit-dbus)
-
-##### Find out the version of PolicyKit we're using
-polkit_version=`pkg-config --modversion polkit`
-POLKIT_VERSION_MAJOR=`echo $polkit_version | awk -F. '{print $1}'`
-POLKIT_VERSION_MINOR=`echo $polkit_version | awk -F. '{print $2}'`
-POLKIT_VERSION_MICRO=`echo $polkit_version | awk -F. '{print $3}'`
-if test "z$POLKIT_VERSION_MAJOR" = "z"; then
-	POLKIT_VERSION_MAJOR="0"
-fi
-if test "z$POLKIT_VERSION_MINOR" = "z"; then
-	POLKIT_VERSION_MINOR="0"
-fi
-if test "z$POLKIT_VERSION_MICRO" = "z"; then
-	POLKIT_VERSION_MICRO="0"
-fi
-
-if test "z$POLKIT_VERSION_MAJOR" = "z0" -a "z$POLKIT_VERSION_MINOR" = "z0" -a "z$POLKIT_VERSION_MICRO" = "z0"; then
-	echo "Error: Couldn't determine the version of your PolicyKit package."
-	echo "  This is probably an error in this script, please report it"
-	echo "  along with the following information:"
-	echo "      Base PolicyKit version ='$polkit_version'"
-	echo "      POLKIT_VERSION_MAJOR='$POLKIT_VERSION_MAJOR'"
-	echo "      POLKIT_VERSION_MINOR='$POLKIT_VERSION_MINOR'"
-	echo "      POLKIT_VERSION_MICRO='$POLKIT_VERSION_MICRO'"
-	exit 1
-else
-	echo "Your PolicyKit version is $POLKIT_VERSION_MAJOR,$POLKIT_VERSION_MINOR,$POLKIT_VERSION_MICRO."
-	POLKIT_CFLAGS="$POLKIT_CFLAGS -DPOLKIT_VERSION_MAJOR=$POLKIT_VERSION_MAJOR"
-	POLKIT_CFLAGS="$POLKIT_CFLAGS -DPOLKIT_VERSION_MINOR=$POLKIT_VERSION_MINOR"
-	POLKIT_CFLAGS="$POLKIT_CFLAGS -DPOLKIT_VERSION_MICRO=$POLKIT_VERSION_MICRO"
-fi
-AC_SUBST(POLKIT_CFLAGS)
-
-AC_PATH_PROG([POLKIT_POLICY_FILE_VALIDATE], [polkit-policy-file-validate], [false])
-
-AC_ARG_WITH(crypto, AC_HELP_STRING([--with-crypto=nss | gnutls], [Cryptography library to use for certificate and key operations]),ac_crypto=$withval, ac_crypto=nss)
-
-with_nss=no
-with_gnutls=no
-if test x"$ac_crypto" = xnss; then
-  PKG_CHECK_MODULES(NSS, [nss >= 3.11])
-  AC_DEFINE(HAVE_NSS, 1, [Define if you have NSS])
-  with_nss=yes
-elif test x"$ac_crypto" = xgnutls; then
-  PKG_CHECK_MODULES(GNUTLS, [gnutls >= 1.2])
-  AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no)
-  if test x"$LIBGCRYPT_CONFIG" = xno; then
-    AC_MSG_ERROR([gnutls explicitly requested but gcrypt not found on system])
-  else
-    AC_DEFINE(HAVE_GNUTLS, 1, [Define if you have libgnutls])
-    LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
-    LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
-    AC_SUBST(LIBGCRYPT_CFLAGS)
-    AC_SUBST(LIBGCRYPT_LIBS)
-    with_gnutls=yes
-  fi
-else
-  AC_MSG_ERROR([Please choose either 'nss' or 'gnutls' for certificate and key operations])
-fi
-AM_CONDITIONAL(WITH_NSS, test x"$with_nss" != xno)
-AM_CONDITIONAL(WITH_GNUTLS, test x"$with_gnutls" != xno)
-
-# Shouldn't ever trigger this, but just in case...
-if test x"$ac_nss" = xno -a x"$ac_gnutls" = xno; then
-  AC_MSG_ERROR([Could not find required development headers and libraries for '$ac_crypto'])
-fi
-
-GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
-AC_SUBST(GLIB_GENMARSHAL)
-
-AC_ARG_WITH(dbus-sys-dir, AS_HELP_STRING([--with-dbus-sys-dir=DIR], [where D-BUS system.d directory is]))
-
-if test -n "$with_dbus_sys_dir" ; then
-    DBUS_SYS_DIR="$with_dbus_sys_dir"
-else
-    DBUS_SYS_DIR="${sysconfdir}/dbus-1/system.d"
-fi
-AC_SUBST(DBUS_SYS_DIR)
-
-# PPPD
-AC_CHECK_HEADERS(pppd/pppd.h,,
-  AC_MSG_ERROR(couldn't find pppd.h. pppd development headers are required.))
-
-AC_ARG_WITH([pppd-plugin-dir], AS_HELP_STRING([--with-pppd-plugin-dir=DIR], [path to the pppd plugins directory]))
-
-if test -n "$with_pppd_plugin_dir" ; then
-	PPPD_PLUGIN_DIR="$with_pppd_plugin_dir"
-else
-	PPPD_PLUGIN_DIR="${libdir}/pppd/2.4.4"
-fi
-AC_SUBST(PPPD_PLUGIN_DIR)
-
-# DHCP client
-AC_ARG_WITH([dhcp-client], AS_HELP_STRING([--with-dhcp-client=dhcpcd|dhclient], [path to the chosen dhcp client]))
-# If a full path is given, use that and do not test if it works or not.
-case "${with_dhcp_client}" in
-	/*)
-		DHCP_CLIENT_PATH="${with_dhcp_client}"
-		AC_MSG_NOTICE(using the DHCP client ${DHCP_CLIENT_PATH})
-		;;
-esac
-if test -z "$DHCP_CLIENT_PATH" -a \( -z "$with_dhcp_client" -o x`basename "$with_dhcp_client"` = "xdhclient" \); then
-	# We only work with ISC dhclient - the FreeBSD and OpenBSD derivatives don't have the same userland.
-	AC_MSG_CHECKING(for dhclient)
-	for client in "$with_dhcp_client" /sbin/dhclient /usr/pkg/sbin/dhclient /usr/local/sbin/dhclient; do
-		test -x "$client" || continue
-		case `"$client" --version 2>&1` in
-			"isc-dhclient-"*) DHCP_CLIENT_PATH="$client"; break;;
-		esac
-	done
-	if test -z "$DHCP_CLIENT_PATH"; then
-		AC_MSG_RESULT(no)
-		if test -n "$with_dhcp_client"; then
-			AC_MSG_ERROR([Could not find ISC dhclient])
-		fi
-	else
-		AC_MSG_RESULT($DHCP_CLIENT_PATH)
-	fi
-fi
-if test -z "$DHCP_CLIENT_PATH" -a \( -z "$with_dhcp_client" -o x`basename "$with_dhcp_client"` = "xdhcpcd" \); then
-	test -n "$DHCP_CLIENT_PATH" && echo bar
-	# We fully work with upstream dhcpcd-4
-	AC_MSG_CHECKING([for dhcpcd])
-	for client in "$with_dhcp_client" /sbin/dhcpcd /usr/pkg/sbin/dhcpcd /usr/local/sbin/dhcpcd; do
-		test -x "$client" || continue
-		case `"$client" --version 2>/dev/null` in
-			"dhcpcd "[123]*);;
-			"dhcpcd "*) DHCP_CLIENT_PATH="$client"; break;;
-		esac
-	done
-	if test -z "$DHCP_CLIENT_PATH"; then
-		AC_MSG_RESULT(no)
-		if test -n "$with_dhcp_client"; then
-			AC_MSG_ERROR([Could not find dhcpcd-4 or newer])
-		fi
-	else
-		AC_MSG_RESULT($DHCP_CLIENT_PATH)
-	fi
-fi
-if test -z "$DHCP_CLIENT_PATH"; then
-	# DHCP clients are not a build time dependency, only runtime.
-	# dhclient has been the longtime default for NM and it's in /sbin
-	# in most distros, so use it.
-	AC_MSG_WARN([Could not find a suitable DHCP client])
-	DHCP_CLIENT_PATH=/sbin/dhclient
-	AC_MSG_WARN([Falling back to ISC dhclient, ${DHCP_CLIENT_PATH}])
-fi
-AC_SUBST(DHCP_CLIENT_PATH)
-DHCP_CLIENT=`basename "$DHCP_CLIENT_PATH"`
-if test "$DHCP_CLIENT" != "dhclient" -a "$DHCP_CLIENT" != "dhcpcd"; then
-	AC_MSG_ERROR([No backend for the DHCP client ${DHCP_CLIENT}])
-fi
-AC_SUBST(DHCP_CLIENT)
-
-# resolvconf support
-AC_ARG_WITH([resolvconf],
-	    AS_HELP_STRING([--with-resolvconf=yes|no|path], [Enable resolvconf support]),
-	    with_resolvconf="$withval",with_resolvconf=no)
-# If a full path is given, use that and do not test if it works or not.
-case "${with_resolvconf}" in
-	/*)
-		RESOLVCONF_PATH="${with_resolvconf}"
-		AC_MSG_NOTICE(setting resolvconf path to ${RESOLVCONF_PATH})
-		;;
-	no)	AC_MSG_NOTICE(resolvconf support disabled)
-		;;
-	*)
-		AC_MSG_CHECKING(for resolvconf)
-		for path in /sbin /usr/sbin /usr/pkg/sbin /usr/local/sbin; do
-			if test -x "${path}/resolvconf"; then
-				RESOLVCONF_PATH="${path}/resolvconf"
-				break
-			fi
-		done
-		if test -n "${RESOLVCONF_PATH}"; then
-			AC_MSG_RESULT($RESOLVCONF_PATH)
-		else
-			AC_MSG_RESULT(no)
-		fi
-		;;
-esac
-AC_SUBST(RESOLVCONF_PATH)
-if test -n "${RESOLVCONF_PATH}"; then
-	AC_DEFINE_UNQUOTED(RESOLVCONF_PATH, "$RESOLVCONF_PATH", [Define if you have a resolvconf implementation])
-fi
-
-# system CA certificates path
-AC_ARG_WITH(system-ca-path, AS_HELP_STRING([--with-system-ca-path=/path/to/ssl/certs], [path to system CA certificates])) 
-if test "x${with_system_ca_path}" = x; then
-  SYSTEM_CA_PATH=/etc/ssl/certs
-else
-  SYSTEM_CA_PATH="$with_system_ca_path"
-fi
-AC_DEFINE_UNQUOTED(SYSTEM_CA_PATH, "$SYSTEM_CA_PATH", [Define to path to system CA certificates])
-AC_SUBST(SYSTEM_CA_PATH)
-
-
-AC_ARG_ENABLE(more-warnings,
-AS_HELP_STRING([--enable-more-warnings], [Maximum compiler warnings]), set_more_warnings="$enableval",set_more_warnings=yes)
-AC_MSG_CHECKING(for more warnings, including -Werror)
-if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
-	AC_MSG_RESULT(yes)
-	CFLAGS="-Wall -Werror -std=gnu89 $CFLAGS"
-
-	for option in -Wshadow -Wmissing-declarations -Wmissing-prototypes \
-		      -Wdeclaration-after-statement -Wstrict-prototypes \
-		      -Wfloat-equal -Wno-unused-parameter -Wno-sign-compare \
-		      -fno-strict-aliasing; do
-		SAVE_CFLAGS="$CFLAGS"
-		CFLAGS="$CFLAGS $option"
-		AC_MSG_CHECKING([whether gcc understands $option])
-		AC_TRY_COMPILE([], [],
-			has_option=yes,
-			has_option=no,)
-		if test $has_option = no; then
-			CFLAGS="$SAVE_CFLAGS"
-		fi
-		AC_MSG_RESULT($has_option)
-		unset has_option
-		unset SAVE_CFLAGS
-	done
-	unset option
-else
-	AC_MSG_RESULT(no)
-fi
-
-# Define _GNU_SOURCE for various things like strcasestr()
-CFLAGS="$CFLAGS -D_GNU_SOURCE"
-
-GTK_DOC_CHECK(1.0)
-
-dnl
-dnl Tests
-dnl
-AC_ARG_WITH(tests, AC_HELP_STRING([--with-tests], [Build NetworkManager tests]))
-AM_CONDITIONAL(WITH_TESTS, test "x$with_tests" = "xyes")
-case $with_tests in
-    yes)
-        with_tests=yes
-        ;;
-    *)
-        with_tests=no
-        ;;
-esac
-
-
-AC_CONFIG_FILES([
-Makefile
-include/Makefile
-src/Makefile
-src/tests/Makefile
-marshallers/Makefile
-src/named-manager/Makefile
-src/vpn-manager/Makefile
-src/dhcp-manager/Makefile
-src/supplicant-manager/Makefile
-src/ppp-manager/Makefile
-src/dnsmasq-manager/Makefile
-src/modem-manager/Makefile
-src/backends/Makefile
-libnm-util/libnm-util.pc
-libnm-util/Makefile
-libnm-util/tests/Makefile
-libnm-util/tests/certs/Makefile
-libnm-glib/libnm_glib.pc
-libnm-glib/libnm_glib_vpn.pc
-libnm-glib/Makefile
-gfilemonitor/Makefile
-callouts/Makefile
-tools/Makefile
-system-settings/Makefile
-system-settings/src/Makefile
-system-settings/plugins/Makefile
-system-settings/plugins/ifupdown/Makefile
-system-settings/plugins/ifcfg-rh/Makefile
-system-settings/plugins/ifcfg-rh/tests/Makefile
-system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile
-system-settings/plugins/ifcfg-suse/Makefile
-system-settings/plugins/keyfile/Makefile
-system-settings/plugins/keyfile/io/Makefile
-system-settings/plugins/keyfile/tests/Makefile
-system-settings/plugins/keyfile/tests/keyfiles/Makefile
-test/Makefile
-initscript/Makefile
-initscript/RedHat/Makefile
-initscript/RedHat/NetworkManager
-initscript/Gentoo/Makefile
-initscript/Gentoo/NetworkManager
-initscript/Debian/Makefile
-initscript/Debian/NetworkManager
-initscript/Slackware/Makefile
-initscript/Slackware/rc.networkmanager
-initscript/SUSE/Makefile
-initscript/SUSE/networkmanager
-initscript/Arch/Makefile
-initscript/Arch/networkmanager
-initscript/paldo/Makefile
-initscript/paldo/NetworkManager
-initscript/Mandriva/Makefile
-initscript/Mandriva/networkmanager
-introspection/Makefile
-man/Makefile
-man/NetworkManager.8
-man/nm-tool.1
-po/Makefile.in
-policy/Makefile
-docs/Makefile
-docs/libnm-glib/Makefile
-docs/libnm-util/Makefile
-NetworkManager.pc
-])
-AC_OUTPUT
-
-echo
-echo Distribution targeting: ${with_distro}
-echo 'if this is not correct, please specifiy your distro with --with-distro=DISTRO'
-
-echo
-echo Building documentation: ${with_docs}
-echo
-echo Building tests: ${with_tests}
-echo
-
-- 
1.6.2.4

From 0ef0e233b5f305e7f0209a5b2d2329c6ea9dbd36 Mon Sep 17 00:00:00 2001
From: Michael Biebl <biebl debian org>
Date: Tue, 21 Apr 2009 00:49:33 +0200
Subject: [PATCH 3/9] Replace obsolete AC_HELP_STRING with AS_HELP_STRING

---
 configure.ac |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 97ab091..48c931a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -62,7 +62,7 @@ AM_GLIB_GNU_GETTEXT
 dnl
 dnl Documentation
 dnl
-AC_ARG_WITH(docs, AC_HELP_STRING([--with-docs], [Build NetworkManager documentation]))
+AC_ARG_WITH(docs, AS_HELP_STRING([--with-docs], [Build NetworkManager documentation]))
 AM_CONDITIONAL(WITH_DOCS, test "x$with_docs" = "xyes")
 case $with_docs in
     yes)
@@ -243,7 +243,7 @@ AC_SUBST(POLKIT_CFLAGS)
 
 AC_PATH_PROG([POLKIT_POLICY_FILE_VALIDATE], [polkit-policy-file-validate], [false])
 
-AC_ARG_WITH(crypto, AC_HELP_STRING([--with-crypto=nss | gnutls], [Cryptography library to use for certificate and key operations]),ac_crypto=$withval, ac_crypto=nss)
+AC_ARG_WITH(crypto, AS_HELP_STRING([--with-crypto=nss | gnutls], [Cryptography library to use for certificate and key operations]),ac_crypto=$withval, ac_crypto=nss)
 
 with_nss=no
 with_gnutls=no
@@ -442,7 +442,7 @@ GTK_DOC_CHECK(1.0)
 dnl
 dnl Tests
 dnl
-AC_ARG_WITH(tests, AC_HELP_STRING([--with-tests], [Build NetworkManager tests]))
+AC_ARG_WITH(tests, AS_HELP_STRING([--with-tests], [Build NetworkManager tests]))
 AM_CONDITIONAL(WITH_TESTS, test "x$with_tests" = "xyes")
 case $with_tests in
     yes)
-- 
1.6.2.4

From cd14bf1d548069b6092033f34aecc11ecdc6df35 Mon Sep 17 00:00:00 2001
From: Michael Biebl <biebl debian org>
Date: Tue, 21 Apr 2009 01:17:07 +0200
Subject: [PATCH 4/9] Update autogen.sh for configure.ac

---
 autogen.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/autogen.sh b/autogen.sh
index f9e56ee..7454373 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -6,7 +6,7 @@ test -z "$srcdir" && srcdir=.
 REQUIRED_AUTOMAKE_VERSION=1.9
 PKG_NAME=NetworkManager
 
-(test -f $srcdir/configure.in \
+(test -f $srcdir/configure.ac \
   && test -f $srcdir/src/NetworkManager.c) || {
     echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
     echo " top-level $PKG_NAME directory"
-- 
1.6.2.4

From d58d71afa676847ea0e2a58a048119633ab56509 Mon Sep 17 00:00:00 2001
From: Michael Biebl <biebl debian org>
Date: Wed, 22 Apr 2009 01:45:30 +0200
Subject: [PATCH 5/9] Use m4/ macro directory

Keep the relevant m4 macros in-tree.
---
 Makefile.am  |    1 +
 configure.ac |    4 +++-
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 2509206..a61200f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -34,3 +34,4 @@ DISTCLEANFILES = intltool-extract intltool-merge intltool-update
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = NetworkManager.pc
 
+ACLOCAL_AMFLAGS = -I m4
diff --git a/configure.ac b/configure.ac
index 48c931a..c47a7bc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,7 +4,9 @@ AC_INIT(NetworkManager, 0.7.995, dcbw redhat com, NetworkManager)
 AM_INIT_AUTOMAKE([1.9 subdir-objects tar-ustar no-dist-gzip dist-bzip2])
 AM_MAINTAINER_MODE
 
-AC_CONFIG_HEADERS(config.h)
+AC_CONFIG_MACRO_DIR([m4])
+
+AC_CONFIG_HEADERS([config.h])
 
 dnl
 dnl Require programs
-- 
1.6.2.4

From 7166d2540eeb1372700693aaf6224e80ffce87da Mon Sep 17 00:00:00 2001
From: Michael Biebl <biebl debian org>
Date: Wed, 22 Apr 2009 01:55:31 +0200
Subject: [PATCH 6/9] Use AC_GNU_SOURCE

Use AC_GNU_SOURCE macro instead of setting -D_GNU_SOURCE manually.
The macro will add the _GNU_SOURCE define to config.h for systems that
have the GNU extensions.
---
 configure.ac |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index c47a7bc..07daaeb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8,6 +8,9 @@ AC_CONFIG_MACRO_DIR([m4])
 
 AC_CONFIG_HEADERS([config.h])
 
+dnl Define _GNU_SOURCE for various things like strcasestr()
+AC_GNU_SOURCE
+
 dnl
 dnl Require programs
 dnl
@@ -436,9 +439,6 @@ else
 	AC_MSG_RESULT(no)
 fi
 
-# Define _GNU_SOURCE for various things like strcasestr()
-CFLAGS="$CFLAGS -D_GNU_SOURCE"
-
 GTK_DOC_CHECK(1.0)
 
 dnl
-- 
1.6.2.4

From a4d028b3d9d688144e74a9e4b9869310ff1dc868 Mon Sep 17 00:00:00 2001
From: Michael Biebl <biebl debian org>
Date: Wed, 22 Apr 2009 02:50:45 +0200
Subject: [PATCH 7/9] Split compiler warnings into separate m4 macro file

The m4 macro is called NM_COMPILER_WARNINGS. Being in a separate file
makes it easier reusable for the other NM projects.
---
 configure.ac            |   30 +-----------------------------
 m4/compiler_warnings.m4 |   31 +++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 29 deletions(-)
 create mode 100644 m4/compiler_warnings.m4

diff --git a/configure.ac b/configure.ac
index 07daaeb..e5270c9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -409,35 +409,7 @@ fi
 AC_DEFINE_UNQUOTED(SYSTEM_CA_PATH, "$SYSTEM_CA_PATH", [Define to path to system CA certificates])
 AC_SUBST(SYSTEM_CA_PATH)
 
-
-AC_ARG_ENABLE(more-warnings,
-AS_HELP_STRING([--enable-more-warnings], [Maximum compiler warnings]), set_more_warnings="$enableval",set_more_warnings=yes)
-AC_MSG_CHECKING(for more warnings, including -Werror)
-if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
-	AC_MSG_RESULT(yes)
-	CFLAGS="-Wall -Werror -std=gnu89 $CFLAGS"
-
-	for option in -Wshadow -Wmissing-declarations -Wmissing-prototypes \
-		      -Wdeclaration-after-statement -Wstrict-prototypes \
-		      -Wfloat-equal -Wno-unused-parameter -Wno-sign-compare \
-		      -fno-strict-aliasing; do
-		SAVE_CFLAGS="$CFLAGS"
-		CFLAGS="$CFLAGS $option"
-		AC_MSG_CHECKING([whether gcc understands $option])
-		AC_TRY_COMPILE([], [],
-			has_option=yes,
-			has_option=no,)
-		if test $has_option = no; then
-			CFLAGS="$SAVE_CFLAGS"
-		fi
-		AC_MSG_RESULT($has_option)
-		unset has_option
-		unset SAVE_CFLAGS
-	done
-	unset option
-else
-	AC_MSG_RESULT(no)
-fi
+NM_COMPILER_WARNINGS
 
 GTK_DOC_CHECK(1.0)
 
diff --git a/m4/compiler_warnings.m4 b/m4/compiler_warnings.m4
new file mode 100644
index 0000000..6cea2f7
--- /dev/null
+++ b/m4/compiler_warnings.m4
@@ -0,0 +1,31 @@
+AC_DEFUN([NM_COMPILER_WARNINGS],
+[AC_ARG_ENABLE(more-warnings,
+	AS_HELP_STRING([--enable-more-warnings], [Maximum compiler warnings]),
+	set_more_warnings="$enableval",set_more_warnings=yes)
+AC_MSG_CHECKING(for more warnings, including -Werror)
+if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
+	AC_MSG_RESULT(yes)
+	CFLAGS="-Wall -Werror -std=gnu89 $CFLAGS"
+
+	for option in -Wshadow -Wmissing-declarations -Wmissing-prototypes \
+		      -Wdeclaration-after-statement -Wstrict-prototypes \
+		      -Wfloat-equal -Wno-unused-parameter -Wno-sign-compare \
+		      -fno-strict-aliasing; do
+		SAVE_CFLAGS="$CFLAGS"
+		CFLAGS="$CFLAGS $option"
+		AC_MSG_CHECKING([whether gcc understands $option])
+		AC_TRY_COMPILE([], [],
+			has_option=yes,
+			has_option=no,)
+		if test $has_option = no; then
+			CFLAGS="$SAVE_CFLAGS"
+		fi
+		AC_MSG_RESULT($has_option)
+		unset has_option
+		unset SAVE_CFLAGS
+	done
+	unset option
+else
+	AC_MSG_RESULT(no)
+fi
+])
-- 
1.6.2.4

From 3dd164cc9579c105cd0ccbd7027cec2242cf66f1 Mon Sep 17 00:00:00 2001
From: Michael Biebl <biebl debian org>
Date: Thu, 23 Apr 2009 17:25:55 +0200
Subject: [PATCH 8/9] Remove NULL in Makefile.am

Be consistent and don't use NULL, it's not defined anyway.
---
 system-settings/plugins/ifupdown/Makefile.am |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/system-settings/plugins/ifupdown/Makefile.am b/system-settings/plugins/ifupdown/Makefile.am
index c6948ad..0c7ab24 100644
--- a/system-settings/plugins/ifupdown/Makefile.am
+++ b/system-settings/plugins/ifupdown/Makefile.am
@@ -1,7 +1,6 @@
 
 INCLUDES = \
-	-I${top_srcdir}/src \
-	$(NULL)
+	-I${top_srcdir}/src
 
 pkglib_LTLIBRARIES = libnm-settings-plugin-ifupdown.la
 
@@ -9,8 +8,7 @@ libnm_settings_plugin_ifupdown_la_SOURCES = \
 	interface_parser.c interface_parser.h \
 	nm-ifupdown-connection.c nm-ifupdown-connection.h \
 	parser.c parser.h \
-	plugin.c plugin.h \
-	$(NULL)
+	plugin.c plugin.h
 
 libnm_settings_plugin_ifupdown_la_CPPFLAGS = \
 	$(GLIB_CFLAGS) \
-- 
1.6.2.4

From 72425db2f3f54f857b5721ab11d5c50d00851b2e Mon Sep 17 00:00:00 2001
From: Michael Biebl <biebl debian org>
Date: Thu, 23 Apr 2009 18:19:36 +0200
Subject: [PATCH 9/9] Update gitignore file

Ignore the m4 macros that are automatically copied to m4/.
---
 .gitignore |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore
index 968228f..0a25429 100644
--- a/.gitignore
+++ b/.gitignore
@@ -65,3 +65,8 @@ libnm-util/tests/test-crypto
 libnm-util/tests/test-settings-defaults
 src/tests/test-dhcp-options
 system-settings/plugins/keyfile/tests/test-keyfile
+
+m4/gtk-doc.m4
+m4/intltool.m4
+m4/libtool.m4
+m4/lt*.m4
-- 
1.6.2.4

Attachment: signature.asc
Description: OpenPGP digital signature



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