~ubuntu-core-dev/ubuntu/raring/upstart/raring

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.61)
AC_INIT([upstart], [1.7], [upstart-devel@lists.ubuntu.com])
NIH_COPYRIGHT([[Copyright © 2013 Scott James Remnant, Canonical Ltd.]])
AC_CONFIG_SRCDIR([init/main.c])
AC_CONFIG_MACRO_DIR([m4])

AC_GNU_SOURCE

AM_INIT_AUTOMAKE([1.10 gnu nostdinc check-news color-tests silent-rules])
AM_SILENT_RULES([yes])
AM_MAINTAINER_MODE([enable])

LT_PREREQ(2.2.4)
LT_INIT

AM_GNU_GETTEXT_VERSION([0.17])
AM_GNU_GETTEXT()

# Checks for programs.
AC_PROG_CC
PKG_PROG_PKG_CONFIG([0.22])

AC_PATH_PROG([NIH_DBUS_TOOL], [nih-dbus-tool])

# Checks for libraries.
NIH_WITH_LOCAL_LIBNIH

PKG_CHECK_MODULES([NIH], [libnih >= 1.0.2])
PKG_CHECK_MODULES([NIH_DBUS], [libnih-dbus >= 1.0.0])
PKG_CHECK_MODULES([DBUS], [dbus-1 >= 1.2.16])
PKG_CHECK_MODULES([UDEV], [libudev >= 146], [have_udev=yes], [have_udev=no])

# Reasons for requiring this library version:
#
# 1) RFC 4627, the JSON "memo" (it is *NOT* a standard!) helpfully fails
#    to specify the maximum size of an integer type. And yet, JSON is
#    supposedly a subset of ECMA-262, which specifies a Number type to
#    be 64-bits.
#
#    The loose JSON "memo" might expalain why older versions of JSON-C encode
#    a JSON Number in sizoef(int) bytes which is only 32-bits on 32-bit
#    systems. This is not acceptable for Upstart which needs to be able
#    to encode 'size_t' and 'unsigned long' types which can be larger
#    than 'int'.
#
# 2) New json_tokener_parse_verbose() function required to detect invalid
#    JSON (!)
#
PKG_CHECK_MODULES([JSON], [json >= 0.10])

AM_CONDITIONAL([HAVE_UDEV], [test "$have_udev" = yes])

AC_ARG_ENABLE(selinux,
	      AS_HELP_STRING([--enable-selinux], [enable SELinux support]),
	      [], [enable_selinux=no])

if test "x$enable_selinux" = "xyes" ; then
	PKG_CHECK_MODULES(SELINUX, [libselinux])
	AC_DEFINE(HAVE_SELINUX, 1, [Define if we have SELinux])
fi

# Checks for header files.
AC_CHECK_HEADERS([valgrind/valgrind.h, sys/prctl.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_PROG_CC_C99
AM_PROG_CC_C_O
NIH_C_THREAD

AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(uid_t)
AC_CHECK_SIZEOF(pid_t)
AC_CHECK_SIZEOF(time_t)
AC_CHECK_SIZEOF(mode_t)
AC_CHECK_SIZEOF(size_t)
AC_CHECK_SIZEOF(ssize_t)

# Unlikely to hit this limit for a while, but it pays to be safe.
for type in int uid_t pid_t time_t mode_t size_t ssize_t
do
	eval value="\$ac_cv_sizeof_${type}"
	test "$value" -gt 8 && AC_MSG_ERROR([type $type is $value bytes, larger than JSON-C can represent])
done

# Checks for library functions.

# Other checks
AC_MSG_CHECKING([whether to include sbindir in PATH])
eval upstart_sbindir=\"$sbindir\"
case $upstart_sbindir in
    /sbin|NONE/sbin|//sbin|/usr/sbin|/usr/local/sbin)
    	AC_MSG_RESULT([no])
	;;
    *)
    	AC_MSG_RESULT([yes])
	AC_DEFINE_UNQUOTED([EXTRA_PATH], ["$upstart_sbindir"],
			   [Directory to append to path.])
	;;
esac

NIH_COMPILER_WARNINGS
NIH_COMPILER_OPTIMISATIONS
NIH_COMPILER_COVERAGE

NIH_LINKER_OPTIMISATIONS


AC_CONFIG_FILES([ Makefile intl/Makefile
		  dbus/Makefile init/Makefile util/Makefile conf/Makefile
		  extra/Makefile doc/Makefile contrib/Makefile po/Makefile.in
		  scripts/Makefile ])
AC_CONFIG_HEADERS([config.h])
AC_OUTPUT