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 NLS bits below
10 # seems to avoid complaints about AMDEP being conditionally defined.
14 [ --disable-nls do not use Native Language Support],
15 [USE_NLS=$enableval], [USE_NLS=yes])
17 if test "$USE_NLS" = "yes"; then
18 AC_PATH_PROG(MSGFMT, msgfmt)
19 if test "$MSGFMT" = ""; then
20 AC_ERROR([msgfmt could not be found. Try configuring with --disable-nls])
24 if test "$USE_NLS" = "yes"; then
25 AC_MSG_CHECKING([for functional NLS support])
26 AC_LINK_IFELSE([AC_LANG_PROGRAM([
28 #include <libintl.h>],[
29 setlocale(LC_ALL, "");
30 (void)dgettext("openconnect", "foo");])],
34 AC_LINK_IFELSE([AC_LANG_PROGRAM([
36 #include <libintl.h>],[
37 setlocale(LC_ALL, "");
38 (void)dgettext("openconnect", "foo");])],
39 [AC_MSG_RESULT(yes (with -lintl))]
46 if test "$USE_NLS" = "yes"; then
48 AC_DEFINE(ENABLE_NLS, 1)
50 AM_CONDITIONAL(USE_NLS, [test "$USE_NLS" = "yes"])
52 AS_COMPILER_FLAGS(CFLAGS,
55 -Wno-missing-field-initializers
58 -Werror=pointer-to-int-cast
59 -Wdeclaration-after-statement
60 -Werror-implicit-function-declaration
64 -Wmissing-declarations
65 -Wmissing-include-dirs
70 AC_ARG_WITH([openssl],
71 AS_HELP_STRING([--with-openssl],
72 [Location of OpenSSL build dir]),
73 [OPENSSL_CFLAGS="-I${with_openssl}/include"
74 OPENSSL_LIBS="${with_openssl}/libssl.a ${with_openssl}/libcrypto.a -ldl -lz"
75 AC_SUBST(OPENSSL_CFLAGS)
76 AC_SUBST(OPENSSL_LIBS)
79 [PKG_CHECK_MODULES(OPENSSL, openssl)
85 PKG_CHECK_MODULES(LIBXML2, libxml-2.0)
86 PKG_CHECK_MODULES(ZLIB, zlib)
88 PKG_CHECK_MODULES(LIBPROXY, libproxy-1.0,
89 [AC_SUBST(LIBPROXY_PC, libproxy-1.0)
90 AC_DEFINE([LIBPROXY_HDR], ["proxy.h"])
93 dnl Libproxy *can* exist without a .pc file, and its header may be called
94 dnl libproxy.h in that case.
95 if (test "$libproxy_pkg" = "no"); then
96 AC_CHECK_HEADER([proxy.h],
97 [AC_DEFINE([LIBPROXY_HDR], ["proxy.h"])
98 AC_SUBST([LIBPROXY_LIBS], [-lproxy])],
99 [AC_CHECK_HEADER([libproxy.h],
100 [AC_DEFINE([LIBPROXY_HDR], ["libproxy.h"])
101 AC_SUBST([LIBPROXY_LIBS], [-lproxy])])])
104 AC_CHECK_HEADER([if_tun.h],
105 [AC_DEFINE([IF_TUN_HDR], ["if_tun.h"])],
106 [AC_CHECK_HEADER([linux/if_tun.h],
107 [AC_DEFINE([IF_TUN_HDR], ["linux/if_tun.h"])],
108 [AC_CHECK_HEADER([net/if_tun.h],
109 [AC_DEFINE([IF_TUN_HDR], ["net/if_tun.h"])],
110 [AC_CHECK_HEADER([net/tun/if_tun.h],
111 [AC_DEFINE([IF_TUN_HDR], ["net/tun/if_tun.h"])])])])])
113 AC_CHECK_LIB(ssl, ENGINE_by_id,
114 AC_DEFINE(HAVE_ENGINE, [1], [OpenSSL has ENGINE support]),
115 AC_MSG_NOTICE([Building without OpenSSL TPM ENGINE support]),
118 AC_CHECK_LIB(ssl, dtls1_stop_timer,
119 AC_DEFINE(HAVE_DTLS1_STOP_TIMER, [1], [OpenSSL has dtls1_stop_timer() function]),
122 AC_PATH_PROG(PYTHON, [python], [], $PATH:/bin:/usr/bin)
123 if (test -n "${ac_cv_path_PYTHON}"); then
124 AC_SUBST(PYTHON, ${ac_cv_path_PYTHON})
126 AC_MSG_NOTICE([Python not found; not building HTML pages])
128 AM_CONDITIONAL(BUILD_WWW, [test -n "${ac_cv_path_PYTHON}"])
130 AC_OUTPUT(Makefile openconnect.pc po/Makefile www/Makefile \
131 www/styles/Makefile www/inc/Makefile www/images/Makefile)