Skip to content

Commit

Permalink
added autoconf test for clutter
Browse files Browse the repository at this point in the history
  • Loading branch information
nadvornik committed Aug 18, 2012
1 parent 8a7f96c commit 269a04d
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 14 deletions.
44 changes: 40 additions & 4 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -396,14 +396,49 @@ AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)


# clutter support - experimental
# ----------------------------------------------------------------------

AC_ARG_ENABLE([clutter],
AC_HELP_STRING([--enable-clutter], [enable clutter support - experimental]),
[libclutter=$enableval], [libclutter=auto])

if test "x${libclutter}" = "xyes" -o "x${libgps}" = "xyes"; then
PKG_CHECK_MODULES(CLUTTER, [clutter-1.0 >= 1.0],
[
PKG_CHECK_MODULES(CLUTTER_GTK, [clutter-gtk-1.0 >= 1.0],
[
HAVE_CLUTTER=yes
AC_DEFINE(HAVE_CLUTTER, 1, [define to enable use of clutter library])
],
[
HAVE_CLUTTER=no
AC_MSG_WARN([$CLUTTER_GTK_PKG_ERRORS])
])

],
[
HAVE_CLUTTER=no
AC_MSG_WARN([$CLUTTER_PKG_ERRORS])
])
else
HAVE_CLUTTER=disabled
fi

AC_SUBST(CLUTTER_CFLAGS)
AC_SUBST(CLUTTER_LIBS)
AC_SUBST(CLUTTER_GTK_CFLAGS)
AC_SUBST(CLUTTER_GTK_LIBS)


# Libchamplain support - used for GPS map facility - experimental
# ----------------------------------------------------------------------

AC_ARG_ENABLE([gps],
AC_HELP_STRING([--enable-gps], [enable GPS map support - experimental]),
[libgps=$enableval], [libgps=auto])
[libgps=$enableval], [libgps=yes])

