package: move skeletons into data/skeletons

* data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-like.m4,
* data/c-skel.m4, data/c.m4, data/d-skel.m4, data/d.m4, data/glr.c,
* data/glr.cc, data/java-skel.m4, data/java.m4, data/lalr1.cc,
* data/lalr1.d, data/lalr1.java, data/location.cc, data/stack.hh,
* data/variant.hh, data/yacc.c:
Move to...
* data/skeletons: here.
Use b4_skeletonsdir instead of b4_pkgdatadir.

* data/local.mk, src/output.c: Adjust.
This commit is contained in:
Akim Demaille
2018-12-24 19:08:35 +01:00
parent 0a4ddce822
commit 112ccb5ed7
23 changed files with 58 additions and 51 deletions

View File

@@ -14,30 +14,33 @@
## along with this program. If not, see <http://www.gnu.org/licenses/>. ## along with this program. If not, see <http://www.gnu.org/licenses/>.
dist_pkgdata_DATA = \ dist_pkgdata_DATA = \
data/README \ data/README
data/bison.m4 \
data/c++-skel.m4 \ skeletonsdir = $(pkgdatadir)/skeletons
data/c++.m4 \ dist_skeletons_DATA = \
data/c-like.m4 \ data/skeletons/bison.m4 \
data/c-skel.m4 \ data/skeletons/c++-skel.m4 \
data/c.m4 \ data/skeletons/c++.m4 \
data/glr.c \ data/skeletons/c-like.m4 \
data/glr.cc \ data/skeletons/c-skel.m4 \
data/java-skel.m4 \ data/skeletons/c.m4 \
data/java.m4 \ data/skeletons/glr.c \
data/lalr1.cc \ data/skeletons/glr.cc \
data/lalr1.java \ data/skeletons/java-skel.m4 \
data/location.cc \ data/skeletons/java.m4 \
data/stack.hh \ data/skeletons/lalr1.cc \
data/variant.hh \ data/skeletons/lalr1.java \
data/yacc.c data/skeletons/location.cc \
data/skeletons/stack.hh \
data/skeletons/variant.hh \
data/skeletons/yacc.c
# Experimental support for the D language. # Experimental support for the D language.
dist_pkgdata_DATA += \ dist_skeletons_DATA += \
data/README-D.txt \ data/skeletons/README-D.txt \
data/d-skel.m4 \ data/skeletons/d-skel.m4 \
data/d.m4 \ data/skeletons/d.m4 \
data/lalr1.d data/skeletons/lalr1.d
m4sugardir = $(pkgdatadir)/m4sugar m4sugardir = $(pkgdatadir)/m4sugar
dist_m4sugar_DATA = \ dist_m4sugar_DATA = \

View File

@@ -18,10 +18,10 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
b4_glr_if( [m4_define([b4_used_skeleton], [b4_pkgdatadir/[glr.cc]])]) b4_glr_if( [m4_define([b4_used_skeleton], [b4_skeletonsdir/[glr.cc]])])
b4_nondeterministic_if([m4_define([b4_used_skeleton], [b4_pkgdatadir/[glr.cc]])]) b4_nondeterministic_if([m4_define([b4_used_skeleton], [b4_skeletonsdir/[glr.cc]])])
m4_define_default([b4_used_skeleton], [b4_pkgdatadir/[lalr1.cc]]) m4_define_default([b4_used_skeleton], [b4_skeletonsdir/[lalr1.cc]])
m4_define_default([b4_skeleton], ["b4_basename(b4_used_skeleton)"]) m4_define_default([b4_skeleton], ["b4_basename(b4_used_skeleton)"])
m4_include(b4_used_skeleton) m4_include(b4_used_skeleton)

View File

@@ -22,7 +22,7 @@ b4_percent_define_ifdef([[api.value.union.name]],
[b4_complain_at(b4_percent_define_get_loc([[api.value.union.name]]), [b4_complain_at(b4_percent_define_get_loc([[api.value.union.name]]),
[named %union is invalid in C++])]) [named %union is invalid in C++])])
m4_include(b4_pkgdatadir/[c.m4]) m4_include(b4_skeletonsdir/[c.m4])
b4_percent_define_check_kind([api.namespace], [code], [deprecated]) b4_percent_define_check_kind([api.namespace], [code], [deprecated])
b4_percent_define_check_kind([parser_class_name], [code], [deprecated]) b4_percent_define_check_kind([parser_class_name], [code], [deprecated])

View File

