diff options
| author | Kristian Köhntopp <kk@php.net> | 2000-03-11 22:05:41 +0000 |
|---|---|---|
| committer | Kristian Köhntopp <kk@php.net> | 2000-03-11 22:05:41 +0000 |
| commit | 1aba4ea9d0d602a652687047e0e8ab2895aae955 (patch) | |
| tree | 31dd58e121c4a3adf627aaba205db24cce4db28c /ext/recode/config.m4 | |
| parent | 649d8721dbddc225a0330a0d9ed7750287dbcd18 (diff) | |
| download | php-git-1aba4ea9d0d602a652687047e0e8ab2895aae955.tar.gz | |
- Added additional DEFER macro.
- First stab at porting the recode module. Still having problems
with the _ex() functions, they core - why?
Diffstat (limited to 'ext/recode/config.m4')
| -rw-r--r-- | ext/recode/config.m4 | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/ext/recode/config.m4 b/ext/recode/config.m4 new file mode 100644 index 0000000000..992a79ef66 --- /dev/null +++ b/ext/recode/config.m4 @@ -0,0 +1,65 @@ +dnl $Id$ +dnl config.m4 for extension recode +dnl don't forget to call PHP_EXTENSION(recode) + + +AC_MSG_CHECKING(for recode support) +AC_ARG_WITH(recode, +[ --with-recode[=DIR] Include recode support. DIR is the recode + install directory.], +[ + if test "$withval" != "no"; then + RECODE_LIST="$withval /usr /usr/local /opt" + + for i in $RECODE_LIST; do + if test -f $i/include/recode.h; then + RECODE_DIR=$i + RECODE_INC=include + RECODE_LIB=lib + fi + if test -f $i/include/recode/recode.h; then + RECODE_DIR=$i + RECODE_INC=include/recode + RECODE_LIB=lib/recode + fi + if test -f $i/recode/include/recode.h; then + RECODE_DIR=$i/recode + RECODE_INC=include + RECODE_LIB=lib + fi + done + if test "$RECODE_DIR" = ""; then + AC_MSG_ERROR(I cannot find recode.h anywhere below $RECODE_LIST. Is it installed?) + fi + + 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(); +],[],[ + AC_MSG_ERROR(I cannot link librecode (-L$RECODE_DIR/$RECODE_LIB -lrecode). Is it installed?) +]) + LIBS="$old_LIBS" + LDFLAGS="$old_LDFLAGS" + + if test "$RECODE_LIB" = ""; then + AC_MSG_ERROR(Please reinstall recode - I cannot find librecode.a) + fi + + AC_ADD_INCLUDE($RECODE_DIR/$RECODE_INC) + AC_ADD_LIBRARY_DEFER_WITH_PATH(recode, $RECODE_DIR/$RECODE_LIB) + + AC_MSG_RESULT(yes) + + AC_DEFINE(HAVE_LIBRECODE, 1, [Whether we have librecode 3.5 or higher]) + PHP_EXTENSION(recode) + else + AC_MSG_RESULT(no) + fi +],[ + AC_MSG_RESULT(no) +]) |