if test "x${libgps}" = "xyes"; then
if test "x${libgps}" = "xyes" -a "x${HAVE_CLUTTER}" = "xyes" ; then
PKG_CHECK_MODULES(LIBCHAMPLAIN, [champlain-0.12 >= 0.12],
[
HAVE_LIBCHAMPLAIN=yes
Expand All @@ -417,7 +452,7 @@ else
HAVE_LIBCHAMPLAIN=disabled
fi

if test "x${libgps}" = "xyes"; then
if test "x${libgps}" = "xyes" -a "x${HAVE_LIBCHAMPLAIN}" = "xyes" ; then
PKG_CHECK_MODULES(LIBCHAMPLAIN_GTK, [champlain-gtk-0.12 >= 0.12],
[
HAVE_LIBCHAMPLAIN_GTK=yes
Expand Down Expand Up @@ -508,7 +543,7 @@ Flags:
Gtk: $GTK_CFLAGS
Glib: $GLIB_CFLAGS
Thread: $GTHREAD_LIBS
Others: $JPEG_LIBS $TIFF_LIBS $LCMS_LIBS $EXIV2_LIBS $LIBCHAMPLAIN_LIBS $LIBCHAMPLAIN_GTK_LIBS
Others: $JPEG_LIBS $TIFF_LIBS $LCMS_LIBS $EXIV2_LIBS $CLUTTER_LIBS $CLUTTER_GTK_LIBS $LIBCHAMPLAIN_LIBS $LIBCHAMPLAIN_GTK_LIBS

Localization:
NLS support: $USE_NLS
Expand All @@ -524,6 +559,7 @@ Support:
LCMS: $HAVE_LCMS
Exiv2: $HAVE_EXIV2
Lirc: $HAVE_LIRC
Clutter: $HAVE_CLUTTER
Libchamplain: $HAVE_LIBCHAMPLAIN
Libchamplain-gtk: $HAVE_LIBCHAMPLAIN_GTK

Expand Down
6 changes: 5 additions & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ AM_CFLAGS = \
$(EXIV2_CFLAGS) \
$(LIBCHAMPLAIN_CFLAGS) \
$(LIBCHAMPLAIN_GTK_CFLAGS) \
$(CLUTTER_CFLAGS) \
$(CLUTTER_GTK_CFLAGS) \
-I$(top_srcdir) \
-I$(top_builddir)

Expand All @@ -17,6 +19,8 @@ AM_CXXFLAGS = \
$(EXIV2_CFLAGS) \
$(LIBCHAMPLAIN_CFLAGS) \
$(LIBCHAMPLAIN_GTK_CFLAGS) \
$(CLUTTER_CFLAGS) \
$(CLUTTER_GTK_CFLAGS) \
-I$(top_srcdir) \
-I$(top_builddir)

Expand Down Expand Up @@ -255,7 +259,7 @@ geeqie_SOURCES = \
window.c \
window.h

geeqie_LDADD = $(GTK_LIBS) $(GLIB_LIBS) $(INTLLIBS) $(JPEG_LIBS) $(TIFF_LIBS) $(LCMS_LIBS) $(EXIV2_LIBS) $(LIBCHAMPLAIN_LIBS) $(LIBCHAMPLAIN_GTK_LIBS)
geeqie_LDADD = $(GTK_LIBS) $(GLIB_LIBS) $(INTLLIBS) $(JPEG_LIBS) $(TIFF_LIBS) $(LCMS_LIBS) $(EXIV2_LIBS) $(LIBCHAMPLAIN_LIBS) $(LIBCHAMPLAIN_GTK_LIBS) $(CLUTTER_LIBS) $(CLUTTER_GTK_LIBS)

EXTRA_DIST = \
$(extra_SLIK)
Expand Down
10 changes: 2 additions & 8 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,9 @@
#include "histogram.h"
#include "pixbuf_util.h"

#ifdef HAVE_LIBCHAMPLAIN
#ifdef HAVE_LIBCHAMPLAIN_GTK
#ifdef HAVE_CLUTTER
#include <clutter-gtk/clutter-gtk.h>
#endif
#endif


gboolean thumb_format_changed = FALSE;
Expand Down Expand Up @@ -775,16 +773,12 @@ gint main(gint argc, gchar *argv[])

parse_command_line_for_debug_option(argc, argv);
DEBUG_1("%s main: gtk_init", get_exec_time());
#ifdef HAVE_LIBCHAMPLAIN
#ifdef HAVE_LIBCHAMPLAIN_GTK
#ifdef HAVE_CLUTTER
if (gtk_clutter_init(&argc, &argv) != CLUTTER_INIT_SUCCESS)
{
log_printf("Can't initialize clutter-gtk.\n");
exit(1);
}
#else
gtk_init(&argc, &argv);
#endif
#else
gtk_init(&argc, &argv);
#endif
Expand Down
5 changes: 5 additions & 0 deletions src/pixbuf-renderer.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@

#include <gtk/gtk.h>

#ifdef HAVE_CLUTTER
/* FIXME: make this configurable */
#define RENDERER_NEW(pr) renderer_clutter_new(pr)
#else
#define RENDERER_NEW(pr) renderer_tiles_new(pr)
#endif

/* comment this out if not using this from within Geeqie
* defining GQ_BUILD does these things:
Expand Down
5 changes: 4 additions & 1 deletion src/renderer-clutter.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
#include "layout.h"

#include <gtk/gtk.h>

#ifdef HAVE_CLUTTER

#include <clutter/clutter.h>

#include <clutter-gtk/clutter-gtk.h>
Expand Down Expand Up @@ -450,5 +453,5 @@ RendererFuncs *renderer_clutter_new(PixbufRenderer *pr)
return (RendererFuncs *) rc;
}


#endif
/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
2 changes: 2 additions & 0 deletions src/renderer-clutter.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
#ifndef RENDERER_CLUTTER_H
#define RENDERER_CLUTTER_H

#ifdef HAVE_CLUTTER
#include <pixbuf-renderer.h>


RendererFuncs *renderer_clutter_new(PixbufRenderer *pr);

#endif
#endif
/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */

0 comments on commit 269a04d

Please sign in to comment.