-
Notifications
You must be signed in to change notification settings - Fork 3
/
configure.in
101 lines (86 loc) · 3.29 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Process this file with autoconf to produce a configure script.
AC_INIT(pam_imap, 0.3.10~dev, [email protected])
AC_CONFIG_SRCDIR([check_user.c])
AC_CONFIG_HEADER(config.h)
#AM_INIT_AUTOMAKE
# Checks for programs.
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_CC_STDC
AC_CHECK_FUNCS(getopt_long)
# Checks for libraries.
AC_CHECK_LIB(crypto, ERR_error_string, [LIBS="$LIBS -lcrypto"])
AC_CHECK_LIB(crypt, crypt, [LIBS="$LIBS -lcrypt"])
# FIXME: Replace `main' with a function in `-ldb':
AC_CHECK_LIB(db, dbm_open, [AC_DEFINE(HAVE_LIBDB, 1, [Define if you have libdb])])
AC_CHECK_LIB(gdbm, gdbm_open, [LIBS="$LIBS -lgdbm"
AC_DEFINE(HAVE_LIBGDBM, 1, [Define if you have libgdbm]) ])
AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(pam, pam_get_item, [LIBS="$LIBS -lpam"])
AC_CHECK_LIB(pam_misc, misc_conv, [LIBS="$LIBS -lpam_misc"]) # only used for check_user
AC_CHECK_LIB(ssl, SSL_CTX_new, [LIBS="$LIBS -lssl"
AC_DEFINE(HAVE_LIBSSL, 1, [Define for OpenSSL]) ]) # ???
#AC_CACHE_CHECK(for dbm_open, ac_cv_dbmopen,
# [ac_cv_dbmopen=no
# AC_TRY_LINK([#include <ndbm.h>],
# [dbm_open(0,0,0);],[ac_cv_dbmopen=yes])])
#if test $ac_cv_dbmopen = no; then
# AC_CACHE_CHECK([for dbm_open in -ldb], ac_cv_libdb,
# [save_LIBS="$LIBS"
# LIBS="$LIBS -ldb"
# ac_cv_libdb=no
# AC_TRY_LINK([#define DB_DBM_HSEARCH 1
##include <db.h>],
# [dbm_open(0,0,0);],
# [ac_cv_libdb=yes])
# LIBS="$save_LIBS"])
#
# if test $ac_cv_libdb = yes; then
# LIBS="$LIBS -ldb"
# AC_DEFINE(HAVE_LIBDB, 1, [Define if you have libdb])
# else
# AC_MSG_ERROR([Could not find dbm_open(), you must install libdb]
#)
# fi
#fi
debug=no
AC_ARG_WITH(debug, [ --with-debug=yes yes/no [no]],
[ob_cv_with_debug=$withval])
if test "x$ob_cv_with_debug" == xyes; then
echo "Defining DEBUG..."
AC_DEFINE(DEBUG, 1, [Turn on Debugging Mode])
CFLAGS="$CFLAGS -g"
else
echo " --with-debug is unset"
fi
# Checks for header files.
AC_FUNC_ALLOCA
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h syslog.h unistd.h])
AC_CHECK_HEADERS([openssl/ssl.h], [], [AC_MSG_ERROR([Please install libssl-dev])])
AC_CHECK_HEADERS([security/pam_appl.h security/pam_modules.h security/pam_misc.h], [], [AC_MSG_ERROR([Please install libpam0g-dev])])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
# Checks for library functions.
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_MMAP
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([dup2 crypt gethostbyname getpass gettimeofday inet_ntoa memmove memset munmap socket strcasecmp strchr strdup strerror strncasecmp strstr strtol])
AC_CONFIG_FILES([Makefile
isynclib/Makefile])
# Make sure we don't define '-shared' in the LDFLAGS before the end, otherwise
# it breaks ./configure tests. (This was moved from near the start.)
# Add -fPIC so shared object will build.
if test "$GCC" = yes; then
CFLAGS="$CFLAGS -fPIC -pipe -Wall"
#CFLAGS="-pipe -Wall -Dlinux -DLINUX_PAM"
AC_CHECK_FILE(./isynclib, [CPPFLAGS="$CPPFLAGS -I./isynclib"])
#LDFLAGS="$LDFLAGS -L/lib -Xlinker -x -shared"
fi
AC_OUTPUT