cvs: pecl /freeimage config.m4 freeimage.c
| From: | Rasmus Lerdorf | Date: | Mon, 05 Jan 2004 16:59:28 +0000 |
| Subject: | cvs: pecl /freeimage config.m4 freeimage.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-646@lists.php.net to get a copy of this message | ||
rasmus Mon Jan 5 11:59:28 2004 EDT
Modified files:
/pecl/freeimage config.m4 freeimage.c
Log:
Should work on Linux now
Index: pecl/freeimage/config.m4
diff -u pecl/freeimage/config.m4:1.1.1.1 pecl/freeimage/config.m4:1.2
--- pecl/freeimage/config.m4:1.1.1.1 Fri Jan 2 01:37:26 2004
+++ pecl/freeimage/config.m4 Mon Jan 5 11:59:27 2004
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.1.1.1 2004/01/02 06:37:26 wenlong Exp $
+dnl $Id: config.m4,v 1.2 2004/01/05 16:59:27 rasmus Exp $
dnl config.m4 for extension freeimage
dnl Comments in this file start with the string 'dnl'.
@@ -7,9 +7,8 @@
dnl If your extension references something external, use with:
-dnl PHP_ARG_WITH(freeimage, for freeimage support,
-dnl Make sure that the comment is aligned:
-dnl [ --with-freeimage Include freeimage support])
+PHP_ARG_WITH(freeimage, for freeimage support,
+[ --with-freeimage Include freeimage support])
dnl Otherwise use enable:
@@ -17,47 +16,52 @@
dnl Make sure that the comment is aligned:
dnl [ --enable-freeimage Enable freeimage support])
-if test "$PHP_FREEIMAGE" != "no"; then
- dnl Write more examples of tests here...
+if test "$PHP_FREEIMAGE" != "no"; then
dnl # --with-freeimage -> check with-path
- dnl SEARCH_PATH="/usr/local /usr" # you might want to change this
- dnl SEARCH_FOR="/include/freeimage.h" # you most likely want to change this
- dnl if test -r $PHP_FREEIMAGE/$SEARCH_FOR; then # path given as parameter
- dnl FREEIMAGE_DIR=$PHP_FREEIMAGE
- dnl else # search default path list
- dnl AC_MSG_CHECKING([for freeimage files in default path])
- dnl for i in $SEARCH_PATH ; do
- dnl if test -r $i/$SEARCH_FOR; then
- dnl FREEIMAGE_DIR=$i
- dnl AC_MSG_RESULT(found in $i)
- dnl fi
- dnl done
- dnl fi
- dnl
- dnl if test -z "$FREEIMAGE_DIR"; then
- dnl AC_MSG_RESULT([not found])
- dnl AC_MSG_ERROR([Please reinstall the freeimage distribution])
- dnl fi
+ SEARCH_PATH="/usr /usr/local"
+ SEARCH_FOR="/include/FreeImage.h"
+ if test -r $PHP_FREEIMAGE/$SEARCH_FOR; then # path given as parameter
+ FREEIMAGE_DIR=$PHP_FREEIMAGE
+ else # search default path list
+ AC_MSG_CHECKING([for freeimage files in default path])
+ for i in $SEARCH_PATH ; do
+ if test -r $i/$SEARCH_FOR; then
+ FREEIMAGE_DIR=$i
+ AC_MSG_RESULT(found in $i)
+ fi
+ done
+ fi
+
+ if test -z "$FREEIMAGE_DIR"; then
+ AC_MSG_RESULT([not found])
+ AC_MSG_ERROR([Please reinstall the freeimage distribution])
+ fi
+
+ AC_LANG_CPLUSPLUS
+ PHP_REQUIRE_CXX
dnl # --with-freeimage -> add include path
- dnl PHP_ADD_INCLUDE($FREEIMAGE_DIR/include)
+ PHP_ADD_INCLUDE($FREEIMAGE_DIR/include)
dnl # --with-freeimage -> check for lib and symbol presence
- dnl LIBNAME=freeimage # you may want to change this
- dnl LIBSYMBOL=freeimage # you most likely want to change this
+ LIBNAME=freeimage
+ LIBSYMBOL=FreeImage_GetVersion
+
+ PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
+ [
+ old_LIBS="$LIBS"
+ LIBS="$LIBS -lstdc++"
+ PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $FREEIMAGE_DIR/lib, FREEIMAGE_SHARED_LIBADD)
+ LIBS="$old_LIBS"
+ AC_DEFINE(HAVE_FREEIMAGELIB,1,[ ])
+ ],[
+ AC_MSG_ERROR([wrong freeimage lib version or lib not found])
+ ],[
+ -L$FREEIMAGE_DIR/lib -lm -ldl
+ ])
- dnl PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
- dnl [
- dnl PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $FREEIMAGE_DIR/lib, FREEIMAGE_SHARED_LIBADD)
- dnl AC_DEFINE(HAVE_FREEIMAGELIB,1,[ ])
- dnl ],[
- dnl AC_MSG_ERROR([wrong freeimage lib version or lib not found])
- dnl ],[
- dnl -L$FREEIMAGE_DIR/lib -lm -ldl
- dnl ])
- dnl
- dnl PHP_SUBST(FREEIMAGE_SHARED_LIBADD)
+ PHP_SUBST(FREEIMAGE_SHARED_LIBADD)
PHP_NEW_EXTENSION(freeimage, freeimage.c, $ext_shared)
fi
Index: pecl/freeimage/freeimage.c
diff -u pecl/freeimage/freeimage.c:1.2 pecl/freeimage/freeimage.c:1.3
--- pecl/freeimage/freeimage.c:1.2 Mon Jan 5 00:13:20 2004
+++ pecl/freeimage/freeimage.c Mon Jan 5 11:59:27 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: freeimage.c,v 1.2 2004/01/05 05:13:20 wenlong Exp $ */
+/* $Id: freeimage.c,v 1.3 2004/01/05 16:59:27 rasmus Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -180,8 +180,8 @@
freeimage_functions,
PHP_MINIT(freeimage),
PHP_MSHUTDOWN(freeimage),
- PHP_RINIT(freeimage), /* Replace with NULL if there's nothing to do at request start */
- PHP_RSHUTDOWN(freeimage), /* Replace with NULL if there's nothing to do at request end */
+ NULL,
+ NULL,
PHP_MINFO(freeimage),
#if ZEND_MODULE_API_NO >= 20010901
"0.1", /* Replace with version number for your extension */
@@ -341,30 +341,13 @@
}
/* }}} */
-/* Remove if there's nothing to do at request start */
-/* {{{ PHP_RINIT_FUNCTION
- */
-PHP_RINIT_FUNCTION(freeimage)
-{
- return SUCCESS;
-}
-/* }}} */
-
-/* Remove if there's nothing to do at request end */
-/* {{{ PHP_RSHUTDOWN_FUNCTION
- */
-PHP_RSHUTDOWN_FUNCTION(freeimage)
-{
- return SUCCESS;
-}
-/* }}} */
-
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(freeimage)
{
php_info_print_table_start();
php_info_print_table_header(2, "freeimage support", "enabled");
+ php_info_print_table_row(2, "Version", FreeImage_GetVersion());
php_info_print_table_end();
/* Remove comments if you have entries in php.ini