1# Additional editing of Makefiles
2/extrasub/,/^CEOF/ {
3  /^CEOF$/ i\
4# DJGPP specific Makefile changes.\
5  /^aliaspath *	*=/s,:,";",g\
6  /^lispdir *	*=/ c\\\\\
7lispdir = \\$(prefix)/gnu/emacs/site-lisp\
8  /^docdir *	*=/s,/doc/,/gnudocs/,g\
9  /TEXINPUTS=/s,:,";",g\
10  /PATH=/s,:,";",g\
11  /CFLAGS[ 	]*=/s,=,= -O2 -g,g\
12  s,config\\.h\\.in,config.h-in,g\
13  s,\\.tab\\.c,_tab.c,g\
14  s,\\.tab\\.h,_tab.h,g\
15  s,\\.old\\.,_old.,g\
16  s,\\.\\([1-9]\\)\\.html,.\\1-html,g\
17  s,\\.html,-html,g\
18  s,/doc,/gnudocs,g\
19  s,libcharset\\.h\\.in,libcharset.h-in,g\
20  s,Makefile\\.in\\.in,Makefile.in-in,g\
21  s,Makefile\\.am\\.in,Makefile.am-in,g\
22  /^install-info-am:/,/^$/ s,file-\\[0-9\\]\\[0-9\\],& \\$\\$file[0-9] \\$\\$file[0-9][0-9],\
23  /^\\.y\\.c:/,/^$/ {\
24    /\\\$(YACC)/ {\
25      s,[ 	]*&&.*$,,\
26      a\\\\\
27	-mv -f y_tab.c \\$*.c\\\\\
28	-@test -f y.tab.c && mv -f y.tab.c \\$*.c\\\\\
29	-@test -f y.tab.h && mv -f y.tab.h y_tab.h\
30    }\
31  }
32}
33
34# Rename config.h.in into config.h-in
35/^ *CONFIG_HEADERS=/,/^EOF/ {
36  s|"lib/config\.h|&:lib/config.h-in|
37  s|"config\.h|&:config.h-in|
38}
39
40# Rename iconv.h.in into iconv.h-in
41/^ *CONFIG_FILES=/,/^EOF/ {
42  s|include/iconv\.h|&:include/iconv.h-in|
43}
44
45# Replace (command) > /dev/null with `command > /dev/null`, since
46# parenthesized commands always return zero status in the ported Bash,
47# even if the named command doesn't exist
48# This does no longer work with autoconf 2.5, libtool 1.4 and automake 1.5.
49# /if ([^|;]*null/{
50#   s,(,`,
51#   s,),,
52#   s,;  *then,`; then,
53# }
54
55# Replace (command) > /dev/null with `command > /dev/null`, since
56# parenthesized commands always return zero status in the ported Bash,
57# even if the named command doesn't exist
58/if [^{].*null/,/ then/ {
59  /test .*null/ {
60    s,(,,
61    s,),,
62  }
63}
64
65# DOS-style absolute file names should be supported as well
66/\*) srcdir=/s,/\*,[\\\\/]* | [A-z]:[\\\\/]*,
67/\$]\*) INSTALL=/s,\[/\$\]\*,[\\\\/$]* | [A-z]:[\\\\/]*,
68/\$]\*) ac_rel_source=/s,\[/\$\]\*,[\\\\/$]* | [A-z]:[\\\\/]*,
69
70# Switch the order of the two Sed commands, since DOS path names
71# could include a colon
72/ac_file_inputs=/s,\( -e "s%\^%\$ac_given_srcdir/%"\)\( -e "s%:% $ac_given_srcdir/%g"\),\2\1,
73
74# Prevent the spliting of conftest.subs.
75# The sed script: conftest.subs is split into 48 or 90 lines long files.
76# This will produce sed scripts called conftest.s1, conftest.s2, etc.
77# that will not work if conftest.subs contains a multi line sed command
78# at line #90. In this case the first part of the sed command will be the
79# last line of conftest.s1 and the rest of the command will be the first lines
80# of conftest.s2. So both script will not work properly.
81# This matches the configure script produced by Autoconf 2.12
82/ac_max_sed_cmds=[0-9]/ s,=.*$,=`sed -n "$=" conftest.subs`,
83# This matches the configure script produced by Autoconf 2.14a
84/ac_max_sed_lines=[0-9]/ s,=.*$,=`sed -n "$=" $ac_cs_root.subs `,
85
86# The following two items are changes needed for configuring
87# and compiling across partitions.
88# 1) The given srcdir value is always translated from the
89#    "x:" syntax into "/dev/x" syntax while we run configure.
90/^[ 	]*-srcdir=\*.*$/ a\
91    ac_optarg=`echo "$ac_optarg" | sed "s,^\\([A-Za-z]\\):,/dev/\\1,"`
92/set X `ls -Lt \$srcdir/ i\
93   if `echo $srcdir | grep "^/dev/" - > /dev/null`; then\
94     srcdir=`echo "$srcdir" | sed -e "s%^/dev/%%" -e "s%/%:/%"`\
95   fi
96
97#  2) We need links across partitions,
98#     so we will use "cp -pf" instead of "ln".
99/# Make a symlink if possible; otherwise try a hard link./,/EOF/ {
100  s,;.*then, 2>/dev/null || cp -pf \$srcdir/\$ac_source \$ac_dest&,
101}
102
103# Let libtool use _libs all the time.
104/objdir=/s,\.libs,_libs,
105