summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sci-mathematics')
-rw-r--r--sci-mathematics/calc/Manifest1
-rw-r--r--sci-mathematics/calc/calc-2.13.0.1.ebuild62
-rw-r--r--sci-mathematics/calc/files/calc-2.12.5.4-as-needed.patch4
-rw-r--r--sci-mathematics/calc/files/calc-2.13.0.1-RPATH.patch199
-rw-r--r--sci-mathematics/calc/files/calc-2.13.0.1-respect-LDFLAGS.patch267
5 files changed, 531 insertions, 2 deletions
diff --git a/sci-mathematics/calc/Manifest b/sci-mathematics/calc/Manifest
index 79765f5f29ec..dce8694b801d 100644
--- a/sci-mathematics/calc/Manifest
+++ b/sci-mathematics/calc/Manifest
@@ -1 +1,2 @@
DIST calc-2.12.5.4.tar.bz2 956258 BLAKE2B 47c2ab46c47baf0d1f1d202a36e0d42cf0b25f7eecf61815814081b2f76aa65dc8cc4e970078a5176266ce1332751169424d1c6d2c16ff148a1b014986b56d47 SHA512 07c89059d4718b29e649a5198e0bb6c6a6d9c6705a0050ad744146f1649c65d0fb1277a68eb45daca907b08ef9336de2002808a5f9b2312e413eb3afb74d491f
+DIST calc-2.13.0.1.tar.bz2 987542 BLAKE2B bbd93aa296211dde8f7d00a86e222bf4ccc0065da021c1666c333610c6837a1984995c74995571af025e68ec64519ed2d158731448037ee0a4f2eafccfc1a625 SHA512 7d7e07072779c97aaeb966f9282a6e4127c839ecadd0b7269d37d587949c47075d301c3420735f903ba179ae2bbbd309fd29e459fbf12b450e528aadc66537c4
diff --git a/sci-mathematics/calc/calc-2.13.0.1.ebuild b/sci-mathematics/calc/calc-2.13.0.1.ebuild
new file mode 100644
index 000000000000..955dc93fbea4
--- /dev/null
+++ b/sci-mathematics/calc/calc-2.13.0.1.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs
+
+DESCRIPTION="Arbitrary precision C-like arithmetic system"
+HOMEPAGE="http://www.isthe.com/chongo/tech/comp/calc/"
+SRC_URI="http://www.isthe.com/chongo/src/calc/${P}.tar.bz2"
+
+SLOT="0"
+LICENSE="LGPL-2"
+KEYWORDS="~alpha amd64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
+
+RDEPEND="
+ sys-libs/ncurses:0=
+ sys-libs/readline:0="
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.13.0.1-RPATH.patch
+ "${FILESDIR}"/${PN}-2.13.0.1-respect-LDFLAGS.patch
+)
+
+src_prepare() {
+ default
+
+ ln -sf libcustcalc.so.${PV} custom/libcustcalc.so || die
+ sed -i -e "/DIR/s:/usr:${EPREFIX}/usr:g" Makefile || die
+}
+
+src_compile() {
+ # parallel compilation hard to fix. better to leave upstream.
+ emake -j1 \
+ CC="$(tc-getCC)" \
+ DEBUG="${CFLAGS}" \
+ LDFLAGS="${LDFLAGS}" \
+ EXTRA_LDFLAGS="${LDFLAGS}" \
+ CALCPAGER="${PAGER}" \
+ USE_READLINE="-DUSE_READLINE" \
+ READLINE_LIB="-lreadline -lhistory $($(tc-getPKG_CONFIG) --libs ncurses) -L\"${S}\"/custom -lcustcalc" \
+ all
+}
+
+src_test() {
+ if echo "${LD_PRELOAD}" | grep -q "sandbox"; then
+ ewarn "Can't run check when running in sandbox - see bug #59676"
+ else
+ emake chk
+ fi
+}
+
+src_install() {
+ emake \
+ T="${D}" \
+ LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
+ install
+
+ dodoc BUGS CHANGES LIBRARY
+}
diff --git a/sci-mathematics/calc/files/calc-2.12.5.4-as-needed.patch b/sci-mathematics/calc/files/calc-2.12.5.4-as-needed.patch
index 3e7e03002ac3..3dbb2cd1bf47 100644
--- a/sci-mathematics/calc/files/calc-2.12.5.4-as-needed.patch
+++ b/sci-mathematics/calc/files/calc-2.12.5.4-as-needed.patch
@@ -1,5 +1,5 @@
---- calc-2.12.5.3/Makefile
-+++ calc-2.12.5.3/Makefile
+--- a/Makefile
++++ b/Makefile
@@ -1136,14 +1136,14 @@
BLD_TYPE= calc-dynamic-only
#
diff --git a/sci-mathematics/calc/files/calc-2.13.0.1-RPATH.patch b/sci-mathematics/calc/files/calc-2.13.0.1-RPATH.patch
new file mode 100644
index 000000000000..c7657a8b772c
--- /dev/null
+++ b/sci-mathematics/calc/files/calc-2.13.0.1-RPATH.patch
@@ -0,0 +1,199 @@
+--- a/Makefile
++++ b/Makefile
+@@ -1384,9 +1384,6 @@ ifeq ($(target),Linux)
+ BLD_TYPE= calc-dynamic-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
+-LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
+- "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
+ LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ ifdef ALLOW_CUSTOM
+ LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
+@@ -1436,7 +1433,6 @@ ifeq ($(target),Darwin)
+ BLD_TYPE= calc-dynamic-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:${LIBDIR}:${PREFIX}/lib
+ LD_SHARE= ${DARWIN_ARCH}
+ #SET_INSTALL_NAME= no
+ SET_INSTALL_NAME= yes
+@@ -1518,9 +1514,6 @@ ifeq ($(target),FreeBSD)
+ BLD_TYPE= calc-dynamic-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
+-LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
+- "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
+ LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ ifdef ALLOW_CUSTOM
+ LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
+@@ -1578,9 +1571,6 @@ ifeq ($(target),OpenBSD)
+ BLD_TYPE= calc-dynamic-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
+-LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
+- "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
+ LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ ifdef ALLOW_CUSTOM
+ LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
+@@ -1632,9 +1622,6 @@ ifeq ($(target),SunOS)
+ BLD_TYPE= calc-dynamic-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
+-LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
+- "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
+ LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ ifdef ALLOW_CUSTOM
+ LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
+@@ -1684,9 +1671,6 @@ ifeq ($(target),Cygwin)
+ BLD_TYPE= calc-static-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
+-LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
+- "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
+ LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ ifdef ALLOW_CUSTOM
+ LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
+@@ -1740,9 +1724,6 @@ ifeq ($(target),simple)
+ BLD_TYPE= calc-static-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
+-LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
+- "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
+ LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
+ #
+@@ -1799,9 +1780,6 @@ CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit
+ BLD_TYPE= calc-static-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
+-LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
+- "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
+ LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ ifdef ALLOW_CUSTOM
+ LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
+@@ -1839,9 +1817,6 @@ ifeq ($(target),)
+ BLD_TYPE= calc-static-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
+-LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
+- "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
+ LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ ifdef ALLOW_CUSTOM
+ LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
+@@ -2115,7 +2090,6 @@ CUSTOM_PASSDOWN= \
+ CUSTOMHELPDIR="${CUSTOMHELPDIR}" \
+ CUSTOMINCDIR="${CUSTOMINCDIR}" \
+ DEBUG="${DEBUG}" \
+- DEFAULT_LIB_INSTALL_PATH="${DEFAULT_LIB_INSTALL_PATH}" \
+ E="${E}" \
+ FMT=${FMT} \
+ GREP=${GREP} \
+@@ -4510,7 +4484,6 @@ env:
+ @echo 'C_SRC=${C_SRC}'; echo ''
+ @echo 'DATE=${DATE}'; echo ''
+ @echo 'DEBUG=${DEBUG}'; echo ''
+- @echo 'DEFAULT_LIB_INSTALL_PATH=${DEFAULT_LIB_INSTALL_PATH}'; echo ''
+ @echo 'DEV_BITS=${DEV_BITS}'; echo ''
+ @echo 'DIFF=${DIFF}'; echo ''
+ @echo 'DISTLIST=${DISTLIST}'; echo ''
+--- a/custom/Makefile
++++ b/custom/Makefile
+@@ -667,9 +667,6 @@ ifeq ($(target),Linux)
+ BLD_TYPE= calc-dynamic-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
+-LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
+- "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
+ LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ ifdef ALLOW_CUSTOM
+ LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
+@@ -719,7 +716,6 @@ ifeq ($(target),Darwin)
+ BLD_TYPE= calc-dynamic-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:${LIBDIR}:${PREFIX}/lib
+ LD_SHARE= ${DARWIN_ARCH}
+ #SET_INSTALL_NAME= no
+ SET_INSTALL_NAME= yes
+@@ -801,9 +797,6 @@ ifeq ($(target),FreeBSD)
+ BLD_TYPE= calc-dynamic-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
+-LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
+- "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
+ LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ ifdef ALLOW_CUSTOM
+ LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
+@@ -861,9 +854,6 @@ ifeq ($(target),OpenBSD)
+ BLD_TYPE= calc-dynamic-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
+-LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
+- "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
+ LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ ifdef ALLOW_CUSTOM
+ LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
+@@ -915,9 +905,6 @@ ifeq ($(target),SunOS)
+ BLD_TYPE= calc-dynamic-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
+-LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
+- "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
+ LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ ifdef ALLOW_CUSTOM
+ LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
+@@ -967,9 +954,6 @@ ifeq ($(target),Cygwin)
+ BLD_TYPE= calc-static-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
+-LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
+- "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
+ LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ ifdef ALLOW_CUSTOM
+ LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
+@@ -1023,9 +1007,6 @@ ifeq ($(target),simple)
+ BLD_TYPE= calc-static-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
+-LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
+- "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
+ LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
+ #
+@@ -1082,9 +1063,6 @@ CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit
+ BLD_TYPE= calc-static-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
+-LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
+- "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
+ LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ ifdef ALLOW_CUSTOM
+ LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
+@@ -1122,9 +1100,6 @@ ifeq ($(target),)
+ BLD_TYPE= calc-static-only
+ #
+ CC_SHARE= -fPIC
+-DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:${PREFIX}/lib
+-LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
+- "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
+ LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
+ ifdef ALLOW_CUSTOM
+ LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
+--
+2.31.1
+
diff --git a/sci-mathematics/calc/files/calc-2.13.0.1-respect-LDFLAGS.patch b/sci-mathematics/calc/files/calc-2.13.0.1-respect-LDFLAGS.patch
new file mode 100644
index 000000000000..971d20e7ef75
--- /dev/null
+++ b/sci-mathematics/calc/files/calc-2.13.0.1-respect-LDFLAGS.patch
@@ -0,0 +1,267 @@
+--- a/Makefile
++++ b/Makefile
+@@ -2541,11 +2541,11 @@ sample: ${SAMPLE_TARGETS}
+
+ sample_rand${EXT}: sample_rand.o ${CALC_DYNAMIC_LIBS} ${MAKE_FILE} ${LOC_MKF}
+ ${CC} sample_rand.o ${LDFLAGS} ${LD_SHARE} ${CALC_DYNAMIC_LIBS} \
+- ${READLINE_LIB} ${READLINE_EXTRAS} -o $@
++ ${READLINE_LIB} ${READLINE_EXTRAS} ${LDFLAGS} -o $@
+
+ sample_many${EXT}: sample_many.o ${CALC_DYNAMIC_LIBS} ${MAKE_FILE} ${LOC_MKF}
+ ${CC} sample_many.o ${LDFLAGS} ${LD_SHARE} ${CALC_DYNAMIC_LIBS} \
+- ${READLINE_LIB} ${READLINE_EXTRAS} -o $@
++ ${READLINE_LIB} ${READLINE_EXTRAS} ${LDFLAGS} -o $@
+
+ ###
+ #
+@@ -2554,15 +2554,15 @@ sample_many${EXT}: sample_many.o ${CALC_DYNAMIC_LIBS} ${MAKE_FILE} ${LOC_MKF}
+ ###
+
+ hist.o: hist.c ${MAKE_FILE} ${LOC_MKF}
+- ${CC} ${CFLAGS} ${TERMCONTROL} ${USE_READLINE} ${READLINE_INCLUDE} \
++ ${CC} ${CFLAGS} ${TERMCONTROL} ${USE_READLINE} ${READLINE_INCLUDE} ${LDFLAGS} \
+ -c hist.c
+
+ seed.o: seed.c ${MAKE_FILE} ${LOC_MKF}
+ ${CC} ${CFLAGS} ${WNO_IMPLICT} ${WNO_ERROR_LONG_LONG} \
+- ${WNO_LONG_LONG} -c seed.c
++ ${WNO_LONG_LONG} ${LDFLAGS} -c seed.c
+
+ file.o: file.c ${MAKE_FILE} ${LOC_MKF}
+- ${CC} ${CFLAGS} ${WNO_ERROR_LONG_LONG} ${WNO_LONG_LONG} -c file.c
++ ${CC} ${CFLAGS} ${WNO_ERROR_LONG_LONG} ${WNO_LONG_LONG} ${LDFLAGS} -c file.c
+
+ ###
+ #
+@@ -4190,7 +4190,7 @@ depend: hsrc custom/Makefile
+ ${Q} :> skel/makedep.out
+ ${Q} cd skel; ${MAKEDEPEND} \
+ -w 1 -f makedep.out -- \
+- ${CFLAGS} -- \
++ ${CFLAGS} ${LDFLAGS} -- \
+ ${C_SRC} ${BUILD_C_SRC} 2>/dev/null
+ -${Q} for i in ${C_SRC} ${BUILD_C_SRC} /dev/null; do \
+ if [ X"$$i" != X"/dev/null" ]; then \
+--- a/Makefile.simple
++++ b/Makefile.simple
+@@ -1941,12 +1941,12 @@ calc.usage: calc.1 ${MAKE_FILE} ${LOC_MKF}
+ sample: ${SAMPLE_TARGETS}
+
+ sample_rand${EXT}: sample_rand.o ${CALC_DYNAMIC_LIBS} ${MAKE_FILE} ${LOC_MKF}
+- ${CC} sample_rand.o ${LDFLAGS} ${LD_SHARE} ${CALC_DYNAMIC_LIBS} \
+- ${READLINE_LIB} ${READLINE_EXTRAS} -o $@
++ ${CC} ${CFLAGS} sample_rand.o ${LDFLAGS} ${LD_SHARE} ${CALC_DYNAMIC_LIBS} \
++ ${READLINE_LIB} ${READLINE_EXTRAS} ${LDFLAGS} -o $@
+
+ sample_many${EXT}: sample_many.o ${CALC_DYNAMIC_LIBS} ${MAKE_FILE} ${LOC_MKF}
+- ${CC} sample_many.o ${LDFLAGS} ${LD_SHARE} ${CALC_DYNAMIC_LIBS} \
+- ${READLINE_LIB} ${READLINE_EXTRAS} -o $@
++ ${CC} ${CFLAGS} sample_many.o ${LDFLAGS} ${LD_SHARE} ${CALC_DYNAMIC_LIBS} \
++ ${READLINE_LIB} ${READLINE_EXTRAS} ${LDFLAGS} -o $@
+
+ ###
+ #
+@@ -1955,15 +1955,15 @@ sample_many${EXT}: sample_many.o ${CALC_DYNAMIC_LIBS} ${MAKE_FILE} ${LOC_MKF}
+ ###
+
+ hist.o: hist.c ${MAKE_FILE} ${LOC_MKF}
+- ${CC} ${CFLAGS} ${TERMCONTROL} ${USE_READLINE} ${READLINE_INCLUDE} \
++ ${CC} ${CFLAGS} ${TERMCONTROL} ${USE_READLINE} ${READLINE_INCLUDE} ${LDFLAGS} \
+ -c hist.c
+
+ seed.o: seed.c ${MAKE_FILE} ${LOC_MKF}
+ ${CC} ${CFLAGS} ${WNO_IMPLICT} ${WNO_ERROR_LONG_LONG} \
+- ${WNO_LONG_LONG} -c seed.c
++ ${WNO_LONG_LONG} ${LDFLAGS} -c seed.c
+
+ file.o: file.c ${MAKE_FILE} ${LOC_MKF}
+- ${CC} ${CFLAGS} ${WNO_ERROR_LONG_LONG} ${WNO_LONG_LONG} -c file.c
++ ${CC} ${CFLAGS} ${WNO_ERROR_LONG_LONG} ${WNO_LONG_LONG} ${LDFLAGS} -c file.c
+
+ ###
+ #
+@@ -3557,7 +3557,7 @@ depend: hsrc custom/Makefile
+ ${Q} :> skel/makedep.out
+ ${Q} cd skel; ${MAKEDEPEND} \
+ -w 1 -f makedep.out -- \
+- ${CFLAGS} -- \
++ ${CFLAGS} ${LDFLAGS} -- \
+ ${C_SRC} ${BUILD_C_SRC} 2>/dev/null
+ -${Q} for i in ${C_SRC} ${BUILD_C_SRC} /dev/null; do \
+ if [ X"$$i" != X"/dev/null" ]; then \
+--- a/custom/Makefile
++++ b/custom/Makefile
+@@ -1280,7 +1280,7 @@ libcustcalc${LIB_EXT_VERSION}: ${CUSTCALC_OBJ} ${MAKE_FILE}
+ ##
+
+ c_sysinfo.o: c_sysinfo.c ${MAKE_FILE}
+- ${CC} ${CFLAGS} c_sysinfo.c -c
++ ${CC} ${CFLAGS} ${LDFLAGS} c_sysinfo.c -c
+
+ ##
+ #
+@@ -1407,7 +1407,7 @@ depend:
+ ${Q} :> skel/custom/makedep.out
+ ${Q} cd skel/custom; ${MAKEDEPEND} \
+ -I../../.. -w 1 -f makedep.out -- \
+- ${CFLAGS} -- \
++ ${CFLAGS} ${LDFLAGS} -- \
+ ${C_SRC} 2>/dev/null
+ ${Q} ${SED} -e 's|: ../../|: |' -E -i '' -l skel/custom/makedep.out
+ -${Q} for i in ${C_SRC} /dev/null; do \
+--
+2.31.1
+
+--- a/Makefile
++++ b/Makefile
+@@ -2487,12 +2487,12 @@ calc-static-only: ${STATIC_FIRST_TARGETS} ${EARLY_TARGETS} \
+
+ calc${EXT}: .hsrc ${CALCOBJS} ${CALC_DYNAMIC_LIBS} ${MAKE_FILE} ${LOC_MKF}
+ ${RM} -f $@
+- ${CC} ${CALCOBJS} ${LDFLAGS} ${LD_SHARE} ${CALC_DYNAMIC_LIBS} \
++ ${CC} ${CPPFLAGS} ${CALCOBJS} ${LDFLAGS} ${LD_SHARE} ${CALC_DYNAMIC_LIBS} \
+ ${READLINE_LIB} ${READLINE_EXTRAS} -o $@
+
+ libcalc${LIB_EXT_VERSION}: ${LIBOBJS} ver_calc${EXT} ${MAKE_FILE} ${LOC_MKF}
+- ${CC} ${LIBCALC_SHLIB} ${LIBOBJS} \
+- ${READLINE_LIB} ${READLINE_EXTRAS} -o libcalc${LIB_EXT_VERSION}
++ ${CC} ${CPPFLAGS} ${LIBCALC_SHLIB} ${LIBOBJS} \
++ ${READLINE_LIB} ${READLINE_EXTRAS} ${LDFLAGS} -o libcalc${LIB_EXT_VERSION}
+
+ libcalc${LIB_EXT}: libcalc${LIB_EXT_VERSION}
+ ${Q} ${RM} -f $@
+@@ -2540,11 +2540,11 @@ calc.usage: calc.1 ${MAKE_FILE} ${LOC_MKF}
+ sample: ${SAMPLE_TARGETS}
+
+ sample_rand${EXT}: sample_rand.o ${CALC_DYNAMIC_LIBS} ${MAKE_FILE} ${LOC_MKF}
+- ${CC} sample_rand.o ${LDFLAGS} ${LD_SHARE} ${CALC_DYNAMIC_LIBS} \
++ ${CC} ${CPPFLAGS} sample_rand.o ${LDFLAGS} ${LD_SHARE} ${CALC_DYNAMIC_LIBS} \
+ ${READLINE_LIB} ${READLINE_EXTRAS} ${LDFLAGS} -o $@
+
+ sample_many${EXT}: sample_many.o ${CALC_DYNAMIC_LIBS} ${MAKE_FILE} ${LOC_MKF}
+- ${CC} sample_many.o ${LDFLAGS} ${LD_SHARE} ${CALC_DYNAMIC_LIBS} \
++ ${CC} ${CPPFLAGS} sample_many.o ${LDFLAGS} ${LD_SHARE} ${CALC_DYNAMIC_LIBS} \
+ ${READLINE_LIB} ${READLINE_EXTRAS} ${LDFLAGS} -o $@
+
+ ###
+@@ -2554,15 +2554,15 @@ sample_many${EXT}: sample_many.o ${CALC_DYNAMIC_LIBS} ${MAKE_FILE} ${LOC_MKF}
+ ###
+
+ hist.o: hist.c ${MAKE_FILE} ${LOC_MKF}
+- ${CC} ${CFLAGS} ${TERMCONTROL} ${USE_READLINE} ${READLINE_INCLUDE} ${LDFLAGS} \
++ ${CC} ${CFLAGS} ${CPPFLAGS} ${TERMCONTROL} ${USE_READLINE} ${READLINE_INCLUDE} ${LDFLAGS} \
+ -c hist.c
+
+ seed.o: seed.c ${MAKE_FILE} ${LOC_MKF}
+- ${CC} ${CFLAGS} ${WNO_IMPLICT} ${WNO_ERROR_LONG_LONG} \
++ ${CC} ${CFLAGS} ${CPPFLAGS} ${WNO_IMPLICT} ${WNO_ERROR_LONG_LONG} \
+ ${WNO_LONG_LONG} ${LDFLAGS} -c seed.c
+
+ file.o: file.c ${MAKE_FILE} ${LOC_MKF}
+- ${CC} ${CFLAGS} ${WNO_ERROR_LONG_LONG} ${WNO_LONG_LONG} ${LDFLAGS} -c file.c
++ ${CC} ${CFLAGS} ${CPPFLAGS} ${WNO_ERROR_LONG_LONG} ${WNO_LONG_LONG} ${LDFLAGS} -c file.c
+
+ ###
+ #
+@@ -4109,7 +4109,7 @@ endif
+ calc-static${EXT}: .hsrc ${CALCOBJS} \
+ ${CALC_STATIC_LIBS} ${MAKE_FILE} ${LOC_MKF}
+ ${RM} -f $@
+- ${CC} ${LDFLAGS} ${CALCOBJS} ${LD_STATIC} ${CALC_STATIC_LIBS} \
++ ${CC} ${CPPFLAGS} ${LDFLAGS} ${CALCOBJS} ${LD_STATIC} ${CALC_STATIC_LIBS} \
+ ${READLINE_LIB} ${READLINE_EXTRAS} -o $@
+
+ libcustcalc.a: custom/libcustcalc.a
+@@ -4133,12 +4133,12 @@ endif
+
+ sample_rand-static${EXT}: sample_rand.o ${CALC_STATIC_LIBS} \
+ ${MAKE_FILE} ${LOC_MKF}
+- ${CC} ${LDFLAGS} sample_rand.o ${LD_STATIC} \
++ ${CC} ${CPPFLAGS} ${LDFLAGS} sample_rand.o ${LD_STATIC} \
+ ${CALC_STATIC_LIBS} ${READLINE_LIB} ${READLINE_EXTRAS} -o $@
+
+ sample_many-static${EXT}: sample_many.o ${CALC_STATIC_LIBS} \
+ ${MAKE_FILE} ${LOC_MKF}
+- ${CC} ${LDFLAGS} sample_many.o ${LD_STATIC} \
++ ${CC} ${CPPFLAGS} ${LDFLAGS} sample_many.o ${LD_STATIC} \
+ ${CALC_STATIC_LIBS} ${READLINE_LIB} ${READLINE_EXTRAS} -o $@
+
+ ###
+@@ -4190,7 +4190,7 @@ depend: hsrc custom/Makefile
+ ${Q} :> skel/makedep.out
+ ${Q} cd skel; ${MAKEDEPEND} \
+ -w 1 -f makedep.out -- \
+- ${CFLAGS} ${LDFLAGS} -- \
++ ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -- \
+ ${C_SRC} ${BUILD_C_SRC} 2>/dev/null
+ -${Q} for i in ${C_SRC} ${BUILD_C_SRC} /dev/null; do \
+ if [ X"$$i" != X"/dev/null" ]; then \
+--- a/custom/Makefile
++++ b/custom/Makefile
+@@ -1271,7 +1271,7 @@ custom/libcustcalc${LIB_EXT_VERSION}: libcustcalc${LIB_EXT_VERSION} \
+ ${CALC_STATIC_LIBCUSTCALC}
+
+ libcustcalc${LIB_EXT_VERSION}: ${CUSTCALC_OBJ} ${MAKE_FILE}
+- ${CC} ${LIBCUSTCALC_SHLIB} ${CUSTCALC_OBJ} -o $@
++ ${CC} ${CPPFLAGS} ${LDFLAGS} ${LIBCUSTCALC_SHLIB} ${CUSTCALC_OBJ} -o $@
+
+ ##
+ #
+@@ -1280,7 +1280,7 @@ libcustcalc${LIB_EXT_VERSION}: ${CUSTCALC_OBJ} ${MAKE_FILE}
+ ##
+
+ c_sysinfo.o: c_sysinfo.c ${MAKE_FILE}
+- ${CC} ${CFLAGS} ${LDFLAGS} c_sysinfo.c -c
++ ${CC} ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} c_sysinfo.c -c
+
+ ##
+ #
+@@ -1407,7 +1407,7 @@ depend:
+ ${Q} :> skel/custom/makedep.out
+ ${Q} cd skel/custom; ${MAKEDEPEND} \
+ -I../../.. -w 1 -f makedep.out -- \
+- ${CFLAGS} ${LDFLAGS} -- \
++ ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -- \
+ ${C_SRC} 2>/dev/null
+ ${Q} ${SED} -e 's|: ../../|: |' -E -i '' -l skel/custom/makedep.out
+ -${Q} for i in ${C_SRC} /dev/null; do \
+--- a/custom/Makefile.simple
++++ b/custom/Makefile.simple
+@@ -748,7 +748,7 @@ custom/libcustcalc${LIB_EXT_VERSION}: libcustcalc${LIB_EXT_VERSION} \
+ ${CALC_STATIC_LIBCUSTCALC}
+
+ libcustcalc${LIB_EXT_VERSION}: ${CUSTCALC_OBJ} ${MAKE_FILE}
+- ${CC} ${LIBCUSTCALC_SHLIB} ${CUSTCALC_OBJ} -o $@
++ ${CC} ${LDFLAGS} ${LIBCUSTCALC_SHLIB} ${CUSTCALC_OBJ} -o $@
+
+ ##
+ #
+@@ -757,7 +757,7 @@ libcustcalc${LIB_EXT_VERSION}: ${CUSTCALC_OBJ} ${MAKE_FILE}
+ ##
+
+ c_sysinfo.o: c_sysinfo.c ${MAKE_FILE}
+- ${CC} ${CFLAGS} c_sysinfo.c -c
++ ${CC} ${CFLAGS} ${LDFLAGS} c_sysinfo.c -c
+
+ ##
+ #
+--- a/custom/Makefile.tail
++++ b/custom/Makefile.tail
+@@ -93,7 +93,7 @@ custom/libcustcalc${LIB_EXT_VERSION}: libcustcalc${LIB_EXT_VERSION} \
+ ${CALC_STATIC_LIBCUSTCALC}
+
+ libcustcalc${LIB_EXT_VERSION}: ${CUSTCALC_OBJ} ${MAKE_FILE}
+- ${CC} ${LIBCUSTCALC_SHLIB} ${CUSTCALC_OBJ} -o $@
++ ${CC} ${CPPFLAGS} ${LDFLAGS} ${LIBCUSTCALC_SHLIB} ${CUSTCALC_OBJ} -o $@
+
+ ##
+ #
+@@ -102,7 +102,7 @@ libcustcalc${LIB_EXT_VERSION}: ${CUSTCALC_OBJ} ${MAKE_FILE}
+ ##
+
+ c_sysinfo.o: c_sysinfo.c ${MAKE_FILE}
+- ${CC} ${CFLAGS} c_sysinfo.c -c
++ ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} c_sysinfo.c -c
+
+ ##
+ #