The only recommended item still missing is @INTL_MACOSX_LIBS@, but to
take care of that we would need to update the way in which we
integrate gettext. We will do that (if at all) in a separate change.

* build-aux/gnulib_extra_libs.am: new file which defines
$(findutils_gnulib_extra_libs). This lists the libraries
the gnlib importer recommends be added to LDADD: $(CLOCK_TIME_LIB)
$(EUIDACCESS_LIBGEN) $(GETHOSTNAME_LIB) $(GETLOCALENAME_L_LIB)
$(HARD_LOCALE_LIB) $(LIBPTHREAD) $(LIBSOCKET) $(LIBTHREAD)
$(LIB_SELINUX) $(LIBC32CONV) $(LIBINTL) $(LIBUNISTRING) $(MBRTOWC_LIB)
$(MODF_LIBM) $(PTHREAD_ONCE_LIB) $(SETLOCALE_NULL_LIB) $(TRUNC_LIBM).
* find/Makefile.am: Add $(findutils_gnulib_extra_libs) to LDADD.
* locate/Makefile.am: Likewise.
* xargs/Makefile.am: Likewise.
* lib/Makefile.am: Likewise; and stop using regexprops_LDADD.
---
 build-aux/gnulib_extra_libs.am | 17 +++++++++++++++++
 find/Makefile.am               |  6 +++++-
 lib/Makefile.am                |  7 +++++--
 locate/Makefile.am             |  5 ++++-
 xargs/Makefile.am              |  7 ++++++-
 5 files changed, 37 insertions(+), 5 deletions(-)
 create mode 100644 build-aux/gnulib_extra_libs.am

diff --git a/build-aux/gnulib_extra_libs.am b/build-aux/gnulib_extra_libs.am
new file mode 100644
index 00000000..285601f8
--- /dev/null
+++ b/build-aux/gnulib_extra_libs.am
@@ -0,0 +1,17 @@
+## Copyright (C) 2026 Free Software Foundation, Inc.
+
+## This program is free software: you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation, either version 3 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+# Recommended by the gnulib importer
+findutils_gnulib_extra_libs = $(CLOCK_TIME_LIB) $(EUIDACCESS_LIBGEN) 
$(GETHOSTNAME_LIB) $(GETLOCALENAME_L_LIB) $(HARD_LOCALE_LIB) $(LIBPTHREAD) 
$(LIBSOCKET) $(LIBTHREAD) $(LIB_SELINUX) $(LIBC32CONV) $(LIBINTL) 
$(LTLIBUNISTRING) $(MBRTOWC_LIB) $(MODF_LIBM) $(PTHREAD_ONCE_LIB) 
$(SETLOCALE_NULL_LIB) $(TRUNC_LIBM)
diff --git a/find/Makefile.am b/find/Makefile.am
index d7ca2510..ef95ba85 100644
--- a/find/Makefile.am
+++ b/find/Makefile.am
@@ -14,6 +14,9 @@
 ## along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 AUTOMAKE_OPTIONS = std-options
+
+include $(top_srcdir)/build-aux/gnulib_extra_libs.am
+
 AM_CFLAGS = $(WARN_CFLAGS)
 localedir = $(datadir)/locale
 
@@ -28,7 +31,8 @@ man_MANS         = find.1
 
 EXTRA_DIST = defs.h sharefile.h print.h $(man_MANS)
 AM_CPPFLAGS = -I../gl/lib -I$(top_srcdir)/lib -I$(top_srcdir)/gl/lib 
-DLOCALEDIR=\"$(localedir)\"
-LDADD = libfindtools.a ../lib/libfind.a ../gl/lib/libgnulib.a $(LIBINTL) 
$(CLOCK_TIME_LIB) $(EUIDACCESS_LIBGEN) $(LIB_SELINUX) $(MODF_LIBM) $(FINDLIBS) 
$(GETHOSTNAME_LIB) $(EUIDACCESS_LIBGEN) $(SETLOCALE_NULL_LIB) $(MBRTOWC_LIB)
+LDADD = libfindtools.a ../lib/libfind.a ../gl/lib/libgnulib.a 
$(findutils_gnulib_extra_libs)
+
 # gnulib advises we link against <first> because we use <second>:
 # $(GETHOSTNAME_LIB)            uname
 # $(CLOCK_TIME_LIB)             gettime
