2000-08-14 09:44:53 +00:00
|
|
|
dnl
|
|
|
|
dnl GNOME_INIT_HOOK (script-if-gnome-enabled, [failflag], [additional-inits])
|
|
|
|
dnl
|
|
|
|
dnl if failflag is "fail" then GNOME_INIT_HOOK will abort if gnomeConf.sh
|
2004-10-28 14:35:53 +00:00
|
|
|
dnl is not found.
|
2000-08-14 09:44:53 +00:00
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_DEFUN([GNOME_INIT_HOOK],[
|
|
|
|
AC_SUBST(GNOME_LIBS)
|
|
|
|
AC_SUBST(GNOMEUI_LIBS)
|
|
|
|
AC_SUBST(GNOMEGNORBA_LIBS)
|
|
|
|
AC_SUBST(GTKXMHTML_LIBS)
|
|
|
|
AC_SUBST(ZVT_LIBS)
|
|
|
|
AC_SUBST(GNOME_LIBDIR)
|
|
|
|
AC_SUBST(GNOME_INCLUDEDIR)
|
|
|
|
|
|
|
|
AC_ARG_WITH(gnome-includes,
|
|
|
|
[ --with-gnome-includes Specify location of GNOME headers],[
|
|
|
|
CFLAGS="$CFLAGS -I$withval"
|
|
|
|
])
|
2004-10-28 14:35:53 +00:00
|
|
|
|
2000-08-14 09:44:53 +00:00
|
|
|
AC_ARG_WITH(gnome-libs,
|
|
|
|
[ --with-gnome-libs Specify location of GNOME libs],[
|
|
|
|
LDFLAGS="$LDFLAGS -L$withval"
|
|
|
|
gnome_prefix=$withval
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_ARG_WITH(gnome,
|
|
|
|
[ --with-gnome Specify prefix for GNOME files],
|
|
|
|
if test x$withval = xyes; then
|
2004-05-25 14:42:10 +00:00
|
|
|
want_gnome=yes
|
|
|
|
dnl Note that an empty true branch is not
|
2000-08-14 09:44:53 +00:00
|
|
|
dnl valid sh syntax.
|
2004-05-25 14:42:10 +00:00
|
|
|
ifelse([$1], [], :, [$1])
|
|
|
|
else
|
|
|
|
if test "x$withval" = xno; then
|
|
|
|
want_gnome=no
|
|
|
|
else
|
|
|
|
want_gnome=yes
|
|
|
|
LDFLAGS="$LDFLAGS -L$withval/lib"
|
|
|
|
CFLAGS="$CFLAGS -I$withval/include"
|
|
|
|
gnome_prefix=$withval/lib
|
|
|
|
fi
|
|
|
|
fi,
|
2000-08-14 09:44:53 +00:00
|
|
|
want_gnome=yes)
|
|
|
|
|
|
|
|
if test "x$want_gnome" = xyes; then
|
|
|
|
|
|
|
|
AC_PATH_PROG(GNOME_CONFIG,gnome-config,no)
|
|
|
|
if test "$GNOME_CONFIG" = "no"; then
|
|
|
|
no_gnome_config="yes"
|
|
|
|
else
|
|
|
|
AC_MSG_CHECKING(if $GNOME_CONFIG works)
|
|
|
|
if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then
|
2004-05-25 14:42:10 +00:00
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
GNOME_GNORBA_HOOK([],$2)
|
|
|
|
GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome`"
|
|
|
|
GNOMEUI_LIBS="`$GNOME_CONFIG --libs-only-l gnomeui`"
|
|
|
|
GNOMEGNORBA_LIBS="`$GNOME_CONFIG --libs-only-l gnorba gnomeui`"
|
|
|
|
GTKXMHTML_LIBS="`$GNOME_CONFIG --libs-only-l gtkxmhtml`"
|
2000-08-14 09:44:53 +00:00
|
|
|
ZVT_LIBS="`$GNOME_CONFIG --libs-only-l zvt`"
|
2004-05-25 14:42:10 +00:00
|
|
|
GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`"
|
|
|
|
GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`"
|
|
|
|
$1
|
2000-08-14 09:44:53 +00:00
|
|
|
else
|
2004-05-25 14:42:10 +00:00
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
no_gnome_config="yes"
|
|
|
|
fi
|
|
|
|
fi
|
2000-08-14 09:44:53 +00:00
|
|
|
|
|
|
|
if test x$exec_prefix = xNONE; then
|
2004-05-25 14:42:10 +00:00
|
|
|
if test x$prefix = xNONE; then
|
2000-08-14 09:44:53 +00:00
|
|
|
gnome_prefix=$ac_default_prefix/lib
|
2004-05-25 14:42:10 +00:00
|
|
|
else
|
|
|
|
gnome_prefix=$prefix/lib
|
|
|
|
fi
|
2000-08-14 09:44:53 +00:00
|
|
|
else
|
2004-05-25 14:42:10 +00:00
|
|
|
gnome_prefix=`eval echo \`echo $libdir\``
|
2000-08-14 09:44:53 +00:00
|
|
|
fi
|
2004-10-28 14:35:53 +00:00
|
|
|
|
2000-08-14 09:44:53 +00:00
|
|
|
if test "$no_gnome_config" = "yes"; then
|
2004-05-25 14:42:10 +00:00
|
|
|
AC_MSG_CHECKING(for gnomeConf.sh file in $gnome_prefix)
|
2000-08-14 09:44:53 +00:00
|
|
|
if test -f $gnome_prefix/gnomeConf.sh; then
|
2004-05-25 14:42:10 +00:00
|
|
|
AC_MSG_RESULT(found)
|
|
|
|
echo "loading gnome configuration from" \
|
2000-08-14 09:44:53 +00:00
|
|
|
"$gnome_prefix/gnomeConf.sh"
|
2004-05-25 14:42:10 +00:00
|
|
|
. $gnome_prefix/gnomeConf.sh
|
|
|
|
$1
|
2000-08-14 09:44:53 +00:00
|
|
|
else
|
2004-05-25 14:42:10 +00:00
|
|
|
AC_MSG_RESULT(not found)
|
|
|
|
if test x$2 = xfail; then
|
|
|
|
AC_MSG_ERROR(Could not find the gnomeConf.sh file that is generated by gnome-libs install)
|
|
|
|
fi
|
2000-08-14 09:44:53 +00:00
|
|
|
fi
|
2004-05-25 14:42:10 +00:00
|
|
|
fi
|
2000-08-14 09:44:53 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test -n "$3"; then
|
|
|
|
n="$3"
|
|
|
|
for i in $n; do
|
|
|
|
AC_MSG_CHECKING(extra library \"$i\")
|
2004-10-28 14:35:53 +00:00
|
|
|
case $i in
|
2000-08-14 09:44:53 +00:00
|
|
|
applets)
|
|
|
|
AC_SUBST(GNOME_APPLETS_LIBS)
|
|
|
|
GNOME_APPLETS_LIBS=`$GNOME_CONFIG --libs-only-l applets`
|
|
|
|
AC_MSG_RESULT($GNOME_APPLETS_LIBS);;
|
|
|
|
docklets)
|
|
|
|
AC_SUBST(GNOME_DOCKLETS_LIBS)
|
|
|
|
GNOME_DOCKLETS_LIBS=`$GNOME_CONFIG --libs-only-l docklets`
|
|
|
|
AC_MSG_RESULT($GNOME_DOCKLETS_LIBS);;
|
|
|
|
capplet)
|
|
|
|
AC_SUBST(GNOME_CAPPLET_LIBS)
|
|
|
|
GNOME_CAPPLET_LIBS=`$GNOME_CONFIG --libs-only-l capplet`
|
|
|
|
AC_MSG_RESULT($GNOME_CAPPLET_LIBS);;
|
|
|
|
*)
|
|
|
|
AC_MSG_RESULT(unknown library)
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl GNOME_INIT ([additional-inits])
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_DEFUN([GNOME_INIT],[
|
|
|
|
GNOME_INIT_HOOK([],fail,$1)
|
|
|
|
])
|