com php-src: support shared build on unix: Makefile.frag config.m4 phpdbg.h
| From: | Bob Weinand | Date: | Sat, 23 Nov 2013 17:56:16 +0000 |
| Subject: | com php-src: support shared build on unix: Makefile.frag config.m4 phpdbg.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-74665@lists.php.net to get a copy of this message | ||
Commit: 1c6e54ecdf183b471c1bc333e4cfec58ba50fe0d
Author: krakjoe <joe.watkins@live.co.uk> Sat, 23 Nov 2013 17:56:16 +0000
Parents: 61b484524afeaf5b5f47ea5f37e33f8b8064fabe
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1c6e54ecdf183b471c1bc333e4cfec58ba50fe0d
Log:
support shared build on unix
Changed paths:
M Makefile.frag
M config.m4
M phpdbg.h
Diff:
diff --git a/Makefile.frag b/Makefile.frag
index 8789bc7..714aacc 100644
--- a/Makefile.frag
+++ b/Makefile.frag
@@ -1,5 +1,10 @@
phpdbg: $(BUILD_BINARY)
+phpdbg-shared: $(BUILD_SHARED)
+
+$(BUILD_SHARED): $(PHP_GLOBAL_OBJS) $(PHP_BINARY_OBJS) $(PHP_PHPDBG_OBJS)
+ $(BUILD_PHPDBG_SHARED)
+
$(BUILD_BINARY): $(PHP_GLOBAL_OBJS) $(PHP_BINARY_OBJS) $(PHP_PHPDBG_OBJS)
$(BUILD_PHPDBG)
diff --git a/config.m4 b/config.m4
index ee80daa..c6a25cf 100644
--- a/config.m4
+++ b/config.m4
@@ -27,6 +27,8 @@ if test "$PHP_PHPDBG" != "no"; then
PHP_SELECT_SAPI(phpdbg, program, $PHP_PHPDBG_FILES, $PHP_PHPDBG_CFLAGS, [$(SAPI_PHPDBG_PATH)])
BUILD_BINARY="sapi/phpdbg/phpdbg"
+ BUILD_SHARED="sapi/phpdbg/libphpdbg.la"
+
BUILD_PHPDBG="\$(LIBTOOL) --mode=link \
\$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM)
\$(LDFLAGS) \$(PHP_RPATHS) \
\$(PHP_GLOBAL_OBJS) \
@@ -36,9 +38,22 @@ if test "$PHP_PHPDBG" != "no"; then
\$(PHPDBG_EXTRA_LIBS) \
\$(ZEND_EXTRA_LIBS) \
-o \$(BUILD_BINARY)"
+
+ BUILD_PHPDBG_SHARED="\$(LIBTOOL) --mode=link \
+ \$(CC) -shared -Wl,-soname,libphpdbg.so -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS)
\$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \
+ \$(PHP_GLOBAL_OBJS) \
+ \$(PHP_BINARY_OBJS) \
+ \$(PHP_PHPDBG_OBJS) \
+ \$(EXTRA_LIBS) \
+ \$(PHPDBG_EXTRA_LIBS) \
+ \$(ZEND_EXTRA_LIBS) \
+ \-DPHPDBG_SHARED \
+ -o \$(BUILD_SHARED)"
PHP_SUBST(BUILD_BINARY)
+ PHP_SUBST(BUILD_SHARED)
PHP_SUBST(BUILD_PHPDBG)
+ PHP_SUBST(BUILD_PHPDBG_SHARED)
fi
dnl ## Local Variables:
diff --git a/phpdbg.h b/phpdbg.h
index 39918ca..8a1b814 100644
--- a/phpdbg.h
+++ b/phpdbg.h
@@ -20,6 +20,14 @@
#ifndef PHPDBG_H
#define PHPDBG_H
+#ifdef PHP_WIN32
+# define PHPDBG_API __declspec(dllexport)
+#elif defined(__GNUC__) && __GNUC__ >= 4
+# define PHPDBG_API __attribute__ ((visibility("default")))
+#else
+# define PHPDBG_API
+#endif
+
#include "php.h"
#include "php_globals.h"
#include "php_variables.h"