diff --git a/lib/Makefile.am b/lib/Makefile.am
index cbf5ea99..2a6aec61 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -17,6 +17,9 @@
 
 AUTOMAKE_OPTIONS = 1.5 gnits
 # no-dependencies
+
+include $(top_srcdir)/build-aux/gnulib_extra_libs.am
+
 AM_CFLAGS = $(WARN_CFLAGS)
 
 noinst_LIBRARIES = libfind.a
@@ -24,7 +27,8 @@ noinst_LIBRARIES = libfind.a
 check_PROGRAMS = regexprops test_splitstring
 check_SCRIPTS = check-regexprops
 regexprops_SOURCES = regexprops.c regextype.c
-regexprops_LDADD = $(LDADD) $(SETLOCALE_NULL_LIB) $(MBRTOWC_LIB)
+
+LDADD = libfind.a ../gl/lib/libgnulib.a $(findutils_gnulib_extra_libs)
 
 TESTS =
 if CROSS_COMPILING
@@ -68,7 +72,6 @@ MAINTAINERCLEANFILES =
 
 
 AM_CPPFLAGS = -I../gl/lib -I$(top_srcdir)/gl/lib
-LDADD = ../gl/lib/libgnulib.a $(LIBINTL)
 
 CLEANFILES = check-regexprops
 
diff --git a/locate/Makefile.am b/locate/Makefile.am
index 25323358..e8510e7b 100644
--- a/locate/Makefile.am
+++ b/locate/Makefile.am
@@ -16,6 +16,9 @@
 ## along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 AUTOMAKE_OPTIONS = std-options
+
+include $(top_srcdir)/build-aux/gnulib_extra_libs.am
+
 AM_CFLAGS = $(WARN_CFLAGS)
 LOCATE_DB = $(localstatedir)/locatedb
 localedir = $(datadir)/locale
@@ -35,7 +38,7 @@ nodist_locate_TEXINFOS = dblocation.texi
 
 AM_CPPFLAGS = -I$(top_srcdir)/lib -I../gl/lib -I$(top_srcdir)/gl/lib 
-DLOCATE_DB=\"$(LOCATE_DB)\" -DLOCALEDIR=\"$(localedir)\"
 
-LDADD = ../lib/libfind.a ../gl/lib/libgnulib.a $(LIBINTL) 
$(SETLOCALE_NULL_LIB) $(MBRTOWC_LIB)
+LDADD = ../lib/libfind.a ../gl/lib/libgnulib.a $(findutils_gnulib_extra_libs)
 
 $(PROGRAMS) $(LIBPROGRAMS): ../lib/libfind.a ../gl/lib/libgnulib.a
 
diff --git a/xargs/Makefile.am b/xargs/Makefile.am
index 0722fa83..dbbae03c 100644
--- a/xargs/Makefile.am
+++ b/xargs/Makefile.am
@@ -14,12 +14,17 @@
 ## along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 AUTOMAKE_OPTIONS = std-options
+
+include $(top_srcdir)/build-aux/gnulib_extra_libs.am
+
+
 AM_CFLAGS = $(WARN_CFLAGS)
 localedir = $(datadir)/locale
 bin_PROGRAMS = xargs
 man_MANS = xargs.1
 AM_CPPFLAGS = -I.. -I../gl/lib -I$(top_srcdir)/gl/lib -I$(top_srcdir)/lib 
-DLOCALEDIR=\"$(localedir)\"
-LDADD = ../lib/libfind.a ../gl/lib/libgnulib.a $(LIBINTL) 
$(SETLOCALE_NULL_LIB) $(MBRTOWC_LIB)
+
+LDADD = ../lib/libfind.a ../gl/lib/libgnulib.a $(findutils_gnulib_extra_libs)
 EXTRA_DIST = $(man_MANS)
 SUBDIRS = . testsuite
 
-- 
2.47.3


Reply via email to