/ [pam-modules] / trunk / configure.ac
To checkout: svn checkout http://svn.gnu.org.ua/sources/pam-modules/trunk/configure.ac
Puszcza

Contents of /trunk/configure.ac

Parent Directory Parent Directory | Revision Log Revision Log


Revision 118 - (show annotations)
Sun May 13 09:48:57 2012 UTC (9 years, 2 months ago) by gray
File size: 6925 byte(s)
Revamp build system. Add pam_ldaphome module.

* configure.ac: Test for ldap.
(AC_OUTPUT): Create pam_ldaphome/Makefile.
* acinclude.m4 (PM_ENABLE): Declare PAM_COND_<item>
conditional in addition to BUILD_PAM_<item> substitution
variable.
* Makefile.am (SUBDIRS): Include most modules via
conditionally defined Makefile variables.

* lib/graypam.h (gray_env): New struct.
(gray_env_get,gray_env_free,gray_env_read)
(gray_boolean_true_p): New protos.
* lib/env.c: New file.
* lib/Makefile.am (libgraypam_la_SOURCES): Add env.c

* pam_fshadow/Makefile.am: Remove BUILD_PAM_FSHADOW
substitution.
* pam_regex/Makefile.am: Remove BUILD_PAM_REGEX
substitution.
* pam_sql/pam_sql.c (free_config, boolean_true_p)
(read_config): Remove. Use gray_env_* functions
instead. All uses updated.
* pam_regex/pam_regex.c: Fix typo.

* pam_ldaphome/Makefile.am: New file.

