source: rtems/c/src/librdbg/src/awk.svc @ 49fa9bc

4.104.114.84.95
Last change on this file since 49fa9bc was 4c3ab846, checked in by Joel Sherrill <joel.sherrill@…>, on 01/13/00 at 21:07:22

Patch rtems-rc-20000104-17.diff from Ralf Corsepius <corsepiu@…>
that addresses the librdbg/rpcgen related problems:

Changes:

  • All rpcgen generated files are now kept inside of the source tree
  • Fix librdbg/configure to correctly detect presence of rpcgen and awk
  • Use rpcgen -m to generated remdeb_svc.c
  • Remove msgout/_msgout from awk.svc
  • minor cleanups to librdbg/configure.in

ATTENTION --- IMPORTANT:

  • With keeping rpc-generated files pre-build inside of the source tree, you as the packager of RTEMS have to ensure that timestamps are correctly set up: The generated files must not be older than the *.x files.
  • This is extraordinarily important when
    • putting the package on read-only media
    • after checking out from CVS
    • after modifications to the *.x files
  • If one of the *.x files is modified you have to either
    • build for i386/pc386 and powerpc/mcp750
    • or to invoke the same rpcgen calls as the librdbg/src/<cpu>/<bsp>/Makefile.am do manually before checking-in the files to CVS.

Proposal:

We could add something to bootstrap for touching the rpcgen-generated
sources and/or to manually regenerate them.

NOTE FROM JOEL:

Ralf proposed modifying bootstrap to handle rpcgen. I think this
is the best solution as it is something already done in the
snapshot procedure.

  • Property mode set to 100644
File size: 1.5 KB
Line 
1#########################################################################
2#
3#  Component:   RDBG
4#  Module:      awk.svc
5#
6#  Synopsis:    AWK script which transforms the server skeleton produced
7#               by rpcgen(1) into something suitable for RDB servers.
8#
9#########################################################################
10#
11# $Id$
12#
13BEGIN {
14    headerstarted = 0
15    withinproc = 0
16    brack = 0
17}
18
19$1 ~ /^\/\*HEADER_START\*\/$/ {
20    headerstarted = 1
21    printf("#include <rpc/types.h>\n");
22    printf("#include <rpc/rpc.h>\n");
23    printf("#include <stdio.h>\n");
24    printf("#include <stdlib.h>\n");
25    printf("#include <string.h>\n");
26    printf("#include <bsp.h>\n");
27    printf("#include <rdbg/servrpc.h>\n");
28    printf("#include <rdbg/%s>\n", THEPROG);
29    printf("#define fprintf(a,b) printf(b)\n");
30}
31
32$1 ~ /^\/\*HEADER_END\*\/$/ {
33    headerstarted = 0
34}
35
36{
37    if (headerstarted == 1) {
38        print $0
39    } else if ($1 ~ /.*_2.*/) {
40        withinproc = 1
41        printf("void\n");
42        print $0
43    } else if (withinproc == 1) {
44        if ($1 == "switch") {
45            print "\tDPRINTF ((\"remotedeb_2: %s (%d)\\n\", "
46            print "\t\t(unsigned) rqstp->rq_proc < "
47            print "\t\t(unsigned) (sizeof names / sizeof names[0]) ?"
48            print "\t\tnames [rqstp->rq_proc] : \"???\", "
49            print "\t\t(int) rqstp->rq_proc));\n"
50        }
51        for (i = 1; i <= NF; i++) {
52            if ($i == "{") {
53                brack++;
54            } else if ($i == "}") {
55                brack--;
56                if (brack == 0) {
57                    withinproc = 0;
58                }
59            }
60        }
61        if ($1 != "_rpcsvcdirty" ) {
62            print $0
63        }
64    }
65}
Note: See TracBrowser for help on using the repository browser.