mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 03:32:51 -06:00
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.
This commit is contained in:
@@ -14,22 +14,36 @@ destdir=/tmp/gf-binary-dist-$$ # assemble binary dist here
|
|||||||
prefix=/usr/local # where to install
|
prefix=/usr/local # where to install
|
||||||
targz=gf-$ver-bin-$hw-$os.tar.gz # the final tar file
|
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 -e # Stop if an error occurs
|
||||||
set -x # print commands before exuting them
|
set -x # print commands before exuting them
|
||||||
|
|
||||||
## First configure & build the C run-time system
|
## First configure & build the C run-time system
|
||||||
(
|
pushd src/runtime/c
|
||||||
cd src/runtime/c
|
|
||||||
bash setup.sh configure --prefix=$prefix
|
bash setup.sh configure --prefix=$prefix
|
||||||
bash setup.sh build
|
bash setup.sh build
|
||||||
bash setup.sh install prefix=$destdir$prefix
|
bash setup.sh install prefix=$destdir$prefix
|
||||||
)
|
popd
|
||||||
|
|
||||||
## Now build GF, with C run-time support enabled
|
## 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
|
||||||
|
|
||||||
|
## Build GF, with C run-time support enabled
|
||||||
cabal install --only-dependencies
|
cabal install --only-dependencies
|
||||||
cabal configure --prefix=$prefix -fserver -fc-runtime --extra-lib-dirs=$destdir$prefix/lib --extra-include-dirs=$destdir$prefix/include
|
cabal configure --prefix=$prefix -fserver -fc-runtime $extra
|
||||||
cabal build
|
DYLD_LIBRARY_PATH="$extralib" LD_LIBRARY_PATH="$extralib" cabal build
|
||||||
cabal copy --destdir=$destdir
|
DYLD_LIBRARY_PATH="$extralib" LD_LIBRARY_PATH="$extralib" cabal copy --destdir=$destdir
|
||||||
|
|
||||||
tar -C $destdir/$prefix -zcf $targz .
|
tar -C $destdir/$prefix -zcf $targz .
|
||||||
echo "Created $targz, consider renaming it to something more user friendly"
|
echo "Created $targz, consider renaming it to something more user friendly"
|
||||||
|
|||||||
@@ -1,8 +1,18 @@
|
|||||||
from distutils.core import setup, Extension
|
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',
|
pgf_module = Extension('pgf',
|
||||||
sources = ['pypgf.c'],
|
sources = ['pypgf.c'],
|
||||||
extra_compile_args = ['-std=c99'],
|
extra_compile_args = ['-std=c99'],
|
||||||
|
include_dirs = includes,
|
||||||
|
library_dirs = libraries,
|
||||||
libraries = ['gu', 'pgf'])
|
libraries = ['gu', 'pgf'])
|
||||||
|
|
||||||
setup (name = 'pgf',
|
setup (name = 'pgf',
|
||||||
|
|||||||
Reference in New Issue
Block a user