From 6d020b7fbec17f79f5a74b9ddb76ef039501b4e3 Mon Sep 17 00:00:00 2001 From: Landon Curt Noll Date: Wed, 2 Aug 2023 00:40:53 -0700 Subject: [PATCH] fix PowerPC detection under Darwin Test if the arch value (`uname -p`) is "powerpc". PowerPC based systems no longer try to use xcrun to determine where things like INCDIR (include files) are located. --- CHANGES | 6 +++--- Makefile | 19 ++++++++++++++++--- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index bd587df..2f359d8 100644 --- a/CHANGES +++ b/CHANGES @@ -27,15 +27,15 @@ The following are the changes from calc version 2.14.2.1 to date: ARCH_CFLAGS+= -arch ppc Old Apple Power PC systems should be detected by the - "uname -m" command returning "ppc". One may force the + "uname -p" command returning "powerpc". One may force the Power PC mode by adding to the end of any make command: - target=Darwin hardware=ppc + make ...make_args... target=Darwin arch=powerpc or by adding the following in the Makefile.local file: target= Darwin - hardware= ppc + arch= powerpc Improved the output of the calcinfo rule by adding echos of various uname values as well as some top Makefile variables. diff --git a/Makefile b/Makefile index 65614e2..bc2a269 100644 --- a/Makefile +++ b/Makefile @@ -841,8 +841,21 @@ HAVE_STRLCAT= # ifeq ($(target),Darwin) -# default INCDIR for macOS -INCDIR= $(shell xcrun --show-sdk-path --sdk macosx)/usr/include +# determine default INCDIR for macOS +# +ifeq ($(arch),powerpc) +# +# Default location for old systems such as Mac OS X 10.6 Snow Leopard +# +INCDIR= /usr/include +# +else +# +# Modern macOS such as macOS 10.11.6 and later +# +INCDIR= $(shell xcrun --sdk macosx --show-sdk-path 2>/dev/null)/usr/include +# +endif else # @@ -1641,7 +1654,7 @@ endif # # -std=gnu99 -arch ppc # -ifeq ($(hardware),ppc) +ifeq ($(arch),powerpc) COMMON_CFLAGS+= -std=gnu99 COMMON_LDFLAGS+= -std=gnu99 ARCH_CFLAGS+= -arch ppc