Improved support for GNU/kFreeBSD

- add kFreeBSD to NBI and CPUID
- add kFreeBSD to jcpuid/jbigi build scripts
- refresh debian patches to compensate for kFreeBSD changes
- i2prouter: Detect kFreeBSD and normalize its name
- clean up osid (switching to "elif") and adding support for detecting kFreeBSD
- update postinstall.sh; I2P cannot be installed using gij so postinstall.sh
  will not be run. If/when openjdk finally comes to kFreeBSD, we'll be ready for it.
This commit is contained in:
kytv
2012-11-19 22:41:54 +00:00
parent d94c14967c
commit d0a3c7256a
13 changed files with 92 additions and 74 deletions

View File

@@ -25,6 +25,10 @@ elif [ $UNIXTYPE = "linux" ] && [ -e /etc/arch-release ]; then
fi
elif [ $UNIXTYPE = "darwin" ]; then
JAVA_HOME=$(/usr/libexec/java_home)
elif [ $UNIXTYPE = "gnu/kfreebsd" ]; then
if [ -d /usr/lib/jvm/java-gcj ]; then
JAVA_HOME="/usr/lib/jvm/java-gcj"
fi
fi
export JAVA_HOME

View File

@@ -35,6 +35,8 @@ SunOS*|OpenBSD*|NetBSD*|*FreeBSD*|Linux*)
UNIXTYPE=$(uname -s | tr "[A-Z]" "[a-z]")
if [ $UNIXTYPE = "sunos" ]; then
UNIXTYPE="solaris"
elif [ $UNIXTYPE = "gnu/kfreebsd" ]; then
UNIXTYPE="linux"
fi
COMPILEFLAGS="-fPIC -Wall"
INCLUDES="-I. -I../../jbigi/include -I$JAVA_HOME/include -I$JAVA_HOME/include/${UNIXTYPE}"

View File

@@ -1,5 +1,13 @@
#!/bin/sh
# If JAVA_HOME isn't set we'll try to figure it out
[ -z $JAVA_HOME ] && . ../find-java-home
if [ ! -f "$JAVA_HOME/include/jni.h" ]; then
echo "Cannot find jni.h! Looked in '$JAVA_HOME/include/jni.h'"
echo "Please set JAVA_HOME to a java home that has the JNI"
exit 1
fi
#FIXME What platforms for MacOS?
MISC_DARWIN_PLATFORMS="powerpc powerpc64 powerpc64le powerpcle"
@@ -49,6 +57,8 @@ X86_PLATFORMS="pentium pentiummmx pentium2 pentium3 pentiumm k6 k62 k63 athlon g
if [ $(uname -s |tr "[A-Z]" "[a-z]") = "linux" ]; then
ECHO="/bin/echo"
elif [ $(uname -s |tr "[A-Z]" "[a-z]") = "gnu/kfreebsd" ]; then
ECHO="/bin/echo"
else
ECHO="echo"
fi
@@ -81,19 +91,23 @@ MINGW*)
PLATFORM_LIST="${MINGW_PLATFORMS}"
NAME="jbigi"
TYPE="dll"
TARGET="-windows-"
TARGET="windows"
$ECHO "Building windows .dlls for all architectures";;
Darwin*)
PLATFORM_LIST="${DARWIN_PLATFORMS}"
NAME="libjbigi"
TYPE="jnilib"
TARGET="-osx-"
TARGET="osx"
$ECHO "Building ${TARGET} .jnilibs for all architectures";;
Linux*)
Linux*|*kFreeBSD)
NAME="libjbigi"
TYPE="so"
PLATFORM_LIST=""
TARGET="-linux-"
if [ $(uname -s | tr "[A-Z]" "[a-z]") = "gnu/kfreebsd" ]; then
TARGET="kfreebsd"
else
TARGET="linux"
fi
arch=$(uname -m | cut -f1 -d" ")
case ${arch} in
i[3-6]86)
@@ -102,13 +116,13 @@ Linux*)
case ${arch} in
x86_64 | amd64)
PLATFORM_LIST="${X86_64_PLATFORMS}"
TARGET="-linux-X86_64-";;
TARGET="$TARGET-X86_64";;
ia64)
PLATFORM_LIST="${X86_64_PLATFORMS}"
TARGET="-linux-ia64-";;
TARGET="$TARGET-ia64";;
x86)
PLATFORM_LIST="${X86_PLATFORMS}"
TARGET="-linux-x86-";;
TARGET="$TARGET-x86";;
*)
PLATFORM_LIST="${LINUX_PLATFORMS}";;
esac
@@ -126,13 +140,13 @@ NetBSD*|FreeBSD*|OpenBSD*)
case ${arch} in
x86_64|amd64)
PLATFORM_LIST="${X86_64_PLATFORMS}"
TARGET="-${BSDTYPE}-X86_64-";;
TARGET="${BSDTYPE}-X86_64";;
ia64)
PLATFORM_LIST="${X86_64_PLATFORMS}"
TARGET="-${BSDTYPE}-ia64-";;
TARGET="${BSDTYPE}-ia64";;
x86)
PLATFORM_LIST="${X86_PLATFORMS}"
TARGET="-${BSDTYPE}-x86-";;
TARGET="${BSDTYPE}-x86";;
*)
case ${BSDTYPE} in
netbsd)
@@ -153,6 +167,10 @@ NetBSD*|FreeBSD*|OpenBSD*)
esac
make_static () {
#
# TODO
# Fix formatting of output filename. Final versions will need to look
# like libjbigi-linux-athlon64.so or libjbigi-linux-athlon64_64.so
$ECHO "Attempting .${4} creation for ${3}${5}${2}"
../../build_jbigi.sh static || return 1
cp ${3}.${4} ../../lib/net/i2p/util/${3}${5}${2}.${4}
@@ -217,7 +235,7 @@ do
rm -Rf *
fi
build_file "$VER" "$x" "$NAME" "$TYPE" "$TARGET"
build_file "$VER" "$x" "$NAME" "$TYPE" "-$TARGET-"
)
done

View File

@@ -35,11 +35,13 @@ case `uname -s` in
LINKFLAGS="-dynamiclib -framework JavaVM"
LIBFILE="lib/freenet/support/CPUInformation/libjcpuid-x86-darwin.jnilib";;
Linux*|OpenBSD*|NetBSD*|*FreeBSD*|SunOS*)
KFREEBSD=0
UNIXTYPE="`uname -s | tr [A-Z] [a-z]`"
if [ ${UNIXTYPE} = "sunos" ]; then
UNIXTYPE="solaris"
elif [ ${UNIXTYPE} = "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
@@ -62,11 +64,15 @@ case `uname -s` in
ARCH="x86";;
*)
echo "Unsupported build environment. jcpuid is only used on x86 systems."
exit 1;;
exit 0;;
esac
LINKFLAGS="-shared -Wl,-soname,libjcpuid-${ARCH}-${UNIXTYPE}.so"
LIBFILE="lib/freenet/support/CPUInformation/libjcpuid-${ARCH}-${UNIXTYPE}.so"
if [ $KFREEBSD -eq 1 ]; then
LIBFILE="lib/freenet/support/CPUInformation/libjcpuid-${ARCH}-kfreebsd.so"
else
LIBFILE="lib/freenet/support/CPUInformation/libjcpuid-${ARCH}-${UNIXTYPE}.so"
fi
COMPILEFLAGS="-fPIC -Wall"
INCLUDES="-I. -Iinclude -I${JAVA_HOME}/include -I${JAVA_HOME}/include/${UNIXTYPE}";;
esac