Skip to content

Instantly share code, notes, and snippets.

@alex-laties
Created September 9, 2015 23:25
Show Gist options
  • Save alex-laties/f89fc3c1d8e45d115522 to your computer and use it in GitHub Desktop.
Save alex-laties/f89fc3c1d8e45d115522 to your computer and use it in GitHub Desktop.
A patch for PHP-CPP to allow for tests to be run against semantically versioned builds.
From dc9a664d0f006ba7cdec5b3f97a9b8b87992cc48 Mon Sep 17 00:00:00 2001
From: Alex Laties <agl@tumblr.com>
Date: Wed, 9 Sep 2015 19:22:51 -0400
Subject: [PATCH] fix up Makefile so it correctly links libphpcpp.so for tests
---
Makefile | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index b1a8047..0682643 100644
--- a/Makefile
+++ b/Makefile
@@ -198,6 +198,7 @@ clean:
${RM} shared ${PHP_SHARED_LIBRARY}
${RM} static ${PHP_STATIC_LIBRARY}
find -name *.o | xargs ${RM}
+ unlink libphpcpp.so
${COMMON_SHARED_OBJECTS}:
${COMPILER} ${COMPILER_FLAGS} ${SHARED_COMPILER_FLAGS} -o $@ ${@:shared/%.o=%.cpp}
@@ -230,7 +231,9 @@ install:
sudo ldconfig; \
fi
-test:
+test: ${PHP_SHARED_LIBRARY}
+ if [ ! -e "libphpcpp.so" ]; then \
+ ln -s ${PHP_SHARED_LIBRARY} libphpcpp.so; \
+ fi
mkdir -p tests/include/zts/phpcpp
cd tests && ./test.sh -p "${PHP_BIN}"
-
--
1.8.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment