FreeBSD 9: make: Error expanding embedded variable

Christian Weisgerber naddy at mips.inka.de
Sat Sep 19 22:30:09 UTC 2015


The po/Makefile.in.in file shipped with gettext 0.19 triggers a bug
in the old make(1) on FreeBSD 9 that causes this cryptic error:

Error expanding embedded variable.

A minimal Makefile to reproduce the problem is this:

FOO =
BAR = $(FOO$(BAZ))
all: $(BAR)

The bug no longer exists in bmake.

If you google for the error message, you'll find the advice "use
gmake", which is not particularly appropriate in this case, since
po/Makefile.in.in is portable and does not use any gmake features.

The po/Makefile.in.in that ships with gettext is copied into a
zillion projects.  I ran into the problem when pkg-fallout sent me
a report about my recent archivers/gcpio update.  I expect the
problem to spread, as projects start using newer versions of this
file.

Here's the fix I used:

--- po/Makefile.in.in.orig	2015-09-12 10:51:46 UTC
+++ po/Makefile.in.in
@@ -80,6 +80,7 @@ CATALOGS = @CATALOGS@
 POFILESDEPS_ = $(srcdir)/$(DOMAIN).pot
 POFILESDEPS_yes = $(POFILESDEPS_)
 POFILESDEPS_no =
+PO_DEPENDS_ON_POT =
 POFILESDEPS = $(POFILESDEPS_$(PO_DEPENDS_ON_POT))
 
 DISTFILESDEPS_ = update-po
-- 
Christian "naddy" Weisgerber                          naddy at mips.inka.de


More information about the freebsd-ports mailing list