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

Annotation of /trunk/configure.ac

Parent Directory Parent Directory | Revision Log Revision Log


Revision 118 - (hide annotations)
Sun May 13 09:48:57 2012 UTC (9 years, 4 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 gray 16 # This file is part of pam-modules. -*- autoconf -*-
2 gray 113 # Copyright (C) 2005-2011 Sergey Poznyakoff
3 gray 16 #
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 gray 50 # the Free Software Foundation; either version 3, or (at your option)
7 gray 16 # 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 gray 50 # 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 gray 16
17 gray 114 AC_PREREQ(2.63)
18 gray 2
19 gray 114 AC_INIT(pam-modules, 1.7, bug-pam-modules@gnu.org.ua)
20 gray 2 AC_CONFIG_SRCDIR(pam_fshadow/pam_fshadow.c)
21 gray 19 AC_CONFIG_AUX_DIR([build-aux])
22 gray 114 AM_INIT_AUTOMAKE([1.11 no-exeext tar-ustar dist-xz silent-rules])
23 gray 2 AM_CONFIG_HEADER(config.h)
24    
25 gray 114 # Enable silent rules by default:
26     AM_SILENT_RULES([yes])
27    
28 gray 28 dnl Library versioning
29     AC_SUBST(VI_CURRENT,1)
30     AC_SUBST(VI_REVISION,0)
31     AC_SUBST(VI_AGE,0)
32 gray 98
33 gray 2 dnl Checks for programs.
34     AC_PROG_CC
35     AC_PROG_INSTALL
36    
37 gray 105 LT_PREREQ(2.2.5a)
38     LT_INIT
39    
40 gray 2 dnl Checks for libraries.
41 gray 90 AC_CHECK_LIB(pam, pam_get_item,:,
42     [AC_MSG_ERROR([Required library libpam is not found])])
43 gray 117
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 gray 90 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 gray 2 dnl Checks for header files.
60     AC_HEADER_STDC
61 gray 90 AC_CHECK_HEADERS(security/pam_appl.h security/pam_modules.h,
62     :,
63     AC_MSG_ERROR([Required PAM header files not found]))
64 gray 106 AC_CHECK_HEADERS(fcntl.h syslog.h unistd.h crypt.h security/_pam_aconf.h \
65     security/pam_misc.h termios.h)
66 gray 2 AC_CHECK_HEADER(shadow.h,
67     [],
68 gray 98 [build_fshadow=no])
69 gray 2
70     dnl Checks for typedefs, structures, and compiler characteristics.
71     AC_C_CONST
72    
73 gray 107 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 gray 2 dnl Checks for library functions.
81 gray 102 AC_CHECK_FUNCS(strerror tcgetattr)
82 gray 107
83 gray 2 AC_CHECK_FUNC(fgetpwent,
84     [],
85 gray 98 [build_fshadow=no])
86 gray 2
87 gray 98 PM_ENABLE(fshadow)
88     PM_ENABLE(log)
89     PM_ENABLE(regex)
90    
91 gray 28 # Check for SQL support
92    
93     AC_ARG_WITH(mysql,
94 gray 52 AC_HELP_STRING([--without-mysql],
95     [Configure to work without MySQL]),
96 gray 98 [build_mysql=$withval])
97 gray 55 AC_ARG_WITH(pgsql,
98     AC_HELP_STRING([--without-pgsql],
99     [Configure to work without Postgres]),
100 gray 98 [build_pgsql=$withval])
101 gray 28 AC_ARG_WITH(postgres,
102 gray 52 AC_HELP_STRING([--without-postgres],
103 gray 55 [Same as --without-pgsql]),
104 gray 98 [build_pgsql=$withval])
105 gray 39 AC_ARG_WITH(sql,
106 gray 52 AC_HELP_STRING([--without-sql],
107     [Do not build SQL dependent modules]),
108 gray 98 [build_mysql=$withval
109     build_pgsql=$withval])
110 gray 39
111 gray 98 if test "$build_mysql" != no; then
112     PM_CHECK_LIB(mysqlclient, mysql_real_connect, "-lm",
113 gray 28 [ 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 gray 98 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 gray 28 fi
124    
125 gray 98 if test "$build_pgsql" != no; then
126     PM_CHECK_LIB(pq, PQconnectStart, [],
127 gray 52 [ 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 gray 28 [Define this if you are going to use PostgreSQL])
136     AC_DEFINE(HAVE_LIBPQ,1,
137 gray 98 [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 gray 28 fi
145    
146     AC_SUBST(MYSQLLIBS)
147     AC_SUBST(PGSQLLIBS)
148     AC_SUBST(SQL_MODULES)
149 gray 58
150 gray 118 # 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 gray 58 ## *****************
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 gray 2 ## **************
182     ## Directories
183     ## **************
184     PAMDIR='$(prefix)/lib/security'
185     AC_ARG_WITH(pamdir,
186 gray 52 AC_HELP_STRING([--with-pamdir=DIR],
187     [install PAM modiles in DIR (PREFIX/lib/security)]),
188     [PAMDIR=$withval])
189 gray 2 AC_SUBST(PAMDIR)
190    
191 gray 52 ## **************
192     ## Summary
193     ## **************
194    
195     AC_CONFIG_COMMANDS([status],[
196     echo ""
197     delim="-------------------------------------------------------------------"
198     echo $delim | tr '-' '*'
199 gray 98 echo "Modules to build:"
200     res=
201 gray 118 for module in fshadow regex log pgsql mysql ldaphome
202 gray 52 do
203     modname=pam_$module
204 gray 98 eval enable=\${build_$module}
205 gray 52 str=`echo ${modname}" yes" | sed 's/./-/g'`
206     dstr=`echo $delim | sed "s/^$str//" | tr '-' '.'`
207     echo ${modname}$dstr $enable
208 gray 98 res="$res$enable"
209 gray 52 done
210     echo $delim | tr '-' '*'
211 gray 98 case "$res" in
212     *yes*) ;;
213     *)
214     AC_MSG_ERROR([Nothing to build?])
215     esac
216 gray 52 ],[
217 gray 98 build_fshadow=$build_fshadow
218     build_regex=$build_regex
219     build_log=$build_log
220     build_pgsql=$build_pgsql
221 gray 118 build_mysql=$build_mysql
222     build_ldaphome=$build_ldaphome])
223 gray 52
224 gray 2 AC_OUTPUT(Makefile
225 gray 63 doc/Makefile
226     lib/Makefile
227 gray 2 pam_fshadow/Makefile
228 gray 28 pam_regex/Makefile
229     pam_log/Makefile
230 gray 102 pam_sql/Makefile
231 gray 118 pam_ldaphome/Makefile
232 gray 102 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