| 1 |
# -*- Autoconf -*- |
|---|
| 2 |
# Process this file with autoconf to produce a configure script. |
|---|
| 3 |
|
|---|
| 4 |
AC_PREREQ(2.59) |
|---|
| 5 |
AC_INIT(op, 1.32, alec@swapoff.org) |
|---|
| 6 |
AC_CONFIG_SRCDIR([regexp.h]) |
|---|
| 7 |
AC_CONFIG_HEADER([config.h]) |
|---|
| 8 |
AM_INIT_AUTOMAKE |
|---|
| 9 |
|
|---|
| 10 |
# Checks for programs. |
|---|
| 11 |
AC_PROG_CC |
|---|
| 12 |
AC_PROG_LEX |
|---|
| 13 |
AC_PROG_INSTALL |
|---|
| 14 |
AC_PROG_MAKE_SET |
|---|
| 15 |
|
|---|
| 16 |
AC_CHECK_FUNC([crypt], [], [AC_CHECK_LIB([crypt], [crypt], [], [AC_MSG_ERROR(Can't find crypt())])]) |
|---|
| 17 |
|
|---|
| 18 |
OPENLOG_VOID=1 |
|---|
| 19 |
AC_COMPILE_IFELSE( |
|---|
| 20 |
[int main(int, char**){int i = openlog(); return 0;}], |
|---|
| 21 |
OPENLOG_VOID=0 |
|---|
| 22 |
) |
|---|
| 23 |
AC_DEFINE_UNQUOTED([OPENLOG_VOID], [${OPENLOG_VOID}], [Does openlog() return void?]) |
|---|
| 24 |
|
|---|
| 25 |
# Feature checks |
|---|
| 26 |
auto_detect_auth=no |
|---|
| 27 |
with_pam=${with_pam:-yes} |
|---|
| 28 |
AC_ARG_WITH(pam, [ --with-pam use PAM for authentication (yes)]) |
|---|
| 29 |
if test "${with_pam}" = yes; then |
|---|
| 30 |
AC_CHECK_LIB([pam], [pam_start], [ |
|---|
| 31 |
AC_DEFINE(USE_PAM, [], [Use PAM for authentication]) |
|---|
| 32 |
LIBS="$LIBS -lpam" |
|---|
| 33 |
], [ |
|---|
| 34 |
AC_MSG_WARN([Can't find pam_start() in libpam, trying shadow support]) |
|---|
| 35 |
auto_detect_auth=yes |
|---|
| 36 |
with_pam=no |
|---|
| 37 |
# Try shadow if PAM failed |
|---|
| 38 |
with_shadow=yes |
|---|
| 39 |
]) |
|---|
| 40 |
fi |
|---|
| 41 |
|
|---|
| 42 |
with_shadow=${with_shadow:-no} |
|---|
| 43 |
AC_ARG_WITH(shadow, [ --with-shadow use shadow file for authentication |
|---|
| 44 |
(default if PAM not found)]) |
|---|
| 45 |
if test "${with_shadow}" = yes; then |
|---|
| 46 |
if test "${with_pam}" = yes; then |
|---|
| 47 |
AC_MSG_WARN([Can't enable PAM and shadow support, shadow disabled]) |
|---|
| 48 |
else |
|---|
| 49 |
if test "${auto_detect_auth}" = yes -a ! -e /etc/shadow; then |
|---|
| 50 |
AC_MSG_WARN([Failed to find shadow support while auto-detecting authentication mechanisms, using basic crypt]) |
|---|
| 51 |
else |
|---|
| 52 |
if test ! -e /etc/shadow; then |
|---|
| 53 |
AC_MSG_WARN([Shadow support enabled but /etc/shadow does not exist, continuing anyway]) |
|---|
| 54 |
fi |
|---|
| 55 |
AC_DEFINE(USE_SHADOW, [], [Use shadow file for authentication]) |
|---|
| 56 |
fi |
|---|
| 57 |
fi |
|---|
| 58 |
fi |
|---|
| 59 |
|
|---|
| 60 |
enable_xauth=${enable_xauth:-no} |
|---|
| 61 |
AC_ARG_ENABLE(xauth, [ --enable-xauth=<xauth> enable xauth support and specify xauth binary]) |
|---|
| 62 |
if test "${enable_xauth}" != no; then |
|---|
| 63 |
EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS -DXAUTH=\\\"$enable_xauth\\\"" |
|---|
| 64 |
fi |
|---|
| 65 |
|
|---|
| 66 |
AC_CHECK_LIB([fl], [yywrap]) |
|---|
| 67 |
AC_SUBST(EXTRA_CPPFLAGS) |
|---|
| 68 |
|
|---|
| 69 |
# Checks for header files. |
|---|
| 70 |
AC_HEADER_DIRENT |
|---|
| 71 |
AC_HEADER_STDC |
|---|
| 72 |
AC_HEADER_SYS_WAIT |
|---|
| 73 |
AC_HEADER_TIME |
|---|
| 74 |
AC_CHECK_HEADERS([limits.h netdb.h shadow.h stdlib.h string.h sys/time.h syslog.h unistd.h]) |
|---|
| 75 |
|
|---|
| 76 |
# Checks for typedefs, structures, and compiler characteristics. |
|---|
| 77 |
AC_C_CONST |
|---|
| 78 |
AC_TYPE_UID_T |
|---|
| 79 |
|
|---|
| 80 |
# Checks for library functions. |
|---|
| 81 |
AC_FUNC_CHOWN |
|---|
| 82 |
AC_FUNC_CLOSEDIR_VOID |
|---|
| 83 |
AC_FUNC_FORK |
|---|
| 84 |
AC_FUNC_MALLOC |
|---|
| 85 |
AC_FUNC_REALLOC |
|---|
| 86 |
AC_FUNC_STAT |
|---|
| 87 |
AC_FUNC_STRFTIME |
|---|
| 88 |
AC_FUNC_VPRINTF |
|---|
| 89 |
AC_CHECK_FUNCS([gethostname getpass getspnam memset regcomp strchr strcspn vsnprintf]) |
|---|
| 90 |
|
|---|
| 91 |
AC_CONFIG_FILES([Makefile op.list]) |
|---|
| 92 |
AC_OUTPUT |
|---|