configure.ac revision d64b723a9e275ee4c6ccb947e3fd6ed6b3e4c359
43b4c41fbb07705c9df321221ab9cb9832460407Christian Maeder# This file is part of systemd.
c63ebf815c8a874525cf18670ad74847f7fc7b26Christian Maeder#
456238178f89e5a3de2988ee6c8af924297d52d9Christian Maeder# Copyright 2010 Lennart Poettering
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder#
456238178f89e5a3de2988ee6c8af924297d52d9Christian Maeder# systemd is free software; you can redistribute it and/or modify it
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# under the terms of the GNU General Public License as published by
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# the Free Software Foundation; either version 2 of the License, or
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# (at your option) any later version.
43b4c41fbb07705c9df321221ab9cb9832460407Christian Maeder#
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# systemd is distributed in the hope that it will be useful, but
f4a2a20e49f41b2afa657e5e64d9e349c7faa091Christian Maeder# WITHOUT ANY WARRANTY; without even the implied warranty of
f2f9df2e17e70674f0bf426ed1763c973ee4cde0Christian Maeder# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
c9a7e6af169a2adfb92f42331cd578065ed83a2bChristian Maeder# General Public License for more details.
c9a7e6af169a2adfb92f42331cd578065ed83a2bChristian Maeder#
e7757995211bd395dc79d26fe017d99375f7d2a6Christian Maeder# You should have received a copy of the GNU General Public License
e7757995211bd395dc79d26fe017d99375f7d2a6Christian Maeder# along with systemd; If not, see <http://www.gnu.org/licenses/>.
63f0e65a37b95621334db9ee4ba0cd9d826f5c0fChristian Maeder
63f0e65a37b95621334db9ee4ba0cd9d826f5c0fChristian MaederAC_PREREQ(2.63)
a1ed34933c266ce85066acb0d7b20c90cb8eb213Christian Maeder
c0c2380bced8159ff0297ece14eba948bd236471Christian MaederAC_INIT([systemd],[0],[mzflfgrzq (at) 0pointer (dot) net])
404166b9366552e9ec5abb87a37c76ec8a815fb7Klaus LuettichAC_CONFIG_SRCDIR([main.c])
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian MaederAC_CONFIG_MACRO_DIR([m4])
ad270004874ce1d0697fb30d7309f180553bb315Christian MaederAC_CONFIG_HEADERS([config.h])
404166b9366552e9ec5abb87a37c76ec8a815fb7Klaus Luettich
63f0e65a37b95621334db9ee4ba0cd9d826f5c0fChristian MaederAM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax])
d23b0cc79c0d204e6ec758dff8d0ba71c9f693f7Christian Maeder
3e8b136f23ed57d40ee617f49bcac37830b58cabChristian MaederAC_SUBST(PACKAGE_URL, [http://git.0pointer.de/?p=systemd.git])
ef9e8535c168d3f774d9e74368a2317a9eda5826Christian Maeder
bab2d88d650448628730ed3b65c9f99c52500e8cChristian MaederAC_CANONICAL_HOST
3e8b136f23ed57d40ee617f49bcac37830b58cabChristian Maeder
ef9e8535c168d3f774d9e74368a2317a9eda5826Christian MaederAM_SILENT_RULES([yes])
63f0e65a37b95621334db9ee4ba0cd9d826f5c0fChristian Maeder
63f0e65a37b95621334db9ee4ba0cd9d826f5c0fChristian MaederAC_CHECK_PROG([STOW], [stow], [yes], [no])
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
3dde4051c307b609159a097f08a05108fdd036efJonathan von SchroederAS_IF([test "x$STOW" = "xyes" && test -d /usr/local/stow], [
3dde4051c307b609159a097f08a05108fdd036efJonathan von Schroeder AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
3dde4051c307b609159a097f08a05108fdd036efJonathan von Schroeder ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
3dde4051c307b609159a097f08a05108fdd036efJonathan von Schroeder])
3dde4051c307b609159a097f08a05108fdd036efJonathan von Schroeder
3dde4051c307b609159a097f08a05108fdd036efJonathan von SchroederAC_PROG_CC
3dde4051c307b609159a097f08a05108fdd036efJonathan von SchroederAC_PROG_CC_C99
3dde4051c307b609159a097f08a05108fdd036efJonathan von SchroederAM_PROG_CC_C_O
3dde4051c307b609159a097f08a05108fdd036efJonathan von SchroederAC_PROG_GCC_TRADITIONAL
3dde4051c307b609159a097f08a05108fdd036efJonathan von SchroederAC_USE_SYSTEM_EXTENSIONS
3dde4051c307b609159a097f08a05108fdd036efJonathan von Schroeder
825a1e4ca1e768de4b4883c65a6cb1dce6aa0002Christian MaederCC_CHECK_CFLAGS_APPEND([-Wall -W -Wextra -pipe -Wno-long-long -Winline -Wvla -Wno-overlength-strings -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing=2 -Wwrite-strings -Wno-unused-parameter -ffast-math -Wp,-D_FORTIFY_SOURCE=2 -fno-common -fdiagnostics-show-option -Wno-missing-field-initializers])
3dde4051c307b609159a097f08a05108fdd036efJonathan von Schroeder
8b767d09a78927b111f5596fdff9ca7d2c1a439fChristian MaederAC_SEARCH_LIBS([clock_gettime], [rt], [], [AC_MSG_ERROR([*** POSIX RT library not found])])
8b767d09a78927b111f5596fdff9ca7d2c1a439fChristian MaederAC_SEARCH_LIBS([cap_init], [cap], [], [AC_MSG_ERROR([*** POSIX caps library not found])])
8b767d09a78927b111f5596fdff9ca7d2c1a439fChristian MaederAC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
8b767d09a78927b111f5596fdff9ca7d2c1a439fChristian Maeder
8b767d09a78927b111f5596fdff9ca7d2c1a439fChristian MaederPKG_CHECK_MODULES(UDEV, [ libudev ])
8b767d09a78927b111f5596fdff9ca7d2c1a439fChristian MaederAC_SUBST(UDEV_CFLAGS)
456238178f89e5a3de2988ee6c8af924297d52d9Christian MaederAC_SUBST(UDEV_LIBS)
4b4a0b61b72cf8478a5d4d5002bca9f699401363Christian Maeder
4b4a0b61b72cf8478a5d4d5002bca9f699401363Christian MaederPKG_CHECK_MODULES(DBUS, [ dbus-1 ])
308834907a120fd8771e18292ed2ca9cd767c12dChristian MaederAC_SUBST(DBUS_CFLAGS)
bab2d88d650448628730ed3b65c9f99c52500e8cChristian MaederAC_SUBST(DBUS_LIBS)
9f226cec9f978edaba67aee4c4e04e3d3b994b87Daniel Calegari
8cacad2a09782249243b80985f28e9387019fe40Christian MaederPKG_CHECK_MODULES(DBUSGLIB, [ dbus-glib-1 ])
6a2dad705deefd1b7a7e09b84fd2d75f2213be47Christian MaederAC_SUBST(DBUSGLIB_CFLAGS)
a7c27282e71cf4505026645f96d4f5cb8a284e32Christian MaederAC_SUBST(DBUSGLIB_LIBS)
363939beade943a02b31004cea09dec34fa8a6d9Christian Maeder
014dc30f64ec25e4790cca987d4d1e6635430510Christian MaederPKG_CHECK_MODULES(GEE, [ gee-1.0 ])
f04e8f3ff56405901be968fd4c6e9769239f1a9bKlaus LuettichAC_SUBST(GEE_CFLAGS)
6aea82c63ba1d2efc0329bc784a14e521469ec20Christian MaederAC_SUBST(GEE_LIBS)
4ba08bfca0cc8d9da65397b8dfd2654fdb4c0e62Christian Maeder
feca1d35123d8c31aee238c9ce79947b0bf65494Christian MaederPKG_CHECK_MODULES(GTK, [ gtk+-2.0 ])
431d34c7007a787331c4e5ec997badb0f8190fc7Christian MaederAC_SUBST(GTK_CFLAGS)
f1541d4a151dbd08002dbd14e7eb1d5dde253689Christian MaederAC_SUBST(GTK_LIBS)
f5c0884429b01e74c6e658ded921fb2e16dfb478Christian Maeder
db675e8302ddb0d6528088ce68f5e98a00e890e3Christian MaederPKG_CHECK_MODULES(CGROUP, [ libcgroup ])
f1541d4a151dbd08002dbd14e7eb1d5dde253689Christian MaederAC_SUBST(CGROUP_CFLAGS)
6dc9bc98d0854fe2e3dd3bfc4275096a0c28ee1cChristian MaederAC_SUBST(CGROUP_LIBS)
6dc9bc98d0854fe2e3dd3bfc4275096a0c28ee1cChristian Maeder
6dc9bc98d0854fe2e3dd3bfc4275096a0c28ee1cChristian MaederAM_PROG_VALAC()
23ffcc44ca8612feccbd8fda63fa5be7ab5f9dc3Christian MaederAC_SUBST(VAPIDIR)
61fa0ac06ede811c7aad54ec4c4202346727368eChristian Maeder
c0c2380bced8159ff0297ece14eba948bd236471Christian MaederAC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO],[Specify the distribution to target: One of fedora, suse, debian, or none]))
63f0e65a37b95621334db9ee4ba0cd9d826f5c0fChristian Maederif test "z$with_distro" = "z"; then
63f0e65a37b95621334db9ee4ba0cd9d826f5c0fChristian Maeder if test "$cross_compiling" = yes; then
63f0e65a37b95621334db9ee4ba0cd9d826f5c0fChristian Maeder 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)])
63f0e65a37b95621334db9ee4ba0cd9d826f5c0fChristian Maeder else
63f0e65a37b95621334db9ee4ba0cd9d826f5c0fChristian Maeder AC_CHECK_FILE(/etc/redhat-release,with_distro="fedora")
9e748851c150e1022fb952bab3315e869aaf0214Christian Maeder AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
6a79849bed67264c396dddb3e9c184bdfc1a1bc9Christian Maeder AC_CHECK_FILE(/etc/debian_version,with_distro="debian")
ca074a78b8dcccbb8c419586787882f98d0c6163Christian Maeder fi
a3c6d8e0670bf2aa71bc8e2a3b1f45d56dd65e4cChristian Maeder if test "z$with_distro" = "z"; then
dc679edd4ca027663212afdf00926ae2ce19b555Christian Maeder with_distro=`uname -s`
63f0e65a37b95621334db9ee4ba0cd9d826f5c0fChristian Maeder fi
ca074a78b8dcccbb8c419586787882f98d0c6163Christian Maederfi
63f0e65a37b95621334db9ee4ba0cd9d826f5c0fChristian Maederwith_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' `
ca074a78b8dcccbb8c419586787882f98d0c6163Christian Maeder
ca074a78b8dcccbb8c419586787882f98d0c6163Christian Maedercase $with_distro in
ca074a78b8dcccbb8c419586787882f98d0c6163Christian Maeder fedora)
4017ebc0f692820736d796af3110c3b3018c108aChristian Maeder SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d
b568982efd0997d877286faa592d81b03c8c67b8Christian Maeder SYSTEM_SYSVRCND_PATH=/etc/rc.d
ca074a78b8dcccbb8c419586787882f98d0c6163Christian Maeder ;;
0be0db405c49906bd7057255069bf6df53395ac9Klaus Luettich suse)
ca074a78b8dcccbb8c419586787882f98d0c6163Christian Maeder SYSTEM_SYSVINIT_PATH=/etc/init.d
63f0e65a37b95621334db9ee4ba0cd9d826f5c0fChristian Maeder SYSTEM_SYSVRCND_PATH=/etc/init.d
63f0e65a37b95621334db9ee4ba0cd9d826f5c0fChristian Maeder ;;
63f0e65a37b95621334db9ee4ba0cd9d826f5c0fChristian Maeder debian)
f2f9df2e17e70674f0bf426ed1763c973ee4cde0Christian Maeder SYSTEM_SYSVINIT_PATH=/etc/init.d
d946c1bfdd7d58aa7c023efe864d5999eb44a61bChristian Maeder SYSTEM_SYSVRCND_PATH=/etc
d946c1bfdd7d58aa7c023efe864d5999eb44a61bChristian Maeder ;;
d946c1bfdd7d58aa7c023efe864d5999eb44a61bChristian Maeder none)
d946c1bfdd7d58aa7c023efe864d5999eb44a61bChristian Maeder SYSTEM_SYSVINIT_PATH=/etc/fix/the/configure/script
d946c1bfdd7d58aa7c023efe864d5999eb44a61bChristian Maeder SYSTEM_SYSVRCND_PATH=/etc/fix/the/configure/script
63f0e65a37b95621334db9ee4ba0cd9d826f5c0fChristian Maeder ;;
d23b0cc79c0d204e6ec758dff8d0ba71c9f693f7Christian Maeder *)
63f0e65a37b95621334db9ee4ba0cd9d826f5c0fChristian Maeder AC_MSG_ERROR([Your distribution (${with_distro}) is not yet supported, SysV init scripts could not be found! (patches welcome); you can specify --with-distro=none to skip this check])
63f0e65a37b95621334db9ee4ba0cd9d826f5c0fChristian Maeder ;;
ca074a78b8dcccbb8c419586787882f98d0c6163Christian Maederesac
ca074a78b8dcccbb8c419586787882f98d0c6163Christian Maeder
63f0e65a37b95621334db9ee4ba0cd9d826f5c0fChristian MaederAC_SUBST(SYSTEM_SYSVINIT_PATH)
63f0e65a37b95621334db9ee4ba0cd9d826f5c0fChristian MaederAC_SUBST(SYSTEM_SYSVRCND_PATH)
ca074a78b8dcccbb8c419586787882f98d0c6163Christian Maeder
ca074a78b8dcccbb8c419586787882f98d0c6163Christian MaederAM_CONDITIONAL(TARGET_FEDORA, test x"$with_distro" = xfedora)
d23b0cc79c0d204e6ec758dff8d0ba71c9f693f7Christian MaederAM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
3e8b136f23ed57d40ee617f49bcac37830b58cabChristian MaederAM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
f1541d4a151dbd08002dbd14e7eb1d5dde253689Christian Maeder
6dc9bc98d0854fe2e3dd3bfc4275096a0c28ee1cChristian MaederAC_OUTPUT([Makefile])
58b96b17bf8e32c0b0d773380a5e62f992eef2bcChristian Maeder
e6d5dbbc3308f05197868806e0b860f4f53875f1Christian Maederecho "
363939beade943a02b31004cea09dec34fa8a6d9Christian Maeder $PACKAGE_NAME $VERSION
58b96b17bf8e32c0b0d773380a5e62f992eef2bcChristian Maeder
e4f4d096e5e6d60dd91c746d0e833d0ac7a29c50Christian Maeder SysV init scripts: ${SYSTEM_SYSVINIT_PATH}
eb74267cf39e4e95f9eeb5c765f4c8dac33971b4Christian Maeder SysV rc?.d directories: ${SYSTEM_SYSVRCND_PATH}
eb74267cf39e4e95f9eeb5c765f4c8dac33971b4Christian Maeder"
e4f4d096e5e6d60dd91c746d0e833d0ac7a29c50Christian Maeder