There is a small omission in bash 5.0's build infrastructure:
The CPPFLAGS variable doesn't propagate to the actual compiler flags
used to build the loadables. In practice, this means that the seq
loadable will fail to build on operating systems that have libintl
outside the default paths (e.g. OpenBSD with GNU gettext in /usr/local):
cc -fPIC -DHAVE_CONFIG_H -DSHELL -DDEV_FD_STAT_BROKEN -O2 -pipe
-Wno-parentheses -Wno-format-security -I. -I.. -I../.. -I../../lib
-I../../builtins -I. -I../../include -I/usr/obj/bash-5.0.2/bash-5.0
-I/usr/obj/bash-5.0.2/bash-5.0/lib -I/usr/obj/bash-5.0.2/bash-5.0/builtins -c
-o seq.o seq.c
In file included from seq.c:32:
In file included from ../../bashintl.h:30:
../../include/gettext.h:27:11: fatal error: 'libintl.h' file not found
# include <libintl.h>
^~~~~~~~~~~
1 error generated.
Trivial fix:
Index: examples/loadables/Makefile.in
--- examples/loadables/Makefile.in.orig
+++ examples/loadables/Makefile.in
@@ -76,7 +76,7 @@ INTL_BUILDDIR = ${LIBBUILD}/intl
INTL_INC = @INTL_INC@
LIBINTL_H = @LIBINTL_H@
-CCFLAGS = $(DEFS) $(LOCAL_DEFS) $(LOCAL_CFLAGS) $(CFLAGS)
+CCFLAGS = $(DEFS) $(LOCAL_DEFS) $(LOCAL_CFLAGS) $(CPPFLAGS) $(CFLAGS)
#
# These values are generated for configure by ${topdir}/support/shobj-conf.
--
Christian "naddy" Weisgerber [email protected]