-
-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libpcp_web: mirror libpcp bison handling for query_parser.y (MacOS)
- Loading branch information
Showing
5 changed files
with
63 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ jsonsl.c | |
sha256.h | ||
sha256.c | ||
getdate.h | ||
getdate.y | ||
getdate.tab.? | ||
derive_parser.y | ||
derive_parser.output | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/bin/sh | ||
# Handle Bison version issues for query_parser.y | ||
# | ||
|
||
b_version=`bison --version | sed -n -e '/^bison/s/.*) *//p'` | ||
|
||
if [ -z "$b_version" ] | ||
then | ||
echo "Arrgh ... cannot get bison version from ..." | ||
bison --version | ||
exit 1 | ||
fi | ||
|
||
if [ ! -f query_parser.y.in ] | ||
then | ||
echo "Arrgh ... cannot find query_parser.y.in" | ||
exit 1 | ||
fi | ||
|
||
rm -f query_parser.y | ||
cat <<End-of-File >query_parser.y | ||
/* | ||
* DO NOT EDIT THIS FILE ... CHANGES HERE WILL BE LOST | ||
* | ||
* This file created from query_parser.y.in (make changes there!) | ||
* by fix_query_parser_y on ${PACKAGE_BUILD_DATE:-`date`}. | ||
*/ | ||
End-of-File | ||
|
||
# From the bison CHANGELOG | ||
# 2012-10-26 | ||
# version 2.6.4 | ||
# 2012-10-25 | ||
# src/parse-gram.y (%pure-parser, %name-prefix): Replace with... | ||
# (%define api.pure, %define api.prefix) | ||
# | ||
case "$b_version" | ||
in | ||
2.[0-5]*|2.6.[0-3]) | ||
sed -e 's/^PUT-PURE-DECL-HERE.*/%pure-parser/' <query_parser.y.in >>query_parser.y | ||
;; | ||
2.6.[4-9]|2.[7-9]*|3.*) | ||
sed -e 's/^PUT-PURE-DECL-HERE.*/%define api.pure full/' <query_parser.y.in >>query_parser.y | ||
;; | ||
*) | ||
rm -f query_parser.y | ||
echo "Arrgh ... don't know what to do with bison version $b_version" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
chmod a-w query_parser.y | ||
|
||
exit 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters