From 28b5dc9456ca499c8ff3568b91e5d761c3b7ee0e Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Sat, 27 May 2023 22:07:11 +0200 Subject: [PATCH] [configure.ac] --with-libsixel --- Makefile.config.in | 1 + configure.ac | 33 +++++++++++++++++++++++++++++++++ src/terminal/Makefile | 1 + 3 files changed, 35 insertions(+) diff --git a/Makefile.config.in b/Makefile.config.in index 1d96ce8e..4de06357 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -150,6 +150,7 @@ CONFIG_DBLATEX = @CONFIG_DBLATEX@ CONFIG_LEDS = @CONFIG_LEDS@ CONFIG_LIBCSS = @CONFIG_LIBCSS@ CONFIG_LIBDOM = @CONFIG_LIBDOM@ +CONFIG_LIBSIXEL = @CONFIG_LIBSIXEL@ CONFIG_LZMA = @CONFIG_LZMA@ CONFIG_MAILCAP = @CONFIG_MAILCAP@ CONFIG_MANUAL = @CONFIG_MANUAL@ diff --git a/configure.ac b/configure.ac index 4000ff3a..8f4765d5 100644 --- a/configure.ac +++ b/configure.ac @@ -895,6 +895,39 @@ if test "x$CONFIG_LIBDOM" = xyes; then AC_SUBST(CONFIG_LIBDOM) fi +# =================================================================== +# Check for libsixel +# =================================================================== + +AC_ARG_WITH([libsixel], + [AS_HELP_STRING([--with-libsixel], + [enable sixel graphics])]) + +CONFIG_LIBSIXEL= + +case "$with_libsixel" in + "" | no) + # The user specified --without-libsixel. + AC_MSG_CHECKING([for libsixel]) + AC_MSG_RESULT([disabled]) + CONFIG_LIBSIXEL="no" + ;; + yes) + ;; + *) + ;; +esac + +if test "x$CONFIG_LIBSIXEL" = x; then + LIBSIXEL_CFLAGS="$($PKG_CONFIG $pkg_config_static --cflags libsixel)" + LIBSIXEL_LIBS="$($PKG_CONFIG $pkg_config_static --libs libsixel)" + LIBS="$LIBSIXEL_LIBS $LIBS" + CFLAGS="$CFLAGS $LIBSIXEL_CFLAGS" + CONFIG_LIBSIXEL=yes + EL_CONFIG(CONFIG_LIBSIXEL, [libsixel]) + AC_SUBST(CONFIG_LIBSIXEL) +fi + # =================================================================== # Check for Guile, optional even if installed. # =================================================================== diff --git a/src/terminal/Makefile b/src/terminal/Makefile index 32c64e75..31966da6 100644 --- a/src/terminal/Makefile +++ b/src/terminal/Makefile @@ -2,6 +2,7 @@ top_builddir=../.. include $(top_builddir)/Makefile.config OBJS-$(CONFIG_MOUSE) += mouse.o +OBJS-$(CONFIG_LIBSIXEL) += sixel.o OBJS-$(CONFIG_TERMINFO) += terminfo.o OBJS = \