automake
[Top][All Lists]
Advanced

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

removing $seen_canonical


From: Derek R. Price
Subject: removing $seen_canonical
Date: Sat, 10 Feb 2001 00:13:42 -0500

I've removed the references to $seen_canonical, re one of the FIXME
comments on the way to enabling traces.  I know this patch is kinda
largish, but even if it doesn't get checked in yet, I'd like some
feedback.  This is somewhat integral to my work on traces.

Derek

--
Derek Price                      CVS Solutions Architect ( http://CVSHome.org )
mailto:address@hidden     OpenAvenue ( http://OpenAvenue.com )
Once Law was sitting on the bench
        And Mercy knelt a-weeping.
"Clear out!" he cried, "disordered wench!
        Nor come before me creeping.
Upon you knees if you appear,
'Tis plain you have no standing here."

Then Justice came.  His Honor cried:
        "YOUR states? -- Devil seize you!"
"Amica curiae," she replied --
        "Friend of the court, so please you."
"Begone!" he shouted -- "There's the door --
I never saw your face before!"
                -- Ambrose Bierce, "The Devil's Dictionary"


Index: ChangeLog
===================================================================
RCS file: /cvs/automake/automake/ChangeLog,v
retrieving revision 1.1014
diff -u -r1.1014 ChangeLog
--- ChangeLog   2001/02/10 01:26:54     1.1014
+++ ChangeLog   2001/02/10 05:06:50
@@ -1,3 +1,7 @@
+2001-02-10  Derek Price  <address@hidden>
+
+       * automake.in: Replace $seen_canonical with %configure_vars.
+
 2001-02-09  Raja R Harinath  <address@hidden>
 
        * depcomp (gcc3): Propagate exit code.
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.872
diff -u -r1.872 automake.in
--- automake.in 2001/02/09 07:06:53     1.872
+++ automake.in 2001/02/10 05:06:54
@@ -191,10 +191,6 @@
 # TRUE if AC_DECL_YYTEXT was seen.
 $seen_decl_yytext = 0;
 
-# TRUE if we've seen AC_CANONICAL_(HOST|SYSTEM).  The presence of
-# AC_CHECK_TOOL also sets this.
-$seen_canonical = 0;
-
 # TRUE if we've seen AC_ARG_PROGRAM.
 $seen_arg_prog = 0;
 
@@ -606,10 +602,14 @@
                                           @libtoolize_files)
            if $seen_libtool;
 
-        # AC_CANONICAL_HOST and AC_CANONICAL_SYSTEM need config.guess and
-        # config.sub.
+       # AC_CANONICAL_BUILD, AC_CANONICAL_HOST, and
+       # AC_CANONICAL_(SYSTEM|TARGET) need config.guess and config.sub.
+       #
+       # FIXME - When traces is enabled, only 'build' need be checked here
+       # since AC_CANONICAL_BUILD is required by AC_CANONICAL_HOST, which is
+       # required by AC_CANONICAL_TARGET, as of AC 2.50..
         &require_config_file ($FOREIGN, 'config.guess', 'config.sub')
-           if $seen_canonical;
+           if $configure_vars{'build'} || $configure_vars{'host'};
     }
 
     # We still need Makefile.in here, because sometimes the `dist'
@@ -3932,29 +3932,18 @@
                           . "address@hidden 'set tool \$(DEJATOOL)' >> 
address@hidden"
                           . "address@hidden 'set srcdir \$(srcdir)' >> 
address@hidden"
                           . "address@hidden 'set objdir' \`pwd\` >> 
address@hidden");
-
-        # Extra stuff for AC_CANONICAL_*
-        local (@whatlist) = ();
-        if ($seen_canonical)
-        {
-            push (@whatlist, 'host');
-        }
 
-        # Extra stuff only for AC_CANONICAL_SYSTEM.
-        if ($seen_canonical == $AC_CANONICAL_SYSTEM)
+       my $c;
+       foreach $c ('build', 'host', 'target')
         {
-            push (@whatlist, 'target', 'build');
+           # Maybe an error message if both of these are not set is a good
+           # idea?  It might be overkill.
+           $output_rules .= "address@hidden 'set ${c}_triplet \$(${c})' >> 
address@hidden"
+               if defined $configure_vars{$c};
+           $output_rules .= "address@hidden 'set ${c}_alias \$(${c}_alias})' 
>> address@hidden"
+               if defined $configure_vars{"${c}_alias"};
         }
 
-        local ($c1, $c2);
-        foreach $c1 (@whatlist)
-        {
-            foreach $c2 ('alias', 'triplet')
-            {
-                $output_rules .= "address@hidden 'set ${c1}_${c2} 
\$(${c1}_${c2})' >> address@hidden";
-            }
-        }
-
         $output_rules .= ("address@hidden '## All variables above are 
generated by configure. Do Not Edit ##' >> address@hidden"
                           . "address@hidden ! -f site.exp || sed '1,/^## All 
variables above are.*##/ d' site.exp >> address@hidden"
                           . "address@hidden ! -f site.exp || mv site.exp 
site.bak\n"
@@ -4228,6 +4217,21 @@
 }
 
 
