]> git.saurik.com Git - bison.git/blame - djgpp/config.sed
fix eof condition
[bison.git] / djgpp / config.sed
CommitLineData
db0dcbf3 1# DJGPP specific configuration file.
7c799348 2# Sed script for additional DJGPP specific editing
013cb7f4 3# of the configure script generated by autoconf 2.62.
7c799348 4
db0dcbf3 5
38b5fb0c 6# Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
db0dcbf3 7
f16b0819 8# This program is free software: you can redistribute it and/or modify
db0dcbf3 9# it under the terms of the GNU General Public License as published by
f16b0819 10# the Free Software Foundation, either version 3 of the License, or
db0dcbf3 11# (at your option) any later version.
f16b0819 12#
db0dcbf3
PE
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
f16b0819 17#
db0dcbf3 18# You should have received a copy of the GNU General Public License
f16b0819 19# along with this program. If not, see <http://www.gnu.org/licenses/>.
db0dcbf3 20
b36e835b 21
3768a1ae 22# Additional editing of Makefiles
013cb7f4
JMG
23/^eval sed.*ac_file_inputs.*tmp\/out \\$/ {
24:loop
25n
26/^$/!b loop
27a\
2c061cb0 28cat > "$tmp/subs-djgpp.sed" << eof_djgpp\
3768a1ae 29# DJGPP specific Makefile changes.\
b36e835b
JMG
30s,\\.deps,_deps,g\
31s,\\.libs,_libs,g\
32s,\\.new\\.,_new.,g\
33s,\\.old\\.,_old.,g\
34s,\\.tab\\.,_tab.,g\
35s,c++\\.at,cxx.at,g\
36s,c++\\.m4,cxx.m4,g\
a7309d7d 37s,c++-skel\\.m4,cxx-skel.m4,g\
b36e835b
JMG
38s,calc++,calcxx,g\
39s,scan-gram-c,c-scan-gram,g\
40s,scan-skel-c,c-scan-skel,g\
50a84377 41s,inttypes_,_inttypes,g\
38b5fb0c
JMG
42s,javacomp\\.sh\\.in,javacomp.sh-in,g\
43s,javaexec\\.sh\\.in,javaexec.sh-in,g\
44s,yacc\\.1\\.in,yacc.1-in,g\
45s,bench\\.pl\\.in,bench.pl-in,g\
b36e835b
JMG
46s,Makefile\\.am\\.in,Makefile.am-in,g\
47s,Makefile\\.in\\.in,Makefile.in-in,g\
48/^\\.y\\.c:/,/^$/ {\
49 /\\\$(YACCCOMPILE)/ {\
50 a\\\\\
51 -@test -f y.tab.c && mv -f y.tab.c y_tab.c\\\\\
3768a1ae 52 -@test -f y.tab.h && mv -f y.tab.h y_tab.h\
3768a1ae 53 }\
b36e835b
JMG
54}\
55/^libbison.a:/ i\\\\\
56\\$(top_srcdir)/djgpp/subpipe.c: \\$(top_srcdir)/djgpp/subpipe.h\\\\\
57subpipe.o: \\$(top_srcdir)/djgpp/subpipe.c \\$(top_srcdir)/djgpp/subpipe.h\\\\\
3768a1ae 58 \\$(COMPILE) -c \\$<\
b36e835b
JMG
59/^yacc:/ i\\\\\
60yacc.bat:\\\\\
3768a1ae
JMG
61 echo "bison\\$(EXEEXT) -y %1 %2 %3 %4 %5 %6 %7 %8 %9" >\\$@\
62/^bin_SCRIPTS =/s/$/ yacc.bat/\
b36e835b 63/^MOSTLYCLEANFILES = yacc/s/$/ yacc.bat/\
38b5fb0c
JMG
64/cross-options.texi:/,/^$/ s|bison|&.exe|g\
65/^\\.x\\.1:/,/^$/ s|\\$program|&.exe|g\
b36e835b 66eof_djgpp\
2c061cb0 67sed -f "\$tmp/subs-djgpp.sed" \$tmp/out > \$tmp/out.djgpp\
b36e835b 68mv -f \$tmp/out.djgpp \$tmp/out
013cb7f4 69}
3768a1ae
JMG
70
71# Makefile.in.in is renamed to Makefile.in-in.
b36e835b
JMG
72/ac_config_files=/ {
73 /runtime-po/!s|po/Makefile\.in|&:po/Makefile.in-in|
74 s|runtime-po/Makefile\.in|&:runtime-po/Makefile.in-in|
38b5fb0c
JMG
75 s|javacomp\.sh\.in|javacomp.sh-in|
76 s|javaexec\.sh\.in|javaexec.sh-in|
77 s|doc/yacc\.1|&:doc/yacc.1-in|
78 s|etc/bench.pl|&:etc/bench.pl-in|
b36e835b
JMG
79}
80
81/CONFIG_FILES=/ {
82 /runtime-po/!s|po/Makefile\.in|&:po/Makefile.in-in|2
83 s|runtime-po/Makefile\.in|&:runtime-po/Makefile.in-in|2
38b5fb0c
JMG
84 s|javacomp\.sh\.in|javacomp.sh-in|
85 s|javaexec\.sh\.in|javaexec.sh-in|
86 s|doc/yacc\.1|&:doc/yacc.1-in|2
87 s|etc/bench\.pl|&:etc/bench.pl-in|2
3768a1ae 88}
3768a1ae
JMG
89
90# We always use _deps and _libs instead of .deps and .libs, because
db0dcbf3 91# the latter is an invalid name on 8+3 MS-DOS file system. This makes
3768a1ae
JMG
92# the generated Makefiles good for every DJGPP installation, not only
93# the one where the package was configured (which could happen to be
94# a Windows box, where leading dots in file names are allowed).
02650b7f 95/^rmdir[ ]*\.tst/ i\
3768a1ae
JMG
96am__leading_dot=_
97
98# Replace (command) > /dev/null with `command > /dev/null`, since
99# parenthesized commands always return zero status in the ported Bash,
100# even if the named command doesn't exist
101/if ([^|;`]*null/{
102 s,(,`,
103 s,),,
02650b7f 104 /null[ ]*2>&1/ s,2>&1,&`,
3768a1ae
JMG
105 /null.*null/ s,null.*null,&`,
106 /null.*null/ !{
02650b7f 107 /null[ ]*2>&1/ !s,null,&`,
3768a1ae
JMG
108 }
109}
110
111# DOS-style absolute file names should be supported as well
112/\*) top_srcdir=/s,/\*,[\\\\/]* | ?:[\\\\/]*,
113
3768a1ae
JMG
114# The following two items are changes needed for configuring
115# and compiling across partitions.
116# 1) The given srcdir value is always translated from the
117# "x:" syntax into "/dev/x" syntax while we run configure.
02650b7f 118/^[ ]*-srcdir=\*.*$/ a\
3768a1ae
JMG
119 ac_optarg=`echo "$ac_optarg" | sed "s,^\\([A-Za-z]\\):,/dev/\\1,"`
120/set X `ls -Lt \$srcdir/ i\
121 if `echo $srcdir | grep "^/dev/" - > /dev/null`; then\
122 srcdir=`echo "$srcdir" | sed -e "s%^/dev/%%" -e "s%/%:/%"`\
123 fi
124
125# Autoconf 2.52e generated configure scripts
126# write absolute paths into Makefiles and bison.in
127# making them useless for DJGPP installations for
128# which the package has not been configured for.
129/MISSING=/,/^$/ {
130 /^fi$/ a\
b36e835b 131am_missing_run=`echo "$am_missing_run" | sed 's%/dev/.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%${top_srcdir}%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%${top_srcdir}%'`
3768a1ae
JMG
132}
133/^install_sh=/a\
b36e835b 134install_sh=`echo "$install_sh" | sed 's%/dev/.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%${top_srcdir}%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%${top_srcdir}%'`
3768a1ae
JMG
135
136# This will only work if the assumption that the
137# testsuite is ran from the following path:
138# ${top_srcdir}/tests/testsuite.dir
139# holds. The explicit names are of no importance.
140# ../../. == ${top_srcdir}
b36e835b
JMG
141#/^esac$/,/^ac_abs_srcdir=/ {
142/^ac_abs_srcdir=/ i\
143ac_abs_builddir=`echo "$ac_abs_builddir" | sed "s%/dev/.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../.%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../.%"`\
144ac_abs_top_builddir=`echo "$ac_abs_top_builddir" | sed "s%/dev/.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../..%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../..%"`\
145ac_abs_top_srcdir=`echo "$ac_abs_top_srcdir" | sed "s%/dev/.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../..%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../..%"`
146#ac_abs_srcdir=`echo "$ac_abs_srcdir" | sed "s%/dev/.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../.%;s%.:.*/bison[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../.%"`
147/^ac_abs_srcdir=/ a\
148for dj_dir in $ac_abs_builddir $ac_abs_top_builddir $ac_abs_top_srcdir $ac_abs_srcdir\
149do\
150 ac_abs_builddir=`echo "$ac_abs_builddir" | sed "s%//%/%g"`\
151 ac_abs_top_builddir=`echo "$ac_abs_top_builddir" | sed "s%//%/%g"`\
152 ac_abs_top_srcdir=`echo "$ac_abs_top_srcdir" | sed "s%//%/%g"`\
153 ac_abs_srcdir=`echo "$ac_abs_srcdir" | sed "s%//%/%g"`\
154done
db0dcbf3 155
3768a1ae
JMG
156# Add DJGPP version information.
157/^#define VERSION/ s/\$VERSION/& (DJGPP port (r1))/
158
159# We need makeinfo to make the html formated docs.
02650b7f 160/\$am_missing_run[ ]*makeinfo/ s,\$am_missing_run,,
3768a1ae
JMG
161
162# The path to the FORTRAN compiler and libraries
163# shall contain no absolute path reference so it
164# will be good for all djgpp installations.
165/^FLIBS="\$ac_cv_flibs"/ i\
166ac_djgpp_path=`echo "$DJDIR" | sed 's%\\\\\\%/%g' | tr $as_cr_LETTERS $as_cr_letters`\
167ac_cv_flibs=`echo "$ac_cv_flibs" | sed "s%-L$ac_djgpp_path%-L/dev/env/DJDIR%g"`
168
2c061cb0
JMG
169# Autoconf generated configure scripts write absolute
170# paths of certain header files into Makefiles making
171# them useless for DJGPP installations for which the
172# package has not been configured for.
173/^.*echo "\$as_me:\$LINENO: result: \$gl_cv_absolute_.*$/ {
174h
175s,^.*\(gl_cv_absolute_\)\([a-z0-9_]*\)\(_h\).*$,\1\2\3=`echo $\1\2\3 | sed "s%[^:]:.*/include/%/dev/env/DJDIR/include/%"`,
176G
177}
50a84377
JMG
178/^.*echo "\$as_me:\$LINENO: result: \$gl_cv_full_.*$/ {
179h
180s,^.*\(gl_cv_full_\)\([a-z0-9_]*\)\(_h\).*$,\1\2\3=`echo $\1\2\3 | sed "s%[^:]:.*/include/%/dev/env/DJDIR/include/%"`,
181G
182}
2c061cb0 183
3768a1ae 184# The following is not a valid DOS file name
db0dcbf3 185s/calc++/calcxx/g
013cb7f4
JMG
186
187# The CR test for awk does not work for DJGPP.
188/^ac_cs_awk_cr=/,/^$/ {
189 /^fi$/ a\
190ac_cs_awk_cr=$ac_cr
191}