From: Alexandre Duret-Lutz Date: Mon, 13 Jan 2003 14:04:38 +0000 (+0000) Subject: Use `_dirstamp' when the file-system doesn't support `.dirstamp'. X-Git-Tag: Release-1-7b~312 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=f7f1fd9696855d17fad3f9704006032e64b46a3e;p=automake.git Use `_dirstamp' when the file-system doesn't support `.dirstamp'. * m4/lead-dot.m4: New file. * m4/Makefile.am (dist_m4data_DATA): Add lead-dot.m4 * m4/init.m4 (AM_INIT_AUTOMAKE): Require AM_SET_LEADING_DOT.: * m4/depend.m4 (AM_SET_DEPDIR): Require AM_SET_LEADING_DOT. Define DEPDIR using am__leading_dot. * automake.in (require_build_directory): Define am__dirstamp, a new variable for the dirstamp basename, based on am__leading_dot. * tests/subobj6.test: Move all `test -f' into Makefiles, so we can use $(am__dirstamp). Reported by Richard Dawe. --- diff --git a/ChangeLog b/ChangeLog index 3b3a1b62..937b5652 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,17 @@ 2003-01-13 Alexandre Duret-Lutz + Use `_dirstamp' when the file-system doesn't support `.dirstamp'. + * m4/lead-dot.m4: New file. + * m4/Makefile.am (dist_m4data_DATA): Add lead-dot.m4 + * m4/init.m4 (AM_INIT_AUTOMAKE): Require AM_SET_LEADING_DOT.: + * m4/depend.m4 (AM_SET_DEPDIR): Require AM_SET_LEADING_DOT. Define + DEPDIR using am__leading_dot. + * automake.in (require_build_directory): Define am__dirstamp, a new + variable for the dirstamp basename, based on am__leading_dot. + * tests/subobj6.test: Move all `test -f' into Makefiles, so we can + use $(am__dirstamp). + Reported by Richard Dawe. + * tests/gnits2.test, tests/pr300-prog.test, tests/transform.test: Move all `test -f' into Makefiles, so we can honor $(EXEEXT) when testing for programs. diff --git a/automake.in b/automake.in index 65294e3c..64f088b5 100755 --- a/automake.in +++ b/automake.in @@ -605,7 +605,7 @@ my %object_compilation_map; # This keeps track of the directories for which we've already -# created `.dirstamp' code. +# created dirstamp code. my %directory_map; # All .P files. @@ -8750,23 +8750,28 @@ sub require_conf_file_with_macro ($$$@) # dependent upon. sub require_build_directory ($) { - my $directory = shift; - my $dirstamp = "$directory/.dirstamp"; + my $directory = shift; + my $dirstamp = "$directory/\$(am__dirstamp)"; - # Don't emit the rule twice. - if (! defined $directory_map{$directory}) + # Don't emit the rule twice. + if (! defined $directory_map{$directory}) { - $directory_map{$directory} = 1; + $directory_map{$directory} = 1; - # Directory must be removed by `make distclean'. - $clean_files{$dirstamp} = DIST_CLEAN; + # Set a variable for the dirstamp basename. + define_pretty_variable ('am__dirstamp', TRUE, INTERNAL, + '$(am__leading_dot)dirstamp') + unless variable_defined ('am__dirstamp'); - $output_rules .= ("$dirstamp:\n" - . "\t\@\$(mkinstalldirs) $directory\n" - . "\t\@: > $dirstamp\n"); + # Directory must be removed by `make distclean'. + $clean_files{$dirstamp} = DIST_CLEAN; + + $output_rules .= ("$dirstamp:\n" + . "\t\@\$(mkinstalldirs) $directory\n" + . "\t\@: > $dirstamp\n"); } - return $dirstamp; + return $dirstamp; } # &require_build_directory_maybe ($FILE) diff --git a/m4/Makefile.am b/m4/Makefile.am index 79e2795a..b1b7a80e 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -2,7 +2,8 @@ ## Makefile for Automake m4. -## Copyright 1996, 1997, 1998, 1999, 2001, 2002 Free Software Foundation, Inc. +## Copyright 1996, 1997, 1998, 1999, 2001, 2002, 2003 +## Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -33,6 +34,7 @@ gcj.m4 \ header.m4 \ init.m4 \ install-sh.m4 \ +lead-dot.m4 \ lex.m4 \ lispdir.m4 \ maintainer.m4 \ diff --git a/m4/Makefile.in b/m4/Makefile.in index 82b82903..772f1998 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -107,6 +107,7 @@ gcj.m4 \ header.m4 \ init.m4 \ install-sh.m4 \ +lead-dot.m4 \ lex.m4 \ lispdir.m4 \ maintainer.m4 \ diff --git a/m4/depend.m4 b/m4/depend.m4 index 23a48d8e..4d6ff228 100644 --- a/m4/depend.m4 +++ b/m4/depend.m4 @@ -1,6 +1,6 @@ -# serial 4 -*- Autoconf -*- +# serial 5 -*- Autoconf -*- -# Copyright 1999, 2000, 2001 Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -118,16 +118,8 @@ AM_CONDITIONAL([am__fastdep$1], [ # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], -[rm -f .deps 2>/dev/null -mkdir .deps 2>/dev/null -if test -d .deps; then - DEPDIR=.deps -else - # MS-DOS does not allow filenames that begin with a dot. - DEPDIR=_deps -fi -rmdir .deps 2>/dev/null -AC_SUBST([DEPDIR]) +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) diff --git a/m4/init.m4 b/m4/init.m4 index d58a6f47..47c94729 100644 --- a/m4/init.m4 +++ b/m4/init.m4 @@ -3,7 +3,7 @@ # This macro actually does too much some checks are only needed if # your package does certain things. But this isn't really a big deal. -# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -21,7 +21,7 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. -# serial 8 +# serial 9 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, @@ -95,6 +95,7 @@ AM_PROG_INSTALL_STRIP # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], diff --git a/m4/lead-dot.m4 b/m4/lead-dot.m4 new file mode 100644 index 00000000..c8789fb2 --- /dev/null +++ b/m4/lead-dot.m4 @@ -0,0 +1,32 @@ +# -*- Autoconf -*- +# Copyright (C) 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 1 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) diff --git a/tests/subobj6.test b/tests/subobj6.test index 6a4f4c9c..f74b6362 100755 --- a/tests/subobj6.test +++ b/tests/subobj6.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. # # This file is part of GNU Automake. # @@ -24,18 +24,23 @@ required=gcc . ./defs || exit 1 -cat > configure.in << 'END' -AC_INIT(f) -AM_INIT_AUTOMAKE(nonesuch, nonesuch) +cat >> configure.in << 'END' AM_PROG_CC_C_O AC_PROG_CC -AC_OUTPUT(Makefile) +AC_OUTPUT END cat > Makefile.am << 'END' AUTOMAKE_OPTIONS = subdir-objects bin_PROGRAMS = wish wish_SOURCES = generic/a.c + +test-all: all + test -f generic/$(am__dirstamp) +test-mostlyclean: mostlyclean + test ! -f generic/a.o +test-distclean: distclean + test ! -f generic/$(am__dirstamp) END # The ac-init file. @@ -61,13 +66,9 @@ mkdir build cd build ../configure -$MAKE - -$MAKE mostlyclean -test -f generic/a.o && exit 1 - -$MAKE distclean -test -f generic/.dirstamp && exit 1 +$MAKE test-all +$MAKE test-mostlyclean +$MAKE test-distclean cd ..