You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rh...@apache.org on 2012/08/09 16:02:38 UTC
svn commit: r1371216 - in /qpid/proton/trunk/proton-c/bindings:
CMakeLists.txt php/CMakeLists.txt php/get_include_dir.php
Author: rhs
Date: Thu Aug 9 14:02:38 2012
New Revision: 1371216
URL: http://svn.apache.org/viewvc?rev=1371216&view=rev
Log:
fixed build to install cproton.php
Added:
qpid/proton/trunk/proton-c/bindings/php/get_include_dir.php
Modified:
qpid/proton/trunk/proton-c/bindings/CMakeLists.txt
qpid/proton/trunk/proton-c/bindings/php/CMakeLists.txt
Modified: qpid/proton/trunk/proton-c/bindings/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/bindings/CMakeLists.txt?rev=1371216&r1=1371215&r2=1371216&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/bindings/CMakeLists.txt (original)
+++ qpid/proton/trunk/proton-c/bindings/CMakeLists.txt Thu Aug 9 14:02:38 2012
@@ -38,5 +38,8 @@ endif (RUBY_FOUND)
# @todo: allow user to specify which php-config if multiple PHP sources installed!
find_program(PHP_CONFIG_EXE php-config)
if (PHP_CONFIG_EXE)
- add_subdirectory(php)
+ find_program(PHP_EXE php)
+ if (PHP_EXE)
+ add_subdirectory(php)
+ endif (PHP_EXE)
endif (PHP_CONFIG_EXE)
Modified: qpid/proton/trunk/proton-c/bindings/php/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/bindings/php/CMakeLists.txt?rev=1371216&r1=1371215&r2=1371216&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/bindings/php/CMakeLists.txt (original)
+++ qpid/proton/trunk/proton-c/bindings/php/CMakeLists.txt Thu Aug 9 14:02:38 2012
@@ -43,8 +43,18 @@ execute_process(COMMAND ${PHP_CONFIG_EXE
OUTPUT_VARIABLE PHP_PFX
OUTPUT_STRIP_TRAILING_WHITESPACE)
+
string(REPLACE ${PHP_PFX} ${CMAKE_INSTALL_PREFIX} PHP_REL_EXT_DIR ${PHP_EXT_DIR})
+set(GET_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/get_include_dir.php)
+execute_process(COMMAND ${PHP_EXE} ${GET_INCLUDE_DIR} ${PHP_PFX}
+ OUTPUT_VARIABLE PHP_INCLUDE_DIR
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+string(REPLACE ${PHP_PFX} ${CMAKE_INSTALL_PREFIX} PHP_REL_INCLUDE_DIR ${PHP_INCLUDE_DIR})
+
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cproton.so
DESTINATION ${PHP_REL_EXT_DIR}
COMPONENT PHP)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cproton.php
+ DESTINATION ${PHP_REL_INCLUDE_DIR}
+ COMPONENT PHP)
Added: qpid/proton/trunk/proton-c/bindings/php/get_include_dir.php
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/bindings/php/get_include_dir.php?rev=1371216&view=auto
==============================================================================
--- qpid/proton/trunk/proton-c/bindings/php/get_include_dir.php (added)
+++ qpid/proton/trunk/proton-c/bindings/php/get_include_dir.php Thu Aug 9 14:02:38 2012
@@ -0,0 +1,34 @@
+<?php
+
+$prefix = $argv[1];
+$include_path = ini_get("include_path");
+
+$php_dir = null;
+$pear_dir = null;
+$abs_dir = null;
+
+foreach (explode(PATH_SEPARATOR, $include_path) as $include_dir) {
+ if (strpos($include_dir, ".") === false &&
+ strpos($include_dir, $prefix) === 0) {
+ $abs_dir = $include_dir;
+ $suffix = substr($abs_dir, strlen($prefix));
+ if (strpos($suffix, "php") !== false) {
+ $php_dir = $abs_dir;
+ }
+ if (strpos($suffix, "pear") !== false) {
+ $pear_dir = $abs_dir;
+ }
+ }
+}
+
+if ($php_dir) {
+ print $php_dir;
+} else if ($pear_dir) {
+ print $pear_dir;
+} else if ($abs_dir) {
+ print $abs_dir;
+}
+
+print "\n";
+
+?>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org