blob: fb79a13b4a7c66474b0a38ef0bb39ae1c7b1b07e [file] [log] [blame]
Scott James Remnant8a0cd072006-05-14 18:28:58 +01001# Process this file with autoconf to produce a configure script.
2
Scott James Remnanta86d3982007-10-15 17:55:09 +01003AC_PREREQ(2.61)
Scott James Remnantb3918a62010-02-03 16:39:50 -08004AC_INIT([upstart], [0.6.5], [upstart-devel@lists.ubuntu.com])
5AC_COPYRIGHT([[Copyright © 2010 Canonical Ltd.]])
Scott James Remnant8a0cd072006-05-14 18:28:58 +01006AC_CONFIG_SRCDIR([init/main.c])
7AC_CONFIG_MACRO_DIR([m4])
8
Scott James Remnant8985dd32006-10-12 15:26:29 +01009AC_GNU_SOURCE
10
Scott James Remnantd2350362010-02-03 19:42:29 -080011AM_INIT_AUTOMAKE([1.10 gnu nostdinc check-news color-tests silent-rules])
12AM_SILENT_RULES([yes])
13AM_MAINTAINER_MODE([enable])
Scott James Remnant8a0cd072006-05-14 18:28:58 +010014
Scott James Remnant32804e82009-01-26 15:25:57 +000015LT_PREREQ(2.2.4)
16LT_INIT
17
Scott James Remnantd2350362010-02-03 19:42:29 -080018AM_GNU_GETTEXT_VERSION([0.17])
Scott James Remnant8a0cd072006-05-14 18:28:58 +010019AM_GNU_GETTEXT()
20
21# Checks for programs.
22AC_PROG_CC
Scott James Remnantd2350362010-02-03 19:42:29 -080023PKG_PROG_PKG_CONFIG([0.22])
24
25AC_PATH_PROG([NIH_DBUS_TOOL], [nih-dbus-tool])
Scott James Remnant8a0cd072006-05-14 18:28:58 +010026
27# Checks for libraries.
Scott James Remnantd2350362010-02-03 19:42:29 -080028AC_ARG_WITH(local-libnih,
29 AS_HELP_STRING([[[--with-local-libnih[=DIR]]]],
30 [Use libnih from source tree DIR]),
31[AS_IF([test "x$with_local_libnih" != "xno"],
32 [AS_IF([! test -f "$withval/nih/alloc.c"],
33 [AC_MSG_ERROR([$withval doesn't look like a libnih source tree])])
34
35 nih_dir="`cd $withval && pwd`"
36
37 NIH_CFLAGS="-I\"\\\"$nih_dir\\\"\""
38 NIH_LIBS="\"$nih_dir/nih/libnih.la\""
39 NIH_DBUS_CFLAGS="-I\"\\\"$nih_dir\\\"\""
40 NIH_DBUS_LIBS="\"$nih_dir/nih-dbus/libnih-dbus.la\""
41 NIH_DBUS_TOOL="\"$nih_dir/nih-dbus-tool/nih-dbus-tool\""])
42])
43
44PKG_CHECK_MODULES([NIH], [libnih >= 1.0.0])
45PKG_CHECK_MODULES([NIH_DBUS], [libnih-dbus >= 1.0.0])
46PKG_CHECK_MODULES([DBUS], [dbus-1 >= 1.2.16])
Scott James Remnant8a0cd072006-05-14 18:28:58 +010047
48# Checks for header files.
Scott James Remnantd2350362010-02-03 19:42:29 -080049AC_CHECK_HEADERS([valgrind/valgrind.h])
Scott James Remnant8a0cd072006-05-14 18:28:58 +010050
51# Checks for typedefs, structures, and compiler characteristics.
Scott James Remnantd2350362010-02-03 19:42:29 -080052AC_PROG_CC_C99
53AM_PROG_CC_C_O
54NIH_C_THREAD
Scott James Remnant8a0cd072006-05-14 18:28:58 +010055
56# Checks for library functions.
57
58# Other checks
Scott James Remnant680d2fd2008-02-29 17:41:38 +000059AC_MSG_CHECKING([whether to include sbindir in PATH])
60eval upstart_sbindir=\"$sbindir\"
61case $upstart_sbindir in
62 /sbin|//sbin|/usr/sbin|/usr/local/sbin)
63 AC_MSG_RESULT([no])
64 ;;
65 *)
66 AC_MSG_RESULT([yes])
67 AC_DEFINE_UNQUOTED([EXTRA_PATH], ["$upstart_sbindir"],
68 [Directory to append to path.])
69 ;;
70esac
71
Scott James Remnantd2350362010-02-03 19:42:29 -080072NIH_COMPILER_WARNINGS
73NIH_COMPILER_OPTIMISATIONS
74NIH_COMPILER_COVERAGE
Scott James Remnant8a0cd072006-05-14 18:28:58 +010075
Scott James Remnantd2350362010-02-03 19:42:29 -080076NIH_LINKER_OPTIMISATIONS
77
78
79AC_CONFIG_FILES([ Makefile intl/Makefile
Scott James Remnantedb382a2009-07-08 20:43:16 +010080 dbus/Makefile init/Makefile util/Makefile conf/Makefile
Scott James Remnantd3a6ca72009-07-08 20:59:21 +010081 doc/Makefile contrib/Makefile po/Makefile.in ])
Scott James Remnant8a0cd072006-05-14 18:28:58 +010082AC_CONFIG_HEADERS([config.h])
83AC_OUTPUT