~ubuntu-branches/ubuntu/saucy/openvpn/saucy

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Alberto Gonzalez Iniesta
  • Date: 2005-01-05 19:03:11 UTC
  • mto: (1.4.1) (10.1.1 lenny)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20050105190311-d0uioiqtor5xbzre
Tags: upstream-1.99+2.rc6
ImportĀ upstreamĀ versionĀ 1.99+2.rc6

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
AC_PREREQ(2.50)
27
27
 
28
 
AC_INIT([OpenVPN], [1.6.0], [openvpn-users@lists.sourceforge.net], [openvpn])
 
28
AC_INIT([OpenVPN], [2.0_rc6], [openvpn-users@lists.sourceforge.net], [openvpn])
29
29
AM_CONFIG_HEADER(config.h)
30
30
AC_CONFIG_SRCDIR(syshead.h)
31
31
 
32
32
AC_ARG_ENABLE(lzo,
33
 
   [  --disable-lzo           Do not compile LZO compression support],
 
33
   [  --disable-lzo           Disable LZO compression support],
34
34
   [LZO="$enableval"],
35
35
   [LZO="yes"]
36
36
)
37
37
 
38
38
AC_ARG_ENABLE(crypto,
39
 
   [  --disable-crypto        Do not compile OpenSSL crypto support],
 
39
   [  --disable-crypto        Disable OpenSSL crypto support],
40
40
   [CRYPTO="$enableval"],
41
41
   [CRYPTO="yes"]
42
42
)
43
43
 
44
44
AC_ARG_ENABLE(ssl,
45
 
   [  --disable-ssl           Do not compile OpenSSL SSL support for TLS-based key exchange],
 
45
   [  --disable-ssl           Disable OpenSSL SSL support for TLS-based key exchange],
46
46
   [SSL="$enableval"],
47
47
   [SSL="yes"]
48
48
)
49
49
 
 
50
AC_ARG_ENABLE(multi,
 
51
   [  --disable-multi         Disable client/server support (--mode server + client mode)],
 
52
   [MULTI="$enableval"],
 
53
   [MULTI="yes"]
 
54
)
 
55
 
 
56
AC_ARG_ENABLE(server,
 
57
   [  --disable-server        Disable server support only (but retain client support)],
 
58
   [MULTI_SERVER="$enableval"],
 
59
   [MULTI_SERVER="yes"]
 
60
)
 
61
 
 
62
AC_ARG_ENABLE(plugins,
 
63
   [  --disable-plugins       Disable plug-in support],
 
64
   [PLUGINS="$enableval"],
 
65
   [PLUGINS="yes"]
 
66
)
 
67
 
 
68
AC_ARG_ENABLE(management,
 
69
   [  --disable-management    Disable management server support],
 
70
   [MANAGEMENT="$enableval"],
 
71
   [MANAGEMENT="yes"]
 
72
)
 
73
 
 
74
AC_ARG_ENABLE(socks,
 
75
   [  --disable-socks         Disable Socks support],
 
76
   [SOCKS="$enableval"],
 
77
   [SOCKS="yes"]
 
78
)
 
79
 
 
80
AC_ARG_ENABLE(http,
 
81
   [  --disable-http          Disable HTTP proxy support],
 
82
   [HTTP_PROXY="$enableval"],
 
83
   [HTTP_PROXY="yes"]
 
84
)
 
85
 
 
86
AC_ARG_ENABLE(fragment,
 
87
   [  --disable-fragment      Disable internal fragmentation support (--fragment)],
 
88
   [FRAGMENT="$enableval"],
 
89
   [FRAGMENT="yes"]
 
90
)
 
91
 
 
92
AC_ARG_ENABLE(debug,
 
93
   [  --disable-debug         Disable debugging support (disable gremlin and verb 7+ messages)],
 
94
   [DEBUG="$enableval"],
 
95
   [DEBUG="yes"]
 
96
)
 
97
 
 
98
AC_ARG_ENABLE(small,
 
99
   [  --enable-small          Enable smaller executable size (disable OCC, usage message, and verb 4 parm list)],
 
100
   [SMALL="$enableval"],
 
101
   [SMALL="no"]
 
102
)
 
103
 
