diff options
author | Mike Frysinger <vapier@gentoo.org> | 2016-05-18 03:03:50 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2016-05-18 03:03:50 -0400 |
commit | c9a4a85f3805644e706d0dead02ebb2984458fb3 (patch) | |
tree | 02410240044c64b82499c96e730265c70acae650 /configure.ac | |
parent | 6e054c42cf9fa1dc7fc227b0b397ab3180f4a5db (diff) | |
download | libgd-c9a4a85f3805644e706d0dead02ebb2984458fb3.tar.gz |
libimagequant: fix integration
The symbol was being set up in cmake but not on the autotools side.
Clean this up to be like other external libraries.
We need to pull in some openmp logic as it's not uncommon for the lib
to be built with openmp support. When we test for it, we need to do
so with openmp flags.
Fixes #137.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index f54e6a3..2706c48 100644 --- a/configure.ac +++ b/configure.ac @@ -119,6 +119,9 @@ AC_CHECK_HEADERS(iconv.h, dnl do we need to specify -lm explicitly? AC_CHECK_FUNC(sin,,[AC_CHECK_LIB(m,sin)]) +AX_PTHREAD() +AX_OPENMP() + dnl Helper macro for working with external libraries. dnl GD_LIB_CHECK([SYM], [FEATURE], [name], [...test...]) dnl $1 - upper case symbol @@ -238,6 +241,19 @@ GD_LIB_CHECK([LIBJPEG], [JPEG], [jpeg], [ ]) ]) +dnl Check for libimagequant support. +GD_LIB_CHECK([LIBIMAGEQUANT], [LIQ], [liq], [ + AC_CHECK_HEADER([libimagequant.h], [ + save_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS $OPENMP_CFLAGS" + AC_CHECK_LIB([imagequant], [liq_attr_create_with_allocator], [dnl + AS_VAR_APPEND([LIBIMAGEQUANT_LIBS], [" -limagequant $OPENMP_CFLAGS"]) + gd_found_lib=yes + ]) + CFLAGS=$save_CFLAGS + ]) +]) + dnl Check for xpm support. GD_LIB_PKG_CHECK([LIBXPM], [XPM], [xpm], [xpm], [ AC_CHECK_LIB([Xpm], [XpmReadFileToXpmImage], [dnl @@ -265,8 +281,6 @@ GD_LIB_CHECK([LIBWEBP], [WEBP], [webp], [ gl_VISIBILITY() CFLAGS="$CFLAGS $CFLAG_VISIBILITY" -AX_PTHREAD() - MINGW_AC_WIN32_NATIVE_HOST() if test "$mingw_cv_win32_host" = yes; then @@ -292,6 +306,7 @@ AC_MSG_RESULT([ Support for Freetype 2.x library: $gd_with_LIBFREETYPE Support for Fontconfig library: $gd_with_LIBFONTCONFIG Support for Xpm library: $gd_with_LIBXPM + Support for liq library: $gd_with_LIBIMAGEQUANT Support for pthreads: $ax_pthread_ok ]) |