From b8745a2b3ade1868c748794db7e54e7840ea65fb Mon Sep 17 00:00:00 2001 From: Ryan Carsten Schmidt Date: Tue, 23 Apr 2024 20:24:13 -0500 Subject: [PATCH 1/4] Remove Java 64-bit macOS statement from README As of Mac OS X 10.6 (released 2009), compilers build 64-bit by default on 64-bit systems, and 10.6 is the last OS version that runs on 32-bit systems. Naturally, users need to install a Java that matches the architecture they want to build for, and as with any other software they should supply -arch flags in CFLAGS, CXXFLAGS, and LDFLAGS if they want to build for a non-default architecture. --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 980234c2a..3acf2e26a 100644 --- a/README.md +++ b/README.md @@ -596,9 +596,6 @@ configure with: ./configure --disable-java-bindings ``` -By default, java requires a 64-bit binary, and not all macOS systems -have a 64-bit devel environment installed. - If you do want Java bindings, be sure to set the JDK_HOME environment variable to wherever `` is. Set the JAVA_HOME variable to the location of the java compiler. Make sure you have ant From 7aa12d085c292f3d82d61b96a9701f47e5eb11ad Mon Sep 17 00:00:00 2001 From: Ryan Carsten Schmidt Date: Tue, 23 Apr 2024 20:28:27 -0500 Subject: [PATCH 2/4] Remove commented-out check for libstdc++ As long as a C++ compiler is used to link any program that is composed at least partly of object files produced by a C++ compiler, there is no need for the build system to check for or know which C++ standard library is being used. Not all systems use libstdc++ by default (some use libc++), and the user might choose a different one by specifying a -stdlib flag in CXXFLAGS. --- configure.ac | 5 ----- 1 file changed, 5 deletions(-) diff --git a/configure.ac b/configure.ac index 19bf9f742..0ae0bfb74 100644 --- a/configure.ac +++ b/configure.ac @@ -385,11 +385,6 @@ AC_ARG_ENABLE( sat-solver, fi], [enable_sat_solver=no]) AS_IF([test "x$enable_sat_solver" = xyes], [ - # The sat-solver code is in C++; so the link-grammar library should now - # directly require libstdc++ instead of indirectly depend on its - # availability via the minisat2 library. - #test x${apple_osx} = xyes || AC_CHECK_LIB(stdc++, main) - # We want to check for C++; the easiest way to do this is to # use c++ to compile stdio.h and bomb if it fails. AC_LANG([C++]) From a9d8bced536dfac7a6c2f74a48b0898fc3f821d8 Mon Sep 17 00:00:00 2001 From: Ryan Carsten Schmidt Date: Tue, 23 Apr 2024 20:36:59 -0500 Subject: [PATCH 3/4] Remove attempt to force x86_64 Java build on macOS This code never took effect because the apple_osx variable on which is was based was always "no". The claim that modern 64-bit Macs build 32-bit by default is false; compilers on macOS have built 64-bit by default on 64-bit systems ever since Mac OS X 10.6 was released (2009). There are also other 64-bit architectures than x86_64: current Macs use arm64 while Macs of decades past used ppc64. Mac OS X 10.6 was the last time Java was included with macOS; since then, users have been expected to install a Java distribution of their choosing -- and there are many to choose from, ever since Oracle made the license for their Java distribution less appealing. It's the user's responsibility to select a Java distribution that matches the architecture they want to build for, and to specify -arch flags in CFLAGS, CXXFLAGS, and LDFLAGS if that architecture is not their compiler's default. No assumptions about this should be made by build systems. --- configure.ac | 8 -------- 1 file changed, 8 deletions(-) diff --git a/configure.ac b/configure.ac index 0ae0bfb74..45e3aa68a 100644 --- a/configure.ac +++ b/configure.ac @@ -776,14 +776,6 @@ AC_SUBST(REGEX_CFLAGS) JNIfound=no if test "x$enable_java_bindings" = "xyes"; then - - if test x${apple_osx} = xyes; then - # Java on Apple OSX requires a 64-bit build. However, even - # modern 64-bit Apple machines build 32-bit binaries by default. - # So force a 64-bit build if a 64-bit CPU is found. - CFLAGS="-arch x86_64 ${CFLAGS}" - fi - absolute_srcdir=`(cd "$srcdir"; pwd)` JAVA_SRCDIR=$absolute_srcdir/bindings/java if test "$native_win32" = yes; then From 4201e58ccc63e49f439ccb84f40ecd03468a41ff Mon Sep 17 00:00:00 2001 From: Ryan Carsten Schmidt Date: Tue, 23 Apr 2024 20:41:18 -0500 Subject: [PATCH 4/4] Remove faulty check for 64-bit macOS This check doesn't work and isn't needed. On 64-bit macOS, configure output says: checking for 64-bit Apple OSX... no When it was first added in af4e52c, it checked whether "host" matched "x86_64-*-darwin*" which would have been true on x86_64 Macs (but there are other Macs with 64-bit processors: current Macs use arm64 processors and Macs of decades past used ppc64 processors). Then in 2f11fb0 it was changed to check whether "host_os" matched "darwin*" which would have been true on all Macs, both 64-bit and 32-bit. Finally in d9f59fd it was changed to check if "host_os" matches "x86_64-*darwin*" which will never be true. Nothing based on this check is needed so the check can be removed. --- configure.ac | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/configure.ac b/configure.ac index 45e3aa68a..28be544cd 100644 --- a/configure.ac +++ b/configure.ac @@ -174,18 +174,6 @@ esac AC_MSG_RESULT([$cygwin]) AM_CONDITIONAL(OS_CYGWIN, test "x$cygwin" = "xyes") -AC_MSG_CHECKING([for 64-bit Apple OSX]) -case "$host_os" in - x86_64-*darwin*) - apple_osx=yes - ;; - *) - apple_osx=no - ;; -esac -AC_MSG_RESULT([$apple_osx]) -AM_CONDITIONAL(OS_X, test "x$apple_osx" = "xyes") - AC_MSG_CHECKING([for NetBSD]) case "$host_os" in *netbsd*)