50
104
AC_ARG_ENABLE(pthread,
51
 
   [  --enable-pthread        Compile pthread support for improved SSL/TLS latency],
 
105
   [  --enable-pthread        Enable pthread support (Experimental for OpenVPN 2.0)],
52
106
   [PTHREAD="$enableval"],
53
107
   [PTHREAD="no"]
54
108
)
55
109
 
 
110
AC_ARG_ENABLE(password-save,
 
111
   [  --enable-password-save  Allow --askpass and --auth-user-pass passwords to be read from a file],
 
112
   [PASSWORD_SAVE="$enableval"],
 
113
   [PASSWORD_SAVE="no"]
 
114
)
 
115
 
 
116
AC_ARG_ENABLE(iproute2,
 
117
   [  --enable-iproute2       Enable support for iproute2],
 
118
   AC_DEFINE(CONFIG_FEATURE_IPROUTE, 1, [enable iproute2 support])   
 
119
)
 
120
 
56
121
AC_ARG_ENABLE(strict,
57
 
   [  --enable-strict         Enable strict compiler warnings],
 
122
   [  --enable-strict         Enable strict compiler warnings (debugging option)],
58
123
   [STRICT="$enableval"],
59
124
   [STRICT="no"]
60
125
)
61
126
 
62
127
AC_ARG_ENABLE(profiling,
63
 
   [  --enable-profiling      Enable profiling],
 
128
   [  --enable-profiling      Enable profiling (debugging option)],
64
129
   [PROFILE="$enableval"],
65
130
   [PROFILE="no"]
66
131
)
67
132
 
68
 
AC_ARG_ENABLE(mtu-dynamic,
69
 
   [  --disable-mtu-dynamic   Disable dynamic MTU support],
70
 
   [DYNAMIC_MTU="$enableval"],
71
 
   [DYNAMIC_MTU="yes"]
72
 
)
73
 
 
74
133
AC_ARG_ENABLE(strict-options,
75
 
   [  --enable-strict-options Enable strict options check between peers],
 
134
   [  --enable-strict-options Enable strict options check between peers (debugging option)],
76
135
   [STRICT_OPTIONS="$enableval"],
77
136
   [STRICT_OPTIONS="no"]
78
137
)
121
180
)
122
181
AC_DEFINE_UNQUOTED(ROUTE_PATH, "$ROUTE", [Path to route tool])
123
182
 
124
 
AC_ARG_WITH(leak-check,
125
 
   [  --with-leak-check=TYPE  Build with memory leak checking, TYPE = dmalloc or ssl],
126
 
   [LEAK="$withval"]
127
 
)
128
 
 
129
 
AC_ARG_ENABLE(iproute2,
130
 
   [  --enable-iproute2       Enable support for iproute2],
131
 
   AC_DEFINE(CONFIG_FEATURE_IPROUTE, 1, [enable iproute2 support])
132
 
   
133
 
)
134
 
 
 
183
AC_ARG_WITH(mem-check,
 
184
   [  --with-mem-check=TYPE  Build with debug memory checking, TYPE = dmalloc or valgrind],
 
185
   [MEMCHECK="$withval"]
 
186
)
135
187
 
136
188
dnl Guess host type.
137
189
AC_CANONICAL_HOST
200
252
AC_HEADER_TIME
201
253
AX_CPP_VARARG_MACRO_ISO
202
254
AX_CPP_VARARG_MACRO_GCC
 
255
AX_EMPTY_ARRAY
203
256
 
204
257
dnl Check for more header files.
205
258
AC_HEADER_SYS_WAIT
211
264
                 netinet/in.h netinet/in_systm.h netinet/ip.h dnl
212
265
                 netinet/if_ether.h netinet/tcp.h resolv.h arpa/inet.h dnl
213
266
                 netdb.h sys/uio.h linux/if_tun.h linux/sockios.h dnl
214
 
                 linux/types.h linux/errqueue.h
 
267
                 linux/types.h linux/errqueue.h dnl
 
268
                 sys/poll.h sys/epoll.h
215
269
)
216
270
AC_CACHE_SAVE
217
271
 
296
350
AC_CHECK_FUNCS(daemon chroot getpwnam setuid nice system getpid dup dup2 dnl
297
351
               getpass strerror syslog openlog mlockall getgrnam setgid dnl
298
352
               setgroups stat flock readv writev setsockopt getsockopt dnl
299
 
               setsid chdir gettimeofday putenv getpeername)
