+1999-06-01 Alexandre Oliva <oliva@dcc.unicamp.br>
+
+ * m4/depout.m4: Instead of `find'ing Makefiles, just iterate on
+ CONFIG_FILES. Do not use temporary variable for list of
+ dependency files, it breaks Cygwin.
+
1999-04-27 Alexandre Oliva <oliva@dcc.unicamp.br>
* depcomp (gcc): Imported comments removed from depend2.am, so
dnl need in order to bootstrap the dependency handling code.
AC_DEFUN(AM_OUTPUT_DEPENDENCY_COMMANDS,[
AC_OUTPUT_COMMANDS([
-find . -name Makefile -print | while read mf; do
+for mf in $CONFIG_FILES; do
+ case "$mf" in
+ Makefile) dirpart=.;;
+ */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`
+ *) continue;;
+ esac
+ grep '^DEP_FILES = ..*' < "$mf" > /dev/null || continue
# Extract the definition of DEP_FILES from the Makefile without
# running `make'.
- DEPDIR=`sed -n -e '/^DEPDIR = / s///p' $mf`
+ DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n -e '/^U = / s///p' < "$mf"`
+ test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
# We invoke sed twice because it is the simplest approach to
# changing $(DEPDIR) to its actual value in the expansion.
- deps="`sed -n -e '
+ for file in `sed -n -e '
/^DEP_FILES = .*\\\\$/ {
s/^DEP_FILES = //
:loop
/\\\\$/ b loop
p
}
- /^DEP_FILES = / s/^DEP_FILES = //p' $mf | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`"
- # If we found a definition, proceed to create all the files.
- if test -n "$deps"; then
- dirpart="`echo $mf | sed -e 's|/[^/]*$||'`"
- test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
- case "$deps" in
- *'$U'*) # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n -e '/^U = / s///p' $mf`
- deps=`echo "$deps" | sed 's/\$U/'"$U"'/g'`
- ;;
- esac
- for file in $deps; do
- if test ! -f "$dirpart/$file"; then
- echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- fi
- done
- fi
-done])])
+ /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ test -f "$dirpart/$file" && continue
+ echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+])])