3 # This script returns the flags to be fed to "aclocal" to ensure that
4 # it finds GTK+'s aclocal macros.
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".
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
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.
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.)
24 # $Id: aclocal-flags,v 1.7 2003/01/22 15:58:33 gerald Exp $
28 # OK, where will aclocal look by default?
30 aclocal_dir=`aclocal --print-ac-dir`
33 # And where do we want to make sure it looks?
35 gtk_prefix=`gtk-config --prefix`
37 if [ -z "$gtk_prefix" ]
41 gtk_aclocal_dir=$gtk_prefix/share/aclocal
44 ac_missing_dir=`dirname $0`
45 echo "-I $ac_missing_dir/aclocal-missing" | tr -d '\012' | tr -d '\015'
48 # If there's no "aclocal", the former will be empty; if there's no
49 # "gtk-config", the latter will be empty.
51 # Add the "-I" flag only if neither of those strings are empty, and
54 if [ ! -z "$aclocal_dir" -a ! -z "$gtk_aclocal_dir" \
55 -a "$aclocal_dir" != "$gtk_aclocal_dir" ]
57 echo " -I $gtk_aclocal_dir" | tr -d '\012' | tr -d '\015'