diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-07-04 23:15:55 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-07-04 23:20:58 +0300 |
commit | cdeaa45ab3844bf8658999c5ed4d7ad78e72b582 (patch) | |
tree | cbb4c22c18137d0fb68888f9328407e0a7845da7 /configure.ac | |
parent | 3da6891d134048d9885b00776a36b1e6153d6a14 (diff) | |
download | pam-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.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 84 |
1 files changed, 48 insertions, 36 deletions
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 |