1 # This file is part of pam-modules. -*- autoconf -*-
2 # Copyright (C) 2005-2011 Sergey Poznyakoff
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3, or (at your option)
7 # any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License along
15 # with this program. If not, see <http://www.gnu.org/licenses/>.
16
17 AC_PREREQ(2.63)
18
19 AC_INIT(pam-modules, 1.7, bug-pam-modules@gnu.org.ua)
20 AC_CONFIG_SRCDIR(pam_fshadow/pam_fshadow.c)
21 AC_CONFIG_AUX_DIR([build-aux])
22 AM_INIT_AUTOMAKE([1.11 no-exeext tar-ustar dist-xz silent-rules])
23 AM_CONFIG_HEADER(config.h)
24
25 # Enable silent rules by default:
26 AM_SILENT_RULES([yes])
27
28 dnl Library versioning
29 AC_SUBST(VI_CURRENT,1)
30 AC_SUBST(VI_REVISION,0)
31 AC_SUBST(VI_AGE,0)
32
33 dnl Checks for programs.
34 AC_PROG_CC
35 AC_PROG_INSTALL
36
37 LT_PREREQ(2.2.5a)
38 LT_INIT
39
40 dnl Checks for libraries.
41 AC_CHECK_LIB(pam, pam_get_item,:,
42 [AC_MSG_ERROR([Required library libpam is not found])])
43
44 AC_ARG_WITH(crypt-lib,
45 AC_HELP_STRING([--with-crypt-lib=LIB],
46 [use -lLIB instead of -lcrypt]),
47 [cryptlib=$withval],
48 [cryptlib=crypt])
49
50 if test "x$cryptlib" != xno; then
51 AC_CHECK_LIB($cryptlib, crypt)
52 fi
53 AC_SUBST(PAM_MISC)
54 AH_TEMPLATE([HAVE_PAM_MISC_SETENV],[Define if pam_misc_setenv is available.])
55 AC_CHECK_LIB(pam_misc, pam_misc_setenv,
56 [PAM_MISC=-lpam_misc
57 AC_DEFINE([HAVE_PAM_MISC_SETENV],1)],:,[-lpam])
58
59 dnl Checks for header files.
60 AC_HEADER_STDC
61 AC_CHECK_HEADERS(security/pam_appl.h security/pam_modules.h,
62 :,
63 AC_MSG_ERROR([Required PAM header files not found]))
64 AC_CHECK_HEADERS(fcntl.h syslog.h unistd.h crypt.h security/_pam_aconf.h \
65 security/pam_misc.h termios.h)
66 AC_CHECK_HEADER(shadow.h,
67 [],
68 [build_fshadow=no])
69
70 dnl Checks for typedefs, structures, and compiler characteristics.
71 AC_C_CONST
72
73 AC_CHECK_HEADERS([shadow.h])
74 AC_CHECK_FUNCS(fgetspent)
75 AC_CHECK_TYPES(struct spwd, , ,
76 [ #include <shadow.h> ])
77 AC_CHECK_MEMBERS([struct spwd.sp_expire], , ,
78 [ #include <shadow.h> ])
79
80 dnl Checks for library functions.
81 AC_CHECK_FUNCS(strerror tcgetattr)
82
83 AC_CHECK_FUNC(fgetpwent,
84 [],
85 [build_fshadow=no])
86
87 PM_ENABLE(fshadow)
88 PM_ENABLE(log)
89 PM_ENABLE(regex)
90
91 # Check for SQL support
92
93 AC_ARG_WITH(mysql,
94 AC_HELP_STRING([--without-mysql],
95 [Configure to work without MySQL]),
96 [build_mysql=$withval])
97 AC_ARG_WITH(pgsql,
98 AC_HELP_STRING([--without-pgsql],
99 [Configure to work without Postgres]),
100 [build_pgsql=$withval])
101 AC_ARG_WITH(postgres,
102 AC_HELP_STRING([--without-postgres],
103 [Same as --without-pgsql]),
104 [build_pgsql=$withval])
105 AC_ARG_WITH(sql,
106 AC_HELP_STRING([--without-sql],
107 [Do not build SQL dependent modules]),
108 [build_mysql=$withval
109 build_pgsql=$withval])
110
111 if test "$build_mysql" != no; then
112 PM_CHECK_LIB(mysqlclient, mysql_real_connect, "-lm",
113 [ AC_DEFINE(USE_SQL_MYSQL,1,
114 [Define this if you are going to use MySQL])
115 AC_DEFINE(HAVE_LIBMYSQL,1,
116 [Define this if you have mysqlclient library])
117 MYSQLLIBS="$pm_cv_lib_mysqlclient"
118 SQL_MODULES="$SQL_MODULES pam_mysql.la"
119 build_mysql=yes ],
120 [ test "$build_mysql" = yes && AC_MSG_ERROR([MySQL libraries required, but not present])
121 build_mysql=no ],
122 [/usr/lib/mysql /usr/local/lib/mysql])
123 fi
124
125 if test "$build_pgsql" != no; then
126 PM_CHECK_LIB(pq, PQconnectStart, [],
127 [ save_CPPFLAGS=$CPPFLAGS
128 for dir in /usr/local/pgsql/include /usr/pgsql/include
129 do
130 CPPFLAGS="$save_CPPFLAGS -I$dir"
131 AC_CHECK_HEADER([libpq-fe.h], [break])
132 CPPFLAGS="$save_CPPFLAGS"
133 done
134 AC_DEFINE(USE_SQL_PGSQL,1,
135 [Define this if you are going to use PostgreSQL])
136 AC_DEFINE(HAVE_LIBPQ,1,
137 [Define this if you have libpq])
138 PGSQLLIBS="$pm_cv_lib_pq"
139 SQL_MODULES="$SQL_MODULES pam_pgsql.la"
140 build_pgsql=yes ],
141 [ test "$build_pgsql" = yes && AC_MSG_ERROR([PostgreSQL libraries required, but not present])
142 build_pgsql=no ],
143 [/usr/pgsql/lib /usr/local/pgsql/lib])
144 fi
145
146 AC_SUBST(MYSQLLIBS)
147 AC_SUBST(PGSQLLIBS)
148 AC_SUBST(SQL_MODULES)
149
150 # LDAP support
151 PM_ENABLE(ldaphome)
152 if test $build_ldaphome = probe; then
153 AC_CHECK_LIB(ldap, ldap_bind,
154 [build_ldaphome=yes]
155 [build_ldaphome=no])
156 fi
157
158 ## *****************
159 ## debugging support
160 ## *****************
161 AC_ARG_ENABLE(debug,
162 AC_HELP_STRING([--enable-debug], [enable debugging mode]),
163 [if test "$enableval" = yes; then
164 if test "$GCC" = yes; then
165 AC_MSG_CHECKING(whether gcc accepts -ggdb)
166 save_CFLAGS=$CFLAGS
167 CFLAGS="-ggdb -Wall"
168 AC_TRY_COMPILE([],void f(){},
169 AC_MSG_RESULT(yes),
170 [if test x"$ac_cv_prog_cc_g" = xyes; then
171 CFLAGS="-g -Wall"
172 else
173 CFLAGS=
174 fi
175 AC_MSG_RESULT(no)])
176 CFLAGS="`echo $save_CFLAGS | sed 's/-O[[0-9]]//g'` $CFLAGS"
177 AC_DEFINE_UNQUOTED([DEBUG_MODE],1,[Define to enable debugging])
178 fi
179 fi])
180
181 ## **************
182 ## Directories
183 ## **************
184 PAMDIR='$(prefix)/lib/security'
185 AC_ARG_WITH(pamdir,
186 AC_HELP_STRING([--with-pamdir=DIR],
187 [install PAM modiles in DIR (PREFIX/lib/security)]),
188 [PAMDIR=$withval])
189 AC_SUBST(PAMDIR)
190
191 ## **************
192 ## Summary
193 ## **************
194
195 AC_CONFIG_COMMANDS([status],[
196 echo ""
197 delim="-------------------------------------------------------------------"
198 echo $delim | tr '-' '*'
199 echo "Modules to build:"
200 res=
201 for module in fshadow regex log pgsql mysql ldaphome
202 do
203 modname=pam_$module
204 eval enable=\${build_$module}
205 str=`echo ${modname}" yes" | sed 's/./-/g'`
206 dstr=`echo $delim | sed "s/^$str//" | tr '-' '.'`
207 echo ${modname}$dstr $enable
208 res="$res$enable"
209 done
210 echo $delim | tr '-' '*'
211 case "$res" in
212 *yes*) ;;
213 *)
214 AC_MSG_ERROR([Nothing to build?])
215 esac
216 ],[
217 build_fshadow=$build_fshadow
218 build_regex=$build_regex
219 build_log=$build_log
220 build_pgsql=$build_pgsql
221 build_mysql=$build_mysql
222 build_ldaphome=$build_ldaphome])
223
224 AC_OUTPUT(Makefile
225 doc/Makefile
226 lib/Makefile
227 pam_fshadow/Makefile
228 pam_regex/Makefile
229 pam_log/Makefile
230 pam_sql/Makefile
231 pam_ldaphome/Makefile
232 pamck/Makefile)

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

Send suggestions and bug reports to Sergey Poznyakoff
ViewVC Help
Powered by ViewVC 1.1.20