From nobody Wed Apr 22 13:45:26 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4g10pv3NJwz6ZZbl for ; Wed, 22 Apr 2026 13:45:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4g10pt5QDPz3Xxr for ; Wed, 22 Apr 2026 13:45:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776865526; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GfmgUryazfdq48vK+fsO61YhnXLkaqkpVEa4gqD5k3A=; b=TP06fOUqUxStGPFg9uObM0A41/C/HqDT5RV3/rex85qjytxIbMWgEBBbgbD2w7kdXdqm4H fReT04Qifm2D+LhGf+nC3q2cZBOfebiY9yCL4LLamLq8zelxgmbWRwEZ74Dz/icRrnWVvn SCuG796z6nFaYkWZbmsn0Th6JYHbBywChZws6gM5kjHVw5GukY8LPyspnswF0jY7uHswzJ FmBG6/zeLpvW5zRA77thsRWjBHGp0Oy/Kevb4vzjPiUo2SR9q8MKPkj2Rh8s03fmosmg8Y JoO1R4A6WSogefPBwGZAvyIOEVEDT7460LoQ+LPRcKUANOVeH3b+Z9B+h4L76Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776865526; a=rsa-sha256; cv=none; b=jKAqs93RjPBid+eWnH/2JpQLWGSNUvcmV4lRsyrkrMboiqVMdWAvHILiEl4VTHfruXE/RJ ylKmrMn/LyiS8UMc/iJ95mAEcKgaeIG+CTOyjqUEbxsRIV+3iRLQz8zP/lNQ62YyAhEG+s wO/TrDwA819vC32zNHKbwPMJHroNVZicMXfoP9SqnZCJtjz77/75TcRXLWVyZK43PMKx8z 4XpSiP2A0fqaQ9xfpTaqTyLebS33Vc9EUP9ilaWh7iKTKepDqvXtUKdAeBat6kpwo7w3Cr +tUPLWrHfHP9bwglPYK9y1F9SGwhAjTY7LAsC+vPY/zMXEuHt1m2Fa66VuRrMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776865526; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GfmgUryazfdq48vK+fsO61YhnXLkaqkpVEa4gqD5k3A=; b=jc6A+KJzG3Sw2F+fU4fbpyOfvqN6gpfh4+jNjuqzvNrvq0eULk13RpyAjkLIrHvORbd5A7 dQigGHf4XEwCKBYSADEkxfhuZO0ebYrzC743egsLJtPtCuUhUzLePfas/X1vQ5zSbQi4zV nQ1GDn2w9+vsV22ZspFe+oL6wpMvAE9gwnESGawLLBpxxNXaZ2md5dBd0aP0+HFeFHy6Gg ClPt1ljHt+pzY2fkO5oPQHaWXULuCakcLBj+U4wciL9RbqlbFQ9aJh5sWg+YkFtURzycLk +O7AkJRl10KoGjg+scbJFfNyQyoPEjSCbsWcndJ2WfmD87fBnkDgBjoDI927+w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4g10pt4NvSzXfs for ; Wed, 22 Apr 2026 13:45:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 216cd by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 22 Apr 2026 13:45:26 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pierre Pronchery Subject: git: b8352da33f34 - main - pkgconf: import into the base system List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khorben X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b8352da33f3434f0ba6093df361261d1b1f973a1 Auto-Submitted: auto-generated Date: Wed, 22 Apr 2026 13:45:26 +0000 Message-Id: <69e8d0f6.216cd.2cf09725@gitrepo.freebsd.org> The branch main has been updated by khorben: URL: https://cgit.FreeBSD.org/src/commit/?id=b8352da33f3434f0ba6093df361261d1b1f973a1 commit b8352da33f3434f0ba6093df361261d1b1f973a1 Author: Pierre Pronchery AuthorDate: 2026-04-08 16:52:29 +0000 Commit: Pierre Pronchery CommitDate: 2026-04-22 13:42:56 +0000 pkgconf: import into the base system This introduces the following option: * MK_PKGCONF: determines if pkgconf and bomtool should be built The objective is to allow the creation of SBOM information while building FreeBSD's src tree. The build system cannot rely on the presence of bomtool (and eventually also spdxtool) in the build environment, except for having it as part of the src tree directly. The framework implementing the generation of SBOM files is under review in D56474. This will also help simplifying the build, with the introduction of another framework relying on the availability of pkgconf. Sponsored by: Alpha-Omega, The FreeBSD Foundation Reviewed by: bapt, philip Approved by: philip (mentor) Differential Revision: https://reviews.freebsd.org/D56404 --- etc/mtree/BSD.usr.dist | 2 + lib/Makefile | 1 + lib/libpkgconf/Makefile | 27 +++++++++++ lib/libpkgconf/libpkgconf/config.h | 77 ++++++++++++++++++++++++++++++++ share/mk/bsd.libnames.mk | 1 + share/mk/src.libnames.mk | 1 + share/mk/src.opts.mk | 1 + tools/build/mk/OptionalObsoleteFiles.inc | 18 ++++++++ tools/build/options/WITHOUT_PKGCONF | 1 + tools/build/options/WITH_PKGCONF | 5 +++ usr.bin/Makefile | 2 + usr.bin/bomtool/Makefile | 20 +++++++++ usr.bin/pkgconf/Makefile | 23 ++++++++++ 13 files changed, 179 insertions(+) diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist index f9577e3c8085..b281a368861d 100644 --- a/etc/mtree/BSD.usr.dist +++ b/etc/mtree/BSD.usr.dist @@ -26,6 +26,8 @@ .. .. .. + pkgconf tags=package=pkgconf-dev + .. samplerate tags=package=sound-dev .. sqlite3 tags=package=libsqlite3-dev diff --git a/lib/Makefile b/lib/Makefile index 1cb2d1d89e39..3faaea355ad0 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -188,6 +188,7 @@ SUBDIR.${MK_ICONV}+= libiconv_modules SUBDIR.${MK_KERBEROS}+= libcom_err .endif SUBDIR.${MK_LDNS}+= libldns +SUBDIR.${MK_PKGCONF}+= libpkgconf SUBDIR.${MK_STATS}+= libstats # The libraries under libclang_rt can only be built by clang. diff --git a/lib/libpkgconf/Makefile b/lib/libpkgconf/Makefile new file mode 100644 index 000000000000..8686103aa826 --- /dev/null +++ b/lib/libpkgconf/Makefile @@ -0,0 +1,27 @@ +PKGCONFDIR= ${SRCTOP}/contrib/pkgconf + +PACKAGE= pkgconf +PRIVATELIB= yes +LIB= pkgconf +MAN= pkg.m4.7 +MANNODEV= pc.5 +MANNODEV+= pkgconf-personality.5 + +SRCS= audit.c buffer.c cache.c client.c pkg.c bsdstubs.c fragment.c +SRCS+= argvsplit.c fileio.c tuple.c dependency.c queue.c +SRCS+= path.c personality.c parser.c +INCS= bsdstubs.h iter.h libpkgconf-api.h libpkgconf.h stdinc.h + +CFLAGS+= -Wno-error=cast-align +CFLAGS+= -Wno-error=cast-qual +CFLAGS+= -Wno-error=incompatible-pointer-types-discards-qualifiers +CFLAGS+= -DPERSONALITY_PATH=\"/usr/share/pkgconfig/personality.d:/etc/pkgconfig/personality.d:${LOCALBASE:U}/etc/pkgconfig/personality.d\" +CFLAGS+= -DPKG_DEFAULT_PATH=\"${LOCALBASE:U}/libdata/pkgconfig:/usr/libdata/pkgconfig:${LOCALBASE:U}/share/pkgconfig\" +CFLAGS+= -DSYSTEM_INCLUDEDIR=\"/usr/include\" +CFLAGS+= -DSYSTEM_LIBDIR=\"/usr/lib\" +CFLAGS+= -I${SRCTOP}/lib/libpkgconf -I${PKGCONFDIR} + +.PATH: ${PKGCONFDIR}/libpkgconf +.PATH: ${PKGCONFDIR}/man + +.include diff --git a/lib/libpkgconf/libpkgconf/config.h b/lib/libpkgconf/libpkgconf/config.h new file mode 100644 index 000000000000..49ae4a195137 --- /dev/null +++ b/lib/libpkgconf/libpkgconf/config.h @@ -0,0 +1,77 @@ +/* libpkgconf/config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the `strlcat' function. */ +#define HAVE_STRLCAT 1 + +/* Define to 1 if you have the `strlcpy' function. */ +#define HAVE_STRLCPY 1 + +/* Define to 1 if you have the `strndup' function. */ +#define HAVE_STRNDUP 1 + +/* Define to 1 if you have the `reallocarray' function. */ +#define HAVE_REALLOCARRAY 1 + +/* Define to 1 if you have the `strlcat' function. */ +#define HAVE_DECL_STRLCAT 1 + +/* Define to 1 if you have the `strlcpy' function. */ +#define HAVE_DECL_STRLCPY 1 + +/* Define to 1 if you have the `strndup' function. */ +#define HAVE_DECL_STRNDUP 1 + +/* Define to 1 if you have the `reallocarray' function. */ +#define HAVE_DECL_REALLOCARRAY 1 + +/* Define to 1 if you have the `pledge' function. */ +/* #undef HAVE_DECL_PLEDGE */ + +/* Define to 1 if you have the `unveil' function. */ +/* #undef HAVE_DECL_UNVEIL */ + +/* Name of package */ +#define PACKAGE "pkgconf" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "https://github.com/pkgconf/pkgconf/issues/new" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "pkgconf" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "pkgconf 2.5.1" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "pkgconf" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "2.5.1" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "2.5.1" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Number of bits in time_t, on hosts where this is settable. */ +/* #undef _TIME_BITS */ + +/* Enable Solaris extensions. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif diff --git a/share/mk/bsd.libnames.mk b/share/mk/bsd.libnames.mk index 9470e95c3036..bf6564afee38 100644 --- a/share/mk/bsd.libnames.mk +++ b/share/mk/bsd.libnames.mk @@ -137,6 +137,7 @@ LIBPANEL?= ${LIBDESTDIR}${LIBDIR_BASE}/libpanel.a LIBPANELW?= ${LIBDESTDIR}${LIBDIR_BASE}/libpanelw.a LIBPCAP?= ${LIBDESTDIR}${LIBDIR_BASE}/libpcap.a LIBPJDLOG?= ${LIBDESTDIR}${LIBDIR_BASE}/libpjdlog.a +LIBPKGCONF?= ${LIBDESTDIR}${LIBDIR_BASE}/libpkgconf.a LIBPMC?= ${LIBDESTDIR}${LIBDIR_BASE}/libpmc.a LIBPROC?= ${LIBDESTDIR}${LIBDIR_BASE}/libproc.a LIBPROCSTAT?= ${LIBDESTDIR}${LIBDIR_BASE}/libprocstat.a diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 388f9372abb0..aa3069b038f7 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -30,6 +30,7 @@ _PRIVATELIBS= \ kldelf \ ldns \ opencsd \ + pkgconf \ samplerate \ sqlite3 \ ssh \ diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 7230f729b3e3..506b36b3d4b0 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -157,6 +157,7 @@ __DEFAULT_YES_OPTIONS = \ PAM \ PF \ PKGBOOTSTRAP \ + PKGCONF \ PKGSERVE \ PMC \ PPP \ diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 3a45c7c9a01c..79d415163c87 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -6911,6 +6911,24 @@ OLD_FILES+=usr/share/snmp/defs/pf_tree.def OLD_FILES+=usr/share/snmp/mibs/BEGEMOT-PF-MIB.txt .endif +.if ${MK_PKGCONF} == no +OLD_FILES+=usr/bin/bomtool +OLD_FILES+=usr/bin/pkgconf +OLD_FILES+=usr/include/pkgconf/bsdstubs.h +OLD_FILES+=usr/include/pkgconf/iter.h +OLD_FILES+=usr/include/pkgconf/libpkgconf-api.h +OLD_FILES+=usr/include/pkgconf/libpkgconf.h +OLD_FILES+=usr/include/pkgconf/stdinc.h +OLD_DIRS+=usr/include/pkgconf +OLD_LIBS+=usr/lib/libprivatepkgconf.so +OLD_LIBS+=usr/lib/libprivatepkgconf.so.5 +OLD_FILES+=usr/share/man/man1/bomtool.1.gz +OLD_FILES+=usr/share/man/man1/pkgconf.1.gz +OLD_FILES+=usr/share/man/man5/pc.5.gz +OLD_FILES+=usr/share/man/man5/pkgconf-personality.5.gz +OLD_FILES+=usr/share/man/man7/pkg.m4.7.gz +.endif + .if ${MK_PKGSERVE} == no OLD_FILES+=usr/libexec/pkg-serve OLD_FILES+=usr/share/man/man8/pkg-serve.8.gz diff --git a/tools/build/options/WITHOUT_PKGCONF b/tools/build/options/WITHOUT_PKGCONF new file mode 100644 index 000000000000..dcf9e0821329 --- /dev/null +++ b/tools/build/options/WITHOUT_PKGCONF @@ -0,0 +1 @@ +Do not build the pkgconf binaries nor the libpkgconf library. diff --git a/tools/build/options/WITH_PKGCONF b/tools/build/options/WITH_PKGCONF new file mode 100644 index 000000000000..f34431bd04c6 --- /dev/null +++ b/tools/build/options/WITH_PKGCONF @@ -0,0 +1,5 @@ +Build the pkgconf binaries, +.Xr pkgconf 1 , +and +.Xr bomtool 1 , +and libpkgconf library (private). diff --git a/usr.bin/Makefile b/usr.bin/Makefile index 6ca784ef6cb6..6718286e7ddb 100644 --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -234,6 +234,8 @@ SUBDIR.${MK_NIS}+= ypcat SUBDIR.${MK_NIS}+= ypmatch SUBDIR.${MK_NIS}+= ypwhich SUBDIR.${MK_OPENSSH}+= ssh-copy-id +SUBDIR.${MK_PKGCONF}+= bomtool +SUBDIR.${MK_PKGCONF}+= pkgconf SUBDIR.${MK_QUOTAS}+= quota SUBDIR.${MK_SENDMAIL}+= vacation SUBDIR.${MK_SOUND}+= beep diff --git a/usr.bin/bomtool/Makefile b/usr.bin/bomtool/Makefile new file mode 100644 index 000000000000..f9471f35801b --- /dev/null +++ b/usr.bin/bomtool/Makefile @@ -0,0 +1,20 @@ +PACKAGE= pkgconf + +PROG= bomtool +SRCS= main.c +SRCS+= getopt_long.c + +LIBADD= pkgconf + +PKGCONFDIR= ${SRCTOP}/contrib/pkgconf + +CFLAGS+= -Wno-error=missing-variable-declarations +CFLAGS+= -Wno-error=incompatible-pointer-types-discards-qualifiers +CFLAGS+= -Wno-error=cast-qual +CFLAGS+= -I${SRCTOP}/lib/libpkgconf -I${PKGCONFDIR} -I${PKGCONFDIR}/cli + +.PATH: ${PKGCONFDIR}/cli/bomtool +.PATH: ${PKGCONFDIR}/cli +.PATH: ${PKGCONFDIR}/man + +.include diff --git a/usr.bin/pkgconf/Makefile b/usr.bin/pkgconf/Makefile new file mode 100644 index 000000000000..2155201ac883 --- /dev/null +++ b/usr.bin/pkgconf/Makefile @@ -0,0 +1,23 @@ +PACKAGE= pkgconf + +PROG= pkgconf +SRCS= main.c +SRCS+= getopt_long.c +SRCS+= renderer-msvc.c + +LIBADD= pkgconf + +SYMLINKS= pkgconf ${BINDIR}/pkg-config + +PKGCONFDIR= ${SRCTOP}/contrib/pkgconf + +CFLAGS+= -Wno-error=missing-variable-declarations +CFLAGS+= -Wno-error=incompatible-pointer-types-discards-qualifiers +CFLAGS+= -Wno-error=cast-qual +CFLAGS+= -DSYSTEM_INCLUDEDIR=\"/usr/include\" -DSYSTEM_LIBDIR=\"/usr/lib\" +CFLAGS+= -I${SRCTOP}/lib/libpkgconf -I${PKGCONFDIR} + +.PATH: ${PKGCONFDIR}/cli +.PATH: ${PKGCONFDIR}/man + +.include