autoconf-patches
[Top][All Lists]
Advanced

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

build testsuite (more) portably


From: Ralf Wildenhues
Subject: build testsuite (more) portably
Date: Sun, 5 Mar 2006 11:29:07 +0100
User-agent: Mutt/1.5.9i

OpenBSD grep has a bug in that it mistreats patterns separated by
newlines.  I will report more on this after finishing a bug report to
this end.  For now, it's only important that Autoconf does not use this
in lib/*/*m4, but in tests/mktests.sh.

Now, tests/Makefile.am is not too portable, due to VPATH limitations;
for example, OpenBSD and Tru64 make try to rebuild the shipped
$(TESTSUITE_GENERATED_AT) files.  This triggers the grep bug above, to
the end that many macros end up being tested that should not be (e.g.,
because they need arguments).

An easy way to work around the former is to fix the latter.  ;-)

If we now also fix $(AUTOCONF_FILES) to use $(srcdir), the resulting
Makefile even works on solaris2.6.  :)

While at it, I found a couple of trivial portability issues in mktests.
Since I don't know what the bash-3.1 bug with "$@" is, please check
whether this is relevant here.

OK to apply?  Should the $(wrappers) rule name wrapper.in explicitly?

Cheers,
Ralf

        * tests/Makefile.am (edit, $(wrappers)): Do not use `$<' in
        non-suffix rule.
        ($(TESTSUITE_GENERATED_AT)): Use `$(srcdir)` for the benefit of
        non-GNU make.
        (autoconfdir, $(AUTOCONF_FILES)): Likewise.
        * tests/mktests.sh: Small shell portability fixes.

Index: tests/Makefile.am
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/Makefile.am,v
retrieving revision 1.97
diff -u -r1.97 Makefile.am
--- tests/Makefile.am   15 Aug 2005 23:47:57 -0000      1.97
+++ tests/Makefile.am   5 Mar 2006 10:08:30 -0000
@@ -63,10 +63,11 @@
        -e 's|@address@hidden|$@|g' \
        -e 's|@address@hidden|@abs_top_srcdir@|g' \
        -e 's|@address@hidden|@abs_top_builddir@|g' \
-       -e 's|@address@hidden|Generated from $<.|g'
+       -e "s|@address@hidden|Generated from $$input.|g"
 
 $(wrappers): wrapper.in
        rm -f $@ address@hidden
+       input=wrapper.in; \
        $(edit) wrapper.in >address@hidden
        chmod +x address@hidden
        chmod a-w address@hidden
@@ -79,11 +80,19 @@
 ## ------------ ##
 
 TESTSUITE_GENERATED_AT = \
-       aclang.at acc.at acfortran.at \
-       acgeneral.at acstatus.at \
-       acautoheader.at acautoupdate.at \
-       acspecific.at acfunctions.at acheaders.at actypes.at \
-       aclibs.at acprograms.at
+       $(srcdir)/aclang.at \
+       $(srcdir)/acc.at \
+       $(srcdir)/acfortran.at \
+       $(srcdir)/acgeneral.at \
+       $(srcdir)/acstatus.at \
+       $(srcdir)/acautoheader.at \
+       $(srcdir)/acautoupdate.at \
+       $(srcdir)/acspecific.at \
+       $(srcdir)/acfunctions.at \
+       $(srcdir)/acheaders.at \
+       $(srcdir)/actypes.at \
+       $(srcdir)/aclibs.at \
+       $(srcdir)/acprograms.at
 
 TESTSUITE_HAND_AT = \
        suite.at \
@@ -134,10 +143,10 @@
 
 ## Producing the test files.
 
-# The files which contains macro we check for syntax.  Don't use $(top_srcdir)
-# here since below we explicitly `cd' to $srcdir.  As for the dependencies,
-# thanks God for VPATH.  Hm...
-autoconfdir = ../lib/autoconf
+# The files which contains macro we check for syntax.  Use $(top_srcdir)
+# for the benefit of non-GNU make.  Fix the names in the rule below
+# where we `cd' to $srcdir.
+autoconfdir = $(top_srcdir)/lib/autoconf
 AUTOCONF_FILES = $(autoconfdir)/general.m4 \
                 $(autoconfdir)/status.m4 \
                 $(autoconfdir)/autoheader.m4 \
@@ -149,11 +158,12 @@
                 $(autoconfdir)/fortran.m4 \
                 $(autoconfdir)/headers.m4 \
                 $(autoconfdir)/libs.m4 \
-                $(autoconfdir)/types.m4        \
+                $(autoconfdir)/types.m4 \
                 $(autoconfdir)/programs.m4
 
 $(TESTSUITE_GENERATED_AT): mktests.sh $(AUTOCONF_FILES)
-       cd $(srcdir) && ./mktests.sh $(AUTOCONF_FILES)
+       cd $(srcdir) && ./mktests.sh \
+         `echo " "$(AUTOCONF_FILES) | sed 's, [^ ]*/, ../lib/autoconf/,g'`
 
 
 ## maintainer-check ##
Index: tests/mktests.sh
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/mktests.sh,v
retrieving revision 1.43
diff -u -r1.43 mktests.sh
--- tests/mktests.sh    14 May 2005 07:00:40 -0000      1.43
+++ tests/mktests.sh    5 Mar 2006 09:45:07 -0000
@@ -2,7 +2,7 @@
 
 # Build some of the Autoconf test files.
 
-# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
 # Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
@@ -28,7 +28,7 @@
 
 trap 'echo "'"$as_me"': failed.  To proceed run make check." >&2
       rm -f acdefuns audefuns requires *.tat
-      for file in "$@"
+      for file
       do
         touch `echo "$file" | sed "s,.*[\\/],,;s/\..*/.at/"`
       done
@@ -46,9 +46,9 @@
 src="$@"
 
 # Set locale to C so that `sort' behaves in a uniform way.
-export LANGUAGE; LANGUAGE=C
-export LANG; LANG=C
-export LC_ALL; LC_ALL=C
+LANGUAGE=C; export LANGUAGE
+LANG=C; export LANG
+LC_ALL=C export LC_ALL
 
 
 # requires




reply via email to

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