2 dnl GNOME_INIT_HOOK (script-if-gnome-enabled, [failflag], [additional-inits])
4 dnl if failflag is "fail" then GNOME_INIT_HOOK will abort if gnomeConf.sh
8 AC_DEFUN([GNOME_INIT_HOOK],[
10 AC_SUBST(GNOMEUI_LIBS)
11 AC_SUBST(GNOMEGNORBA_LIBS)
12 AC_SUBST(GTKXMHTML_LIBS)
14 AC_SUBST(GNOME_LIBDIR)
15 AC_SUBST(GNOME_INCLUDEDIR)
17 AC_ARG_WITH(gnome-includes,
18 [ --with-gnome-includes Specify location of GNOME headers],[
19 CFLAGS="$CFLAGS -I$withval"
22 AC_ARG_WITH(gnome-libs,
23 [ --with-gnome-libs Specify location of GNOME libs],[
24 LDFLAGS="$LDFLAGS -L$withval"
29 [ --with-gnome Specify prefix for GNOME files],
30 if test x$withval = xyes; then
32 dnl Note that an empty true branch is not
34 ifelse([$1], [], :, [$1])
36 if test "x$withval" = xno; then
40 LDFLAGS="$LDFLAGS -L$withval/lib"
41 CFLAGS="$CFLAGS -I$withval/include"
42 gnome_prefix=$withval/lib
47 if test "x$want_gnome" = xyes; then
49 AC_PATH_PROG(GNOME_CONFIG,gnome-config,no)
50 if test "$GNOME_CONFIG" = "no"; then
53 AC_MSG_CHECKING(if $GNOME_CONFIG works)
54 if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then
56 GNOME_GNORBA_HOOK([],$2)
57 GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome`"
58 GNOMEUI_LIBS="`$GNOME_CONFIG --libs-only-l gnomeui`"
59 GNOMEGNORBA_LIBS="`$GNOME_CONFIG --libs-only-l gnorba gnomeui`"
60 GTKXMHTML_LIBS="`$GNOME_CONFIG --libs-only-l gtkxmhtml`"
61 ZVT_LIBS="`$GNOME_CONFIG --libs-only-l zvt`"
62 GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`"
63 GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`"
71 if test x$exec_prefix = xNONE; then
72 if test x$prefix = xNONE; then
73 gnome_prefix=$ac_default_prefix/lib
75 gnome_prefix=$prefix/lib
78 gnome_prefix=`eval echo \`echo $libdir\``
81 if test "$no_gnome_config" = "yes"; then
82 AC_MSG_CHECKING(for gnomeConf.sh file in $gnome_prefix)
83 if test -f $gnome_prefix/gnomeConf.sh; then
85 echo "loading gnome configuration from" \
86 "$gnome_prefix/gnomeConf.sh"
87 . $gnome_prefix/gnomeConf.sh
90 AC_MSG_RESULT(not found)
91 if test x$2 = xfail; then
92 AC_MSG_ERROR(Could not find the gnomeConf.sh file that is generated by gnome-libs install)
101 AC_MSG_CHECKING(extra library \"$i\")
104 AC_SUBST(GNOME_APPLETS_LIBS)
105 GNOME_APPLETS_LIBS=`$GNOME_CONFIG --libs-only-l applets`
106 AC_MSG_RESULT($GNOME_APPLETS_LIBS);;
108 AC_SUBST(GNOME_DOCKLETS_LIBS)
109 GNOME_DOCKLETS_LIBS=`$GNOME_CONFIG --libs-only-l docklets`
110 AC_MSG_RESULT($GNOME_DOCKLETS_LIBS);;
112 AC_SUBST(GNOME_CAPPLET_LIBS)
113 GNOME_CAPPLET_LIBS=`$GNOME_CONFIG --libs-only-l capplet`
114 AC_MSG_RESULT($GNOME_CAPPLET_LIBS);;
116 AC_MSG_RESULT(unknown library)
123 dnl GNOME_INIT ([additional-inits])
126 AC_DEFUN([GNOME_INIT],[
127 GNOME_INIT_HOOK([],fail,$1)