From: Tom Tromey Date: Thu, 30 Nov 1995 00:32:56 +0000 (+0000) Subject: (am_variable): New function. X-Git-Tag: Release-0-25~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f619748a238fa8a97bc2955ee54d3614c04d91ae;p=thirdparty%2Fautomake.git (am_variable): New function. (handle_texinfo): Use it. (generate_makefile): Use it. --- diff --git a/automake.in b/automake.in index bdf78d564..dee0c4023 100755 --- a/automake.in +++ b/automake.in @@ -248,21 +248,11 @@ sub generate_makefile &read_am_file ($makefile . '.am'); # Program stuff. - local ($programs) = (defined ($contents{'AM_PROGRAMS'}) - ? $contents{'AM_PROGRAMS'} - : $contents{'PROGRAMS'}); - local ($libprograms) = (defined ($contents{'AM_LIBPROGRAMS'}) - ? $contents{'AM_LIBPROGRAMS'} - : $contents{'LIBPROGRAMS'}); - local ($libraries) = (defined ($contents{'AM_LIBRARIES'}) - ? $contents{'AM_LIBRARIES'} - : $contents{'LIBRARIES'}); - local ($scripts) = (defined ($contents{'AM_SCRIPTS'}) - ? $contents{'AM_SCRIPTS'} - : $contents{'SCRIPTS'}); - local ($libscripts) = (defined ($contents{'AM_LIBSCRIPTS'}) - ? $contents{'AM_LIBSCRIPTS'} - : $contents{'LIBSCRIPTS'}); + local ($programs) = &am_variable ('PROGRAMS'); + local ($libprograms) = &am_variable ('AM_LIBPROGRAMS'); + local ($libraries) = &am_variable ('AM_LIBRARIES'); + local ($scripts) = &am_variable ('AM_SCRIPTS'); + local ($libscripts) = &am_variable ('AM_LIBSCRIPTS'); &handle_programs ($programs, $libprograms, $libraries); &handle_scripts ($scripts, $libscripts); @@ -503,9 +493,10 @@ sub handle_scripts # Handle all Texinfo source. sub handle_texinfo { - return if (! defined $contents{TEXINFOS}); + local ($texis) = &am_variable ('TEXINFOS'); + return if (!$texis); - local (@texis) = split (' ', $contents{TEXINFOS}); + local (@texis) = split (' ', $texis); if ($#texis > 0) { print STDERR "automake: sorry, only one file allowed in \`TEXINFOS'\n"; @@ -1187,6 +1178,17 @@ sub file_contents return $results; } +# Return contents of some Makefile.am variable. Allow for AM_ style +# overrides. +sub am_variable +{ + local ($varname) = @_; + + return (defined ($contents{'AM_' . $varname}) + ? $contents{'AM_' . $varname} + : $contents{$varname}); +} + ################################################################ # Verify that the file must exist in the current directory.