xref: /PHP-7.2/ext/interbase/config.m4 (revision 902d39a3)
1PHP_ARG_WITH(interbase,for Firebird support,
2[  --with-interbase[=DIR]    Include Firebird support.  DIR is the Firebird base
3                          install directory [/opt/firebird]])
4
5if test "$PHP_INTERBASE" != "no"; then
6
7  AC_PATH_PROG(FB_CONFIG, fb_config, no)
8
9  if test -x "$FB_CONFIG" && test "$PHP_INTERBASE" = "yes"; then
10    AC_MSG_CHECKING(for libfbconfig)
11    FB_CFLAGS=`$FB_CONFIG --cflags`
12    FB_LIBDIR=`$FB_CONFIG --libs`
13    FB_VERSION=`$FB_CONFIG --version`
14    AC_MSG_RESULT(version $FB_VERSION)
15    PHP_EVAL_LIBLINE($FB_LIBDIR, INTERBASE_SHARED_LIBADD)
16    PHP_EVAL_INCLINE($FB_CFLAGS)
17
18  else
19    if test "$PHP_INTERBASE" = "yes"; then
20      IBASE_INCDIR=/opt/firebird/include
21      IBASE_LIBDIR=/opt/firebird/lib
22    else
23      IBASE_INCDIR=$PHP_INTERBASE/include
24      IBASE_LIBDIR=$PHP_INTERBASE/$PHP_LIBDIR
25    fi
26
27    PHP_CHECK_LIBRARY(fbclient, isc_detach_database,
28    [
29      IBASE_LIBNAME=fbclient
30    ], [
31      PHP_CHECK_LIBRARY(gds, isc_detach_database,
32      [
33        IBASE_LIBNAME=gds
34      ], [
35        PHP_CHECK_LIBRARY(ib_util, isc_detach_database,
36        [
37          IBASE_LIBNAME=ib_util
38        ], [
39          AC_MSG_ERROR([libfbclient, libgds or libib_util not found! Check config.log for more information.])
40        ], [
41          -L$IBASE_LIBDIR
42        ])
43      ], [
44        -L$IBASE_LIBDIR
45      ])
46    ], [
47      -L$IBASE_LIBDIR
48    ])
49
50    PHP_ADD_LIBRARY_WITH_PATH($IBASE_LIBNAME, $IBASE_LIBDIR, INTERBASE_SHARED_LIBADD)
51    PHP_ADD_INCLUDE($IBASE_INCDIR)
52  fi
53
54  AC_DEFINE(HAVE_IBASE,1,[ ])
55  PHP_NEW_EXTENSION(interbase, interbase.c ibase_query.c ibase_service.c ibase_events.c ibase_blobs.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
56  PHP_SUBST(INTERBASE_SHARED_LIBADD)
57fi
58