]> git.draconx.ca Git - dxcommon.git/commitdiff
fix-ltdl: Fix order-only hack with HP-UX make.
authorNick Bowler <nbowler@draconx.ca>
Sat, 26 Feb 2022 20:26:58 +0000 (15:26 -0500)
committerNick Bowler <nbowler@draconx.ca>
Sat, 26 Feb 2022 20:26:58 +0000 (15:26 -0500)
HP-UX make gets confused by the space in $(findstring ...,$(...))
syntax: instead of expanding to the empty string as desired, it
mismatches the parentheses and we are left with a single ).  E.g.:

  % cat >Makefile <<'EOF'
  all:
@echo '$(a $(b))'
EOF
  % make
  )

Since $(x) and ${x} are equivalent in Make, a neat solution is to
just replace one set of parentheses with braces; now there are no
nested parentheses to mismatch in the first place.

scripts/fix-ltdl.pl

index f65265dfaf8ad05d53801bc5b6b41b8b37c9b030..cfd05457aebbe7c7d0020e0169d7bc6553877c50 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env perl
 #
-# Copyright © 2012, 2014 Nick Bowler
+# Copyright © 2012, 2014, 2022 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
@@ -99,7 +99,7 @@ while (<STDIN>) {
                print <<'EOF';
 # This trick should define ltdl_orderonly to | iff we're using GNU make.
 ltdl_make_features = $(.FEATURES)
-ltdl_have_orderonly = $(findstring order-only,$(ltdl_make_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)