Scott James Remnant | 8a0cd07 | 2006-05-14 18:28:58 +0100 | [diff] [blame] | 1 | # Process this file with autoconf to produce a configure script. |
| 2 | |
Scott James Remnant | a86d398 | 2007-10-15 17:55:09 +0100 | [diff] [blame] | 3 | AC_PREREQ(2.61) |
Scott James Remnant | 726290a | 2009-07-21 18:31:35 +0100 | [diff] [blame] | 4 | AC_INIT([upstart], [0.6.3], [upstart-devel@lists.ubuntu.com]) |
Scott James Remnant | fcb81e6 | 2009-01-26 15:26:29 +0000 | [diff] [blame] | 5 | AC_COPYRIGHT([[Copyright © 2009 Canonical Ltd.]]) |
Scott James Remnant | 8a0cd07 | 2006-05-14 18:28:58 +0100 | [diff] [blame] | 6 | AC_CONFIG_SRCDIR([init/main.c]) |
| 7 | AC_CONFIG_MACRO_DIR([m4]) |
| 8 | |
Scott James Remnant | 8985dd3 | 2006-10-12 15:26:29 +0100 | [diff] [blame] | 9 | AC_GNU_SOURCE |
| 10 | |
Scott James Remnant | 0c3bef3 | 2007-10-08 13:20:56 +0100 | [diff] [blame] | 11 | AM_INIT_AUTOMAKE([1.10 gnu nostdinc check-news dist-bzip2]) |
Scott James Remnant | 8a0cd07 | 2006-05-14 18:28:58 +0100 | [diff] [blame] | 12 | |
Scott James Remnant | 32804e8 | 2009-01-26 15:25:57 +0000 | [diff] [blame] | 13 | LT_PREREQ(2.2.4) |
| 14 | LT_INIT |
| 15 | |
Scott James Remnant | e16d32c | 2007-10-08 13:37:44 +0100 | [diff] [blame] | 16 | AM_GNU_GETTEXT_VERSION([0.16.1]) |
Scott James Remnant | 8a0cd07 | 2006-05-14 18:28:58 +0100 | [diff] [blame] | 17 | AM_GNU_GETTEXT() |
| 18 | |
| 19 | # Checks for programs. |
| 20 | AC_PROG_CC |
Scott James Remnant | c043a8a | 2007-04-24 12:59:54 +0100 | [diff] [blame] | 21 | AM_PROG_CC_C_O |
Scott James Remnant | 2a66c57 | 2009-09-15 03:19:16 +0100 | [diff] [blame] | 22 | PKG_PROG_PKG_CONFIG |
Scott James Remnant | 8a0cd07 | 2006-05-14 18:28:58 +0100 | [diff] [blame] | 23 | |
| 24 | # Checks for libraries. |
Scott James Remnant | 477d9d4 | 2008-04-12 14:07:48 +0100 | [diff] [blame] | 25 | NIH_INIT([dbus]) |
Scott James Remnant | 8a0cd07 | 2006-05-14 18:28:58 +0100 | [diff] [blame] | 26 | |
| 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 Remnant | 680d2fd | 2008-02-29 17:41:38 +0000 | [diff] [blame] | 34 | AC_MSG_CHECKING([whether to include sbindir in PATH]) |
| 35 | eval upstart_sbindir=\"$sbindir\" |
| 36 | case $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 | ;; |
| 45 | esac |
| 46 | |
Scott James Remnant | 2a66c57 | 2009-09-15 03:19:16 +0100 | [diff] [blame] | 47 | PKG_CHECK_MODULES([UDEV], [libudev >= 146]) |
| 48 | |
Scott James Remnant | 8a0cd07 | 2006-05-14 18:28:58 +0100 | [diff] [blame] | 49 | |
Colin Watson | d58a9aa | 2010-01-16 02:55:43 +0000 | [diff] [blame] | 50 | AM_CONDITIONAL(CROSS_COMPILING, test "x$cross_compiling" = xyes) |
| 51 | if 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'` |
| 62 | else |
| 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} |
| 68 | fi |
| 69 | AC_SUBST(AR_FOR_BUILD) |
| 70 | AC_SUBST(CC_FOR_BUILD) |
| 71 | AC_SUBST(RANLIB_FOR_BUILD) |
| 72 | AC_SUBST(CFLAGS_FOR_BUILD) |
| 73 | AC_SUBST(LDFLAGS_FOR_BUILD) |
| 74 | AC_SUBST(DBUS_CFLAGS_FOR_BUILD) |
| 75 | AC_SUBST(DBUS_LIBS_FOR_BUILD) |
| 76 | |
| 77 | |
Scott James Remnant | 9b25c8d | 2009-01-26 15:35:51 +0000 | [diff] [blame] | 78 | AC_CONFIG_FILES([ Makefile m4/Makefile intl/Makefile |
Scott James Remnant | 0ad2d9a | 2009-02-20 22:08:20 +0000 | [diff] [blame] | 79 | nih/Makefile nih-dbus/Makefile nih-dbus-tool/Makefile |
Scott James Remnant | 2a66c57 | 2009-09-15 03:19:16 +0100 | [diff] [blame] | 80 | dbus/Makefile init/Makefile util/Makefile udev/Makefile conf/Makefile |
Scott James Remnant | d3a6ca7 | 2009-07-08 20:59:21 +0100 | [diff] [blame] | 81 | doc/Makefile contrib/Makefile po/Makefile.in ]) |
Scott James Remnant | 8a0cd07 | 2006-05-14 18:28:58 +0100 | [diff] [blame] | 82 | AC_CONFIG_HEADERS([config.h]) |
| 83 | AC_OUTPUT |