xref: /PHP-7.2/ext/pdo_firebird/config.m4 (revision 902d39a3)
1PHP_ARG_WITH(pdo-firebird,for Firebird support for PDO,
2[  --with-pdo-firebird[=DIR] PDO: Firebird support.  DIR is the Firebird base
3                          install directory [/opt/firebird]])
4
5if test "$PHP_PDO_FIREBIRD" != "no"; then
6
7  if test "$PHP_PDO" = "no" && test "$ext_shared" = "no"; then
8    AC_MSG_ERROR([PDO is not enabled! Add --enable-pdo to your configure line.])
9  fi
10
11  AC_PATH_PROG(FB_CONFIG, fb_config, no)
12
13  if test -x "$FB_CONFIG" && test "$PHP_PDO_FIREBIRD" = "yes"; then
14    AC_MSG_CHECKING(for libfbconfig)
15    FB_CFLAGS=`$FB_CONFIG --cflags`
16    FB_LIBDIR=`$FB_CONFIG --libs`
17    FB_VERSION=`$FB_CONFIG --version`
18    AC_MSG_RESULT(version $FB_VERSION)
19    PHP_EVAL_LIBLINE($FB_LIBDIR, PDO_FIREBIRD_SHARED_LIBADD)
20    PHP_EVAL_INCLINE($FB_CFLAGS)
21
22  else
23    if test "$PHP_PDO_FIREBIRD" = "yes"; then
24      FIREBIRD_INCDIR=
25      FIREBIRD_LIBDIR=
26      FIREBIRD_LIBDIR_FLAG=
27    else
28      FIREBIRD_INCDIR=$PHP_PDO_FIREBIRD/include
29      FIREBIRD_LIBDIR=$PHP_PDO_FIREBIRD/$PHP_LIBDIR
30      FIREBIRD_LIBDIR_FLAG=-L$FIREBIRD_LIBDIR
31    fi
32
33    PHP_CHECK_LIBRARY(fbclient, isc_detach_database,
34    [
35      FIREBIRD_LIBNAME=fbclient
36    ], [
37      PHP_CHECK_LIBRARY(gds, isc_detach_database,
38      [
39        FIREBIRD_LIBNAME=gds
40      ], [
41        PHP_CHECK_LIBRARY(ib_util, isc_detach_database,
42        [
43          FIREBIRD_LIBNAME=ib_util
44        ], [
45          AC_MSG_ERROR([libfbclient, libgds or libib_util not found! Check config.log for more information.])
46        ], [
47          $FIREBIRD_LIBDIR_FLAG
48        ])
49      ], [
50        $FIREBIRD_LIBDIR_FLAG
51      ])
52    ], [
53      $FIREBIRD_LIBDIR_FLAG
54    ])
55    PHP_ADD_LIBRARY_WITH_PATH($FIREBIRD_LIBNAME, $FIREBIRD_LIBDIR, PDO_FIREBIRD_SHARED_LIBADD)
56    PHP_ADD_INCLUDE($FIREBIRD_INCDIR)
57  fi
58
59  PHP_CHECK_PDO_INCLUDES
60
61  AC_DEFINE(HAVE_PDO_FIREBIRD,1,[ ])
62  PHP_NEW_EXTENSION(pdo_firebird, pdo_firebird.c firebird_driver.c firebird_statement.c, $ext_shared,,-I$pdo_cv_inc_path)
63  PHP_SUBST(PDO_FIREBIRD_SHARED_LIBADD)
64  PHP_ADD_EXTENSION_DEP(pdo_firebird, pdo)
65fi
66