chiark / gitweb /
systemctl: enable chkconfig compat only if chkconfig is found rather than based on...
[elogind.git] / configure.ac
index d0ce504bc5f7f05aec9f2318bcfd076bf5e2ce2d..a39dd6a33c79e4a1f1fca7da0640007212f7b84f 100644 (file)
@@ -20,7 +20,7 @@
 AC_PREREQ([2.64])
 
 AC_INIT([systemd],
-        [195],
+        [196],
         [http://bugs.freedesktop.org/enter_bug.cgi?product=systemd],
         [systemd],
         [http://www.freedesktop.org/wiki/Software/systemd])
@@ -100,21 +100,20 @@ AC_ARG_WITH([python],
 
 AS_IF([test "x$with_python" != "xno"], [
         AM_PATH_PYTHON(,, [:])
-        if test "$PYTHON" != : ; then
-                have_python=yes
-                AC_PATH_PROG([PYTHON_CONFIG], python-config)
-
-                if test -n "$PYTHON_CONFIG" ; then
-                        have_python_devel=yes
-                        PYTHON_CFLAGS="`$PYTHON_CONFIG --cflags`"
-                        PYTHON_LIBS="`$PYTHON_CONFIG --libs`"
-                        AC_SUBST(PYTHON_CFLAGS)
-                        AC_SUBST(PYTHON_LIBS)
-                fi
-        fi
+        AS_IF([test "$PYTHON" != :], [have_python=yes])
 ])
-
 AM_CONDITIONAL([HAVE_PYTHON], [test "$have_python" = "yes"])
+
+AS_IF([test "x$with_python" != "xno"], [
+        AC_PATH_PROG(PYTHON_CONFIG, python${PYTHON_VERSION}-config)
+        AS_IF([test -n "$PYTHON_CONFIG"], [
+              have_python_devel=yes
+              PYTHON_CFLAGS="`$PYTHON_CONFIG --cflags`"
+              PYTHON_LIBS="`$PYTHON_CONFIG --ldflags`"
+              AC_SUBST(PYTHON_CFLAGS)
+              AC_SUBST(PYTHON_LIBS)
+        ])
+])
 AM_CONDITIONAL([HAVE_PYTHON_DEVEL], [test "$have_python_devel" = "yes"])
 
 CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
@@ -172,7 +171,7 @@ CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
         -Wl,-z,now])
 AC_SUBST([OUR_LDFLAGS], $with_ldflags)
 
-AC_SEARCH_LIBS([clock_gettime], [rt], [], [AC_MSG_ERROR([*** POSIX RT library not found])])
+AC_SEARCH_LIBS([mq_open], [rt], [], [AC_MSG_ERROR([*** POSIX RT library not found])])
 AC_SEARCH_LIBS([dlsym], [dl], [], [AC_MSG_ERROR([*** Dynamic linking loader library not found])])
 
 save_LIBS="$LIBS"
@@ -194,8 +193,30 @@ AC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at], [], [], [[#include <sys/
 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
 
 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.3.2])
-PKG_CHECK_MODULES(KMOD, [libkmod >= 5])
-PKG_CHECK_MODULES(BLKID,[blkid >= 2.20])
+
+# ------------------------------------------------------------------------------
+have_kmod=no
+AC_ARG_ENABLE(kmod, AS_HELP_STRING([--disable-kmod], [disable loadable modules support]))
+if test "x$enable_kmod" != "xno"; then
+        PKG_CHECK_MODULES(KMOD, [ libkmod >= 5 ],
+                [AC_DEFINE(HAVE_KMOD, 1, [Define if kmod is available]) have_kmod=yes], have_kmod=no)
+        if test "x$have_kmod" = xno -a "x$enable_kmod" = xyes; then
+                AC_MSG_ERROR([*** kmod support requested but libraries not found])
+        fi
+fi
+AM_CONDITIONAL(HAVE_KMOD, [test "$have_kmod" = "yes"])
+
+# ------------------------------------------------------------------------------
+have_blkid=no
+AC_ARG_ENABLE(blkid, AS_HELP_STRING([--disable-blkid], [disable blkid support]))
+if test "x$enable_blkid" != "xno"; then
+        PKG_CHECK_MODULES(BLKID, [ blkid >= 2.20 ],
+                [AC_DEFINE(HAVE_BLKID, 1, [Define if blkid is available]) have_blkid=yes], have_blkid=no)
+        if test "x$have_blkid" = xno -a "x$enable_blkid" = xyes; then
+                AC_MSG_ERROR([*** blkid support requested but libraries not found])
+        fi
+fi
+AM_CONDITIONAL(HAVE_BLKID, [test "$have_blkid" = "yes"])
 
 # ------------------------------------------------------------------------------
 have_ima=yes
@@ -211,6 +232,25 @@ if test "x${have_ima}" != xno ; then
         AC_DEFINE(HAVE_IMA, 1, [Define if IMA is available])
 fi
 
+# ------------------------------------------------------------------------------
+have_chkconfig=yes
+AC_ARG_ENABLE([chkconfig], AS_HELP_STRING([--disable-chkconfig],[Disable optional chkconfig support]),
+                [case "${enableval}" in
+                        yes) have_chkconfig=yes ;;
+                        no) have_chkconfig=no ;;
+                        *) AC_MSG_ERROR(bad value ${enableval} for --disable-chkconfig) ;;
+                esac],
+                [AC_PATH_PROG(CHKCONFIG, chkconfig)
+                if test -z "$CHKCONFIG"; then
+                        have_chkconfig=no
+                else
+                        have_chkconfig=yes
+                fi])
+
+if test "x${have_chkconfig}" != xno ; then
+        AC_DEFINE(HAVE_CHKCONFIG, 1, [Define if CHKCONFIG is available])
+fi
+
 # ------------------------------------------------------------------------------
 have_selinux=no
 AC_ARG_ENABLE(selinux, AS_HELP_STRING([--disable-selinux], [Disable optional SELINUX support]))
