summaryrefslogtreecommitdiff
path: root/ext/bz2
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2003-12-04 02:58:33 +0000
committerWez Furlong <wez@php.net>2003-12-04 02:58:33 +0000
commit213f528aad57a59ce851b2960443876447badf9e (patch)
tree88b5cbfdc53aff5fb2314c244c9a069a4d6dd5ad /ext/bz2
parent1635a2bdf5c57d52e6c5d6ce123f93636d8820d5 (diff)
downloadphp-git-213f528aad57a59ce851b2960443876447badf9e.tar.gz
Fixup bz2 extension so it builds as shared and static under win32
Diffstat (limited to 'ext/bz2')
-rw-r--r--ext/bz2/config.w3218
-rw-r--r--ext/bz2/php_bz2.h10
2 files changed, 24 insertions, 4 deletions
diff --git a/ext/bz2/config.w32 b/ext/bz2/config.w32
new file mode 100644
index 0000000000..7fe9c555bf
--- /dev/null
+++ b/ext/bz2/config.w32
@@ -0,0 +1,18 @@
+// $Id$
+// vim:ft=javascript
+
+ARG_WITH("bz2", "BZip2", "no");
+
+if (PHP_BZ2 != "no") {
+ if (CHECK_LIB("libbz2.lib", "bz2", PHP_BZ2) &&
+ CHECK_HEADER_ADD_INCLUDE("bzlib.h", "CFLAGS_BZ2")) {
+ EXTENSION("bz2", "bz2.c");
+ AC_DEFINE('HAVE_BZ2', 1, 'Have BZ2 library');
+ // BZ2 extension does this slightly differently from others
+ if (PHP_BZ2_SHARED) {
+ ADD_FLAG("CFLAGS_BZ2", "/D PHP_BZ2_EXPORTS ");
+ }
+ } else {
+ WARNING("bz2 not enabled; libraries and headers not found");
+ }
+}
diff --git a/ext/bz2/php_bz2.h b/ext/bz2/php_bz2.h
index 30383ed88c..89323cda78 100644
--- a/ext/bz2/php_bz2.h
+++ b/ext/bz2/php_bz2.h
@@ -44,16 +44,18 @@ PHP_FUNCTION(bzdecompress);
#ifdef PHP_WIN32
# ifdef PHP_BZ2_EXPORTS
-# define PHP_BZ2_API __declspec(dllexport)
+# define PHP_BZ2_API __declspec(dllexport)
+# elif defined(COMPILE_DL_BZ2)
+# define PHP_BZ2_API __declspec(dllimport)
# else
-# define PHP_BZ2_API __declspec(dllimport)
+# define PHP_BZ2_API /* nothing special */
# endif
#else
# define PHP_BZ2_API
#endif
-PHP_BZ2_API PHPAPI php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
-PHP_BZ2_API PHPAPI php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz, char *mode, php_stream *innerstream STREAMS_DC TSRMLS_DC);
+PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
+PHP_BZ2_API php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz, char *mode, php_stream *innerstream STREAMS_DC TSRMLS_DC);
#define php_stream_bz2open_from_BZFILE(bz, mode, innerstream) _php_stream_bz2open_from_BZFILE((bz), (mode), (innerstream) STREAMS_CC TSRMLS_CC)
#define php_stream_bz2open(wrapper, path, mode, options, opened_path) _php_stream_bz2open((wrapper), (path), (mode), (options), (opened_path), NULL STREAMS_CC TSRMLS_CC)