aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2012-07-04 23:15:55 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2012-07-04 23:20:58 +0300
commitcdeaa45ab3844bf8658999c5ed4d7ad78e72b582 (patch)
treecbb4c22c18137d0fb68888f9328407e0a7845da7
parent3da6891d134048d9885b00776a36b1e6153d6a14 (diff)
downloadpam-modules-cdeaa45ab3844bf8658999c5ed4d7ad78e72b582.tar.gz
pam-modules-cdeaa45ab3844bf8658999c5ed4d7ad78e72b582.tar.bz2
Fix the congfigure script.
* acinclude.m4 (PM_ENABLE): Revamp. Change meaning of the second argument. * configure.ac: Reflect the above change. * pam_umotd/pam_umotd.c: Remove unused includes.
-rw-r--r--acinclude.m49
-rw-r--r--configure.ac84
-rw-r--r--pam_umotd/pam_umotd.c3
3 files changed, 52 insertions, 44 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 5fcbf99..9a1033f 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -17,13 +17,12 @@ AC_DEFUN([PM_ENABLE],[
AC_ARG_ENABLE($1,
AC_HELP_STRING([--disable-$1], [Disable pam_$1]),
[build_$1=$enableval],
- [build_$1=probe])
+ [build_$1=m4_if([$2],[],yes,probe)])
m4_pushdef([upmodname],translit($1, [a-z.-], [A-Z__]))
- if test $build_$1 != no; then
- build_$1=yes
- AC_SUBST([BUILD_PAM_]upmodname, ['$(]upmodname[)'])
+ m4_if([$2],[],,[if test $build_$1 != no; then
$2
- fi
+ test $build_$1 = probe && build_$1=no
+ fi])
AM_CONDITIONAL([PAM_COND_]upmodname, [test "$[]build_$1" = "yes"])
m4_popdef([upmodname])
])
diff --git a/configure.ac b/configure.ac
index b63f7b8..00047b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -81,11 +81,17 @@ AC_CHECK_MEMBERS([struct spwd.sp_expire], , ,
dnl Checks for library functions.
AC_CHECK_FUNCS(strerror tcgetattr)
-AC_CHECK_FUNC(fgetpwent,
- [],
- [build_fshadow=no])
-PM_ENABLE(fshadow)
+PM_ENABLE(fshadow,[
+ AC_CHECK_FUNC(fgetpwent,
+ [build_fshadow=yes],
+ [if $build_fshadow = yes; then
+ AC_MSG_ERROR([cannot build requested pam_fgetpwent, because the fgetpwent function is not available])
+ else
+ build_fshadow=no
+ fi])
+])
+
PM_ENABLE(log)
PM_ENABLE(regex)
@@ -110,38 +116,40 @@ AC_ARG_WITH(sql,
build_pgsql=$withval])
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="$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])
+ PM_ENABLE(mysql, [
+ 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="$pm_cv_lib_mysqlclient"
+ SQL_MODULES="$SQL_MODULES pam_mysql.la"
+ build_mysql=yes ],
+ [ test "$build_mysql" = yes && AC_MSG_ERROR([cannot build the requested module pam_mysql, because MySQL libraries are not present])
+ build_mysql=no ],
+ [/usr/lib/mysql /usr/local/lib/mysql])])
fi
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
+ PM_ENABLE(pgsql, [
+ PM_CHECK_LIB(pq, PQconnectStart, [],
+ [ save_CPPFLAGS=$CPPFLAGS
+ for dir in /usr/local/pgsql/include /usr/pgsql/include
+ do
CPPFLAGS="$save_CPPFLAGS -I$dir"
AC_CHECK_HEADER([libpq-fe.h], [break])
CPPFLAGS="$save_CPPFLAGS"
- done
- 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 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])
+ done
+ 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 libpq])
+ PGSQLLIBS="$pm_cv_lib_pq"
+ SQL_MODULES="$SQL_MODULES pam_pgsql.la"
+ build_pgsql=yes ],
+ [ test "$build_pgsql" = yes && AC_MSG_ERROR([cannot build the requested module pma_pgsql, because PostgreSQL libraries are not present])
+ build_pgsql=no ],
+ [/usr/pgsql/lib /usr/local/pgsql/lib])])
fi
AC_SUBST(MYSQLLIBS)
@@ -149,15 +157,18 @@ AC_SUBST(PGSQLLIBS)
AC_SUBST(SQL_MODULES)
# LDAP support
-PM_ENABLE(ldaphome)
-if test $build_ldaphome = probe; then
+PM_ENABLE(ldaphome,[
AC_CHECK_LIB(ldap, ldap_bind,
- [build_ldaphome=yes]
- [build_ldaphome=no])
-fi
+ [build_ldaphome=yes],
+ [if test $build_ldaphome = yes; then
+ AC_MSG_ERROR([cannot build pam_ldaphome, because the required library libldap is not found])
+ else
+ build_ldaphome=no
+ fi])
+])
#
-PM_ENABLE(umotd)
+PM_ENABLE(umotd,[
case $build_umotd in
probe)
build_umotd=$ac_cv_header_security_pam_ext_h
@@ -166,6 +177,7 @@ yes)
test $ac_cv_header_security_pam_ext_h = no && AC_MSG_ERROR([Cannot build pam_umotd, because the required header security/pam_ext.h is not present])
;;
esac
+])
## *****************
## debugging support
diff --git a/pam_umotd/pam_umotd.c b/pam_umotd/pam_umotd.c
index 2fcd2dc..d51ea8b 100644
--- a/pam_umotd/pam_umotd.c
+++ b/pam_umotd/pam_umotd.c
@@ -23,14 +23,11 @@
#include <security/pam_modules.h>
#include <security/pam_ext.h>
-#include <sys/stat.h>
#include <sys/types.h>
#include <sys/select.h>
#include <sys/wait.h>
-#include <dirent.h>
#include <unistd.h>
#include <fcntl.h>
-#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>

Return to:

Send suggestions and report system problems to the System administrator.