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