Adds Payload AVP to PduDef AVPLs simmetric to the Transport AVP
[obnox/wireshark/wip.git] / aclocal-flags
1 #!/bin/sh
2 #
3 # This script returns the flags to be fed to "aclocal" to ensure that
4 # it finds GTK+'s aclocal macros.
5 #
6 # aclocal will search, by default, only in a directory in the same
7 # tree where it was installed - e.g., if installed in "/usr/bin", it'll
8 # search only in "/usr/share/aclocal", and if installed in "/usr/local/bin",
9 # it'll search only in "/usr/local/share/aclocal".
10 #
11 # However, there is no guarantee that GTK+ has been installed there; if
12 # it's not, it won't find the GTK+ autoconf macros, and will complain
13 # bitterly.
14 #
15 # So, if the "share/local" directory under the directory reported by
16 # "gtk-config --prefix" isn't the same directory as the directory
17 # reported by "aclocal --print-ac-dir", we return a "-I" flag with
18 # the first of those directories as the argument.
19 #
20 # (If they *are* the same directory, and we supply that "-I" flag,
21 # "aclocal" will look in that directory twice, and get well and truly
22 # confused, reporting a ton of duplicate macro definitions.)
23 #
24 # $Id$
25 #
26
27 #
28 # OK, where will aclocal look by default?
29 #
30 aclocal_dir=`aclocal --print-ac-dir`
31
32 #
33 # And where do we want to make sure it looks?
34 #
35 gtk_prefix=`gtk-config --prefix 2>/dev/null`
36
37 if [ -z "$gtk_prefix" ]
38 then
39         gtk_aclocal_dir=""
40 else
41         gtk_aclocal_dir=$gtk_prefix/share/aclocal
42 fi
43
44 ac_missing_dir=`dirname $0`
45 echo "-I $ac_missing_dir/aclocal-fallback" | tr -d '\012' | tr -d '\015'
46
47 #
48 # If there's no "aclocal", the former will be empty; if there's no
49 # "gtk-config", the latter will be empty.
50 #
51 # Add the "-I" flag only if neither of those strings are empty, and
52 # they're different.
53 #
54 if [ ! -z "$aclocal_dir" -a ! -z "$gtk_aclocal_dir" \
55     -a "$aclocal_dir" != "$gtk_aclocal_dir" ]
56 then
57         echo " -I $gtk_aclocal_dir" | tr -d '\012' | tr -d '\015'
58 fi
59 echo
60 exit 0