summaryrefslogtreecommitdiff
path: root/dev-libs
diff options
context:
space:
mode:
Diffstat (limited to 'dev-libs')
-rw-r--r--dev-libs/Manifest.gzbin98014 -> 98013 bytes
-rw-r--r--dev-libs/dmalloc/Manifest9
-rw-r--r--dev-libs/dmalloc/dmalloc-5.6.5-r1.ebuild62
-rw-r--r--dev-libs/dmalloc/dmalloc-5.6.5.ebuild73
-rw-r--r--dev-libs/dmalloc/files/dmalloc-5.6.5-Makefile.in.patch343
-rw-r--r--dev-libs/dmalloc/files/dmalloc-5.6.5-add-destdir-support.patch103
-rw-r--r--dev-libs/dmalloc/files/dmalloc-5.6.5-allow-overriding-ar-and-ld.patch89
-rw-r--r--dev-libs/dmalloc/files/dmalloc-5.6.5-configure-c99.patch35
-rw-r--r--dev-libs/dmalloc/files/dmalloc-5.6.5-fix-cxx-check.patch22
-rw-r--r--dev-libs/dmalloc/files/dmalloc-5.6.5-set-soname-version.patch32
10 files changed, 335 insertions, 433 deletions
diff --git a/dev-libs/Manifest.gz b/dev-libs/Manifest.gz
index 10b4b44c4a50..dcb13af6bd34 100644
--- a/dev-libs/Manifest.gz
+++ b/dev-libs/Manifest.gz
Binary files differ
diff --git a/dev-libs/dmalloc/Manifest b/dev-libs/dmalloc/Manifest
index 200701ecb8bb..ba4e3fccf32c 100644
--- a/dev-libs/dmalloc/Manifest
+++ b/dev-libs/dmalloc/Manifest
@@ -3,11 +3,14 @@ AUX dmalloc-5.5.2-ar.patch 390 BLAKE2B d339b90b38b045ef929a661aa2fb0c95e35a89bd8
AUX dmalloc-5.5.2-cxx.patch 546 BLAKE2B 6f85a3024d417c81f3a4dd4f50cf444f09eb3b53eb9faf7ccbd022ea9e596ebcefe0038fa894bf2782e08c53dab3a8d89fc43153e9bef34a2c84771fcf497bd5 SHA512 370ff73c4af16d7b4cb5e15a88f3cafcc16494df7df50c4494b1e34ed687f1385b774431cc94a9ba75ef96f2828f75501ee2d0addc9d3e34d4f718ac94ae5f6d
AUX dmalloc-5.5.2-string-macros.patch 367 BLAKE2B 7fd3e6ae9b4564ec519da953c5116b9a8d19fa446c1d3e24ff736ce3725fd7425881dc07272a3f5dbdee1202e1dac8f68f19266296f5c8335976e5287fa90ddc SHA512 61d0015e7997ecad97e722a1b308ec90e996e9d53b9f475c911f1d9eb929d8007881e52699e9f3427c5cecb9f0b2d202d12a7d607d23434913afbef455f08617
AUX dmalloc-5.5.2-threads.patch 165 BLAKE2B fee0be1573996dc7460735a94c645989db6fb9570e1140ec64e87e4bddd6b84227d072454bd64c4e0f261e81da0dd27a6ebf310b60e8a74539a21f83370e291f SHA512 b561c715c19604128c046b36bfe09794922176ce1cd12947da277631a410bbc19c5a1f7e998f0b61d7564e3b7516bee0fb4deddb13e036bb9e667f3502e56d0e
-AUX dmalloc-5.6.5-Makefile.in.patch 14323 BLAKE2B 00b99d856b1f9d6eec88b848af350c77c0e7ca1504efc474d76998d62b18b5c6eb2bece77af45674095d9dc616988b1bba7c3850a4af3d5210b418890818f4fb SHA512 b150c58963463d335d4bd0265f8535d8ced94bd72b29ba2cf395370e5d36c31881c557c5315a3ce9e776cd78f67bdd94aecfabc71001b24b3e317b868f7597fb
-AUX dmalloc-5.6.5-configure-c99.patch 1826 BLAKE2B ff3ed1ec4ff079dca239497060d183dc18c63a79eaf7460dd523dbcca5e4337593a52c8741070ad8fc7d2ae9e62007a542d6b1cb2a34afa8760b2e52cb330567 SHA512 1a21755bbb53e74a525f511fe76b8bd197fb9042a73929719d2e8c6a47c1ac080be7a8b2afe22747e26f028b2eddf06b153753fbf546c2ad152081081d6dc7fa
+AUX dmalloc-5.6.5-add-destdir-support.patch 4227 BLAKE2B 5a9c448f6d3f57687d8d6b3e8ce1f0fd1f344bf82ed176f51cca6a2669470ee068f7e807af6daabfabbfa564f9d14b517a170be565b340b271a921f86eb6edac SHA512 9034f5fb633acba033091fbc59f7f7d11bfb50f94d5c87b98f22bdc0fba2f082f4d14ebc7cbe89cf23555511161bb18c23c0a019364fb2c1d8706931421918b4
+AUX dmalloc-5.6.5-allow-overriding-ar-and-ld.patch 2907 BLAKE2B b00c59d74108e54954638e5b543587315a91f76ea56ebfd57ca5ca9b5e3a9c6a3bcfd92c51725f493984b54fdd6adeda999f578f00f6ac66619a2ca07d88631c SHA512 971cfe9ae48d0bb203eb421ce2e3be884933ba810fc8d0a2ebc3cb6d234a146e094129c3b6eebf77a122cbf7f74338497fedf88653a3ad80ae7e6f332f288ead
+AUX dmalloc-5.6.5-configure-c99.patch 2072 BLAKE2B 512a674d46af8ee35caa38c99d296d65c10884763813e4be1ff4a89768ecdb819205d8570724cb0924e3c963e3191378ffc509b894c324d3c4311b294657f4cd SHA512 88012d8ac6023f8f6c69e714469e44e16d9c4e20ea1c7006c560764806b3802333c4fa9fb656aca734332add6bce6fd942cae470e5311950a74f5b435aea68fa
+AUX dmalloc-5.6.5-fix-cxx-check.patch 623 BLAKE2B 3828e4b54bfb41c2743f180bb34c6748ae4d137afb8dfaff9691a89634ef124b30ed7259ecc72c3fbd6aa7828fd935dc69453a6daa67cfdffd0a16286f55e33c SHA512 0920ae481816cb9575ff1acc67a3d4d32b04379ef7d765ccd6f5168b06c14f3cbcceff4e294265283fe893196586ad61c2b5fcd3d3ab1de91c7dab38951d1db6
+AUX dmalloc-5.6.5-set-soname-version.patch 1439 BLAKE2B b926f917e1cc73b7db64fa46ba15778c20b4d13eb813a61087418445c22edb6610789399db8e643dc9ed39c48060ad83461d12d51dbe6c5fad84ad1a5c0d8565 SHA512 350e7a58f0057328a1c896990fc6c4889af54a5aac7d1af4d64f5258485e445e486395d36580b973c19c4f1ee4069cc22cabdd566aad019a2b4db4808c761f19
AUX dmalloc-999999-texi2html.patch 355 BLAKE2B 3b599bdfa45f6c781b446d72cab79acb6f6b59e0c648989c1012b625f4e07ed5b0934cd4c21865af154a1745e1ce2b72bf90f738efa40d7c2654e5e2723b389c SHA512 e29aba00d3e5edf0639685858215736f3aed4baa9f7b79577a69bf5e2e51a0072e92befe7ad0e24a68ea35e184271c15312b5acea145ff1a186eb0d35a985c72
DIST dmalloc-5.5.2.tgz 666608 BLAKE2B 9371b35b9a39706215ff2fc4e31510dafa30a86dccb2290563a2c8a0e7211372dca419dd7d549011548853f1e168fe15c55361d763d27230c547c93113de823e SHA512 96bb94aeb2bc3220f652b5294bdf8592b984cb2a53e5f02b2b8d52450c3396d18651f334644cdfff9c85a8c0d0cedc7f6a18b9d70497b2c6b5f85dbd1e827b93
DIST dmalloc-5.6.5.tgz 322310 BLAKE2B 43ba8cdef73423f2e3d6fa5dea34f1653d890c95dcd4ea13e9317d85d1991d0e68e80192860c7bdaf4ee33b36c892b9df31340ddde808b7d60ee00f21d532976 SHA512 17090378b763dd3eaf5ff196298f08982ad593d4c3a0104a67866b88793b612307f3ce9ef0aa7dfef2df6c8eb050e2be06513b29ca912e916c0bfd882a0f4bf1
EBUILD dmalloc-5.5.2-r7.ebuild 1828 BLAKE2B 920eee5e279c94245c135806010dfe50c75167f0b2943d2c9e78527977c1daa26516c0f9fff56cf61038700256ab2bbb63c75511bb3a5d54e34482ec0fb6ec64 SHA512 7f191948682117b5bb09cfa3de947c6adf4413f0b9871af48b8b1d46f7a51b3a4f79581e395ed21cf623a4bec3cf9ee9595bd2efa6daed6bdb18aac2f901d070
-EBUILD dmalloc-5.6.5.ebuild 1586 BLAKE2B 99faeb74c1f67e6459bc6d4e546ae7c4703c41887f94e24461d759319fe52b21c3d5d1227fbd5d6e18b33285c4e11aa8d9553d5ed703f602d9d0a1fa6b4ad6c0 SHA512 f13311939d5aeb7a1918268ff49015dce829c0a4c26c2885dd1cc1b4ae8c8abeafefcfb838522b3a85350e884644debb9395fc3957e0285861ee55641128dc4c
+EBUILD dmalloc-5.6.5-r1.ebuild 1252 BLAKE2B 5e4d3ff36982ef82f06ff0875f4aa8fedddeea2ea9cd7cb74c78fe2e877301b538974a610852c4dd130e0fc8e083931d3f50bb7ed92f1f6d3f3b1d7c2f1f406e SHA512 3be7de09fb2db95ad50e7e55f2142d24162811ce081470ae4e6dedccc9d5fa6143ba299e7b320b98ce1245183b20dc70b0485aea29395541acf5448867e93c3c
MISC metadata.xml 245 BLAKE2B 35d3566b19b5e18d70897e185aa1f37c3d9143eafc8f93f182b7add40f61283974bbbf058d16afde701168b84ee0e4e3f396b09df0c804131c27d2f56933f04b SHA512 281d535e9fa2912bfe988e396e16141f762300dce9becd3e716c6e63b080918f3f7c912b28e68d4a32656eb552ccf2ef4a7d3fbb339d7350752051a41bc8cc38
diff --git a/dev-libs/dmalloc/dmalloc-5.6.5-r1.ebuild b/dev-libs/dmalloc/dmalloc-5.6.5-r1.ebuild
new file mode 100644
index 000000000000..62fc41dd4d5e
--- /dev/null
+++ b/dev-libs/dmalloc/dmalloc-5.6.5-r1.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools
+
+DESCRIPTION="A Debug Malloc Library"
+HOMEPAGE="https://dmalloc.com"
+SRC_URI="https://dmalloc.com/releases/${P}.tgz"
+
+LICENSE="CC-BY-SA-3.0"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="threads"
+
+BDEPEND="sys-apps/texinfo"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-5.6.5-add-destdir-support.patch
+ "${FILESDIR}"/${PN}-5.6.5-allow-overriding-ar-and-ld.patch
+ "${FILESDIR}"/${PN}-5.6.5-set-soname-version.patch
+ "${FILESDIR}"/${PN}-5.6.5-configure-c99.patch
+ "${FILESDIR}"/${PN}-5.6.5-fix-cxx-check.patch
+)
+
+src_prepare() {
+ default
+
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --enable-cxx \
+ --enable-shlib \
+ $(use_enable threads)
+}
+
+src_test() {
+ # mv: cannot stat 'aout': No such file or directory
+ emake -j1 heavy
+}
+
+src_install() {
+ default
+
+ soname_link() {
+ dosym ${1}.so.${PV} /usr/$(get_libdir)/${1}.so.${PV%%.*}
+ dosym ${1}.so.${PV%%.*} /usr/$(get_libdir)/${1}.so
+ }
+
+ soname_link libdmalloc
+ soname_link libdmallocxx
+
+ if use threads; then
+ soname_link libdmallocth
+ soname_link libdmallocthcxx
+ fi
+
+ rm "${ED}"/usr/$(get_libdir)/lib${PN}*.a || die
+}
diff --git a/dev-libs/dmalloc/dmalloc-5.6.5.ebuild b/dev-libs/dmalloc/dmalloc-5.6.5.ebuild
deleted file mode 100644
index 75f5f823673e..000000000000
--- a/dev-libs/dmalloc/dmalloc-5.6.5.ebuild
+++ /dev/null
@@ -1,73 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit autotools toolchain-funcs
-
-DESCRIPTION="A Debug Malloc Library"
-HOMEPAGE="https://dmalloc.com"
-SRC_URI="https://dmalloc.com/releases/${P}.tgz"
-
-LICENSE="CC-BY-SA-3.0"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
-IUSE="threads"
-
-BDEPEND="sys-apps/texinfo"
-
-PATCHES=(
- # - Build objects twice, once -fPIC for shared.
- # - Use DESTDIR.
- # - Fix SONAME and NEEDED.
- "${FILESDIR}"/${PN}-5.6.5-Makefile.in.patch
- # - Broken test, always returns false.
- "${FILESDIR}"/${PN}-5.5.2-cxx.patch
- "${FILESDIR}"/${PN}-5.6.5-configure-c99.patch
-)
-
-src_prepare() {
- default
-
- # - Add threads support.
- use threads && eapply "${FILESDIR}"/${PN}-5.5.2-threads.patch
-
- # Respect CFLAGS/LDFLAGS. #337429
- sed -i \
- -e '/libdmalloc/ s:$(CC):& $(CFLAGS) $(LDFLAGS):g' \
- -e 's|ar cr|$(AR) cr|g' \
- Makefile.in || die
-
- # Run autoconf for -cxx.patch.
- eautoconf
-}
-
-src_configure() {
- tc-export AR
-
- econf \
- --enable-cxx \
- --enable-shlib \
- $(use_enable threads)
-}
-
-src_test() {
- emake heavy
-}
-
-src_install() {
- default
-
- # add missing symlinks, lazy
- dosym lib${PN}.so.${PV} /usr/$(get_libdir)/lib${PN}.so
- dosym lib${PN}.so.${PV} /usr/$(get_libdir)/lib${PN}.so.${PV%%.*}
-
- local lib
- for lib in cxx th thcxx; do
- dosym lib${PN}${lib}.so.${PV} /usr/$(get_libdir)/lib${PN}${lib}.so
- dosym lib${PN}${lib}.so.${PV} \
- /usr/$(get_libdir)/lib${PN}${lib}.so.${PV%%.*}
- done
-
- rm "${ED}"/usr/$(get_libdir)/lib${PN}*.a || die
-}
diff --git a/dev-libs/dmalloc/files/dmalloc-5.6.5-Makefile.in.patch b/dev-libs/dmalloc/files/dmalloc-5.6.5-Makefile.in.patch
deleted file mode 100644
index 2f28c6159218..000000000000
--- a/dev-libs/dmalloc/files/dmalloc-5.6.5-Makefile.in.patch
+++ /dev/null
@@ -1,343 +0,0 @@
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -42,7 +42,7 @@ LIBRARY = lib$(MODULE).a
-
- # thread version of the library
- LIB_TH = lib$(MODULE)th.a
--LIB_TH_SL = lib$(MODULE)th.@shlibext@
-+LIB_TH_SL = lib$(MODULE)th.@shlibext@.5.5.2
- @TH_ON@BUILD_ALL_1 = threads
- @TH_ON@INSTALL_LIB_1 = installth
- @SL_ON@BUILD_THREADS_1 = $(LIB_TH_SL)
-@@ -51,8 +51,8 @@ LIB_TH_SL = lib$(MODULE)th.@shlibext@
- @TH_ON@@SL_ON@INSTALL_LIB_2 = installthsl
-
- # C++ version of the library
--LIB_CXX = lib$(MODULE)xx.a
--LIB_CXX_SL = lib$(MODULE)xx.@shlibext@
-+LIB_CXX = lib$(MODULE)cxx.a
-+LIB_CXX_SL = lib$(MODULE)cxx.@shlibext@.5.5.2
- @CXX_ON@BUILD_ALL_3 = $(LIB_CXX)
- @CXX_ON@INSTALL_LIB_3 = installcxx
- @SL_ON@BUILD_CXX_3 = $(LIB_CXX_SL)
-@@ -62,7 +62,7 @@ LIB_CXX_SL = lib$(MODULE)xx.@shlibext@
-
- # threads + C++
- LIB_TH_CXX = lib$(MODULE)thcxx.a
--LIB_TH_CXX_SL = lib$(MODULE)thcxx.@shlibext@
-+LIB_TH_CXX_SL = lib$(MODULE)thcxx.@shlibext@.5.5.2
- @TH_ON@@CXX_ON@BUILD_ALL_5 = $(LIB_TH_CXX)
- @TH_ON@@CXX_ON@INSTALL_LIB_5 = installthcxx
- @TH_ON@BUILD_CXX_5 = $(LIB_TH_CXX)
-@@ -77,7 +77,7 @@ LIB_TH_CXX_SL = lib$(MODULE)thcxx.@shlibext@
- @CXX_ON@@SL_ON@INSTALL_THREADS_6 = installthcxxsl
-
- # shared versions of the libraries
--LIB_SL = lib$(MODULE).@shlibext@
-+LIB_SL = lib$(MODULE).@shlibext@.5.5.2
- @SL_ON@BUILD_ALL_7 = $(LIB_SL)
- @SL_ON@INSTALL_LIB_7 = installsl
- @SL_ON@BUILD_TH_CXX_7 = $(LIB_TH_CXX_SL)
-@@ -150,9 +150,14 @@ SHELL = /bin/sh
-
- HFLS = dmalloc.h
- OBJS = append.o arg_check.o compat.o dmalloc_rand.o dmalloc_tab.o env.o heap.o
-+OBJS_SL = arg_check_sl.o compat_sl.o dmalloc_rand_sl.o dmalloc_tab_sl.o env_sl.o heap_sl.o
-+
- NORMAL_OBJS = chunk.o error.o user_malloc.o
-+NORMAL_OBJS_SL = chunk_sl.o error_sl.o user_malloc_sl.o
- THREAD_OBJS = chunk_th.o error_th.o user_malloc_th.o
-+THREAD_OBJS_SL = chunk_th_sl.o error_th_sl.o malloc_th_sl.o
- CXX_OBJS = dmallocc.o
-+CXX_OBJS_SL = dmallocc_sl.o
-
- CFLAGS = $(CCFLAGS)
- TEST = $(MODULE)_t
-@@ -165,9 +170,9 @@ all : $(BUILD_ALL)
-
- clean :
- rm -f $(A_OUT) core *.o *.t
-- rm -f $(LIBRARY) $(LIB_TH) $(LIB_CXX) $(LIB_TH_CXX) $(TEST) $(TEST_FC)
-- rm -f $(LIB_TH_SL) $(LIB_CXX_SL) $(LIB_TH_CXX_SL) $(LIB_SL)
-+ rm -f $(TEST) $(TEST_FC)
- rm -f $(UTIL) dmalloc.h
-+ rm -f lib$(MODULE)*.*
-
- realclean : clean
-
-@@ -182,65 +187,65 @@ distclean : clean
- docs : $(DOCS) LICENSE.txt
-
- installdirs :
-- $(srcdir)/mkinstalldirs $(includedir) $(libdir) $(bindir)
-+ $(srcdir)/mkinstalldirs $(DESTDIR)$(includedir) $(DESTDIR)$(libdir) $(DESTDIR)$(bindir)
-
- installincs : $(HFLS)
-- $(srcdir)/mkinstalldirs $(includedir)
-- $(INSTALL_DATA) $(HFLS) $(includedir)
-+ $(srcdir)/mkinstalldirs $(DESTDIR)$(includedir)
-+ $(INSTALL_DATA) $(HFLS) $(DESTDIR)$(includedir)
-
- installthsl : $(LIB_TH_SL)
-- $(srcdir)/mkinstalldirs $(libdir)
-- $(INSTALL_PROGRAM) $(LIB_TH_SL) $(libdir)
-+ $(srcdir)/mkinstalldirs $(DESTDIR)$(libdir)
-+ $(INSTALL_PROGRAM) $(DESTDIR)$(LIB_TH_SL) $(DESTDIR)$(libdir)
-
- installth : $(INSTALL_THREADS)
-- $(srcdir)/mkinstalldirs $(libdir)
-- $(INSTALL_PROGRAM) $(LIB_TH) $(libdir)
-+ $(srcdir)/mkinstalldirs $(DESTDIR)$(libdir)
-+ $(INSTALL_PROGRAM) $(LIB_TH) $(DESTDIR)$(libdir)
- @CXX_OFF@ @echo "Enter 'make installthcxx' to install the threaded C++ library"
- @SL_OFF@ @echo "Enter 'make installthsl' to install the threaded shared-library"
-
- installthcxxsl : $(LIB_TH_CXX_SL)
-- $(srcdir)/mkinstalldirs $(shlibdir)
-- $(INSTALL_PROGRAM) $(LIB_TH_CXX_SL) $(shlibdir)
-+ $(srcdir)/mkinstalldirs $(DESTDIR)$(shlibdir)
-+ $(INSTALL_PROGRAM) $(LIB_TH_CXX_SL) $(DESTDIR)$(shlibdir)
-
- installthcxx : $(INSTALL_TH_CXX)
-- $(srcdir)/mkinstalldirs $(libdir)
-- $(INSTALL_PROGRAM) $(LIB_TH_CXX) $(libdir)
-+ $(srcdir)/mkinstalldirs $(DESTDIR)$(libdir)
-+ $(INSTALL_PROGRAM) $(LIB_TH_CXX) $(DESTDIR)$(libdir)
- @SL_OFF@ @echo "Enter 'make installthcxxsl' to install the threaded C++ shared-library"
-
- installcxxsl : $(LIB_CXX_SL)
-- $(srcdir)/mkinstalldirs $(libdir)
-- $(INSTALL_PROGRAM) $(LIB_CXX_SL) $(libdir)
-+ $(srcdir)/mkinstalldirs $(DESTDIR)$(libdir)
-+ $(INSTALL_PROGRAM) $(LIB_CXX_SL) $(DESTDIR)$(libdir)
-
- installcxx : $(INSTALL_CXX)
-- $(srcdir)/mkinstalldirs $(libdir)
-- $(INSTALL_PROGRAM) $(LIB_CXX) $(libdir)
-+ $(srcdir)/mkinstalldirs $(DESTDIR)$(libdir)
-+ $(INSTALL_PROGRAM) $(LIB_CXX) $(DESTDIR)$(libdir)
- @TH_OFF@ @echo "Enter 'make installthcxx' to install the threaded C++ library"
- @SL_OFF@ @echo "Enter 'make installcxxsl' to install the C++ shared-library"
-
- installsl : $(LIB_SL)
-- $(srcdir)/mkinstalldirs $(shlibdir)
-- $(INSTALL_PROGRAM) $(LIB_SL) $(shlibdir)
-+ $(srcdir)/mkinstalldirs $(DESTDIR)$(shlibdir)
-+ $(INSTALL_PROGRAM) $(LIB_SL) $(DESTDIR)$(shlibdir)
- @CXX_OFF@ @echo "Enter 'make installcxxsl' to install the C++ shared-library"
- @TH_OFF@ @echo "Enter 'make installthsl' to install thread shared-library"
-
- installlib : $(INSTALL_LIB)
-- $(srcdir)/mkinstalldirs $(libdir)
-- $(INSTALL_PROGRAM) $(LIBRARY) $(libdir)
-- @RANLIB@ $(libdir)/$(LIBRARY)
-+ $(srcdir)/mkinstalldirs $(DESTDIR)$(libdir)
-+ $(INSTALL_PROGRAM) $(LIBRARY) $(DESTDIR)$(libdir)
-+ @RANLIB@ $(DESTDIR)$(libdir)/$(LIBRARY)
- @SL_OFF@ @echo "Enter 'make installsl' to install $(LIB_SL) in $(shlibdir)"
- @CXX_OFF@ @echo "Enter 'make installcxx' to install the C++ library"
- @TH_OFF@ @echo "Enter 'make installth' to install thread library"
-
- # see notes about why we need the FILE2 entries below
- installdocs : $(INSTALL_FILE2) $(HTML_FILE2) $(INFO_FILE)
-- $(srcdir)/mkinstalldirs $(docdir)
-- $(INSTALL_DATA) $(INSTALL_FILE2) $(docdir)/$(INSTALL_FILE)
-- $(INSTALL_DATA) $(HTML_FILE2) $(docdir)/$(HTML_FILE)
-- $(INSTALL_DATA) $(INFO_FILE) $(docdir)
-+ $(srcdir)/mkinstalldirs $(DESTDIR)$(docdir)
-+ $(INSTALL_DATA) $(INSTALL_FILE2) $(DESTDIR)$(docdir)/$(INSTALL_FILE)
-+ $(INSTALL_DATA) $(HTML_FILE2) $(DESTDIR)$(docdir)/$(HTML_FILE)
-+ $(INSTALL_DATA) $(INFO_FILE) $(DESTDIR)$(docdir)
-
- install : installincs installlib $(UTIL)
-- $(srcdir)/mkinstalldirs $(bindir)
-- $(INSTALL_PROGRAM) $(UTIL) $(bindir)
-+ $(srcdir)/mkinstalldirs $(DESTDIR)$(bindir)
-+ $(INSTALL_PROGRAM) $(UTIL) $(DESTDIR)$(bindir)
- @echo "Enter 'make installdocs' to install $(DOCS) in $(docdir)"
-
- dmalloc.h.2 conf.h settings.h version.h : $(srcdir)/configure $(srcdir)/settings.dist $(srcdir)/conf.h.in
-@@ -297,10 +302,8 @@ shlib : $(BUILD_SL)
-
- # NOTE: you may have to edit the configure.ac script to get this to
- # work on your operating system. Please send feedback to the author
--$(LIB_SL) : $(LIBRARY)
-- rm -f $@ $@.t
-- @shlinkargs@ $(LIBRARY)
-- mv $@.t $@
-+$(LIB_SL) : $(OBJS_SL) $(NORMAL_OBJS_SL)
-+ $(CC) -shared -Wl,-soname,libdmalloc.so.5 -o $@ $(OBJS_SL) $(NORMAL_OBJS_SL)
-
- $(LIBRARY) : $(OBJS) $(NORMAL_OBJS)
- ar cr $@ $?
-@@ -310,32 +313,26 @@ $(LIB_TH) : $(OBJS) $(THREAD_OBJS)
- ar cr $@ $?
- @RANLIB@ $@
-
--$(LIB_TH_SL) : $(LIB_TH)
-- rm -f $@ $@.t
-- @shlinkargs@ $(LIB_TH)
-- mv $@.t $@
-+$(LIB_TH_SL) : $(OBJS_SL) $(THREAD_OBJS_SL)
-+ $(CC) -shared -Wl,-soname,libdmallocth.so.5 -o $@ $(OBJS_SL) $(THREAD_OBJS_SL)
-
- $(LIB_CXX) : $(OBJS) $(NORMAL_OBJS) $(CXX_OBJS)
- ar cr $@ $?
- @RANLIB@ $@
-
--$(LIB_CXX_SL) : $(LIB_CXX)
-- rm -f $@ $@.t
-- @shlinkargs@ $(LIB_CXX)
-- mv $@.t $@
-+$(LIB_CXX_SL) : $(OBJS_SL) $(NORMAL_OBJS_SL) $(CXX_OBJS_SL)
-+ $(CC) -shared -Wl,-soname,libdmalloccxx.so.5 -o $@ $(OBJS_SL) $(NORMAL_OBJS_SL) $(CXX_OBJS_SL)
-
- $(LIB_TH_CXX) : $(OBJS) $(THREAD_OBJS) $(CXX_OBJS)
- ar cr $@ $?
- @RANLIB@ $@
-
--$(LIB_TH_CXX_SL) : $(LIB_TH_CXX)
-- rm -f $@ $@.t
-- @shlinkargs@ $(LIB_TH_CXX)
-- mv $@.t $@
-+$(LIB_TH_CXX_SL) : $(OBJS_SL) $(THREAD_OBJS_SL) $(CXX_OBJS_SL)
-+ $(CC) -shared -Wl,-soname,libdmallocthcxx.so.5 -o $@ $(OBJS_SL) $(THREAD_OBJS_SL) $(CXX_OBJS_SL)
-
--threadssl : $(LIB_TH_SL)
-+threadssl : $(LIB_TH_SL)$(ver)
-
--threadscxxsl : $(LIB_TH_CXX_SL)
-+threadscxxsl : $(LIB_TH_CXX_SL)$(ver)
-
- threadscxx : $(BUILD_TH_CXX)
- @SL_OFF@ @echo "Enter 'make threadscxxsl' to build the threaded C++ shared-library"
-@@ -344,7 +341,7 @@ threads : $(BUILD_THREADS)
- @CXX_OFF@ @echo "Enter 'make threadscxx' to build the threaded C++ library"
- @SL_OFF@ @echo "Enter 'make threadssl' to build the threaded shared library"
-
--cxxsl : $(LIB_CXX_SL)
-+cxxsl : $(LIB_CXX_SL)$(ver)
-
- cxx : $(BUILD_CXX)
- @SL_OFF@ @echo "Enter 'make cxxsl' to build the cxx shared library"
-@@ -404,6 +401,11 @@ heavy : $(TEST) light
- rm -f $@
- $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
-
-+dmallocc_sl.o : $(srcdir)/dmallocc.cc dmalloc.h
-+ rm -f $@
-+ $(CXX) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $(srcdir)/dmallocc.cc \
-+ -o ./$@
-+
- #
- # .cc.o auto-target doesn't work on some systems.
- # also, $? did not work on OSF for the -c, grrr
-@@ -434,39 +436,108 @@ append.o: append.c conf.h settings.h dmalloc.h append.h compat.h \
- dmalloc_loc.h
- arg_check.o: arg_check.c conf.h settings.h dmalloc.h chunk.h debug_tok.h \
- dmalloc_loc.h error.h arg_check.h
-+arg_check_sl.o: arg_check.c conf.h settings.h dmalloc.h chunk.h debug_tok.h \
-+ dmalloc_loc.h error.h arg_check.h
-+ rm -f $@
-+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
- chunk.o: chunk.c conf.h settings.h dmalloc.h append.h chunk.h chunk_loc.h \
- dmalloc_loc.h compat.h debug_tok.h dmalloc_rand.h dmalloc_tab.h \
- error.h error_val.h heap.h
-+chunk_sl.o: chunk.c conf.h settings.h dmalloc.h append.h chunk.h chunk_loc.h \
-+ dmalloc_loc.h compat.h debug_tok.h dmalloc_rand.h dmalloc_tab.h \
-+ error.h error_val.h heap.h
-+ rm -f $@
-+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
- compat.o: compat.c conf.h settings.h dmalloc.h compat.h dmalloc_loc.h
-+compat_sl.o: compat.c conf.h settings.h dmalloc.h compat.h dmalloc_loc.h
-+ rm -f $@
-+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
- dmalloc.o: dmalloc.c conf.h settings.h dmalloc_argv.h dmalloc.h append.h \
- compat.h debug_tok.h dmalloc_loc.h env.h error_val.h version.h
-+dmalloc_sl.o: dmalloc.c conf.h settings.h dmalloc_argv.h dmalloc.h compat.h \
-+ debug_tok.h dmalloc_loc.h env.h error_val.h version.h
-+ rm -f $@
-+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
- dmalloc_argv.o: dmalloc_argv.c conf.h settings.h append.h dmalloc_argv.h \
- dmalloc_argv_loc.h compat.h
-+dmalloc_argv_sl.o: dmalloc_argv.c conf.h settings.h dmalloc_argv.h \
-+ dmalloc_argv_loc.h compat.h
-+ rm -f $@
-+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
- dmalloc_fc_t.o: dmalloc_fc_t.c conf.h settings.h dmalloc.h dmalloc_argv.h \
- dmalloc_rand.h debug_tok.h dmalloc_loc.h error_val.h
-+ rm -f $@
-+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
- dmalloc_rand.o: dmalloc_rand.c dmalloc_rand.h
-+dmalloc_rand_sl.o: dmalloc_rand.c dmalloc_rand.h
-+ rm -f $@
-+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
- dmalloc_t.o: dmalloc_t.c conf.h settings.h append.h compat.h dmalloc.h \
- dmalloc_argv.h dmalloc_rand.h arg_check.h debug_tok.h dmalloc_loc.h \
- error_val.h heap.h
-+dmalloc_t_sl.o: dmalloc_t.c conf.h settings.h compat.h dmalloc.h \
-+ dmalloc_argv.h dmalloc_rand.h arg_check.h debug_tok.h dmalloc_loc.h \
-+ error_val.h heap.h
-+ rm -f $@
-+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
- dmalloc_tab.o: dmalloc_tab.c conf.h settings.h append.h chunk.h compat.h \
- dmalloc.h dmalloc_loc.h dmalloc_tab.h dmalloc_tab_loc.h
-+dmalloc_tab_sl.o: dmalloc_tab.c conf.h settings.h chunk.h compat.h dmalloc.h \
-+ dmalloc_loc.h error.h error_val.h dmalloc_tab.h dmalloc_tab_loc.h
-+ rm -f $@
-+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
- env.o: env.c conf.h settings.h dmalloc.h append.h compat.h dmalloc_loc.h \
- debug_tok.h env.h error.h
-+env_sl.o: env.c conf.h settings.h dmalloc.h compat.h dmalloc_loc.h \
-+ debug_tok.h env.h error.h
-+ rm -f $@
-+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
- error.o: error.c conf.h settings.h dmalloc.h append.h chunk.h compat.h \
- debug_tok.h dmalloc_loc.h env.h error.h error_val.h version.h
-+error_sl.o: error.c conf.h settings.h dmalloc.h chunk.h compat.h debug_tok.h \
-+ dmalloc_loc.h env.h error.h error_val.h version.h
-+ rm -f $@
-+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
- heap.o: heap.c conf.h settings.h dmalloc.h append.h chunk.h compat.h \
- debug_tok.h dmalloc_loc.h error.h error_val.h heap.h
-+heap_sl.o: heap.c conf.h settings.h dmalloc.h chunk.h compat.h debug_tok.h \
-+ dmalloc_loc.h error.h error_val.h heap.h
-+ rm -f $@
-+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
- protect.o: protect.c conf.h settings.h dmalloc.h dmalloc_loc.h error.h \
- heap.h protect.h
-+protect_sl.o: protect.c conf.h settings.h dmalloc.h dmalloc_loc.h error.h \
-+ heap.h protect.h
-+ rm -f $@
-+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
- user_malloc.o: user_malloc.c conf.h settings.h dmalloc.h append.h chunk.h \
- compat.h debug_tok.h dmalloc_loc.h env.h error.h error_val.h heap.h \
- user_malloc.h return.h
-+user_malloc_sl.o: user_malloc.c conf.h settings.h dmalloc.h append.h chunk.h \
-+ compat.h debug_tok.h dmalloc_loc.h env.h error.h error_val.h heap.h \
-+ user_malloc.h return.h
-+ rm -f $@
-+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
- dmallocc.o: dmallocc.cc dmalloc.h return.h conf.h settings.h
- chunk_th.o: chunk.c conf.h settings.h dmalloc.h append.h chunk.h chunk_loc.h \
- dmalloc_loc.h compat.h debug_tok.h dmalloc_rand.h dmalloc_tab.h \
- error.h error_val.h heap.h
-+chunk_th_sl.o: chunk.c conf.h settings.h dmalloc.h chunk.h chunk_loc.h \
-+ dmalloc_loc.h compat.h debug_tok.h dmalloc_rand.h dmalloc_tab.h error.h \
-+ error_val.h heap.h
-+ rm -f $@
-+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
- error_th.o: error.c conf.h settings.h dmalloc.h append.h chunk.h compat.h \
- debug_tok.h dmalloc_loc.h env.h error.h error_val.h version.h
-+error_th_sl.o: error.c conf.h settings.h dmalloc.h chunk.h compat.h debug_tok.h \
-+ dmalloc_loc.h env.h error.h error_val.h version.h
-+ rm -f $@
-+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
- user_malloc_th.o: user_malloc.c conf.h settings.h dmalloc.h append.h chunk.h \
- compat.h debug_tok.h dmalloc_loc.h env.h error.h error_val.h heap.h \
- user_malloc.h return.h
-+user_malloc_th_sl.o: malloc.c conf.h settings.h dmalloc.h chunk.h compat.h \
-+ debug_tok.h dmalloc_loc.h env.h error.h error_val.h heap.h \
-+ malloc_funcs.h return.h
-+ rm -f $@
-+ $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) $(DEFS) $(INCS) -c $< -o ./$@
diff --git a/dev-libs/dmalloc/files/dmalloc-5.6.5-add-destdir-support.patch b/dev-libs/dmalloc/files/dmalloc-5.6.5-add-destdir-support.patch
new file mode 100644
index 000000000000..2ab42e0d258c
--- /dev/null
+++ b/dev-libs/dmalloc/files/dmalloc-5.6.5-add-destdir-support.patch
@@ -0,0 +1,103 @@
+From 79c791659a519cc7b3b3e615a3cc51c5e85a0a0a Mon Sep 17 00:00:00 2001
+From: Alfred Wingate <parona@protonmail.com>
+Date: Sat, 16 Dec 2023 14:13:57 +0200
+Subject: [PATCH 1/5] Add DESTDIR support
+
+Signed-off-by: Alfred Wingate <parona@protonmail.com>
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -182,65 +182,65 @@ distclean : clean
+ docs : $(DOCS) LICENSE.txt
+
+ installdirs :
+- $(srcdir)/mkinstalldirs $(includedir) $(libdir) $(bindir)
++ $(srcdir)/mkinstalldirs $(DESTDIR)$(includedir) $(DESTDIR)$(libdir) $(DESTDIR)$(bindir)
+
+ installincs : $(HFLS)
+- $(srcdir)/mkinstalldirs $(includedir)
+- $(INSTALL_DATA) $(HFLS) $(includedir)
++ $(srcdir)/mkinstalldirs $(DESTDIR)$(includedir)
++ $(INSTALL_DATA) $(HFLS) $(DESTDIR)$(includedir)
+
+ installthsl : $(LIB_TH_SL)
+- $(srcdir)/mkinstalldirs $(libdir)
+- $(INSTALL_PROGRAM) $(LIB_TH_SL) $(libdir)
++ $(srcdir)/mkinstalldirs $(DESTDIR)$(libdir)
++ $(INSTALL_PROGRAM) $(LIB_TH_SL) $(DESTDIR)$(libdir)
+
+ installth : $(INSTALL_THREADS)
+- $(srcdir)/mkinstalldirs $(libdir)
+- $(INSTALL_PROGRAM) $(LIB_TH) $(libdir)
++ $(srcdir)/mkinstalldirs $(DESTDIR)$(libdir)
++ $(INSTALL_PROGRAM) $(LIB_TH) $(DESTDIR)$(libdir)
+ @CXX_OFF@ @echo "Enter 'make installthcxx' to install the threaded C++ library"
+ @SL_OFF@ @echo "Enter 'make installthsl' to install the threaded shared-library"
+
+ installthcxxsl : $(LIB_TH_CXX_SL)
+- $(srcdir)/mkinstalldirs $(shlibdir)
+- $(INSTALL_PROGRAM) $(LIB_TH_CXX_SL) $(shlibdir)
++ $(srcdir)/mkinstalldirs $(DESTDIR)$(shlibdir)
++ $(INSTALL_PROGRAM) $(LIB_TH_CXX_SL) $(DESTDIR)$(shlibdir)
+
+ installthcxx : $(INSTALL_TH_CXX)
+- $(srcdir)/mkinstalldirs $(libdir)
+- $(INSTALL_PROGRAM) $(LIB_TH_CXX) $(libdir)
++ $(srcdir)/mkinstalldirs $(DESTDIR)$(libdir)
++ $(INSTALL_PROGRAM) $(LIB_TH_CXX) $(DESTDIR)$(libdir)
+ @SL_OFF@ @echo "Enter 'make installthcxxsl' to install the threaded C++ shared-library"
+
+ installcxxsl : $(LIB_CXX_SL)
+- $(srcdir)/mkinstalldirs $(libdir)
+- $(INSTALL_PROGRAM) $(LIB_CXX_SL) $(libdir)
++ $(srcdir)/mkinstalldirs $(DESTDIR)$(libdir)
++ $(INSTALL_PROGRAM) $(LIB_CXX_SL) $(DESTDIR)$(libdir)
+
+ installcxx : $(INSTALL_CXX)
+- $(srcdir)/mkinstalldirs $(libdir)
+- $(INSTALL_PROGRAM) $(LIB_CXX) $(libdir)
++ $(srcdir)/mkinstalldirs $(DESTDIR)$(libdir)
++ $(INSTALL_PROGRAM) $(LIB_CXX) $(DESTDIR)$(libdir)
+ @TH_OFF@ @echo "Enter 'make installthcxx' to install the threaded C++ library"
+ @SL_OFF@ @echo "Enter 'make installcxxsl' to install the C++ shared-library"
+
+ installsl : $(LIB_SL)
+- $(srcdir)/mkinstalldirs $(shlibdir)
+- $(INSTALL_PROGRAM) $(LIB_SL) $(shlibdir)
++ $(srcdir)/mkinstalldirs $(DESTDIR)$(shlibdir)
++ $(INSTALL_PROGRAM) $(LIB_SL) $(DESTDIR)$(shlibdir)
+ @CXX_OFF@ @echo "Enter 'make installcxxsl' to install the C++ shared-library"
+ @TH_OFF@ @echo "Enter 'make installthsl' to install thread shared-library"
+
+ installlib : $(INSTALL_LIB)
+- $(srcdir)/mkinstalldirs $(libdir)
+- $(INSTALL_PROGRAM) $(LIBRARY) $(libdir)
+- @RANLIB@ $(libdir)/$(LIBRARY)
++ $(srcdir)/mkinstalldirs $(DESTDIR)$(libdir)
++ $(INSTALL_PROGRAM) $(LIBRARY) $(DESTDIR)$(libdir)
++ @RANLIB@ $(DESTDIR)$(libdir)/$(LIBRARY)
+ @SL_OFF@ @echo "Enter 'make installsl' to install $(LIB_SL) in $(shlibdir)"
+ @CXX_OFF@ @echo "Enter 'make installcxx' to install the C++ library"
+ @TH_OFF@ @echo "Enter 'make installth' to install thread library"
+
+ # see notes about why we need the FILE2 entries below
+ installdocs : $(INSTALL_FILE2) $(HTML_FILE2) $(INFO_FILE)
+- $(srcdir)/mkinstalldirs $(docdir)
+- $(INSTALL_DATA) $(INSTALL_FILE2) $(docdir)/$(INSTALL_FILE)
+- $(INSTALL_DATA) $(HTML_FILE2) $(docdir)/$(HTML_FILE)
+- $(INSTALL_DATA) $(INFO_FILE) $(docdir)
++ $(srcdir)/mkinstalldirs $(DESTDIR)$(docdir)
++ $(INSTALL_DATA) $(INSTALL_FILE2) $(DESTDIR)$(docdir)/$(INSTALL_FILE)
++ $(INSTALL_DATA) $(HTML_FILE2) $(DESTDIR)$(docdir)/$(HTML_FILE)
++ $(INSTALL_DATA) $(INFO_FILE) $(DESTDIR)$(docdir)
+
+ install : installincs installlib $(UTIL)
+- $(srcdir)/mkinstalldirs $(bindir)
+- $(INSTALL_PROGRAM) $(UTIL) $(bindir)
++ $(srcdir)/mkinstalldirs $(DESTDIR)$(bindir)
++ $(INSTALL_PROGRAM) $(UTIL) $(DESTDIR)$(bindir)
+ @echo "Enter 'make installdocs' to install $(DOCS) in $(docdir)"
+
+ dmalloc.h.2 conf.h settings.h version.h : $(srcdir)/configure $(srcdir)/settings.dist $(srcdir)/conf.h.in
+--
+2.43.0
+
diff --git a/dev-libs/dmalloc/files/dmalloc-5.6.5-allow-overriding-ar-and-ld.patch b/dev-libs/dmalloc/files/dmalloc-5.6.5-allow-overriding-ar-and-ld.patch
new file mode 100644
index 000000000000..981909d9940a
--- /dev/null
+++ b/dev-libs/dmalloc/files/dmalloc-5.6.5-allow-overriding-ar-and-ld.patch
@@ -0,0 +1,89 @@
+From 626e5fb4c3f89b21e5ed75ee6c01d86527dede5f Mon Sep 17 00:00:00 2001
+From: Alfred Wingate <parona@protonmail.com>
+Date: Sun, 17 Dec 2023 13:57:11 +0200
+Subject: [PATCH 2/5] Allow overriding AR and LD
+
+https://bugs.gentoo.org/337429
+
+Signed-off-by: Alfred Wingate <parona@protonmail.com>
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -303,11 +303,11 @@ $(LIB_SL) : $(LIBRARY)
+ mv $@.t $@
+
+ $(LIBRARY) : $(OBJS) $(NORMAL_OBJS)
+- ar cr $@ $?
++ $(AR) cr $@ $?
+ @RANLIB@ $@
+
+ $(LIB_TH) : $(OBJS) $(THREAD_OBJS)
+- ar cr $@ $?
++ $(AR) cr $@ $?
+ @RANLIB@ $@
+
+ $(LIB_TH_SL) : $(LIB_TH)
+@@ -316,7 +316,7 @@ $(LIB_TH_SL) : $(LIB_TH)
+ mv $@.t $@
+
+ $(LIB_CXX) : $(OBJS) $(NORMAL_OBJS) $(CXX_OBJS)
+- ar cr $@ $?
++ $(AR) cr $@ $?
+ @RANLIB@ $@
+
+ $(LIB_CXX_SL) : $(LIB_CXX)
+@@ -325,7 +325,7 @@ $(LIB_CXX_SL) : $(LIB_CXX)
+ mv $@.t $@
+
+ $(LIB_TH_CXX) : $(OBJS) $(THREAD_OBJS) $(CXX_OBJS)
+- ar cr $@ $?
++ $(AR) cr $@ $?
+ @RANLIB@ $@
+
+ $(LIB_TH_CXX_SL) : $(LIB_TH_CXX)
+--- a/configure.ac
++++ b/configure.ac
+@@ -76,8 +76,13 @@ if test "$ac_cv_prog_cc_stdc" = "no" ; then
+ fi
+ AC_PROG_INSTALL
+ AC_PROG_RANLIB
++AC_CHECK_TOOL(AR,ar)
++AC_CHECK_TOOL(LD,ld)
+ AC_C_CONST
+
++AC_ARG_VAR(AR)
++AC_ARG_VAR(LD)
++
+ # we need this for various settings
+ AC_HEADER_STDC
+ AC_CHECK_HEADER([stdarg.h],
+@@ -144,7 +149,7 @@ AC_SUBST(shlibdir)
+ AC_MSG_CHECKING([shared library link args])
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([ int foo(int val) { return val + 1; } ])],[
+ # so now we try to create an archive from the compiled .o file
+- (ar cr conftest.a conftest.o) 2>&5
++ (${AR} cr conftest.a conftest.o) 2>&5
+ # see which shared-library ld commands work
+ #
+ # Darwin/Mac OS X - Terry Teague
+@@ -169,12 +174,12 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([ int foo(int val) { return val + 1; } ])],[
+ ac_cv_shared_link_args='# Could not configure shlib linking'
+ enable_shlib=no
+ fi
+- elif (ld -shared --whole-archive -soname conftest.so -o conftest.so.t conftest.a) 2>&5; then
+- ac_cv_shared_link_args='ld -shared --whole-archive -soname $@ -o $@.t'
+- elif (ld -shared -o conftest.so.t -all -soname conftest.so.t -none -lc -all conftest.a) 2>&5; then
+- ac_cv_shared_link_args='ld -shared -o $@.t -all -soname $@ -none -lc -all'
+- elif (ld -G -o conftest.so.t conftest.a) 2>&5; then
+- ac_cv_shared_link_args='ld -G -o $@.t'
++ elif (${LD} -shared --whole-archive -soname conftest.so -o conftest.so.t conftest.a) 2>&5; then
++ ac_cv_shared_link_args='$(LD) -shared --whole-archive -soname $@ -o $@.t'
++ elif (${LD} -shared -o conftest.so.t -all -soname conftest.so.t -none -lc -all conftest.a) 2>&5; then
++ ac_cv_shared_link_args='$(LD) -shared -o $@.t -all -soname $@ -none -lc -all'
++ elif (${LD} -G -o conftest.so.t conftest.a) 2>&5; then
++ ac_cv_shared_link_args='$(LD) -G -o $@.t'
+ else
+ # oh well, toss an error
+ ac_cv_shared_link_args='# Could not configure shlib linking'
+--
+2.43.0
+
diff --git a/dev-libs/dmalloc/files/dmalloc-5.6.5-configure-c99.patch b/dev-libs/dmalloc/files/dmalloc-5.6.5-configure-c99.patch
index f4c4904a235e..4f5e6339d8aa 100644
--- a/dev-libs/dmalloc/files/dmalloc-5.6.5-configure-c99.patch
+++ b/dev-libs/dmalloc/files/dmalloc-5.6.5-configure-c99.patch
@@ -1,6 +1,12 @@
+From debb91ecdd39a7039abdc6b2fb4c9b79956fc758 Mon Sep 17 00:00:00 2001
+From: Alfred Wingate <parona@protonmail.com>
+Date: Sun, 17 Dec 2023 14:35:31 +0200
+Subject: [PATCH 4/5] Fix c99 compatibility in configure script
+
+Signed-off-by: Alfred Wingate <parona@protonmail.com>
--- a/configure.ac
+++ b/configure.ac
-@@ -482,19 +482,20 @@ AC_MSG_RESULT([$ac_cv_pnt_arith_type])
+@@ -486,19 +486,20 @@ AC_MSG_RESULT([$ac_cv_pnt_arith_type])
AC_CHECK_FUNCS(abort)
AC_MSG_CHECKING([abort safe])
AC_RUN_IFELSE([AC_LANG_SOURCE([[
@@ -24,7 +30,7 @@
/* it should be already 0s */
start = malloc (number * size);
pnt = start;
-@@ -504,7 +505,7 @@ char *calloc (int number, int size) {
+@@ -508,7 +509,7 @@ char *calloc (int number, int size) {
}
char *realloc (char *old_pnt, int new_size) {
char *start, *pnt, *end;
@@ -33,7 +39,15 @@
start = malloc (new_size);
pnt = start;
end = start + new_size;
-@@ -647,6 +648,7 @@ fi
+@@ -549,6 +550,7 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ AC_CHECK_FUNCS(getenv)
+ AC_MSG_CHECKING([getenv safe])
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
++#include <stdlib.h>
+ static char heap_mem[102400], *heap_p = heap_mem;
+ free (char *pnt) {
+ }
+@@ -651,6 +653,7 @@ fi
#
AC_MSG_CHECKING([constructor attribute])
AC_RUN_IFELSE([AC_LANG_SOURCE([[
@@ -41,7 +55,7 @@
/* if we call the loc_con constructor then exit with error code 0 */
static void loc_con() __attribute__((constructor));
static void loc_con() { exit(0); }
-@@ -662,6 +664,7 @@ int main() { return 1; }
+@@ -666,6 +669,7 @@ int main() { return 1; }
#
AC_MSG_CHECKING([destructor attribute])
AC_RUN_IFELSE([AC_LANG_SOURCE([[
@@ -49,13 +63,6 @@
/* if we call the loc_decon destructor then exit with error code 0 */
static void loc_decon() __attribute__((destructor));
static void loc_decon() { exit(0); }
---- a/configure.ac
-+++ b/configure.ac
-@@ -546,6 +546,7 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
- AC_CHECK_FUNCS(getenv)
- AC_MSG_CHECKING([getenv safe])
- AC_RUN_IFELSE([AC_LANG_SOURCE([[
-+#include <stdlib.h>
- static char heap_mem[102400], *heap_p = heap_mem;
- free (char *pnt) {
- }
+--
+2.43.0
+
diff --git a/dev-libs/dmalloc/files/dmalloc-5.6.5-fix-cxx-check.patch b/dev-libs/dmalloc/files/dmalloc-5.6.5-fix-cxx-check.patch
new file mode 100644
index 000000000000..7e7c61f1baa3
--- /dev/null
+++ b/dev-libs/dmalloc/files/dmalloc-5.6.5-fix-cxx-check.patch
@@ -0,0 +1,22 @@
+From 17fb0cc429213fa3c2dd3d2bdec3b87e6b779be9 Mon Sep 17 00:00:00 2001
+From: Alfred Wingate <parona@protonmail.com>
+Date: Sun, 17 Dec 2023 14:49:28 +0200
+Subject: [PATCH 5/5] Fix CXX check
+
+Signed-off-by: Alfred Wingate <parona@protonmail.com>
+--- a/configure.ac
++++ b/configure.ac
+@@ -63,8 +63,8 @@ AC_PROG_CC
+ AC_PROG_CXX
+
+ # see if we actually have a CXX program
+-if test "$ac_cv_prog_CXX" = "" -o ! -x "$ac_cv_prog_CXX"; then
+- AC_MSG_WARN(could not find C++ compiler $ac_cv_prog_CXX)
++if test "x$CXX" = "x" -o -x "$CXX"; then
++ AC_MSG_WARN(could not find C++ compiler $CXX)
+ enable_cxx=no
+ fi
+
+--
+2.43.0
+
diff --git a/dev-libs/dmalloc/files/dmalloc-5.6.5-set-soname-version.patch b/dev-libs/dmalloc/files/dmalloc-5.6.5-set-soname-version.patch
new file mode 100644
index 000000000000..ebed9c0ef1aa
--- /dev/null
+++ b/dev-libs/dmalloc/files/dmalloc-5.6.5-set-soname-version.patch
@@ -0,0 +1,32 @@
+From 4cab6b74df4fb9ed7046faeb53c5ab01fa0716a1 Mon Sep 17 00:00:00 2001
+From: Alfred Wingate <parona@protonmail.com>
+Date: Sun, 17 Dec 2023 14:26:44 +0200
+Subject: [PATCH 3/5] Set soname version for shared library
+
+Signed-off-by: Alfred Wingate <parona@protonmail.com>
+--- a/configure.ac
++++ b/configure.ac
+@@ -175,9 +175,9 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([ int foo(int val) { return val + 1; } ])],[
+ enable_shlib=no
+ fi
+ elif (${LD} -shared --whole-archive -soname conftest.so -o conftest.so.t conftest.a) 2>&5; then
+- ac_cv_shared_link_args='$(LD) -shared --whole-archive -soname $@ -o $@.t'
++ ac_cv_shared_link_args="\$(LD) -shared --whole-archive -soname \$(@:${dmalloc_version}=${dmalloc_version_major}) -o \$@.t"
+ elif (${LD} -shared -o conftest.so.t -all -soname conftest.so.t -none -lc -all conftest.a) 2>&5; then
+- ac_cv_shared_link_args='$(LD) -shared -o $@.t -all -soname $@ -none -lc -all'
++ ac_cv_shared_link_args="\$(LD) -shared -o \$@.t -all -soname \$(@:${dmalloc_version}=${dmalloc_version_major}) -none -lc -all"
+ elif (${LD} -G -o conftest.so.t conftest.a) 2>&5; then
+ ac_cv_shared_link_args='$(LD) -G -o $@.t'
+ else
+@@ -208,7 +208,7 @@ if test `uname` = "Darwin"; then
+ else
+ ac_cv_shared_lib_suffix=so
+ fi
+-shlibext="$ac_cv_shared_lib_suffix"
++shlibext="$ac_cv_shared_lib_suffix.$dmalloc_version"
+ AC_MSG_RESULT([$ac_cv_shared_lib_suffix])
+ AC_SUBST(shlibext)
+
+--
+2.43.0
+