mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
improve how Apple Power PC systems compile, improve make calcinfo
This commit is contained in:
24
CHANGES
24
CHANGES
@@ -16,6 +16,30 @@ The following are the changes from calc version 2.14.2.1 to date:
|
|||||||
Updated COPYING to include the actual text of "The Unlicense".
|
Updated COPYING to include the actual text of "The Unlicense".
|
||||||
Made minor formatting changes to the file.
|
Made minor formatting changes to the file.
|
||||||
|
|
||||||
|
The Darwin specific ${DARWIN_ARCH}, thay by default was unset,
|
||||||
|
is now the ${ARCH_CFLAGS} Makefile variable. Comments about
|
||||||
|
various "-arch name" have been moved to the ${ARCH_CFLAGS} area.
|
||||||
|
|
||||||
|
For old Apple Power PC systems, the following is added:
|
||||||
|
|
||||||
|
COMMON_CFLAGS+= -std=gnu99
|
||||||
|
COMMON_LDFLAGS+= -std=gnu99
|
||||||
|
ARCH_CFLAGS+= -arch ppc
|
||||||
|
|
||||||
|
Old Apple Power PC systems should be detected by the
|
||||||
|
"uname -m" command returning "ppc". One may force the
|
||||||
|
Power PC mode by adding to the end of any make command:
|
||||||
|
|
||||||
|
target=Darwin hardware=ppc
|
||||||
|
|
||||||
|
or by adding the following in the Makefile.local file:
|
||||||
|
|
||||||
|
target= Darwin
|
||||||
|
hardware= ppc
|
||||||
|
|
||||||
|
Improved the output of the calcinfo rule by adding echos
|
||||||
|
of various uname values as well as some top Makefile variables.
|
||||||
|
|
||||||
|
|
||||||
The following are the changes from calc version 2.14.2.0 to 2.14.2.0:
|
The following are the changes from calc version 2.14.2.0 to 2.14.2.0:
|
||||||
|
|
||||||
|
63
Makefile
63
Makefile
@@ -1458,8 +1458,15 @@ EXTRA_LDFLAGS=
|
|||||||
# The ARCH_CFLAGS are ${CC} when compiling C files. They follow
|
# The ARCH_CFLAGS are ${CC} when compiling C files. They follow
|
||||||
# CCMISC and precede EXTRA_CFLAGS.
|
# CCMISC and precede EXTRA_CFLAGS.
|
||||||
#
|
#
|
||||||
|
# When ARCH_CFLAGS is empty, the native binary architecture is assumed.
|
||||||
|
#
|
||||||
ARCH_CFLAGS=
|
ARCH_CFLAGS=
|
||||||
#ARCH_CFLAGS= -march=native
|
# ARCH_CFLAGS= -arch i386 # old Intel binary
|
||||||
|
# ARCH_CFLAGS= -arch ppc # Power PC binary
|
||||||
|
# ARCH_CFLAGS= -arch x86_64 # Intel 64-bit binary
|
||||||
|
# ARCH_CFLAGS= -arch arm64 # Apple Silicon binary
|
||||||
|
# ARCH_CFLAGS= -arch arm64 -arch x86_64 # Apple Silicon and Intel 64-bit binary
|
||||||
|
# ARCH_CFLAGS= -arch i386 -arch ppc # old Intel and Power PC binary
|
||||||
|
|
||||||
# COMMON_CFLAGS are the common ${CC} flags used for all programs, both
|
# COMMON_CFLAGS are the common ${CC} flags used for all programs, both
|
||||||
# intermediate and final calc and calc related programs
|
# intermediate and final calc and calc related programs
|
||||||
@@ -1630,39 +1637,48 @@ endif
|
|||||||
# Apple macOS / Darwin target #
|
# Apple macOS / Darwin target #
|
||||||
###############################
|
###############################
|
||||||
|
|
||||||
|
# For old Apple Power PC systems, we need to add:
|
||||||
|
#
|
||||||
|
# -std=gnu99 -arch ppc
|
||||||
|
#
|
||||||
|
ifeq ($(hardware),ppc)
|
||||||
|
COMMON_CFLAGS+= -std=gnu99
|
||||||
|
COMMON_LDFLAGS+= -std=gnu99
|
||||||
|
ARCH_CFLAGS+= -arch ppc
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(target),Darwin)
|
ifeq ($(target),Darwin)
|
||||||
#
|
#
|
||||||
BLD_TYPE= calc-dynamic-only
|
BLD_TYPE= calc-dynamic-only
|
||||||
#
|
#
|
||||||
CC_SHARE= -fPIC
|
CC_SHARE= -fPIC
|
||||||
DEFAULT_LIB_INSTALL_PATH= ${PWD}:${LIBDIR}:${PREFIX}/lib
|
DEFAULT_LIB_INSTALL_PATH= ${PWD}:${LIBDIR}:${PREFIX}/lib
|
||||||
LD_SHARE= ${DARWIN_ARCH}
|
LD_SHARE= ${ARCH_CFLAGS}
|
||||||
#SET_INSTALL_NAME= no
|
#SET_INSTALL_NAME= no
|
||||||
SET_INSTALL_NAME= yes
|
SET_INSTALL_NAME= yes
|
||||||
ifeq ($(SET_INSTALL_NAME),yes)
|
ifeq ($(SET_INSTALL_NAME),yes)
|
||||||
LIBCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib \
|
LIBCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib \
|
||||||
-install_name ${LIBDIR}/libcalc${LIB_EXT_VERSION} ${DARWIN_ARCH}
|
-install_name ${LIBDIR}/libcalc${LIB_EXT_VERSION} ${ARCH_CFLAGS}
|
||||||
else
|
else
|
||||||
LIBCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib \
|
LIBCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib \
|
||||||
${DARWIN_ARCH}
|
${ARCH_CFLAGS}
|
||||||
endif
|
endif
|
||||||
ifdef ALLOW_CUSTOM
|
ifdef ALLOW_CUSTOM
|
||||||
ifeq ($(SET_INSTALL_NAME),yes)
|
ifeq ($(SET_INSTALL_NAME),yes)
|
||||||
LIBCUSTCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib \
|
LIBCUSTCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib \
|
||||||
-install_name ${LIBDIR}/libcustcalc${LIB_EXT_VERSION} ${DARWIN_ARCH}
|
-install_name ${LIBDIR}/libcustcalc${LIB_EXT_VERSION} ${ARCH_CFLAGS}
|
||||||
else
|
else
|
||||||
LIBCUSTCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib \
|
LIBCUSTCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib \
|
||||||
${DARWIN_ARCH}
|
${ARCH_CFLAGS}
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
LIBCUSTCALC_SHLIB=
|
LIBCUSTCALC_SHLIB=
|
||||||
endif
|
endif
|
||||||
#
|
#
|
||||||
CC_STATIC=
|
CC_STATIC=
|
||||||
LD_STATIC= ${DARWIN_ARCH}
|
LD_STATIC= ${ARCH_CFLAGS}
|
||||||
LIBCALC_STATIC=
|
LIBCALC_STATIC=
|
||||||
LIBCUSTCALC_STATIC=
|
LIBCUSTCALC_STATIC=
|
||||||
#
|
|
||||||
# If you want to add flags to all compiler and linker
|
# If you want to add flags to all compiler and linker
|
||||||
# run (via ${COMMON_CFLAGS} and ${COMMON_LDFLAGS}),
|
# run (via ${COMMON_CFLAGS} and ${COMMON_LDFLAGS}),
|
||||||
# set ${COMMON_ADD}.
|
# set ${COMMON_ADD}.
|
||||||
@@ -1686,7 +1702,7 @@ WNO_ERROR_LONG_LONG= -Wno-error=long-long
|
|||||||
WNO_LONG_LONG= -Wno-long-long
|
WNO_LONG_LONG= -Wno-long-long
|
||||||
CCWERR=
|
CCWERR=
|
||||||
CCOPT= ${DEBUG}
|
CCOPT= ${DEBUG}
|
||||||
CCMISC= ${DARWIN_ARCH}
|
CCMISC= ${ARCH_CFLAGS}
|
||||||
#
|
#
|
||||||
LCC= cc
|
LCC= cc
|
||||||
CC= ${PURIFY} ${LCC} ${CCWERR}
|
CC= ${PURIFY} ${LCC} ${CCWERR}
|
||||||
@@ -1696,11 +1712,6 @@ LIB_EXT:= .dylib
|
|||||||
LIB_EXT_VERSION:= .${VERSION}${LIB_EXT}
|
LIB_EXT_VERSION:= .${VERSION}${LIB_EXT}
|
||||||
# LDCONFIG not required on this platform, so we redefine it to an empty string
|
# LDCONFIG not required on this platform, so we redefine it to an empty string
|
||||||
LDCONFIG:=
|
LDCONFIG:=
|
||||||
# DARWIN_ARCH= -arch i386 -arch ppc # Universal binary
|
|
||||||
# DARWIN_ARCH= -arch i386 # Intel binary
|
|
||||||
# DARWIN_ARCH= -arch ppc # PPC binary
|
|
||||||
# DARWIN_ARCH= -arch x86_64 # native 64-bit binary
|
|
||||||
DARWIN_ARCH= # native binary
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
##################
|
##################
|
||||||
@@ -4946,6 +4957,30 @@ calcinfo:
|
|||||||
-@${UNAME} -a
|
-@${UNAME} -a
|
||||||
@echo '=-=-= end of output of $${UNAME} -a =-=-='
|
@echo '=-=-= end of output of $${UNAME} -a =-=-='
|
||||||
@echo
|
@echo
|
||||||
|
@echo '=-=-= output of $${UNAME} -s follows =-=-='
|
||||||
|
-@${UNAME} -s
|
||||||
|
@echo '=-=-= end of output of $${UNAME} -s =-=-='
|
||||||
|
@echo
|
||||||
|
@echo '=-=-= output of $${UNAME} -p follows =-=-='
|
||||||
|
-@${UNAME} -p
|
||||||
|
@echo '=-=-= end of output of $${UNAME} -p =-=-='
|
||||||
|
@echo
|
||||||
|
@echo '=-=-= output of $${UNAME} -m follows =-=-='
|
||||||
|
-@${UNAME} -m
|
||||||
|
@echo '=-=-= end of output of $${UNAME} -m =-=-='
|
||||||
|
@echo
|
||||||
|
@echo '=-=-= output of $${UNAME} -o follows =-=-='
|
||||||
|
-@${UNAME} -o
|
||||||
|
@echo '=-=-= end of output of $${UNAME} -o =-=-='
|
||||||
|
@echo
|
||||||
|
@echo '=-=-= output of top makefile variables follows =-=-='
|
||||||
|
@echo "target= ${target}"
|
||||||
|
@echo "arch= ${arch}"
|
||||||
|
@echo "hardware= ${hardware}"
|
||||||
|
@echo "OSNAME= ${OSNAME}"
|
||||||
|
@echo "SHELL= ${SHELL}"
|
||||||
|
@echo '=-=-= end of output top makefile variables =-=-='
|
||||||
|
@echo
|
||||||
@echo '=-=-= HOSTNAME=${HOSTNAME} =-=-='
|
@echo '=-=-= HOSTNAME=${HOSTNAME} =-=-='
|
||||||
@echo
|
@echo
|
||||||
@echo '=-=-= output of $${HOSTNAME} follows =-=-='
|
@echo '=-=-= output of $${HOSTNAME} follows =-=-='
|
||||||
|
@@ -1316,8 +1316,15 @@ EXTRA_LDFLAGS=
|
|||||||
# The ARCH_CFLAGS are ${CC} when compiling C files. They follow
|
# The ARCH_CFLAGS are ${CC} when compiling C files. They follow
|
||||||
# CCMISC and precede EXTRA_CFLAGS.
|
# CCMISC and precede EXTRA_CFLAGS.
|
||||||
#
|
#
|
||||||
|
# When ARCH_CFLAGS is empty, the native binary architecture is assumed.
|
||||||
|
#
|
||||||
ARCH_CFLAGS=
|
ARCH_CFLAGS=
|
||||||
#ARCH_CFLAGS= -march=native
|
# ARCH_CFLAGS= -arch i386 # old Intel binary
|
||||||
|
# ARCH_CFLAGS= -arch ppc # Power PC binary
|
||||||
|
# ARCH_CFLAGS= -arch x86_64 # Intel 64-bit binary
|
||||||
|
# ARCH_CFLAGS= -arch arm64 # Apple Silicon binary
|
||||||
|
# ARCH_CFLAGS= -arch arm64 -arch x86_64 # Apple Silicon and Intel 64-bit binary
|
||||||
|
# ARCH_CFLAGS= -arch i386 -arch ppc # old Intel and Power PC binary
|
||||||
|
|
||||||
# COMMON_CFLAGS are the common ${CC} flags used for all programs, both
|
# COMMON_CFLAGS are the common ${CC} flags used for all programs, both
|
||||||
# intermediate and final calc and calc related programs
|
# intermediate and final calc and calc related programs
|
||||||
@@ -4250,6 +4257,30 @@ calcinfo:
|
|||||||
-@${UNAME} -a
|
-@${UNAME} -a
|
||||||
@echo '=-=-= end of output of $${UNAME} -a =-=-='
|
@echo '=-=-= end of output of $${UNAME} -a =-=-='
|
||||||
@echo
|
@echo
|
||||||
|
@echo '=-=-= output of $${UNAME} -s follows =-=-='
|
||||||
|
-@${UNAME} -s
|
||||||
|
@echo '=-=-= end of output of $${UNAME} -s =-=-='
|
||||||
|
@echo
|
||||||
|
@echo '=-=-= output of $${UNAME} -p follows =-=-='
|
||||||
|
-@${UNAME} -p
|
||||||
|
@echo '=-=-= end of output of $${UNAME} -p =-=-='
|
||||||
|
@echo
|
||||||
|
@echo '=-=-= output of $${UNAME} -m follows =-=-='
|
||||||
|
-@${UNAME} -m
|
||||||
|
@echo '=-=-= end of output of $${UNAME} -m =-=-='
|
||||||
|
@echo
|
||||||
|
@echo '=-=-= output of $${UNAME} -o follows =-=-='
|
||||||
|
-@${UNAME} -o
|
||||||
|
@echo '=-=-= end of output of $${UNAME} -o =-=-='
|
||||||
|
@echo
|
||||||
|
@echo '=-=-= output of top makefile variables follows =-=-='
|
||||||
|
@echo "target= ${target}"
|
||||||
|
@echo "arch= ${arch}"
|
||||||
|
@echo "hardware= ${hardware}"
|
||||||
|
@echo "OSNAME= ${OSNAME}"
|
||||||
|
@echo "SHELL= ${SHELL}"
|
||||||
|
@echo '=-=-= end of output top makefile variables =-=-='
|
||||||
|
@echo
|
||||||
@echo '=-=-= HOSTNAME=${HOSTNAME} =-=-='
|
@echo '=-=-= HOSTNAME=${HOSTNAME} =-=-='
|
||||||
@echo
|
@echo
|
||||||
@echo '=-=-= output of $${HOSTNAME} follows =-=-='
|
@echo '=-=-= output of $${HOSTNAME} follows =-=-='
|
||||||
|
Reference in New Issue
Block a user