php-src/ext/recode/config.m4

65 lines
1.7 KiB
Plaintext
Raw Normal View History

2001-11-30 19:00:13 +00:00
dnl
dnl $Id$
2001-11-30 19:00:13 +00:00
dnl
PHP_ARG_WITH(recode,for recode support,
2005-05-29 23:17:16 +00:00
[ --with-recode[=DIR] Include recode support])
2002-04-24 12:45:55 +00:00
if test "$PHP_RECODE" != "no"; then
RECODE_LIST="$PHP_RECODE /usr/local /usr /opt"
2002-04-24 12:45:55 +00:00
for i in $RECODE_LIST; do
if test -f $i/include/recode.h; then
RECODE_DIR=$i
RECODE_INC=include
RECODE_LIB=$PHP_LIBDIR
2002-04-24 12:45:55 +00:00
fi
if test -f $i/include/recode/recode.h; then
RECODE_DIR=$i
RECODE_INC=include/recode
RECODE_LIB=$PHP_LIBDIR/recode
2002-04-24 12:45:55 +00:00
fi
if test -f $i/recode/include/recode.h; then
RECODE_DIR=$i/recode
RECODE_INC=include
RECODE_LIB=$PHP_LIBDIR
2002-04-24 12:45:55 +00:00
fi
test -n "$RECODE_DIR" && break
2002-04-24 12:45:55 +00:00
done
if test -z "$RECODE_DIR"; then
AC_MSG_ERROR([Can not find recode.h anywhere under $RECODE_LIST.])
fi
PHP_CHECK_LIBRARY(recode, recode_format_table,
[
PHP_ADD_LIBRARY_WITH_PATH(recode, $RECODE_DIR/$RECODE_LIB, RECODE_SHARED_LIBADD)
2002-04-24 12:45:55 +00:00
], [
old_LDFLAGS=$LDFLAGS
old_LIBS=$LIBS
LDFLAGS="$LDFLAGS -L$RECODE_DIR/$RECODE_LIB"
LIBS="$LIBS -lrecode"
AC_TRY_LINK(
[
char *program_name;
],[
recode_format_table();
],[
PHP_ADD_LIBRARY_DEFER_WITH_PATH(recode, $RECODE_DIR/$RECODE_LIB, RECODE_SHARED_LIBADD)
AC_DEFINE(HAVE_BROKEN_RECODE, 1, [Whether we have librecode 3.5])
],[
AC_MSG_ERROR(I cannot link librecode (-L$RECODE_DIR/$RECODE_LIB -lrecode). Is it installed?)
])
LIBS=$old_LIBS
LDFLAGS=$old_LDFLAGS
2002-04-24 12:45:55 +00:00
], [
-L$RECODE_DIR/$RECODE_LIB
])
AC_DEFINE(HAVE_LIBRECODE, 1, [Whether we have librecode 3.5 or higher])
2002-04-24 12:45:55 +00:00
PHP_ADD_INCLUDE($RECODE_DIR/$RECODE_INC)
PHP_SUBST(RECODE_SHARED_LIBADD)
AC_CHECK_HEADERS(stdbool.h)
PHP_NEW_EXTENSION(recode, recode.c, $ext_shared)
fi