X-Git-Url: https://git.draconx.ca/gitweb/dxcommon.git/blobdiff_plain/90f9f764fa1d891ca8922f2fd0177ae44b1ed790..HEAD:/scripts/fix-ltdl.pl diff --git a/scripts/fix-ltdl.pl b/scripts/fix-ltdl.pl index 8065545..bd026c8 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, 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 @@ -61,8 +61,9 @@ sub handle_libobj { die if (!defined $am_dir_prefix); print <) { 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) @@ -132,6 +134,7 @@ EXTRA_LTLIBRARIES += $ltdl_dir/libobj.la ${am_dir_prefix}libobj_la_SOURCES = ${am_dir_prefix}libobj_la_CPPFLAGS = \$(AM_CPPFLAGS) \$(LTDL_CPPFLAGS) ${am_dir_prefix}libobj_la_LINK = false +${am_dir_prefix}libobj_la_SHORTNAME = lo EOF } @@ -140,6 +143,15 @@ EOF $_ = fixup_libobjs($_); } + # There is no reason to list $(LT_DLLOADERS) in noinst_LTLIBRARIES; + # these will be picked up as ordinary prerequisites. They're already + # all in EXTRA_LTLIBRARIES. + drop if (/^noinst_LTLIBRARIES.*\$\(LT_DLLOADERS\)$/); + + # Don't list other libs in noinst_LTLIBRARIES so that they don't get + # built unless explicitly required by prerequisites. + s/noinst_LTLIBRARIES/EXTRA_LTLIBRARIES/; + # BUILT_SOURCES has similar problems to recursive make: inadequate # dependencies lead to incorrect builds. Collect them into an # ordinary variable so we can deal with them later.