diff options
-rw-r--r-- | GNUmakefile | 9 | ||||
-rw-r--r-- | fbiconfig.c | 2 | ||||
-rw-r--r-- | fbpdf.c | 14 |
3 files changed, 22 insertions, 3 deletions
diff --git a/GNUmakefile b/GNUmakefile index 7e392eb..9dca7f7 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -14,7 +14,7 @@ CFLAGS += -Wno-pointer-sign PKG_CONFIG = pkg-config PKGS_IDA := libexif libpng libtiff-4 PKGS_FBI := freetype2 fontconfig libdrm libexif libpng libtiff-4 -PKGS_FBPDF := libdrm poppler-glib gbm epoxy cairo-gl +PKGS_FBPDF := libdrm poppler-glib gbm epoxy HAVE_DEPS := $(shell $(PKG_CONFIG) $(PKGS_FBI) $(PKGS_FBPDF) && echo yes) # map pkg-config names to debian packages using apt-file @@ -70,6 +70,7 @@ RESDIR := $(call ac_resdir) HAVE_LINUX_FB_H := $(call ac_header,linux/fb.h) HAVE_GLIBC := $(call ac_func,fopencookie) HAVE_STRSIGNAL := $(call ac_func,strsignal) +HAVE_CAIRO_GL := $(call ac_pkg_config,cairo-gl) HAVE_LIBPCD := $(call ac_lib,pcd_open,pcd) HAVE_LIBGIF := $(call ac_lib,DGifOpenFileName,gif) HAVE_LIBWEBP := $(call ac_pkg_config,libwebp) @@ -102,7 +103,11 @@ ifeq ($(HAVE_LIBWEBP),yes) PKGS_FBI += libwebp endif -includes = ENDIAN_H STRSIGNAL NEW_EXIF +ifeq ($(HAVE_CAIRO_GL),yes) + PKGS_FBPDF += cairo-gl +endif + +includes = STRSIGNAL CAIRO_GL libraries = PCD GIF CURL SANE LIRC ida_libs = PCD GIF WEBP CURL SANE fbi_libs = PCD GIF WEBP CURL LIRC diff --git a/fbiconfig.c b/fbiconfig.c index 524e3aa..d33aecb 100644 --- a/fbiconfig.c +++ b/fbiconfig.c @@ -243,12 +243,14 @@ struct cfg_cmdline fbpdf_cfg[] = { .option = { O_PAGEFLIP }, .yesno = 1, .desc = "use pageflip (drm only)", +#ifdef HAVE_CAIRO_GL },{ .letter = 'g', .cmdline = "opengl", .option = { O_OPENGL }, .yesno = 1, .desc = "use opengl (drm only)", +#endif },{ .letter = 'm', .cmdline = "mode", @@ -34,7 +34,9 @@ #include <cairo.h> #include <epoxy/egl.h> -#include <cairo-gl.h> +#ifdef HAVE_CAIRO_GL +# include <cairo-gl.h> +#endif #include "vt.h" #include "kbd.h" @@ -154,7 +156,9 @@ static void page_render(void) cairo_destroy(context); if (surfacegl) { +#ifdef HAVE_CAIRO_GL cairo_gl_surface_swapbuffers(surfacegl); +#endif } if (gfx->flush_display) gfx->flush_display(second); @@ -302,7 +306,11 @@ int main(int argc, char *argv[]) output = cfg_get_str(O_OUTPUT); mode = cfg_get_str(O_VIDEO_MODE); fitwidth = GET_FIT_WIDTH(); +#ifdef HAVE_CAIRO_GL opengl = GET_OPENGL(); +#else + opengl = 0; +#endif pageflip = GET_PAGEFLIP(); if (device) { @@ -361,11 +369,15 @@ int main(int argc, char *argv[]) gfx->stride); } } else { +#ifdef HAVE_CAIRO_GL cairo_device_t *dev; dev = cairo_egl_device_create(gfx->dpy, gfx->ctx); surfacegl = cairo_gl_surface_create_for_egl(dev, gfx->surface, gfx->hdisplay, gfx->vdisplay); +#else + exit(1); +#endif } tty_raw(); |