[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

fwd: akim@epita.fr: Re: AC_CONFIG_COMMANDS does not handle an empty second argument.

From: Zack Weinberg <zack_at_codesourcery.com>
Date: 2002-02-07 00:13:32 CET

Remember that bug with APR's configure script and *BSD shell?

zw

----- Forwarded message from Akim Demaille <akim@epita.fr> -----

To: Zack Weinberg <zack@codesourcery.com>
Cc: autoconf@gnu.org
Subject: Re: AC_CONFIG_COMMANDS does not handle an empty second argument.
From: Akim Demaille <akim@epita.fr>
Date: 06 Feb 2002 18:51:34 +0100

| for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
| ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
| ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
|
| case $ac_dest in
| esac
| done
| EOF
|
| Note the empty case statement.

Thanks, I'm applying the following patch. I'd like to know what shell
you used to document this. None of the shells I tried (zsh, bash,
ash) exhibit such a problem. It's funny to note CONFIG_COMMANDS was
the only one to have the problem: all the others (_HEADERS etc.) were
protected just like below.

Index: ChangeLog
from Akim Demaille <akim@epita.fr>

        * lib/autoconf/status.m4 (_AC_OUTPUT_COMMANDS): Don't output empty
        case/esac, some shells don't support it.
        Reported by Zack Weinberg.
        * tests/torture.at (AC_CONFIG_COMMANDS with empty commands): New.

Index: THANKS
===================================================================
RCS file: /cvsroot/autoconf/autoconf/THANKS,v
retrieving revision 1.80
diff -u -u -r1.80 THANKS
--- THANKS 29 Jan 2002 17:19:30 -0000 1.80
+++ THANKS 6 Feb 2002 17:48:59 -0000
@@ -170,6 +170,7 @@
 Werner Lemberg wl@gnu.org
 Wilfredo Sanchez wsanchez@apple.com
 Wolfgang Mueller Wolfgang.Mueller@cui.unige.ch
+Zack Weinberg zack@codesourcery.com
 
 Many people are not named here because we lost track of them. We
 thank them! Please, help us keep this list up to date.
Index: lib/autoconf/status.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/status.m4,v
retrieving revision 1.17
diff -u -u -r1.17 status.m4
--- lib/autoconf/status.m4 14 Dec 2001 17:57:29 -0000 1.17
+++ lib/autoconf/status.m4 6 Feb 2002 17:48:59 -0000
@@ -361,9 +361,12 @@
   _AC_SRCPATHS(["$ac_dir"])
 
   AC_MSG_NOTICE([executing $ac_dest commands])
- case $ac_dest in
+dnl Some shells don't like empty case/esac
+m4_ifset([AC_LIST_COMMANDS_COMMANDS],
+[ case $ac_dest in
 AC_LIST_COMMANDS_COMMANDS()dnl
   esac
+])dnl
 done
 _ACEOF
 ])# _AC_OUTPUT_COMMANDS
Index: tests/torture.at
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/torture.at,v
retrieving revision 1.31
diff -u -u -r1.31 torture.at
--- tests/torture.at 6 Feb 2002 09:39:55 -0000 1.31
+++ tests/torture.at 6 Feb 2002 17:48:59 -0000
@@ -1,15 +1,6 @@
 # -*- Autotest -*-
 
-AT_BANNER([[Testing config.status.
-
-## ---------------------------------------------------------------- ##
-## This section of torture tests is trying to make Autoconf produce ##
-## failing `configure' scripts, which must never happen. If one of ##
-## these tests ever fails, it is extremely important that you ##
-## report the failure to bug-autoconf@gnu.org. ##
-## ---------------------------------------------------------------- ##]])
-
-# Copyright 2000, 2001 Free Software Foundation, Inc.
+# Copyright 2000, 2001, 2002 (C) 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
@@ -27,6 +18,18 @@
 # 02111-1307, USA.
 
 
+AT_BANNER([[Testing config.status.]])
+
+
+## ---------------------------------------- ##
+## AC_CONFIG_COMMANDS with empty commands. ##
+## ---------------------------------------- ##
+
+AT_CHECK_MACRO([AC_CONFIG_COMMANDS with empty commands],
+[[AC_CONFIG_COMMANDS([foo], [], [:])
+]])
+
+
 ## ------------ ##
 ## AC_ARG_VAR. ##
 ## ------------ ##
@@ -179,8 +182,7 @@
 # Create a link
 AT_CHECK_CONFIG_CREATION(link)
 
-AT_CLEANUP(header file link commandvar-header var-file var-link var-command
- input)
+AT_CLEANUP
 
 
 
@@ -246,7 +248,7 @@
          ["'$ " ' $ "'$
 ])
 
-AT_CLEANUP(configure config.status config.log config.cache)
+AT_CLEANUP
 
 
 
@@ -453,7 +455,7 @@
 [AT_BIG_VALUE
 ])])
 
-AT_CLEANUP(dummy)
+AT_CLEANUP
 
 
 ## -------- ##
@@ -493,7 +495,7 @@
 at_here=`pwd`
 AT_CHECK([cd at-dir && $at_here/configure], [], [ignore])
 
-AT_CLEANUP(at-dir foo.in foo)
+AT_CLEANUP
 
 
 ## ----------------- ##

----- End forwarded message -----

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:05 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.