automake
[Top][All Lists]
Advanced

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

Re: DIST_COMMON broke


From: Derek R. Price
Subject: Re: DIST_COMMON broke
Date: Wed, 07 Feb 2001 19:04:46 -0500

Tom Tromey wrote:

> >>>>> "Derek" == Derek R Price <address@hidden> writes:
>
> Derek> Also, looking at this area of the code reminds me that I sent
> Derek> a, unfortunately largish, patch in something over a month ago
> Derek> that hasn't been reviewed to my knowledge.  The patch was
> Derek> intended to fix a misplaced depcomp file (a bug which is still
> Derek> present in the current CVS Automake, I might add), but I had
> Derek> also ended up removing all the "special case '.'" bugs the code
> Derek> is littered with FIXME comments about (especially around the
> Derek> &require_file_* functions).
>
> Yeah, I still have a few of your patches sitting in my mailbox.

Well, when you get around to it, this one should take the place of my
last depcomp patch.  I fixed tests/depcomp, tidied the ChangeLog based on
the standards and practices Raja & Akim made me aware of, and merged the
rest with the current CVS Autoconf.

ChangeLog entry:

        * automake.in (require_file_with_conf_line,
        require_file_with_line, require_file): Pass a @require_file_path
        of $relative_dir instead of '.' to require_file_internal so that
        all the special casing of '.' can be removed elsewhere.
        (require_config_file, require_conf_file_with_line,
        require_conf_file_with_conf_line): Remove special casing for '.'
        and make sure $config_aux_dir is maintained properly.
        (require_file_internal): Remove special casing of '.' and set
        @require_file_path when missing files are added.
        (maybe_push_required_file): Remove special casing of '.'
        (handle_dependencies): Remove a workaround for a bug now fixed
        and remove $config_aux_dir special casing.
        (handle_configure): Remove special casing for $config_aux_dir
        (handle_python): Ditto.
        (yacc_lex_finish_helper): Change $config_aux_dir switch to
        switch on the value of $config_aux_dir_set_in_configure_in.
        (handle_texinfo): Ditto.
        (scan_one_configure_file): Set $config_aux_dir and
        $config_aux_dir_set_in_configure_in properly so special casing
        on the value of $config_aux_dir can be removed elsewhere.

        * tests/depcomp.test: New file.
        * tests/confsub.test: Look for depcomp in $(top_srcdir) instead
of the
        first subdir containing a C file.
        * tests/libobj2.test: Ditto.
        * tests/Makefile.am (TESTS): Added 'depcomp.test'.

Derek

