diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-02-17 14:48:58 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-02-17 14:48:58 +0000 |
commit | d1ae7a52a3b5cda4c6844121e53ebb913e66c76a (patch) | |
tree | ec05e6a51bf24d482276b0e274fe3630b652c17b | |
parent | bde5c28e08498b70bfb9f27de0bb94fdb9b87640 (diff) | |
download | pam-modules-d1ae7a52a3b5cda4c6844121e53ebb913e66c76a.tar.gz pam-modules-d1ae7a52a3b5cda4c6844121e53ebb913e66c76a.tar.bz2 |
Fix configure script
* pam_fshadow/Makefile.am: Build the module conditionally.
* pam_regex/Makefile.am: Likewise.
* pam_log/Makefile.am: Likewise.
* NEWS, README: Update.
* configure.ac: Raise version number to 1.5. Update bug-report
address.
Add options for disabling fshadow, log and regex.
* acinclude.m4: Prefix all macros with PM_
(PM_CHECK_LIB): Rewrite.
git-svn-id: file:///svnroot/pam-modules/trunk@98 56984be4-0537-0410-a56c-fcb268c96130
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | NEWS | 23 | ||||
-rw-r--r-- | README | 15 | ||||
-rw-r--r-- | acinclude.m4 | 97 | ||||
-rw-r--r-- | configure.ac | 95 | ||||
-rw-r--r-- | pam_fshadow/Makefile.am | 6 | ||||
-rw-r--r-- | pam_log/Makefile.am | 6 | ||||
-rw-r--r-- | pam_regex/Makefile.am | 6 |
9 files changed, 176 insertions, 86 deletions
@@ -1,3 +1,15 @@ +2009-02-17 Sergey Poznyakoff <gray@gnu.org.ua> + + * pam_fshadow/Makefile.am: Build the module conditionally. + * pam_regex/Makefile.am: Likewise. + * pam_log/Makefile.am: Likewise. + * NEWS, README: Update. + * configure.ac: Raise version number to 1.5. Update bug-report + address. + Add options for disabling fshadow, log and regex. + * acinclude.m4: Prefix all macros with PM_ + (PM_CHECK_LIB): Rewrite. + 2008-03-20 Sergey Poznyakoff <gray@gnu.org.ua> * configure.ac, NEWS: Version 1.4 diff --git a/Makefile.am b/Makefile.am index 7885d82..40c2229 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (C) 2001, 2006, 2008 Sergey Poznyakoff +# Copyright (C) 2001, 2006, 2008, 2009 Sergey Poznyakoff # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -1,8 +1,25 @@ -pam-modules -- history of user-visible changes. 2008-03-20 -Copyright (C) 2001,2004,2005,2007,2008 Sergey Poznyakoff +pam-modules -- history of user-visible changes. 2009-02-17 +Copyright (C) 2001,2004,2005,2007,2008,2009 Sergey Poznyakoff See the end of file for copying conditions. Please send radius bug reports to <bug-pam-modules@gnu.org.ua> + + +Version 1.5, 2009-02-17 + +* Configure + +New command line options: + + --disable-fshadow + --disable-log + --disable-regex + +Improved autodetection of MySQL and PostgreSQL libraries. + +Missing prerequisites for any module cause disabling of that module, +but the configuration process continues. + Version 1.4, 2008-03-20 @@ -81,7 +98,7 @@ Version 0.1 ========================================================================= Copyright information: -Copyright (C) 2001,2004,2005,2007,2008 Sergey Poznyakoff +Copyright (C) 2001,2004,2005,2007,2008,2009 Sergey Poznyakoff Permission is granted to anyone to make or distribute verbatim copies of this document as received, in any medium, provided that the @@ -1,5 +1,5 @@ PAM-modules README -Copyright (C) 2001, 2004, 2005, 2007 Sergey Poznyakoff +Copyright (C) 2001, 2004, 2005, 2007, 2009 Sergey Poznyakoff See the end of file for copying conditions. * Introduction @@ -32,7 +32,16 @@ The applications-specific options are: --with-pamdir=DIR Set installation directory for PAM loadable files. - Default is PREFIX/lib/security + Default is PREFIX/lib/security. + + --disable-fshadow + Disable pam_fshadow module. + + --disable-log + Disable pam_log module. + + --disable-regex + Disable pam_regex module. --without-mysql Do not build pam_mysql @@ -64,7 +73,7 @@ Send bug reports to <bug-pam-modules@gnu.org.ua>. Read the chapter * Copyright information: -Copyright (C) 2001, 2004, 2005, 2007 Sergey Poznyakoff +Copyright (C) 2001, 2004, 2005, 2007, 2009 Sergey Poznyakoff Permission is granted to anyone to make or distribute verbatim copies of this document as received, in any medium, provided that the diff --git a/acinclude.m4 b/acinclude.m4 index dd62724..fca20dd 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1,19 +1,47 @@ -dnl RA_FLUSHLEFT -- remove all whitespace at the beginning of lines +# Copyright (C) 2001, 2006, 2008, 2009 Sergey Poznyakoff +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. + +AC_DEFUN([PM_ENABLE],[ + AC_ARG_ENABLE($1, + AC_HELP_STRING([--disable-$1], [Disable pam_$1]), + [if test $build_$1 = probe; then + build_$1=$enableval + fi]) + if test $build_$1 != no; then + build_$1=yes + m4_pushdef([upmodname],[PAM_]translit($1, [a-z.-], [A-Z__])) + AC_SUBST([BUILD_]upmodname, ['$(]upmodname[)']) + $2 + fi]) + +dnl PM_FLUSHLEFT -- remove all whitespace at the beginning of lines dnl This is useful for c-code which may include cpp statements dnl -define([RA_FLUSHLEFT], +define([PM_FLUSHLEFT], [changequote(`,')dnl patsubst(`$1', `^[ ]+') changequote([,])])dnl -dnl RA_RESULT_ACTIONS -- generate shell code for the result of a test +dnl PM_RESULT_ACTIONS -- generate shell code for the result of a test dnl $1 -- CVAR -- cache variable to check dnl $2 -- NAME -- if not empty, used to generate a default value TRUE: dnl `AC_DEFINE(HAVE_NAME)' dnl $2 -- TRUE -- what to do if the CVAR is not `no' dnl $3 -- FALSE -- what to do otherwise; defaults to `:' dnl -AC_DEFUN([RA_RESULT_ACTIONS], [ +AC_DEFUN([PM_RESULT_ACTIONS], [ [if test "$$1" != "" -a "$$1" != no; then ]ifelse([$3], , [AC_DEFINE(HAVE_]translit($2, [a-z ./<>], [A-Z___])[,1,[FIXME])], @@ -22,7 +50,7 @@ else ]ifelse([$4], , [:], [$4])[ fi]])dnl -dnl RA_CHECK_STRUCT_FIELD -- See if a structure has a particular field +dnl PM_CHECK_STRUCT_FIELD -- See if a structure has a particular field dnl $1 - NAME -- name of structure dnl $2 - FIELD -- name of field to test dnl $3 - INCLS -- C program text to inculde necessary files for testing @@ -34,14 +62,14 @@ dnl NOTE: We still don't use AC_CHECK_MEMBERS, since it has (as of dnl autoconf 2.53) a bug which prevents it from recognizing members dnl of aggregate type. -AC_DEFUN([RA_CHECK_STRUCT_FIELD], [ - define([ra_CVAR], [ra_cv_struct_]translit($1_$2, [A-Z], [a-z]))dnl - AC_CACHE_CHECK([whether struct $1 has $2 field], ra_CVAR, - AC_TRY_COMPILE(RA_FLUSHLEFT([$3]), - [struct $1 ra_x; int ra_y = sizeof ra_x.$2;], - ra_CVAR[=yes], ra_CVAR[=no])) - RA_RESULT_ACTIONS(ra_CVAR, [$1_$2], [$4], [$5])dnl - undefine([ra_CVAR])])dnl +AC_DEFUN([PM_CHECK_STRUCT_FIELD], [ + define([pm_CVAR], [pm_cv_struct_]translit($1_$2, [A-Z], [a-z]))dnl + AC_CACHE_CHECK([whether struct $1 has $2 field], pm_CVAR, + AC_TRY_COMPILE(PM_FLUSHLEFT([$3]), + [struct $1 pm_x; int pm_y = sizeof pm_x.$2;], + pm_CVAR[=yes], pm_CVAR[=no])) + PM_RESULT_ACTIONS(pm_CVAR, [$1_$2], [$4], [$5])dnl + undefine([pm_CVAR])])dnl dnl Arguments: dnl $1 -- Library to look for @@ -50,22 +78,31 @@ dnl $3 -- Any additional libraries that might be needed dnl $4 -- Action to be taken when test succeeds dnl $5 -- Action to be taken when test fails dnl $6 -- Directories where the library may reside -AC_DEFUN([RA_CHECK_LIB], -[ - save_LIBS=$LIBS - AC_CACHE_CHECK([for -l$1], ra_cv_lib_$1, - [ - for path in $6 - do - LIBS="$save_LIBS -L$path" - AC_CHECK_LIB($1, $2, - [ra_cv_lib_$1="$3 -L$path -l$1" - break], - [ra_cv_lib_$1=no],$3) - done - ]) - RA_RESULT_ACTIONS([ra_cv_lib_$1],[LIB$1],[$4],[$5]) - LIBS=$save_LIBS -]) +AC_DEFUN([PM_CHECK_LIB], +[m4_ifval([$4], , [AH_CHECK_LIB([$1])])dnl +AS_VAR_PUSHDEF([pm_Lib], [pm_cv_lib_$1])dnl +AC_CACHE_CHECK([for $2 in -l$1], [pm_Lib], +[AS_VAR_SET([pm_Lib], [no]) + pm_check_lib_save_LIBS=$LIBS + for path in "" $6 + do + if test -n "$path"; then + pm_ldflags="-L$path -l$1 $3" + else + pm_ldflags="-l$1 $3" + fi + LIBS="$pm_ldflags $pm_check_lib_save_LIBS" + AC_LINK_IFELSE([AC_LANG_CALL([], [$2])], + [AS_VAR_SET([pm_Lib], ["$pm_ldflags"]) + break]) + done + LIBS=$pm_check_lib_save_LIBS]) +AS_IF([test "AS_VAR_GET([pm_Lib])" != no], + [m4_default([$4], [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_LIB$1)) + LIBS="-l$1 $LIBS" +])], + [$5])dnl +AS_VAR_POPDEF([pm_Lib])dnl +])# PM_CHECK_LIB diff --git a/configure.ac b/configure.ac index 6068d19..20bbb58 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ # This file is part of pam-modules. -*- autoconf -*- -# Copyright (C) 2005, 2006, 2007, 2008 Sergey Poznyakoff +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Sergey Poznyakoff # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ AC_PREREQ(2.53) -AC_INIT(pam-modules, 1.4, gray@gnu.org.ua) +AC_INIT(pam-modules, 1.5, bug-pam-modules@gnu.org.ua) AC_CONFIG_SRCDIR(pam_fshadow/pam_fshadow.c) AC_CONFIG_AUX_DIR([build-aux]) AM_INIT_AUTOMAKE(no-exeext) @@ -27,7 +27,13 @@ AC_SUBST(VI_CURRENT,1) AC_SUBST(VI_REVISION,0) AC_SUBST(VI_AGE,0) AC_SUBST(PAM_COMMON_INCLUDES, '-I${top_builddir} -I${top_srcdir} -I${top_srcdir}/lib') - + +dnl Modules +build_fshadow=probe +build_regex=probe +build_log=probe +build_pgsql=probe + dnl Checks for programs. AC_PROG_CC AC_PROG_INSTALL @@ -51,7 +57,7 @@ AC_CHECK_HEADERS(security/pam_appl.h security/pam_modules.h, AC_CHECK_HEADERS(fcntl.h syslog.h unistd.h crypt.h security/_pam_aconf.h) AC_CHECK_HEADER(shadow.h, [], - [AC_MSG_ERROR(shadow.h is not present on your system)]) + [build_fshadow=no]) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST @@ -60,48 +66,51 @@ dnl Checks for library functions. AC_CHECK_FUNCS(strerror) AC_CHECK_FUNC(fgetspent, [], - [AC_MSG_ERROR(fgetspent is not present on your system)]) + [build_fshadow=no]) AC_CHECK_FUNC(fgetpwent, [], - [AC_MSG_ERROR(fgetspent is not present on your system)]) + [build_fshadow=no]) + +PM_ENABLE(fshadow) +PM_ENABLE(log) +PM_ENABLE(regex) # Check for SQL support -MYSQL=probe -PGSQL=probe AC_ARG_WITH(mysql, AC_HELP_STRING([--without-mysql], [Configure to work without MySQL]), - [MYSQL=$withval]) + [build_mysql=$withval]) AC_ARG_WITH(pgsql, AC_HELP_STRING([--without-pgsql], [Configure to work without Postgres]), - [PGSQL=$withval]) + [build_pgsql=$withval]) AC_ARG_WITH(postgres, AC_HELP_STRING([--without-postgres], [Same as --without-pgsql]), - [PGSQL=$withval]) + [build_pgsql=$withval]) AC_ARG_WITH(sql, AC_HELP_STRING([--without-sql], [Do not build SQL dependent modules]), - [MYSQL=$withval - PGSQL=$withval]) + [build_mysql=$withval + build_pgsql=$withval]) -if test "$MYSQL" != no; then - RA_CHECK_LIB(mysqlclient, mysql_real_connect, "-lm", +if test "$build_mysql" != no; then + PM_CHECK_LIB(mysqlclient, mysql_real_connect, "-lm", [ AC_DEFINE(USE_SQL_MYSQL,1, [Define this if you are going to use MySQL]) AC_DEFINE(HAVE_LIBMYSQL,1, [Define this if you have mysqlclient library]) - MYSQLLIBS="$ra_cv_lib_mysqlclient" - SQL_MODULES="$SQL_MODULES pam_mysql.la" ], - [ test "$MYSQL" = yes && AC_MSG_ERROR([MySQL libraries required, but not present]) - MYSQL=no ], - [/usr/local/lib/mysql /usr/lib/mysql]) + MYSQLLIBS="$pm_cv_lib_mysqlclient" + SQL_MODULES="$SQL_MODULES pam_mysql.la" + build_mysql=yes ], + [ test "$build_mysql" = yes && AC_MSG_ERROR([MySQL libraries required, but not present]) + build_mysql=no ], + [/usr/lib/mysql /usr/local/lib/mysql]) fi -if test "$PGSQL" != no; then - RA_CHECK_LIB(pq, PQconnectStart, [], +if test "$build_pgsql" != no; then + PM_CHECK_LIB(pq, PQconnectStart, [], [ save_CPPFLAGS=$CPPFLAGS for dir in /usr/local/pgsql/include /usr/pgsql/include do @@ -112,12 +121,13 @@ if test "$PGSQL" != no; then AC_DEFINE(USE_SQL_PGSQL,1, [Define this if you are going to use PostgreSQL]) AC_DEFINE(HAVE_LIBPQ,1, - [Define this if you have libp]) - PGSQLLIBS="$ra_cv_lib_pq" - SQL_MODULES="$SQL_MODULES pam_pgsql.la" ], - [ test "$PGSQL" = yes && AC_MSG_ERROR([PostgreSQL libraries required, but not present]) - PGSQL=no ], - [/usr/local/pgsql/lib /usr/pgsql/lib]) + [Define this if you have libpq]) + PGSQLLIBS="$pm_cv_lib_pq" + SQL_MODULES="$SQL_MODULES pam_pgsql.la" + build_pgsql=yes ], + [ test "$build_pgsql" = yes && AC_MSG_ERROR([PostgreSQL libraries required, but not present]) + build_pgsql=no ], + [/usr/pgsql/lib /usr/local/pgsql/lib]) fi AC_SUBST(MYSQLLIBS) @@ -165,30 +175,29 @@ AC_CONFIG_COMMANDS([status],[ echo "" delim="-------------------------------------------------------------------" echo $delim | tr '-' '*' -echo "Modules to build:" +echo "Modules to build:" +res= for module in fshadow regex log pgsql mysql do modname=pam_$module - eval enable=\${enable_$module} + eval enable=\${build_$module} str=`echo ${modname}" yes" | sed 's/./-/g'` dstr=`echo $delim | sed "s/^$str//" | tr '-' '.'` echo ${modname}$dstr $enable + res="$res$enable" done echo $delim | tr '-' '*' +case "$res" in +*yes*) ;; +*) + AC_MSG_ERROR([Nothing to build?]) +esac ],[ -enable_fshadow=yes -enable_regex=yes -enable_log=yes -if test "$PGSQL" = no; then - enable_pgsql=no -else - enable_pgsql=yes -fi -if test "$MYSQL" = no; then - enable_mysql=no -else - enable_mysql=yes -fi]) +build_fshadow=$build_fshadow +build_regex=$build_regex +build_log=$build_log +build_pgsql=$build_pgsql +build_mysql=$build_mysql]) AC_OUTPUT(Makefile doc/Makefile diff --git a/pam_fshadow/Makefile.am b/pam_fshadow/Makefile.am index f996406..280a717 100644 --- a/pam_fshadow/Makefile.am +++ b/pam_fshadow/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (C) 2001, 2006, 2007, 2008 Sergey Poznyakoff +# Copyright (C) 2001, 2006, 2007, 2008, 2009 Sergey Poznyakoff # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -14,7 +14,9 @@ # with this program. If not, see <http://www.gnu.org/licenses/>. pamdir=@PAMDIR@ -pam_PROGRAMS = pam_fshadow.la +PAM_FSHADOW = pam_fshadow.la +pam_PROGRAMS = @BUILD_PAM_FSHADOW@ +EXTRA_PROGRAMS = pam_fshadow.la AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = pam_fshadow.la pam_fshadow_la_SOURCES = pam_fshadow.c LDADD = -lpam @LIBS@ ../lib/libgraypam.la diff --git a/pam_log/Makefile.am b/pam_log/Makefile.am index 80bb0bd..c3346a4 100644 --- a/pam_log/Makefile.am +++ b/pam_log/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (C) 2006, 2008 Sergey Poznyakoff +# Copyright (C) 2006, 2008, 2009 Sergey Poznyakoff # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -14,7 +14,9 @@ # with this program. If not, see <http://www.gnu.org/licenses/>. pamdir=@PAMDIR@ -pam_PROGRAMS = pam_log.la +PAM_LOG = pam_log.la +pam_PROGRAMS = @BUILD_PAM_LOG@ +EXTRA_PROGRAMS = pam_log.la AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = pam_log.la pam_log_la_SOURCES = pam_log.c LDADD = -lpam ../lib/libgraypam.la diff --git a/pam_regex/Makefile.am b/pam_regex/Makefile.am index a29daec..b5a9c0f 100644 --- a/pam_regex/Makefile.am +++ b/pam_regex/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (C) 2001, 2006, 2008 Sergey Poznyakoff +# Copyright (C) 2001, 2006, 2008, 2009 Sergey Poznyakoff # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -14,7 +14,9 @@ # with this program. If not, see <http://www.gnu.org/licenses/>. pamdir=@PAMDIR@ -pam_PROGRAMS = pam_regex.la +PAM_REGEX = pam_regex.la +pam_PROGRAMS = @BUILD_PAM_REGEX@ +EXTRA_PROGRAMS = pam_regex.la pam_regex_la_SOURCES = pam_regex.c pam_regex_la_LDADD = ../lib/libgraypam.la AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = pam_regex.la |