1
  
2
  
3
  
4
  
5
  
6
  
7
  
8
  
9
  
10
  
11
  
12
  
13
  
14
  
15
  
16
  
17
  
18
  
19
  
20
  
21
  
22
  
23
  
24
  
25
  
26
  
27
  
28
  
29
  
30
  
31
  
32
  
33
  
34
  
35
  
36
  
37
  
38
  
39
  
40
  
41
  
42
  
43
  
44
  
45
  
46
  
47
  
48
  
49
  
50
  
51
  
52
  
53
  
54
  
55
  
56
  
57
  
58
  
59
  
60
  
61
  
62
  
63
  
64
  
AC_INIT(ssleay.c) 
 
AC_CONFIG_HEADER(config.h) 
 
sinclude(../module_configure.in) 
 
AC_ARG_WITH(ssleay,  [  --with-ssleay       enable the ssleay-module],[],[with_ssleay=no]) 
 
if test x$with_ssleay = xyes; then 
  OLD_LDFLAGS=$LDFLAGS 
  OLD_CPPFLAGS=$CPPFLAGS 
  OLD_LIBS=$LIBS 
 
  AC_MSG_CHECKING(Checking for existance of SSLeay) 
   
  AC_CACHE_VAL(pike_cv_ssleay_exists, 
  [ 
    if test -d /usr/local/ssl ; then 
      pike_cv_ssleay_exists="yes" 
    else 
      pike_cv_ssleay_exists="no" 
    fi 
  ]) 
   
  AC_MSG_RESULT($pike_cv_ssleay_exists) 
   
  if test x$pike_cv_ssleay_exists = xyes; then 
   
    if test -d /usr/local/ssl/lib ; then 
      echo Added /usr/local/ssl/lib to the library search path. 
      LDFLAGS="-L/usr/local/ssl/lib ${LDFLAGS}" 
      # link with libc first, so we get the right definition 
      # of crypt() 
      LDFLAGS="-lc ${LDFLAGS}" 
    fi 
 
    if test -d /usr/local/ssl/include ; then 
      echo Added /usr/local/ssl/include to the include search path. 
      CPPFLAGS="-I/usr/local/ssl/include ${CPPFLAGS}" 
    fi 
 
    pike_cv_ssleay="yes" 
 
    AC_CHECK_LIB(crypto, ERR_print_errors_fp, [], [ pike_cv_ssleay="no" ]) 
    AC_CHECK_LIB(ssl, SSL_use_PrivateKey_file, [], [ pike_cv_ssleay="no" ]) 
 
    AC_MSG_CHECKING(Supported version of SSLeay) 
 
    AC_MSG_RESULT($pike_cv_ssleay) 
 
    if test x$pike_cv_ssleay = xyes; then 
      AC_DEFINE(HAVE_SSLEAY) 
    else 
      # Restore variables, so we don't link with unnessesary libs 
 
      LIBS=$OLD_LIBS 
      CPPFLAGS=$OLD_CPPFLAGS 
      LDFLAGS=$OLD_LDFLAGS 
    fi 
  fi 
fi 
 
AC_OUTPUT(Makefile,echo FOO >stamp-h )