300
 
AC_REPLACE_FUNCS(inet_aton)
 
353
               setsid chdir gettimeofday putenv getpeername unlink dnl
 
354
               poll chsize ftruncate)
301
355
AC_CACHE_SAVE
302
356
 
303
357
dnl Required library functions
312
366
dnl check libraries
313
367
dnl
314
368
 
 
369
dnl Checking for a working epoll
 
370
AC_CHECKING([for working epoll implementation])
 
371
OLDLDFLAGS="$LDFLAGS"
 
372
LDFLAGS="$LDFLAGS -Wl,--fatal-warnings"
 
373
AC_CHECK_FUNCS(epoll_create, AC_DEFINE([HAVE_EPOLL_CREATE], 1, []))
 
374
LDFLAGS="$OLDLDFLAGS"
 
375
 
 
376
dnl
 
377
dnl check for valgrind tool
 
378
dnl
 
379
 
 
380
if test "$MEMCHECK" = "valgrind"; then
 
381
   AC_CHECKING([for valgrind tool and Header files])
 
382
   AC_CHECK_HEADER(valgrind/memcheck.h, 
 
383
        [
 
384
            AC_DEFINE(USE_VALGRIND, 1, [Use valgrind memory debugging library])
 
385
            CFLAGS="-g -fno-inline"
 
386
        ],
 
387
        [AC_MSG_ERROR([valgrind headers not found.])]
 
388
   )
 
389
fi
 
390
 
315
391
dnl
316
392
dnl check for pthread library
317
393
dnl
318
394
 
319
395
if test "$PTHREAD" = "yes"; then
320
 
   AC_CHECKING([for pthread support])
