File: config.m4

package info (click to toggle)
php4 6%3A4.4.4-8%2Betch6
  • links: PTS
  • area: main
  • in suites: etch
  • size: 35,068 kB
  • ctags: 39,148
  • sloc: ansic: 340,486; php: 34,786; cpp: 10,150; sh: 9,010; lex: 2,180; yacc: 1,712; xml: 1,335; makefile: 559; awk: 466; java: 455; perl: 154
file content (83 lines) | stat: -rw-r--r-- 2,266 bytes parent folder | download | duplicates (3)
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
dnl
dnl $Id: config.m4,v 1.8.2.3 2003/10/03 05:25:32 sniper Exp $
dnl

PHP_ARG_WITH(cyrus, for cyrus imap support,
[  --with-cyrus[=DIR]      Include Cyrus IMAP support])

if test "$PHP_CYRUS" != "no"; then
  found_cyrus=no
  found_sasl=no
  found_openssl=no

  dnl
  dnl Cyrus
  dnl
  for i in $PHP_CYRUS /usr/local /usr; do
    if test -r $i/include/cyrus/imclient.h && test "$found_cyrus" = "no"; then
      PHP_ADD_INCLUDE($i/include)
      PHP_ADD_LIBRARY_WITH_PATH(cyrus, $i/lib, CYRUS_SHARED_LIBADD)
      found_cyrus=yes
      CYRUS_INCPATH=$i/include
      break 2
    fi
  done

  dnl Check that imclient_connect() accepts 4 args
  old_CPPFLAGS=$CPPFLAGS
  CPPFLAGS=-I$CYRUS_INCPATH
  AC_TRY_COMPILE([#include <stdio.h>
#include <cyrus/imclient.h>], [imclient_connect(0,0,0,0)], [], [
    AC_MSG_ERROR(cyrus-imap version 2.0.8 or greater required)
  ])
  CPPFLAGS=$old_CPPFLAGS
  
  if test "$found_cyrus" = "no"; then
    AC_MSG_RESULT(not found)
    AC_MSG_ERROR(Please Re-install the cyrus distribution)
  fi

  dnl
  dnl sasl/sasl2 
  dnl
  for i in $PHP_CYRUS /usr/local /usr; do
    if test -r $i/include/sasl.h && test "$found_sasl" = "no"; then
      PHP_ADD_INCLUDE($i/include)
      found_sasl=yes
    elif test -r $i/include/sasl/sasl.h && test "$found_sasl" = "no"; then
      PHP_ADD_INCLUDE($i/include/sasl)
      found_sasl=yes
    fi

    if test "$found_sasl" = "yes"; then
      if test -f $i/lib/libsasl2.a || test -f $i/lib/libsasl2.$SHLIB_SUFFIX_NAME; then
        PHP_ADD_LIBRARY_WITH_PATH(sasl2, $i/lib, CYRUS_SHARED_LIBADD)
      else
        PHP_ADD_LIBRARY_WITH_PATH(sasl, $i/lib, CYRUS_SHARED_LIBADD)
      fi
      break 2
    fi
  done
  
  if test "$found_sasl" = "no"; then
    AC_MSG_RESULT(sasl not found)
    AC_MSG_ERROR(Please Re-install the cyrus distribution)
  fi

  dnl
  dnl OpenSSL
  dnl
  if test "$PHP_OPENSSL" = "no"; then
    for i in $PHP_CYRUS /usr/local /usr; do
      if test -r $i/include/openssl/ssl.h; then
        PHP_ADD_LIBRARY_WITH_PATH(ssl, $i/lib, CYRUS_SHARED_LIBADD)
        PHP_ADD_LIBRARY_WITH_PATH(crypto, $i/lib, CYRUS_SHARED_LIBADD)
        break 2
      fi
    done
  fi
  
  PHP_NEW_EXTENSION(cyrus, cyrus.c, $ext_shared)
  PHP_SUBST(CYRUS_SHARED_LIBADD)
  AC_DEFINE(HAVE_CYRUS,1,[ ])
fi