File: config.m4

package info (click to toggle)
php4 4.0.3pl1-0potato3
  • links: PTS
  • area: main
  • in suites: potato
  • size: 15,168 kB
  • ctags: 20,556
  • sloc: ansic: 155,237; php: 10,827; sh: 9,608; yacc: 1,874; lex: 1,742; makefile: 788; java: 424; awk: 359; cpp: 335; perl: 181; xml: 57
file content (58 lines) | stat: -rw-r--r-- 2,007 bytes parent folder | download
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
dnl $Id: config.m4,v 1.9 2000/09/28 20:09:23 sniper Exp $
dnl config.m4 for extension db
dnl don't forget to call PHP_EXTENSION(db)


# Checks for libraries.
# Prefer Berkeley DB, gdbm and ndbm/dbm, in that order
AC_DEFUN(AC_PREFERRED_DB_LIB,[
  AC_CHECK_LIB(db, dbm_open,[AC_DEFINE(NDBM,1, [Whether you have NDBM]) DBM_TYPE=ndbm; DBM_LIB=-ldb],
   [AC_CHECK_LIB(gdbm, gdbm_open,[AC_DEFINE(GDBM,1, [Whether you have GDBM]) DBM_TYPE=gdbm; DBM_LIB=-lgdbm],
   [AC_CHECK_LIB(c, dbm_open,[AC_DEFINE(NDBM,1,[ ]) DBM_TYPE=ndbm; DBM_LIB=],
    [AC_CHECK_LIB(dbm, dbm_open,[AC_DEFINE(NDBM,1,[ ]) DBM_TYPE=ndbm; DBM_LIB=-ldbm],
     [DBM_TYPE=""])])])])
  AC_MSG_CHECKING([preferred dbm library])
  if test "a$DBM_TYPE" = a; then
    AC_MSG_RESULT(none found)
    AC_MSG_WARN(No dbm library found - using built-in flatfile support)
  else
    AC_MSG_RESULT($DBM_TYPE chosen)
  fi
  PHP_SUBST(DBM_LIB)
  PHP_SUBST(DBM_TYPE)
])


PHP_ARG_WITH(db, whether to include old xDBM support,
[  --with-db               Include old xDBM support (deprecated)])

if test "$PHP_DB" != "no"; then

  AC_PREFERRED_DB_LIB

  if test "$DBM_LIB" = "-lgdbm"; then
    AC_CHECK_HEADER(gdbm.h, [ GDBM_INCLUDE="" ], [ 
      AC_MSG_RESULT("Try /usr/local/include/gdbm.h"); 
      AC_CHECK_HEADER(/usr/local/include/gdbm.h, [ GDBM_INCLUDE="-I/usr/local/include" ],[
        AC_MSG_RESULT("Try /opt/local/include/gdbm.h");
        AC_CHECK_HEADER(/opt/local/include/gdbm.h, [ GDBM_INCLUDE="-I/opt/local/include" ],[
          dnl if in /usr/pkg/include, do not add anything.  See above.
          AC_MSG_RESULT("Try /usr/pkg/include/gdbm.h");
          AC_CHECK_HEADER(/usr/pkg/include/gdbm.h, [ GDBM_INCLUDE="" ],[
            AC_MSG_RESULT("Giving up - You need to install gdbm.h somewhere");
            exit
          ])
        ])
      ])  
    ])
  else
    GDBM_INCLUDE="-I/usr/include/db1"
  fi

  if test -n "$DBM_LIB"; then
    INCLUDES="$INCLUDES $GDBM_INCLUDE"
    EXTRA_LIBS="$EXTRA_LIBS $DBM_LIB"
  fi

  PHP_EXTENSION(db)
fi