Blob Blame Raw
diff -up swipl-7.6.0/packages/jpl/configure.orig swipl-7.6.0/packages/jpl/configure
--- swipl-7.6.0/packages/jpl/configure.orig	2017-10-20 09:41:38.924326293 +0200
+++ swipl-7.6.0/packages/jpl/configure	2017-10-20 09:47:22.792854064 +0200
@@ -4618,34 +4618,6 @@ $as_echo "#define PL_ARITY_AS_SIZE 1" >>
 CMDEXT=sh
 OSLIBPL=
 
-if test "x$JAVALIBS" = "x"; then
-  case "$PLARCH" in
-     *darwin*)
-	  JAVALIBS="-ljvm"
-	  { $as_echo "$as_me:${as_lineno-$LINENO}: checking \"JAVA_HOME\"..." >&5
-$as_echo "$as_me: checking \"JAVA_HOME\"..." >&6;}
-	  if test -z "$JAVA_HOME" -o ! -d "$JAVA_HOME"; then
-	    JAVA_HOME=$(/usr/libexec/java_home)
-	  fi
-	  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVA_HOME" >&5
-$as_echo "$JAVA_HOME" >&6; }
-	  JAVA_BINDIR="${JAVA_BINDIR:-$JAVA_HOME/bin}"
-	  PATH="$JAVA_BINDIR:$PATH"
-	  java_abs_paths=yes
-	  OSLIBPL=jpl_config.pl
-	  ;;
-     *powerpc-linux*)
-	  JAVALIBS="-ljava -ljvm"
-	  ;;
-     *win32*|*win64*)
-	  JAVALIBS="-ljvm"
-	  CMDEXT=bat
-	  ;;
-     *)
-	  JAVALIBS="-ljava -lverify -ljvm"
-	  ;;
-  esac
-fi
 
 case "$PLARCH" in
   *win32*)
@@ -5657,6 +5629,10 @@ darwin*)	_JNI_LIBDIRS="lib"
 		_JNI_LIBDIRS="lib/amd64"
 		_JNI_LIBSUBDIRS="server"
 		;;
+	alpha*)
+		_JNI_LIBDIRS="lib/alpha"
+		_JNI_LIBSUBDIRS="server"
+		;;
 	arm*)
 		_JNI_LIBDIRS="lib/arm"
 		_JNI_LIBSUBDIRS="server"
@@ -5670,14 +5646,16 @@ darwin*)	_JNI_LIBDIRS="lib"
 		_JNI_LIBSUBDIRS="server"
 		;;
 	powerpc)
-		case "$host_os" in
-		linux*)
-			_JNI_LIBDIRS="lib/ppc bin"
-			_JNI_LIBSUBDIRS="server classic"
-			;;
-		*)
-			_JNI_LIBDIRS=""
-		esac
+		 _JNI_LIBDIRS="lib/ppc"
+		 _JNI_LIBSUBDIRS="server"
+		;;
+	s390)
+		_jni_libdirs="lib/s390"
+		_jni_libsubdirs="server"
+		;;
+	s390x)
+		_jni_libdirs="lib/s390x"
+		_jni_libsubdirs="server"
 		;;
 	*)
 		# Fallback option should work on all architectures except
@@ -5688,6 +5666,29 @@ darwin*)	_JNI_LIBDIRS="lib"
 ;;
 esac
 
+# Set JAVALIBS differently if we're using GCJ
+if test "x$JAVALIBS" = "x"; then
+    if (echo $_JTOPDIR | grep gcj > /dev/null); then
+        JAVALIBS="-ljvm"
+    else
+        case "$PLARCH" in
+            *darwin*)
+            JAVALIBS="-Wl,-framework,JavaVM"
+            ;;
+            *powerpc-linux*)
+            JAVALIBS="-ljava -ljvm"
+            ;;
+            *win32*|*win64*)
+            JAVALIBS="-ljvm"
+            ;;
+            *)
+            JAVALIBS="-ljava -lverify -ljvm"
+            ;;
+        esac
+    fi
+fi
+
+
 if test -z "$JNI_CLIENT_DIRS"; then
   for d in $_JNI_LIBDIRS; do
 	for subd in $_JNI_LIBSUBDIRS; do