@@ -18,10 +18,10 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
b4_glr_if( [m4_define([b4_used_skeleton], [b4_pkgdatadir/[glr.c]])]) b4_glr_if( [m4_define([b4_used_skeleton], [b4_skeletonsdir/[glr.c]])])
b4_nondeterministic_if([m4_define([b4_used_skeleton], [b4_pkgdatadir/[glr.c]])]) b4_nondeterministic_if([m4_define([b4_used_skeleton], [b4_skeletonsdir/[glr.c]])])
m4_define_default([b4_used_skeleton], [b4_pkgdatadir/[yacc.c]]) m4_define_default([b4_used_skeleton], [b4_skeletonsdir/[yacc.c]])
m4_define_default([b4_skeleton], ["b4_basename(b4_used_skeleton)"]) m4_define_default([b4_skeleton], ["b4_basename(b4_used_skeleton)"])
m4_include(b4_used_skeleton) m4_include(b4_used_skeleton)

View File

@@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
m4_include(b4_pkgdatadir/[c-like.m4]) m4_include(b4_skeletonsdir/[c-like.m4])
# b4_tocpp(STRING) # b4_tocpp(STRING)
# ---------------- # ----------------

View File

@@ -20,7 +20,7 @@
b4_glr_if( [b4_complain([%%glr-parser not supported for D])]) b4_glr_if( [b4_complain([%%glr-parser not supported for D])])
b4_nondeterministic_if([b4_complain([%%nondeterministic-parser not supported for D])]) b4_nondeterministic_if([b4_complain([%%nondeterministic-parser not supported for D])])
m4_define_default([b4_used_skeleton], [b4_pkgdatadir/[lalr1.d]]) m4_define_default([b4_used_skeleton], [b4_skeletonsdir/[lalr1.d]])
m4_define_default([b4_skeleton], ["b4_basename(b4_used_skeleton)"]) m4_define_default([b4_skeleton], ["b4_basename(b4_used_skeleton)"])
m4_include(b4_used_skeleton) m4_include(b4_used_skeleton)

View File

@@ -21,7 +21,7 @@
# If we are loaded by glr.cc, do not override c++.m4 definitions by # If we are loaded by glr.cc, do not override c++.m4 definitions by
# those of c.m4. # those of c.m4.
m4_if(b4_skeleton, ["glr.c"], m4_if(b4_skeleton, ["glr.c"],
[m4_include(b4_pkgdatadir/[c.m4])]) [m4_include(b4_skeletonsdir/[c.m4])])
## ---------------- ## ## ---------------- ##
## Default values. ## ## Default values. ##

View File

@@ -46,8 +46,8 @@
# We require a pure interface. # We require a pure interface.
m4_define([b4_pure_flag], [1]) m4_define([b4_pure_flag], [1])
m4_include(b4_pkgdatadir/[c++.m4]) m4_include(b4_skeletonsdir/[c++.m4])
b4_bison_locations_if([m4_include(b4_pkgdatadir/[location.cc])]) b4_bison_locations_if([m4_include(b4_skeletonsdir/[location.cc])])
m4_define([b4_parser_class_name], m4_define([b4_parser_class_name],
[b4_percent_define_get([[parser_class_name]])]) [b4_percent_define_get([[parser_class_name]])])
@@ -354,5 +354,5 @@ b4_copyright([Skeleton interface for Bison GLR parsers in C++],
# Let glr.c (and b4_shared_declarations) believe that the user # Let glr.c (and b4_shared_declarations) believe that the user
# arguments include the parser itself. # arguments include the parser itself.
m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_wrap])) m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_wrap]))
m4_include(b4_pkgdatadir/[glr.c]) m4_include(b4_skeletonsdir/[glr.c])
m4_popdef([b4_parse_param]) m4_popdef([b4_parse_param])

View File

@@ -20,7 +20,7 @@
b4_glr_if( [b4_complain([%%glr-parser not supported for Java])]) b4_glr_if( [b4_complain([%%glr-parser not supported for Java])])
b4_nondeterministic_if([b4_complain([%%nondeterministic-parser not supported for Java])]) b4_nondeterministic_if([b4_complain([%%nondeterministic-parser not supported for Java])])
m4_define_default([b4_used_skeleton], [b4_pkgdatadir/[lalr1.java]]) m4_define_default([b4_used_skeleton], [b4_skeletonsdir/[lalr1.java]])
m4_define_default([b4_skeleton], ["b4_basename(b4_used_skeleton)"]) m4_define_default([b4_skeleton], ["b4_basename(b4_used_skeleton)"])
m4_include(b4_used_skeleton) m4_include(b4_used_skeleton)

View File

@@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
m4_include(b4_pkgdatadir/[c-like.m4]) m4_include(b4_skeletonsdir/[c-like.m4])
# b4_list2(LIST1, LIST2) # b4_list2(LIST1, LIST2)

