~ubuntu-branches/ubuntu/maverick/libcgroup/maverick-proposed

« back to all changes in this revision

Viewing changes to configure.in

  • Committer: Bazaar Package Importer
  • Author(s): Dustin Kirkland
  • Date: 2009-08-26 11:29:17 UTC
  • Revision ID: james.westby@ubuntu.com-20090826112917-402ews2uj6v350d2
Tags: upstream-0.34
ImportĀ upstreamĀ versionĀ 0.34

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#                                               -*- Autoconf -*-
 
2
# Process this file with autoconf to produce a configure script.
 
3
 
4
#  Copyright International Business Machines Corp. 2008
 
5
 
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.
 
10
 
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.
 
14
#
 
15
AC_PREREQ(2.61)
 
16
 
 
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)
 
25
 
 
26
# we do not want static libraries
 
27
AC_DISABLE_STATIC
 
28
 
 
29
AC_CONFIG_SRCDIR([src])
 
30
AC_CONFIG_HEADER([config.h])
 
31
 
 
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.])],
 
38
        [])
 
39
 
 
40
AC_ARG_ENABLE([tools],
 
41
        [AC_HELP_STRING([--enable-tools],
 
42
                [compile libcgroup tools [default=yes]])],
 
43
        [
 
44
                if test "x$enableval" = xno; then
 
45
                        with_tools=false
 
46
                else
 
47
                        with_tools=true
 
48
                fi
 
49
        ],
 
50
        [with_tools=true])
 
51
AM_CONDITIONAL([WITH_TOOLS], [test x$with_tools = xtrue])
 
52
 
 
53
AC_ARG_ENABLE([pam],
 
54
        [AC_HELP_STRING([--enable-pam],
 
55
                [compile libcgroup PAM module [default=yes]])],
 
56
        [
 
57
                if test "x$enableval" = xno; then
 
58
                        with_pam=false
 
59
                else
 
60
                        with_pam=true
 
61
                fi
 
62
        ],
 
63
        [with_pam=true])
 
64
AM_CONDITIONAL([WITH_PAM], [test x$with_pam = xtrue])
 
65
 
 
66
AC_ARG_ENABLE([daemon],
 
67
        [AC_HELP_STRING([--enable-daemon],
 
68
                [compile libcgroup daemon [default=yes]])],
 
69
        [
 
70
                if test "x$enableval" = xno; then
 
71
                        with_daemon=false
 
72
                else
 
73
                        with_daemon=true
 
74
                fi
 
75
        ],
 
76
        [with_daemon=true])
 
77
AM_CONDITIONAL([WITH_DAEMON], [test x$with_daemon = xtrue])
 
78
 
 
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))],
 
84
        [
 
85
                if test "x$enableval" = xno -o "x$enableval" = xyes; then
 
86
                        AC_MSG_ERROR([Provide valid path with --enable-cgred-socket option.])
 
87
                else
 
88
                        socket_path="$enableval"
 
89
                fi
 
90
        ], [])
 
91
AC_DEFINE_UNQUOTED([CGRULE_CGRED_SOCKET_PATH],"$socket_path", [Cgrulesengd socket path])
 
92
 
 
93
# Checks for programs.
 
94
AC_PROG_CXX
 
95
AC_PROG_CC
 
96
AC_PROG_YACC
 
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.])
 
101
    fi
 
102
fi
 
103
AM_PROG_LEX
 
104
if test "$LEX" != flex; then
 
105
    AC_MSG_ERROR([This program cannot be built unless flex is installed.])
 
106
fi
 
107
AC_PROG_LIBTOOL
 
108
 
 
109
# Checks for header files.
 
110
AC_HEADER_DIRENT
 
111
AC_HEADER_STDC
 
112
AC_CHECK_HEADERS([limits.h mntent.h stdlib.h string.h sys/mount.h unistd.h])
 
113
 
 
114
# Checks for typedefs, structures, and compiler characteristics.
 
115
AC_HEADER_STDBOOL
 
116
AC_C_CONST
 
117
AC_TYPE_UID_T
 
118
AC_C_INLINE
 
119
AC_TYPE_INT64_T
 
120
AC_TYPE_PID_T
 
121
 
 
122
# Checks for library functions.
 
123
AC_FUNC_CHOWN
 
124
AC_FUNC_GETMNTENT
 
125
AC_FUNC_MALLOC
 
126
AC_FUNC_REALLOC
 
127
AC_FUNC_STAT
 
128
AC_CHECK_FUNCS([getmntent hasmntopt memset mkdir rmdir strdup])
 
129
 
 
130
if test x$with_pam = xtrue; then
 
131
        AC_CHECK_LIB(
 
132
                [pam],
 
133
                [pam_syslog],
 
134
                [],
 
135
                [AC_MSG_ERROR([Cannot compile PAM module without libpam!])])
 
136
 
 
137
        AC_CHECK_HEADERS(
 
138
                [security/pam_modules.h security/pam_modutil.h security/pam_ext.h],
 
139
                [],
 
140
                [AC_MSG_ERROR([Cannot compile PAM module without necessary
 
141
                header files!])])
 
142
fi
 
143
 
 
144
AC_CONFIG_FILES([Makefile
 
145
        tests/Makefile
 
146
        src/Makefile
 
147
        src/daemon/Makefile
 
148
        src/tools/Makefile
 
149
        src/pam/Makefile
 
150
        scripts/Makefile
 
151
        scripts/init.d/cgconfig
 
152
        scripts/init.d/cgred
 
153
        samples/Makefile
 
154
        include/Makefile
 
155
        doc/Makefile
 
156
        doc/man/Makefile
 
157
        dist/Makefile])
 
158
AC_CONFIG_FILES([dist/libcgroup.spec:dist/libcgroup.spec.in])
 
159
CFLAGS="$CFLAGS -Wall"
 
160
AC_OUTPUT
 
161