From 23f61447fbb0e8aa6aeffad009acd3b174c5cd24 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Thu, 27 Jun 2002 19:31:58 +0000 Subject: [PATCH] * automake.in (LANG_IGNORE, LANG_PROCESS, LANG_SUBDIR, COMPILE_LIBTOOL, COMPILE_ORDINARY): Redefine as constants. Adjust all occurrences. --- ChangeLog | 6 ++++++ automake.in | 42 +++++++++++++++++++++--------------------- 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 556964e8..29a1ad0e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-06-27 Alexandre Duret-Lutz + + * automake.in (LANG_IGNORE, LANG_PROCESS, LANG_SUBDIR, + COMPILE_LIBTOOL, COMPILE_ORDINARY): Redefine as constants. + Adjust all occurrences. + 2002-06-27 Alexandre Duret-Lutz * aclocal.in: Add local variables so that Emacs setups GNU style diff --git a/automake.in b/automake.in index 5c2bdcc8..8a64ed0e 100755 --- a/automake.in +++ b/automake.in @@ -239,14 +239,14 @@ my $gen_copyright = "\ # LANG_SUBDIR means that the resulting object file should be in a # subdir if the source file is. In this case the file name cannot # have `..' components. -my $LANG_IGNORE = 0; -my $LANG_PROCESS = 1; -my $LANG_SUBDIR = 2; +use constant LANG_IGNORE => 0; +use constant LANG_PROCESS => 1; +use constant LANG_SUBDIR => 2; # These are used when keeping track of whether an object can be built # by two different paths. -my $COMPILE_LIBTOOL = 1; -my $COMPILE_ORDINARY = 2; +use constant COMPILE_LIBTOOL => 1; +use constant COMPILE_ORDINARY => 2; @@ -1918,7 +1918,7 @@ sub handle_single_transform_list ($$$$@) &saw_extension ($extension); # Note: computed subr call. The language rewrite function - # should return one of the $LANG_* constants. It could + # should return one of the LANG_* constants. It could # also return a list whose first value is such a constant # and whose second value is a new source extension which # should be applied. This means this particular language @@ -1928,7 +1928,7 @@ sub handle_single_transform_list ($$$$@) my ($r, $source_extension) = & $subr ($directory, $base, $extension); # Skip this entry if we were asked not to process it. - next if $r == $LANG_IGNORE; + next if $r == LANG_IGNORE; # Now extract linker and other info. $linker = $lang->linker; @@ -1987,7 +1987,7 @@ sub handle_single_transform_list ($$$$@) # If rewrite said it was ok, put the object into a # subdir. - if ($r == $LANG_SUBDIR && $directory ne '') + if ($r == LANG_SUBDIR && $directory ne '') { $object = $directory . '/' . $object; } @@ -2057,13 +2057,13 @@ sub handle_single_transform_list ($$$$@) } my $comp_val = (($object =~ /\.lo$/) - ? $COMPILE_LIBTOOL : $COMPILE_ORDINARY); + ? COMPILE_LIBTOOL : COMPILE_ORDINARY); (my $comp_obj = $object) =~ s/\.lo$/.\$(OBJEXT)/; if (defined $object_compilation_map{$comp_obj} && $object_compilation_map{$comp_obj} != 0 # Only see the error once. && ($object_compilation_map{$comp_obj} - != ($COMPILE_LIBTOOL | $COMPILE_ORDINARY)) + != (COMPILE_LIBTOOL | COMPILE_ORDINARY)) && $object_compilation_map{$comp_obj} != $comp_val) { am_error ("object `$object' created both with libtool and without"); @@ -4900,9 +4900,9 @@ sub check_gnits_standards # Functions to handle files of each language. # Each `lang_X_rewrite($DIRECTORY, $BASE, $EXT)' function follows a -# simple formula: Return value is $LANG_SUBDIR if the resulting object -# file should be in a subdir if the source file is, $LANG_PROCESS if -# file is to be dealt with, $LANG_IGNORE otherwise. +# simple formula: Return value is LANG_SUBDIR if the resulting object +# file should be in a subdir if the source file is, LANG_PROCESS if +# file is to be dealt with, LANG_IGNORE otherwise. # Much of the actual processing is handled in # handle_single_transform_list. These functions exist so that @@ -4914,7 +4914,7 @@ sub check_gnits_standards # when a subdir object should be used. sub lang_sub_obj { - return defined $options{'subdir-objects'} ? $LANG_SUBDIR : $LANG_PROCESS; + return defined $options{'subdir-objects'} ? LANG_SUBDIR : LANG_PROCESS; } # Rewrite a single C source file. @@ -4928,10 +4928,10 @@ sub lang_c_rewrite am_error ("C source file `$base.c' would be deleted by ansi2knr rules"); } - my $r = $LANG_PROCESS; + my $r = LANG_PROCESS; if (defined $options{'subdir-objects'}) { - $r = $LANG_SUBDIR; + $r = LANG_SUBDIR; $base = $directory . '/' . $base unless $directory eq '.' || $directory eq ''; @@ -4969,7 +4969,7 @@ sub lang_cxx_rewrite sub lang_header_rewrite { # Header files are simply ignored. - return $LANG_IGNORE; + return LANG_IGNORE; } # Rewrite a single yacc file. @@ -5021,19 +5021,19 @@ sub lang_asm_rewrite # Rewrite a single Fortran 77 file. sub lang_f77_rewrite { - return $LANG_PROCESS; + return LANG_PROCESS; } # Rewrite a single preprocessed Fortran 77 file. sub lang_ppf77_rewrite { - return $LANG_PROCESS; + return LANG_PROCESS; } # Rewrite a single ratfor file. sub lang_ratfor_rewrite { - return $LANG_PROCESS; + return LANG_PROCESS; } # Rewrite a single Objective C file. @@ -5045,7 +5045,7 @@ sub lang_objc_rewrite # Rewrite a single Java file. sub lang_java_rewrite { - return $LANG_SUBDIR; + return LANG_SUBDIR; } # The lang_X_finish functions are called after all source file -- 2.43.5