gtkhtml - config.m4 - suggestions?
| From: | Alan Knowles | Date: | Sat, 22 Sep 2001 16:10:28 +0000 |
| Subject: | gtkhtml - config.m4 - suggestions? | ||
| Groups: | php.gtk.dev | ||
| Request: | Send a blank email to php-gtk-dev+get-68@lists.php.net to get a copy of this message | ||
below is the current working config.m4 for gtkhtml widget..
It uses gnome-config --cflags gtkhtml etc. to get the dependances.
one of the problems it does have is that libgtkhtml exports GTKHTML_HAVE_GCONF as a -D on the
--cflags output,
using PHP_EVAL_INCLINE($GTKHTML_CFLAGS) strips out the above flags at compile time.. - so i have had
to hack a grep and AC_DEFINE to replace it..
Ideas to make that cleaner would be nice..
anyway working code below..
regards
alan
=============
=================
dnl config.m4 for gtkhtml module
dnl PHP_PATH_GNOME_CONFIG([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]])
dnl Test to see if gtkhtml is installed, and define GTKHTML_CFLAGS, LIBS
dnl
AC_DEFUN(PHP_PATH_GNOME_CONFIG,
[dnl
dnl Get the cflags and libraries from the gnome-config script
dnl
AC_ARG_WITH(gtkhtml-config,
[ --with-gnome-config=GNOME_CONFIG Location of gnome-config],
GNOME_CONFIG="$withval")
module_args=gtkhtml
AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
AC_MSG_CHECKING(for gnome-config)
if test "$GNOME_CONFIG " = "no"; then
AC_MSG_RESULT(no)
ifelse([$2], , :, [$2])
else
GTKHTML_CFLAGS=
$GNOME_CONFIG --cflags $module_args
GTKHTML_LIBS=$GNOME_CONFIG --libs $module_args
GTKHTML_HAVE_GCONFTEST=$GNOME_CONFIG --cflags $module_args | grep GTKHTML_HAVE_GCONF
AC_MSG_RESULT(yes)
ifelse([$1], , :, [$1])
fi
AC_SUBST(GTKHTML_CFLAGS)
AC_SUBST(GTKHTML_LIBS)
AC_SUBST(GTKHTML_HAVE_GCONFTEST)
])
PHP_GTK_ARG_ENABLE(gtkhtml,for gtkhtml support,
[ --enable-gtkhtml Enable gtkhtml support])
if test "$PHP_GTK_GTKHTML" != "no"; then
PHP_PATH_GNOME_CONFIG(have_gnomeconfig=yes,have_gnomeconfig=no)
if test "$have_gnomeconfig" != "yes"; then
AC_MSG_ERROR(Unable to locate gnomeconfig)
else
AC_DEFINE(HAVE_GTKHML,1,[gtkhtml support])
PHP_EVAL_INCLINE($GTKHTML_CFLAGS)
if test "$GTKHTML_HAVE_GCONFTEST no" != " no"; then
AC_DEFINE(GTKHTML_HAVE_GCONF,1,[ ])
fi
PHP_EVAL_LIBLINE($GTKHTML_LIBS, GTKHTML_SHARED_LIBADD)
PHP_SUBST(GTKHTML_SHARED_LIBADD)
PHP_GTK_EXTENSION(gtkhtml)
fi
fi
=========================