summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2014-06-18 16:09:46 +0000
committerhallgren <hallgren@chalmers.se>2014-06-18 16:09:46 +0000
commit65b064fe8232f0bf0ece2cbd1ca80c041be9c4a3 (patch)
tree894752551ef432b9e05ee925e9673a700e7dc9b5
parentd92f65f186a5c93f6e08150385a6856f69a8cca5 (diff)
build-binary-dist.sh: updated to include the Python binding to the C run-time
There are also some changes in src/runtime/python/setyp.py to support this.
-rw-r--r--bin/build-binary-dist.sh28
-rw-r--r--src/runtime/python/setup.py10
2 files changed, 31 insertions, 7 deletions
diff --git a/bin/build-binary-dist.sh b/bin/build-binary-dist.sh
index 8a018a6f3..cf8caf218 100644
--- a/bin/build-binary-dist.sh
+++ b/bin/build-binary-dist.sh
@@ -14,22 +14,36 @@ destdir=/tmp/gf-binary-dist-$$ # assemble binary dist here
prefix=/usr/local # where to install
targz=gf-$ver-bin-$hw-$os.tar.gz # the final tar file
+extralib="$destdir$prefix/lib"
+extrainclude="$destdir$prefix/include"
+extra="--extra-lib-dirs=$extralib --extra-include-dirs=$extrainclude"
+
set -e # Stop if an error occurs
set -x # print commands before exuting them
## First configure & build the C run-time system
-(
-cd src/runtime/c
+pushd src/runtime/c
bash setup.sh configure --prefix=$prefix
bash setup.sh build
bash setup.sh install prefix=$destdir$prefix
-)
+popd
+
+## Build the python binding to the C run-time system
+pushd src/runtime/python
+EXTRA_INCLUDE_DIRS="$extrainclude" EXTRA_LIB_DIRS="$extralib" python setup.py build
+python setup.py install --prefix=$destdir$prefix
+popd
+
+## Build the Java binding to the C run-time system
+pushd src/runtime/java
+# not implemented yet
+popd
-## Now build GF, with C run-time support enabled
+## Build GF, with C run-time support enabled
cabal install --only-dependencies
-cabal configure --prefix=$prefix -fserver -fc-runtime --extra-lib-dirs=$destdir$prefix/lib --extra-include-dirs=$destdir$prefix/include
-cabal build
-cabal copy --destdir=$destdir
+cabal configure --prefix=$prefix -fserver -fc-runtime $extra
+DYLD_LIBRARY_PATH="$extralib" LD_LIBRARY_PATH="$extralib" cabal build
+DYLD_LIBRARY_PATH="$extralib" LD_LIBRARY_PATH="$extralib" cabal copy --destdir=$destdir
tar -C $destdir/$prefix -zcf $targz .
echo "Created $targz, consider renaming it to something more user friendly"
diff --git a/src/runtime/python/setup.py b/src/runtime/python/setup.py
index cac6f7409..19459b411 100644
--- a/src/runtime/python/setup.py
+++ b/src/runtime/python/setup.py
@@ -1,8 +1,18 @@
from distutils.core import setup, Extension
+import os
+
+includes = os.getenv('EXTRA_INCLUDE_DIRS','').split(':')
+if includes==['']:
+ includes=[]
+libraries = os.getenv('EXTRA_LIB_DIRS','').split(':')
+if libraries==['']:
+ libraries=[]
pgf_module = Extension('pgf',
sources = ['pypgf.c'],
extra_compile_args = ['-std=c99'],
+ include_dirs = includes,
+ library_dirs = libraries,
libraries = ['gu', 'pgf'])
setup (name = 'pgf',