summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorskydrome2015-08-12 16:06:58 -0400
committerskydrome2015-08-12 16:06:58 -0400
commitb955a41caeab80bef8500d6966a29934b231567f (patch)
tree1e8ce0154acc7d33969ad79efe2095d6659a6f46
parenta710ef02d8617a732c76571960e7eca4d3ebe322 (diff)
downloadaur-b955a41caeab80bef8500d6966a29934b231567f.tar.gz
manually build onion-fec, including the java header files
using the Makefile works fine on i686 but fails for some with x64 systems
-rw-r--r--PKGBUILD22
1 files changed, 21 insertions, 1 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 2d298f3d6235..6c08d64557b7 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -203,7 +203,27 @@ build_fec() {
msg "Building onion-fec..."
cd "$srcdir/contrib/onion-fec/src/csrc"
- make
+ LDFLAGS="-shared -Wl,-O1,--sort-common,-z,relro"
+ INCLUDES="-I${_JAVA_HOME}/include -I${_JAVA_HOME}/include/linux"
+ _CLASSPATH="-classpath ../ com.onionnetworks.fec"
+
+ rm -f *.o *.S com_*.h
+
+ javah -o com_onionnetworks_fec_Native8Code.h ${_CLASSPATH}.Native8Code
+ javah -o com_onionnetworks_fec_Native16Code.h ${_CLASSPATH}.Native16Code
+
+ gcc fec.c -o fec8.S -S $CFLAGS -DGF_BITS=8
+ gcc fec.c -o fec16.S -S $CFLAGS -DGF_BITS=16
+
+ gcc fec-jinterf.c -o fec8-jinterf.o -c $CFLAGS $INCLUDES -DGF_BITS=8
+ gcc fec-jinterf.c -o fec16-jinterf.o -c $CFLAGS $INCLUDES -DGF_BITS=16
+
+ gcc fec8.S -o fec8.o -c $CFLAGS -DGF_BITS=8
+ gcc fec16.S -o fec16.o -c $CFLAGS -DGF_BITS=16
+
+ gcc fec8.o fec8-jinterf.o -o libfec8.so $LDFLAGS
+ gcc fec16.o fec16-jinterf.o -o libfec16.so $LDFLAGS
+
_DEST="../../bin/lib/linux-${_arch}"
mkdir -p "$_DEST"
cp libfec*.so "$_DEST"