+2009-01-01 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * gnulib-tool (func_modules_add_dummy, func_emit_lib_Makefile_am,
+ func_emit_tests_Makefile_am, func_import): Abort loops early if we
+ already know the answer.
+
2009-01-01 Jim Meyering <meyering@redhat.com>
* lib/version-etc.c (version_etc_va): Update copyright year.
#! /bin/sh
#
-# Copyright (C) 2002-2008 Free Software Foundation, Inc.
+# Copyright (C) 2002-2009 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
# - modules list of modules, including 'dummy' if needed
func_modules_add_dummy ()
{
+ # Determine whether any module provides a lib_SOURCES augmentation.
have_lib_SOURCES=
sed_remove_backslash_newline=':a
/\\$/{
# Ignore .h files since they are not compiled.
case "$file" in
*.h) ;;
- *) have_lib_SOURCES=yes ;;
+ *)
+ have_lib_SOURCES=yes
+ break 2
+ ;;
esac
done
fi
# Test whether there are some source files in subdirectories.
for f in `func_get_filelist "$module"`; do
case $f in
- lib/*/*.c) uses_subdirs=yes ;;
+ lib/*/*.c)
+ uses_subdirs=yes
+ break
+ ;;
esac
done
fi
# Test whether there are some source files in subdirectories.
for f in `func_get_filelist "$module"`; do
case $f in
- lib/*/*.c | tests/*/*.c) uses_subdirs=yes ;;
+ lib/*/*.c | tests/*/*.c)
+ uses_subdirs=yes
+ break
+ ;;
esac
done
fi
func_verify_nontests_module
if test -n "$module"; then
all_files=`func_get_filelist $module`
- lib_files=`for f in $all_files; do \
- case $f in \
- lib/*) echo $f ;; \
- esac; \
- done | sed -e 's,^lib/,,'`
- if test -n "$lib_files"; then
- use_libtests=true
- break
- fi
+ # Test whether some file in $all_files lies in lib/.
+ for f in $all_files; do
+ case $f in
+ lib/*)
+ use_libtests=true
+ break 2
+ ;;
+ esac
+ done
fi
done