Do not give a warning for not implemented OID if value is a "NULL tag".
[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 GLib's aclocal macros.  (We assume GTK+ is installed in the
5 # same place as GLib.)
6 #
7 # aclocal will search, by default, only in a directory in the same
8 # tree where it was installed - e.g., if installed in "/usr/bin", it'll
9 # search only in "/usr/share/aclocal", and if installed in "/usr/local/bin",
10 # it'll search only in "/usr/local/share/aclocal".
11 #
12 # However, there is no guarantee that GLib has been installed there; if
13 # it's not, it won't find the GLib autoconf macros, and will complain
14 # bitterly.
15 #
16 # So, if the "share/local" directory under the directory reported by
17 # "pkg-config --variable=prefix glib-2.0" isn't the same directory as
18 # the directory reported by "aclocal --print-ac-dir", we return a "-I"
19 # flag with the first of those directories as the argument.
20 #
21 # (If they *are* the same directory, and we supply that "-I" flag,
22 # "aclocal" will look in that directory twice, and get well and truly
23 # confused, reporting a ton of duplicate macro definitions.)
24 #
25 # $Id$
26 #
27
28 #
29 # OK, where will aclocal look by default?
30 #
31 aclocal_dir=`aclocal --print-ac-dir`
32
33 #
34 # And where do we want to make sure it looks?
35 #
36 glib_prefix=`pkg-config --variable=prefix glib-2.0 2>/dev/null`
37
38 if [ -z "$glib_prefix" ]
39 then
40         glib_aclocal_dir=""
41 else
42         glib_aclocal_dir=$glib_prefix/share/aclocal
43 fi
44
45 ac_missing_dir=`dirname $0`
46 echo "-I $ac_missing_dir/aclocal-fallback" | tr -d '\012' | tr -d '\015'
47
48 #
49 # If there's no "aclocal", the former will be empty; if there's no
50 # "pkg-config" or it doesn't know about glib-2.0, the latter will be
51 # empty.
52 #
53 # Add the "-I" flag only if neither of those strings are empty, and
54 # they're different.
55 #
56 if [ ! -z "$aclocal_dir" -a ! -z "$glib_aclocal_dir" \
57     -a "$aclocal_dir" != "$glib_aclocal_dir" ]
58 then
59         echo " -I $glib_aclocal_dir" | tr -d '\012' | tr -d '\015'
60 fi
61 echo
62 exit 0