From 69dd1687944916e21fa520b4b87061a5dbeceab2 Mon Sep 17 00:00:00 2001 From: Matthias Paulmier Date: Mon, 4 Jun 2018 17:13:03 +0200 Subject: Utils.pm: Add more utility methods * subst: Method to get a configure-style substitute from a text * file_contents_internal: Return the contents of a file from automake/lib/am. This is a long method that will need some reworking later. --- bin/automake.in | 14 -------------- lib/Automake/Utils.pm | 16 +++++++++++++++- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/bin/automake.in b/bin/automake.in index 480e69f02..e119d9ca1 100755 --- a/bin/automake.in +++ b/bin/automake.in @@ -612,20 +612,6 @@ sub msg_ac ################################################################ -# subst ($TEXT) -# ------------- -# Return a configure-style substitution using the indicated text. -# We do this to avoid having the substitutions directly in automake.in; -# when we do that they are sometimes removed and this causes confusion -# and bugs. -sub subst -{ - my ($text) = @_; - return '@' . $text . '@'; -} - -################################################################ - # $BACKPATH # backname ($RELDIR) diff --git a/lib/Automake/Utils.pm b/lib/Automake/Utils.pm index e1cd46337..832b74e05 100644 --- a/lib/Automake/Utils.pm +++ b/lib/Automake/Utils.pm @@ -20,11 +20,13 @@ use strict; use Exporter; use Automake::Rule; use Automake::Global; +use Automake::Location; +use Automake::Condition; use vars qw (@ISA @EXPORT); @ISA = qw (Exporter); -@EXPORT = qw (&var_SUFFIXES_trigger &locate_aux_dir); +@EXPORT = qw (var_SUFFIXES_trigger locate_aux_dir subst); # var_SUFFIXES_trigger ($TYPE, $VALUE) # ------------------------------------ @@ -66,4 +68,16 @@ sub locate_aux_dir $am_config_aux_dir =~ s,/*$,,; } +# subst ($TEXT) +# ------------- +# Return a configure-style substitution using the indicated text. +# We do this to avoid having the substitutions directly in automake.in; +# when we do that they are sometimes removed and this causes confusion +# and bugs. +sub subst ($) +{ + my ($text) = @_; + return '@' . $text . '@'; +} + 1; -- cgit v1.2.1