~ubuntu-branches/ubuntu/precise/openvpn/precise-updates

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Bhavani Shankar
  • Date: 2009-07-24 19:22:13 UTC
  • mfrom: (1.1.13 upstream) (10.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090724192213-cy0pox13ulk4hdam
Tags: 2.1~rc19-1ubuntu1
* Merge from debian unstable (LP: #404099), remaining changes:
  - debian/openvpn.init.d:
    - Do not use start-stop-daemon and use < /dev/null to avoid blocking boot
    - show per-VPN result messages
    - add "--script-security 2" by default for backwards compatibility
    - Added lsb-base>=3.2-14 depend to allow status_of_proc()

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
dnl             packet encryption, packet authentication, and
5
5
dnl             packet compression.
6
6
dnl
7
 
dnl  Copyright (C) 2002-2008 OpenVPN Technologies, Inc. <sales@openvpn.net>
 
7
dnl  Copyright (C) 2002-2009 OpenVPN Technologies, Inc. <sales@openvpn.net>
8
8
dnl
9
9
dnl  This program is free software; you can redistribute it and/or modify
10
10
dnl  it under the terms of the GNU General Public License as published by
44
44
WIN32="no"
45
45
CYGWIN="no"
46
46
case "${host}" in
47
 
        *-mingw32*)
 
47
        *-mingw*)
48
48
                WIN32="yes"
49
49
                cross_compiling="yes"
50
50
        ;;
679
679
 
680
680
if test "$CRYPTO" = "yes"; then
681
681
   AC_CHECKING([for OpenSSL Crypto Library and Header files])
682
 
   AC_CHECK_HEADER(openssl/evp.h,
683
 
        [AC_CHECK_LIB(crypto, EVP_CIPHER_CTX_init,
 
682
   AC_CHECK_HEADER(openssl/evp.h,,
 
683
        [AC_MSG_ERROR([OpenSSL Crypto headers not found.])])
 
684
 
 
685
   for lib in crypto eay32; do
 
686
      AC_CHECK_LIB($lib, EVP_CIPHER_CTX_init,
684
687
            [
685
 
                   AC_CHECKING([that OpenSSL Library is at least version 0.9.6])
686
 
                   AC_EGREP_CPP(yes,
687
 
                     [
688
 
                       #include <openssl/evp.h>
689
 
                       #if SSLEAY_VERSION_NUMBER >= 0x00906000L
690
 
                         yes
691
 
                       #endif
692
 
                     ],
693
 
                     [
694
 
                       AC_DEFINE(USE_CRYPTO, 1, [Use OpenSSL crypto library])
695
 
                       if test "${WIN32}" = "yes"; then
696
 
                         OPENVPN_ADD_LIBS(-leay32)
697
 
                       else
698
 
                         OPENVPN_ADD_LIBS(-lcrypto)
699
 
                       fi
700
 
                       AC_CHECK_FUNCS(EVP_CIPHER_CTX_set_key_length)
701
 
 
702
 
                       dnl check for OpenSSL crypto acceleration capability
703
 
                       AC_CHECK_HEADERS(openssl/engine.h)
704
 
                       AC_CHECK_FUNCS(ENGINE_load_builtin_engines)
705
 
                       AC_CHECK_FUNCS(ENGINE_register_all_complete)
706
 
                       AC_CHECK_FUNCS(ENGINE_cleanup)
707
 
                     ],
708
 
                     [AC_MSG_ERROR([OpenSSL crypto Library is too old.])]
709
 
                   )
710
 
            ],
711
 
            [AC_MSG_ERROR([OpenSSL Crypto library not found.])]
712
 
        )],
713
 
        [AC_MSG_ERROR([OpenSSL Crypto headers not found.])]
 
688
                cryptofound=1
 
689
                OPENVPN_ADD_LIBS(-l$lib)
 
690
            ]
 
691
      )
 
692
   done
 
693
 
 
694
   test -n "$cryptofound" || AC_MSG_ERROR([OpenSSL Crypto library not found.])
 
695
 
 
696
   AC_MSG_CHECKING([that OpenSSL Library is at least version 0.9.6])
 
