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.
#!/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
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)