Commit 235c0a3e 235c0a3eba0ba3a9406459c1b70b1321bee815d4 by Alain Magloire

First attempt to support libargp.a

1 parent dc128166
......@@ -46,7 +46,7 @@ dnl Check for headers
AC_HEADER_STDC
AC_HEADER_DIRENT
AM_C_PROTOTYPES
AC_CHECK_HEADERS(errno.h fcntl.h inttypes.h libgen.h limits.h malloc.h \
AC_CHECK_HEADERS(argp.h errno.h fcntl.h inttypes.h libgen.h limits.h malloc.h \
paths.h shadow.h stdio.h stdlib.h string.h strings.h sys/file.h syslog.h \
unistd.h)
......@@ -72,12 +72,18 @@ AC_REPLACE_FUNCS(snprintf strtok_r vasprintf strncasecmp strcasecmp)
AC_CHECK_FUNCS(mkstemp)
dnl Check for libraries
AC_CHECK_FUNCS(argp_parse)
if test x"$ac_cv_func_argp_parse" != xyes; then
AC_REPLACE_FUNCS(strndup strnlen strchrnul)
AC_SUBST(ARGPLIBS)
fi
dnl Use either PAM or CRYPT, not both.
if test x"$testpam" = x"yes"; then
AC_CHECK_HEADERS(security/pam_appl.h)
if test x"$ac_cv_header_security_pam_appl_h" = x"yes"; then
AC_CHECK_LIB(pam, pam_start, AUTHLIBS="-lpam -ldl" ac_cv_have_libpam="yes",, -ldl)
AC_CHECK_LIB(pam, pam_start,
AUTHLIBS="-lpam -ldl" ac_cv_have_libpam="yes",, -ldl)
AC_DEFINE(USE_LIBPAM)
AM_CONDITIONAL(USE_LIBPAM, test x"$ac_cv_have_libpam" != xno)
fi
......@@ -108,7 +114,8 @@ AC_CHECK_FUNC(socket, [true],
dnl Check for GNU Readline
if test x"$usereadline" = x"yes"; then
AC_CHECK_LIB(readline, readline,
AC_CHECK_HEADERS(readline/readline.h, AC_DEFINE(WITH_READLINE)))
[AC_CHECK_HEADERS(readline/readline.h, AC_DEFINE(WITH_READLINE))
LIBS="$LIBS -lreadline"])
fi
dnl Check for Berkeley DB
......