From 3449836571833dec092ceb3edfdce24cf88f81dd Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Sat, 22 Nov 2014 12:15:48 -0500 Subject: [PATCH] fix-ltdl: Fix order-only hack with FreeBSD make. FreeBSD make does not work well when undefined variables are used in nested expansions. When such an expansion appears in the prerequisites of a target, FreeBSD make exits with a fatal error. For example: A = $(var$(B)) foo : $(A) % make Error expanding embedded variable. This causes the order-only hack to fail because FreeBSD make does not define .FEATURES. The workaround is simple: add another variable which is assigned the value of .FEATURES. That variable can be used in the nested expansion to avoid the error. --- scripts/fix-ltdl.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/fix-ltdl.pl b/scripts/fix-ltdl.pl index 7dd1c8b..f65265d 100755 --- a/scripts/fix-ltdl.pl +++ b/scripts/fix-ltdl.pl @@ -1,6 +1,6 @@ #!/usr/bin/env perl # -# Copyright © 2012 Nick Bowler +# Copyright © 2012, 2014 Nick Bowler # # Fixup a non-recursive libltdl makefile fragment. While libltdl purports to # support inclusion into non-recursive automake builds, it does a few things @@ -98,7 +98,8 @@ while () { print "# Postprocessed by ", basename($0), "\n"; print <<'EOF'; # This trick should define ltdl_orderonly to | iff we're using GNU make. -ltdl_have_orderonly = $(findstring order-only,$(.FEATURES)) +ltdl_make_features = $(.FEATURES) +ltdl_have_orderonly = $(findstring order-only,$(ltdl_make_features)) ltdl_orderonly = $(ltdl_have_orderonly:order-only=|) ltdl_core_headers = ltdl_src_headers = $(ltdl_orderonly) $(ltdl_core_headers) -- 2.43.0