freebsd-ports/math/libjbigi/files/patch-jbigi__build_jbigi.sh
Mario Sergio Fujikawa Ferreira 7721084482 o Fix build on amd64: do not try to build JCPUID on amd64 ARCH since
it requires "-fPIC" on linking (but it breaks when used).
o Use '-fPIC' on all other targets.
2009-04-24 11:20:13 +00:00

40 lines
1.3 KiB
Bash

--- jbigi/build_jbigi.sh.orig Fri Jan 21 18:52:41 2005
+++ jbigi/build_jbigi.sh Fri Dec 23 11:13:55 2005
@@ -2,7 +2,6 @@
# When executed in Mingw: Produces an jbigi.dll
# When executed in Linux: Produces an libjbigi.so
-CC="gcc"
case `uname -sr` in
MINGW*)
@@ -24,9 +23,9 @@
LINKFLAGS="-dynamiclib -framework JavaVM"
LIBFILE="libjbigi.jnilib";;
*)
- COMPILEFLAGS="-fPIC -Wall"
- INCLUDES="-I. -I../../jbigi/include -I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
- LINKFLAGS="-shared -Wl,-soname,libjbigi.so"
+ COMPILEFLAGS="-Wall ${CFLAGS}"
+ INCLUDES="-I. -I${LOCALBASE}/include -Ijbigi/include -I$JAVA_HOME/include -I$JAVA_HOME/include/freebsd"
+ LINKFLAGS="-shared -Wl,-soname,libjbigi.so ${LDFLAGS} -fPIC"
LIBFILE="libjbigi.so";;
esac
@@ -36,13 +35,13 @@
then
echo "Building jbigi lib that is dynamically linked to GMP"
LIBPATH="-L.libs"
- INCLUDELIBS="-lgmp"
+ INCLUDELIBS="-L${LOCALBASE}/lib -lgmp"
else
echo "Building jbigi lib that is statically linked to GMP"
- STATICLIBS=".libs/libgmp.a"
+ STATICLIBS="${LOCALBASE}/lib/libgmp.a"
fi
echo "Compiling C code..."
rm -f jbigi.o $LIBFILE
-$CC -c $COMPILEFLAGS $INCLUDES ../../jbigi/src/jbigi.c
+$CC -c $COMPILEFLAGS $INCLUDES jbigi/src/jbigi.c
$CC $LINKFLAGS $INCLUDES $INCLUDELIBS -o $LIBFILE jbigi.o $STATICLIBS