From 547cbd7f0fe312ae37fd022c6dd170e1d7772626 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 13 May 2001 16:40:28 +0000 Subject: [PATCH] 2001-05-13 Tom Tromey * tests/Makefile.am (TESTS): Added python.test. * tests/python.test: New file. * automake.in (handle_languages): Use config_aux_dir_set_in_configure_in. (handle_python): Correctly mention AM_PATH_PYTHON. Use py-compile, not py_comp. Define py_compile macro. 2001-05-13 Derek Price * 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'. --- ChangeLog | 66 ++++++++++++++++++++++++++++ automake.in | 106 +++++++++++++-------------------------------- tests/Makefile.am | 2 + tests/Makefile.in | 2 + tests/confsub.test | 2 - tests/depcomp.test | 35 +++++++++++++++ tests/libobj2.test | 2 - tests/python.test | 15 +++++++ 8 files changed, 151 insertions(+), 79 deletions(-) create mode 100755 tests/depcomp.test create mode 100755 tests/python.test diff --git a/ChangeLog b/ChangeLog index 0f408442..641e1bb0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,40 @@ +2001-05-13 Tom Tromey + + * tests/Makefile.am (TESTS): Added python.test. + * tests/python.test: New file. + * automake.in (handle_languages): Use + config_aux_dir_set_in_configure_in. + (handle_python): Correctly mention AM_PATH_PYTHON. Use + py-compile, not py_comp. Define py_compile macro. + +2001-05-13 Derek Price + + * 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'. + 2001-05-12 Tom Tromey * tests/gcj.test: Updated for gcj dependency tracking. @@ -2818,6 +2855,35 @@ * automake.in (handle_ltlibraries): Allow _LDFLAGS to be conditionally defined. Fixes PR automake/77 and ldflags.test. +2000-12-05 Derek Price + + * 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 * automake.in (file_contents_with_transform): Added file name and diff --git a/automake.in b/automake.in index a286507a..f980d5f1 100755 --- a/automake.in +++ b/automake.in @@ -364,6 +364,7 @@ my $ac_output_line = 0; # can be set by AC_CONFIG_AUX_DIR. my @config_aux_path = ('.', '..', '../..'); my $config_aux_dir = ''; +my $config_aux_dir_set_in_configure_in = 0; # Whether AM_GNU_GETTEXT has been seen in configure.ac. my $seen_gettext = 0; @@ -400,7 +401,7 @@ my $package_version_line = 0; # TRUE if we've seen AM_PATH_LISPDIR. my $seen_lispdir = 0; -# TRUE if we've seen AM_CHECK_PYTHON. +# TRUE if we've seen AM_PATH_PYTHON. my $seen_pythondir = 0; # TRUE if we've seen AC_EXEEXT. @@ -1447,23 +1448,8 @@ sub handle_languages # be empty. if (&saw_sources_p (0) && keys %dep_files) { - my $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. - my $depcomp_dir = ($config_aux_dir_specified ? $config_aux_dir - : '.'); - $require_file_found{'depcomp'} = 1 if -f "$depcomp_dir/depcomp"; - # Set location of depcomp. - my $prefix = ($config_aux_dir_specified ? $config_aux_dir - : '$(top_srcdir)'); - - &define_variable ('depcomp', "\$(SHELL) $prefix/depcomp"); + &define_variable ('depcomp', "\$(SHELL) $config_aux_dir/depcomp"); &require_config_file ($FOREIGN, 'depcomp'); @@ -2859,14 +2845,14 @@ sub handle_texinfo 'mdate-sh'); my $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', ('TEXI' => $info_cursor, @@ -2909,7 +2895,7 @@ sub handle_texinfo &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"); @@ -3580,16 +3566,8 @@ sub handle_configure } # 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'") @@ -4123,10 +4101,11 @@ sub handle_python return if ! @pyfiles; # Found some python. - &am_error ("`python_PYTHON' defined but `AM_CHECK_PYTHON' not in `$configure_ac'") + &am_error ("`python_PYTHON' defined but `AM_PATH_PYTHON' not in `$configure_ac'") if ! $seen_pythondir && &variable_defined ('python_PYTHON'); - &require_file_with_conf_line ('AM_CHECK_PYTHON', $FOREIGN, 'py_comp'); + &require_file_with_conf_line ('AM_PATH_PYTHON', $FOREIGN, 'py-compile'); + &define_variable ('py_compile', $config_aux_dir . '/py-compile'); } # Handle Java. @@ -4451,6 +4430,7 @@ sub scan_one_autoconf_file if (/$AC_CONFIG_AUX_DIR_PATTERN/o) { @config_aux_path = &unquote_m4_arg ($1); + $config_aux_dir_set_in_configure_in = 1; } # Check for ansi2knr. @@ -5024,7 +5004,7 @@ sub yacc_lex_finish_helper # 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"); } @@ -7314,8 +7294,7 @@ sub maybe_push_required_file { my ($dir, $file, $fullfile) = @_; - # FIXME: Once again, special-case `.'. - if ($dir eq $relative_dir || $dir eq '.') + if ($dir eq $relative_dir) { &push_dist_common ($file); } @@ -7356,16 +7335,8 @@ sub require_file_internal my $dangling_sym = 0; foreach my $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 @@ -7396,7 +7367,7 @@ sub require_file_internal { if ($strictness >= $mystrict) { - if ($dangling_sym && ($force_missing || $add_missing)) + if ($dangling_sym && $add_missing) { unlink ($fullfile); } @@ -7449,6 +7420,9 @@ sub require_file_internal &maybe_push_required_file (dirname ($errfile), $file, $errfile); + + # Prune the path list. + @require_file_paths = &dirname ($errfile); } if ($suppress) @@ -7486,19 +7460,19 @@ sub require_file_internal # 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, '', @_); } @@ -7510,14 +7484,8 @@ sub require_config_file &require_file_internal (1, '', @_); my $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. @@ -7527,14 +7495,8 @@ sub require_conf_file_with_line &require_file_internal (0, @_); my $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. @@ -7544,14 +7506,8 @@ sub require_conf_file_with_conf_line &require_file_internal (1, @_); my $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"); } ################################################################ diff --git a/tests/Makefile.am b/tests/Makefile.am index 314a2c91..fc77fe1d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -92,6 +92,7 @@ defun2.test \ dejagnu.test \ depacl.test \ depacl2.test \ +depcomp.test \ depend.test \ depend3.test \ discover.test \ @@ -214,6 +215,7 @@ prefix.test \ primary.test \ primary2.test \ proginst.test \ +python.test \ ranlib.test \ recurs.test \ recurs2.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 93ad14a3..4bb65ed9 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -164,6 +164,7 @@ defun2.test \ dejagnu.test \ depacl.test \ depacl2.test \ +depcomp.test \ depend.test \ depend3.test \ discover.test \ @@ -286,6 +287,7 @@ prefix.test \ primary.test \ primary2.test \ proginst.test \ +python.test \ ranlib.test \ recurs.test \ recurs2.test \ diff --git a/tests/confsub.test b/tests/confsub.test index a66679b4..2e0778f7 100755 --- a/tests/confsub.test +++ b/tests/confsub.test @@ -27,8 +27,6 @@ END : > subdir/config.h.in -mv depcomp subdir - $ACLOCAL || exit 1 $AUTOMAKE || exit 1 diff --git a/tests/depcomp.test b/tests/depcomp.test new file mode 100755 index 00000000..35964b5f --- /dev/null +++ b/tests/depcomp.test @@ -0,0 +1,35 @@ +#! /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 -f 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 + +$ACLOCAL || exit 1 +$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 diff --git a/tests/libobj2.test b/tests/libobj2.test index 305099f1..6a185cbe 100755 --- a/tests/libobj2.test +++ b/tests/libobj2.test @@ -28,8 +28,6 @@ END : > subdir/fsusage.c -mv depcomp subdir - $ACLOCAL || exit 1 $AUTOMAKE || exit 1 diff --git a/tests/python.test b/tests/python.test new file mode 100755 index 00000000..b3b52b9c --- /dev/null +++ b/tests/python.test @@ -0,0 +1,15 @@ +#! /bin/sh + +# Test to make sure py_compile is defined. + +. $srcdir/defs || exit 1 + +echo 'AM_PATH_PYTHON' >> configure.in + +cat > Makefile.am << 'END' +python_PYTHON = foo.py +END + +$AUTOMAKE -a || exit 1 + +grep '^py_compile =' Makefile.in -- 2.43.5