8dffee3ed4f5fbc367f9511afbfbdcbb65038160
[platform/upstream/diffutils.git] / ms / config.sed
1 # Additional editing of Makefiles and of config.status
2
3 # Copyright (C) 2001-2002, 2009-2011 Free Software Foundation, Inc.
4
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14
15 # You should have received a copy of the GNU General Public License
16 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
18 # Written by Eli Zaretskii.
19
20
21 /(echo[  ]*':t/ a\
22 # DJGPP specific Makefile changes.\
23   /^aliaspath * *=/s,:,";",g;t t\
24   /TEXINPUTS=/s,:,";",g;t t\
25   /PATH=/s,:,";",g;t t\
26   s,\\.deps,_deps,g;t t\
27   s,\\.new\\.,_new.,g;t t\
28   s,\\.old\\.,_old.,g;t t\
29   s,\\.tab\\.,_tab.,g;t t\
30   s,Makefile\\.in\\.in,Makefile.in-in,g;t t\
31   s,Makefile\\.am\\.in,Makefile.am-in,g;t t\
32   /^install-info-am:/,/^$/ {\
33     /@list=.\\\$(INFO_DEPS)\[^ \]/s,DEPS),& diff.i,\
34     s,\\(\\\$\\\$d/\\\$\\\$file-\\[0-9\\]\\[0-9\\]\\)\\(\[^ \]\\),\\1 \\$\\$d/\\$\\$file[0-9] \\$\\$d/\\$\\$file[0-9][0-9]\\2,\
35     s,\\( \\\$\\\$file-\\[0-9\\]\\[0-9\\]\\)\\(\[^ \]\\),\\1 \\$\\$file[0-9] \\$\\$file[0-9][0-9]\\2,\
36   }\
37   /^uninstall-info-am:/,/^$/ {\
38     /@list=.\\\$(INFO_DEPS)\[^ \]/s,DEPS),& diff.i,\
39     s,\\(file-\\[0-9\\]\\[0-9\\]\\)\\(\[^ \]\\),\\1 \\$\\$file[0-9] \\$\\$file[0-9][0-9]\\2,\
40   }
41
42 # Makefile.in.in is renamed to Makefile.in-in.
43 /^ac_config_files=/,/_ACEOF/ {
44   s|po/Makefile\.in|&:po/Makefile.in-in|
45 }
46 /CONFIG_FILES=/ s|po/Makefile\.in|&:po/Makefile.in-in|2
47
48 # We always use _deps instead of .deps, because the latter is an
49 # invalid name on 8+3 MS-DOS file system.  This makes the generated
50 # Makefiles good for every DJGPP installation, not only the one
51 # where the package was configured (which could happen to be a
52 # Windows box, where leading dots in file names are allowed).
53 s,\.deps,_deps,g
54
55 # The following two items are changes needed for configuring
56 # and compiling across partitions.
57 # The given srcdir value is always translated from the
58 # "x:" syntax into "/dev/x" syntax while we run configure.
59 /^[      ]*-srcdir=\*.*$/ a\
60     ac_optarg=`echo "$ac_optarg" | sed "s,^\\([A-Za-z]\\):,/dev/\\1,"`
61 /set X `ls -Lt \$srcdir/ i\
62    if `echo $srcdir | grep "^/dev/" - > /dev/null`; then\
63      srcdir=`echo "$srcdir" | sed -e "s%^/dev/%%" -e "s%/%:/%"`\
64    fi
65
66 # Autoconf 2.52e generated configure scripts write absolute paths into
67 # Makefiles, making them useless for DJGPP installations other than the
68 # one for which the package has been configured.
69 /MISSING=/,/^$/ {
70   /^fi$/ a\
71 am_missing_run=`echo "$am_missing_run" | sed 's%/dev.*/diffutil.*[-.]2.*[7-9].*[0-9]%${top_srcdir}%'`
72 }
73 /^install_sh=/a\
74 install_sh=`echo "$install_sh" | sed 's%/dev.*/diffutil.*[-.]2.*[7-9].*[0-9]%${top_srcdir}%'`
75
76
77 # The following makes sure we are not going to remove a directory
78 # which is the cwd on its drive (DOS doesn't allow to remove such
79 # a directory).  The trick is to chdir to the root directory on
80 # temp directory's drive.
81 /^ *trap 'exit_status=\$\?; rm -rf/s%rm -rf%cd $tmp; cd /; &%
82
83 # AC_CONFIG_LINKS fails if the source and destination are on
84 # different file systems and symlinks don't work.
85 /^    ln \$srcdir/s%||%|| cp -pf $srcdir/$ac_source $ac_dest ||%