+
+# &found_ac_canonical_x ($x, $where)
+# ----------------------------------
+# Helper function which sets %configure_vars for an AC_CANONICAL_* invocation
+sub found_ac_canonical_x
+{
+    my $c;
+    foreach $c ('', '_alias', '_cpu', '_vendor', '_os')
+    {
+       $configure_vars{$_[0] . $c} = $_[1];
+    }
+}
+
+
+
 # &scan_one_autoconf_file ($FILENAME)
 # -----------------------------------
 # Scan one file for interesting things.  Subroutine of
@@ -4444,12 +4448,25 @@
            }
        }
 
-        # Handle AC_CANONICAL_*.  Always allow upgrading to
-        # AC_CANONICAL_SYSTEM, but never downgrading.
-       $seen_canonical = $AC_CANONICAL_HOST
-           if ! $seen_canonical
-               && (/AC_CANONICAL_HOST/ || /AC_CHECK_TOOL/);
-        $seen_canonical = $AC_CANONICAL_SYSTEM if /AC_CANONICAL_SYSTEM/;
+       # Handle AC_CANONICAL_*.
+       #
+       # This is kinda broken, or maybe just not optimized, under Autoconf
+       # 2.50 since then AC_CANONICAL_HOST requires AC_CANONICAL_BUILD.  The
+       # reason I say maybe just not optimized is that if we really only care
+       # about HOST or SYSTEM, like the old code did and like I assume works
+       # with 2.13, then the following code should still work.
+       #
+       # The "fix" under 2.50 is to enable amtraces.
+       &found_ac_canonical_x ('build', $filename . ':' . $.) 
+           if /AC_CANONICAL_BUILD/;
+       &found_ac_canonical_x ('host', $filename . ':' . $.) 
+           if /AC_CANONICAL_HOST/ || /AC_CHECK_TOOL/;
+       if (/AC_CANONICAL_SYSTEM/ || /AC_CANONICAL_TARGET/)
+       {
+           &found_ac_canonical_x ('build', $filename . ':' . $.);
+           &found_ac_canonical_x ('host', $filename . ':' . $.);
+           &found_ac_canonical_x ('target', $filename . ':' . $.);
+       }
 
        $seen_path_xtra = 1 if /AC_PATH_XTRA/;
 
@@ -4540,9 +4557,8 @@
            $configure_vars{'LIBTOOL'} = $filename . ':' . $.;
            $configure_vars{'RANLIB'} = $filename . ':' . $.;
            $configure_vars{'CC'} = $filename . ':' . $.;
-           # AC_PROG_LIBTOOL runs AC_CANONICAL_HOST.  Make sure we
-           # never downgrade (if we've seen AC_CANONICAL_SYSTEM).
-           $seen_canonical = $AC_CANONICAL_HOST if ! $seen_canonical;
+           # AC_PROG_LIBTOOL runs AC_CANONICAL_HOST.
+           &found_ac_canonical_x('host', $filename . ':' . $.);
        }
 
        $seen_multilib = 1 if (/AM_ENABLE_MULTILIB/);
@@ -6400,27 +6416,6 @@
         &file_contents ('header-vars',
                        &transform ('top_builddir' => $top_builddir));
 
-    # Generate some useful variables when AC_CANONICAL_* used.  FIXME:
-    # this should use generic %configure_vars method.
-    if ($seen_canonical)
-    {
-       local ($curs, %vars);
-       $vars{'host_alias'} = 'host_alias';
-       $vars{'host_triplet'} = 'host';
-       if ($seen_canonical == $AC_CANONICAL_SYSTEM)
-       {
-           $vars{'build_alias'} = 'build_alias';
-           $vars{'build_triplet'} = 'build';
-           $vars{'target_alias'} = 'target_alias';
-           $vars{'target_triplet'} = 'target';
-       }
-       foreach $curs (sort keys %vars)
-       {
-           $output_vars .= "$curs = address@hidden@\n";
-           $contents{$curs} = "address@hidden@";
-       }
-    }
-
     local ($curs);
     foreach $curs (sort keys %configure_vars)
     {
@@ -6523,10 +6518,6 @@
 
 sub initialize_global_constants
 {
-    # Values for AC_CANONICAL_*
-    $AC_CANONICAL_HOST = 1;
-    $AC_CANONICAL_SYSTEM = 2;
-
     # Associative array of standard directory names.  Entry is TRUE if
     # corresponding directory should be installed during
     # 'install-exec' phase.

reply via email to

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