File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / odbc / config.m4
Revision 1.1.1.3 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Oct 14 08:02:26 2013 UTC (11 years, 5 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, HEAD
v 5.4.20

    1: dnl
    2: dnl $Id: config.m4,v 1.1.1.3 2013/10/14 08:02:26 misho Exp $
    3: dnl
    4: 
    5: AC_DEFUN([PHP_ODBC_CHECK_HEADER],[
    6: if ! test -f "$ODBC_INCDIR/$1"; then
    7:   AC_MSG_ERROR([ODBC header file '$ODBC_INCDIR/$1' not found!])
    8: fi
    9: ])
   10: 
   11: dnl
   12: dnl Figure out which library file to link with for the Solid support.
   13: dnl
   14: AC_DEFUN([PHP_ODBC_FIND_SOLID_LIBS],[
   15:   AC_MSG_CHECKING([Solid library file])  
   16:   ac_solid_uname_r=`uname -r 2>/dev/null`
   17:   ac_solid_uname_s=`uname -s 2>/dev/null`
   18:   case $ac_solid_uname_s in
   19:     AIX) ac_solid_os=a3x;;   # a4x for AIX4/ Solid 2.3/3.0 only
   20:     HP-UX) ac_solid_os=h9x;; # h1x for hpux11, h0x for hpux10
   21:     IRIX) ac_solid_os=irx;;  # Solid 2.3(?)/ 3.0 only
   22:     Linux) 
   23:       if ldd -v /bin/sh | grep GLIBC > /dev/null; then
   24:         AC_DEFINE(SS_LINUX,1,[Needed in sqlunix.h ])
   25:         ac_solid_os=l2x
   26:       else
   27:         AC_DEFINE(SS_LINUX,1,[Needed in sqlunix.h ])
   28:         ac_solid_os=lux
   29:       fi;; 
   30:     SunOS) 
   31:       ac_solid_os=ssx;; # should we deal with SunOS 4?
   32:     FreeBSD) 
   33:       if test `expr $ac_solid_uname_r : '\(.\)'` -gt "2"; then
   34:         AC_DEFINE(SS_FBX,1,[Needed in sqlunix.h for wchar defs ])
   35:         ac_solid_os=fex
   36:       else 
   37:         AC_DEFINE(SS_FBX,1,[Needed in sqlunix.h for wchar defs ])
   38:         ac_solid_os=fbx
   39:       fi;;
   40:   esac
   41: 
   42:   if test -f $1/soc${ac_solid_os}35.a; then
   43:     ac_solid_version=35
   44:     ac_solid_prefix=soc
   45:   elif test -f $1/scl${ac_solid_os}30.a; then
   46:     ac_solid_version=30
   47:     ac_solid_prefix=scl
   48:   elif test -f $1/scl${ac_solid_os}23.a; then
   49:     ac_solid_version=23
   50:     ac_solid_prefix=scl
   51:   fi
   52: 
   53: #
   54: # Check for the library files, and setup the ODBC_LIBS path...
   55: #
   56: if test ! -f $1/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so -a \
   57:   ! -f $1/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a; then
   58:   #
   59:   # we have an error and should bail out, as we can't find the libs!
   60:   #
   61:   echo ""
   62:   echo "*********************************************************************"
   63:   echo "* Unable to locate $1/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so or $1/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a"
   64:   echo "* Please correct this by creating the following links and reconfiguring:"
   65:   echo "* $1/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a -> $1/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a"
   66:   echo "* $1/${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so -> $1/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so"
   67:   echo "*********************************************************************"
   68: else
   69:   ODBC_LFLAGS=-L$1
   70:   ODBC_LIBS=-l${ac_solid_prefix}${ac_solid_os}${ac_solid_version}
   71: fi
   72: 
   73:   AC_MSG_RESULT(`echo $ODBC_LIBS | sed -e 's!.*/!!'`)
   74: ])
   75: 
   76: 
   77: dnl
   78: dnl Figure out which library file to link with for the Empress support.
   79: dnl
   80: 
   81: AC_DEFUN([PHP_ODBC_FIND_EMPRESS_LIBS],[
   82:   AC_MSG_CHECKING([Empress library file])
   83:   ODBC_LIBS=`echo $1/libempodbccl.so | cut -d' ' -f1`
   84:   if test ! -f $ODBC_LIBS; then
   85:     ODBC_LIBS=`echo $1/libempodbccl.so | cut -d' ' -f1`
   86:   fi
   87:   AC_MSG_RESULT(`echo $ODBC_LIBS | sed -e 's!.*/!!'`)
   88: ])
   89: 
   90: AC_DEFUN([PHP_ODBC_FIND_EMPRESS_BCS_LIBS],[
   91:   AC_MSG_CHECKING([Empress local access library file])
   92:   ODBCBCS_LIBS=`echo $1/libempodbcbcs.a | cut -d' ' -f1`
   93:   if test ! -f $ODBCBCS_LIBS; then
   94:     ODBCBCS_LIBS=`echo $1/libempodbcbcs.a | cut -d' ' -f1`
   95:   fi
   96:   AC_MSG_RESULT(`echo $ODBCBCS_LIBS | sed -e 's!.*/!!'`)
   97: ])
   98: 
   99: dnl
  100: dnl configure options
  101: dnl
  102: if test -z "$ODBC_TYPE"; then
  103: PHP_ARG_WITH(adabas,,
  104: [  --with-adabas[=DIR]     Include Adabas D support [/usr/local]])
  105: 
  106:   if test "$PHP_ADABAS" != "no"; then
  107:     AC_MSG_CHECKING([for Adabas support])
  108:     if test "$PHP_ADABAS" = "yes"; then
  109:       PHP_ADABAS=/usr/local
  110:     fi
  111:     PHP_ADD_INCLUDE($PHP_ADABAS/incl)
  112:     PHP_ADD_LIBPATH($PHP_ADABAS/$PHP_LIBDIR)
  113:     ODBC_OBJS="$PHP_ADABAS/$PHP_LIBDIR/odbclib.a"
  114:     ODBC_LIB="$abs_builddir/ext/odbc/libodbc_adabas.a"
  115:     $srcdir/build/shtool mkdir -f -p ext/odbc
  116:     rm -f "$ODBC_LIB"
  117:     cp "$ODBC_OBJS" "$ODBC_LIB"
  118:     PHP_ADD_LIBRARY(sqlptc)
  119:     PHP_ADD_LIBRARY(sqlrte)
  120:     PHP_ADD_LIBRARY_WITH_PATH(odbc_adabas, $abs_builddir/ext/odbc)
  121:     ODBC_TYPE=adabas
  122:     ODBC_INCDIR=$PHP_ADABAS/incl
  123:     PHP_ODBC_CHECK_HEADER(sqlext.h)
  124:     AC_DEFINE(HAVE_ADABAS,1,[ ])
  125:     AC_MSG_RESULT([$ext_output])
  126:   fi
  127: fi
  128: 
  129: if test -z "$ODBC_TYPE"; then
  130: PHP_ARG_WITH(sapdb,,
  131: [  --with-sapdb[=DIR]      Include SAP DB support [/usr/local]])
  132: 
  133:   if test "$PHP_SAPDB" != "no"; then
  134:     AC_MSG_CHECKING([for SAP DB support])
  135:     if test "$PHP_SAPDB" = "yes"; then
  136:       PHP_SAPDB=/usr/local
  137:     fi
  138:     PHP_ADD_INCLUDE($PHP_SAPDB/incl)
  139:     PHP_ADD_LIBPATH($PHP_SAPDB/$PHP_LIBDIR)
  140:     PHP_ADD_LIBRARY(sqlod)
  141:     ODBC_TYPE=sapdb
  142:     AC_DEFINE(HAVE_SAPDB,1,[ ])
  143:     AC_MSG_RESULT([$ext_output])
  144:   fi
  145: fi
  146: 
  147: if test -z "$ODBC_TYPE"; then
  148: PHP_ARG_WITH(solid,,
  149: [  --with-solid[=DIR]      Include Solid support [/usr/local/solid]])
  150: 
  151:   if test "$PHP_SOLID" != "no"; then
  152:     AC_MSG_CHECKING(for Solid support)
  153:     if test "$PHP_SOLID" = "yes"; then
  154:       PHP_SOLID=/usr/local/solid
  155:     fi
  156:     ODBC_INCDIR=$PHP_SOLID/include
  157:     ODBC_LIBDIR=$PHP_SOLID/$PHP_LIBDIR
  158:     ODBC_INCLUDE=-I$ODBC_INCDIR
  159:     ODBC_TYPE=solid
  160:     if test -f $ODBC_LIBDIR/soc*35.a; then
  161:       AC_DEFINE(HAVE_SOLID_35,1,[ ])
  162:     elif test -f $ODBC_LIBDIR/scl*30.a; then
  163:       AC_DEFINE(HAVE_SOLID_30,1,[ ])
  164:     elif test -f $ODBC_LIBDIR/scl*23.a; then
  165:       AC_DEFINE(HAVE_SOLID,1,[ ])
  166:     fi
  167:     AC_MSG_RESULT([$ext_output])
  168:     PHP_ODBC_FIND_SOLID_LIBS($ODBC_LIBDIR)
  169:   fi
  170: fi
  171: 
  172: if test -z "$ODBC_TYPE"; then
  173: PHP_ARG_WITH(ibm-db2,,
  174: [  --with-ibm-db2[=DIR]    Include IBM DB2 support [/home/db2inst1/sqllib]])
  175: 
  176:   if test "$PHP_IBM_DB2" != "no"; then
  177:     AC_MSG_CHECKING(for IBM DB2 support)
  178:     if test "$PHP_IBM_DB2" = "yes"; then
  179:       ODBC_INCDIR=/home/db2inst1/sqllib/include
  180:       ODBC_LIBDIR=/home/db2inst1/sqllib/lib
  181:     else
  182:       ODBC_INCDIR=$PHP_IBM_DB2/include
  183:       ODBC_LIBDIR=$PHP_IBM_DB2/$PHP_LIBDIR
  184:     fi
  185: 
  186:     PHP_ODBC_CHECK_HEADER(sqlcli1.h)
  187: 
  188:     ODBC_INCLUDE=-I$ODBC_INCDIR
  189:     ODBC_LFLAGS=-L$ODBC_LIBDIR
  190:     ODBC_TYPE=ibm-db2
  191:     ODBC_LIBS=-ldb2
  192: 
  193:     PHP_TEST_BUILD(SQLExecute, [
  194:       AC_DEFINE(HAVE_IBMDB2,1,[ ])
  195:       AC_MSG_RESULT([$ext_output])
  196:     ], [
  197:       AC_MSG_RESULT(no)
  198:       AC_MSG_ERROR([
  199: build test failed. Please check the config.log for details.
  200: You need to source your DB2 environment before running PHP configure:
  201: # . \$IBM_DB2/db2profile
  202: ])
  203:     ], [
  204:       $ODBC_LFLAGS $ODBC_LIBS
  205:     ])
  206:   fi
  207: fi
  208: 
  209: if test -z "$ODBC_TYPE"; then
  210: PHP_ARG_WITH(ODBCRouter,,
  211: [  --with-ODBCRouter[=DIR] Include ODBCRouter.com support [/usr]])
  212: 
  213:   if test "$PHP_ODBCROUTER" != "no"; then
  214:     AC_MSG_CHECKING(for ODBCRouter.com support)
  215:     if test "$PHP_ODBCROUTER" = "yes"; then
  216:       PHP_ODBCROUTER=/usr
  217:     fi
  218:     ODBC_INCDIR=$PHP_ODBCROUTER/include
  219:     ODBC_LIBDIR=$PHP_ODBCROUTER/lib
  220:     ODBC_LFLAGS=-L$ODBC_LIBDIR
  221:     ODBC_INCLUDE=-I$ODBC_INCDIR
  222:     ODBC_LIBS=-lodbcsdk
  223:     ODBC_TYPE=ODBCRouter
  224:     AC_DEFINE(HAVE_ODBC_ROUTER,1,[ ])
  225:     AC_MSG_RESULT([$ext_output])
  226:   fi
  227: fi
  228: 
  229: if test -z "$ODBC_TYPE"; then
  230: PHP_ARG_WITH(empress,,
  231: [  --with-empress[=DIR]    Include Empress support [\$EMPRESSPATH]
  232:                           (Empress Version >= 8.60 required)])
  233: 
  234:   if test "$PHP_EMPRESS" != "no"; then
  235:     AC_MSG_CHECKING(for Empress support)
  236:     if test "$PHP_EMPRESS" = "yes"; then
  237:       ODBC_INCDIR=$EMPRESSPATH/include/odbc
  238:       ODBC_LIBDIR=$EMPRESSPATH/shlib
  239:     else
  240:       ODBC_INCDIR=$PHP_EMPRESS/include/odbc
  241:       ODBC_LIBDIR=$PHP_EMPRESS/shlib
  242:     fi
  243:     ODBC_INCLUDE=-I$ODBC_INCDIR
  244:     ODBC_LFLAGS=-L$ODBC_LIBDIR
  245:     ODBC_TYPE=empress
  246:     AC_DEFINE(HAVE_EMPRESS,1,[ ])
  247:     AC_MSG_RESULT([$ext_output])
  248:     PHP_ODBC_FIND_EMPRESS_LIBS($ODBC_LIBDIR)
  249:   fi
  250: fi
  251: 
  252: if test -z "$ODBC_TYPE"; then
  253: PHP_ARG_WITH(empress-bcs,,
  254: [  --with-empress-bcs[=DIR]
  255:                           Include Empress Local Access support [\$EMPRESSPATH]
  256:                           (Empress Version >= 8.60 required)])
  257: 
  258:   if test "$PHP_EMPRESS_BCS" != "no"; then
  259:     AC_MSG_CHECKING(for Empress local access support)
  260:     if test "$PHP_EMPRESS_BCS" = "yes"; then
  261:       ODBC_INCDIR=$EMPRESSPATH/include/odbc
  262:       ODBC_LIBDIR=$EMPRESSPATH/shlib
  263:     else
  264:       ODBC_INCDIR=$PHP_EMPRESS_BCS/include/odbc
  265:       ODBC_LIBDIR=$PHP_EMPRESS_BCS/shlib
  266:     fi
  267:     CC="empocc -bcs";export CC;
  268:     LD="empocc -bcs";export LD;
  269:     ODBC_INCLUDE=-I$ODBC_INCDIR
  270:     ODBC_LFLAGS=-L$ODBC_LIBDIR
  271:     LIST=`empocc -listlines -bcs -o a a.c`
  272: 
  273:     NEWLIST=
  274:     for I in $LIST
  275:     do
  276:       case $I in
  277:         $EMPRESSPATH/odbccl/lib/* | \
  278:         $EMPRESSPATH/rdbms/lib/* | \
  279:         $EMPRESSPATH/common/lib/*)
  280:               NEWLIST="$NEWLIST $I"
  281:               ;;
  282:       esac
  283:     done
  284:     ODBC_LIBS="-lempphpbcs -lms -lmscfg -lbasic -lbasic_os -lnlscstab -lnlsmsgtab -lm -ldl -lcrypt"
  285:     ODBC_TYPE=empress-bcs
  286:     AC_DEFINE(HAVE_EMPRESS,1,[ ])
  287:     AC_MSG_RESULT([$ext_output])
  288:     PHP_ODBC_FIND_EMPRESS_BCS_LIBS($ODBC_LIBDIR)
  289:   fi
  290: fi
  291: 
  292: if test -z "$ODBC_TYPE"; then
  293: PHP_ARG_WITH(birdstep,,
  294: [  --with-birdstep[=DIR]   Include Birdstep support [/usr/local/birdstep]])
  295:   
  296:   if test "$PHP_BIRDSTEP" != "no"; then
  297:     AC_MSG_CHECKING(for Birdstep support)
  298:     if test "$PHP_BIRDSTEP" = "yes"; then
  299:         ODBC_INCDIR=/usr/local/birdstep/include
  300:         ODBC_LIBDIR=/usr/local/birdstep/lib
  301:     else
  302:         ODBC_INCDIR=$PHP_BIRDSTEP/include
  303:         ODBC_LIBDIR=$PHP_BIRDSTEP/$PHP_LIBDIR
  304:     fi
  305:    
  306:     case $host_alias in
  307:       *aix*[)]
  308:         AC_DEFINE(AIX,1,[ ]);;
  309:       *hpux*[)]
  310:         AC_DEFINE(HPUX,1,[ ]);;
  311:       *linux*[)]
  312:         AC_DEFINE(LINUX,1,[ ]);;
  313:       *qnx*[)]
  314:         AC_DEFINE(NEUTRINO,1,[ ]);;
  315:       i?86-*-solaris*[)]
  316:         AC_DEFINE(ISOLARIS,1,[ ]);;
  317:       sparc-*-solaris*[)]
  318:         AC_DEFINE(SOLARIS,1,[ ]);;
  319:       *unixware*[)]
  320:         AC_DEFINE(UNIXWARE,1,[ ]);;
  321:     esac
  322: 
  323:     ODBC_INCLUDE=-I$ODBC_INCDIR
  324:     ODBC_TYPE=birdstep
  325:     ODBC_LFLAGS=-L$ODBC_LIBDIR
  326:     ODBC_LIBS="-lCadm -lCdict -lCenc -lCrdm -lCrpc -lCrdbc -lCrm -lCuapi -lutil"
  327: 
  328:     if test -f "$ODBC_LIBDIR/libCrdbc32.$SHLIB_SUFFIX_NAME"; then
  329:       ODBC_LIBS="-lCrdbc32 -lCadm32 -lCncp32 -lCrm32 -lCsql32 -lCdict32 -lCrdm32 -lCrpc32 -lutil"
  330:     elif test -f "$ODBC_LIBDIR/libCrdbc.$SHLIB_SUFFIX_NAME"; then
  331:       ODBC_LIBS="-lCrdbc -lCadm -lCncp -lCrm -lCsql -lCdict -lCrdm -lCrpc -lutil"
  332:     fi
  333: 
  334:     AC_DEFINE(HAVE_BIRDSTEP,1,[ ])
  335:     AC_MSG_RESULT([$ext_output])
  336:   fi
  337: fi
  338: 
  339: if test -z "$ODBC_TYPE"; then
  340: PHP_ARG_WITH(custom-odbc,,
  341: [  --with-custom-odbc[=DIR]
  342:                           Include user defined ODBC support. DIR is ODBC install base
  343:                           directory [/usr/local]. Make sure to define CUSTOM_ODBC_LIBS and
  344:                           have some odbc.h in your include dirs. f.e. you should define 
  345:                           following for Sybase SQL Anywhere 5.5.00 on QNX, prior to
  346:                           running this configure script:
  347:                               CPPFLAGS=\"-DODBC_QNX -DSQLANY_BUG\"
  348:                               LDFLAGS=-lunix
  349:                               CUSTOM_ODBC_LIBS=\"-ldblib -lodbc\"])
  350: 
  351:   if test "$PHP_CUSTOM_ODBC" != "no"; then
  352:     AC_MSG_CHECKING(for a custom ODBC support)
  353:     if test "$PHP_CUSTOM_ODBC" = "yes"; then
  354:       PHP_CUSTOM_ODBC=/usr/local
  355:     fi
  356:     ODBC_INCDIR=$PHP_CUSTOM_ODBC/include
  357:     ODBC_LIBDIR=$PHP_CUSTOM_ODBC/$PHP_LIBDIR
  358:     ODBC_LFLAGS=-L$ODBC_LIBDIR
  359:     ODBC_INCLUDE=-I$ODBC_INCDIR
  360:     ODBC_LIBS=$CUSTOM_ODBC_LIBS
  361:     ODBC_TYPE=custom-odbc
  362:     AC_DEFINE(HAVE_CODBC,1,[ ])
  363:     AC_MSG_RESULT([$ext_ouput])
  364:   fi
  365: fi
  366: 
  367: if test -z "$ODBC_TYPE"; then
  368: PHP_ARG_WITH(iodbc,,
  369: [  --with-iodbc[=DIR]      Include iODBC support [/usr/local]])
  370: 
  371:   if test "$PHP_IODBC" != "no"; then
  372:     AC_MSG_CHECKING(for iODBC support)
  373:     if test -z "$PKG_CONFIG"; then
  374:       AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  375:     fi 
  376:     if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libiodbc ; then
  377:       PHP_ADD_LIBRARY_WITH_PATH(iodbc, $PHP_IODBC/$PHP_LIBDIR)
  378:       ODBC_TYPE=iodbc
  379:       ODBC_INCLUDE=`$PKG_CONFIG --cflags-only-I libiodbc`
  380:       ODBC_LFLAGS=`$PKG_CONFIG --libs-only-L libiodbc`
  381:       ODBC_LIBS=`$PKG_CONFIG --libs-only-l libiodbc`
  382:       PHP_EVAL_INCLINE($ODBC_INCLUDE)
  383:       AC_DEFINE(HAVE_IODBC,1,[ ])
  384:       AC_DEFINE(HAVE_ODBC2,1,[ ])
  385:       AC_MSG_RESULT([$ext_output])
  386:     else
  387:       if test "$PHP_IODBC" = "yes"; then
  388:         PHP_IODBC=/usr/local
  389:       fi
  390:       PHP_ADD_LIBRARY_WITH_PATH(iodbc, $PHP_IODBC/$PHP_LIBDIR)
  391:       PHP_ADD_INCLUDE($PHP_IODBC/include, 1)
  392:       ODBC_TYPE=iodbc
  393:       ODBC_INCLUDE=-I$PHP_IODBC/include
  394:       ODBC_LFLAGS=-L$PHP_IODBC/$PHP_LIBDIR
  395:       ODBC_LIBS=-liodbc
  396:       AC_DEFINE(HAVE_IODBC,1,[ ])
  397:       AC_DEFINE(HAVE_ODBC2,1,[ ])
  398:       AC_MSG_RESULT([$ext_output])
  399:     fi
  400:   fi
  401: fi
  402: 
  403: if test -z "$ODBC_TYPE"; then
  404: PHP_ARG_WITH(esoob,,
  405: [  --with-esoob[=DIR]      Include Easysoft OOB support [/usr/local/easysoft/oob/client]])
  406: 
  407:   if test "$PHP_ESOOB" != "no"; then
  408:     AC_MSG_CHECKING(for Easysoft ODBC-ODBC Bridge support)
  409:     if test "$PHP_ESOOB" = "yes"; then
  410:       PHP_ESOOB=/usr/local/easysoft/oob/client
  411:     fi
  412:     ODBC_INCDIR=$PHP_ESOOB/include
  413:     ODBC_LIBDIR=$PHP_ESOOB/$PHP_LIBDIR
  414:     ODBC_LFLAGS=-L$ODBC_LIBDIR
  415:     ODBC_INCLUDE=-I$ODBC_INCDIR
  416:     ODBC_LIBS=-lesoobclient
  417:     ODBC_TYPE=esoob
  418:     AC_DEFINE(HAVE_ESOOB,1,[ ])
  419:     AC_MSG_RESULT([$ext_output])
  420:   fi
  421: fi
  422: 
  423: if test -z "$ODBC_TYPE"; then
  424: PHP_ARG_WITH(unixODBC,,
  425: [  --with-unixODBC[=DIR]   Include unixODBC support [/usr/local]])
  426: 
  427:   if test "$PHP_UNIXODBC" != "no"; then
  428:     AC_MSG_CHECKING(for unixODBC support)
  429:     if test "$PHP_UNIXODBC" = "yes"; then
  430:       PHP_UNIXODBC=/usr/local
  431:     fi
  432:     ODBC_INCDIR=$PHP_UNIXODBC/include
  433:     ODBC_LIBDIR=$PHP_UNIXODBC/$PHP_LIBDIR
  434:     ODBC_LFLAGS=-L$ODBC_LIBDIR
  435:     ODBC_INCLUDE=-I$ODBC_INCDIR
  436:     ODBC_LIBS=-lodbc
  437:     ODBC_TYPE=unixODBC
  438:     PHP_ODBC_CHECK_HEADER(sqlext.h)
  439:     AC_DEFINE(HAVE_UNIXODBC,1,[ ])
  440:     AC_MSG_RESULT([$ext_output])
  441:   fi
  442: fi
  443: 
  444: if test -z "$ODBC_TYPE"; then
  445: PHP_ARG_WITH(dbmaker,,
  446: [  --with-dbmaker[=DIR]    Include DBMaker support])
  447: 
  448:   if test "$PHP_DBMAKER" != "no"; then
  449:     AC_MSG_CHECKING(for DBMaker support)
  450:     if test "$PHP_DBMAKER" = "yes"; then
  451:       # find dbmaker's home directory
  452:       DBMAKER_HOME=`grep "^dbmaker:" /etc/passwd | $AWK -F: '{print $6}'`
  453: 
  454:       # check DBMaker version (from 5.0 to 2.0)
  455:       DBMAKER_VERSION=5.0
  456: 
  457:       while test ! -d $DBMAKER_HOME/$DBMAKER_VERSION -a "$DBMAKER_VERSION" != "2.9"; do
  458:         DM_VER=`echo $DBMAKER_VERSION | sed -e 's/\.//' | $AWK '{ print $1-1;}'`
  459:         MAJOR_V=`echo $DM_VER | $AWK '{ print $1/10; }'  | $AWK -F. '{ print $1; }'`
  460:         MINOR_V=`echo $DM_VER | $AWK '{ print $1%10; }'`
  461:         DBMAKER_VERSION=$MAJOR_V.$MINOR_V
  462:       done
  463: 
  464:       if test "$DBMAKER_VERSION" = "2.9"; then
  465:         PHP_DBMAKER=$DBMAKER_HOME
  466:       else
  467:         PHP_DBMAKER=$DBMAKER_HOME/$DBMAKER_VERSION
  468:       fi
  469:     fi
  470: 
  471:     ODBC_INCDIR=$PHP_DBMAKER/include
  472:     ODBC_LIBDIR=$PHP_DBMAKER/$PHP_LIBDIR
  473:     ODBC_INCLUDE=-I$ODBC_INCDIR
  474:     ODBC_LFLAGS=-L$ODBC_LIBDIR
  475:     ODBC_INCLUDE=-I$ODBC_INCDIR
  476:     ODBC_LIBS="-ldmapic -lc"
  477:     ODBC_TYPE=dbmaker
  478: 
  479:     AC_DEFINE(HAVE_DBMAKER,1,[Whether you want DBMaker])
  480: 
  481:     if test "$ext_shared" = "yes"; then
  482:       AC_MSG_RESULT([yes (shared)])
  483:       ODBC_LIBS="-ldmapic -lc -lm"
  484:       ODBC_SHARED="odbc.la"
  485:     else
  486:       AC_MSG_RESULT([yes (static)])
  487:       PHP_ADD_LIBRARY_WITH_PATH(dmapic, $ODBC_LIBDIR)
  488:       PHP_ADD_INCLUDE($ODBC_INCDIR)
  489:       ODBC_STATIC="libphpext_odbc.la"
  490:     fi
  491:   fi
  492: fi
  493: 
  494: dnl
  495: dnl Extension setup
  496: dnl
  497: if test -n "$ODBC_TYPE"; then
  498:   if test "$ODBC_TYPE" != "dbmaker"; then
  499:     PHP_EVAL_LIBLINE([$ODBC_LFLAGS $ODBC_LIBS], ODBC_SHARED_LIBADD)
  500:     if test "$ODBC_TYPE" != "birdstep" && test "$ODBC_TYPE" != "solid"; then
  501:       AC_DEFINE(HAVE_SQLDATASOURCES,1,[ ])
  502:     fi
  503:   fi
  504:   
  505:   AC_DEFINE(HAVE_UODBC,1,[ ])
  506:   PHP_SUBST(ODBC_SHARED_LIBADD)
  507:   PHP_SUBST(ODBC_INCDIR)
  508:   PHP_SUBST(ODBC_LIBDIR)
  509:   PHP_SUBST_OLD(ODBC_INCLUDE)
  510:   PHP_SUBST_OLD(ODBC_LIBS)
  511:   PHP_SUBST_OLD(ODBC_LFLAGS)
  512:   PHP_SUBST_OLD(ODBC_TYPE)
  513: 
  514:   PHP_NEW_EXTENSION(odbc, php_odbc.c, $ext_shared,, $ODBC_INCLUDE)
  515: fi

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