From b7dd7a659a0ec79bc87de30dec35831769cefb26 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Fri, 17 Nov 2006 12:41:24 +0000 Subject: [PATCH] Fixup for building 64bit on a 32/64 system git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/sqlclient/trunk@24123 72102866-910b-0410-8b05-ffd578937521 --- configure | 17 ++++++++++++----- configure.ac | 17 ++++++++++++----- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/configure b/configure index 92410a9..5c73073 100755 --- a/configure +++ b/configure @@ -1771,10 +1771,6 @@ else { echo "$as_me:$LINENO: result: no: build if possible" >&5 echo "${ECHO_T}no: build if possible" >&6; } -# FIXME - check for -ljvm: on my machine I have a jni.h (from GCC), -# but no -ljvm, so this config code erroneously decides to compile the -# JDBC bundle, and that fails. :-( - # Get likely subdirectory for system specific java include case "$GNUSTEP_HOST_OS" in bsdi*) _JNI_SUBDIR="bsdos";; @@ -3659,7 +3655,18 @@ done if test "$ac_cv_header_jni_h" = "yes"; then JDBC_VM_LIBS="-ljvm" jre_lib="$JAVA_HOME/jre/lib" - case "$GNUSTEP_HOST_CPU" in + # If on a 32/64bit system and compiling for the 64bit model + # adjust the cpu type to be the 64bit version + case "$CFLAGS" in + *-m64*) + if test "$GNUSTEP_HOST_CPU" = "ix86"; then + _CPU="x86_64" + else + _CPU="$GNUSTEP_HOST_CPU" + fi;; + *) _CPU="$GNUSTEP_HOST_CPU";; + esac + case "$_CPU" in ix86) JAVA_CPU=i386;; x86_64) JAVA_CPU=amd64;; sparc) JAVA_CPU=sparc;; diff --git a/configure.ac b/configure.ac index f027782..0d89a2b 100644 --- a/configure.ac +++ b/configure.ac @@ -55,10 +55,6 @@ if test "$ac_cv_jdbc_bundle" = "no"; then else AC_MSG_RESULT([no: build if possible]) -# FIXME - check for -ljvm: on my machine I have a jni.h (from GCC), -# but no -ljvm, so this config code erroneously decides to compile the -# JDBC bundle, and that fails. :-( - # Get likely subdirectory for system specific java include case "$GNUSTEP_HOST_OS" in bsdi*) _JNI_SUBDIR="bsdos";; @@ -77,7 +73,18 @@ AC_CHECK_HEADERS(jni.h) if test "$ac_cv_header_jni_h" = "yes"; then JDBC_VM_LIBS="-ljvm" jre_lib="$JAVA_HOME/jre/lib" - case "$GNUSTEP_HOST_CPU" in + # If on a 32/64bit system and compiling for the 64bit model + # adjust the cpu type to be the 64bit version + case "$CFLAGS" in + *-m64*) + if test "$GNUSTEP_HOST_CPU" = "ix86"; then + _CPU="x86_64" + else + _CPU="$GNUSTEP_HOST_CPU" + fi;; + *) _CPU="$GNUSTEP_HOST_CPU";; + esac + case "$_CPU" in ix86) JAVA_CPU=i386;; x86_64) JAVA_CPU=amd64;; sparc) JAVA_CPU=sparc;;