2 AC_INIT(openconnect, 3.13)
5 AM_MAINTAINER_MODE([enable])
6 AM_INIT_AUTOMAKE([foreign])
7 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
9 # Black magic: putting this before the conditional IT_PROG_LIBTOOL below
10 # seems to avoid complaints about AMDEP being conditionally defined.
13 # Ick. IT_PROG_INTLTOOL isn't capable of doing this for itself? And hell,
14 # we don't even *need* intltool for a build-from-tarball on most systems,
15 # do we? But to avoid a whole chain of dependencies, we need it to be
17 AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update])
18 AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge])
19 AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract])
20 if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then
21 AC_MSG_NOTICE([The intltool scripts were not found. Disabling NLS.])
27 AC_SUBST(GETTEXT_PACKAGE, [openconnect])
28 AM_CONDITIONAL(USE_NLS, [test "$USE_NLS" = "yes"])
29 if (test "$USE_NLS" = "yes"); then
30 AC_DEFINE(ENABLE_NLS, 1)
33 AS_COMPILER_FLAGS(CFLAGS,
36 -Wno-missing-field-initializers
39 -Werror=pointer-to-int-cast
40 -Wdeclaration-after-statement
41 -Werror-implicit-function-declaration
45 -Wmissing-declarations
46 -Wmissing-include-dirs
53 AC_ARG_WITH([openssl],
54 AS_HELP_STRING([--with-openssl],
55 [Location of OpenSSL build dir]),
56 [OPENSSL_CFLAGS="-I${with_openssl}/include"
57 OPENSSL_LIBS="${with_openssl}/libssl.a ${with_openssl}/libcrypto.a -ldl -lz"
58 AC_SUBST(OPENSSL_CFLAGS)
59 AC_SUBST(OPENSSL_LIBS)
62 [PKG_CHECK_MODULES(OPENSSL, openssl)
68 PKG_CHECK_MODULES(LIBXML2, libxml-2.0)
69 PKG_CHECK_MODULES(ZLIB, zlib)
71 PKG_CHECK_MODULES(LIBPROXY, libproxy-1.0,
72 [AC_SUBST(LIBPROXY_PC, libproxy-1.0)
73 AC_DEFINE([LIBPROXY_HDR], ["proxy.h"])
76 dnl Libproxy *can* exist without a .pc file, and its header may be called
77 dnl libproxy.h in that case.
78 if (test "$libproxy_pkg" = "no"); then
79 AC_CHECK_HEADER([proxy.h],
80 [AC_DEFINE([LIBPROXY_HDR], ["proxy.h"])
81 AC_SUBST([LIBPROXY_LIBS], [-lproxy])],
82 [AC_CHECK_HEADER([libproxy.h],
83 [AC_DEFINE([LIBPROXY_HDR], ["libproxy.h"])
84 AC_SUBST([LIBPROXY_LIBS], [-lproxy])])])
87 AC_CHECK_HEADER([if_tun.h],
88 [AC_DEFINE([IF_TUN_HDR], ["if_tun.h"])],
89 [AC_CHECK_HEADER([linux/if_tun.h],
90 [AC_DEFINE([IF_TUN_HDR], ["linux/if_tun.h"])],
91 [AC_CHECK_HEADER([net/if_tun.h],
92 [AC_DEFINE([IF_TUN_HDR], ["net/if_tun.h"])],
93 [AC_CHECK_HEADER([net/tun/if_tun.h],
94 [AC_DEFINE([IF_TUN_HDR], ["net/tun/if_tun.h"])])])])])
96 AC_CHECK_LIB(ssl, ENGINE_by_id,
97 AC_DEFINE(HAVE_ENGINE, [1], [OpenSSL has ENGINE support]),
98 AC_MSG_NOTICE([Building without OpenSSL TPM ENGINE support]),
101 AC_CHECK_LIB(ssl, dtls1_stop_timer,
102 AC_DEFINE(HAVE_DTLS1_STOP_TIMER, [1], [OpenSSL has dtls1_stop_timer() function]),
105 AC_PATH_PROG(PYTHON, [python], [], $PATH:/bin:/usr/bin)
106 if (test -n "${ac_cv_path_PYTHON}"); then
107 AC_SUBST(PYTHON, ${ac_cv_path_PYTHON})
109 AC_MSG_NOTICE([Python not found; not building HTML pages])
111 AM_CONDITIONAL(BUILD_WWW, [test -n "${ac_cv_path_PYTHON}"])
113 AC_OUTPUT(Makefile openconnect.pc po/Makefile.in www/Makefile \
114 www/styles/Makefile www/inc/Makefile www/images/Makefile)