Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/cqual devel/cqual: fix build for newer Emacs ver...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ebe9cad2b313
branches:  trunk
changeset: 432625:ebe9cad2b313
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat May 23 18:11:53 2020 +0000

description:
devel/cqual: fix build for newer Emacs versions

Building the code with Emacs 26 failed since the generated AST_types.h
contained only "nil" as the type definitions.

Luckily, Emacs 21 was still available, so the files were generated with
that.

diffstat:

 devel/cqual/Makefile           |    12 +-
 devel/cqual/files/AST_defs.c   |  1874 ++++++++++++++++++++++++++++++++++++++++
 devel/cqual/files/AST_parent.c |   371 +++++++
 devel/cqual/files/AST_print.c  |   810 +++++++++++++++++
 4 files changed, 3064 insertions(+), 3 deletions(-)

diffs (truncated from 3095 to 300 lines):

diff -r 9951300cd164 -r ebe9cad2b313 devel/cqual/Makefile
--- a/devel/cqual/Makefile      Sat May 23 17:43:22 2020 +0000
+++ b/devel/cqual/Makefile      Sat May 23 18:11:53 2020 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.29 2019/08/11 13:18:40 wiz Exp $
+# $NetBSD: Makefile,v 1.30 2020/05/23 18:11:53 rillig Exp $
 
 DISTNAME=              cqual-0.991
-PKGREVISION=           16
+PKGREVISION=           17
 CATEGORIES=            devel
 MASTER_SITES=          ${MASTER_SITE_SOURCEFORGE:=cqual/}
 
@@ -22,7 +22,13 @@
 
 .include "options.mk"
 
-.include "../../mk/bsd.prefs.mk"
+# These files used to be generated by an Emacs LISP file.
+# That file needed to be patched for Emacs 24 (see patch-src_build-basics_el
+# and patch-src_build-types_el), and with Emacs > 24 it doesn't work at all.
+# All generated types became nil, which led to compile errors.
+post-patch:
+       cd ${FILESDIR} && ${CP} *.c ${WRKSRC}/src
+       cd ${WRKSRC}/src && ${TOUCH} AST_defs.h AST_types.h
 
 .if ${OPSYS} == "SunOS" && ${OS_VERSION} == "5.8"
 pre-build:
