File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / recode / config.m4
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue May 29 12:34:42 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

    1: dnl
    2: dnl $Id: config.m4,v 1.1.1.2 2012/05/29 12:34:42 misho Exp $
    3: dnl
    4: 
    5: PHP_ARG_WITH(recode,for recode support,
    6: [  --with-recode[=DIR]     Include recode support])
    7: 
    8: if test "$PHP_RECODE" != "no"; then
    9:   RECODE_LIST="$PHP_RECODE /usr/local /usr /opt"
   10: 
   11:   for i in $RECODE_LIST; do
   12:     if test -f $i/include/recode.h; then
   13:       RECODE_DIR=$i
   14:       RECODE_INC=include
   15:       RECODE_LIB=$PHP_LIBDIR
   16:     fi
   17:     if test -f $i/include/recode/recode.h; then
   18:       RECODE_DIR=$i
   19:       RECODE_INC=include/recode
   20:       RECODE_LIB=$PHP_LIBDIR/recode
   21:     fi
   22:     if test -f $i/recode/include/recode.h; then
   23:       RECODE_DIR=$i/recode
   24:       RECODE_INC=include
   25:       RECODE_LIB=$PHP_LIBDIR
   26:     fi
   27:     test -n "$RECODE_DIR" && break
   28:   done
   29: 
   30:   if test -z "$RECODE_DIR"; then
   31:     AC_MSG_ERROR([Can not find recode.h anywhere under $RECODE_LIST.])
   32:   fi
   33: 
   34:   PHP_CHECK_LIBRARY(recode, recode_format_table,
   35:   [
   36:     PHP_ADD_LIBRARY_WITH_PATH(recode, $RECODE_DIR/$RECODE_LIB, RECODE_SHARED_LIBADD)
   37:   ], [
   38:     old_LDFLAGS=$LDFLAGS
   39:     old_LIBS=$LIBS
   40:     LDFLAGS="$LDFLAGS -L$RECODE_DIR/$RECODE_LIB"
   41:     LIBS="$LIBS -lrecode"
   42:     AC_TRY_LINK(
   43:     [
   44: char *program_name;
   45:     ],[
   46: recode_format_table();
   47:     ],[
   48:       PHP_ADD_LIBRARY_DEFER_WITH_PATH(recode, $RECODE_DIR/$RECODE_LIB, RECODE_SHARED_LIBADD)
   49:       AC_DEFINE(HAVE_BROKEN_RECODE, 1, [Whether we have librecode 3.5])
   50:     ],[
   51:       AC_MSG_ERROR(I cannot link librecode (-L$RECODE_DIR/$RECODE_LIB -lrecode). Is it installed?)
   52:     ])
   53:     LIBS=$old_LIBS
   54:     LDFLAGS=$old_LDFLAGS
   55:   ], [
   56:     -L$RECODE_DIR/$RECODE_LIB
   57:   ])
   58: 
   59:   AC_DEFINE(HAVE_LIBRECODE, 1, [Whether we have librecode 3.5 or higher])
   60:   PHP_ADD_INCLUDE($RECODE_DIR/$RECODE_INC)
   61:   PHP_SUBST(RECODE_SHARED_LIBADD)
   62:   AC_CHECK_HEADERS(stdbool.h)
   63:   PHP_NEW_EXTENSION(recode, recode.c, $ext_shared)
   64: fi

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