forked from plashchynski/libdssl
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfigure.in
75 lines (56 loc) · 2.04 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
AC_INIT(src/packet.c)
AC_CONFIG_AUX_DIR(build)
AM_INIT_AUTOMAKE(dssl, 2.1.1)
AC_PROG_INSTALL
AC_PROG_CC
AC_LANG_C
AC_HEADER_STDC
AC_DISABLE_SHARED
AC_PROG_LIBTOOL
# Define CXXFLAGS before AC_PROG_CXX to suppress the default autoconf
# compiler options
# _SYS_MD5_H is required to avoid conflict between OpenSSL and sys/md5.h MD5_CTX
CFLAGS="${CFLAGS} -DDSSL -D_SYS_MD5_H"
AC_ARG_ENABLE(
examples-build,
AS_HELP_STRING(
[--enable-examples-build],
[enable build of examples @<:@enabled@:>@]
),
,
enable_examples_build="yes"
)
# introduce the optional configure parameter for OpenSSL library location
AC_ARG_WITH(openssl,
AC_HELP_STRING(
[--with-openssl=prefix],
[Specify OpenSSL installation directory. If not set, /usr/local/ssl is used by default]
),
OPENSSL_PATHSET=1,
OPENSSL_PATHSET=0
)
# add OpenSSL to include path
if test $OPENSSL_PATHSET = 1 ; then
OPENSSL_PATH=$with_openssl
else
OPENSSL_PATH="/usr/local/ssl"
fi
CFLAGS="$CFLAGS -I$OPENSSL_PATH/include"
LDFLAGS="$LDFLAGS -L$OPENSSL_PATH/lib"
AC_CHECK_HEADERS([arpa/inet.h inttypes.h netinet/in.h stdlib.h string.h sys/time.h])
AC_CHECK_HEADER([pcap.h],,[AC_MSG_ERROR([libpcap header file not found. Install libpcap from http://www.tcpdump.org])])
AC_CHECK_HEADER([zlib.h],,[AC_MSG_ERROR([zlib header file not found. Install zlib from http://www.zlib.net])])
AC_CHECK_HEADER([openssl/ssl.h],,[AC_MSG_ERROR([OpenSSL library header not found. Install OpenSSL from http://www.openssl.org])])
AC_ARG_ENABLE(debug,
[ --enable-debug Build a debug version of DSSL library ],
[ if test -n "$GCC"; then
CFLAGS="$CFLAGS -O0 -D_DEBUG -ggdb"
else
CFLAGS="$CFLAGS -D_DEBUG"
fi
], [CFLAGS="$CFLAGS -O2 -DNDEBUG"] )
AC_CHECK_LIB([dl],[dlopen],[DL_LIBS="-ldl"])
LIBS="-lz -lssl -lcrypto $DL_LIBS $LIBS"
AM_CONDITIONAL([ENABLE_EXAMPLES_BUILD], [test "${enable_examples_build}" != "no"])
AC_CONFIG_FILES([Makefile src/Makefile samples/Makefile tests/Makefile])
AC_OUTPUT