--- espgs/src/configure.ac.orig 2005-08-01 13:36:20.000000000 +0900 +++ espgs/src/configure.ac 2005-08-01 13:30:53.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]) @@ -546,7 +587,8 @@ APPLE_DEVS="appledmp iwhi iwlo iwlq" IBM_DEVS="ibmpro jetp3852" OKI_DEVS="oki182 okiibm oki4w" JAPAN_DEVS="lips4 lips4v ljet4pjl lj4dithp dj505j picty180 lips2p bjc880j pr201 pr150 pr1000 pr1000_4 jj100 bj10v bj10vh mj700v2c mj500c mj6000c mj8000c fmpr fmlbp ml600 lbp310 lbp320 md50Mono md50Eco md1xMono escpage lp2000 npdl rpdl" -MISC_PDEVS="uniprint ap3250 atx23 atx24 atx38 coslw2p coslwxl cp50 declj250 fs600 imagen lj250 m8510 necp6 oce9050 r4081 sj48 tek4696 t4693d2 t4693d4 t4693d8 dl2100 la50 la70 la75 la75plus ln03 xes md2k md5k gdi samsunggdi oprp opvp" +MISC_PDEVS="uniprint ap3250 atx23 atx24 atx38 coslw2p coslwxl cp50 declj250 fs600 imagen lj250 m8510 necp6 oce9050 r4081 sj48 tek4696 t4693d2 t4693d4 t4693d8 dl2100 la50 la70 la75 la75plus ln03 xes md2k md5k gdi samsunggdi" +OPVP_DEVS="opvp oprp" dnl Known file formats BMP_DEVS="bmpmono bmpgray bmpsep1 bmpsep8 bmp16 bmp256 bmp16m bmp32b bmpa16 bmpa16m bmpa256 bmpa32b bmpamono bmpasep1 bmpasep8" @@ -577,7 +619,7 @@ while test -n "$drivers"; do fi ;; PRINTERS) - P_DEVS="$P_DEVS $CANON_DEVS $EPSON_DEVS $HP_DEVS $LEXMARK_DEVS $BROTHER_DEVS $APPLE_DEVS $IBM_DEVS $OKI_DEVS $JAPAN_DEVS $MISC_PDEVS" + P_DEVS="$P_DEVS $CANON_DEVS $EPSON_DEVS $HP_DEVS $LEXMARK_DEVS $BROTHER_DEVS $APPLE_DEVS $IBM_DEVS $OKI_DEVS $JAPAN_DEVS $MISC_PDEVS $OPVP_DEVS" ;; FILES) F_DEVS="$F_DEVS $BMP_DEVS $FAX_DEVS $JPEG_DEVS $PNG_DEVS $TIFF_DEVS $PCX_DEVS $PBM_DEVS $PS_DEVS $MISC_FDEVS" @@ -656,10 +698,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_DEVS" 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 +710,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