321
 
   ACX_PTHREAD(
322
 
        [
 
396
  AC_CHECKING([for pthread support])
 
397
  AC_MSG_RESULT([********* WARNING: pthread support is experimental for OpenVPN 2.0])
 
398
  ACX_PTHREAD(
 
399
        [
323
400
            case "$target" in
324
401
            *openbsd*)
325
402
                AC_MSG_RESULT([WARNING: pthread support on OpenBSD is unstable!])
341
418
dnl check for dmalloc library
342
419
dnl
343
420
 
344
 
if test "$LEAK" = "dmalloc"; then
 
421
if test "$MEMCHECK" = "dmalloc"; then
345
422
   AC_CHECKING([for dmalloc Library and Header files])
346
423
   AC_CHECK_HEADER(dmalloc.h, 
347
424
        [AC_CHECK_LIB(dmalloc, malloc,
360
437
fi
361
438
 
362
439
dnl
 
440
dnl Check for libdl library
 
441
dnl
 
442
if test "$PLUGINS" = "yes"; then
 
443
   AC_CHECKING([for libdl Library and Header files])
 
444
   AC_CHECK_HEADER(dlfcn.h, 
 
445
        [AC_CHECK_LIB(dl, dlopen,
 
446
            [
 
447
               OPENVPN_ADD_LIBS(-ldl)
 
448
               AC_DEFINE(USE_LIBDL, 1, [Use libdl for dynamic library loading])
 
449
            ],
 
450
            [AC_MSG_RESULT([libdl library not found.])]
 
451
        )],
 
452
        [AC_MSG_RESULT([libdl headers not found.])]
 
453
   )
 
454
fi
 
455
 
 
456
dnl
363
457
dnl check for LZO library
364
458
dnl
365
459
 
390
484
   AC_CHECK_HEADER(openssl/evp.h,
391
485
        [AC_CHECK_LIB(crypto, EVP_CIPHER_CTX_init,
392
486
            [
393
 
                   AC_CHECKING([that OpenSSL Library is at least version 0.9.5])
 
487
                   AC_CHECKING([that OpenSSL Library is at least version 0.9.6])
394
488
                   AC_EGREP_CPP(yes,
395
489
                     [
396
490
                       #include "openssl/evp.h"
397
 
                       #if SSLEAY_VERSION_NUMBER >= 0x00905000L
 
491
                       #if SSLEAY_VERSION_NUMBER >= 0x00906000L
398
492
                         yes
399
493
                       #endif
400
494
                     ],
402
496
                       AC_DEFINE(USE_CRYPTO, 1, [Use OpenSSL crypto library])
403
497
                       OPENVPN_ADD_LIBS(-lcrypto)
404
498
                       AC_CHECK_FUNCS(EVP_CIPHER_CTX_set_key_length)
 
499
 
 
500
                       dnl check for OpenSSL crypto acceleration capability
 
501
                       AC_CHECK_HEADERS(openssl/engine.h)
 
502
                       AC_CHECK_FUNCS(ENGINE_load_builtin_engines)
 
503
                       AC_CHECK_FUNCS(ENGINE_register_all_complete)
 
504
                       AC_CHECK_FUNCS(ENGINE_cleanup)
405
505
                     ],
406
506
                     [AC_MSG_ERROR([OpenSSL crypto Library is too old.])]
407
507
                   )
420
520
      AC_CHECK_HEADER(openssl/ssl.h,
421
521
           [AC_CHECK_LIB(ssl, SSL_CTX_new,
422
522
               [
423
 
                  if test "$LEAK" = "ssl"; then
 
523
                  if test "$MEMCHECK" = "ssl"; then
424
524
                     AC_CHECKING([for Memory Debugging Capabilities in OpenSSL Library])
425
525
                     AC_CHECK_LIB(ssl, CRYPTO_mem_ctrl,
426
526
                         [
440
540
   fi
441
541
fi
442
542
 
 
543
dnl enable multi-client mode
 
544
if test "$MULTI" = "yes"; then
 
545
   AC_DEFINE(ENABLE_CLIENT_SERVER, 1, [Enable client/server capability])
 
546
fi
 
547
 
 
548
dnl enable client mode only, not server
 
549
if test "$MULTI_SERVER" = "no"; then
 
550
   AC_DEFINE(ENABLE_CLIENT_ONLY, 1, [Enable client capability only])
 
551
fi
 
552
 
 
553
dnl enable management server capability
 
554
if test "$MANAGEMENT" = "yes"; then
 
555
   AC_DEFINE(ENABLE_MANAGEMENT, 1, [Enable management server capability])
 
556
fi
 
557
 
 
558
dnl enable socks 
 
559
if test "$SOCKS" = "yes"; then
 
560
   AC_DEFINE(ENABLE_SOCKS, 1, [Enable Socks proxy support])
 
561
fi
 
562
 
 
563
dnl enable HTTP proxy
 
564
if test "$HTTP_PROXY" = "yes"; then
 
565
   AC_DEFINE(ENABLE_HTTP_PROXY, 1, [Enable HTTP proxy support])
 
566
fi
 
567
 
 
568
dnl enable debugging
 
569
if test "$DEBUG" = "yes"; then
 
570
   AC_DEFINE(ENABLE_DEBUG, 1, [Enable debugging support])
 
571
fi
 
572
 
 
573
dnl enable small size optimizations
 
574
if test "$SMALL" = "yes"; then
 
575
   AC_DEFINE(ENABLE_SMALL, 1, [Enable smaller executable size])
 
576
fi
 
577
 
 
578
dnl enable --fragment
 
579
if test "$FRAGMENT" = "yes"; then
 
580
   AC_DEFINE(ENABLE_FRAGMENT, 1, [Enable internal fragmentation support])
 
581
fi
 
582
 
443
583
dnl enable strict compiler warnings
444
584
if test "$STRICT" = "yes"; then
445
 
   CFLAGS="$CFLAGS -Wall -W -Wpointer-arith -Wsign-compare -Winline -Wno-unused-parameter"
 
585
   CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wsign-compare -Wno-unused-parameter -Wno-unused-function"
446
586
fi
447
587
 
448
588
dnl enable profiling
455
595
   AC_DEFINE(STRICT_OPTIONS_CHECK, 1, [Enable strict options check between peers])
456
596
fi
457
597
 
458
 
dnl enable dynamic MTU capability
459
 
if test "$DYNAMIC_MTU" = "yes"; then
460
 
   AC_DEFINE(FRAGMENT_ENABLE, 1, [Enable dynamic MTU capability])
 
598
dnl enable password save
 
599
if test "$PASSWORD_SAVE" = "yes"; then
 
600
   AC_DEFINE(ENABLE_PASSWORD_SAVE, 1, [Allow --askpass and --auth-user-pass passwords to be read from a file])
461
601
fi
462
602
 
463
603
AC_OUTPUT(Makefile openvpn.spec config-win32.h install-win32/openvpn.nsi)