cvs: php4 /ext/recode config.m4 recode.c
| From: | Jani Taskinen | Date: | Mon, 29 Apr 2002 15:40:16 +0000 |
| Subject: | cvs: php4 /ext/recode config.m4 recode.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-11529@lists.php.net to get a copy of this message | ||
sniper Mon Apr 29 11:40:16 2002 EDT
Modified files:
/php4/ext/recode config.m4 recode.c
Log:
Make it possible to use recode 3.5 too. (happy now Wez? :)
Index: php4/ext/recode/config.m4
diff -u php4/ext/recode/config.m4:1.9 php4/ext/recode/config.m4:1.10
--- php4/ext/recode/config.m4:1.9 Wed Apr 24 08:45:55 2002
+++ php4/ext/recode/config.m4 Mon Apr 29 11:40:16 2002
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.9 2002/04/24 12:45:55 sniper Exp $
+dnl $Id: config.m4,v 1.10 2002/04/29 15:40:16 sniper Exp $
dnl
PHP_ARG_WITH(recode,for recode support,
@@ -30,16 +30,33 @@
AC_MSG_ERROR([Can not find recode.h anywhere under $RECODE_LIST.])
fi
- PHP_CHECK_LIBRARY(recode, recode_format_table, [
- AC_DEFINE(HAVE_LIBRECODE, 1, [Whether we have librecode 3.5 or higher])
+ PHP_CHECK_LIBRARY(recode, recode_format_table,
+ [
+ PHP_ADD_LIBRARY_WITH_PATH(recode, $RECODE_DIR/$RECODE_LIB, RECODE_SHARED_LIBADD)
], [
- AC_MSG_ERROR(I cannot link librecode (-L$RECODE_DIR/$RECODE_LIB -lrecode). Is it installed?)
+ 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
], [
-L$RECODE_DIR/$RECODE_LIB
])
+ AC_DEFINE(HAVE_LIBRECODE, 1, [Whether we have librecode 3.5 or higher])
PHP_ADD_INCLUDE($RECODE_DIR/$RECODE_INC)
- PHP_ADD_LIBRARY_WITH_PATH(recode, $RECODE_DIR/$RECODE_LIB, RECODE_SHARED_LIBADD)
PHP_SUBST(RECODE_SHARED_LIBADD)
AC_CHECK_HEADERS(stdbool.h)
PHP_NEW_EXTENSION(recode, recode.c, $ext_shared)
Index: php4/ext/recode/recode.c
diff -u php4/ext/recode/recode.c:1.27 php4/ext/recode/recode.c:1.28
--- php4/ext/recode/recode.c:1.27 Wed Apr 24 08:45:55 2002
+++ php4/ext/recode/recode.c Mon Apr 29 11:40:16 2002
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: recode.c,v 1.27 2002/04/24 12:45:55 sniper Exp $ */
+/* $Id: recode.c,v 1.28 2002/04/29 15:40:16 sniper Exp $ */
/* {{{ includes & prototypes */
@@ -30,8 +30,10 @@
#if HAVE_LIBRECODE
/* For recode 3.5 */
+#if HAVE_BROKEN_RECODE
extern char *program_name;
char *program_name = "php";
+#endif
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
@@ -117,7 +119,7 @@
{
php_info_print_table_start();
php_info_print_table_row(2, "Recode Support", "enabled");
- php_info_print_table_row(2, "Revision", "$Revision: 1.27 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 1.28 $");
php_info_print_table_end();
}