diff --git a/common/draw.c b/common/draw.c index 5fcd8db61..fa6575db6 100644 --- a/common/draw.c +++ b/common/draw.c @@ -21,11 +21,11 @@ #include -#ifdef HAVE_GTK +#ifdef HAVE_IMLIB2 +#include +#else #include #include -#else -#include #endif #include @@ -647,7 +647,7 @@ void draw_image_from_argb_data(DrawCtx *ctx, int x, int y, int w, int h, cairo_surface_destroy(source); } -#ifdef HAVE_GTK +#ifndef HAVE_IMLIB2 /** Draw an image (PNG format only) from a file to a draw context * \param ctx Draw context to draw to @@ -710,7 +710,7 @@ draw_get_image_size(const char *filename) return size; } -#else /* HAVE_GTK */ +#else /* HAVE_IMLIB2 */ static const char * draw_imlib_load_strerror(Imlib_Load_Error e) @@ -823,7 +823,7 @@ draw_get_image_size(const char *filename) return size; } -#endif /* HAVE_GTK */ +#endif /* HAVE_IMLIB2 */ /** Rotate a drawable * \param ctx Draw context to draw to diff --git a/configure.ac b/configure.ac index 7c9ef42f2..11b4b04e3 100644 --- a/configure.ac +++ b/configure.ac @@ -113,15 +113,15 @@ PKG_CHECK_MODULES([pangocairo], [pangocairo],, [AC_MSG_ERROR([awesome requires pangocairo.])]) PKG_CHECK_MODULES([confuse], [libconfuse >= 2.6],, [AC_MSG_ERROR([awesome requires libconfuse >= 2.6.])]) -AC_ARG_WITH([gtk], AS_HELP_STRING([--with-gtk], [Build with gtk library (default: disabled)])) +AC_ARG_WITH([imlib2], AS_HELP_STRING([--with-imlib2], [Build with Imlib2 (default: disabled)])) -if test "x$with_gtk" == "xyes"; then +if test "x$with_imlib2" == "xyes"; then + PKG_CHECK_MODULES([imlib2], [imlib2],, + [AC_MSG_ERROR([Cannot fined Imlib2.])]) + AC_DEFINE([WITH_IMLIB2],1,[Defined to use Imlib2]) +else PKG_CHECK_MODULES([GTK], [gtk+-2.0 >= 2.2],, [AC_MSG_ERROR([Cannot find gtk+-2.0 >= 2.2])]) - AC_DEFINE([HAVE_GTK],1,[Defined to use gtk]) -else - PKG_CHECK_MODULES([imlib2], [imlib2],, - [AC_MSG_ERROR([awesome requires Imlib2.])]) fi PKG_CHECK_MODULES([xcb], [xcb],, [AC_MSG_ERROR([awesome requires xcb.])])