* subdir3.test: Allow any number of dependencies.
[automake.git] / m4 / header.m4
blobc82b6a7ec2c09d17ed1e3e26ec31ff0bc7e1f8f7
1 # Like AC_CONFIG_HEADER, but automatically create stamp file.
3 # serial 3
5 # When config.status generates a header, we must update the stamp-h file.
6 # This file resides in the same directory as the config header
7 # that is generated.  We must strip everything past the first ":",
8 # and everything past the last "/".
10 AC_PREREQ([2.12])
12 AC_DEFUN([AM_CONFIG_HEADER],
13 [AC_CONFIG_HEADER([$1])
14   AC_OUTPUT_COMMANDS(
15    ifelse(patsubst([$1], [[^ ]], []),
16           [],
17           [test -z "$CONFIG_HEADERS" || echo timestamp >dnl
18            patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),
19   [am_indx=1
20   for am_file in $1; do
21     case " $CONFIG_HEADERS " in
22     *" $am_file "*)
23       echo timestamp > `echo $am_file | sed 's%:.*%%;s%[^/]*$%%'`stamp-h$am_indx
24       ;;
25     esac
26     am_indx=\`expr \$am_indx + 1\`
27   done])