dnl
dnl $Id: config.m4 239118 2007-07-03 17:25:43Z sniper $
dnl

PHP_ARG_WITH(sybase,for Sybase support,
[  --with-sybase[=DIR]     Include Sybase-DB support.  DIR is the Sybase home
                          directory [/home/sybase]])

if test "$PHP_SYBASE" != "no"; then
  if test "$PHP_SYBASE" = "yes"; then
    SYBASE_INCDIR=/home/sybase/include
    SYBASE_LIBDIR=/home/sybase/lib
  else
    SYBASE_INCDIR=$PHP_SYBASE/include
    SYBASE_LIBDIR=$PHP_SYBASE/lib
  fi
  PHP_ADD_INCLUDE($SYBASE_INCDIR)
  PHP_ADD_LIBRARY_WITH_PATH(sybdb, $SYBASE_LIBDIR, SYBASE_SHARED_LIBADD)
  PHP_NEW_EXTENSION(sybase, php_sybase_db.c, $ext_shared)
  AC_CHECK_LIB(dnet_stub, dnet_addr,
     [ PHP_ADD_LIBRARY_WITH_PATH(dnet_stub,,SYBASE_SHARED_LIBADD)
        AC_DEFINE(HAVE_LIBDNET_STUB,1,[ ])
     ])
  AC_DEFINE(HAVE_SYBASE,1,[ ])
  AC_CHECK_LIB(sybdb, tdsdbopen, 
     [ AC_DEFINE(PHP_SYBASE_DBOPEN,tdsdbopen,[ ])
       AC_DEFINE(DBMFIX,1,[ ]) ],
     [ AC_DEFINE(PHP_SYBASE_DBOPEN,dbopen,[ ]) ])
     
  PHP_SUBST(SYBASE_SHARED_LIBADD)
fi
