1 dnl OpenVPN -- An application to securely tunnel IP networks
2 dnl over a single UDP port, with support for SSL/TLS-based
3 dnl session authentication and key exchange,
4 dnl packet encryption, packet authentication, and
5 dnl packet compression.
7 dnl Copyright (C) 2002-2009 OpenVPN Technologies, Inc. <sales@openvpn.net>
9 dnl This program is free software; you can redistribute it and/or modify
10 dnl it under the terms of the GNU General Public License as published by
11 dnl the Free Software Foundation; either version 2 of the License, or
12 dnl (at your option) any later version.
14 dnl This program is distributed in the hope that it will be useful,
15 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
16 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 dnl GNU General Public License for more details.
19 dnl You should have received a copy of the GNU General Public License
20 dnl along with this program (see the file COPYING included with this
21 dnl distribution); if not, write to the Free Software Foundation, Inc.,
22 dnl 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 dnl Process this file with autoconf to produce a configure script.
28 m4_include(version.m4)
29 AC_INIT([OpenVPN], [PRODUCT_VERSION], [openvpn-users@lists.sourceforge.net], [openvpn])
30 AM_CONFIG_HEADER(config.h)
31 AC_CONFIG_SRCDIR(syshead.h)
36 AM_INIT_AUTOMAKE(openvpn, [$PACKAGE_VERSION])
38 AC_ARG_WITH(cygwin-native,
39 [ --with-cygwin-native Compile native win32],
40 [CYGWIN_NATIVE="${withval}"],
52 AC_MSG_CHECKING([cygwin mode to use])
53 if test "${CYGWIN_NATIVE}" = "yes"; then
54 AC_MSG_RESULT([Using native win32])
55 CFLAGS="${CFLAGS} -mno-cygwin"
59 AC_MSG_RESULT([Using cygwin])
67 [ --disable-lzo Disable LZO compression support],
73 [ --disable-crypto Disable OpenSSL crypto support],
74 [CRYPTO="$enableval"],
79 [ --disable-ssl Disable OpenSSL SSL support for TLS-based key exchange],
85 [ --disable-multi Disable client/server support (--mode server + client mode)],
91 [ --disable-server Disable server support only (but retain client support)],
92 [MULTI_SERVER="$enableval"],
96 AC_ARG_ENABLE(plugins,
97 [ --disable-plugins Disable plug-in support],
98 [PLUGINS="$enableval"],
102 AC_ARG_ENABLE(management,
103 [ --disable-management Disable management server support],
104 [MANAGEMENT="$enableval"],
108 AC_ARG_ENABLE(pkcs11,
109 [ --disable-pkcs11 Disable pkcs11 support],
110 [PKCS11="$enableval"],
115 [ --disable-socks Disable Socks support],
116 [SOCKS="$enableval"],
121 [ --disable-http Disable HTTP proxy support],
122 [HTTP_PROXY="$enableval"],
126 AC_ARG_ENABLE(fragment,
127 [ --disable-fragment Disable internal fragmentation support (--fragment)],
128 [FRAGMENT="$enableval"],
132 AC_ARG_ENABLE(multihome,
133 [ --disable-multihome Disable multi-homed UDP server support (--multihome)],
134 [MULTIHOME="$enableval"],
138 AC_ARG_ENABLE(port-share,
139 [ --disable-port-share Disable TCP server port-share support (--port-share)],
140 [PORT_SHARE="$enableval"],
145 [ --disable-debug Disable debugging support (disable gremlin and verb 7+ messages)],
146 [DEBUG="$enableval"],
151 [ --enable-small Enable smaller executable size (disable OCC, usage message, and verb 4 parm list)],
152 [SMALL="$enableval"],
156 AC_ARG_ENABLE(pthread,
157 [ --enable-pthread Enable pthread support (Experimental for OpenVPN 2.0)],
158 [PTHREAD="$enableval"],
162 AC_ARG_ENABLE(password-save,
163 [ --enable-password-save Allow --askpass and --auth-user-pass passwords to be read from a file],
164 [PASSWORD_SAVE="$enableval"],
168 AC_ARG_ENABLE(iproute2,
169 [ --enable-iproute2 Enable support for iproute2],
170 test $enableval = "yes" && AC_DEFINE(CONFIG_FEATURE_IPROUTE, 1, [enable iproute2 support])
173 AC_ARG_ENABLE(def-auth,
174 [ --disable-def-auth Disable deferred authentication],
175 [DEF_AUTH="$enableval"],
180 [ --disable-pf Disable internal packet filter],
185 AC_ARG_ENABLE(strict,
186 [ --enable-strict Enable strict compiler warnings (debugging option)],
187 [STRICT="$enableval"],
191 AC_ARG_ENABLE(pedantic,
192 [ --enable-pedantic Enable pedantic compiler warnings, will not generate a working executable (debugging option)],
193 [PEDANTIC="$enableval"],
197 AC_ARG_ENABLE(profiling,
198 [ --enable-profiling Enable profiling (debugging option)],
199 [PROFILE="$enableval"],
203 AC_ARG_ENABLE(strict-options,
204 [ --enable-strict-options Enable strict options check between peers (debugging option)],
205 [STRICT_OPTIONS="$enableval"],
206 [STRICT_OPTIONS="no"]
209 AC_ARG_ENABLE(selinux,
210 [ --disable-selinux Disable SELinux support],
211 [SELINUX="$enableval"],
215 AC_ARG_WITH(ssl-headers,
216 [ --with-ssl-headers=DIR Crypto/SSL Include files location],
217 [CS_HDR_DIR="$withval"]
218 [CPPFLAGS="$CPPFLAGS -I$withval"]
222 [ --with-ssl-lib=DIR Crypto/SSL Library location],
223 [LDFLAGS="$LDFLAGS -L$withval"]
226 AC_ARG_WITH(lzo-headers,
227 [ --with-lzo-headers=DIR LZO Include files location],
228 [LZO_HDR_DIR="$withval"]
229 [CPPFLAGS="$CPPFLAGS -I$withval"]
233 [ --with-lzo-lib=DIR LZO Library location],
234 [LDFLAGS="$LDFLAGS -L$withval"]
237 AC_ARG_WITH(pkcs11-helper-headers,
238 [ --with-pkcs11-helper-headers=DIR pkcs11-helper Include files location],
239 [PKCS11_HELPER_HDR_DIR="$withval"]
240 [CPPFLAGS="$CPPFLAGS -I$withval"]
243 AC_ARG_WITH(pkcs11-helper-lib,
244 [ --with-pkcs11-helper-lib=DIR pkcs11-helper Library location],
245 [LDFLAGS="$LDFLAGS -L$withval"]
248 AC_ARG_WITH(ifconfig-path,
249 [ --with-ifconfig-path=PATH Path to ifconfig tool],
250 [IFCONFIG="$withval"],
251 [AC_PATH_PROG([IFCONFIG], [ifconfig], [ifconfig], [$PATH:/usr/local/sbin:/usr/sbin:/sbin])]
253 AC_DEFINE_UNQUOTED(IFCONFIG_PATH, "$IFCONFIG", [Path to ifconfig tool])
255 AC_ARG_WITH(iproute-path,
256 [ --with-iproute-path=PATH Path to iproute tool],
257 [IPROUTE="$withval"],
258 [AC_PATH_PROG([IPROUTE], [ip], [ip], [$PATH:/usr/local/sbin:/usr/sbin:/sbin])]
260 AC_DEFINE_UNQUOTED(IPROUTE_PATH, "$IPROUTE", [Path to iproute tool])
263 AC_ARG_WITH(route-path,
264 [ --with-route-path=PATH Path to route tool],
266 [AC_PATH_PROG([ROUTE], [route], [route], [$PATH:/usr/local/sbin:/usr/sbin:/sbin])]
268 AC_DEFINE_UNQUOTED(ROUTE_PATH, "$ROUTE", [Path to route tool])
270 AC_ARG_WITH(mem-check,
271 [ --with-mem-check=TYPE Build with debug memory checking, TYPE = dmalloc or valgrind],
272 [MEMCHECK="$withval"]
275 dnl fix search path, to allow compilers to find syshead.h
276 CPPFLAGS="$CPPFLAGS -I${srcdir}"
279 openvpn_target=$target
280 if test $target_alias; then
281 openvpn_target=$target_alias
283 AC_DEFINE_UNQUOTED(TARGET_ALIAS, "$openvpn_target", [A string representing our target])
286 AC_DEFINE(TARGET_LINUX, 1, [Are we running on Linux?])
287 dnl RH9 SSL headers workaround
288 if test -z $CS_HDR_DIR && test "$CRYPTO" = "yes"; then
289 CPPFLAGS="$CPPFLAGS $(pkg-config --cflags openssl 2>/dev/null)"
293 AC_DEFINE(TARGET_SOLARIS, 1, [Are we running on Solaris?])
296 AC_DEFINE(TARGET_OPENBSD, 1, [Are we running on OpenBSD?])
299 AC_DEFINE(TARGET_FREEBSD, 1, [Are we running on FreeBSD?])
302 AC_DEFINE(TARGET_NETBSD, 1, [Are we running NetBSD?])
305 dnl some Mac OS X tendering (we use vararg macros...)
306 AC_DEFINE(TARGET_DARWIN, 1, [Are we running on Mac OS X?])
307 CPPFLAGS="$CPPFLAGS -no-cpp-precomp"
310 AC_DEFINE(TARGET_WIN32, 1, [Are we running WIN32?])
311 OPENVPN_ADD_LIBS(-lgdi32)
312 OPENVPN_ADD_LIBS(-lws2_32)
313 OPENVPN_ADD_LIBS(-lwininet)
314 OPENVPN_ADD_LIBS(-lcrypt32)
315 OPENVPN_ADD_LIBS(-liphlpapi)
316 OPENVPN_ADD_LIBS(-lwinmm)
319 AC_DEFINE(TARGET_DRAGONFLY, 1, [Are we running on DragonFlyBSD?])
324 dnl Checks for programs.
327 AC_PROG_GCC_TRADITIONAL
330 if test "${WIN32}" = "yes"; then
331 AC_ARG_VAR([MAN2HTML], [man2html utility])
332 AC_CHECK_PROGS([MAN2HTML], [man2html])
333 test -z "${MAN2HTML}" && AC_MSG_ERROR([man2html is required for win32])
336 dnl Checks for header files.
339 dnl Checks for typedefs, structures, and compiler characteristics.
349 AX_CPP_VARARG_MACRO_ISO
350 AX_CPP_VARARG_MACRO_GCC
353 dnl Check for more header files.
354 AC_CHECK_HEADERS(fcntl.h stdlib.h dnl
355 stdarg.h stdio.h string.h dnl
356 strings.h ctype.h errno.h dnl
359 if test "${WIN32}" != "yes"; then
361 AC_CHECK_HEADERS(sys/time.h sys/socket.h sys/un.h sys/ioctl.h sys/stat.h dnl
362 sys/mman.h fcntl.h sys/file.h stdlib.h stdint.h dnl
363 stdarg.h unistd.h signal.h stdio.h string.h dnl
364 strings.h ctype.h errno.h syslog.h pwd.h grp.h dnl
365 net/if_tun.h net/tun/if_tun.h stropts.h sys/sockio.h dnl
366 netinet/in.h netinet/in_systm.h dnl
367 netinet/tcp.h arpa/inet.h dnl
368 netdb.h sys/uio.h linux/if_tun.h linux/sockios.h dnl
369 linux/types.h sys/poll.h sys/epoll.h err.h dnl
371 AC_CHECK_HEADERS(net/if.h,,,
372 [#ifdef HAVE_SYS_SOCKET_H
373 # include <sys/socket.h>
376 AC_CHECK_HEADERS(netinet/ip.h,,,
377 [#ifdef HAVE_SYS_TYPES_H
378 # include <sys/types.h>
380 #ifdef HAVE_NETINET_IN_H
381 # include <netinet/in.h>
383 #ifdef HAVE_NETINET_IN_SYSTM_H
384 # include <netinet/in_systm.h>
387 AC_CHECK_HEADERS(netinet/if_ether.h,,,
388 [#ifdef HAVE_SYS_TYPES_H
389 # include <sys/types.h>
391 #ifdef HAVE_SYS_SOCKET_H
392 # include <sys/socket.h>
394 #ifdef HAVE_NETINET_IN_H
395 # include <netinet/in.h>
398 AC_CHECK_HEADERS(resolv.h,,,
399 [#ifdef HAVE_NETINET_IN_H
400 # include <netinet/in.h>
403 AC_CHECK_HEADERS(linux/errqueue.h,,,
404 [#ifdef HAVE_LINUX_TYPES_H
405 # include <linux/types.h>
412 dnl check that in_addr_t is defined
416 [AC_DEFINE(in_addr_t, uint32_t, [Some systems don't define in_addr_t])],
417 [#include "syshead.h"])
419 dnl check for basic types
423 [AC_DEFINE(uint8_t, unsigned char, [8-bit unsigned type])],
424 [#include "syshead.h"])
428 [AC_DEFINE(uint16_t, unsigned char, [16-bit unsigned type])],
429 [#include "syshead.h"])
433 [AC_DEFINE(uint32_t, unsigned long, [32-bit unsigned type])],
434 [#include "syshead.h"])
436 dnl check for IPv6 types
439 [AC_DEFINE(HAVE_TUN_PI, 1, [struct tun_pi needed for IPv6 support])],
441 [#include "syshead.h"])
444 [AC_DEFINE(HAVE_IPHDR, 1, [struct iphdr needed for IPv6 support])],
446 [#include "syshead.h"])
449 [AC_DEFINE(HAVE_IOVEC, 1, [struct iovec needed for IPv6 support])],
451 [#include "syshead.h"])
453 dnl check for extended socket error types
455 [struct sock_extended_err],
456 [AC_DEFINE(HAVE_SOCK_EXTENDED_ERR, 1, [struct sock_extended_err needed for extended socket error support])],
458 [#include "syshead.h"])
461 [AC_DEFINE(HAVE_MSGHDR, 1, [struct msghdr needed for extended socket error support])],
463 [#include "syshead.h"])
466 [AC_DEFINE(HAVE_CMSGHDR, 1, [struct cmsghdr needed for extended socket error support])],
468 [#include "syshead.h"])
471 [AC_DEFINE(HAVE_IN_PKTINFO, 1, [struct in_pktinfo needed for IP_PKTINFO support])],
473 [#include "syshead.h"])
475 AC_CHECK_SIZEOF(unsigned int)
476 AC_CHECK_SIZEOF(unsigned long)
480 AC_CHECK_FUNCS([ctime memset vsnprintf strdup], ,
481 [AC_MSG_ERROR([Required library function not found])])
482 AC_CHECK_FUNCS(daemon chroot getpwnam setuid nice system getpid dup dup2 dnl
483 getpass strerror syslog openlog mlockall getgrnam setgid dnl
484 setgroups stat flock readv writev time dnl
485 setsid chdir putenv getpeername unlink dnl
486 chsize ftruncate execve getpeereid umask)
488 # Windows use stdcall for winsock so we cannot auto detect these
489 m4_define([SOCKET_FUNCS], [socket recv recvfrom send sendto listen dnl
490 accept connect bind select gethostbyname inet_ntoa])
491 m4_define([SOCKET_OPT_FUNCS], [setsockopt getsockopt getsockname poll])
493 if test "${WIN32}" = "yes"; then
495 AC_DEFINE([HAVE_GETTIMEOFDAY], [1], [We fake gettimeofday for win32 at otime.c])
496 m4_foreach([F], m4_split(SOCKET_FUNCS SOCKET_OPT_FUNCS),
497 m4_define(UF, [[m4_join([_], [HAVE], m4_toupper(F))]])
498 AC_DEFINE([UF], [1], [Win32 builtin]))
502 dnl check for other types
505 dnl Check for libsocket
506 AC_SEARCH_LIBS(socket, socket)
509 AC_SEARCH_LIBS(inet_ntoa, nsl)
511 dnl Check for libresolv
512 AC_SEARCH_LIBS(gethostbyname, resolv nsl)
514 dnl optional library functions
517 AC_CHECK_FUNCS(gettimeofday)
519 AC_CHECK_FUNCS(SOCKET_FUNCS, ,
520 [AC_MSG_ERROR([Required library function not found])])
521 AC_CHECK_FUNCS(SOCKET_OPT_FUNCS sendmsg recvmsg)
525 dnl Required library functions
529 dnl Check for res_init
536 AC_MSG_RESULT([res_init DEFINED])
537 AC_DEFINE([HAVE_RES_INIT], 1, [Indicates if res_init is available])
539 AC_MSG_RESULT([res_init UNDEFINED])
546 dnl Checking for a working epoll
547 AC_CHECKING([for working epoll implementation])
548 OLDLDFLAGS="$LDFLAGS"
549 LDFLAGS="$LDFLAGS -Wl,--fatal-warnings"
550 AC_CHECK_FUNC(epoll_create, AC_DEFINE(HAVE_EPOLL_CREATE, 1, [epoll_create function is defined]))
551 LDFLAGS="$OLDLDFLAGS"
554 dnl check for valgrind tool
557 if test "$MEMCHECK" = "valgrind"; then
558 AC_CHECKING([for valgrind tool and Header files])
559 AC_CHECK_HEADER(valgrind/memcheck.h,
561 AC_DEFINE(USE_VALGRIND, 1, [Use valgrind memory debugging library])
562 CFLAGS="-g -fno-inline"
564 [AC_MSG_ERROR([valgrind headers not found.])]
569 dnl check for pthread library
572 if test "$PTHREAD" = "yes"; then
573 AC_CHECKING([for pthread support])
574 AC_MSG_RESULT([********* WARNING: pthread support is experimental for OpenVPN 2.0])
579 AC_MSG_RESULT([WARNING: pthread support on OpenBSD is unstable!])
580 CFLAGS="$CFLAGS -pthread"
583 LIBS="$PTHREAD_LIBS $LIBS"
584 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
586 AC_DEFINE(USE_PTHREAD, 1, [Use pthread-based multithreading])
589 AC_MSG_RESULT([I don't know how to build with pthread support on this platform.])
590 AC_MSG_ERROR([try ./configure --disable-pthread])
595 dnl check for dmalloc library
598 if test "$MEMCHECK" = "dmalloc"; then
599 AC_CHECKING([for dmalloc Library and Header files])
600 AC_CHECK_HEADER(dmalloc.h,
601 [AC_CHECK_LIB(dmalloc, malloc,
603 if test "$PTHREAD" = "yes"; then
604 OPENVPN_ADD_LIBS(-ldmallocth)
606 OPENVPN_ADD_LIBS(-ldmalloc)
608 AC_DEFINE(DMALLOC, 1, [Use dmalloc memory debugging library])
610 [AC_MSG_ERROR([dmalloc library not found.])]
612 [AC_MSG_ERROR([dmalloc headers not found.])]
617 dnl Check for dlopen -- first try libc then libdl.
619 if test "${WIN32}" != "yes"; then
620 if test "$PLUGINS" = "yes"; then
621 AC_CHECKING([for libdl Library and Header files])
622 AC_CHECK_HEADER(dlfcn.h,
623 [AC_CHECK_FUNC(dlopen,
624 [AC_DEFINE(USE_LIBDL, 1, [Use libdl for dynamic library loading])],
625 [AC_CHECK_LIB(dl, dlopen,
627 OPENVPN_ADD_LIBS(-ldl)
628 AC_DEFINE(USE_LIBDL, 1, [Use libdl for dynamic library loading])
630 [AC_MSG_RESULT([libdl library not found.])]
633 [AC_MSG_RESULT([libdl headers not found.])]
639 dnl Check if LoadLibrary exists on Windows
641 if test "${WIN32}" = "yes"; then
642 if test "$PLUGINS" = "yes"; then
648 AC_MSG_RESULT([LoadLibrary DEFINED])
649 AC_DEFINE(USE_LOAD_LIBRARY, 1, [Use LoadLibrary to load DLLs on Windows])
651 AC_MSG_RESULT([LoadLibrary UNDEFINED])
657 dnl check for LZO library
660 if test "$LZO" = "yes"; then
662 AC_CHECKING([for LZO Library and Header files])
663 AC_CHECK_HEADER(lzo/lzo1x.h,
666 AC_DEFINE(LZO_HEADER_DIR, 1, [Use lzo/ directory prefix for LZO header files (for LZO 2.0)])
668 [ AC_CHECK_HEADER(lzo1x.h, [ LZO_H="1" ; lzolibs=lzo ]) ]
671 if test -n "$LZO_H"; then
673 for i in $lzolibs ; do
674 if test $havelzolib = 1 ; then break ; fi
675 AC_CHECK_LIB($i, lzo1x_1_15_compress,
677 OPENVPN_ADD_LIBS(-l$i)
678 AC_DEFINE(USE_LZO, 1, [Use LZO compression library])
679 AC_DEFINE_UNQUOTED(LZO_VERSION_NUM, "$LZO_H", [LZO version number])
684 if test $havelzolib = 0 ; then
685 AC_MSG_ERROR([LZO headers were found but LZO library was not found])
688 AC_MSG_RESULT([LZO headers were not found])
689 AC_MSG_RESULT([LZO library available from http://www.oberhumer.com/opensource/lzo/])
690 AC_MSG_ERROR([Or try ./configure --disable-lzo])
695 dnl check for OpenSSL-crypto library
698 if test "$CRYPTO" = "yes"; then
699 AC_CHECKING([for OpenSSL Crypto Library and Header files])
700 AC_CHECK_HEADER(openssl/evp.h,,
701 [AC_MSG_ERROR([OpenSSL Crypto headers not found.])])
703 for lib in crypto eay32; do
704 AC_CHECK_LIB($lib, EVP_CIPHER_CTX_init,
707 OPENVPN_ADD_LIBS(-l$lib)
712 test -n "$cryptofound" || AC_MSG_ERROR([OpenSSL Crypto library not found.])
714 AC_MSG_CHECKING([that OpenSSL Library is at least version 0.9.6])
717 #include <openssl/evp.h>
718 #if SSLEAY_VERSION_NUMBER >= 0x00906000L
724 AC_DEFINE(USE_CRYPTO, 1, [Use OpenSSL crypto library])
725 AC_CHECK_FUNCS(EVP_CIPHER_CTX_set_key_length)
727 dnl check for OpenSSL crypto acceleration capability
728 AC_CHECK_HEADERS(openssl/engine.h)
729 AC_CHECK_FUNCS(ENGINE_load_builtin_engines)
730 AC_CHECK_FUNCS(ENGINE_register_all_complete)
731 AC_CHECK_FUNCS(ENGINE_cleanup)
733 [AC_MSG_ERROR([OpenSSL crypto Library is too old.])]
737 dnl check for OpenSSL-SSL library
740 if test "$SSL" = "yes"; then
741 AC_CHECKING([for OpenSSL SSL Library and Header files])
742 AC_CHECK_HEADER(openssl/ssl.h,,
743 [AC_MSG_ERROR([OpenSSL SSL headers not found.])]
746 for lib in ssl ssl32; do
747 AC_CHECK_LIB($lib, SSL_CTX_new,
750 OPENVPN_ADD_LIBS(-l$lib)
755 test -n "${sslfound}" || AC_MSG_ERROR([OpenSSL SSL library not found.])
757 if test "$MEMCHECK" = "ssl"; then
758 AC_CHECKING([for Memory Debugging Capabilities in OpenSSL Library])
759 AC_CHECK_LIB(ssl, CRYPTO_mem_ctrl,
761 AC_DEFINE(CRYPTO_MDEBUG, 1, [Use memory debugging function in OpenSSL])
762 AC_MSG_RESULT([NOTE: OpenSSL library must be compiled with CRYPTO_MDEBUG])
764 [AC_MSG_ERROR([Memory Debugging function in OpenSSL library not found.])]
768 AC_DEFINE(USE_SSL, 1, [Use OpenSSL SSL library])
772 dnl enable pkcs11 capability
773 if test "$PKCS11" = "yes"; then
774 AC_CHECKING([for pkcs11-helper Library and Header files])
775 AC_CHECK_HEADER(pkcs11-helper-1.0/pkcs11h-core.h,
776 [AC_CHECK_LIB(pkcs11-helper, pkcs11h_initialize,
778 AC_DEFINE(USE_PKCS11, 1, [Enable PKCS11 capability])
779 OPENVPN_ADD_LIBS(-lpkcs11-helper)
781 [AC_MSG_RESULT([pkcs11-helper library not found.])]
783 [AC_MSG_RESULT([pkcs11-helper headers not found.])]
787 dnl enable multi-client mode
788 if test "$MULTI" = "yes"; then
789 AC_DEFINE(ENABLE_CLIENT_SERVER, 1, [Enable client/server capability])
792 dnl enable client mode only, not server
793 if test "$MULTI_SERVER" = "no"; then
794 AC_DEFINE(ENABLE_CLIENT_ONLY, 1, [Enable client capability only])
797 dnl enable management server capability
798 if test "$MANAGEMENT" = "yes"; then
799 AC_DEFINE(ENABLE_MANAGEMENT, 1, [Enable management server capability])
803 if test "$SOCKS" = "yes"; then
804 AC_DEFINE(ENABLE_SOCKS, 1, [Enable Socks proxy support])
807 dnl enable HTTP proxy
808 if test "$HTTP_PROXY" = "yes"; then
809 AC_DEFINE(ENABLE_HTTP_PROXY, 1, [Enable HTTP proxy support])
812 dnl compile --multihome option
813 if test "$MULTIHOME" = "yes"; then
814 AC_DEFINE(ENABLE_MULTIHOME, 1, [Enable multi-homed UDP server capability])
818 if test "$DEBUG" = "yes"; then
819 AC_DEFINE(ENABLE_DEBUG, 1, [Enable debugging support])
822 dnl enable small size optimizations
823 if test "$SMALL" = "yes"; then
824 AC_DEFINE(ENABLE_SMALL, 1, [Enable smaller executable size])
827 dnl enable --fragment
828 if test "$FRAGMENT" = "yes"; then
829 AC_DEFINE(ENABLE_FRAGMENT, 1, [Enable internal fragmentation support])
832 dnl enable --port-share
833 if test "$PORT_SHARE" = "yes"; then
834 AC_DEFINE(ENABLE_PORT_SHARE, 1, [Enable TCP Server port sharing])
837 dnl enable deferred auth
838 if test "$DEF_AUTH" = "yes"; then
839 AC_DEFINE(CONFIGURE_DEF_AUTH, 1, [Enable deferred authentication])
842 dnl enable internal packet filter
843 if test "$PF" = "yes"; then
844 AC_DEFINE(CONFIGURE_PF, 1, [Enable internal packet filter])
847 dnl enable strict compiler warnings
848 if test "$STRICT" = "yes"; then
849 CFLAGS="$CFLAGS -Wall -Wno-unused-parameter -Wno-unused-function"
852 dnl enable pedantic compiler warnings
853 if test "$PEDANTIC" = "yes"; then
854 CFLAGS="$CFLAGS -ansi -pedantic"
858 if test "$PROFILE" = "yes"; then
859 CFLAGS="$CFLAGS -pg -DENABLE_PROFILING"
862 dnl enable strict options check between peers
863 if test "$STRICT_OPTIONS" = "yes"; then
864 AC_DEFINE(STRICT_OPTIONS_CHECK, 1, [Enable strict options check between peers])
867 dnl enable password save
868 if test "$PASSWORD_SAVE" = "yes"; then
869 AC_DEFINE(ENABLE_PASSWORD_SAVE, 1, [Allow --askpass and --auth-user-pass passwords to be read from a file])
873 dnl check for SELinux library and headers
875 if test "$SELINUX" = "yes"; then
876 AC_CHECKING([for libselinux Library and Header files])
877 AC_CHECK_HEADER(selinux/selinux.h,
878 [AC_CHECK_LIB(selinux, setcon,
880 OPENVPN_ADD_LIBS(-lselinux)
881 AC_DEFINE(HAVE_SETCON, 1, [SELinux support])
883 [AC_MSG_RESULT([SELinux library not found.])]
885 [AC_MSG_RESULT([SELinux headers not found.])]
889 TAP_ID="PRODUCT_TAP_ID"
890 TAP_WIN32_MIN_MAJOR="PRODUCT_TAP_WIN32_MIN_MAJOR"
891 TAP_WIN32_MIN_MINOR="PRODUCT_TAP_WIN32_MIN_MINOR"
892 AC_DEFINE_UNQUOTED(TAP_ID, "${TAP_ID}", [The TAP-Win32 id defined in tap-win32/SOURCES])
893 AC_DEFINE_UNQUOTED(TAP_WIN32_MIN_MAJOR, ${TAP_WIN32_MIN_MAJOR}, [The TAP-Win32 version number is defined in tap-win32/SOURCES])
894 AC_DEFINE_UNQUOTED(TAP_WIN32_MIN_MINOR, ${TAP_WIN32_MIN_MINOR}, [The TAP-Win32 version number is defined in tap-win32/SOURCES])
896 AC_SUBST(TAP_WIN32_MIN_MAJOR)
897 AC_SUBST(TAP_WIN32_MIN_MINOR)
899 win32datadir="\${datadir}/${PACKAGE}-win32"
900 AC_SUBST(win32datadir)
901 AM_CONDITIONAL(WIN32, test "${WIN32}" = "yes")
903 # workaround for <autoconf-2.60
904 if test -z "${docdir}"; then
905 docdir="\$(datadir)/doc/\$(PACKAGE_NAME)"
908 if test -z "${htmldir}"; then
919 service-win32/Makefile
920 install-win32/Makefile
921 install-win32/settings