1#! /bin/sh
2#
3# nana - generates a set of gdb(1) commands from the inputs source files.
4#
5# Arguments: a list of C/C++ source code plus the usual C flags. Note
6#   that all the -D, -I options passed to nana(1) must be the same as
7#   those passed to the orginal compile.
8#
9# Strangeness: since this command gets passed compile options (e.g. -lm)
10#    we need to strip these out before passing to CPP lest we get errors.
11#    For now I've just copped out and redirected stderr to /dev/null
12#
13#
14# Copyright (c) 1997 Phil Maker
15# All rights reserved.
16#
17# Redistribution and use in source and binary forms, with or without
18# modification, are permitted provided that the following conditions
19# are met:
20# 1. Redistributions of source code must retain the above copyright
21#    notice, this list of conditions and the following disclaimer.
22# 2. Redistributions in binary form must reproduce the above copyright
23#    notice, this list of conditions and the following disclaimer in the
24#    documentation and/or other materials provided with the distribution.
25#
26# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
27# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
30# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36# SUCH DAMAGE.
37#
38# Id: nana.in,v 1.1.1.1 1997/11/23 11:45:50 pjm Exp
39
40
41prefix=@prefix@
42exec_prefix=@exec_prefix@
43
44case $1
45in
46    --version)
47	  echo "nana (GNU @PACKAGE@) @VERSION@"
48	  echo "Copyright (C) 1997 Phil Maker"
49	  echo "Nana comes with NO WARRANTY, to the extent permitted by law."
50	  echo "You may redistribute copies of nana without charge."
51	  echo "See the file COPYING for more details."
52	  exit 0
53          ;;
54    --help)
55	  echo "usage: nana [gcc/g++ arguments ...]"
56	  echo ""
57	  echo "The arguments must be the same as those used to"
58	  echo "compile your program including all C preprocessor options"
59	  echo "such as -D or -I."
60	  echo ""
61	  echo "The output is a set of gdb(1) commands written to stdout"
62	  echo ""
63	  echo "See also:"
64	  echo "  <ftp://ftp.cs.ntu.edu.au/pub/nana>"
65	  echo "  <http://www.cs.ntu.edu.au/homepages/pjm/nana-home>"
66	  echo ""
67	  echo "Report suggestions to majordomo list - nana@it.ntu.edu.au"
68	  echo "Report bugs to nana-bug@it.ntu.edu.au"
69	  exit 0
70	  ;;
71esac
72
73@CPP@ -D_NANA_FILTER_ $* 2>/dev/null | ${NANAEXECDIR-@libexecdir@}/nanafilter
74