Changeset d0a3c72


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.
Files:
13 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}";;
  • core/java/src/freenet/support/CPUInformation/CPUID.java

    rd94c149 rd0a3c72  
    5656    private static final String libSuffix = isWindows ? ".dll" : ".so";
    5757    private static final boolean isLinux = System.getProperty("os.name").toLowerCase(Locale.US).contains("linux");
    58     private static final boolean isFreebsd = System.getProperty("os.name").toLowerCase(Locale.US).contains("freebsd");
     58    private static final boolean isKFreebsd = System.getProperty("os.name").toLowerCase(Locale.US).contains("kfreebsd");
     59    private static final boolean isFreebsd = (!isKFreebsd) && System.getProperty("os.name").toLowerCase(Locale.US).contains("freebsd");
    5960    private static final boolean isNetbsd = System.getProperty("os.name").toLowerCase(Locale.US).contains("netbsd");
    6061    private static final boolean isOpenbsd = System.getProperty("os.name").toLowerCase(Locale.US).contains("openbsd");
     
    448449            }
    449450        }
     451        if(isKFreebsd)
     452            return "jcpuid-x86-kfreebsd"; // The convention on kfreebsd...
    450453        if(isFreebsd)
    451454            return "jcpuid-x86-freebsd"; // The convention on freebsd...
     
    465468        if(isWindows)
    466469             return "jcpuid-x86_64-windows";
     470        if(isKFreebsd)
     471            return "jcpuid-x86_64-kfreebsd";
    467472        if(isFreebsd)
    468473            return "jcpuid-x86_64-freebsd";
  • core/java/src/net/i2p/util/NativeBigInteger.java

    rd94c149 rd0a3c72  
    163163    private static final boolean _isMac = SystemVersion.isMac();
    164164    private static final boolean _isLinux = System.getProperty("os.name").toLowerCase(Locale.US).contains("linux");
    165     private static final boolean _isFreebsd = System.getProperty("os.name").toLowerCase(Locale.US).contains("freebsd");
     165    private static final boolean _isKFreebsd = System.getProperty("os.name").toLowerCase(Locale.US).contains("kfreebsd");
     166    private static final boolean _isFreebsd = (!_isKFreebsd) && System.getProperty("os.name").toLowerCase(Locale.US).contains("freebsd");
    166167    private static final boolean _isNetbsd = System.getProperty("os.name").toLowerCase(Locale.US).contains("netbsd");
    167168    private static final boolean _isOpenbsd = System.getProperty("os.name").toLowerCase(Locale.US).contains("openbsd");
     
    774775        if(_isWin)
    775776             return "jbigi-windows-";
     777        if(_isKFreebsd)
     778            return "jbigi-kfreebsd-";
    776779        if(_isFreebsd)
    777780            return "jbigi-freebsd-";
  • debian/patches/0001-path-substitution.patch

    rd94c149 rd0a3c72  
    108108 then
    109109     COMMAND="$FIXED_COMMAND"
    110 @@ -905,9 +856,6 @@
     110@@ -908,9 +859,6 @@
    111111         # The string passed to eval must handles spaces in paths correctly.
    112112         COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.java.command=\"$JAVABINARY\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" $ANCHORPROP $STATUSPROP $COMMANDPROP $LOCKPROP $LOGPROP $ADDITIONAL_PARA"
     
    118118         eval echo `gettext '$APP_LONG_NAME is already running.'`
    119119         exit 1
    120 @@ -1031,9 +979,6 @@
     120@@ -1034,9 +982,6 @@
    121121         # The string passed to eval must handles spaces in paths correctly.
    122122         COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.java.command=\"$JAVABINARY\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $STATUSPROP $COMMANDPROP $LOCKPROP $LOGPROP $ADDITIONAL_PARA"
     
    128128         eval echo `gettext '$APP_LONG_NAME is already running.'`
    129129         exit 1
    130 @@ -1874,18 +1819,9 @@
     130@@ -1877,18 +1822,9 @@
    131131             status
    132132             ;;
  • debian/patches/0002-jbigi-soname.patch

    rd94c149 rd0a3c72  
    1313--- a/core/c/jbigi/build_jbigi.sh
    1414+++ b/core/c/jbigi/build_jbigi.sh
    15 @@ -37,7 +37,7 @@
    16              UNIXTYPE="solaris"
     15@@ -39,7 +39,7 @@
     16             UNIXTYPE="linux"
    1717         fi
    1818         COMPILEFLAGS="-fPIC -Wall"
     
    2222         LIBFILE="libjbigi.so";;
    2323 *)
    24 @@ -56,7 +56,7 @@
     24@@ -58,7 +58,7 @@
    2525 
    2626 echo "Compiling C code..."
  • debian/patches/0003-renaming-jcpuid.patch

    rd94c149 rd0a3c72  
    99--- a/core/c/jcpuid/build.sh
    1010+++ b/core/c/jcpuid/build.sh
    11 @@ -65,8 +65,8 @@
    12                  exit 1;;
     11@@ -67,12 +67,8 @@
     12                 exit 0;;
    1313         esac
    1414 
    1515-        LINKFLAGS="-shared -Wl,-soname,libjcpuid-${ARCH}-${UNIXTYPE}.so"
    16 -        LIBFILE="lib/freenet/support/CPUInformation/libjcpuid-${ARCH}-${UNIXTYPE}.so"
     16-        if [ $KFREEBSD -eq 1 ]; then
     17-            LIBFILE="lib/freenet/support/CPUInformation/libjcpuid-${ARCH}-kfreebsd.so"
     18-        else
     19-            LIBFILE="lib/freenet/support/CPUInformation/libjcpuid-${ARCH}-${UNIXTYPE}.so"
     20-        fi
    1721+        LINKFLAGS="-shared -Wl,-soname,libjcpuid.so"
    1822+        LIBFILE="../jbigi/libjcpuid.so"
  • history.txt

    rd94c149 rd0a3c72  
     12012-11-19 kytv
     2 * Add support for kFreeBSD to NBI and CPUID
     3 * Improve kFreeBSD support in jcupid/jbigi scripts
     4
    152012-11-19 zzz
    26 * BuildHandler: Disable CoDel, wasn't helping
  • installer/resources/i2prouter

    rd94c149 rd0a3c72  
    357357    'unix_sv')
    358358        DIST_OS="unixware"
     359        ;;
     360    'gnu/kfreebsd')
     361        DIST_OS="kfreebsd"
    359362        ;;
    360363    'os/390')
  • installer/resources/osid

    rd94c149 rd0a3c72  
    3535DARWIN=`echo "$HOST_OS" | grep Darwin`
    3636MAC=`echo "$HOST_OS" | grep Mac`
     37KFREEBSD=`echo "$HOST_OS" | grep kFreeBSD`
    3738FREEBSD=`echo "$HOST_OS" | grep FreeBSD`
    3839LINUX=`echo "$HOST_OS" | grep Linux`
     
    4445if [ ! "X$DARWIN" = "X" -o ! "X$MAC" = "X" ]; then
    4546    echo osx
    46     exit 0
    47 fi
    48 
    49 if [ ! "X$FREEBSD" = "X" ]; then
     47elif [ ! "X$KFREEBSD" = "X" ]; then
     48    echo kfreebsd
     49elif [ ! "X$FREEBSD" = "X" ]; then
    5050    echo freebsd
    51     exit 0
    52 fi
    53 
    54 if [ ! "X$NETBSD" = "X" ]; then
     51elif [ ! "X$NETBSD" = "X" ]; then
    5552    echo netbsd
    56     exit 0
    57 fi
    58 
    59 if [ ! "X$OPENBSD" = "X" ]; then
     53elif [ ! "X$OPENBSD" = "X" ]; then
    6054    echo openbsd
    61     exit 0
    62 fi
    63 
    64 if [ ! "X$LINUX" = "X" ]; then
     55elif [ ! "X$LINUX" = "X" ]; then
    6556
    6657    LINUX_DISTRO=`cat /proc/version`
     
    7465    if [ ! "X$DEBIAN" = "X" ]; then
    7566        echo debian
    76         exit 0
     67    elif [ ! "X$FEDORA" = "X" ]; then
     68        echo fedora
     69    elif [ ! "X$GENTOO" = "X" ]; then
     70        echo gentoo
     71    elif [ ! "X$MANDRAKE" = "X" ]; then
     72        echo mandrake
     73    elif [ ! "X$REDHAT" = "X" ]; then
     74        echo redhat
     75    elif [ ! "X$SUSE" = "X" ]; then
     76        echo suse
     77    else
     78        echo linux
    7779    fi
    78 
    79     if [ ! "X$FEDORA" = "X" ]; then
    80         echo fedora
    81         exit 0
    82     fi
    83 
    84     if [ ! "X$GENTOO" = "X" ]; then
    85         echo gentoo
    86         exit 0
    87     fi
    88 
    89     if [ ! "X$MANDRAKE" = "X" ]; then
    90         echo mandrake
    91         exit 0
    92     fi
    93 
    94     if [ ! "X$REDHAT" = "X" ]; then
    95         echo redhat
    96         exit 0
    97     fi
    98 
    99     if [ ! "X$SUSE" = "X" ]; then
    100         echo suse
    101         exit 0
    102     fi
    103 
    104     echo linux
    105     exit 0
     80elif [ ! "X$SOLARIS" = "X" -o ! "X$SUNOS" = "X" ]; then
     81    echo solaris
     82else
     83    echo unknown
    10684fi
    107 
    108 if [ ! "X$SOLARIS" = "X" -o ! "X$SUNOS" = "X" ]; then
    109     echo solaris
    110     exit 0
    111 fi
    112 
    113 echo unknown
    114 exit 0
    115 
  • installer/resources/postinstall.sh

    rd94c149 rd0a3c72  
    8282        cp ${wrapperpath}/libwrapper.so ./lib/
    8383        ;;
    84     netbsd|openbsd )
     84    netbsd|openbsd|kfreebsd)
    8585        # FIXME
    8686        # This isn't displayed when installing, but if we fall back to the "*)"
Note: See TracChangeset for help on using the changeset viewer.