-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
90 lines (74 loc) · 2.21 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
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/main.cc)
AM_INIT_AUTOMAKE(teepeedee, 0.3.2pre)
dnl Check for openssl modified from that by
dnl Mark Ethan Trostler <[email protected]>
dnl 1.2 (last modified: 2003-01-28)
dnl http://www.gnu.org/software/ac-archive/htmldoc/check_ssl.html
AC_DEFUN([CHECK_SSL],
[AC_MSG_CHECKING(if ssl is wanted)
AC_ARG_WITH(ssl,
[ --with-ssl enable ssl [will check /usr/local/ssl
/usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr ]
],
[
if test "x$withval" == xno; then
AC_MSG_RESULT(no)
openssl_dont_want=true
else
AC_MSG_RESULT(yes)
openssl_search_dir="$withval"
fi
],[ AC_MSG_RESULT(yes)])
if test "x$openssl_dont_want" != xtrue; then
for dir in $openssl_search_dir /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr; do
ssldir="$dir"
if test -f "$dir/include/openssl/ssl.h"; then
found_ssl="yes";
AC_DEFINE([HAVE_OPENSSL],1,[OpenSSL library present and to be used])
CPPFLAGS="$CPPFLAGS -I$ssldir/include"
break;
fi
done
if test x_$found_ssl != x_yes; then
AC_MSG_ERROR(Cannot find ssl libraries)
else
printf "OpenSSL found in $ssldir\n";
LIBS="$LIBS -lssl -lcrypto";
LDFLAGS="$LDFLAGS -L$ssldir/lib";
HAVE_OPENSSL=yes
fi
AC_SUBST(HAVE_OPENSSL)
fi
])
dnl AM_CONFIG_HEADER(config.h)
dnl Checks for programs
AC_PROG_CXX
AC_PROG_RANLIB
dnl System stuff
AC_SYS_LARGEFILE
dnl Checks for header files
AC_CHECK_HEADERS([sys/sendfile.h sys/uio.h crypt.h])
dnl Check for functions
AC_CHECK_DECLS([sendfile],,,[#ifdef HAVE_SYS_SENDFILE_H
#include <sys/sendfile.h>
#endif
#ifdef HAVE_SYS_UIO_H
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
#endif])
AC_CHECK_FUNCS([sendfile readdir_r])
CHECK_SSL
dnl Configure directory location
AC_ARG_ENABLE([configdir],
AC_HELP_STRING([--enable-configdir=dir],[default directory for configuration]),
tpd_configdir="$enableval",
tpd_configdir="/etc/${PACKAGE}"
)
AC_DEFINE_UNQUOTED(TPD_CONFIGDIR,"`eval echo ${tpd_configdir}`",directory containing configuration files)
dnl All done
AC_OUTPUT(Makefile
src/Makefile
lib/Makefile
)