1# fixautomake.m4 serial 6 (gettext-0.16)
2dnl Copyright (C) 2002-2003, 2006 Free Software Foundation, Inc.
3dnl This file is free software, distributed under the terms of the GNU
4dnl General Public License.  As a special exception to the GNU General
5dnl Public License, this file may be distributed as part of a program
6dnl that contains a configuration script generated by Autoconf, under
7dnl the same distribution terms as the rest of that program.
8
9dnl From Bruno Haible
10
11dnl Fix unesthetic build commands generated by automake.
12AC_DEFUN([FIX_MAKEFILE_COMPILE], [
13  sed -e "s,\`test -f \\\$< || echo '\\\$(srcdir)/'\`\\\$<,\\\$<," -e "s,\`test -f '\\\$<' || echo '\\\$(srcdir)/'\`\\\$<,\\\$<," < $ac_file > $ac_file.tmp
14  mv $ac_file.tmp $ac_file
15])
16
17dnl Fix an automake-1.5-1.7.2 bug: the distrib rule is omitted.
18AC_DEFUN([FIX_MAKEFILE_DISTRIB], [
19  sed -e 's,^#distdir:,distdir:,' < $ac_file > $ac_file.tmp
20  mv $ac_file.tmp $ac_file
21])
22
23dnl Fix an automake-1.9-1.10 bug: the distrib rule is not extensible.
24dnl Insert a invocation of the distdir1 target inside the distdir commands,
25dnl after $(distdir) has been erased and re-created.
26AC_DEFUN([FIX_MAKEFILE_TOPDIR_DISTRIB], [
27  sed_script='/mkdir \$(distdir)$/{a\
28\	$(MAKE) distdir1
29}'
30  sed -e "$sed_script" < $ac_file > $ac_file.tmp
31  mv $ac_file.tmp $ac_file
32])
33
34dnl Fix an automake-1.5-1.7.2 bug: all info files are erased by "make".
35AC_DEFUN([FIX_MAKEFILE_INFO], [
36  sed -e '/@rm -f \$''@/d' < $ac_file > $ac_file.tmp
37  mv $ac_file.tmp $ac_file
38])
39