# 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;
\f
&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
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;
# 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;
}
}
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");
# 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
# 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.
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 '';
sub lang_header_rewrite
{
# Header files are simply ignored.
- return $LANG_IGNORE;
+ return LANG_IGNORE;
}
# Rewrite a single yacc file.
# 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.
# 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