blob: a11c8f21ad2127605d1ca5d3c96727c877f516e0 [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 Remnant726290a2009-07-21 18:31:35 +01004AC_INIT([upstart], [0.6.3], [upstart-devel@lists.ubuntu.com])
Scott James Remnantfcb81e62009-01-26 15:26:29 +00005AC_COPYRIGHT([[Copyright © 2009 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 Remnant0c3bef32007-10-08 13:20:56 +010011AM_INIT_AUTOMAKE([1.10 gnu nostdinc check-news dist-bzip2])
Scott James Remnant8a0cd072006-05-14 18:28:58 +010012
Scott James Remnant32804e82009-01-26 15:25:57 +000013LT_PREREQ(2.2.4)
14LT_INIT
15
Scott James Remnante16d32c2007-10-08 13:37:44 +010016AM_GNU_GETTEXT_VERSION([0.16.1])
Scott James Remnant8a0cd072006-05-14 18:28:58 +010017AM_GNU_GETTEXT()
18
19# Checks for programs.
20AC_PROG_CC
Scott James Remnantc043a8a2007-04-24 12:59:54 +010021AM_PROG_CC_C_O
Scott James Remnant2a66c572009-09-15 03:19:16 +010022PKG_PROG_PKG_CONFIG
Scott James Remnant8a0cd072006-05-14 18:28:58 +010023
24# Checks for libraries.
Scott James Remnant477d9d42008-04-12 14:07:48 +010025NIH_INIT([dbus])
Scott James Remnant8a0cd072006-05-14 18:28:58 +010026
27# Checks for header files.
28
29# Checks for typedefs, structures, and compiler characteristics.
30
31# Checks for library functions.
32
33# Other checks
Scott James Remnant680d2fd2008-02-29 17:41:38 +000034AC_MSG_CHECKING([whether to include sbindir in PATH])
35eval upstart_sbindir=\"$sbindir\"
36case $upstart_sbindir in
37 /sbin|//sbin|/usr/sbin|/usr/local/sbin)
38 AC_MSG_RESULT([no])
39 ;;
40 *)
41 AC_MSG_RESULT([yes])
42 AC_DEFINE_UNQUOTED([EXTRA_PATH], ["$upstart_sbindir"],
43 [Directory to append to path.])
44 ;;
45esac
46
Scott James Remnant2a66c572009-09-15 03:19:16 +010047PKG_CHECK_MODULES([UDEV], [libudev >= 146])
48
Scott James Remnant8a0cd072006-05-14 18:28:58 +010049
Colin Watsond58a9aa2010-01-16 02:55:43 +000050AM_CONDITIONAL(CROSS_COMPILING, test "x$cross_compiling" = xyes)
51if test "x$cross_compiling" = xyes; then
52 AR_FOR_BUILD=${AR_FOR_BUILD-ar}
53 CC_FOR_BUILD=${CC_FOR_BUILD-gcc -std=gnu99}
54 RANLIB_FOR_BUILD=${RANLIB_FOR_BUILD-ranlib}
55 dnl This is unfortunately specific to the way dpkg-buildpackage
56 dnl overrides pkg-config's library path, which makes it hard for
57 dnl this patch to go upstream. In future we should have a
58 dnl ${host}-pkg-config instead.
59 m4_pattern_allow([^PKG_CONFIG_LIBDIR$])
60 DBUS_CFLAGS_FOR_BUILD=`unset PKG_CONFIG_LIBDIR; pkg-config --cflags 'dbus-1 >= 1.2.16'`
61 DBUS_LIBS_FOR_BUILD=`unset PKG_CONFIG_LIBDIR; pkg-config --libs 'dbus-1 >= 1.2.16'`
62else
63 AR_FOR_BUILD="\$(AR)"
64 CC_FOR_BUILD="\$(CC)"
65 RANLIB_FOR_BUILD="\$(RANLIB)"
66 CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-$CFLAGS}
67 LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-$LDFLAGS}
68fi
69AC_SUBST(AR_FOR_BUILD)
70AC_SUBST(CC_FOR_BUILD)
71AC_SUBST(RANLIB_FOR_BUILD)
72AC_SUBST(CFLAGS_FOR_BUILD)
73AC_SUBST(LDFLAGS_FOR_BUILD)
74AC_SUBST(DBUS_CFLAGS_FOR_BUILD)
75AC_SUBST(DBUS_LIBS_FOR_BUILD)
76
77
Scott James Remnant9b25c8d2009-01-26 15:35:51 +000078AC_CONFIG_FILES([ Makefile m4/Makefile intl/Makefile
Scott James Remnant0ad2d9a2009-02-20 22:08:20 +000079 nih/Makefile nih-dbus/Makefile nih-dbus-tool/Makefile
Scott James Remnant2a66c572009-09-15 03:19:16 +010080 dbus/Makefile init/Makefile util/Makefile udev/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