+2006-10-21  Bruno Haible  <bruno@clisp.org>
+
+       * gnulib-tool (func_emit_lib_Makefile_am, func_emit_tests_Makefile_am):
+       Change mostlyclean-local rule to avoid sh syntax error from bash
+       versions 2.00..2.05 when $(MOSTLYCLEANDIRS) is empty.
+
 2006-10-23  Jim Meyering  <jim@meyering.net>
 
        * lib/getaddrinfo.c (getnameinfo): Use new lightweight uinttostr,
 
 
 progname=$0
 package=gnulib
-cvsdatestamp='$Date: 2006-10-20 13:42:39 $'
+cvsdatestamp='$Date: 2006-10-23 11:25:20 $'
 last_checkin_date=`echo "$cvsdatestamp" | sed -e 's,^\$[D]ate: ,,'`
 version=`echo "$last_checkin_date" | sed -e 's/ .*$//' -e 's,/,-,g'`
 nl='
   cat allsnippets.tmp
   echo
   echo "mostlyclean-local: mostlyclean-generic"
-  echo "       @test -z \"\$(MOSTLYCLEANDIRS)\" || \\"
-  echo "         for dir in \$(MOSTLYCLEANDIRS); do \\"
-  echo "           if test -d \$\$dir; then \\"
-  echo "             echo \"rmdir \$\$dir\"; rmdir \$\$dir; \\"
-  echo "           fi; \\"
-  echo "         done"
+  echo "       @for dir in '' \$(MOSTLYCLEANDIRS); do \\"
+  echo "         if test -n \"\$\$dir\" && test -d \$\$dir; then \\"
+  echo "           echo \"rmdir \$\$dir\"; rmdir \$\$dir; \\"
+  echo "         fi; \\"
+  echo "       done"
   rm -f allsnippets.tmp
 }
 
   echo "       rm -rf SunWS_cache"
   echo
   echo "mostlyclean-local: mostlyclean-generic"
-  echo "       @test -z \"\$(MOSTLYCLEANDIRS)\" || \\"
-  echo "         for dir in \$(MOSTLYCLEANDIRS); do \\"
-  echo "           if test -d \$\$dir; then \\"
-  echo "             echo \"rmdir \$\$dir\"; rmdir \$\$dir; \\"
-  echo "           fi; \\"
-  echo "         done"
+  echo "       @for dir in '' \$(MOSTLYCLEANDIRS); do \\"
+  echo "         if test -n \"\$\$dir\" && test -d \$\$dir; then \\"
+  echo "           echo \"rmdir \$\$dir\"; rmdir \$\$dir; \\"
+  echo "         fi; \\"
+  echo "       done"
   rm -f allsnippets.tmp
 }