View File

@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
m4_include(b4_pkgdatadir/[c++.m4]) m4_include(b4_skeletonsdir/[c++.m4])
# api.value.type=variant is valid. # api.value.type=variant is valid.
m4_define([b4_value_type_setup_variant]) m4_define([b4_value_type_setup_variant])
@@ -142,9 +142,9 @@ m4_define([b4_parser_class_name],
b4_bison_locations_if([# Backward compatibility. b4_bison_locations_if([# Backward compatibility.
m4_define([b4_location_constructors]) m4_define([b4_location_constructors])
m4_include(b4_pkgdatadir/[location.cc])]) m4_include(b4_skeletonsdir/[location.cc])])
m4_include(b4_pkgdatadir/[stack.hh]) m4_include(b4_skeletonsdir/[stack.hh])
b4_variant_if([m4_include(b4_pkgdatadir/[variant.hh])]) b4_variant_if([m4_include(b4_skeletonsdir/[variant.hh])])
# b4_shared_declarations(hh|cc) # b4_shared_declarations(hh|cc)

View File

@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
m4_include([d.m4]) m4_include(b4_skeletonsdir/[d.m4])
m4_divert_push(0)dnl m4_divert_push(0)dnl

View File

@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
m4_include(b4_pkgdatadir/[java.m4]) m4_include(b4_skeletonsdir/[java.m4])
b4_defines_if([b4_fatal([%s: %%defines does not make sense in Java], b4_defines_if([b4_fatal([%s: %%defines does not make sense in Java],
[b4_skeleton])]) [b4_skeleton])])

View File

@@ -51,7 +51,7 @@ m4_define([b4_lac_flag],
[m4_if(b4_percent_define_get([[parse.lac]]), [m4_if(b4_percent_define_get([[parse.lac]]),
[none], [[0]], [[1]])]) [none], [[0]], [[1]])])
m4_include(b4_pkgdatadir/[c.m4]) m4_include(b4_skeletonsdir/[c.m4])
## ---------------- ## ## ---------------- ##
## Default values. ## ## Default values. ##

View File

@@ -1,3 +1,3 @@
data/glr.c data/skeletons/glr.c
data/lalr1.cc data/skeletons/lalr1.cc
data/yacc.c data/skeletons/yacc.c

View File

@@ -549,11 +549,12 @@ output_skeleton (void)
/* Compute the names of the package data dir and skeleton files. */ /* Compute the names of the package data dir and skeleton files. */
char const *m4 = (m4 = getenv ("M4")) ? m4 : M4; char const *m4 = (m4 = getenv ("M4")) ? m4 : M4;
char const *datadir = pkgdatadir (); char const *datadir = pkgdatadir ();
char *skeldir = xpath_join (datadir, "skeletons");
char *m4sugar = xpath_join (datadir, "m4sugar/m4sugar.m4"); char *m4sugar = xpath_join (datadir, "m4sugar/m4sugar.m4");
char *m4bison = xpath_join (datadir, "bison.m4"); char *m4bison = xpath_join (skeldir, "bison.m4");
char *skel = (IS_PATH_WITH_DIR (skeleton) char *skel = (IS_PATH_WITH_DIR (skeleton)
? xstrdup (skeleton) ? xstrdup (skeleton)
: xpath_join (datadir, skeleton)); : xpath_join (skeldir, skeleton));
/* Test whether m4sugar.m4 is readable, to check for proper /* Test whether m4sugar.m4 is readable, to check for proper
installation. A faulty installation can cause deadlock, so a installation. A faulty installation can cause deadlock, so a
@@ -608,6 +609,7 @@ output_skeleton (void)
true, filter_fd); true, filter_fd);
} }
free (skeldir);
free (m4sugar); free (m4sugar);
free (m4bison); free (m4bison);
free (skel); free (skel);
@@ -680,10 +682,12 @@ prepare (void)
/* About the skeletons. */ /* About the skeletons. */
{ {
/* b4_pkgdatadir is used inside m4_include in the skeletons, so digraphs /* b4_skeletonsdir is used inside m4_include in the skeletons, so digraphs
would never be expanded. Hopefully no one has M4-special characters in would never be expanded. Hopefully no one has M4-special characters in
his Bison installation path. */ his Bison installation path. */
MUSCLE_INSERT_STRING_RAW ("pkgdatadir", pkgdatadir ()); char *skeldir = xpath_join (pkgdatadir (), "skeletons");
MUSCLE_INSERT_STRING_RAW ("skeletonsdir", skeldir);
free (skeldir);
} }
} }