forked from I2P_Developers/i2p.i2p
Quote and shellcheck the jbigi.jar build scripts in order to fix errors when building jbigi jars on Windows
This commit is contained in:
@@ -39,13 +39,13 @@ cd bin/local
|
||||
|
||||
echo "Building..."
|
||||
if [ "$1" != "dynamic" ]; then
|
||||
case `uname -sr` in
|
||||
case $(uname -sr) in
|
||||
Darwin*)
|
||||
# --with-pic is required for static linking
|
||||
../../gmp-${GMP_VER}/configure --with-pic;;
|
||||
../../gmp-"${GMP_VER}"/configure --with-pic;;
|
||||
*)
|
||||
# and it's required for ASLR
|
||||
../../gmp-${GMP_VER}/configure --with-pic;;
|
||||
../../gmp-"${GMP_VER}"/configure --with-pic;;
|
||||
esac
|
||||
make
|
||||
make check
|
||||
@@ -55,13 +55,13 @@ else
|
||||
sh ../../build_jbigi.sh dynamic
|
||||
fi
|
||||
|
||||
cp *jbigi???* ../../lib/
|
||||
cp -- *jbigi???* ../../lib/
|
||||
echo 'Library copied to lib/'
|
||||
cd ../..
|
||||
|
||||
if [ "$1" != "notest" ]; then
|
||||
if [ -z "$I2P" ]; then
|
||||
if [ -r $HOME/i2p/lib/i2p.jar ]; then
|
||||
if [ -r "$HOME/i2p/lib/i2p.jar" ]; then
|
||||
I2P="$HOME/i2p"
|
||||
elif [ -r /usr/share/i2p/lib/i2p.jar ]; then
|
||||
I2P="/usr/share/i2p"
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd `dirname $0`
|
||||
cd "$(dirname "$0")" || exit 1
|
||||
rm -rf lib
|
||||
mkdir -p lib/freenet/support/CPUInformation
|
||||
|
||||
[ -z $CC_PREFIX ] && CC_PREFIX=""
|
||||
[ -z $TARGET ] && TARGET="$(uname -s)"
|
||||
[ -z $HOST ] && HOST="$(uname -s | tr '[:upper:]' '[:lower:]')"
|
||||
[ -z "$CC_PREFIX" ] && CC_PREFIX=""
|
||||
[ -z "$TARGET" ] && TARGET="$(uname -s)"
|
||||
[ -z "$HOST" ] && HOST="$(uname -s | tr '[:upper:]' '[:lower:]')"
|
||||
|
||||
case $TARGET in
|
||||
case "$TARGET" in
|
||||
MINGW*|CYGWIN*|windows*)
|
||||
echo "Building windows .dlls";;
|
||||
SunOS*)
|
||||
@@ -16,14 +16,14 @@ case $TARGET in
|
||||
Darwin*)
|
||||
echo "Building Darwin jnilibs";;
|
||||
Linux*|NetBSD*|OpenBSD*|*FreeBSD*)
|
||||
echo "Building `uname -s |tr [A-Z] [a-z]` .sos";;
|
||||
echo "Building $(uname -s |tr [A-Z] [a-z]) .sos";;
|
||||
*)
|
||||
echo "Unsupported build environment"
|
||||
exit 1;;
|
||||
esac
|
||||
|
||||
|
||||
if [ -z $BITS ]; then
|
||||
if [ -z "$BITS" ]; then
|
||||
UNAME="$(uname -m)"
|
||||
if test "${UNAME#*x86_64}" != "$UNAME"; then
|
||||
BITS=64
|
||||
@@ -45,13 +45,13 @@ if [ -z $BITS ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
printf "BITS variable not set, $BITS bit system detected\n" >&2
|
||||
printf '..%s..' "BITS variable not set, $BITS bit system detected\n" >&2
|
||||
fi
|
||||
|
||||
|
||||
if [ -z $CC ]; then
|
||||
if [ -z "$CC" ]; then
|
||||
export CC="gcc"
|
||||
printf "CC variable not set, defaulting to $CC\n" >&2
|
||||
printf '..%s..' "CC variable not set, defaulting to $CC\n" >&2
|
||||
fi
|
||||
|
||||
|
||||
@@ -67,14 +67,14 @@ if [ -z "$DEBIANVERSION" ] ; then
|
||||
export CFLAGS="-m64 -mtune=generic"
|
||||
export LDFLAGS="-m64"
|
||||
else
|
||||
printf "BITS value \"$BITS\" not valid, please select 32 or 64\n" >&2
|
||||
printf '..%s..' "BITS value \"$BITS\" not valid, please select 32 or 64\n" >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
[ -z $ARCH ] && case `uname -m` in
|
||||
[ -z "$ARCH" ] && case $(uname -m) in
|
||||
x86_64*|amd64)
|
||||
if [ $BITS -eq 64 ]; then
|
||||
if [ "$BITS" -eq 64 ]; then
|
||||
ARCH="x86_64"
|
||||
else
|
||||
ARCH="x86"
|
||||
@@ -86,7 +86,7 @@ fi
|
||||
ARCH="x86";;
|
||||
# Solaris x86
|
||||
i86pc)
|
||||
if [ $BITS -eq 64 ]; then
|
||||
if [ "$BITS" -eq 64 ]; then
|
||||
ARCH="x86_64"
|
||||
else
|
||||
ARCH="x86"
|
||||
@@ -98,9 +98,9 @@ fi
|
||||
esac
|
||||
|
||||
|
||||
case $TARGET in
|
||||
case "$TARGET" in
|
||||
MINGW*|CYGWIN*|windows*)
|
||||
[ -z $JAVA_HOME ] && JAVA_HOME="/c/software/j2sdk1.4.2_05"
|
||||
[ -z "$JAVA_HOME" ] && JAVA_HOME="/c/software/j2sdk1.4.2_05"
|
||||
CFLAGS="${CFLAGS} -Wall"
|
||||
INCLUDES="-I. -Iinclude -I${JAVA_HOME}/include/ -I${JAVA_HOME}/include/$HOST/"
|
||||
LDFLAGS="${LDFLAGS} -shared -static -static-libgcc -Wl,--kill-at"
|
||||
@@ -113,15 +113,15 @@ case $TARGET in
|
||||
LIBFILE="lib/freenet/support/CPUInformation/libjcpuid-x86_64-osx.jnilib";;
|
||||
Linux*|OpenBSD*|NetBSD*|*FreeBSD*|SunOS*)
|
||||
KFREEBSD=0
|
||||
UNIXTYPE="`uname -s | tr [A-Z] [a-z]`"
|
||||
if [ ${UNIXTYPE} = "sunos" ]; then
|
||||
UNIXTYPE="$(uname -s | tr [A-Z] [a-z])"
|
||||
if [ "${UNIXTYPE}" = "sunos" ]; then
|
||||
UNIXTYPE="solaris"
|
||||
elif [ ${UNIXTYPE} = "gnu/kfreebsd" ]; then
|
||||
elif [ "${UNIXTYPE}" = "gnu/kfreebsd" ]; then
|
||||
UNIXTYPE="linux"
|
||||
KFREEBSD=1
|
||||
fi
|
||||
# If JAVA_HOME isn't set, try to figure it out on our own
|
||||
[ -z $JAVA_HOME ] && . ../find-java-home
|
||||
[ -z "$JAVA_HOME" ] && . ../find-java-home
|
||||
# JAVA_HOME being set doesn't guarantee that it's usable
|
||||
if [ ! -f "$JAVA_HOME/include/jni.h" ]; then
|
||||
echo "Please ensure you have a Java SDK installed" >&2
|
||||
@@ -151,10 +151,10 @@ echo "HOST:$HOST"
|
||||
echo "ARCH:$ARCH"
|
||||
echo "CFLAGS:$CFLAGS"
|
||||
echo "LDFLAGS:$LDFLAGS"
|
||||
echo ""
|
||||
echo "INCLUDES:$INCLUDES"
|
||||
|
||||
echo "Compiling C code..."
|
||||
rm -f ${LIBFILE}
|
||||
${CC_PREFIX}${CC} ${CFLAGS} ${LDFLAGS} ${INCLUDES} src/*.c -o ${LIBFILE} || (echo "Failed to compile ${LIBFILE}"; exit 1)
|
||||
${CC_PREFIX}strip ${LIBFILE} || (echo "Failed to strip ${LIBFILE}" ; exit 1)
|
||||
echo Built `dirname $0`/${LIBFILE}
|
||||
"${CC_PREFIX}""${CC}" ${CFLAGS} ${LDFLAGS} ${INCLUDES} src/*.c -o "${LIBFILE}" || (echo "Failed to compile ${LIBFILE}"; exit 1)
|
||||
"${CC_PREFIX}"strip "${LIBFILE}" || (echo "Failed to strip ${LIBFILE}" ; exit 1)
|
||||
echo Built "$(dirname "$0")"/"${LIBFILE}"
|
||||
|
||||
Reference in New Issue
Block a user