Changeset 430 in openpam for trunk


Ignore:
Timestamp:
Mar 9, 2010, 5:52:12 PM (9 years ago)
Author:
Dag-Erling Smørgrav
Message:

modernize further

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r428 r430  
    11dnl $Id$
    22
    3 AC_PREREQ(2.59)
     3AC_PREREQ([2.62])
    44AC_REVISION([$Id$])
    5 AC_INIT([OpenPAM],[trunk],[des@des.no])
     5AC_INIT([OpenPAM], [trunk], [des@des.no])
    66AC_CONFIG_SRCDIR([lib/pam_start.c])
    77AC_CONFIG_MACRO_DIR([m4])
     
    99AM_CONFIG_HEADER([config.h])
    1010
     11# C compiler and features
     12AC_LANG(C)
     13AC_PROG_CC
     14AC_PROG_CC_STDC
     15AC_PROG_CPP
     16AC_GNU_SOURCE
     17AC_C_CONST
     18AC_C_RESTRICT
     19AC_C_VOLATILE
     20
     21# libtool
    1122LT_PREREQ([2.2.6])
    1223LT_INIT([disable-static dlopen])
    1324
    14 AC_LANG(C)
    15 AC_C_VOLATILE
    16 
    17 AC_PROG_CC
    18 AC_PROG_CC_STDC
    19 AC_PROG_CPP
     25# other programs
    2026AC_PROG_INSTALL
    2127
     
    2430AC_DEFINE_UNQUOTED(LIB_MAJ, $LIB_MAJ, [OpenPAM library major number])
    2531
    26 AC_ARG_ENABLE(debug,
     32AC_ARG_ENABLE([debug],
    2733        AC_HELP_STRING([--enable-debug],
    2834                [turn debugging on by default]),
    2935        AC_DEFINE(OPENPAM_DEBUG, 1, [Turn debugging on by default]))
    3036
    31 AC_MSG_CHECKING([whether loading unversioned modules support is enabled])
    32 AC_ARG_ENABLE(unversioned-modules,
     37AC_ARG_ENABLE([unversioned-modules],
    3338        AC_HELP_STRING([--disable-unversioned-modules],
    3439                [support loading of unversioned modules]),
    35         [if test "$enableval" = "no"; then
     40        [AS_IF([test x"$enableval" = x"no"], [
    3641                AC_DEFINE(DISABLE_UNVERSIONED_MODULES,
    3742                        1,
    3843                        [Whether loading unversioned modules support is disabled])
    39         fi
    40         AC_MSG_RESULT(no)],
    41         AC_MSG_RESULT(yes))
     44        ])])
    4245
    43 AC_MSG_CHECKING([for modules directory support])
    44 AC_ARG_WITH(modules-dir,
     46AC_ARG_WITH([modules-dir],
    4547        AC_HELP_STRING([--with-modules-dir=DIR],
    4648                [OpenPAM modules directory]),
    47         [if test "$withval" != "no"; then
     49        [AS_IF([test x"$withval" != x"no"], [
    4850                OPENPAM_MODULES_DIR="$withval"
    4951                AC_DEFINE_UNQUOTED(OPENPAM_MODULES_DIR,
    5052                        "$OPENPAM_MODULES_DIR",
    5153                        [OpenPAM modules directory])
    52                 AC_MSG_RESULT($OPENPAM_MODULES_DIR)
    53         else
     54        ], [
    5455                OPENPAM_MODULES_DIR="$libdir"
    55                 AC_MSG_RESULT(no)
    56         fi],
    57         [OPENPAM_MODULES_DIR="$libdir"
    58         AC_MSG_RESULT(no)])
     56        ])],
     57        [OPENPAM_MODULES_DIR="$libdir"])
    5958AC_SUBST(OPENPAM_MODULES_DIR)
    6059
    61 AC_MSG_CHECKING([whether to build the documentation])
    62 AC_ARG_WITH(doc,
    63         AC_HELP_STRING([--with-doc],
    64                 [build documentation]),
    65         ,
     60AC_ARG_WITH([doc],
     61        AC_HELP_STRING([--with-doc], [build documentation]),
     62        [],
    6663        [with_doc=yes])
    67 AC_MSG_RESULT($with_doc)
     64AM_CONDITIONAL([WITH_DOC], [test x"$with_doc" = x"yes"])
    6865
    69 AC_MSG_CHECKING([whether to build example version of pam_unix.so])
    70 AC_ARG_WITH(pam-unix,
    71         AC_HELP_STRING([--with-pam-unix],
    72                 [compile example version of pam_unix.so]),
    73         ,
     66AC_ARG_WITH([pam-unix],
     67        AC_HELP_STRING([--with-pam-unix], [compile example version of pam_unix.so]),
     68        [],
    7469        [with_pam_unix=no])
    75 AC_MSG_RESULT($with_pam_unix)
     70AM_CONDITIONAL([WITH_PAM_UNIX], [test x"$with_pam_unix" = x"yes"])
    7671
    77 AC_MSG_CHECKING([whether to build example version of su(1)])
    7872AC_ARG_WITH(su,
    79         AC_HELP_STRING([--with-su],
    80                 [compile example version of su(1)]),
    81         ,
     73        AC_HELP_STRING([--with-su], [compile example version of su(1)]),
     74        [],
    8275        [with_su=no])
    83 AC_MSG_RESULT($with_su)
     76AM_CONDITIONAL([WITH_SU], [test x"$with_su" = x"yes"])
    8477
    85 AM_CONDITIONAL(WITH_DOC, test "x$with_doc" = "xyes")
    86 AM_CONDITIONAL(WITH_PAM_UNIX, test "x$with_pam_unix" = "xyes")
    87 AM_CONDITIONAL(WITH_SU, test "x$with_su" = "xyes")
     78AC_CHECK_HEADERS([crypt.h])
    8879
    89 AC_CHECK_HEADERS(crypt.h)
     80AC_CHECK_FUNCS([fpurge])
    9081
    91 AC_CHECK_FUNCS(fpurge)
    92 
    93 DL_LIBS=
    94 AC_CHECK_LIB(dl, dlopen, DL_LIBS=-ldl)
     82saved_LIBS="${LIBS}"
     83LIBS=""
     84AC_CHECK_LIB([dl], [dlopen])
     85DL_LIBS="${LIBS}"
     86LIBS="${saved_LIBS}"
    9587AC_SUBST(DL_LIBS)
    9688
    97 CRYPT_LIBS=
    98 AC_CHECK_LIB(crypt, crypt, CRYPT_LIBS=-lcrypt)
     89saved_LIBS="${LIBS}"
     90LIBS=""
     91AC_CHECK_LIB([crypt], [crypt])
     92CRYPT_LIBS="${LIBS}"
     93LIBS="${saved_LIBS}"
    9994AC_SUBST(CRYPT_LIBS)
    10095
    101 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
    102 
    103 AC_ARG_ENABLE(developer-warnings,
    104         AS_HELP_STRING([--enable-developer-warnings],[enable strict warnings (default is NO)]),
    105         CFLAGS="${CFLAGS} -Wall -Wextra")
    106 AC_ARG_ENABLE(debugging-symbols,
    107         AS_HELP_STRING([--enable-debugging-symbols],[enable debugging symbols (default is NO)]),
    108         CFLAGS="${CFLAGS} -O0 -g -fno-inline")
    109 AC_ARG_ENABLE(werror,
    110         AS_HELP_STRING([--enable-werror],[use -Werror (default is NO)]),
    111         CFLAGS="${CFLAGS} -Werror")
     96AC_ARG_ENABLE([developer-warnings],
     97        AS_HELP_STRING([--enable-developer-warnings], [enable strict warnings (default is NO)]),
     98        [CFLAGS="${CFLAGS} -Wall -Wextra"])
     99AC_ARG_ENABLE([debugging-symbols],
     100        AS_HELP_STRING([--enable-debugging-symbols], [enable debugging symbols (default is NO)]),
     101        [CFLAGS="${CFLAGS} -O0 -g -fno-inline"])
     102AC_ARG_ENABLE([werror],
     103        AS_HELP_STRING([--enable-werror], [use -Werror (default is NO)]),
     104        [CFLAGS="${CFLAGS} -Werror"])
    112105
    113106AC_CONFIG_FILES([
Note: See TracChangeset for help on using the changeset viewer.