1# Additional editing of Makefiles
2/(echo[ 	]*':t/ a\
3# DJGPP specific Makefile changes.\
4  /^aliaspath *	*=/s,:,";",g;t t\
5  /TEXINPUTS=/s,:,";",g;t t\
6  /PATH=/s,:,";",g;t t\
7  s,\\.deps,_deps,g;t t\
8  s,\\.libs,_libs,g;t t\
9  s,\\.new\\.,_new.,g;t t\
10  s,\\.old\\.,_old.,g;t t\
11  s,\\.tab\\.,_tab.,g;t t\
12  /^docdir *	*=/s,/doc/,/gnudocs/,;t t\
13  s,config\\.h\\.in,config.h-in,g;t t\
14  s,\\.\\([1-9]\\)\\.html,.\\1-html,g;t t\
15  s,\\.html,-html,g;t t\
16  s,/doc,/gnudocs,g;t t\
17  s,libcharset\\.h\\.in,libcharset.h-in,g;t t\
18  s,localcharset\\.h\\.in,localcharset.h-in,g;t t\
19  s,Makefile\\.in\\.in,Makefile.in-in,g;t t\
20  s,Makefile\\.am\\.in,Makefile.am-in,g;t t\
21  /^lispdir *	*=/ c\\\
22lispdir = \$(prefix)/gnu/emacs/site-lisp\
23  /^install-info-am:/,/^$/ s,file-\\[0-9\\]\\[0-9\\],& \\$\\$file[0-9] \\$\\$file[0-9][0-9],\
24  /^\\.y\\.c:/,/^$/ {\
25    /\\\$(YACC)/ {\
26      s,[ 	]*&&.*$,,\
27      a\\\
28	-mv -f y_tab.c \$*.c\\\
29	-@test -f y.tab.c && mv -f y.tab.c \$*.c\\\
30	-@test -f y.tab.h && mv -f y.tab.h y_tab.h\
31    }\
32  }
33
34# Rename config.h.in into config.h-in
35/^[ 	]*ac_config_headers=/,/^_ACEOF/ {
36  s|config\.h|&:config.h-in|g
37}
38/CONFIG_HEADERS=/ s|config\.h\.in|&:config.h-in|2
39
40# We always use _deps and _libs instead of .deps and .libs, because
41# the latter is an invalid name on 8+3 MS-DOS filesystem.  This makes
42# the generated Makefiles good for every DJGPP installation, not only
43# the one where the package was configured (which could happen to be
44# a Windows box, where leading dots in file names are allowed).
45s,\.deps,_deps,g
46s,\.libs,_libs,g
47/^rmdir[ 	]*\.tst/ i\
48am__leading_dot=_
49
50# Replace (command) > /dev/null with `command > /dev/null`, since
51# parenthesized commands always return zero status in the ported Bash,
52# even if the named command doesn't exist
53/if ([^|;`]*null/{
54  s,(,`,
55  s,),,
56  /null[ 	]*2>&1/ s,2>&1,&`,
57  /null.*null/ s,null.*null,&`,
58  /null.*null/ !{
59    /null[ 	]*2>&1/ !s,null,&`,
60  }
61}
62
63# DOS-style absolute file names should be supported as well
64/\*) srcdir=/s,/\*,[\\\\/]* | [A-z]:[\\\\/]*,
65/\$]\*) INSTALL=/s,\[/\$\]\*,[\\\\/$]* | [A-z]:[\\\\/]*,
66/\$]\*) ac_rel_source=/s,\[/\$\]\*,[\\\\/$]* | [A-z]:[\\\\/]*,
67
68# Switch the order of the two Sed commands, since DOS path names
69# could include a colon
70/ac_file_inputs=/s,\( -e "s%\^%\$ac_given_srcdir/%"\)\( -e "s%:% $ac_given_srcdir/%g"\),\2\1,
71
72# Prevent the spliting of conftest.subs.
73# The sed script: conftest.subs is split into 48 or 90 lines long files.
74# This will produce sed scripts called conftest.s1, conftest.s2, etc.
75# that will not work if conftest.subs contains a multi line sed command
76# at line #90. In this case the first part of the sed command will be the
77# last line of conftest.s1 and the rest of the command will be the first lines
78# of conftest.s2. So both script will not work properly.
79# This matches the configure script produced by Autoconf 2.57
80/ac_max_sed_lines=[0-9]/ s,=.*$,=`sed -n "$=" $tmp/subs.sed`,
81
82# The following two items are changes needed for configuring
83# and compiling across partitions.
84# 1) The given srcdir value is always translated from the
85#    "x:" syntax into "/dev/x" syntax while we run configure.
86/^[ 	]*-srcdir=\*.*$/ a\
87    ac_optarg=`echo "$ac_optarg" | sed "s,^\\([A-Za-z]\\):,/dev/\\1,"`
88/set X `ls -Lt \$srcdir/ i\
89   if `echo $srcdir | grep "^/dev/" - > /dev/null`; then\
90     srcdir=`echo "$srcdir" | sed -e "s%^/dev/%%" -e "s%/%:/%"`\
91   fi
92
93#  2) We need links across partitions,
94#     so we will use "cp -pf" instead of "ln".
95/# Make a symlink if possible; otherwise try a hard link./,/EOF/ {
96  s,;.*then, 2>/dev/null || cp -pf \$srcdir/\$ac_source \$ac_dest&,
97}
98
99# Autoconf 2.52e generated configure scripts
100# write absolute paths into Makefiles making
101# them useless for DJGPP installations for which
102# the package has not been configured for.
103/MISSING=/,/^$/ {
104  /^fi$/ a\
105am_missing_run=`echo "$am_missing_run" | sed 's%/dev.*/libicharset-[0-9]\\{1,1\\}[-.0-9]*%${top_srcdir}%'`
106}
107/^install_sh=/a\
108install_sh=`echo "$install_sh" | sed 's%/dev.*/libicharset-[0-9]\\{1,1\\}[-.0-9]*%${top_srcdir}%'`
109
110# The following makes sure we are not going to remove a directory
111# which is the cwd on its drive (DOS doesn't allow to remove such
112# a directory).  The trick is to chdir to the root directory on
113# temp directory's drive before removing $tmp.
114/^[ 	]*trap[ 	]*'exit_status=\$\?;[ 	]*rm[ 	]*-rf/ s%rm -rf%cd $tmp; cd /; &%
115
116# AC_CONFIG_LINKS fails if the source and destination are on
117# different file systems and symlinks don't work.
118/^    ln \$srcdir/s%||%|| cp -pf $srcdir/$ac_source $ac_dest ||%
119
120# Add DJGPP version information.
121/^[ 	]*VERSION=/ s/\([0-9]\.[0-9]\.[0-9]\)/\1  (DJGPP port 2006-03-21 (r1))/
122
123# We need makeinfo to make the html formated docs.
124/\$am_missing_run[ 	]*makeinfo/ s,\$am_missing_run,,
125
126# The path to the FORTRAN compiler and libraries
127# shall contain no absolute path reference so it
128# will be good for all djgpp installations.
129/^FLIBS="\$ac_cv_flibs"/ i\
130ac_djgpp_path=`echo "$DJDIR" | sed 's%\\\\\\%/%g' | tr $as_cr_LETTERS $as_cr_letters`\
131ac_cv_flibs=`echo "$ac_cv_flibs" | sed "s%-L$ac_djgpp_path%-L/dev/env/DJDIR%g"`
132
133# Let libtool use _libs all the time.
134/objdir=/s,\.libs,_libs,
135