Changeset d0a3c72 for core/c


Ignore:
Timestamp:
Nov 19, 2012 10:41:54 PM (8 years ago)
Author:
kytv <kytv@…>
Branches:
master
Children:
5975b69
Parents:
d94c149
Message:

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.
Location:
core/c
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • core/c/find-java-home

    rd94c149 rd0a3c72  
    2626elif [ $UNIXTYPE = "darwin" ]; then
    2727    JAVA_HOME=$(/usr/libexec/java_home)
     28elif [ $UNIXTYPE = "gnu/kfreebsd" ]; then
     29    if [ -d /usr/lib/jvm/java-gcj ]; then
     30        JAVA_HOME="/usr/lib/jvm/java-gcj"
     31    fi
    2832fi
    2933
  • core/c/jbigi/build_jbigi.sh

    rd94c149 rd0a3c72  
    3636        if [ $UNIXTYPE = "sunos" ]; then
    3737            UNIXTYPE="solaris"
     38        elif [ $UNIXTYPE = "gnu/kfreebsd" ]; then
     39            UNIXTYPE="linux"
    3840        fi
    3941        COMPILEFLAGS="-fPIC -Wall"
  • core/c/jbigi/mbuild-all.sh

    rd94c149 rd0a3c72  
    11#!/bin/sh
     2
     3# If JAVA_HOME isn't set we'll try to figure it out
     4[ -z $JAVA_HOME ] && . ../find-java-home
     5if [ ! -f "$JAVA_HOME/include/jni.h" ]; then
     6    echo "Cannot find jni.h! Looked in '$JAVA_HOME/include/jni.h'"
     7    echo "Please set JAVA_HOME to a java home that has the JNI"
     8    exit 1
     9fi
    210
    311#FIXME What platforms for MacOS?
     
    4957
    5058if [ $(uname -s |tr "[A-Z]" "[a-z]") = "linux" ]; then
     59        ECHO="/bin/echo"
     60elif [ $(uname -s |tr "[A-Z]" "[a-z]") = "gnu/kfreebsd" ]; then
    5161        ECHO="/bin/echo"
    5262else
     
    8292        NAME="jbigi"
    8393        TYPE="dll"
    84         TARGET="-windows-"
     94        TARGET="windows"
    8595        $ECHO "Building windows .dlls for all architectures";;
    8696Darwin*)
     
    8898        NAME="libjbigi"
    8999        TYPE="jnilib"
    90         TARGET="-osx-"
     100        TARGET="osx"
    91101        $ECHO "Building ${TARGET} .jnilibs for all architectures";;
    92 Linux*)
     102Linux*|*kFreeBSD)
    93103        NAME="libjbigi"
    94104        TYPE="so"
    95105        PLATFORM_LIST=""
    96         TARGET="-linux-"
     106        if [ $(uname -s | tr "[A-Z]" "[a-z]") = "gnu/kfreebsd" ]; then
     107                TARGET="kfreebsd"
     108        else
     109                TARGET="linux"
     110        fi
    97111        arch=$(uname -m | cut -f1 -d" ")
    98112        case ${arch} in
     
    103117                x86_64 | amd64)
    104118                        PLATFORM_LIST="${X86_64_PLATFORMS}"
    105                         TARGET="-linux-X86_64-";;
     119                        TARGET="$TARGET-X86_64";;
    106120                ia64)
    107121                        PLATFORM_LIST="${X86_64_PLATFORMS}"
    108                         TARGET="-linux-ia64-";;
     122                        TARGET="$TARGET-ia64";;
    109123                x86)
    110124                        PLATFORM_LIST="${X86_PLATFORMS}"
    111                         TARGET="-linux-x86-";;
     125                        TARGET="$TARGET-x86";;
    112126                *)
    113127                        PLATFORM_LIST="${LINUX_PLATFORMS}";;
     
    127141                x86_64|amd64)
    128142                        PLATFORM_LIST="${X86_64_PLATFORMS}"
    129                         TARGET="-${BSDTYPE}-X86_64-";;
     143                        TARGET="${BSDTYPE}-X86_64";;
    130144                ia64)
    131145                        PLATFORM_LIST="${X86_64_PLATFORMS}"
    132                         TARGET="-${BSDTYPE}-ia64-";;
     146                        TARGET="${BSDTYPE}-ia64";;
    133147                x86)
    134148                        PLATFORM_LIST="${X86_PLATFORMS}"
    135                         TARGET="-${BSDTYPE}-x86-";;
     149                        TARGET="${BSDTYPE}-x86";;
    136150                *)
    137151                        case ${BSDTYPE} in
     
    154168
    155169make_static () {
     170        #
     171        # TODO
     172        # Fix formatting of output filename. Final versions will need to look
     173        # like libjbigi-linux-athlon64.so or libjbigi-linux-athlon64_64.so
    156174        $ECHO "Attempting .${4} creation for ${3}${5}${2}"
    157175        ../../build_jbigi.sh static || return 1
     
    218236                fi
    219237
    220                 build_file "$VER" "$x" "$NAME" "$TYPE" "$TARGET"
     238                build_file "$VER" "$x" "$NAME" "$TYPE" "-$TARGET-"
    221239        )
    222240done
  • core/c/jcpuid/build.sh

    rd94c149 rd0a3c72  
    3636        LIBFILE="lib/freenet/support/CPUInformation/libjcpuid-x86-darwin.jnilib";;
    3737    Linux*|OpenBSD*|NetBSD*|*FreeBSD*|SunOS*)
     38        KFREEBSD=0
    3839        UNIXTYPE="`uname -s | tr [A-Z] [a-z]`"
    3940        if [ ${UNIXTYPE} = "sunos" ]; then
    4041            UNIXTYPE="solaris"
    41         elif [ ${UNIXTYPE} = "kfreebsd" ]; then
     42        elif [ ${UNIXTYPE} = "gnu/kfreebsd" ]; then
    4243            UNIXTYPE="linux"
     44            KFREEBSD=1
    4345        fi
    4446        # If JAVA_HOME isn't set, try to figure it out on our own
     
    6365            *)
    6466                echo "Unsupported build environment. jcpuid is only used on x86 systems."
    65                 exit 1;;
     67                exit 0;;
    6668        esac
    6769
    6870        LINKFLAGS="-shared -Wl,-soname,libjcpuid-${ARCH}-${UNIXTYPE}.so"
    69         LIBFILE="lib/freenet/support/CPUInformation/libjcpuid-${ARCH}-${UNIXTYPE}.so"
     71        if [ $KFREEBSD -eq 1 ]; then
     72            LIBFILE="lib/freenet/support/CPUInformation/libjcpuid-${ARCH}-kfreebsd.so"
     73        else
     74            LIBFILE="lib/freenet/support/CPUInformation/libjcpuid-${ARCH}-${UNIXTYPE}.so"
     75        fi
    7076        COMPILEFLAGS="-fPIC -Wall"
    7177        INCLUDES="-I. -Iinclude -I${JAVA_HOME}/include -I${JAVA_HOME}/include/${UNIXTYPE}";;
Note: See TracChangeset for help on using the changeset viewer.