File: configure.ac

package info (click to toggle)
libcgroup 3.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,840 kB
  • sloc: ansic: 15,527; python: 8,219; cpp: 5,652; sh: 5,209; yacc: 470; makefile: 419; lex: 38
file content (292 lines) | stat: -rw-r--r-- 7,634 bytes parent folder | download
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
#                                               -*- Autoconf -*-
# SPDX-License-Identifier: LGPL-2.1-only
# Process this file with autoconf to produce a configure script.
#
#  Copyright International Business Machines Corp. 2008
#
#  Authors:	Balbir Singh <balbir@linux.vnet.ibm.com>
#
AC_PREREQ([2.69])

# In following section update all occurences of version, including soname
AC_INIT([libcgroup],[3.2.0])

AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIRS([m4])

AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects])

m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

# set library version, soname is libcgroup.so.MAJOR
AC_SUBST(LIBRARY_VERSION_MAJOR, 3)
AC_SUBST(LIBRARY_VERSION_MINOR, 2)
AC_SUBST(LIBRARY_VERSION_RELEASE, 0)

# we do not want static libraries
#AC_DISABLE_STATIC

AM_PROG_AR
LT_INIT

AC_CONFIG_SRCDIR([src])
AC_CONFIG_HEADER([config.h])

# Process command line options
AC_ARG_ENABLE([tools],
	[AS_HELP_STRING([--enable-tools],[compile libcgroup tools [default=yes]])],
	[
		if test "x$enableval" = xno; then
			with_tools=false
		else
			with_tools=true
		fi
	],
	[with_tools=true])
AM_CONDITIONAL([WITH_TOOLS], [test x$with_tools = xtrue])

AC_ARG_ENABLE([pam],
	[AS_HELP_STRING([--enable-pam],[compile libcgroup PAM module [default=yes]])],
	[
		if test "x$enableval" = xno; then
			with_pam=false
		else
			with_pam=true
		fi
	],
	[with_pam=true])
AM_CONDITIONAL([WITH_PAM], [test x$with_pam = xtrue])

AC_ARG_ENABLE([daemon],
	[AS_HELP_STRING([--enable-daemon],[compile libcgroup daemon [default=yes]])],
	[
		if test "x$enableval" = xno; then
			with_daemon=false
		else
			with_daemon=true
		fi
	],
	[with_daemon=true])
AM_CONDITIONAL([WITH_DAEMON], [test x$with_daemon = xtrue])

AC_ARG_ENABLE([python],
	[AS_HELP_STRING([--enable-python],
	[build the python bindings, requires cython])])
AS_IF([test "$enable_python" = yes], [
	# cython version check
	AS_IF([test "$CYTHON_VER_MAJ" -eq 0 -a "$CYTHON_VER_MIN" -lt 29], [
		AC_MSG_ERROR([python bindings require cython 0.29 or higher])
	])
	AM_PATH_PYTHON([3])
])
AM_CONDITIONAL([ENABLE_PYTHON], [test "$enable_python" = yes])
AC_DEFINE_UNQUOTED([ENABLE_PYTHON],
	[$(test "$enable_python" = yes && echo 1 || echo 0)],
	[Python bindings build flag.])

AC_ARG_ENABLE([systemd],
	[AS_HELP_STRING([--enable-systemd],[enable systemd support [default=yes]])],
	[
		if test "x$enableval" = xno; then
			with_systemd=false
		else
			with_systemd=true
		fi
	],
	[with_systemd=true])
AM_CONDITIONAL([WITH_SYSTEMD], [test x$with_systemd = xtrue])

AC_ARG_ENABLE([initscript-install],
	[AS_HELP_STRING([--enable-initscript-install],[install init scripts [default=no]])],
	[
		if test "x$enableval" = xno; then
			with_initscript_install=false
		else
			with_initscript_install=true
		fi
	],
	[with_initscript_install=false])
AM_CONDITIONAL([WITH_INITSCRIPT_INSTALL], [test x$with_initscript_install = xtrue])

socket_path="/var/run/cgred.socket"
AC_ARG_ENABLE([cgred-socket],
	[AS_HELP_STRING([--enable-cgred-socket=PATH],[specify location of cgrulesengd communication socket
		(default=/var/run/cgred.socket)])],
	[
		if test "x$enableval" = xno -o "x$enableval" = xyes; then
			AC_MSG_ERROR([Provide valid path with --enable-cgred-socket option.])
		else
			socket_path="$enableval"
		fi
	], [])
AC_DEFINE_UNQUOTED([CGRULE_CGRED_SOCKET_PATH],"$socket_path", [Cgrulesengd socket path])

pam_module_dir="$libdir/security"
AC_ARG_ENABLE([pam-module-dir],
	[AS_HELP_STRING([--enable-pam-module-dir=PATH],[specify location of libcgroup PAM module
		(default=$libdir/security)])],
	[
		if test "x$enableval" = xno -o "x$enableval" = xyes; then
			AC_MSG_ERROR([Provide valid path with --enable-pam-module-dir option.])
		else
			pam_module_dir="$enableval"
		fi
	], [])
