forked from meduketto/iksemel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
145 lines (130 loc) · 3.92 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
dnl Process this file with autoconf to produce a configure script.
AC_INIT
AC_PREREQ(2.50)
AC_CONFIG_SRCDIR([configure.ac])
AM_INIT_AUTOMAKE(iksemel,1.5)
AM_CONFIG_HEADER(include/config.h)
AC_CANONICAL_HOST
dnl Checks for programs
AC_PROG_CC
AC_PROG_INSTALL
AC_CHECK_TOOL(OBJDUMP, objdump, :)
AM_PROG_LIBTOOL
AC_LANG_C
PKG_PROG_PKG_CONFIG
dnl Checks for header files
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h strings.h errno.h)
dnl Checks for typedefs and structures
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_CHECK_MEMBERS([struct stat.st_blksize])
dnl Special check for windows
case "$host_os" in
*mingw*)
AC_CHECK_LIB(wsock32, main, , AC_MSG_ERROR(Winsock is needed for a Win32 build.))
;;
esac
dnl Check for posix io
AC_ARG_ENABLE(default-io,
AS_HELP_STRING([--disable-default-io],[disable builtin socket transport code]),
defio=$enableval, defio=yes)
if test "$defio" = yes; then
AC_DEFINE(USE_DEFAULT_IO,1,[Define this is you want default transport])
fi
AM_CONDITIONAL(DO_POSIX, test "x$defio" = "xyes")
dnl Checks for library functions
AC_SEARCH_LIBS(recv,socket)
AC_CHECK_FUNCS(getopt_long)
AC_CHECK_FUNCS(getaddrinfo)
dnl Check -Wall flag of GCC
if test "x$GCC" = "xyes"; then
if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
CFLAGS="$CFLAGS -Wall"
fi
fi
dnl Options for overriding TLS checks
AC_ARG_WITH([openssl],
AS_HELP_STRING([--without-openssl],[disable checking for openssl]),
[with_openssl=$enableval],
[with_openssl=yes]
)
AC_ARG_WITH([gnutls],
AS_HELP_STRING([--without-gnutls],[disable checking for GNU TLS]),
[with_gnutls=$enableval],
[with_gnutls=yes]
)
dnl Check OpenSSL
if test "x$with_openssl" = "xyes"; then
PKG_CHECK_MODULES([OPENSSL], openssl >= 0.9.8, have_openssl=yes, have_openssl=no)
if test "x$have_openssl" = "xyes"; then
LIBOPENSSL_CFLAGS="$OPENSSL_CFLAGS"
LIBOPENSSL_LIBS="$OPENSSL_LIBS"
AC_SUBST(LIBOPENSSL_CFLAGS)
AC_SUBST(LIBOPENSSL_LIBS)
AC_DEFINE(HAVE_OPENSSL, 1, [whether to use OpenSSL support.])
fi
fi
dnl Check GNU TLS
if test "x$with_gnutls" = "xyes"; then
if test "x$have_openssl" != "xyes"; then
PKG_CHECK_MODULES([GNUTLS], gnutls >= 2.0.0, have_gnutls=yes, have_gnutls=no)
if test "x$have_gnutls" = "xyes"; then
LIBGNUTLS_CFLAGS="$GNUTLS_CFLAGS"
LIBGNUTLS_LIBS="$GNUTLS_LIBS"
AC_SUBST(LIBGNUTLS_CFLAGS)
AC_SUBST(LIBGNUTLS_LIBS)
AC_DEFINE(HAVE_GNUTLS, 1, [whether to use GnuTSL support.])
fi
fi
fi
dnl Option for overriding Python check
AC_ARG_ENABLE([python],
AS_HELP_STRING([--disable-python],[disable checking for Python bindings]),
[with_python=$enableval],
[with_python=yes]
)
dnl a macro to check for ability to create python extensions
dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
dnl function also defines PYTHON_INCLUDES
AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
[AC_REQUIRE([AM_PATH_PYTHON])
AC_MSG_CHECKING(for headers required to compile python extensions)
dnl deduce PYTHON_INCLUDES
py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
if test "$py_prefix" != "$py_exec_prefix"; then
PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
fi
AC_SUBST(PYTHON_INCLUDES)
dnl check if the headers exist:
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
AC_TRY_CPP([#include <Python.h>],dnl
[AC_MSG_RESULT(found)
$1],dnl
[AC_MSG_RESULT(not found)
$2])
CPPFLAGS="$save_CPPFLAGS"
])
dnl Check Python for binding
if test "x$with_python" = "xyes"; then
with_python=no
AM_PATH_PYTHON([2.2], , [:])
AM_CHECK_PYTHON_HEADERS(with_python=yes,[AC_MSG_ERROR(could not find Python headers)])
fi
AM_CONDITIONAL([DO_PYTHON], [test "x$with_python" = "xyes"])
dnl Generating makefiles
AC_CONFIG_FILES([
Makefile
iksemel.pc
src/Makefile
include/Makefile
tools/Makefile
python/Makefile
test/Makefile
doc/Makefile
])
AC_OUTPUT