changeset 706:de6fd9fc14e5 draft

SpliceX patched compiler for /path/to/Python.h and /path/to/structmember.h
author d3v11 <d3v11@d3v11.ano>
date Sat, 29 Oct 2011 11:37:41 -0400
parents dc8f88270f6a
children 67aa934958cf
files contrib/splicex/CHANGES contrib/splicex/README contrib/splicex/configure contrib/splicex/src/make.in
diffstat 4 files changed, 46 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/splicex/CHANGES	Sat Oct 29 10:17:30 2011 -0400
+++ b/contrib/splicex/CHANGES	Sat Oct 29 11:37:41 2011 -0400
@@ -25,3 +25,23 @@
 		via Cython. see README for dependencies
 		and installation details.
 		
+		SpliceX compiler flags patched. recent
+		update did not distinguish:
+
+			/usr/include/<python version>
+
+				-FROM-
+
+			/usr/local/include/<python version>
+
+		Thus, if you have debian python-dev or 
+		source python-dev the ./configure script
+		should choose the appropriate option.
+		if the configure still failed to locate
+		the python development files (headers)
+		please let me know and I will correct.
+
+		SpliceX can now optionally do a pure
+		python install. This cuts down on
+		dependencies and is useful if you just
+		want to test, try, and/or debug.
--- a/contrib/splicex/README	Sat Oct 29 10:17:30 2011 -0400
+++ b/contrib/splicex/README	Sat Oct 29 11:37:41 2011 -0400
@@ -32,6 +32,20 @@
 	If your goal is simply to test, try, and/or debug splicex then
 	using the pythonic install will be more practical.
 
+	NOTES:
+
+		If you installed Python from source you can ignore
+		the python-dev dependency below. However, your source
+		install of Python must have the development files. IE:
+
+		tar xvf Python-*.tgz
+		cd Python-*
+		./configure --with-pydebug
+		make install
+
+		This generates Python.h and structmember.h, which are
+		need for gcc to compile splicex.
+
 	DEPENDS ON:
 
 		python (>=2.6), python-dev(>=2.6), cython (>=0.12.1), 
--- a/contrib/splicex/configure	Sat Oct 29 10:17:30 2011 -0400
+++ b/contrib/splicex/configure	Sat Oct 29 11:37:41 2011 -0400
@@ -57,7 +57,15 @@
 echo -e "	python version == $1"
 echo -e "	interpreter path == $PYPATH"
 if [ -z "$2" ]; then
- echo -e "	compiler flags == gcc -I/usr/include/$1"
+ if [ -e /usr/include/"$1"/Python.h ] && [ -e /usr/include/"$1"/structmember.h ]; then
+  PYHEADERS="/usr/include/$1"
+  echo -e "	compiler flags == gcc -I /usr/include/$1"
+ elif [ -e /usr/local/include/"$1"/Python.h ] && [ -e /usr/local/include/"$1"/structmember.h ]; then
+  PYHEADERS="/usr/local/include/$1"
+  echo -e "	compiler flags == gcc -I /usr/local/include/$1"
+ else
+  echo -e "	Python.h and structmember.h could not be found... FAILED"
+ fi
 fi
 echo
 if [ -z "$2" ]; then
@@ -69,6 +77,7 @@
 echo -ne "	generating Makefile..."
 if [ -z "$2" ]; then
  sed -e s^PYTHON^"$1"^g src/make.in >Makefile || exit 1
+ sed -i s^HEADERS^"$PYHEADERS"^g Makefile || exit 1
  echo -ne ' DONE'
  echo
 else
--- a/contrib/splicex/src/make.in	Sat Oct 29 10:17:30 2011 -0400
+++ b/contrib/splicex/src/make.in	Sat Oct 29 11:37:41 2011 -0400
@@ -1,10 +1,10 @@
 compile:
 	cython build/deshadow.pyx -o build/deshadow.c
-	gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/PYTHON -c build/deshadow.c -o build/deshadow.o
+	gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I HEADERS -c build/deshadow.c -o build/deshadow.o
 	gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/deshadow.o -o build/deshadow.so
 
 	cython build/splicex.pyx -o build/splicex.c
-	gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/PYTHON -c build/splicex.c -o build/splicex.o
+	gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I HEADERS -c build/splicex.c -o build/splicex.o
 	gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/splicex.o -o build/splicex.so
 
 install-deb: