#!/bin/sh

# munch - a sleazy hack for a wind river tool that I don't have.
# It is part of C++ support and gathers up constructor and
# destructor declarations or some such thing.

# The real tool is used something like this:
# nm a.out.file | munch >ctdt.c

# what I do is ignore standard input and just emit a fixed file.
# (namely, exactly what gets generated for the wind kernel
#  when I build it on a sun host).
# works for me!

cat <<END_OF_WORLD
/* ctors and dtors arrays -- to be used by runtime system */
/*   to call static constructors and destructors          */
/*                                                        */
/* NOTE: Use a C compiler to compile this file. If you    */
/*       are using GNU C++, be sure to use compile this   */
/*       file using GNU C and the -traditional flag.      */

typedef void (*VOIDFUNCPTR) ();	/* ptr to function returning void */


extern VOIDFUNCPTR _ctors[];
VOIDFUNCPTR _ctors[] =
    {
    0
    };


extern VOIDFUNCPTR _dtors[];
VOIDFUNCPTR _dtors[] =
    {
    0
    };
END_OF_WORLD