Add "stamp-h1", for automake 1.6.1, as per Joerg Mayer's suggestion.
[obnox/wireshark/wip.git] / idl2eth.sh
1 #! @SHELL@
2 #
3 #  $Id: idl2eth.sh,v 1.1 2001/09/15 23:01:12 guy Exp $
4 #
5 #  File : idl2eth          
6 #
7 #  Author : Frank Singleton (frank.singleton@ericsson.com)
8 #
9 #  Copyright (C) 2001 Frank Singleton, Ericsson Inc.
10 #
11 #  This file is a simple shell script wrapper for the IDL to 
12 #  Ethereal dissector code.
13 #
14 #  ie: ethereal_be.py and ethereal_gen.py
15 #
16 #  This file is used to generate "Ethereal" dissectors from IDL descriptions. 
17 #  The output language generated is "C". It will generate code to use the 
18 #  GIOP/IIOP get_CDR_XXX API.
19 #
20 #  Please see packet-giop.h in Ethereal distro for API description.
21 #  Ethereal is available at http://www.ethereal.com/
22 #
23 #  Omniidl is part of the OmniOrb distribution, and is available at
24 #  http://www.uk.research.att.com/omniORB/omniORB.html
25 #
26 #  This program is free software; you can redistribute it and/or modify it
27 #  under the terms of the GNU General Public License as published by
28 #  the Free Software Foundation; either version 2 of the License, or
29 #  (at your option) any later version.
30 #
31 #  This program is distributed in the hope that it will be useful,
32 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
33 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
34 #  General Public License for more details.
35 #
36 #  You should have received a copy of the GNU General Public License
37 #  along with this program; if not, write to the Free Software
38 #  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
39 #  02111-1307, USA.
40 #
41
42
43 #  Must at least supply an IDL file
44
45 if [ $# -lt 1 ]; then
46     echo "idl2eth Error: no IDL file specified."
47     echo "Usage: idl2eth idl_file_name"
48     exit 1;
49 fi
50
51 #
52 # Run ethereal backend, looking for ethereal_be.py and ethereal_gen.py
53 # in pythons's "site-packages" directory. If cannot find that, then
54 # try looking in current directory. If still cannot, then exit with
55 # error.
56
57 if [ -f $PYTHONPATH/site-packages/ethereal_be.py ] && [ -f $PYTHONPATH/site-packages/ethereal_gen.py ]; then
58     omniidl  -p $PYTHONPATH/site-packages -b ethereal_be $1
59     exit $?
60 fi
61
62 # Try current directory.
63
64 if [ -f ./ethereal_be.py ] && [ -f ./ethereal_gen.py ]; then
65     omniidl  -p ./ -b ethereal_be $1
66     exit $?
67 fi
68
69 # Could not find both ethereal_be.py AND ethereal_gen.py
70
71 echo "idl2eth Error: Could not find both ethereal_be.py AND ethereal_gen.py."
72 echo "Please ensure you have the PYTHONPATH variable set, or that ethereal_be.py "
73 echo "and ethereal_gen.py exist in the current directory. "
74 echo
75 echo "On this system, PYTHONPATH is : $PYTHONPATH"
76 echo
77
78 exit 2
79
80
81