@@ -567,6 +607,25 @@ if test "x$enable_coredump" != "xno"; then
 fi
 AM_CONDITIONAL(ENABLE_COREDUMP, [test "$have_coredump" = "yes"])
 
+# ------------------------------------------------------------------------------
+AC_ARG_WITH(rc-local-script-path-start,
+        AS_HELP_STRING([--with-rc-local-script-path-start=PATH],
+                [Path to /etc/rc.local]),
+        [RC_LOCAL_SCRIPT_PATH_START="$withval"],
+        [RC_LOCAL_SCRIPT_PATH_START="/etc/rc.local"])
+
+AC_ARG_WITH(rc-local-script-path-stop,
+        AS_HELP_STRING([--with-rc-local-script-path-stop=PATH],
+                [Path to /sbin/halt.local]),
+        [RC_LOCAL_SCRIPT_PATH_STOP="$withval"],
+        [RC_LOCAL_SCRIPT_PATH_STOP="/sbin/halt.local"])
+
+AC_DEFINE_UNQUOTED(RC_LOCAL_SCRIPT_PATH_START, ["$RC_LOCAL_SCRIPT_PATH_START"], [Path of /etc/rc.local script])
+AC_DEFINE_UNQUOTED(RC_LOCAL_SCRIPT_PATH_STOP, ["$RC_LOCAL_SCRIPT_PATH_STOP"], [Path of /sbin/halt.local script])
+
+AC_SUBST(RC_LOCAL_SCRIPT_PATH_START)
+AC_SUBST(RC_LOCAL_SCRIPT_PATH_STOP)
+
 # ------------------------------------------------------------------------------
 AC_ARG_WITH(firmware-path,
        AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
@@ -619,7 +678,7 @@ AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
 
 # ------------------------------------------------------------------------------
 
-AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO],[Specify the distribution to target: One of fedora, suse, debian, ubuntu, arch, gentoo, slackware, altlinux, mandriva, mageia, angstrom or other]))
+AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO],[Specify the distribution to target: One of fedora, suse, debian, arch, gentoo, slackware, altlinux, mandriva, mageia, angstrom or other]))
 if test "z$with_distro" = "z"; then
         if test "$cross_compiling" = yes; then
                 AC_MSG_WARN([Target distribution cannot be reliably detected when cross-compiling. You should specify it with --with-distro (see $0 --help for recognized distros)])
@@ -655,11 +714,6 @@ case $with_distro in
                 AC_DEFINE(TARGET_DEBIAN, [], [Target is Debian])
                 M4_DEFINES=-DTARGET_DEBIAN=1
                 ;;
-        ubuntu)
-                SYSTEM_SYSVRCND_PATH=/etc
-                AC_DEFINE(TARGET_UBUNTU, [], [Target is Ubuntu])
-                M4_DEFINES=-DTARGET_UBUNTU=1
-                ;;
         arch)
                 SYSTEM_SYSVINIT_PATH=
                 SYSTEM_SYSVRCND_PATH=
@@ -744,8 +798,6 @@ AC_ARG_WITH([tty-gid],
 AM_CONDITIONAL(TARGET_FEDORA, test x"$with_distro" = xfedora)
 AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
 AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
-AM_CONDITIONAL(TARGET_UBUNTU, test x"$with_distro" = xubuntu)
-AM_CONDITIONAL(TARGET_DEBIAN_OR_UBUNTU, test x"$with_distro" = xdebian -o x"$with_distro" = xubuntu)
 AM_CONDITIONAL(TARGET_ARCH, test x"$with_distro" = xarch)
 AM_CONDITIONAL(TARGET_GENTOO, test x"$with_distro" = xgentoo)
 AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware)
@@ -840,6 +892,7 @@ AC_MSG_RESULT([
         GCRYPT:                  ${have_gcrypt}
         QRENCODE:                ${have_qrencode}
         MICROHTTPD:              ${have_microhttpd}
+        CHKCONFIG:               ${have_chkconfig}
         binfmt:                  ${have_binfmt}
         vconsole:                ${have_vconsole}
         readahead:               ${have_readahead}
@@ -850,6 +903,8 @@ AC_MSG_RESULT([
         timedated:               ${have_timedated}
         localed:                 ${have_localed}
         coredump:                ${have_coredump}
+        kmod:                    ${have_kmod}
+        blkid:                   ${have_blkid}
         firmware path:           ${FIRMWARE_PATH}
         gudev:                   ${enable_gudev}
         gintrospection:          ${enable_introspection}
@@ -873,8 +928,12 @@ AC_MSG_RESULT([
         Split /usr:              ${enable_split_usr}
         man pages:               ${have_manpages}
         gtk-doc:                 ${enable_gtk_doc}
+        Extra start script:      ${RC_LOCAL_SCRIPT_PATH_START}
+        Extra stop script:       ${RC_LOCAL_SCRIPT_PATH_STOP}
 
         CFLAGS:                  ${OUR_CFLAGS} ${CFLAGS}
         CPPLAGS:                 ${OUR_CPPFLAGS} ${CPPFLAGS}
         LDFLAGS:                 ${OUR_LDFLAGS} ${LDFLAGS}
+        PYTHON_CFLAGS:           ${PYTHON_CFLAGS}
+        PYTHON_LIBS:             ${PYTHON_LIBS}
 ])