pkgsrc/lang/php5/patches/patch-ap
jdolecek ccd4418385 load extensions via dlopen(), in preference to using NsLinkModule() et.al. on Mac OS X,
so that symbols of loaded modules are available for other, dependant modules;
dlopen() is native function since 10.4, so actually apparently preferable interface
now

this is necessary for PDO family of modules (pdo_* depends on symbols of PDO module),
and for XSL module (which depends on symbols of DOM module); doing it this way
allows for PDO and DOM modules to be also shared and dynamically loaded, this avoids
need to compile them into main PHP binary

bump PKGREVISION, this is functionality change for Mac OS X (no change for other
platforms)
2007-09-04 23:39:31 +00:00

39 lines
1.4 KiB
Text

$NetBSD: patch-ap,v 1.3 2007/09/04 23:39:31 jdolecek Exp $
--- Zend/zend.h.orig 2007-09-05 00:16:02.000000000 +0200
+++ Zend/zend.h
@@ -80,18 +80,7 @@
# include <dlfcn.h>
#endif
-#if HAVE_MACH_O_DYLD_H
-#include <mach-o/dyld.h>
-
-/* MH_BUNDLE loading functions for Mac OS X / Darwin */
-void *zend_mh_bundle_load (char* bundle_path);
-int zend_mh_bundle_unload (void *bundle_handle);
-void *zend_mh_bundle_symbol(void *bundle_handle, const char *symbol_name);
-const char *zend_mh_bundle_error(void);
-
-#endif /* HAVE_MACH_O_DYLD_H */
-
-#if defined(HAVE_LIBDL) && !defined(HAVE_MACH_O_DYLD_H) && !defined(ZEND_WIN32)
+#if defined(HAVE_LIBDL) && !defined(ZEND_WIN32)
# ifndef RTLD_LAZY
# define RTLD_LAZY 1 /* Solaris 1, FreeBSD's (2.1.7.1 and older) */
@@ -118,6 +107,14 @@ const char *zend_mh_bundle_error(void);
# define DL_HANDLE void *
# define ZEND_EXTENSIONS_SUPPORT 1
#elif defined(HAVE_MACH_O_DYLD_H)
+
+#include <mach-o/dyld.h>
+
+/* MH_BUNDLE loading functions for Mac OS X / Darwin */
+void *zend_mh_bundle_load (char* bundle_path);
+int zend_mh_bundle_unload (void *bundle_handle);
+void *zend_mh_bundle_symbol(void *bundle_handle, const char *symbol_name);
+const char *zend_mh_bundle_error(void);
# define DL_LOAD(libname) zend_mh_bundle_load(libname)
# define DL_UNLOAD zend_mh_bundle_unload
# define DL_FETCH_SYMBOL(h,s) zend_mh_bundle_symbol(h,s)