munch.pl

# NAME

munch.pl - Combine C++ static constructors and destructors for libraries

# SYNOPSIS

munch.pl [-h] [-o file_ctdt.c] file.nm

# DESCRIPTION

Creates a ctdt.c file of C++ static constructors and destructors, as required for all vxWorks binaries containing C++ code. The VxWorks linking loader and unloader only call one constructor function, so the code generated by this script is needed to ensure that all the static constructors and destructors in the library module will be executed at the appropriate time.

The file input to this function is generated by running the nm program on the library concerned. The processing algorithm was reverse-engineered from the munch.tcl scripts provided with various versions of VxWorks up to 6.9.

# OPTIONS

munch.pl understands the following options:

-h

  Help, display this document as text.

-o file_ctdt.c

  Name of the output file to be created.

If no output filename is set with a -o option, the generated C code will be sent to the standard output stream.

# COPYRIGHT AND LICENSE

Copyright (C) 2013 UChicago Argonne LLC, as Operator of Argonne National Laboratory.

This software is distributed under the terms of the EPICS Open License.