Hello Eric,
> [adding bug-automake and bug-make; ...]
I sent a separate followup there.
This mail goes again to bug-autconf only, as it discusses possible
workaround with current make implementation.
Regarding the patch attached to
http://lists.gnu.org/archive/html/bug-autoconf/2008-05/msg00000.html
I hed asuspicion as soon as I saw it, but since I was not able to
express my feelings exactly, I decided to work on it more ... and
basically I put it off. Now my ideas finally got a shape.
I was also thinking about "make dist", but I concentrated on good old
case-sensitive case.
As you mentioned, with --gnu strictness in Automake, INSTALL gets
listed in DIST_COMMON, which is a pre-requisite of distdir target.
Since "INSTALL" is equal to "./INSTALL", this implies that the file
is (re)built before each "make dist".
When "make dist*" is issued in a VPATH build, the $(srcdir)/INSTALL
file is found because of the VPATH mechanism, and then the rule for
$(srcdir)/INSTALL is used to ensure that the file is up-to-date.
When we introduced the $(abs_srcdir)/INSTALL hack, we lost the above
benefits.
Consequently, I'd like to propose an alternate solution:
if configure detects case-insensitive make, the rule for
$(srcdir)/INSTALL would be disabled.
That should not be a problem, as case insensitive platforms are
rarely used to create the distribution tarball of Autoconf.
Attached please find a patch.
The main advantage of this patch is that it is conservative:
- in the common situation, things work exactly as before
- the extra code is hidden in one macro, so the code is not made less
readable
OK to commit?
Stepan Kasal
>From 09321a75c8431d7242578be5f12cc1f1139c1ce1 Mon Sep 17 00:00:00 2001
From: Stepan Kasal <[EMAIL PROTECTED]>
Date: Thu, 22 May 2008 17:52:28 +0200
Subject: [PATCH] Check for case sensitive make.
* m4/make-check.m4 (AC_PROG_MAKE_CASE_SENSITIVE): New macro,...
* configure.ac: ... called here.
* Makefile.am ($(abs_srcdir)/INSTALL, INSTALL): Return to...
($(srcdir)/INSTALL): ...this, but enclose the rule in
"if MAKE_CASE_SENSITIVE".
Signed-off-by: Stepan Kasal <[EMAIL PROTECTED]>
---
ChangeLog | 9 +++++++++
Makefile.am | 13 +++++--------
configure.ac | 6 ++++++
m4/make-case.m4 | 26 ++++++++++++++++++++++++++
4 files changed, 46 insertions(+), 8 deletions(-)
create mode 100644 m4/make-case.m4
diff --git a/ChangeLog b/ChangeLog
index 76340a6..855653e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-06-05 Stepan Kasal <[EMAIL PROTECTED]>
+
+ Check for case sensitive make.
+ * m4/make-check.m4 (AC_PROG_MAKE_CASE_SENSITIVE): New macro,...
+ * configure.ac: ... called here.
+ * Makefile.am ($(abs_srcdir)/INSTALL, INSTALL): Return to...
+ ($(srcdir)/INSTALL): ...this, but enclose the rule in
+ "if MAKE_CASE_SENSITIVE".
+
2008-06-03 Eric Blake <[EMAIL PROTECTED]>
Fix 'make dist' regression from 2008-05-08.
diff --git a/Makefile.am b/Makefile.am
index 3ccaf2b..bf3d58a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -30,22 +30,19 @@ EXTRA_DIST = ChangeLog.0 ChangeLog.1 ChangeLog.2 \
build-aux/announce-gen build-aux/gnupload \
.prev-version .version
-MAINTAINERCLEANFILES = $(abs_srcdir)/INSTALL
+MAINTAINERCLEANFILES = $(srcdir)/INSTALL
## --------- ##
## INSTALL. ##
## --------- ##
-## abs_srcdir is necessary for case-insensitive make to distinguish from
-## 'make install'. But automake also insists that the plain target INSTALL
-## exist prior to 'make dist'.
-INSTALL: $(abs_srcdir)/INSTALL
-
-pkgdata_DATA = $(abs_srcdir)/INSTALL
+pkgdata_DATA = $(srcdir)/INSTALL
AM_MAKEINFOFLAGS = --no-headers --no-validate --no-split
-$(abs_srcdir)/INSTALL: $(top_srcdir)/doc/install.texi
+if MAKE_CASE_SENSITIVE
+$(srcdir)/INSTALL: $(top_srcdir)/doc/install.texi
$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -o $@ \
$(top_srcdir)/doc/install.texi
+endif
## maintainer-check ##
maintainer-check: maintainer-check-tests
diff --git a/configure.ac b/configure.ac
index 9fbb235..d4f1908 100644
--- a/configure.ac
+++ b/configure.ac
@@ -147,6 +147,12 @@ AC_PROG_EGREP
AC_PROG_SED
+## ----- ##
+## Make. ##
+## ----- ##
+AC_PROG_MAKE_CASE_SENSITIVE
+
+
## ------------ ##
## Conclusion. ##
## ------------ ##
diff --git a/m4/make-case.m4 b/m4/make-case.m4
new file mode 100644
index 0000000..b23ccf9
--- /dev/null
+++ b/m4/make-case.m4
@@ -0,0 +1,26 @@
+# make-case.m4 serial 0
+dnl Copyright (C) 2008 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# AC_PROG_MAKE_CASE_SENSITIVE
+# ---------------------------
+# Checks whether make is configured to be case insensitive; if yes,
+# sets AM_CONDITIONAL MAKE_CASE_SENSITIVE.
+#
+AC_DEFUN([AC_PROG_MAKE_CASE_SENSITIVE],
+[AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_CACHE_CHECK([whether ${MAKE-make} is case sensitive],
+[ac_cv_prog_make_${ac_make}_case],
+[echo all: >conftest.make
+if ${MAKE-make} -f conftest.make ALL >/dev/null 2>&1; then
+ ac_res=no
+else
+ ac_res=yes
+fi
+eval ac_cv_prog_make_${ac_make}_case=$ac_res
+rm -f conftest.make])
+AM_CONDITIONAL([MAKE_CASE_SENSITIVE],
+ [eval test \$ac_cv_prog_make_${ac_make}_case = yes])
+])
--
1.5.5.3