1cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project#! @SHELL@ 2cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project# @configure_input@ 3cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project# Wrapper around a non installed bison to make it work as an installed one. 4cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project 505436638acc7c010349a69c3395f1a57c642dc62Ying Wang# Copyright (C) 2001-2012 Free Software Foundation, Inc. 605436638acc7c010349a69c3395f1a57c642dc62Ying Wang# 705436638acc7c010349a69c3395f1a57c642dc62Ying Wang# This program is free software: you can redistribute it and/or modify 805436638acc7c010349a69c3395f1a57c642dc62Ying Wang# it under the terms of the GNU General Public License as published by 905436638acc7c010349a69c3395f1a57c642dc62Ying Wang# the Free Software Foundation, either version 3 of the License, or 1005436638acc7c010349a69c3395f1a57c642dc62Ying Wang# (at your option) any later version. 1105436638acc7c010349a69c3395f1a57c642dc62Ying Wang# 1205436638acc7c010349a69c3395f1a57c642dc62Ying Wang# This program is distributed in the hope that it will be useful, 1305436638acc7c010349a69c3395f1a57c642dc62Ying Wang# but WITHOUT ANY WARRANTY; without even the implied warranty of 1405436638acc7c010349a69c3395f1a57c642dc62Ying Wang# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1505436638acc7c010349a69c3395f1a57c642dc62Ying Wang# GNU General Public License for more details. 1605436638acc7c010349a69c3395f1a57c642dc62Ying Wang# 1705436638acc7c010349a69c3395f1a57c642dc62Ying Wang# You should have received a copy of the GNU General Public License 1805436638acc7c010349a69c3395f1a57c642dc62Ying Wang# along with this program. If not, see <http://www.gnu.org/licenses/>. 1905436638acc7c010349a69c3395f1a57c642dc62Ying Wang 2005436638acc7c010349a69c3395f1a57c642dc62Ying Wangabs_top_srcdir='@abs_top_srcdir@' 2105436638acc7c010349a69c3395f1a57c642dc62Ying Wangabs_top_builddir='@abs_top_builddir@' 2205436638acc7c010349a69c3395f1a57c642dc62Ying Wang: ${PERL='@PERL@'} 2305436638acc7c010349a69c3395f1a57c642dc62Ying Wang 24cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Project# Use the shipped files, not those installed. 2505436638acc7c010349a69c3395f1a57c642dc62Ying WangBISON_PKGDATADIR=$abs_top_srcdir/data 26cea198a11f15a2eb071d98491ca9a8bc8cebfbc4The Android Open Source Projectexport BISON_PKGDATADIR 2705436638acc7c010349a69c3395f1a57c642dc62Ying Wang 2805436638acc7c010349a69c3395f1a57c642dc62Ying Wang$PREBISON "$abs_top_builddir/src/bison" ${1+"$@"} 2905436638acc7c010349a69c3395f1a57c642dc62Ying Wangstatus=$? 3005436638acc7c010349a69c3395f1a57c642dc62Ying Wang 3105436638acc7c010349a69c3395f1a57c642dc62Ying Wang# As a special dark magic, if we are actually using this wrapper to 3205436638acc7c010349a69c3395f1a57c642dc62Ying Wang# compile Bison's src/parse-gram.y, post-process the synclines to 3305436638acc7c010349a69c3395f1a57c642dc62Ying Wang# avoid dependencies on the user's set up (srcdir vs. builddir). 3405436638acc7c010349a69c3395f1a57c642dc62Ying Wangfor i 3505436638acc7c010349a69c3395f1a57c642dc62Ying Wangdo 3605436638acc7c010349a69c3395f1a57c642dc62Ying Wang case $i in 3705436638acc7c010349a69c3395f1a57c642dc62Ying Wang */parse-gram.y) 3805436638acc7c010349a69c3395f1a57c642dc62Ying Wang if $PERL --version >/dev/null; then 3905436638acc7c010349a69c3395f1a57c642dc62Ying Wang # We are called by ylwrap which still uses y.tab.*, and 4005436638acc7c010349a69c3395f1a57c642dc62Ying Wang # post-processes the synclines on y.tab.c itself. Don't let it 4105436638acc7c010349a69c3395f1a57c642dc62Ying Wang # do it. Besides, it leaves "parse-gram.y" as the source, 4205436638acc7c010349a69c3395f1a57c642dc62Ying Wang # dropping the src/ part. 4305436638acc7c010349a69c3395f1a57c642dc62Ying Wang $PERL -pi -e 's{"y\.tab\.}{"parse-gram.}g;' \ 4405436638acc7c010349a69c3395f1a57c642dc62Ying Wang -e 's{".*/(parse-gram\.y)"}{"$1"}g;' \ 4505436638acc7c010349a69c3395f1a57c642dc62Ying Wang y.tab.[ch] 4605436638acc7c010349a69c3395f1a57c642dc62Ying Wang fi 4705436638acc7c010349a69c3395f1a57c642dc62Ying Wang ;; 4805436638acc7c010349a69c3395f1a57c642dc62Ying Wang esac 4905436638acc7c010349a69c3395f1a57c642dc62Ying Wangdone 5005436638acc7c010349a69c3395f1a57c642dc62Ying Wang 5105436638acc7c010349a69c3395f1a57c642dc62Ying Wangexit $status 5205436638acc7c010349a69c3395f1a57c642dc62Ying Wang 5305436638acc7c010349a69c3395f1a57c642dc62Ying Wang# Local Variables: 5405436638acc7c010349a69c3395f1a57c642dc62Ying Wang# mode: shell-script 5505436638acc7c010349a69c3395f1a57c642dc62Ying Wang# End: 56