automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: more constants


From: Alexandre Duret-Lutz
Subject: FYI: more constants
Date: 27 Jun 2002 21:31:14 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

I'm checking in this on HEAD.

2002-06-27  Alexandre Duret-Lutz  <address@hidden>

        * automake.in (LANG_IGNORE, LANG_PROCESS, LANG_SUBDIR,
        COMPILE_LIBTOOL, COMPILE_ORDINARY): Redefine as constants.
        Adjust all occurrences.

Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1311
diff -u -r1.1311 automake.in
--- automake.in 27 Jun 2002 19:19:46 -0000      1.1311
+++ automake.in 27 Jun 2002 19:29:13 -0000
@@ -239,14 +239,14 @@
 # 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 @@
             &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 @@
             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 @@
 
             # 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 @@
         }
 
        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 @@
 # 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 @@
 # 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 @@
        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_header_rewrite
 {
     # Header files are simply ignored.
-    return $LANG_IGNORE;
+    return LANG_IGNORE;
 }
 
 # Rewrite a single yacc file.
@@ -5021,19 +5021,19 @@
 # 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 @@
 # 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
-- 
Alexandre Duret-Lutz




reply via email to

[Prev in Thread] Current Thread [Next in Thread]