]>
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 | ||
f4c75eaf AD |
5 | abs_top_srcdir='@abs_top_srcdir@' |
6 | abs_top_builddir='@abs_top_builddir@' | |
7 | ||
2c0ddf03 | 8 | # Use the shipped files, not those installed. |
f4c75eaf | 9 | BISON_PKGDATADIR=$abs_top_srcdir/data |
be2a1a68 | 10 | export BISON_PKGDATADIR |
f4c75eaf AD |
11 | $PREBISON "$abs_top_builddir/src/bison" ${1+"$@"} |
12 | status=$? | |
13 | ||
14 | # As a special dark magic, if we are actually using this wrapper to | |
15 | # compile Bison's src/parse-gram.y, post-process the synclines to | |
16 | # avoid dependencies on the user's set up (srcdir vs. builddir). | |
17 | PERL=perl | |
18 | ||
19 | for i | |
20 | do | |
21 | case $i in | |
22 | */src/parse-gram.y) | |
23 | if $PERL --version >/dev/null; then | |
24 | # We are called by ylwrap which still uses y.tab.*, and | |
25 | # post-processes the synclines on y.tab.c itself. Don't let it | |
26 | # do it. Besides, it leaves "parse-gram.y" as the source, | |
27 | # dropping the src/ part. | |
28 | perl -pi -e 's{"y\.tab\.}{"src/parse-gram.}g;' \ | |
29 | -e 's{".*/(parse-gram\.y)"}{"src/$1"}g;' \ | |
30 | y.tab.[ch] | |
31 | fi | |
32 | ;; | |
33 | esac | |
34 | done | |
35 | ||
36 | exit $status | |
37 | ||
38 | # Local Variables: | |
39 | # mode: shell-script | |
40 | # End: |