]>
Commit | Line | Data |
---|---|---|
be2a1a68 | 1 | #! @SHELL@ |
25d81090 | 2 | # @configure_input@ |
342b8b6e AD |
3 | # Wrapper around a non installed bison to make it work as an installed one. |
4 | ||
3272a725 AD |
5 | # Copyright (C) 2001-2012 Free Software Foundation, Inc. |
6 | # | |
7 | # This program is free software: you can redistribute it and/or modify | |
8 | # it under the terms of the GNU General Public License as published by | |
9 | # the Free Software Foundation, either version 3 of the License, or | |
10 | # (at your option) any later version. | |
11 | # | |
12 | # This program is distributed in the hope that it will be useful, | |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | # GNU General Public License for more details. | |
16 | # | |
17 | # You should have received a copy of the GNU General Public License | |
18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
19 | ||
f4c75eaf AD |
20 | abs_top_srcdir='@abs_top_srcdir@' |
21 | abs_top_builddir='@abs_top_builddir@' | |
22 | ||
2c0ddf03 | 23 | # Use the shipped files, not those installed. |
f4c75eaf | 24 | BISON_PKGDATADIR=$abs_top_srcdir/data |
be2a1a68 | 25 | export BISON_PKGDATADIR |
4c4d3539 | 26 | |
a17187e5 | 27 | $PREBISON "$abs_top_builddir/src/bison" ${1+"$@"} |
f4c75eaf AD |
28 | status=$? |
29 | ||
30 | # As a special dark magic, if we are actually using this wrapper to | |
31 | # compile Bison's src/parse-gram.y, post-process the synclines to | |
32 | # avoid dependencies on the user's set up (srcdir vs. builddir). | |
f4c75eaf AD |
33 | for i |
34 | do | |
35 | case $i in | |
36 | */src/parse-gram.y) | |
a17187e5 | 37 | : ${PERL=perl} |
f4c75eaf AD |
38 | if $PERL --version >/dev/null; then |
39 | # We are called by ylwrap which still uses y.tab.*, and | |
40 | # post-processes the synclines on y.tab.c itself. Don't let it | |
41 | # do it. Besides, it leaves "parse-gram.y" as the source, | |
42 | # dropping the src/ part. | |
4c4d3539 AD |
43 | $PERL -pi -e 's{"y\.tab\.}{"src/parse-gram.}g;' \ |
44 | -e 's{".*/(parse-gram\.y)"}{"src/$1"}g;' \ | |
f4c75eaf AD |
45 | y.tab.[ch] |
46 | fi | |
47 | ;; | |
48 | esac | |
49 | done | |
50 | ||
51 | exit $status | |
52 | ||
53 | # Local Variables: | |
54 | # mode: shell-script | |
55 | # End: |