697
   AC_EGREP_CPP(yes,
 
698
     [
 
699
       #include <openssl/evp.h>
 
700
       #if SSLEAY_VERSION_NUMBER >= 0x00906000L
 
701
         yes
 
702
       #endif
 
703
     ],
 
704
     [
 
705
       AC_MSG_RESULT([yes])
 
706
       AC_DEFINE(USE_CRYPTO, 1, [Use OpenSSL crypto library])
 
707
       AC_CHECK_FUNCS(EVP_CIPHER_CTX_set_key_length)
 
708
 
 
709
       dnl check for OpenSSL crypto acceleration capability
 
710
       AC_CHECK_HEADERS(openssl/engine.h)
 
711
       AC_CHECK_FUNCS(ENGINE_load_builtin_engines)
 
712
       AC_CHECK_FUNCS(ENGINE_register_all_complete)
 
713
       AC_CHECK_FUNCS(ENGINE_cleanup)
 
714
     ],
 
715
     [AC_MSG_ERROR([OpenSSL crypto Library is too old.])]
714
716
   )
715
717
 
716
718
dnl
719
721
 
720
722
   if test "$SSL" = "yes"; then
721
723
      AC_CHECKING([for OpenSSL SSL Library and Header files])
722
 
      AC_CHECK_HEADER(openssl/ssl.h,
723
 
           [AC_CHECK_LIB(ssl, SSL_CTX_new,
724
 
               [
725
 
                  if test "$MEMCHECK" = "ssl"; then
726
 
                     AC_CHECKING([for Memory Debugging Capabilities in OpenSSL Library])
727
 
                     AC_CHECK_LIB(ssl, CRYPTO_mem_ctrl,
728
 
                         [
729
 
                             AC_DEFINE(CRYPTO_MDEBUG, 1, [Use memory debugging function in OpenSSL])
730
 
                             AC_MSG_RESULT([NOTE: OpenSSL library must be compiled with CRYPTO_MDEBUG])
731
 
                         ],
732
 
                         [AC_MSG_ERROR([Memory Debugging function in OpenSSL library not found.])]
733
 
                     )
734
 
                  fi
735
 
               ],
736
 
               [AC_MSG_ERROR([OpenSSL SSL library not found.])]
737
 
           )],
 
724
      AC_CHECK_HEADER(openssl/ssl.h,,
738
725
           [AC_MSG_ERROR([OpenSSL SSL headers not found.])]
739
726
      )
 
727
 
 
728
      for lib in ssl ssl32; do
 
729
          AC_CHECK_LIB($lib, SSL_CTX_new,
 
730
                [
 
731
                        sslfound=1
 
732
                        OPENVPN_ADD_LIBS(-l$lib)
 
733
                ]
 
734
          )
 
735
      done
 
736
 
 
737
      test -n "${sslfound}" || AC_MSG_ERROR([OpenSSL SSL library not found.])
 
738
 
 
739
      if test "$MEMCHECK" = "ssl"; then
 
740
             AC_CHECKING([for Memory Debugging Capabilities in OpenSSL Library])
 
741
             AC_CHECK_LIB(ssl, CRYPTO_mem_ctrl,
 
742
                 [
 
743
                     AC_DEFINE(CRYPTO_MDEBUG, 1, [Use memory debugging function in OpenSSL])
 
744
                     AC_MSG_RESULT([NOTE: OpenSSL library must be compiled with CRYPTO_MDEBUG])
 
745
                 ],
 
746
                 [AC_MSG_ERROR([Memory Debugging function in OpenSSL library not found.])]
 
747
             )
 
748
      fi
 
749
 
740
750
      AC_DEFINE(USE_SSL, 1, [Use OpenSSL SSL library])
741
 
      if test "${WIN32}" = "yes"; then
742
 
        OPENVPN_ADD_LIBS(-lssl32)
743
 
      else
744
 
        OPENVPN_ADD_LIBS(-lssl)
745
 
      fi
746
751
   fi
747
752
fi
748
753
 
852
857
 
853
858
# workaround for <autoconf-2.60
854
859
if test -z "${docdir}"; then
855
 
        docdir="\$(datarootdir)/doc/\$(PACKAGE_NAME)"
 
860
        docdir="\$(datadir)/doc/\$(PACKAGE_NAME)"
856
861
        AC_SUBST([docdir])
857
862
fi
858
863
if test -z "${htmldir}"; then