AC_SUBST([pamlibdir],"$pam_module_dir")

AC_ARG_ENABLE([opaque-hierarchy],
	[AS_HELP_STRING([--enable-opaque-hierarchy=NAME],[specify name of a hierarchy which libcgroup should ignore, e.g. name=systemd
		(default=none)])],
	[
		if test "x$enableval" = xno -o "x$enableval" = xyes; then
			AC_MSG_ERROR([Provide name of a hierarchy.])
		else
			AC_DEFINE_UNQUOTED([OPAQUE_HIERARCHY], "$enableval",
				[Define to ignore specific hierarchy.])
		fi
	], [])

AC_ARG_ENABLE([tests],
      [AS_HELP_STRING([--enable-tests],[compile libcgroup tests [default=yes]])],
      [
		if test "x$enableval" = xno; then
			with_tests=false
		else
			with_tests=true
		fi
       ],
       [with_tests=true])
AM_CONDITIONAL([WITH_TESTS], [test x$with_tests = xtrue])

AC_ARG_ENABLE([samples],
      [AS_HELP_STRING([--enable-samples],[compile libcgroup samples C programs [default=no]])],
      [
		if test "x$enableval" = xno; then
			with_samples=false
		else
			with_samples=true
		fi
       ],
       [with_samples=false])
AM_CONDITIONAL([WITH_SAMPLES], [test x$with_samples = xtrue])

AC_ARG_ENABLE([unittests],
      [AS_HELP_STRING([--enable-unittests],[compile libcgroup unit tests [default=no]])],
      [
		if test "x$enableval" = xno; then
			with_unittests=false
		else
			with_unittests=true
		fi
       ],
       [with_unittests=false])
AM_CONDITIONAL([WITH_UNITTESTS], [test x$with_unittests = xtrue])

# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_YACC
if test "$YACC" = yacc; then
    AC_CHECK_PROG([REALLY_YACC], [yacc], [yacc])
    if test "$REALLY_YACC" = ""; then
        AC_MSG_ERROR([This program cannot be built unless a version of yacc is installed.])
    fi
fi
AM_PROG_LEX
if test "$LEX" != flex; then
    AC_MSG_ERROR([This program cannot be built unless flex is installed.])
fi
LT_INIT

# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([limits.h mntent.h stdlib.h string.h sys/mount.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_TYPE_UID_T
AC_C_INLINE
AC_TYPE_INT64_T
AC_TYPE_PID_T

# Checks for library functions.
AC_FUNC_CHOWN
AC_FUNC_GETMNTENT
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_STAT
AC_CHECK_FUNCS([getmntent hasmntopt memset mkdir rmdir strdup])

orig_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -D_GNU_SOURCE"
AC_FUNC_STRERROR_R
CFLAGS="$orig_CFLAGS"

AC_SEARCH_LIBS(
	[fts_open],
	[fts],
	[],
	[AC_MSG_ERROR([Unable to find the fts_open() function])])

if test x$with_pam = xtrue; then
	AC_CHECK_LIB(
		[pam],
		[pam_syslog],
		[
			dnl Override the default behavior of AC_CHECK_LIB,
			dnl we don't want -lpam in LIBS.
			:
		],
		[AC_MSG_ERROR([Cannot compile PAM module without libpam!])])

	AC_CHECK_HEADERS(
		[security/pam_modules.h	security/pam_modutil.h security/pam_ext.h],
		[],
		[AC_MSG_ERROR([Cannot compile PAM module without necessary
		header files!])])
fi

if test x$with_systemd = xtrue; then
       AC_CHECK_LIB([systemd],
                    [sd_bus_message_new_method_call],
                    [],
                    [AC_MSG_ERROR([Cannot compile systemd support without
		    libsystemd!])])

       AC_CHECK_HEADERS(
               [systemd/sd-bus.h],
               [],
               [AC_MSG_ERROR([Cannot compile systemd support - missing
	       systemd header files!])])
fi

AX_CODE_COVERAGE

AC_CONFIG_FILES([Makefile
	src/Makefile
	src/daemon/Makefile
	src/tools/Makefile
	src/pam/Makefile
	src/python/Makefile
	scripts/Makefile
	scripts/init.d/cgconfig
	scripts/init.d/cgred
	tests/Makefile
	tests/ftests/Makefile
	tests/gunit/Makefile
	samples/Makefile
	samples/c/Makefile
	samples/cmdline/Makefile
	samples/config/Makefile
	samples/python/Makefile
	include/Makefile
	include/libcgroup/init.h
	doc/Makefile
	doc/man/Makefile
	dist/Makefile
	libcgroup.pc])
AC_CONFIG_FILES([dist/libcgroup.spec:dist/libcgroup.spec.in])
CFLAGS="$CFLAGS -Wall"
AC_OUTPUT