--- espgs/src/configure.ac.orig 2005-05-11 00:53:11.000000000 +0900 +++ espgs/src/configure.ac 2005-05-17 16:19:04.000000000 +0900 @@ -179,7 +179,48 @@ dnl ------------------------------------ AC_CHECK_LIB(m, cos) dnl AC_CHECK_LIB(pthread, pthread_create) -AC_CHECK_FUNC(iconv_open) +dnl *** Tests for iconv *** +AC_ARG_WITH(libiconv, + [AC_HELP_STRING([--with-libiconv=@<:@no/gnu/native@:>@], + [use the libiconv library])],, + [with_libiconv=maybe]) +found_iconv=no +case $with_libiconv in + maybe) + # Check in the C library first + AC_CHECK_FUNC(iconv_open, [with_libiconv=no; found_iconv=yes]) + # Check if we have GNU libiconv + if test $found_iconv = "no"; then + AC_CHECK_LIB(iconv, libiconv_open, [with_libiconv=gnu; found_iconv=yes]) + fi + # Check if we have a iconv in -liconv, possibly from vendor + if test $found_iconv = "no"; then + AC_CHECK_LIB(iconv, iconv_open, [with_libiconv=native; found_iconv=yes]) + fi + ;; + no) + AC_CHECK_FUNC(iconv_open, [with_libiconv=no; found_iconv=yes]) + ;; + gnu|yes) + AC_CHECK_LIB(iconv, libiconv_open, [with_libiconv=gnu; found_iconv=yes]) + ;; + native) + AC_CHECK_LIB(iconv, iconv_open, [with_libiconv=native; found_iconv=yes]) + ;; +esac +if test x$found_iconv != xno -a x$with_libiconv != xno ; then + LIBS="$LIBS -liconv" +fi + +case $with_libiconv in + gnu) + AC_DEFINE(USE_LIBICONV_GNU, 1, [Using GNU libiconv]) + ;; + native) + AC_DEFINE(USE_LIBICONV_NATIVE, 1, [Using a native implementation of iconv in a separate library]) + ;; +esac + AC_CHECK_LIB(dl, dlopen) AC_MSG_CHECKING([for local jpeg library source]) @@ -656,10 +697,10 @@ while test -n "$drivers"; do ;; opvp) # Open Vector Printing driver... - if test x$ac_cv_lib_dl_dlopen != xno -a x$ac_cv_func_iconv_open != xno; then - P_DEVS="$P_DEVS opvp" + if test x$ac_cv_lib_dl_dlopen != xno -a x$found_iconv != xno; then + P_DEVS="$P_DEVS opvp oprp" else - AC_MSG_WARN(Unable to include opvp driver due to missing prerequisites...) + AC_MSG_WARN(Unable to include opvp/oprp driver due to missing prerequisites...) fi ;; *) @@ -668,8 +709,13 @@ while test -n "$drivers"; do ;; esac done -# Make sure we don't have any duplicates in there, add $(DD)foo.dev constructs +# No need to include opvp/oprp driver without iconv/libiconv. if test -n "$P_DEVS"; then + if test x$found_iconv = xno ; then + P_DEVS=`echo $P_DEVS | sed -e 's|opvp||' -e 's|oprp||'` + AC_MSG_WARN(Unable to include opvp/oprp driver due to missing iconv/libiconv...) + fi +# Make sure we don't have any duplicates in there, add $(DD)foo.dev constructs PRINTERS=`(for i in $P_DEVS; do echo '$(DD)'${i}.dev; done) | sort | uniq | tr '\012' ' '` fi if test -n "$F_DEVS"; then