-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathconfigure.ac
163 lines (144 loc) · 5.39 KB
/
configure.ac
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([smaug], [0.8.0], [[email protected]])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([src/smg_id.cc])
AC_CONFIG_HEADERS([src/config.h])
# Release 0.8.0, libsmaug 0:0:0
AC_SUBST(libsmaug_la_version_info, 0:0:0)
LT_INIT
AC_ARG_ENABLE([debug],
[ --enable-debug Build Smaug with debugging output to stderr enabled (default is no)],
[case "$enableval" in
yes) debug=true;;
no) debug=false;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
esac],[debug=false])
AM_CONDITIONAL([SMG_DEBUG], [test "x$debug" = "xtrue"])
AC_ARG_ENABLE([getdns],
[ --enable-getdns Build with getdns API (default is no)],
[case "$enableval" in
yes) getdns=true;;
no) getdns=false;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-getdns]) ;;
esac],[getdns=false])
AC_ARG_WITH(getdns_dir,
AC_HELP_STRING(
[--with-getdns-dir[=DIR])],
[getdns API library directory]),
[getdns_dir=$withval])
AM_CONDITIONAL([SMG_GETDNS], [test "x$getdns" = "xtrue" || test "x$getdns_dir" != "x"])
AC_ARG_ENABLE([openldap],
[ --enable-openldap Build with OpenLDAP support (default is no)],
[case "$enableval" in
yes) openldap=true;;
no) openldap=false;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-openldap]) ;;
esac],[openldap=false])
AC_ARG_WITH(openldap_dir,
AC_HELP_STRING(
[--with-openldap[=DIR]],
[OPENLDAP library directory]),
[openldap_dir=$withval])
AM_CONDITIONAL([SMG_LDAP], [test "x$openldap" = "xtrue" || test "x$openldap_dir" != "x"])
AC_ARG_WITH(openssl-lib-dir,
AC_HELP_STRING(
[--with-openssl-lib-dir[=DIR]],
[OPENSSL library directory]),
[openssl_lib_dir=$withval])
AC_CHECK_LIB(ssl, ssl_ok, OPENSSL_LIB=" ", OPENSSL_LIB= )
AC_CHECK_LIB(crypto, EVP_PKEY_new, CRYPTO_LIB=" ", CRYPTO_LIB= )
LDFLAGS="$LDFLAGS $OPENSSL_LIB $CRYPTO_LIB $LDAP_LIB"
if test "x$openssl_lib_dir" != "x"; then
AC_CHECK_LIB(ssl, ssl_ok, OPENSSL_LIB=" ", OPENSSL_LIB= )
# hunt through several directories trying to find the libraries
if test "x$OPENSSL_LIB" = "x"; then
old_LDFLAGS="$LDFLAGS"
for try in $openssl_lib_dir /usr/lib /usr/local/lib /opt/local/lib; do
LDFLAGS=$"old_LDFLAGS -L$try"
unset ac_cv_ssl_ok
# AC_CHECK_LIB(ssl, OpenSSL_add_all_algorithms, OPENSSL_LIB="-L$try", OPENSSL_LIB=)
AC_CHECK_LIB(ssl, ssl_ok, OPENSSL_LIB="-L$try", OPENSSL_LIB=)
if test "x$OPENSSL_LIB" != "x"; then
break;
fi
done
LDFLAGS="$old_LDFLAGS $OPENSSL_LIB"
fi
if test "x$OPENSSL_LIB" = "x"; then
AC_MSG_ERROR([OPENSSL_LIB not found.])
fi
fi
if test "x$getdns_dir" != "x"; then
AC_CHECK_LIB(getdns, getdns_context_create, GETDNS_LIB=" ", GETDNS_LIB= )
# hunt through several directories trying to find the libraries
if test "x$GETDNS_LIB" = "x"; then
old_LDFLAGS="$LDFLAGS"
for try in /usr/lib /usr/local/lib /opt/local/lib; do
LDFLAGS=$"old_LDFLAGS -L$try"
unset ac_cv_getdns_context_create
AC_CHECK_LIB(getdns, getdns_context_create, GETDNS_LIB="-L$try", GETDNS_LIB=)
if test "x$GETDNS_LIB" != "x"; then
break;
fi
done
LDFLAGS="$old_LDFLAGS $GETDNS_LIB"
fi
if test "x$GETDNS_LIB" = "x"; then
AC_MSG_ERROR([GETDNS_LIB libraries not found.])
fi
else
AC_CHECK_LIB(unbound, ub_ctx_create, LIBUNBOUND=" ", LIBUNBOUND=)
# hunt through several directories trying to find the libraries
if test "x$LIBUNBOUND" = "x"; then
old_LDFLAGS="$LDFLAGS"
for try in /usr/lib /usr/local/lib /opt/local/lib; do
LDFLAGS=$"old_LDFLAGS -L$try"
unset ac_cv_ub_ctx_create
AC_CHECK_LIB(unbound, ub_ctx_create, LIBUNBOUND="-L$try", LIBUNBOUND=)
if test "x$LIBUNBOUND" != "x"; then
break;
fi
done
LDFLAGS="$old_LDFLAGS $LIBUNBOUND"
fi
if test "x$LIBUNBOUND" = "x"; then
AC_MSG_ERROR([LIBUNBOUND not found.])
fi
fi
if test "x$openldap" = "xtrue"; then
AC_CHECK_LIB(ldap, ldap_initialize, LDAP_LIB=" ", LDAP_LIB= )
# hunt through several directories trying to find the libraries
if test "x$LDAP_LIB" = "x"; then
old_LDFLAGS="$LDFLAGS"
for try in $openldap_dir /usr/lib /usr/local/lib /opt/local/lib; do
LDFLAGS=$"old_LDFLAGS -L$try"
unset ac_cv_ldap_initialize
AC_CHECK_LIB(ldap, ldap_initialize, LDAP_LIB="-L$try ", LDAP_LIB=)
if test "x$LDAP_LIB" != "x"; then
break;
fi
done
LDFLAGS="$old_LDFLAGS $LDAP_LIB"
fi
if test "x$LDAP_LIB" = "x"; then
AC_MSG_ERROR([LDAP_LIB not found.])
fi
fi
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
# Checks for libraries.
# Checks for header files.
AC_CHECK_HEADERS([string.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_CHECK_FUNCS([memset])
# AC_CONFIG_FILES([src/Makefile])
AC_OUTPUT(Makefile src/Makefile scripts/Makefile)