/ [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 63 - (show annotations)
Thu Mar 13 13:53:32 2008 UTC (13 years, 10 months ago) by gray
File size: 5717 byte(s)
* configure.ac (PAM_COMMON_INCLUDES): Add -I${top_srcdir}/lib.
(AC_OUTPUT): Add lib/Makefile.
* doc/pam-modules.texi: Document `transform' option.
* Make.rules: New file.

* lib/mem.c, lib/slist.c, lib/log.c, lib/converse.c,
lib/graypam.h, lib/Makefile.am, lib/transform.c.

* pam_regex/pam_regex.c: Implement user name transformations.

* pam_fshadow/Makefile.am, pam_sql/Makefile.am:
Add ../lib/libgraypam.la to LDADD
* pam_fshadow/pam_fshadow.c, pam_sql/pam_mysql.c,
pam_sql/pam_pgsql.c, pam_sql/pam_sql.c: Use functions from ../lib.

1 # This file is part of pam-modules. -*- autoconf -*-
2 # Copyright (C) 2005, 2006, 2007 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.53)
18
19 AC_INIT(pam-modules, 1.2, gray@gnu.org.ua)
20 AC_CONFIG_SRCDIR(pam_fshadow/pam_fshadow.c)
21 AC_CONFIG_AUX_DIR([build-aux])
22 AM_INIT_AUTOMAKE(no-exeext)
23 AM_CONFIG_HEADER(config.h)
24
25 dnl Library versioning
26 AC_SUBST(VI_CURRENT,1)
27 AC_SUBST(VI_REVISION,0)
28 AC_SUBST(VI_AGE,0)
29 AC_SUBST(PAM_COMMON_INCLUDES, '-I${top_builddir} -I${top_srcdir} -I${top_srcdir}/lib')
30
31 dnl Checks for programs.
32 AC_PROG_CC
33 AC_PROG_INSTALL
34 AM_PROG_LIBTOOL
35
36 dnl Checks for libraries.
37 AC_CHECK_LIB(crypt, crypt)
38
39 dnl Checks for header files.
40 AC_HEADER_STDC
41 AC_CHECK_HEADERS(fcntl.h syslog.h unistd.h crypt.h)
42 AC_CHECK_HEADER(shadow.h,
43 [],
44 [AC_MSG_ERROR(shadow.h is not present on your system)])
45
46 dnl Checks for typedefs, structures, and compiler characteristics.
47 AC_C_CONST
48
49 dnl Checks for library functions.
50 AC_CHECK_FUNCS(strerror)
51 AC_CHECK_FUNC(fgetspent,
52 [],
53 [AC_MSG_ERROR(fgetspent is not present on your system)])
54 AC_CHECK_FUNC(fgetpwent,
55 [],
56 [AC_MSG_ERROR(fgetspent is not present on your system)])
57
58 # Check for SQL support
59 MYSQL=probe
60 PGSQL=probe
61
62 AC_ARG_WITH(mysql,
63 AC_HELP_STRING([--without-mysql],
64 [Configure to work without MySQL]),
65 [MYSQL=$withval])
66 AC_ARG_WITH(pgsql,
67 AC_HELP_STRING([--without-pgsql],
68 [Configure to work without Postgres]),
69 [PGSQL=$withval])
70 AC_ARG_WITH(postgres,
71 AC_HELP_STRING([--without-postgres],
72 [Same as --without-pgsql]),
73 [PGSQL=$withval])
74 AC_ARG_WITH(sql,
75 AC_HELP_STRING([--without-sql],
76 [Do not build SQL dependent modules]),
77 [MYSQL=$withval
78 PGSQL=$withval])
79
80 if test "$MYSQL" != no; then
81 RA_CHECK_LIB(mysqlclient, mysql_real_connect, "-lm",
82 [ AC_DEFINE(USE_SQL_MYSQL,1,
83 [Define this if you are going to use MySQL])
84 AC_DEFINE(HAVE_LIBMYSQL,1,
85 [Define this if you have mysqlclient library])
86 MYSQLLIBS="$ra_cv_lib_mysqlclient"
87 SQL_MODULES="$SQL_MODULES pam_mysql.la" ],
88 [ test "$MYSQL" = yes && AC_MSG_ERROR([MySQL libraries required, but not present])
89 MYSQL=no ],
90 [/usr/local/lib/mysql /usr/lib/mysql])
91 fi
92
93 if test "$PGSQL" != no; then
94 RA_CHECK_LIB(pq, PQconnectStart, [],
95 [ save_CPPFLAGS=$CPPFLAGS
96 for dir in /usr/local/pgsql/include /usr/pgsql/include
97 do
98 CPPFLAGS="$save_CPPFLAGS -I$dir"
99 AC_CHECK_HEADER([libpq-fe.h], [break])
100 CPPFLAGS="$save_CPPFLAGS"
101 done
102 AC_DEFINE(USE_SQL_PGSQL,1,
103 [Define this if you are going to use PostgreSQL])
104 AC_DEFINE(HAVE_LIBPQ,1,
105 [Define this if you have libp])
106 PGSQLLIBS="$ra_cv_lib_pq"
107 SQL_MODULES="$SQL_MODULES pam_pgsql.la" ],
108 [ test "$PGSQL" = yes && AC_MSG_ERROR([PostgreSQL libraries required, but not present])
109 PGSQL=no ],
110 [/usr/local/pgsql/lib /usr/pgsql/lib])
111 fi
112
113 AC_SUBST(MYSQLLIBS)
114 AC_SUBST(PGSQLLIBS)
115 AC_SUBST(SQL_MODULES)
116
117 ## *****************
118 ## debugging support
119 ## *****************
120 AC_ARG_ENABLE(debug,
121 AC_HELP_STRING([--enable-debug], [enable debugging mode]),
122 [if test "$enableval" = yes; then
123 if test "$GCC" = yes; then
124 AC_MSG_CHECKING(whether gcc accepts -ggdb)
125 save_CFLAGS=$CFLAGS
126 CFLAGS="-ggdb -Wall"
127 AC_TRY_COMPILE([],void f(){},
128 AC_MSG_RESULT(yes),
129 [if test x"$ac_cv_prog_cc_g" = xyes; then
130 CFLAGS="-g -Wall"
131 else
132 CFLAGS=
133 fi
134 AC_MSG_RESULT(no)])
135 CFLAGS="`echo $save_CFLAGS | sed 's/-O[[0-9]]//g'` $CFLAGS"
136 AC_DEFINE_UNQUOTED([DEBUG_MODE],1,[Define to enable debugging])
137 fi
138 fi])
139
140 ## **************
141 ## Directories
142 ## **************
143 PAMDIR='$(prefix)/lib/security'
144 AC_ARG_WITH(pamdir,
145 AC_HELP_STRING([--with-pamdir=DIR],
146 [install PAM modiles in DIR (PREFIX/lib/security)]),
147 [PAMDIR=$withval])
148 AC_SUBST(PAMDIR)
149
150 ## **************
151 ## Summary
152 ## **************
153
154 AC_CONFIG_COMMANDS([status],[
155 echo ""
156 delim="-------------------------------------------------------------------"
157 echo $delim | tr '-' '*'
158 echo "Modules to build:"
159 for module in fshadow regex log pgsql mysql
160 do
161 modname=pam_$module
162 eval enable=\${enable_$module}
163 str=`echo ${modname}" yes" | sed 's/./-/g'`
164 dstr=`echo $delim | sed "s/^$str//" | tr '-' '.'`
165 echo ${modname}$dstr $enable
166 done
167 echo $delim | tr '-' '*'
168 ],[
169 enable_fshadow=yes
170 enable_regex=yes
171 enable_log=yes
172 if test "$PGSQL" = no; then
173 enable_pgsql=no
174 else
175 enable_pgsql=yes
176 fi
177 if test "$MYSQL" = no; then
178 enable_mysql=no
179 else
180 enable_mysql=yes
181 fi])
182
183 AC_OUTPUT(Makefile
184 doc/Makefile
185 lib/Makefile
186 pam_fshadow/Makefile
187 pam_regex/Makefile
188 pam_log/Makefile
189 pam_sql/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