2
# Process this file with autoconf to produce a configure script.
4
# Copyright International Business Machines Corp. 2008
6
# Authors: Balbir Singh <balbir@linux.vnet.ibm.com>
7
# This program is free software; you can redistribute it and/or modify it
8
# under the terms of version 2.1 of the GNU Lesser General Public License
9
# as published by the Free Software Foundation.
11
# This program is distributed in the hope that it would be useful, but
12
# WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
# In following section update all occurences of version, including soname
18
AC_INIT([libcgroup], 0.34,
19
[http://sourceforge.net/tracker/?group_id=218421&atid=1043649])
20
AM_INIT_AUTOMAKE([foreign dist-bzip2])
21
# set library version, soname is libcgroup.so.MAJOR
22
AC_SUBST(LIBRARY_VERSION_MAJOR, 1)
23
AC_SUBST(LIBRARY_VERSION_MINOR, 0)
24
AC_SUBST(LIBRARY_VERSION_RELEASE, 34)
26
# we do not want static libraries
29
AC_CONFIG_SRCDIR([src])
30
AC_CONFIG_HEADER([config.h])
32
# Process command line options
33
AC_ARG_ENABLE([debug],
34
[AC_HELP_STRING([--enable-debug],
35
[enable extra debugging output [default=no]])],
36
[AC_DEFINE([CGROUP_DEBUG], [],
37
[Define to enable extra debugging output.])],
40
AC_ARG_ENABLE([tools],
41
[AC_HELP_STRING([--enable-tools],
42
[compile libcgroup tools [default=yes]])],
44
if test "x$enableval" = xno; then
51
AM_CONDITIONAL([WITH_TOOLS], [test x$with_tools = xtrue])
54
[AC_HELP_STRING([--enable-pam],
55
[compile libcgroup PAM module [default=yes]])],
57
if test "x$enableval" = xno; then
64
AM_CONDITIONAL([WITH_PAM], [test x$with_pam = xtrue])
66
AC_ARG_ENABLE([daemon],
67
[AC_HELP_STRING([--enable-daemon],
68
[compile libcgroup daemon [default=yes]])],
70
if test "x$enableval" = xno; then
77
AM_CONDITIONAL([WITH_DAEMON], [test x$with_daemon = xtrue])
79
socket_path="/var/run/cgred.socket"
80
AC_ARG_ENABLE([cgred-socket],
81
[AC_HELP_STRING([--enable-cgred-socket=PATH],
82
specify location of cgrulesengd communication socket
83
(default=/var/run/cgred.socket))],
85
if test "x$enableval" = xno -o "x$enableval" = xyes; then
86
AC_MSG_ERROR([Provide valid path with --enable-cgred-socket option.])
88
socket_path="$enableval"
91
AC_DEFINE_UNQUOTED([CGRULE_CGRED_SOCKET_PATH],"$socket_path", [Cgrulesengd socket path])
93
# Checks for programs.
97
if test "$YACC" = yacc; then
98
AC_CHECK_PROG([REALLY_YACC], [yacc], [yacc])
99
if test "$REALLY_YACC" = ""; then
100
AC_MSG_ERROR([This program cannot be built unless a version of yacc is installed.])
104
if test "$LEX" != flex; then
105
AC_MSG_ERROR([This program cannot be built unless flex is installed.])
109
# Checks for header files.
112
AC_CHECK_HEADERS([limits.h mntent.h stdlib.h string.h sys/mount.h unistd.h])
114
# Checks for typedefs, structures, and compiler characteristics.
122
# Checks for library functions.
128
AC_CHECK_FUNCS([getmntent hasmntopt memset mkdir rmdir strdup])
130
if test x$with_pam = xtrue; then
135
[AC_MSG_ERROR([Cannot compile PAM module without libpam!])])
138
[security/pam_modules.h security/pam_modutil.h security/pam_ext.h],
140
[AC_MSG_ERROR([Cannot compile PAM module without necessary
144
AC_CONFIG_FILES([Makefile
151
scripts/init.d/cgconfig
158
AC_CONFIG_FILES([dist/libcgroup.spec:dist/libcgroup.spec.in])
159
CFLAGS="$CFLAGS -Wall"