summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2014-08-26 19:11:22 +0200
committerThomas Haller <thaller@redhat.com>2014-08-26 19:37:51 +0200
commite1de236db1de03fbd1384040dfe0ecb0223fc2f0 (patch)
tree9eff4f27ff20bbff5f8ac29ffd81c42d4dafe125
parentfb7b08388e9de5440962337e20a823bbf9d019ae (diff)
downloadNetworkManager-e1de236db1de03fbd1384040dfe0ecb0223fc2f0.tar.gz
build: add configure option not to install udev rules
Previously, user could only change the udev base directory, but not disabling installation entirely. Support this now with: ./configure --with-udev-dir=no or ./configure --without-udev-dir Also, just passing '--with-udev-dir' equals '--with-udev-dir=yes'. Treat 'yes' equal to the default '/lib/udev'. Also, check that the path is an absolute path starting with a '/'. Signed-off-by: Thomas Haller <thaller@redhat.com>
-rw-r--r--callouts/Makefile.am4
-rw-r--r--configure.ac18
2 files changed, 14 insertions, 8 deletions
diff --git a/callouts/Makefile.am b/callouts/Makefile.am
index 1e7001c34e..1d1eb3c764 100644
--- a/callouts/Makefile.am
+++ b/callouts/Makefile.am
@@ -69,8 +69,10 @@ libtest_dispatcher_envp_la_LIBADD = \
$(DBUS_LIBS)
-udevrulesdir = $(UDEV_BASE_DIR)/rules.d
+if WITH_UDEV_DIR
+udevrulesdir = $(UDEV_DIR)/rules.d
udevrules_DATA = 77-nm-olpc-mesh.rules
+endif
dbusactivationdir = $(datadir)/dbus-1/system-services
dbusactivation_in_files = org.freedesktop.nm_dispatcher.service.in
diff --git a/configure.ac b/configure.ac
index a082c8e20c..d6ffd106c4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -284,14 +284,18 @@ if (test "${enable_qt}" = "yes"); then
fi
AM_CONDITIONAL(WITH_QT, test "${enable_qt}" = "yes")
-
-AC_ARG_WITH(udev-dir, AS_HELP_STRING([--with-udev-dir=DIR], [where the udev base directory is]))
-if test -n "$with_udev_dir" ; then
- UDEV_BASE_DIR="$with_udev_dir"
-else
- UDEV_BASE_DIR="/lib/udev"
+AC_ARG_WITH(udev-dir, AS_HELP_STRING([--with-udev-dir=DIR], [Absolute path of the udev base directory. Set to 'no' not to install the udev rules]), [], [with_udev_dir="yes"])
+if (test "$with_udev_dir" != 'no'); then
+ if (test "$with_udev_dir" != 'yes' && echo -n "$with_udev_dir" | grep -v -q '^/'); then
+ AC_MSG_ERROR([--with-udev-dir must be an absolute path or 'yes' or 'no'. Instead it is '$with_udev_dir'])
+ fi
+ if (test "$with_udev_dir" = 'yes'); then
+ with_udev_dir="/lib/udev"
+ fi
+ UDEV_DIR="$with_udev_dir"
+ AC_SUBST(UDEV_DIR)
fi
-AC_SUBST(UDEV_BASE_DIR)
+AM_CONDITIONAL(WITH_UDEV_DIR, test "$with_udev_dir" != 'no')
# systemd unit support
AC_ARG_WITH([systemdsystemunitdir], AS_HELP_STRING([--with-systemdsystemunitdir=DIR],