svn: /pecl/imagick/trunk/ config.m4 config.w32 imagick.c php_imagick.h php_imagick_defs.h php_imagick_shared.h
| From: | Mikko Koppanen | Date: | Mon, 21 Sep 2009 19:28:12 +0000 |
| Subject: | svn: /pecl/imagick/trunk/ config.m4 config.w32 imagick.c php_imagick.h php_imagick_defs.h php_imagick_shared.h | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-12912@lists.php.net to get a copy of this message | ||
mkoppanen Mon, 21 Sep 2009 19:28:12 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=288545
Log:
Housekeeping: Generate config header during configure regardless if building inside php source tree
Changed paths:
U pecl/imagick/trunk/config.m4
U pecl/imagick/trunk/config.w32
U pecl/imagick/trunk/imagick.c
U pecl/imagick/trunk/php_imagick.h
U pecl/imagick/trunk/php_imagick_defs.h
U pecl/imagick/trunk/php_imagick_shared.h
Modified: pecl/imagick/trunk/config.m4
===================================================================
--- pecl/imagick/trunk/config.m4 2009-09-21 19:11:13 UTC (rev 288544)
+++ pecl/imagick/trunk/config.m4 2009-09-21 19:28:12 UTC (rev 288545)
@@ -9,7 +9,7 @@
fi
if test $PHP_IMAGICK != "no"; then
-
+
AC_MSG_CHECKING(ImageMagick MagickWand API configuration program)
for i in $PHP_IMAGICK /usr/local /usr;
@@ -63,7 +63,8 @@
AC_MSG_ERROR(Cannot locate header file MagickWand.h)
fi
- AC_DEFINE(IMAGICK_USE_NEW_HEADER,1,[ ])
+ AC_DEFINE(IMAGICK_USE_NEW_HEADER,1,[ ])
+ PHP_IMAGICK_USE_NEW_HEADER=1
fi
dnl Thanks to Antony Dovgal for pointing out that the
@@ -109,6 +110,16 @@
PHP_SUBST(IMAGICK_SHARED_LIBADD)
PHP_NEW_EXTENSION(imagick, imagick_class.c imagickdraw_class.c imagickpixel_class.c
imagickpixeliterator_class.c imagick_helpers.c imagick_read.c imagick.c, $ext_shared)
- dnl share headers
- PHP_INSTALL_HEADERS([ext/imagick], [php_imagick.h php_imagick_defs.h config.h
php_imagick_shared.h])
+ dnl Generate configuration header
+ if test ! -z "${PHP_IMAGICK_USE_NEW_HEADER}"; then
+ echo "#ifndef _PHP_IMAGICK_CONFIG_H_" > php_imagick_config.h
+ echo "# ifndef IMAGICK_USE_NEW_HEADER" >> php_imagick_config.h
+ echo "# define IMAGICK_USE_NEW_HEADER 1" >> php_imagick_config.h
+ echo "# endif" >> php_imagick_config.h
+ echo "#endif" >> php_imagick_config.h
+ else
+ echo "" > php_imagick_config.h
+ fi
+
+ PHP_INSTALL_HEADERS([ext/imagick], [php_imagick.h php_imagick_defs.h php_imagick_shared.h
php_imagick_config.h])
fi
Modified: pecl/imagick/trunk/config.w32
===================================================================
--- pecl/imagick/trunk/config.w32 2009-09-21 19:11:13 UTC (rev 288544)
+++ pecl/imagick/trunk/config.w32 2009-09-21 19:28:12 UTC (rev 288545)
@@ -10,6 +10,12 @@
ADD_FLAG("CFLAGS_IMAGICK", "/D IMAGICK_USE_NEW_HEADER /D _MAGICKMOD_ /D _VISUALC_
/D NeedFunctionPrototypes /D _LIB");
EXTENSION('imagick', 'imagick_class.c imagickdraw_class.c imagickpixel_class.c
imagickpixeliterator_class.c imagick_helpers.c imagick_read.c imagick.c');
AC_DEFINE('HAVE_IMAGICK', 1);
+
+ echo "#ifndef _PHP_IMAGICK_CONFIG_H_" > php_imagick_config.h
+ echo "# ifndef IMAGICK_USE_NEW_HEADER" >> php_imagick_config.h
+ echo "# define IMAGICK_USE_NEW_HEADER 1" >> php_imagick_config.h
+ echo "# endif" >> php_imagick_config.h
+ echo "#endif" >> php_imagick_config.h
} else {
WARNING("imagick not enabled; libraries and headers not found");
}
Modified: pecl/imagick/trunk/imagick.c
===================================================================
--- pecl/imagick/trunk/imagick.c 2009-09-21 19:11:13 UTC (rev 288544)
+++ pecl/imagick/trunk/imagick.c 2009-09-21 19:28:12 UTC (rev 288545)
@@ -21,7 +21,6 @@
#include "php_imagick.h"
#include "php_imagick_defs.h"
#include "php_imagick_macros.h"
-#include "php_imagick_shared.h"
ZEND_DECLARE_MODULE_GLOBALS(imagick)
Modified: pecl/imagick/trunk/php_imagick.h
===================================================================
--- pecl/imagick/trunk/php_imagick.h 2009-09-21 19:11:13 UTC (rev 288544)
+++ pecl/imagick/trunk/php_imagick.h 2009-09-21 19:28:12 UTC (rev 288545)
@@ -26,15 +26,14 @@
#define PHP_IMAGICK_VERSION "2.3.1-dev"
#define PHP_IMAGICK_EXTNUM 20301
-/* Import configure options
- when building outside of
- the PHP source tree */
+/* Import configure options when building
+ outside of the PHP source tree */
#ifdef HAVE_CONFIG_H
-#include "config.h"
+# include "config.h"
#endif
#ifdef ZTS
-#include "TSRM.h"
+# include "TSRM.h"
#endif
/* Include PHP Standard Headers */
@@ -42,14 +41,14 @@
/* Include locale header */
#ifdef HAVE_LOCALE_H
-#include <locale.h>
+# include <locale.h>
#endif
/* Include magic wand header */
#ifdef IMAGICK_USE_NEW_HEADER
-#include <wand/MagickWand.h>
+# include <wand/MagickWand.h>
#else
-#include <wand/magick-wand.h>
+# include <wand/magick-wand.h>
#endif
#ifndef DefaultChannels
Modified: pecl/imagick/trunk/php_imagick_defs.h
===================================================================
--- pecl/imagick/trunk/php_imagick_defs.h 2009-09-21 19:11:13 UTC (rev 288544)
+++ pecl/imagick/trunk/php_imagick_defs.h 2009-09-21 19:28:12 UTC (rev 288545)
@@ -18,9 +18,17 @@
+----------------------------------------------------------------------+
*/
#ifndef PHP_IMAGICK_DEFS_H /* PHP_IMAGICK_DEFS_H */
-/* Prevent double inclusion */
-#define PHP_IMAGICK_DEFS_H
+# define PHP_IMAGICK_DEFS_H
+/*
+ API exports
+*/
+#ifdef PHP_WIN32
+# define IMAGICK_EXPORTS __declspec(dllexport)
+#else
+# define IMAGICK_EXPORTS PHPAPI
+#endif
+
/* Globals, needed for the ini settings */
ZEND_BEGIN_MODULE_GLOBALS(imagick)
zend_bool locale_fix;
Modified: pecl/imagick/trunk/php_imagick_shared.h
===================================================================
--- pecl/imagick/trunk/php_imagick_shared.h 2009-09-21 19:11:13 UTC (rev 288544)
+++ pecl/imagick/trunk/php_imagick_shared.h 2009-09-21 19:28:12 UTC (rev 288545)
@@ -21,23 +21,11 @@
#ifndef _PHP_IMAGICK_SHARED_H_
# define _PHP_IMAGICK_SHARED_H_
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
+#include "php_imagick_config.h"
#include "php_imagick.h"
#include "php_imagick_defs.h"
/*
- API exports
-*/
-#ifdef PHP_WIN32
-# define IMAGICK_EXPORTS __declspec(dllexport)
-#else
-# define IMAGICK_EXPORTS PHPAPI
-#endif
-
-/*
Allow extensions to use the class entries
*/
IMAGICK_EXPORTS zend_class_entry *php_imagick_get_class_entry();