Skip to content
This repository was archived by the owner on Jul 26, 2018. It is now read-only.

Commit 1c2ab94

Browse files
committed
Fix a problem building the Java binding when creating binary packages
Pass -I and -L flags to gcc so that the C run-time system can be found. Also added a line in src/runtime/java/Makefile to install jpgf.jar.
1 parent f485851 commit 1c2ab94

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

bin/build-binary-dist.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,8 @@ fi
4545
if which >/dev/null javac && which >/dev/null jar ; then
4646
pushd src/runtime/java
4747
rm -f libjpgf.la # In case it contains the wrong INSTALL_PATH
48-
make INSTALL_PATH="$prefix/lib"
48+
make CFLAGS="-I$extrainclude -L$extralib" INSTALL_PATH="$prefix/lib"
4949
make INSTALL_PATH="$destdir$prefix/lib" install
50-
cp jpgf.jar "$destdir$prefix/lib" # missing from make install...
5150
popd
5251
else
5352
echo "Java SDK is not installed, so the Java binding will not be included"

debian/rules

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ override_dh_shlibdeps:
1515

1616
override_dh_auto_build:
1717
cd src/runtime/python && EXTRA_INCLUDE_DIRS=$(CURDIR)/src/runtime/c EXTRA_LIB_DIRS=$(CURDIR)/src/runtime/c/.libs python setup.py build
18-
cd src/runtime/java && make INSTALL_PATH=/usr/lib
18+
cd src/runtime/java && make CFLAGS="-I$(CURDIR)/src/runtime/c -L$(CURDIR)/src/runtime/c/.libs" INSTALL_PATH=/usr/lib
1919
echo LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(CURDIR)/src/runtime/c/.libs
2020
LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(CURDIR)/src/runtime/c/.libs cabal build
2121

@@ -37,7 +37,6 @@ override_dh_auto_install:
3737
cd src/runtime/c && bash setup.sh copy prefix=$(CURDIR)/debian/gf/usr
3838
cd src/runtime/python && python setup.py install --prefix=$(CURDIR)/debian/gf/usr
3939
cd src/runtime/java && make INSTALL_PATH=$(CURDIR)/debian/gf/usr/lib install
40-
cp src/runtime/java/jpgf.jar $(CURDIR)/debian/gf/usr/lib
4140
D="`find debian/gf -name site-packages`" && [ -n "$$D" ] && cd $$D && cd .. && mv site-packages dist-packages
4241

4342
override_dh_auto_test:

src/runtime/java/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ LIBTOOL = $(if $(shell command -v glibtool 2>/dev/null), glibtool --tag=CC, libt
1212
all: libjpgf.la jpgf.jar
1313

1414
libjpgf.la: $(patsubst %.c, %.lo, $(C_SOURCES))
15-
$(LIBTOOL) --mode=link gcc -g -O -o libjpgf.la -shared $^ -rpath $(INSTALL_PATH) -lgu -lpgf -lsg
15+
$(LIBTOOL) --mode=link gcc $(CFLAGS) -g -O -o libjpgf.la -shared $^ -rpath $(INSTALL_PATH) -lgu -lpgf -lsg
1616

1717
%.lo : %.c
18-
$(LIBTOOL) --mode=compile gcc -g -O -c -I$(JNI_PATH) -std=c99 -shared $< -o $@
18+
$(LIBTOOL) --mode=compile gcc $(CFLAGS) -g -O -c -I$(JNI_PATH) -std=c99 -shared $< -o $@
1919

2020
jpgf.jar: $(patsubst %.java, %.class, $(JAVA_SOURCES))
2121
jar -cf $@ org/grammaticalframework/pgf/*.class org/grammaticalframework/sg/*.class
@@ -25,6 +25,8 @@ jpgf.jar: $(patsubst %.java, %.class, $(JAVA_SOURCES))
2525

2626
install: libjpgf.la jpgf.jar
2727
$(LIBTOOL) --mode=install install -s libjpgf.la $(INSTALL_PATH)
28+
install jpgf.jar $(INSTALL_PATH)
29+
2830

2931
doc:
3032
javadoc org.grammaticalframework.pgf org.grammaticalframework.sg -d java-api

0 commit comments

Comments
 (0)