git: 7a6d524a3194 - main - libsamplerate: Build as internal library

From: Christos Margiolis <christos_at_FreeBSD.org>
Date: Fri, 01 Aug 2025 13:02:31 UTC
The branch main has been updated by christos:

URL: https://cgit.FreeBSD.org/src/commit/?id=7a6d524a3194e0f8c3508f9e65f03c4eabfea020

commit 7a6d524a3194e0f8c3508f9e65f03c4eabfea020
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2025-08-01 13:02:01 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2025-08-01 13:02:13 +0000

    libsamplerate: Build as internal library
    
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D51666
---
 lib/Makefile               |  1 +
 lib/libsamplerate/Makefile | 18 ++++++++++++++++++
 share/mk/src.libnames.mk   |  4 ++++
 3 files changed, 23 insertions(+)

diff --git a/lib/Makefile b/lib/Makefile
index 3417e7b30cb4..e0aafcad60d4 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -92,6 +92,7 @@ SUBDIR=	${SUBDIR_BOOTSTRAP} \
 	librss \
 	librt \
 	librtld_db \
+	libsamplerate \
 	libsbuf \
 	libsmb \
 	libstdbuf \
diff --git a/lib/libsamplerate/Makefile b/lib/libsamplerate/Makefile
new file mode 100644
index 000000000000..256f2087284f
--- /dev/null
+++ b/lib/libsamplerate/Makefile
@@ -0,0 +1,18 @@
+.PATH:		${SRCTOP}/contrib/libsamplerate
+
+LIB=		samplerate
+INTERNALLIB=
+
+SRCS=		samplerate.c \
+		src_linear.c \
+		src_sinc.c \
+		src_zoh.c
+
+INCS=		samplerate.h
+
+CFLAGS+=	-DENABLE_SINC_BEST_CONVERTER \
+		-DENABLE_SINC_MEDIUM_CONVERTER \
+		-DENABLE_SINC_FAST_CONVERTER \
+		-I${SRCTOP}/contrib/libsamplerate
+
+.include <bsd.lib.mk>
diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk
index 88202aeb78fe..0fe352dffaf4 100644
--- a/share/mk/src.libnames.mk
+++ b/share/mk/src.libnames.mk
@@ -72,6 +72,7 @@ _INTERNALLIBS=	\
 		pfctl \
 		pkgecc \
 		pmcstat \
+		samplerate \
 		sl \
 		sm \
 		smdb \
@@ -747,6 +748,9 @@ LIBC_NOSSP_PIC?=	${LIBC_NOSSP_PICDIR}/libc_nossp_pic.a
 LIBSYS_PICDIR=	${_LIB_OBJTOP}/lib/libsys
 LIBSYS_PIC?=	${LIBSYS_PICDIR}/libsys_pic.a
 
+LIBSAMPLERATEDIR?=	${_LIB_OBJTOP}/lib/libsamplerate
+LIBSAMPLERATE?=	${LIBSAMPLERATEDIR}/libsamplerate${PIE_SUFFIX}.a
+
 # Define a directory for each library.  This is useful for adding -L in when
 # not using a --sysroot or for meta mode bootstrapping when there is no
 # Makefile.depend.  These are sorted by directory.