First attempt to support libargp.a
Showing
1 changed file
with
18 additions
and
11 deletions
... | @@ -46,7 +46,7 @@ dnl Check for headers | ... | @@ -46,7 +46,7 @@ dnl Check for headers |
46 | AC_HEADER_STDC | 46 | AC_HEADER_STDC |
47 | AC_HEADER_DIRENT | 47 | AC_HEADER_DIRENT |
48 | AM_C_PROTOTYPES | 48 | AM_C_PROTOTYPES |
49 | AC_CHECK_HEADERS(errno.h fcntl.h inttypes.h libgen.h limits.h malloc.h \ | 49 | AC_CHECK_HEADERS(argp.h errno.h fcntl.h inttypes.h libgen.h limits.h malloc.h \ |
50 | paths.h shadow.h stdio.h stdlib.h string.h strings.h sys/file.h syslog.h \ | 50 | paths.h shadow.h stdio.h stdlib.h string.h strings.h sys/file.h syslog.h \ |
51 | unistd.h) | 51 | unistd.h) |
52 | 52 | ||
... | @@ -72,12 +72,18 @@ AC_REPLACE_FUNCS(snprintf strtok_r vasprintf strncasecmp strcasecmp) | ... | @@ -72,12 +72,18 @@ AC_REPLACE_FUNCS(snprintf strtok_r vasprintf strncasecmp strcasecmp) |
72 | AC_CHECK_FUNCS(mkstemp) | 72 | AC_CHECK_FUNCS(mkstemp) |
73 | 73 | ||
74 | dnl Check for libraries | 74 | dnl Check for libraries |
75 | AC_CHECK_FUNCS(argp_parse) | ||
76 | if test x"$ac_cv_func_argp_parse" != xyes; then | ||
77 | AC_REPLACE_FUNCS(strndup strnlen strchrnul) | ||
78 | AC_SUBST(ARGPLIBS) | ||
79 | fi | ||
75 | 80 | ||
76 | dnl Use either PAM or CRYPT, not both. | 81 | dnl Use either PAM or CRYPT, not both. |
77 | if test x"$testpam" = x"yes"; then | 82 | if test x"$testpam" = x"yes"; then |
78 | AC_CHECK_HEADERS(security/pam_appl.h) | 83 | AC_CHECK_HEADERS(security/pam_appl.h) |
79 | if test x"$ac_cv_header_security_pam_appl_h" = x"yes"; then | 84 | if test x"$ac_cv_header_security_pam_appl_h" = x"yes"; then |
80 | AC_CHECK_LIB(pam, pam_start, AUTHLIBS="-lpam -ldl" ac_cv_have_libpam="yes",, -ldl) | 85 | AC_CHECK_LIB(pam, pam_start, |
86 | AUTHLIBS="-lpam -ldl" ac_cv_have_libpam="yes",, -ldl) | ||
81 | AC_DEFINE(USE_LIBPAM) | 87 | AC_DEFINE(USE_LIBPAM) |
82 | AM_CONDITIONAL(USE_LIBPAM, test x"$ac_cv_have_libpam" != xno) | 88 | AM_CONDITIONAL(USE_LIBPAM, test x"$ac_cv_have_libpam" != xno) |
83 | fi | 89 | fi |
... | @@ -93,28 +99,29 @@ AC_SUBST(AUTHLIBS) | ... | @@ -93,28 +99,29 @@ AC_SUBST(AUTHLIBS) |
93 | 99 | ||
94 | dnl Check threading support | 100 | dnl Check threading support |
95 | if test x"$usepthread" = x"yes"; then | 101 | if test x"$usepthread" = x"yes"; then |
96 | AC_SEARCH_LIBS(pthread_cancel, pthread, | 102 | AC_SEARCH_LIBS(pthread_cancel, pthread, |
97 | [AC_CHECK_FUNCS(pthread_rwlock_init) | 103 | [AC_CHECK_FUNCS(pthread_rwlock_init) |
98 | AC_CHECK_HEADERS(pthread.h, AC_DEFINE(WITH_PTHREAD))]) | 104 | AC_CHECK_HEADERS(pthread.h, AC_DEFINE(WITH_PTHREAD))]) |
99 | fi | 105 | fi |
100 | 106 | ||
101 | dnl Do we need extra libs for networking? | 107 | dnl Do we need extra libs for networking? |
102 | AC_CHECK_FUNC(gethostbyname, [true], | 108 | AC_CHECK_FUNC(gethostbyname, [true], |
103 | AC_CHECK_LIB(nsl, gethostbyaddr, LIBS="-lnsl $LIBS")) | 109 | AC_CHECK_LIB(nsl, gethostbyaddr, LIBS="-lnsl $LIBS")) |
104 | 110 | ||
105 | AC_CHECK_FUNC(socket, [true], | 111 | AC_CHECK_FUNC(socket, [true], |
106 | AC_CHECK_LIB(socket, socket, LIBS="-lsocket $LIBS")) | 112 | AC_CHECK_LIB(socket, socket, LIBS="-lsocket $LIBS")) |
107 | 113 | ||
108 | dnl Check for GNU Readline | 114 | dnl Check for GNU Readline |
109 | if test x"$usereadline" = x"yes"; then | 115 | if test x"$usereadline" = x"yes"; then |
110 | AC_CHECK_LIB(readline, readline, | 116 | AC_CHECK_LIB(readline, readline, |
111 | AC_CHECK_HEADERS(readline/readline.h, AC_DEFINE(WITH_READLINE))) | 117 | [AC_CHECK_HEADERS(readline/readline.h, AC_DEFINE(WITH_READLINE)) |
118 | LIBS="$LIBS -lreadline"]) | ||
112 | fi | 119 | fi |
113 | 120 | ||
114 | dnl Check for Berkeley DB | 121 | dnl Check for Berkeley DB |
115 | if test x"${usedb2}" = x"yes"; then | 122 | if test x"${usedb2}" = x"yes"; then |
116 | AC_CHECK_LIB(db, db_open, [AC_CHECK_HEADERS(db.h, AC_DEFINE(WITH_BDB2)) | 123 | AC_CHECK_LIB(db, db_open, [AC_CHECK_HEADERS(db.h, AC_DEFINE(WITH_BDB2)) |
117 | LIBS="$LIBS -ldb"]) | 124 | LIBS="$LIBS -ldb"]) |
118 | fi | 125 | fi |
119 | 126 | ||
120 | dnl Output Makefiles | 127 | dnl Output Makefiles | ... | ... |
-
Please register or sign in to post a comment