configure.ac revision d7c114c00030309435fc56c77c8578a25d228ebe
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# This file is part of systemd.
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# Copyright 2010 Lennart Poettering
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# systemd is free software; you can redistribute it and/or modify it
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# under the terms of the GNU General Public License as published by
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# the Free Software Foundation; either version 2 of the License, or
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# (at your option) any later version.
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# systemd is distributed in the hope that it will be useful, but
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# WITHOUT ANY WARRANTY; without even the implied warranty of
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# General Public License for more details.
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# You should have received a copy of the GNU General Public License
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# along with systemd; If not, see <http://www.gnu.org/licenses/>.
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_PREREQ(2.63)
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_INIT([systemd],[0],[mzflfgrzq (at) 0pointer (dot) net])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_CONFIG_SRCDIR([main.c])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_CONFIG_MACRO_DIR([m4])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_CONFIG_HEADERS([config.h])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_SUBST(PACKAGE_URL, [http://git.0pointer.de/?p=systemd.git])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_CANONICAL_HOST
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAM_SILENT_RULES([yes])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_CHECK_PROG([STOW], [stow], [yes], [no])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAS_IF([test "x$STOW" = "xyes" && test -d /usr/local/stow], [
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_PROG_GCC_TRADITIONAL
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_USE_SYSTEM_EXTENSIONS
ac8cfcf56c5d7b3eaeec64e94f6c4659e82a2b10Lennart PoetteringCC_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])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_SEARCH_LIBS([clock_gettime], [rt], [], [AC_MSG_ERROR([*** POSIX RT library not found])])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_SEARCH_LIBS([cap_init], [cap], [], [AC_MSG_ERROR([*** POSIX caps library not found])])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringPKG_CHECK_MODULES(UDEV, [ libudev ])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_SUBST(UDEV_CFLAGS)
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_SUBST(UDEV_LIBS)
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringPKG_CHECK_MODULES(DBUS, [ dbus-1 ])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_SUBST(DBUS_CFLAGS)
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_SUBST(DBUS_LIBS)
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringPKG_CHECK_MODULES(DBUSGLIB, [ dbus-glib-1 ])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_SUBST(DBUSGLIB_CFLAGS)
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_SUBST(DBUSGLIB_LIBS)
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringPKG_CHECK_MODULES(GEE, [ gee-1.0 ])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_SUBST(GEE_CFLAGS)
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_SUBST(GEE_LIBS)
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringPKG_CHECK_MODULES(GTK, [ gtk+-2.0 ])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_SUBST(GTK_CFLAGS)
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_SUBST(GTK_LIBS)
8e27452380193a5f81bfd08a59aab8b07008ba0bLennart PoetteringPKG_CHECK_MODULES(CGROUP, [ libcgroup ])
8e27452380193a5f81bfd08a59aab8b07008ba0bLennart PoetteringAC_SUBST(CGROUP_CFLAGS)
8e27452380193a5f81bfd08a59aab8b07008ba0bLennart PoetteringAC_SUBST(CGROUP_LIBS)
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAM_PROG_VALAC()
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_SUBST(VAPIDIR)
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart PoetteringAC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO],[Specify the distribution to target: One of fedora, suse, debian, or none]))
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poetteringif test "z$with_distro" = "z"; then
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering if test "$cross_compiling" = yes; then
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering 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)])
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering AC_CHECK_FILE(/etc/redhat-release,with_distro="fedora")
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering AC_CHECK_FILE(/etc/debian_version,with_distro="debian")
d7c114c00030309435fc56c77c8578a25d228ebeDave Reisner AC_CHECK_FILE(/etc/arch-release,with_distro="arch")
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering if test "z$with_distro" = "z"; then
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering with_distro=`uname -s`
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poetteringwith_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' `
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poetteringcase $with_distro in
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering SYSTEM_SYSVRCND_PATH=/etc/rc.d
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering special_dbus_service=messagebus.service
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering special_syslog_service=rsyslog.service
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering AC_DEFINE(TARGET_FEDORA, [], [Target is Fedora/RHEL])
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering SYSTEM_SYSVINIT_PATH=/etc/init.d
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering SYSTEM_SYSVRCND_PATH=/etc/init.d
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering special_dbus_service=dbus.service
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering special_syslog_service=syslog.service
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering AC_DEFINE(TARGET_SUSE, [], [Target is OpenSUSE/SLES])
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering SYSTEM_SYSVINIT_PATH=/etc/init.d
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering SYSTEM_SYSVRCND_PATH=/etc
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering special_dbus_service=dbus.service
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering special_syslog_service=sysklogd.service
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering AC_DEFINE(TARGET_DEBIAN, [], [Target is Debian/Ubuntu])
d7c114c00030309435fc56c77c8578a25d228ebeDave Reisner SYSTEM_SYSVINIT_PATH=/etc/rc.d
d7c114c00030309435fc56c77c8578a25d228ebeDave Reisner SYSTEM_SYSVRCND_PATH=/etc
d7c114c00030309435fc56c77c8578a25d228ebeDave Reisner special_dbus_service=dbus.service
d7c114c00030309435fc56c77c8578a25d228ebeDave Reisner special_syslog_service=syslog-ng.service
d7c114c00030309435fc56c77c8578a25d228ebeDave Reisner AC_DEFINE(TARGET_ARCH, [], [Target is ArchLinux])
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering SYSTEM_SYSVINIT_PATH=/fix/the/configure/script
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering SYSTEM_SYSVRCND_PATH=/fix/the/configure/script
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering special_dbus_service=fix-the-configure-script.service
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering special_syslog_service=fix-the-configure-script.service
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering 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])
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart PoetteringAC_SUBST(SYSTEM_SYSVINIT_PATH)
d64b723a9e275ee4c6ccb947e3fd6ed6b3e4c359Lennart PoetteringAC_SUBST(SYSTEM_SYSVRCND_PATH)
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart PoetteringAM_CONDITIONAL(TARGET_FEDORA, test x"$with_distro" = xfedora)
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart PoetteringAM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart PoetteringAM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
d7c114c00030309435fc56c77c8578a25d228ebeDave ReisnerAM_CONDITIONAL(TARGET_ARCH, test x"$with_distro" = xarch)
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart PoetteringAC_DEFINE_UNQUOTED(SPECIAL_DBUS_SERVICE, ["$special_dbus_service"], [D-Bus service name])
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart PoetteringAC_DEFINE_UNQUOTED(SPECIAL_SYSLOG_SERVICE, ["$special_syslog_service"], [syslog service name])
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringAC_OUTPUT([Makefile])
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering $PACKAGE_NAME $VERSION
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering Distribution: ${with_distro}
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering SysV init scripts: ${SYSTEM_SYSVINIT_PATH}
0571e0111d76cf96aa4069d9c7a6e24d97aa7e48Lennart Poettering SysV rc?.d directories: ${SYSTEM_SYSVRCND_PATH}
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering Syslog service: ${special_syslog_service}
2c696a96a2bd63d2ff0d5595622124ef9270b172Lennart Poettering D-Bus service: ${special_dbus_service}