--
Derek Price                      CVS Solutions Architect ( http://CVSHome.org )
mailto:address@hidden     OpenAvenue ( http://OpenAvenue.com )
--
I will not aim for the head.
I will not aim for the head.
I will not aim for the head...

          - Bart Simpson on chalkboard, _The Simpsons_


Index: ChangeLog
===================================================================
RCS file: /cvs/automake/automake/ChangeLog,v
retrieving revision 1.1001
diff -u -r1.1001 ChangeLog
--- ChangeLog   2001/02/07 21:51:39     1.1001
+++ ChangeLog   2001/02/07 23:27:58
@@ -522,6 +522,35 @@
        * automake.in (handle_ltlibraries): Allow _LDFLAGS to be
        conditionally defined.  Fixes PR automake/77 and ldflags.test.
 
+2000-12-05  Derek Price  <address@hidden>
+
+       * automake.in (require_file_with_conf_line,
+       require_file_with_line, require_file): Pass a @require_file_path
+       of $relative_dir instead of '.' to require_file_internal so that
+       all the special casing of '.' can be removed elsewhere.
+       (require_config_file, require_conf_file_with_line,
+       require_conf_file_with_conf_line): Remove special casing for '.'
+       and make sure $config_aux_dir is maintained properly.
+       (require_file_internal): Remove special casing of '.' and set
+       @require_file_path when missing files are added.
+       (maybe_push_required_file): Remove special casing of '.'
+       (handle_dependencies): Remove a workaround for a bug now fixed
+       and remove $config_aux_dir special casing.
+       (handle_configure): Remove special casing for $config_aux_dir
+       (handle_python): Ditto.
+       (yacc_lex_finish_helper): Change $config_aux_dir switch to
+       switch on the value of $config_aux_dir_set_in_configure_in.
+       (handle_texinfo): Ditto.
+       (scan_one_configure_file): Set $config_aux_dir and
+       $config_aux_dir_set_in_configure_in properly so special casing
+       on the value of $config_aux_dir can be removed elsewhere.
+
+       * tests/depcomp.test: New file.
+       * tests/confsub.test: Look for depcomp in $(top_srcdir) instead of the
+       first subdir containing a C file.
+       * tests/libobj2.test: Ditto.
+       * tests/Makefile.am (TESTS): Added 'depcomp.test'.
+
 2000-11-25  Tom Tromey  <address@hidden>
 
        * automake.in (file_contents_with_transform): Added file name and
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.866
diff -u -r1.866 automake.in
--- automake.in 2001/02/07 21:15:05     1.866
+++ automake.in 2001/02/07 23:28:02
@@ -166,6 +166,7 @@
 # can be set by AC_CONFIG_AUX_DIR.
 @config_aux_path = ('.', '..', '../..');
 $config_aux_dir = '';
+$config_aux_dir_set_in_configure_in = 0;
 
 # Whether AC_PROG_MAKE_SET has been seen in configure.ac.
 $seen_make_set = 0;
@@ -2267,14 +2268,14 @@
                                          'mdate-sh');
 
            local ($conf_dir);
-           if ($config_aux_dir eq '.' || $config_aux_dir eq '')
+           if ($config_aux_dir_set_in_configure_in)
            {
-               $conf_dir = '$(srcdir)/';
+               $conf_dir = $config_aux_dir;
+               $conf_dir .= '/' unless $conf_dir =~ /\/$/;
            }
            else
            {
-               $conf_dir = $config_aux_dir;
-               $conf_dir .= '/' unless $conf_dir =~ /\/$/;
+               $conf_dir = '$(srcdir)/';
            }
            $output_rules .=
                &file_contents ('texi-vers',
@@ -2354,7 +2355,7 @@
        &define_variable ('TEXINFO_TEX', "$texinfodir/texinfo.tex");
 
     }
-    elsif ($config_aux_dir ne '.' && $config_aux_dir ne '')
+    elsif ($config_aux_dir_set_in_configure_in)
     {
         $texinfodir = $config_aux_dir;
        &define_variable ('TEXINFO_TEX', "$texinfodir/texinfo.tex");
@@ -2983,24 +2984,9 @@
        # be empty.
        if (&saw_sources_p (0) && keys %dep_files)
        {
-           local ($config_aux_dir_specified) = ($config_aux_dir ne '.'
-                                                && $config_aux_dir ne '');
-
-           # Set $require_file_found{'depcomp'} if the depcomp file exists,
-           # before calling require_config_file on `depcomp'.  This makes
-           # require_file_internal skip its buggy existence test that would
-           # make automake fail (with `required file `lib/depcomp' not found')
-           # when AC_CONFIG_AUX_DIR is not set.  See tests/subdir4.test.
-           local ($depcomp_dir) = ($config_aux_dir_specified ? $config_aux_dir
-                                   : '.');
-           $require_file_found{'depcomp'} = 1 if -f "$depcomp_dir/depcomp";
-
            # Set location of depcomp.
-           local ($prefix) = ($config_aux_dir_specified ? $config_aux_dir
-                              : '$(top_srcdir)');
+           &define_variable ('depcomp', "\$(SHELL) $config_aux_dir/depcomp");
 
-           &define_variable ('depcomp', "\$(SHELL) $prefix/depcomp");
-
            &require_config_file ($FOREIGN, 'depcomp');
 
            local ($iter);
@@ -3402,16 +3388,7 @@
     }
 
     # Set location of mkinstalldirs.
-    if ($config_aux_dir ne '.' && $config_aux_dir ne '')
-    {
-       &define_variable ('mkinstalldirs', ('$(SHELL) ' . $config_aux_dir
-                                           . '/mkinstalldirs'));
-    }
-    else
-    {
-       &define_variable ('mkinstalldirs',
-                         '$(SHELL) $(top_srcdir)/mkinstalldirs');
-    }
+    &define_variable ('mkinstalldirs', ('$(SHELL) ' . $config_aux_dir . 
'/mkinstalldirs'));
 
     &am_line_error ('CONFIG_HEADER',
                    "\`CONFIG_HEADER' is an anachronism; now determined from 
\`$configure_ac'")
@@ -4151,14 +4128,7 @@
     &am_error ("\`python_PYTHON' defined but \`AM_CHECK_PYTHON' not in 
\`$configure_ac'")
        if ! $seen_pythondir && &variable_defined ('python_PYTHON');
 
-    if ($config_aux_dir eq '.' || $config_aux_dir eq '')
-    {
-       &define_variable ('py_compile', '$(top_srcdir)/py-compile');
-    }
-    else
-    {
-       &define_variable ('py_compile', $config_aux_dir . '/py-compile');
-    }
+    &define_variable ('py_compile', $config_aux_dir . '/py-compile');
 }
 
 # Handle Java.
@@ -4480,7 +4450,8 @@
 
        if (/$AC_CONFIG_AUX_DIR_PATTERN/o)
        {
-           @config_aux_path = $1;
+           @config_aux_path = $config_aux_dir = $1;
+           $config_aux_dir_set_in_configure_in = 1;
        }
 
        # Check for ansi2knr.
@@ -5058,7 +5029,7 @@
     # allow parallel builds to work correctly.  FIXME: for now, no
     # line number.
     &require_config_file ($FOREIGN, 'ylwrap');
-    if ($config_aux_dir ne '.' && $config_aux_dir ne '')
+    if ($config_aux_dir_set_in_configure_in)
     {
        &define_variable ('YLWRAP', $config_aux_dir . "/ylwrap");
     }
@@ -7563,8 +7534,7 @@
 {
     local ($dir, $file, $fullfile) = @_;
 
-    # FIXME: Once again, special-case `.'.
-    if ($dir eq $relative_dir || $dir eq '.')
+    if ($dir eq $relative_dir)
     {
        &push_dist_common ($file);
     }
@@ -7598,18 +7568,11 @@
 
        $found_it = 0;
        $dangling_sym = 0;
+       
        foreach $dir (@require_file_paths)
        {
-           if ($dir eq '.')
-           {
-               $fullfile = $relative_dir . "/" . $file;
-               $errdir = $relative_dir unless $errdir;
-           }
-           else
-           {
-               $fullfile = $dir . "/" . $file;
-               $errdir = $dir unless $errdir;
-           }
+           $fullfile = $dir . "/" . $file;
+           $errdir = $dir unless $errdir;
 
            # Use different name for "error filename".  Otherwise on
            # an error the bad file will be reported as eg
@@ -7640,7 +7603,7 @@
        {
            if ($strictness >= $mystrict)
            {
-               if ($dangling_sym && ($force_missing || $add_missing))
+               if ($dangling_sym && $add_missing)
                {
                    unlink ($fullfile);
                }
@@ -7693,6 +7656,9 @@
 
                    &maybe_push_required_file (&dirname ($errfile),
                                               $file, $errfile);
+
+                   # Prune the path list.
+                   @require_file_paths = &dirname ($errfile);
                }
 
                local ($save) = $exit_status;
@@ -7716,19 +7682,19 @@
 # configure.ac, not the current Makefile.am.
 sub require_file_with_conf_line
 {
-    @require_file_paths = '.';
+    @require_file_paths = $relative_dir;
     &require_file_internal (1, @_);
 }
 
 sub require_file_with_line
 {
-    @require_file_paths = '.';
+    @require_file_paths = $relative_dir;
     &require_file_internal (0, @_);
 }
 
 sub require_file
 {
-    @require_file_paths = '.';
+    @require_file_paths = $relative_dir;
     &require_file_internal (0, '', @_);
 }
 
@@ -7740,14 +7706,8 @@
     &require_file_internal (1, '', @_);
     local ($dir) = $require_file_paths[0];
     @config_aux_path = @require_file_paths;
-    if ($dir eq '.')
-    {
-       $config_aux_dir = '.';
-    }
-    else
-    {
-       $config_aux_dir = '$(top_srcdir)/' . $dir;
-    }
+    # avoid unsightly '/.'s.
+    $config_aux_dir = '$(top_srcdir)' . ($dir eq '.' ? "" : "/$dir");
 }
 
 # Assumes that the line number is in Makefile.am.
@@ -7757,14 +7717,8 @@
     &require_file_internal (0, @_);
     local ($dir) = $require_file_paths[0];
     @config_aux_path = @require_file_paths;
-    if ($dir eq '.')
-    {
-       $config_aux_dir = '.';
-    }
-    else
-    {
-       $config_aux_dir = '$(top_srcdir)/' . $dir;
-    }
+    # avoid unsightly '/.'s.
+    $config_aux_dir = '$(top_srcdir)' . ($dir eq '.' ? "" : "/$dir");
 }
 
 # Assumes that the line number is in configure.ac.
@@ -7774,14 +7728,8 @@
     &require_file_internal (1, @_);
     local ($dir) = $require_file_paths[0];
     @config_aux_path = @require_file_paths;
-    if ($dir eq '.')
-    {
-       $config_aux_dir = '.';
-    }
-    else
-    {
-       $config_aux_dir = '$(top_srcdir)/' . $dir;
-    }
+    # avoid unsightly '/.'s.
+    $config_aux_dir = '$(top_srcdir)' . ($dir eq '.' ? "" : "/$dir");
 }
 
 ################################################################
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.253
diff -u -r1.253 tests/Makefile.am
--- tests/Makefile.am   2001/02/07 21:51:39     1.253
+++ tests/Makefile.am   2001/02/07 23:28:02
@@ -86,6 +86,7 @@
 dejagnu.test \
 depacl.test \
 depacl2.test \
+depcomp.test \
 depend.test \
 depend3.test \
 discover.test \
Index: tests/Makefile.in
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.in,v
retrieving revision 1.322
diff -u -r1.322 tests/Makefile.in
--- tests/Makefile.in   2001/02/07 21:51:39     1.322
+++ tests/Makefile.in   2001/02/07 23:28:02
@@ -156,6 +156,7 @@
 dejagnu.test \
 depacl.test \
 depacl2.test \
+depcomp.test \
 depend.test \
 depend3.test \
 discover.test \
Index: tests/confsub.test
===================================================================
RCS file: /cvs/automake/automake/tests/confsub.test,v
retrieving revision 1.9
diff -u -r1.9 tests/confsub.test
--- tests/confsub.test  2000/03/19 23:38:10     1.9
+++ tests/confsub.test  2001/02/07 23:28:03
@@ -27,8 +27,6 @@
 
 : > subdir/config.h.in
 
-mv depcomp subdir
-
 $AUTOMAKE || exit 1
 
 # Make sure subdir Makefile.in doesn't itself look in the subdir.
Index: tests/depcomp.test
===================================================================
RCS file: depcomp.test
diff -N tests/depcomp.test
--- /dev/null   Tue May  5 13:32:27 1998
+++ tests/depcomp.test  Wed Feb  7 15:28:03 2001
@@ -0,0 +1,34 @@
+#! /bin/sh
+
+# Test to make sure depcomp is installed and found properly
+# when required for multiple directories
+
+. $srcdir/defs || exit 1
+
+cat > configure.in << 'END'
+AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+PACKAGE=nonesuch
+VERSION=nonesuch
+AC_PROG_CC
+AC_OUTPUT(subdir/Makefile subdir2/Makefile)
+END
+
+rm depcomp
+mkdir subdir
+mkdir subdir2
+
+cat > subdir/Makefile.am << 'END'
+noinst_PROGRAMS = foo
+foo_SOURCES = foo.c
+END
+
+cp subdir/Makefile.am subdir2/Makefile.am
+
+: > subdir/foo.c
+: > subdir2/foo.c
+
+$AUTOMAKE --add-missing || exit 1
+
+# There used to be a bug where this was created in the first subdir with C
+# sources in it instead of in $top_srcdir or $ac_auxdir
+test -f depcomp || exit 1
Index: tests/libobj2.test
===================================================================
RCS file: /cvs/automake/automake/tests/libobj2.test,v
retrieving revision 1.8
diff -u -r1.8 tests/libobj2.test
--- tests/libobj2.test  2000/03/19 23:38:10     1.8
+++ tests/libobj2.test  2001/02/07 23:28:03
@@ -28,8 +28,6 @@
 
 : > subdir/fsusage.c
 
-mv depcomp subdir
-
 $AUTOMAKE || exit 1
 
 grep 'fsusage\.c' subdir/Makefile.in

reply via email to

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