From f998805502fc306c6b4e43f9a13d83836bfbbb22 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 14 Jan 1999 22:45:40 +0000 Subject: [PATCH] * automake.in (handle_configure): Compute $header_dir based on $one_name, not $one_hdr. Reported by Erez Zadok. Fixes confh2.test. (handle_configure): Compute relative path to input header correctly in all cases. --- ChangeLog | 6 ++++++ TODO | 13 +++++++++++++ automake.in | 44 +++++++++++++++++++++++++++++++++++++++----- tests/confh3.test | 4 ++-- 4 files changed, 60 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0d67ead9..bc43c551 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 1999-01-14 Tom Tromey + * automake.in (handle_configure): Compute $header_dir based on + $one_name, not $one_hdr. Reported by Erez Zadok. Fixes + confh2.test. + (handle_configure): Compute relative path to input header + correctly in all cases. + * automake.in (handle_tests): Avoid error messages from dejagnu test rules. From Karl Heuer. diff --git a/TODO b/TODO index bd0430f5..e327c058 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,16 @@ +* Run automake before libtool. It will report an error but + still won't put the file into the disty. This is wrong. + From Mark H Wilkinson + +* AM_CONFIG_HEADER might generate the wrong stamp file names + when given multiple headers. Write a test. + +* Currently don't correctly handle multiple inputs to a config header. + +* header stamp files still in wrong dirs. + stamp-h.in must be in dir with h.in file + stamp-h must be in dir with output file + * foo=bar if cond foo += joe diff --git a/automake.in b/automake.in index e27c3993..ccb3ffcc 100755 --- a/automake.in +++ b/automake.in @@ -3013,7 +3013,7 @@ sub handle_configure local ($one_fullname) = shift (@local_fullnames); local ($one_name) = shift (@local_names); $hdr_index += 1; - local ($header_dir) = &dirname ($one_hdr); + local ($header_dir) = &dirname ($one_name); # If the header is in the current directory we want to build # the header here. Otherwise, if we're at the topmost @@ -3025,13 +3025,11 @@ sub handle_configure local ($ch_sans_dir, $cn_sans_dir, $stamp_dir); if ($relative_dir eq $header_dir) { - $ch_sans_dir = &basename ($one_hdr); $cn_sans_dir = &basename ($one_name); $stamp_dir = ''; } else { - $ch_sans_dir = $one_hdr; $cn_sans_dir = $one_name; if ($header_dir eq '.') { @@ -3043,6 +3041,41 @@ sub handle_configure } } + # Compute relative path from directory holding output + # header to directory holding input header. FIXME: + # doesn't handle case where we have multiple inputs. + if (&dirname ($one_hdr) eq $relative_dir) + { + $ch_sans_dir = &basename ($one_hdr); + } + else + { + local (@rel_out_path, $rel_path); + # FIXME this chunk of code should be its own sub. + # It is used elsewhere. + foreach (split (/\//, $relative_dir)) + { + next if $_ eq '' || $_ eq '.'; + if ($_ eq '..') + { + # FIXME: actually this is an error. + pop @rel_out_path; + } + else + { + push (@rel_out_path, '..'); + } + } + if (@rel_out_path) + { + $ch_sans_dir = join ('/', @rel_out_path) . '/' . $one_hdr; + } + else + { + $ch_sans_dir = $one_hdr; + } + } + &require_file_with_conf_line ($config_header_line, $FOREIGN, $ch_sans_dir); @@ -3077,9 +3110,10 @@ sub handle_configure $output_rules .= &file_contents_with_transform ($xform, 'remake-hdr'); - &create ("${relative_dir}/${stamp_dir}${stamp_name}.in"); + local ($out_dir) = &dirname ($ch_sans_dir); + &create ("${relative_dir}/${out_dir}/${stamp_name}.in"); &require_file_with_conf_line ($config_header_line, $FOREIGN, - "${stamp_dir}${stamp_name}.in"); + "${out_dir}/${stamp_name}.in"); $distclean_config .= ' ' if $distclean_config; $distclean_config .= $cn_sans_dir; diff --git a/tests/confh3.test b/tests/confh3.test index 05911869..8cfe5895 100755 --- a/tests/confh3.test +++ b/tests/confh3.test @@ -26,5 +26,5 @@ mkdir d1 d2 $AUTOMAKE || exit 1 grep '^config.h:' d1/Makefile.in || exit 1 -fgrep 'echo timestamp > stamp-h' Makefile.in || exit 1 -fgrep '../d2/config.h.in' Makefile.in || exit 1 +fgrep 'echo timestamp > stamp-h' d1/Makefile.in || exit 1 +fgrep '../d2/config.h.in' d1/Makefile.in || exit 1 -- 2.43.5