2 dnl GNOME_INIT_HOOK (script-if-gnome-enabled, failflag)
4 dnl if failflag is "fail" then GNOME_INIT_HOOK will abort if gnomeConf.sh
8 AC_DEFUN([GNOME_INIT_HOOK],
11 AC_SUBST(GNOMEUI_LIBS)
12 AC_SUBST(GNOMEGNORBA_LIBS)
13 AC_SUBST(GTKXMHTML_LIBS)
15 AC_SUBST(GNOME_APPLET_LIBS)
16 AC_SUBST(GNOME_LIBDIR)
17 AC_SUBST(GNOME_INCLUDEDIR)
19 AC_ARG_WITH(gnome-includes,
20 [ --with-gnome-includes Specify location of GNOME headers],[
21 CFLAGS="$CFLAGS -I$withval"
24 AC_ARG_WITH(gnome-libs,
25 [ --with-gnome-libs Specify location of GNOME libs],[
26 LDFLAGS="$LDFLAGS -L$withval"
31 [ --with-gnome Specify prefix for GNOME files],
32 if test x$withval = xyes; then
34 dnl Note that an empty true branch is not
36 ifelse([$1], [], :, [$1])
38 if test "x$withval" = xno; then
42 LDFLAGS="$LDFLAGS -L$withval/lib"
43 CFLAGS="$CFLAGS -I$withval/include"
44 gnome_prefix=$withval/lib
49 if test "x$want_gnome" = xyes; then
51 AC_PATH_PROG(GNOME_CONFIG,gnome-config,no)
52 if test "$GNOME_CONFIG" = "no"; then
55 AC_MSG_CHECKING(if $GNOME_CONFIG works)
56 if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then
58 GNOME_GNORBA_HOOK([],$2)
59 GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome`"
60 GNOMEUI_LIBS="`$GNOME_CONFIG --libs-only-l gnomeui`"
61 GNOMEGNORBA_LIBS="`$GNOME_CONFIG --libs-only-l gnorba gnomeui`"
62 GTKXMHTML_LIBS="`$GNOME_CONFIG --libs-only-l gtkxmhtml`"
63 ZVT_LIBS="`$GNOME_CONFIG --libs-only-l zvt`"
64 GNOME_APPLET_LIBS="`$GNOME_CONFIG --libs-only-l applets`"
65 GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`"
66 GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`"
74 if test x$exec_prefix = xNONE; then
75 if test x$prefix = xNONE; then
76 gnome_prefix=$ac_default_prefix/lib
78 gnome_prefix=$prefix/lib
81 gnome_prefix=`eval echo \`echo $libdir\``
84 if test "$no_gnome_config" = "yes"; then
85 AC_MSG_CHECKING(for gnomeConf.sh file in $gnome_prefix)
86 if test -f $gnome_prefix/gnomeConf.sh; then
88 echo "loading gnome configuration from" \
89 "$gnome_prefix/gnomeConf.sh"
90 . $gnome_prefix/gnomeConf.sh
93 AC_MSG_RESULT(not found)
94 if test x$2 = xfail; then
95 AC_MSG_ERROR(Could not find the gnomeConf.sh file that is generated by gnome-libs install)
102 AC_DEFUN([GNOME_INIT],[
103 GNOME_INIT_HOOK([],fail)