From 0bc09a8a73fd531c116176362e06cad438d79faa Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Tue, 16 Nov 2021 01:23:57 +0100 Subject: [PATCH] also add include parameter for checking iconv library, or libc and gnulibiconv might get mixed --- configure | 15 +++++++++++++++ configure.ac | 8 ++++++++ 2 files changed, 23 insertions(+) diff --git a/configure b/configure index d722f0146..4fe95546f 100755 --- a/configure +++ b/configure @@ -815,6 +815,7 @@ with_ffi_include with_ffi_library enable_iconv with_libiconv_library +with_libiconv_include enable_stricticonv enable_xml with_xml_prefix @@ -1582,6 +1583,7 @@ Optional Packages: --with-ffi-include=PATH Include path for ffi headers --with-ffi-library=PATH Library path for ffi libs --with-libiconv-library=PATH Library path for libiconv libraries + --with-libiconv-include=PATH Include path for libiconv header --with-xml-prefix=PFX Prefix where libxml is installed (optional) --with-tls-prefix=PFX Prefix where libgnutls is installed (optional) --with-zeroconf-api=API force use of a specific zeroconf API (mdns or avahi) @@ -11531,6 +11533,19 @@ esac fi + +# Check whether --with-libiconv-include was given. +if test "${with_libiconv_include+set}" = set; then : + withval=$with_libiconv_include; libiconv_incdir="$withval" +else + libiconv_incdir="no" +fi + + if test ${libiconv_incdir} != "no"; then + CPPFLAGS="$CPPFLAGS -I${libiconv_incdir}" + INCLUDE_FLAGS="$INCLUDE_FLAGS -I${libiconv_incdir}" + fi + old_LIBS="$LIBS" LIBS="-liconv $LIBS" if test "$cross_compiling" = yes; then : diff --git a/configure.ac b/configure.ac index 7bfe436d8..7361e3a20 100644 --- a/configure.ac +++ b/configure.ac @@ -3169,6 +3169,14 @@ if test $found_iconv = no ; then GS_ADD_LIBRARY_PATH([${libiconv_libdir}]) fi + AC_ARG_WITH(libiconv-include, + [ --with-libiconv-include=PATH Include path for libiconv header], + libiconv_incdir="$withval", libiconv_incdir="no") + if test ${libiconv_incdir} != "no"; then + CPPFLAGS="$CPPFLAGS -I${libiconv_incdir}" + INCLUDE_FLAGS="$INCLUDE_FLAGS -I${libiconv_incdir}" + fi + old_LIBS="$LIBS" LIBS="-liconv $LIBS" AC_RUN_IFELSE([AC_LANG_SOURCE([#include