source: openpam/trunk/configure.ac @ 486

Last change on this file since 486 was 475, checked in by Dag-Erling Smørgrav, 8 years ago

Provide strlcmp(3) internally on systems that don't already have it.

  • Property svn:keywords set to Id
File size: 3.1 KB
Line 
1dnl $Id: configure.ac 475 2011-11-03 15:29:24Z des $
2
3AC_PREREQ([2.62])
4AC_REVISION([$Id: configure.ac 475 2011-11-03 15:29:24Z des $])
5AC_INIT([OpenPAM], [trunk], [des@des.no])
6AC_CONFIG_SRCDIR([lib/pam_start.c])
7AC_CONFIG_MACRO_DIR([m4])
8AM_INIT_AUTOMAKE([foreign])
9AM_CONFIG_HEADER([config.h])
10
11# C compiler and features
12AC_LANG(C)
13AC_PROG_CC
14AC_PROG_CC_STDC
15AC_PROG_CPP
16AC_GNU_SOURCE
17AC_C_CONST
18AC_C_RESTRICT
19AC_C_VOLATILE
20
21# libtool
22LT_PREREQ([2.2.6])
23LT_INIT([disable-static dlopen])
24
25# other programs
26AC_PROG_INSTALL
27
28LIB_MAJ=2
29AC_SUBST(LIB_MAJ)
30AC_DEFINE_UNQUOTED(LIB_MAJ, $LIB_MAJ, [OpenPAM library major number])
31
32AC_ARG_ENABLE([debug],
33    AC_HELP_STRING([--enable-debug],
34        [turn debugging on by default]),
35    AC_DEFINE(OPENPAM_DEBUG, 1, [Turn debugging on by default]))
36
37AC_ARG_ENABLE([unversioned-modules],
38    AC_HELP_STRING([--disable-unversioned-modules],
39        [support loading of unversioned modules]),
40    [AS_IF([test x"$enableval" = x"no"], [
41        AC_DEFINE(DISABLE_UNVERSIONED_MODULES,
42            1,
43            [Whether loading unversioned modules support is disabled])
44    ])])
45
46AC_ARG_WITH([modules-dir],
47    AC_HELP_STRING([--with-modules-dir=DIR],
48        [OpenPAM modules directory]),
49    [AS_IF([test x"$withval" != x"no"], [
50        OPENPAM_MODULES_DIR="$withval"
51    ], [
52        OPENPAM_MODULES_DIR="$libdir"
53    ])],
54    [OPENPAM_MODULES_DIR="$libdir"])
55AC_DEFINE_UNQUOTED(OPENPAM_MODULES_DIR,
56    "${OPENPAM_MODULES_DIR%/}/",
57    [OpenPAM modules directory])
58AC_SUBST(OPENPAM_MODULES_DIR)
59
60AC_ARG_WITH([doc],
61    AC_HELP_STRING([--with-doc], [build documentation]),
62    [],
63    [with_doc=yes])
64AM_CONDITIONAL([WITH_DOC], [test x"$with_doc" = x"yes"])
65
66AC_ARG_WITH([pam-unix],
67    AC_HELP_STRING([--with-pam-unix], [compile sample pam_unix(8) implementation]),
68    [],
69    [with_pam_unix=no])
70AM_CONDITIONAL([WITH_PAM_UNIX], [test x"$with_pam_unix" = x"yes"])
71
72AC_ARG_WITH(pamtest,
73    AC_HELP_STRING([--with-pamtest], [compile test application]),
74    [],
75    [with_pamtest=no])
76AM_CONDITIONAL([WITH_PAMTEST], [test x"$with_pamtest" = x"yes"])
77
78AC_ARG_WITH(su,
79    AC_HELP_STRING([--with-su], [compile sample su(1) implementation]),
80    [],
81    [with_su=no])
82AM_CONDITIONAL([WITH_SU], [test x"$with_su" = x"yes"])
83
84AC_CHECK_HEADERS([crypt.h])
85
86AC_CHECK_FUNCS([fpurge strlcmp])
87
88saved_LIBS="${LIBS}"
89LIBS=""
90AC_CHECK_LIB([dl], [dlopen])
91DL_LIBS="${LIBS}"
92LIBS="${saved_LIBS}"
93AC_SUBST(DL_LIBS)
94
95saved_LIBS="${LIBS}"
96LIBS=""
97AC_CHECK_LIB([crypt], [crypt])
98CRYPT_LIBS="${LIBS}"
99LIBS="${saved_LIBS}"
100AC_SUBST(CRYPT_LIBS)
101
102AC_ARG_ENABLE([developer-warnings],
103    AS_HELP_STRING([--enable-developer-warnings], [enable strict warnings (default is NO)]),
104    [CFLAGS="${CFLAGS} -Wall -Wextra"])
105AC_ARG_ENABLE([debugging-symbols],
106    AS_HELP_STRING([--enable-debugging-symbols], [enable debugging symbols (default is NO)]),
107    [CFLAGS="${CFLAGS} -O0 -g -fno-inline"])
108AC_ARG_ENABLE([werror],
109    AS_HELP_STRING([--enable-werror], [use -Werror (default is NO)]),
110    [CFLAGS="${CFLAGS} -Werror"])
111
112AC_CONFIG_FILES([
113    bin/Makefile
114    bin/pamtest/Makefile
115    bin/su/Makefile
116    include/Makefile
117    include/security/Makefile
118    lib/Makefile
119    modules/Makefile
120    modules/pam_unix/Makefile
121    modules/pam_deny/Makefile
122    modules/pam_permit/Makefile
123    doc/Makefile
124    doc/man/Makefile
125    Makefile
126])
127AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.