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 | b3918a6 | 2010-02-03 16:39:50 -0800 | [diff] [blame] | 4 | AC_INIT([upstart], [0.6.5], [upstart-devel@lists.ubuntu.com]) |
| 5 | AC_COPYRIGHT([[Copyright © 2010 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 | d235036 | 2010-02-03 19:42:29 -0800 | [diff] [blame^] | 11 | AM_INIT_AUTOMAKE([1.10 gnu nostdinc check-news color-tests silent-rules]) |
| 12 | AM_SILENT_RULES([yes]) |
| 13 | AM_MAINTAINER_MODE([enable]) |
Scott James Remnant | 8a0cd07 | 2006-05-14 18:28:58 +0100 | [diff] [blame] | 14 | |
Scott James Remnant | 32804e8 | 2009-01-26 15:25:57 +0000 | [diff] [blame] | 15 | LT_PREREQ(2.2.4) |
| 16 | LT_INIT |
| 17 | |
Scott James Remnant | d235036 | 2010-02-03 19:42:29 -0800 | [diff] [blame^] | 18 | AM_GNU_GETTEXT_VERSION([0.17]) |
Scott James Remnant | 8a0cd07 | 2006-05-14 18:28:58 +0100 | [diff] [blame] | 19 | AM_GNU_GETTEXT() |
| 20 | |
| 21 | # Checks for programs. |
| 22 | AC_PROG_CC |
Scott James Remnant | d235036 | 2010-02-03 19:42:29 -0800 | [diff] [blame^] | 23 | PKG_PROG_PKG_CONFIG([0.22]) |
| 24 | |
| 25 | AC_PATH_PROG([NIH_DBUS_TOOL], [nih-dbus-tool]) |
Scott James Remnant | 8a0cd07 | 2006-05-14 18:28:58 +0100 | [diff] [blame] | 26 | |
| 27 | # Checks for libraries. |
Scott James Remnant | d235036 | 2010-02-03 19:42:29 -0800 | [diff] [blame^] | 28 | AC_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 | |
| 44 | PKG_CHECK_MODULES([NIH], [libnih >= 1.0.0]) |
| 45 | PKG_CHECK_MODULES([NIH_DBUS], [libnih-dbus >= 1.0.0]) |
| 46 | PKG_CHECK_MODULES([DBUS], [dbus-1 >= 1.2.16]) |
Scott James Remnant | 8a0cd07 | 2006-05-14 18:28:58 +0100 | [diff] [blame] | 47 | |
| 48 | # Checks for header files. |
Scott James Remnant | d235036 | 2010-02-03 19:42:29 -0800 | [diff] [blame^] | 49 | AC_CHECK_HEADERS([valgrind/valgrind.h]) |
Scott James Remnant | 8a0cd07 | 2006-05-14 18:28:58 +0100 | [diff] [blame] | 50 | |
| 51 | # Checks for typedefs, structures, and compiler characteristics. |
Scott James Remnant | d235036 | 2010-02-03 19:42:29 -0800 | [diff] [blame^] | 52 | AC_PROG_CC_C99 |
| 53 | AM_PROG_CC_C_O |
| 54 | NIH_C_THREAD |
Scott James Remnant | 8a0cd07 | 2006-05-14 18:28:58 +0100 | [diff] [blame] | 55 | |
| 56 | # Checks for library functions. |
| 57 | |
| 58 | # Other checks |
Scott James Remnant | 680d2fd | 2008-02-29 17:41:38 +0000 | [diff] [blame] | 59 | AC_MSG_CHECKING([whether to include sbindir in PATH]) |
| 60 | eval upstart_sbindir=\"$sbindir\" |
| 61 | case $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 | ;; |
| 70 | esac |
| 71 | |
Scott James Remnant | d235036 | 2010-02-03 19:42:29 -0800 | [diff] [blame^] | 72 | NIH_COMPILER_WARNINGS |
| 73 | NIH_COMPILER_OPTIMISATIONS |
| 74 | NIH_COMPILER_COVERAGE |
Scott James Remnant | 8a0cd07 | 2006-05-14 18:28:58 +0100 | [diff] [blame] | 75 | |
Scott James Remnant | d235036 | 2010-02-03 19:42:29 -0800 | [diff] [blame^] | 76 | NIH_LINKER_OPTIMISATIONS |
| 77 | |
| 78 | |
| 79 | AC_CONFIG_FILES([ Makefile intl/Makefile |
Scott James Remnant | edb382a | 2009-07-08 20:43:16 +0100 | [diff] [blame] | 80 | dbus/Makefile init/Makefile util/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 |