File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / mssql / config.m4
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue May 29 12:34:40 2012 UTC (12 years, 5 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, HEAD
php 5.4.3+patches

dnl
dnl $Id: config.m4,v 1.1.1.2 2012/05/29 12:34:40 misho Exp $
dnl

PHP_ARG_WITH(mssql,for MSSQL support via FreeTDS,
[  --with-mssql[=DIR]      Include MSSQL-DB support.  DIR is the FreeTDS home
                          directory [/usr/local/freetds]])

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

  if test "$PHP_MSSQL" = "yes"; then
    for i in /usr/local /usr; do
      if test -f $i/include/sybdb.h; then
        FREETDS_INSTALLATION_DIR=$i
        FREETDS_INCLUDE_DIR=$i/include
        break
      elif test -f $i/include/freetds/sybdb.h; then
        FREETDS_INSTALLATION_DIR=$i
        FREETDS_INCLUDE_DIR=$i/include/freetds
        break
      fi
    done

    if test -z "$FREETDS_INSTALLATION_DIR"; then
      AC_MSG_ERROR(Cannot find FreeTDS in known installation directories)
    fi

  elif test "$PHP_MSSQL" != "no"; then

    if test -f $PHP_MSSQL/include/sybdb.h; then
      FREETDS_INSTALLATION_DIR=$PHP_MSSQL
      FREETDS_INCLUDE_DIR=$PHP_MSSQL/include
    elif test -f $PHP_MSSQL/include/freetds/sybdb.h; then
      FREETDS_INSTALLATION_DIR=$PHP_MSSQL
      FREETDS_INCLUDE_DIR=$PHP_MSSQL/include/freetds
    else
      AC_MSG_ERROR(Directory $PHP_MSSQL is not a FreeTDS installation directory)
    fi
  fi  

  if test ! -r "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.a" && test ! -r "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.so"; then
     AC_MSG_ERROR(Could not find $FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.[a|so])
  fi

  PHP_ADD_INCLUDE($FREETDS_INCLUDE_DIR)
  PHP_ADD_LIBRARY_WITH_PATH(sybdb, $FREETDS_INSTALLATION_DIR/$PHP_LIBDIR, MSSQL_SHARED_LIBADD)

  PHP_NEW_EXTENSION(mssql, php_mssql.c, $ext_shared)
  AC_CHECK_LIB(dnet_stub, dnet_addr,
     [ PHP_ADD_LIBRARY_WITH_PATH(dnet_stub,,MSSQL_SHARED_LIBADD)
        AC_DEFINE(HAVE_LIBDNET_STUB,1,[ ])
     ])
  AC_DEFINE(HAVE_MSSQL,1,[ ])
  AC_DEFINE(HAVE_FREETDS,1,[ ])
  PHP_SUBST(MSSQL_SHARED_LIBADD)
fi

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>