From af9b052fe91570844dad41bc0f6a0032d6284f81 Mon Sep 17 00:00:00 2001 From: Landon Curt Noll Date: Mon, 14 Aug 2023 15:27:22 -0700 Subject: [PATCH] fixed -dead_strip_dylibs for macOS, fixed macOS lib version numbers Added Makefile variable ${VER} to holdthe calc major release version. The calc major release version is a 3 level version (x.y.z). Under macOS, the current version of both libcalc and libcustcalc are set to the current calc major release version. Under macOS, to reduce dependency chains, we remove functions and data that are unreachable by the entry point or exported symbols. In particular, the linker is run with "-dead_strip" and with "-dead_strip_dylibs". --- CHANGES | 5 ++++- Makefile.config | 6 +++++- Makefile.target | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index ec3db01..8da3746 100644 --- a/CHANGES +++ b/CHANGES @@ -84,8 +84,11 @@ The following are the changes from calc version 2.14.3.1 to date: Dropped the use of Makefile variable ${SET_INSTALL_NAME}. Under macOS it was always needed, elsewhere it was not. + Added Makefile variable ${VER} to holdthe calc major release version. + The calc major release version is a 3 level version (x.y.z). + Under macOS, the current version of both libcalc and - libcustcalc are set to the current calc release version. + libcustcalc are set to the current calc major release version. Under macOS, to reduce dependency chains, we remove functions and data that are unreachable by the entry point or exported symbols. diff --git a/Makefile.config b/Makefile.config index c29396f..8e1d322 100644 --- a/Makefile.config +++ b/Makefile.config @@ -1301,10 +1301,14 @@ endif # ($(ALLOW_CUSTOM),-DCUSTOM) EXT= #EXT=.exe -# The default calc version +# The calc version in the form of x.y.z.w # VERSION= 2.14.3.1 +# The calc major version in the form of x.y.z +# +VER= 2.14.3 + # Names of shared libraries with versions # LIB_EXT= .so diff --git a/Makefile.target b/Makefile.target index 7b188e6..341df10 100644 --- a/Makefile.target +++ b/Makefile.target @@ -166,11 +166,11 @@ DEFAULT_LIB_INSTALL_PATH= ${PWD}:${LIBDIR}:${PREFIX}/lib LD_SHARE= ${ARCH_CFLAGS} LIBCALC_SHLIB= -dynamiclib -undefined dynamic_lookup \ -install_name ${LIBDIR}/libcalc${LIB_EXT_VERSION} \ - -current_version ${VERSION} \ + -current_version ${VER} \ ${ARCH_CFLAGS} LIBCUSTCALC_SHLIB= -dynamiclib -undefined dynamic_lookup \ -install_name ${LIBDIR}/libcustcalc${LIB_EXT_VERSION} \ - -current_version ${VERSION} \ + -current_version ${VER} \ ${ARCH_CFLAGS} # To reduce dependency chains under macOS, we remove functions and