# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. # # Copyright International Business Machines Corp. 2008 # # Authors: Balbir Singh # This program is free software; you can redistribute it and/or modify it # under the terms of version 2.1 of the GNU Lesser General Public License # as published by the Free Software Foundation. # # This program is distributed in the hope that it would be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # AC_PREREQ(2.61) # In following section update all occurences of version, including soname AC_INIT([libcgroup], 0.41) AM_INIT_AUTOMAKE([foreign dist-bzip2]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) # set library version, soname is libcgroup.so.MAJOR AC_SUBST(LIBRARY_VERSION_MAJOR, 1) AC_SUBST(LIBRARY_VERSION_MINOR, 0) AC_SUBST(LIBRARY_VERSION_RELEASE, 41) # we do not want static libraries AC_DISABLE_STATIC AC_CONFIG_SRCDIR([src]) AC_CONFIG_HEADER([config.h]) AC_ARG_ENABLE([bindings], [AC_HELP_STRING([--enable-bindings], [enable python bindings [default=no]])], [ if test "x$enableval" = xno; then with_bindings=false else with_bindings=true fi ], [with_bindings = false]) AM_CONDITIONAL([WITH_BINDINGS], [test x$with_bindings = xtrue]) # Process command line options AC_ARG_ENABLE([tools], [AC_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], [AC_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], [AC_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([initscript-install], [AC_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], [AC_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], [AC_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], [AC_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 ], []) # 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 AC_PROG_LIBTOOL # 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]) 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 AC_CONFIG_FILES([Makefile tests/Makefile tests/tools/testenv.sh tests/tools/Makefile tests/tools/cgconfigparser/Makefile tests/tools/cgclassify/Makefile tests/tools/multimount/Makefile tests/runlibcgrouptest.sh src/Makefile src/daemon/Makefile src/tools/Makefile src/pam/Makefile src/bindings/Makefile scripts/Makefile scripts/init.d/cgconfig scripts/init.d/cgred samples/Makefile include/Makefile doc/Makefile doc/man/Makefile dist/Makefile libcgroup.pc]) AC_CONFIG_FILES([dist/libcgroup.spec:dist/libcgroup.spec.in]) CFLAGS="$CFLAGS -Wall" AC_OUTPUT