From: Bryan Kadzban <bryan@kadzban.is-a-geek.net>
To: linux-hotplug@vger.kernel.org
Subject: [PATCH] Allow configuring without systemd-only dependencies
Date: Fri, 08 Jun 2012 06:35:00 +0000 [thread overview]
Message-ID: <4FD19D14.2070109@kadzban.is-a-geek.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 940 bytes --]
Some dependencies (intltool, m4, dbus, pkg-config, PAM) are only
required or useful for systemd, not for udev. Leave these required by
default, but allow them to be made optional if the right flag is used to
./configure.
Signed-Off-By: Bryan Kadzban <bryan@kadzban.is-a-geek.net>
-----
This is necessary for anyone who wants to build udev only. It's not
sufficient, but without this or something like it, ./configure fails
hard. This change touches *only* configure; if the dependencies are
made optional in a ./configure run, and they don't exist on the system
(or in some cases, even if they do) make will fail hard.
I'm not attached to the --with-X flag's name; coming up with a better
one would be fine.
Unfortunately there's no "use intltool if it's present, otherwise don't
bother" variant of IT_PROG_INTLTOOL. If that's wanted, I could hack it
together with another invocation of AC_PATH_PROG, but this is slightly
simpler.
[-- Attachment #2: systemd-make-systemd-dependencies-optional.patch --]
[-- Type: text/plain, Size: 4453 bytes --]
diff --git a/configure.ac b/configure.ac
index 70f3e96..446fb95 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,8 +44,15 @@ AS_IF([test "x$host_cpu" = "xmips" || test "x$host_cpu" = "xmipsel" ||
LT_PREREQ(2.2)
LT_INIT
+AC_ARG_WITH([require-systemd-deps],
+ [AS_HELP_STRING([--without-require-systemd-deps],
+ [make systemd configure dependencies optional @<:@default: required@:>@])],
+ [with_require_systemd_deps=$withval], [with_require_systemd_deps=yes])
+
# i18n stuff for the PolicyKit policy files
+AS_IF([test "x$with_require_systemd_deps" = "xyes"], [
IT_PROG_INTLTOOL([0.40.0])
+])
GETTEXT_PACKAGE=systemd
AC_SUBST(GETTEXT_PACKAGE)
@@ -61,7 +68,9 @@ AC_PROG_CC_C99
AM_PROG_CC_C_O
AC_PROG_GCC_TRADITIONAL
+AS_IF([test "x$with_require_systemd_deps" = "xyes"], [
AC_PATH_PROG([M4], [m4])
+])
# gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line
m4_ifdef([GTK_DOC_CHECK], [
@@ -75,7 +84,7 @@ GOBJECT_INTROSPECTION_CHECK([1.31.1])
AC_CHECK_TOOL(OBJCOPY, objcopy)
AC_CHECK_TOOL(STRINGS, strings)
AC_CHECK_TOOL(GPERF, gperf)
-if test -z "$GPERF" ; then
+if test -z "$GPERF" && test "x$with_require_systemd_deps" = "xyes" ; then
AC_MSG_ERROR([*** gperf not found])
fi
@@ -132,6 +141,7 @@ AC_SUBST([GCLDFLAGS], $with_ldflags)
AC_SEARCH_LIBS([clock_gettime], [rt], [], [AC_MSG_ERROR([*** POSIX RT library not found])])
AC_SEARCH_LIBS([dlsym], [dl], [], [AC_MSG_ERROR([*** Dynamic linking loader library not found])])
+AS_IF([test "x$with_require_systemd_deps" = "xyes"], [
save_LIBS="$LIBS"
LIBS=
AC_SEARCH_LIBS([cap_init], [cap], [], [AC_MSG_ERROR([*** POSIX caps library not found])])
@@ -139,11 +149,14 @@ AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers n
CAP_LIBS="$LIBS"
LIBS="$save_LIBS"
AC_SUBST(CAP_LIBS)
+])
# This makes sure pkg.m4 is available.
m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
+AS_IF([test "x$with_require_systemd_deps" = "xyes"], [
PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.3.2])
+])
PKG_CHECK_MODULES(KMOD, [libkmod >= 5])
PKG_CHECK_MODULES(BLKID,[blkid >= 2.20])
@@ -648,22 +661,22 @@ AM_CONDITIONAL(HAVE_SYSV_COMPAT, test "$SYSTEM_SYSV_COMPAT" = "yes")
AC_ARG_WITH([dbuspolicydir],
AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
[],
- [with_dbuspolicydir=`pkg-config --variable=sysconfdir dbus-1`/dbus-1/system.d])
+ [AS_IF([test "x$with_require_systemd_deps" = "xyes"], [with_dbuspolicydir=`pkg-config --variable=sysconfdir dbus-1`/dbus-1/system.d])])
AC_ARG_WITH([dbussessionservicedir],
AS_HELP_STRING([--with-dbussessionservicedir=DIR], [D-Bus session service directory]),
[],
- [with_dbussessionservicedir=`pkg-config --variable=session_bus_services_dir dbus-1`])
+ [AS_IF([test "x$with_require_systemd_deps" = "xyes"], [with_dbussessionservicedir=`pkg-config --variable=session_bus_services_dir dbus-1`])])
AC_ARG_WITH([dbussystemservicedir],
AS_HELP_STRING([--with-dbussystemservicedir=DIR], [D-Bus system service directory]),
[],
- [with_dbussystemservicedir=`pkg-config --variable=session_bus_services_dir dbus-1`/../system-services])
+ [AS_IF([test "x$with_require_systemd_deps" = "xyes"], [with_dbussystemservicedir=`pkg-config --variable=session_bus_services_dir dbus-1`/../system-services])])
AC_ARG_WITH([dbusinterfacedir],
AS_HELP_STRING([--with-dbusinterfacedir=DIR], [D-Bus interface directory]),
[],
- [with_dbusinterfacedir=`pkg-config --variable=session_bus_services_dir dbus-1`/../interfaces])
+ [AS_IF([test "x$with_require_systemd_deps" = "xyes"], [with_dbusinterfacedir=`pkg-config --variable=session_bus_services_dir dbus-1`/../interfaces])])
AC_ARG_WITH([rootprefix],
AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
@@ -677,7 +690,7 @@ AC_ARG_WITH([rootlibdir],
AC_ARG_WITH([pamlibdir],
AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]),
[],
- [with_pamlibdir=${with_rootlibdir}/security])
+ [AS_IF([test "x$with_require_systemd_deps" = "xyes"], [with_pamlibdir=${with_rootlibdir}/security])])
AC_ARG_ENABLE([split-usr],
AS_HELP_STRING([--enable-split-usr], [Assume that /bin, /sbin aren\'t symlinks into /usr]),
next reply other threads:[~2012-06-08 6:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-08 6:35 Bryan Kadzban [this message]
2012-06-08 16:15 ` [PATCH] Allow configuring without systemd-only dependencies William Hubbs
2012-06-09 7:01 ` Bryan Kadzban
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FD19D14.2070109@kadzban.is-a-geek.net \
--to=bryan@kadzban.is-a-geek.net \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).