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)
14 AC_SUBST(GNOME_LIBDIR)
15 AC_SUBST(GNOME_INCLUDEDIR)
17 AC_PATH_PROG(GNOME_CONFIG,gnome-config,no)
18 if test "$GNOME_CONFIG" = "no"; then
21 AC_MSG_CHECKING(if $GNOME_CONFIG works)
22 if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then
25 GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome`"
26 GNOMEUI_LIBS="`$GNOME_CONFIG --libs-only-l gnomeui`"
27 GNOMEGNORBA_LIBS="`$GNOME_CONFIG --libs-only-l gnorba gnomeui`"
28 GTKXMHTML_LIBS="`$GNOME_CONFIG --libs-only-l gtkxmhtml`"
29 GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`"
30 GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`"
38 if test x$exec_prefix = xNONE; then
39 if test x$prefix = xNONE; then
40 gnome_prefix=$ac_default_prefix/lib
42 gnome_prefix=$prefix/lib
45 gnome_prefix=`eval echo \`echo $libdir\``
48 AC_ARG_WITH(gnome-includes,
49 [ --with-gnome-includes Specify location of GNOME headers],[
50 CFLAGS="$CFLAGS -I$withval"
53 AC_ARG_WITH(gnome-libs,
54 [ --with-gnome-libs Specify location of GNOME libs],[
55 LDFLAGS="$LDFLAGS -L$withval"
60 [ --with-gnome Specify prefix for GNOME files],[
61 if test x$withval = xyes; then
62 dnl Note that an empty true branch is not valid sh syntax.
63 ifelse([$1], [], :, [$1])
65 LDFLAGS="$LDFLAGS -L$withval/lib"
66 CFLAGS="$CFLAGS -I$withval/include"
67 gnome_prefix=$withval/lib
71 if test "$no_gnome_config" = "yes"; then
72 AC_MSG_CHECKING(for gnomeConf.sh file in $gnome_prefix)
73 if test -f $gnome_prefix/gnomeConf.sh; then
75 echo "loading gnome configuration from $gnome_prefix/gnomeConf.sh"
76 . $gnome_prefix/gnomeConf.sh
79 AC_MSG_RESULT(not found)
80 if test x$2 = xfail; then
81 AC_MSG_ERROR(Could not find the gnomeConf.sh file that is generated by gnome-libs install)
87 AC_DEFUN([GNOME_INIT],[
88 GNOME_INIT_HOOK([],fail)