libextractor-php

GNU libextractor
Log | Files | Refs | README

config.m4 (1317B)


      1 dnl $Id: config.m4,v 1.1 2004/12/23 06:20:22 manfred Exp $
      2 dnl config.m4 for extension extractor
      3 
      4 PHP_ARG_WITH(extractor, for extractor support,
      5 [  --with-extractor             Include extractor support])
      6 
      7 if test "$PHP_EXTRACTOR" != "no"; then 
      8    
      9    SEARCH_PATH="/usr/local /usr"     # you might want to change this
     10    SEARCH_FOR="/include/extractor.h"  # you most likely want to change this
     11    if test -r $PHP_EXTRACTOR/$SEARCH_FOR; then # path given as parameter
     12      EXTRACTOR_DIR=$PHP_EXTRACTOR
     13    else # search default path list
     14      AC_MSG_CHECKING([for extractor files in default path])
     15      for i in $SEARCH_PATH ; do
     16        if test -r $i/$SEARCH_FOR; then
     17          EXTRACTOR_DIR=$i
     18          AC_MSG_RESULT(found in $i)
     19        fi
     20      done
     21    fi
     22 
     23    if test -z "$EXTRACTOR_DIR"; then
     24      AC_MSG_RESULT([not found])
     25      AC_MSG_ERROR([Please reinstall the extractor distribution])
     26    fi
     27 
     28    PHP_ADD_INCLUDE($EXTRACTOR_DIR/include)
     29 
     30    PHP_ADD_LIBRARY_WITH_PATH(extractor, $PHP_EXTRACTOR_DIR/lib, EXTRACTOR_SHARED_LIBADD)
     31 
     32    AC_CHECK_LIB(extractor, EXTRACTOR_loadDefaultLibraries, 
     33    [
     34       AC_DEFINE(HAVE_EXTRACTORLIB,1,[ ])
     35    ], [
     36       AC_MSG_ERROR(extractor library not found or wrong version)
     37    ],)
     38 
     39   PHP_SUBST(EXTRACTOR_SHARED_LIBADD)
     40 
     41   PHP_NEW_EXTENSION(extractor, extractor.c, $ext_shared)
     42 fi