From 4fd0261efa225b0c82d8c3e1a72939107256b551 Mon Sep 17 00:00:00 2001 From: dev Date: Thu, 5 May 2016 22:03:27 +0000 Subject: [PATCH 1/2] jcpuid/build_jbigi: Default BITS to 64 if unset. To make sure that our debian build scripts work, set BITS to 64 if unassigned. --- core/c/jbigi/build_jbigi.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/c/jbigi/build_jbigi.sh b/core/c/jbigi/build_jbigi.sh index 49f891a0f..61b2fb82e 100755 --- a/core/c/jbigi/build_jbigi.sh +++ b/core/c/jbigi/build_jbigi.sh @@ -4,6 +4,11 @@ # When executed in OSX: Produces a libjbigi.jnilib [ -z "$CC" ] && CC="gcc" +if [ -z $BITS ]; then + BITS=64 + printf "\aBITS variable not set, defaulting to $BITS\n\a" >&2 +fi + # If JAVA_HOME isn't set we'll try to figure it out [ -z $JAVA_HOME ] && . `dirname $0`/../find-java-home if [ ! -f "$JAVA_HOME/include/jni.h" ]; then From c2f35c0d2948a99314e7ad17ebfebab7c06089b4 Mon Sep 17 00:00:00 2001 From: dev Date: Thu, 5 May 2016 22:32:20 +0000 Subject: [PATCH 2/2] core/buildscripts: Added proper uname based BITS detection. Added automatic detection for the BITS variable. --- core/c/jbigi/build_jbigi.sh | 12 +++++++++++- core/c/jbigi/mbuild-all.sh | 14 +++++++++++++- core/c/jcpuid/build.sh | 14 +++++++++++++- 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/core/c/jbigi/build_jbigi.sh b/core/c/jbigi/build_jbigi.sh index 61b2fb82e..f2c042ef0 100755 --- a/core/c/jbigi/build_jbigi.sh +++ b/core/c/jbigi/build_jbigi.sh @@ -5,7 +5,17 @@ [ -z "$CC" ] && CC="gcc" if [ -z $BITS ]; then - BITS=64 + if [[ $(uname -a) =~ "x86_64" ]]; then + BITS=64 + elif [[ $(uname -a) =~ "i386" ]]; then + BITS=32 + elif [[ $(uname -a) =~ "i686" ]]; then + BITS=32 + else + echo "Unable to detect default setting for BITS variable" + exit + fi + printf "\aBITS variable not set, defaulting to $BITS\n\a" >&2 fi diff --git a/core/c/jbigi/mbuild-all.sh b/core/c/jbigi/mbuild-all.sh index e74f29c00..5099b578d 100755 --- a/core/c/jbigi/mbuild-all.sh +++ b/core/c/jbigi/mbuild-all.sh @@ -86,10 +86,22 @@ fi if [ -z $BITS ]; then - BITS=32 + UNAME="$(uname -a)" + if test "${UNAME#*x86_64}" != "x86_&4"; then + BITS=64 + elif test "${UNAME#*i386}" != "i386"; then + BITS=32 + elif test "${UNAME#*i686}" != "i686"; then + BITS=32 + else + echo "Unable to detect default setting for BITS variable" + exit + fi + printf "\aBITS variable not set, defaulting to $BITS\n\a" >&2 fi + if [ -z $CC ]; then export CC="gcc" printf "\aCC variable not set, defaulting to $CC\n\a" >&2 diff --git a/core/c/jcpuid/build.sh b/core/c/jcpuid/build.sh index cb9a7e500..63dacb55e 100755 --- a/core/c/jcpuid/build.sh +++ b/core/c/jcpuid/build.sh @@ -24,10 +24,22 @@ esac if [ -z $BITS ]; then - BITS=64 + UNAME="$(uname -a)" + if test "${UNAME#*x86_64}" != "x86_&4"; then + BITS=64 + elif test "${UNAME#*i386}" != "i386"; then + BITS=32 + elif test "${UNAME#*i686}" != "i686"; then + BITS=32 + else + echo "Unable to detect default setting for BITS variable" + exit + fi + printf "\aBITS variable not set, defaulting to $BITS\n\a" >&2 fi + if [ -z $CC ]; then export CC="gcc" printf "\aCC variable not set, defaulting to $CC\n\a" >&2