forked from darnir/vtls
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.ac
147 lines (130 loc) · 5.02 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
AC_INIT([libvtls], [0.0.1], [[email protected]], [libvtls], [http://github.com/rockdaboot/libvtls])
AC_PREREQ([2.59])
AM_INIT_AUTOMAKE([1.10 -Wall no-define foreign])
# Generate two configuration headers; one for building the library itself with
# an autogenerated template, and a second one that will be installed alongside
# the library.
AC_CONFIG_HEADERS([config.h])
AC_PROG_CC
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
#LT_INIT([disable-static])
LT_INIT([dlopen])
AC_CONFIG_MACRO_DIR([m4])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
dnl Check that compiler understands inline
AC_C_INLINE
#
# Gettext
#
#AM_GNU_GETTEXT([external],[need-ngettext])
#AM_GNU_GETTEXT_VERSION([0.18.1])
#
# check for gtk-doc
#
m4_ifdef([GTK_DOC_CHECK], [
GTK_DOC_CHECK([1.15],[--flavour no-tmpl])
],[
AM_CONDITIONAL([ENABLE_GTK_DOC], false)
])
# needed for some older versions of gtk-doc
m4_ifdef([GTK_DOC_USE_LIBTOOL], [], [
AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], false)
])
#if test x"$have_gtk_doc" = xyes -a x"$enable_gtk_doc" = xyes; then
# docdir_makefile=docs/libvtls/Makefile
# docdir_version_xml=docs/libvtls/version.xml
# AC_SUBST([LIBVTLS_DOCS], [docs/libvtls])
#fi
#
# enable creation of man pages
#
AC_ARG_ENABLE(man,[AC_HELP_STRING([--enable-man],
[generate man pages [default=auto]])],enable_man=yes,enable_man=no)
AS_IF([test "$enable_man" != no], [
AC_PATH_PROG([XSLTPROC], [xsltproc])
AS_IF([test -z "$XSLTPROC"], [
AS_IF([test "$enable_man" = yes], [
AC_MSG_ERROR([xsltproc is required for --enable-man])
])
enable_man=no
])
])
AM_CONDITIONAL(ENABLE_MAN, test x$enable_man != xno)
AC_MSG_CHECKING([whether to generate man pages])
AS_IF([ test "$enable_man" != no ], [
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
])
PKG_PROG_PKG_CONFIG
# Define these substitions here to keep all version information in one place.
# For information on how to properly maintain the library version information,
# refer to the libtool manual, section "Updating library version information":
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
#
# 1. Start with version information of ‘0:0:0’ for each libtool library.
# 2. Update the version information only immediately before a public release of your software. More frequent updates are unnecessary, and only guarantee that the current interface number gets larger faster.
# 3. If the library source code has changed at all since the last update, then increment revision (‘c:r:a’ becomes ‘c:r+1:a’).
# 4. If any interfaces have been added, removed, or changed since the last update, increment current, and set revision to 0.
# 5. If any interfaces have been added since the last public release, then increment age.
# 6. If any existing interfaces have been removed or changed since the last public release, then set age to 0.
AC_SUBST([LIBVTLS_SO_VERSION], [0:0:0])
AC_SUBST([LIBVTLS_VERSION], $VERSION)
AC_ARG_WITH(gnutls, AS_HELP_STRING([--without-gnutls], [disable GNUTLS SSL support]), use_gnutls=$withval, use_gnutls=yes)
AS_IF([test "x$use_gnutls" != "xno"], [
PKG_CHECK_MODULES([GNUTLS], [gnutls], [
use_gnutls=yes
LIBS="$GNUTLS_LIBS $LIBS"
CFLAGS="$GNUTLS_CFLAGS $CFLAGS"
AC_DEFINE([USE_GNUTLS], [1], [Use GnuTLS])
], [
AC_SEARCH_LIBS(gnutls_global_init, gnutls,
[use_gnutls=yes; AC_DEFINE([USE_GNUTLS], [1], [Use GnuTLS])],
[use_gnutls=no; AC_MSG_WARN(*** GNUTLS was not found. You will not be able to libvtls-gnutls.)])
])
])
AM_CONDITIONAL([USE_GNUTLS], [test "x$use_gnutls" = xyes])
# Check for valgrind
ac_enable_valgrind=no
AC_ARG_ENABLE(valgrind-tests,
AS_HELP_STRING([--enable-valgrind-tests], [enable using Valgrind for tests]),
[ac_enable_valgrind=$enableval],
[ac_enable_valgrind=no])
if test "${ac_enable_valgrind}" = "yes" ; then
AC_CHECK_PROG(HAVE_VALGRIND, valgrind, yes, no)
if test "$HAVE_VALGRIND" = "yes" ; then
VALGRIND_ENVIRONMENT="valgrind --error-exitcode=1 --leak-check=yes --show-reachable=yes --track-origins=yes"
AC_SUBST(VALGRIND_ENVIRONMENT)
TESTS_INFO="Test suite will be run under Valgrind"
else
TESTS_INFO="Valgrind not found"
fi
else
TESTS_INFO="Valgrind testing not enabled"
fi
# Checks for header files.
AC_CHECK_HEADERS([\
poll.h sys/poll.h arpa/inet.h sys/select.h\
])
# check for alloca / alloca.h
AC_FUNC_ALLOCA
AC_CHECK_FUNCS([strndup clock_gettime gettimeofday inet_pton select poll])
# Override the template file name of the generated .pc file, so that there
# is no need to rename the template file when the API version changes.
AC_CONFIG_FILES([Makefile
include/Makefile
src/Makefile
examples/Makefile
libvtls.pc:libvtls.pc.in])
AC_OUTPUT
AC_MSG_NOTICE([Summary of build options:
Version: ${PACKAGE_VERSION}
Host OS: ${host_os}
Install prefix: ${prefix}
Compiler: ${CC}
CFlags: ${CFLAGS} ${CPPFLAGS}
LDFlags: ${LDFLAGS}
Libs: ${LIBS}
GnuTLS: ${use_gnutls}
Tests: ${TESTS_INFO}
])