- # Write a warning to the generated file.
- echo "###################################" > $file
- echo "# WARNING! DO NOT EDIT THIS FILE! #" >> $file
- echo "###################################" >> $file
- echo >> $file
- echo "# It was generated from $file.m4 on `date`." >> $file
- echo >> $file
-
- # Process $1.m4 with m4 using the given options.
- echo "m4(): generating '$file' from '$file.m4' with options '$*'"
- # Add useful macros.
- (echo "define(\`IF', \`ifelse(\`\$1', \`\$2',dnl')dnl
-define(\`FI', \`)dnl')dnl";
- # Run the file (and the default macros) through m4.
- cat $file.m4) | $m4 $* >> $file
-
- unset file