diff -r 9951300cd164 -r ebe9cad2b313 devel/cqual/files/AST_defs.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/cqual/files/AST_defs.c      Sat May 23 18:11:53 2020 +0000
@@ -0,0 +1,1874 @@
+/* Automatically generated from nodetypes.def, do not edit. */
+
+/* See the copyright notice in nodetypes.def */
+node new_node(region r, location loc)
+{
+  node obj = ralloc(r, struct AST_node);
+
+  obj->kind = kind_node;
+  obj->loc = loc;
+
+  return obj;
+}
+
+declaration new_declaration(region r, location loc)
+{
+  declaration obj = ralloc(r, struct AST_declaration);
+
+  obj->kind = kind_declaration;
+  obj->loc = loc;
+
+  return obj;
+}
+
+statement new_statement(region r, location loc)
+{
+  statement obj = ralloc(r, struct AST_statement);
+
+  obj->kind = kind_statement;
+  obj->loc = loc;
+
+  return obj;
+}
+
+expression new_expression(region r, location loc)
+{
+  expression obj = ralloc(r, struct AST_expression);
+
+  obj->kind = kind_expression;
+  obj->loc = loc;
+
+  return obj;
+}
+
+type_element new_type_element(region r, location loc)
+{
+  type_element obj = ralloc(r, struct AST_type_element);
+
+  obj->kind = kind_type_element;
+  obj->loc = loc;
+
+  return obj;
+}
+
+declarator new_declarator(region r, location loc)
+{
+  declarator obj = ralloc(r, struct AST_declarator);
+
+  obj->kind = kind_declarator;
+  obj->loc = loc;
+
+  return obj;
+}
+
+label new_label(region r, location loc)
+{
+  label obj = ralloc(r, struct AST_label);
+
+  obj->kind = kind_label;
+  obj->loc = loc;
+
+  return obj;
+}
+
+asm_decl new_asm_decl(region r, location loc, asm_stmt asm_stmt)
+{
+  asm_decl obj = ralloc(r, struct AST_asm_decl);
+
+  obj->kind = kind_asm_decl;
+  obj->loc = loc;
+  obj->asm_stmt = asm_stmt;
+
+  return obj;
+}
+
+data_decl new_data_decl(region r, location loc, type_element modifiers, attribute attributes, declaration decls)
+{
+  data_decl obj = ralloc(r, struct AST_data_decl);
+
+  obj->kind = kind_data_decl;
+  obj->loc = loc;
+  obj->modifiers = modifiers;
+  obj->attributes = attributes;
+  obj->decls = decls;
+
+  return obj;
+}
+
+extension_decl new_extension_decl(region r, location loc, declaration decl)
+{
+  extension_decl obj = ralloc(r, struct AST_extension_decl);
+
+  obj->kind = kind_extension_decl;
+  obj->loc = loc;
+  obj->decl = decl;
+
+  return obj;
+}
+
+ellipsis_decl new_ellipsis_decl(region r, location loc, type_element qualifiers)
+{
+  ellipsis_decl obj = ralloc(r, struct AST_ellipsis_decl);
+
+  obj->kind = kind_ellipsis_decl;
+  obj->loc = loc;
+  obj->qualifiers = qualifiers;
+
+  return obj;
+}
+
+enumerator new_enumerator(region r, location loc, cstring cstring, expression arg1, data_declaration ddecl)
+{
+  enumerator obj = ralloc(r, struct AST_enumerator);
+
+  obj->kind = kind_enumerator;
+  obj->loc = loc;
+  obj->cstring = cstring;
+  obj->arg1 = arg1;
+  obj->ddecl = ddecl;
+
+  return obj;
+}
+
+oldidentifier_decl new_oldidentifier_decl(region r, location loc, cstring cstring, data_declaration ddecl)
+{
+  oldidentifier_decl obj = ralloc(r, struct AST_oldidentifier_decl);
+
+  obj->kind = kind_oldidentifier_decl;
+  obj->loc = loc;
+  obj->cstring = cstring;
+  obj->ddecl = ddecl;
+
+  return obj;
+}
+
+function_decl new_function_decl(region r, location loc, declarator declarator, type_element qualifiers, attribute attributes, declaration old_parms, statement stmt, function_decl parent_function, 
data_declaration ddecl)
+{
+  function_decl obj = ralloc(r, struct AST_function_decl);
+
+  obj->kind = kind_function_decl;
+  obj->loc = loc;
+  obj->declarator = declarator;
+  obj->qualifiers = qualifiers;
+  obj->attributes = attributes;
+  obj->old_parms = old_parms;
+  obj->stmt = stmt;
+  obj->parent_function = parent_function;
+  obj->ddecl = ddecl;
+
+  return obj;
+}
+
+implicit_decl new_implicit_decl(region r, location loc, identifier ident)
+{
+  implicit_decl obj = ralloc(r, struct AST_implicit_decl);
+
+  obj->kind = kind_implicit_decl;
+  obj->loc = loc;
+  obj->ident = ident;
+
+  return obj;
+}
+
+variable_decl new_variable_decl(region r, location loc, declarator declarator, attribute attributes, expression arg1, asm_stmt asm_stmt, data_declaration ddecl)
+{
+  variable_decl obj = ralloc(r, struct AST_variable_decl);
+
+  obj->kind = kind_variable_decl;
+  obj->loc = loc;
+  obj->declarator = declarator;
+  obj->attributes = attributes;
+  obj->arg1 = arg1;
+  obj->asm_stmt = asm_stmt;
+  obj->ddecl = ddecl;
+
+  return obj;
+}
+
+field_decl new_field_decl(region r, location loc, declarator declarator, attribute attributes, expression arg1)
+{
+  field_decl obj = ralloc(r, struct AST_field_decl);
+
+  obj->kind = kind_field_decl;
+  obj->loc = loc;
+  obj->declarator = declarator;
+  obj->attributes = attributes;
+  obj->arg1 = arg1;
+
+  return obj;
+}
+
+asttype new_asttype(region r, location loc, declarator declarator, type_element qualifiers)
+{
+  asttype obj = ralloc(r, struct AST_asttype);
+
+  obj->kind = kind_asttype;
+  obj->loc = loc;
+  obj->declarator = declarator;
+  obj->qualifiers = qualifiers;
+
+  return obj;
+}
+
+typename new_typename(region r, location loc, data_declaration ddecl)
+{
+  typename obj = ralloc(r, struct AST_typename);
+
+  obj->kind = kind_typename;
+  obj->loc = loc;
+  obj->ddecl = ddecl;
+
+  return obj;
+}
+
+type_variable new_type_variable(region r, location loc, cstring cstring)
+{
+  type_variable obj = ralloc(r, struct AST_type_variable);
+
+  obj->kind = kind_type_variable;
+  obj->loc = loc;
+  obj->cstring = cstring;
+
+  return obj;
+}
+
+typeof_expr new_typeof_expr(region r, location loc, expression arg1)
+{
+  typeof_expr obj = ralloc(r, struct AST_typeof_expr);
+
+  obj->kind = kind_typeof_expr;
+  obj->loc = loc;
+  obj->arg1 = arg1;
+
+  return obj;
+}
+
+typeof_type new_typeof_type(region r, location loc, asttype asttype)
+{
+  typeof_type obj = ralloc(r, struct AST_typeof_type);
+
+  obj->kind = kind_typeof_type;
+  obj->loc = loc;
+  obj->asttype = asttype;
+
+  return obj;
+}
+
+attribute new_attribute(region r, location loc, word word1, word word2, expression args)
+{
+  attribute obj = ralloc(r, struct AST_attribute);
+
+  obj->kind = kind_attribute;
+  obj->loc = loc;
+  obj->word1 = word1;
+  obj->word2 = word2;
+  obj->args = args;
+
+  return obj;
+}



Home | Main Index | Thread Index | Old Index