Changeset 467

Show
Ignore:
Timestamp:
05/14/04 18:18:10 (5 years ago)
Author:
morris
Message:

test present iconv to make sure it handles UTF-8 and MacRoman?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wired/trunk/configure

    r461 r467  
    23722372 
    23732373####################################################################### 
    2374 # configure flags 
     2374# Check flags 
    23752375 
    23762376# Check for some other user to use than "wired" 
     
    43014301_ACEOF 
    43024302 
    4303         echo "$as_me:$LINENO: checking for iconv_open" >&5 
    4304 echo $ECHO_N "checking for iconv_open... $ECHO_C" >&6 
    4305 if test "${ac_cv_func_iconv_open+set}" = set; then 
    4306   echo $ECHO_N "(cached) $ECHO_C" >&6 
    4307 else 
    4308   cat >conftest.$ac_ext <<_ACEOF 
    4309 #line $LINENO "configure" 
    4310 /* confdefs.h.  */ 
    4311 _ACEOF 
    4312 cat confdefs.h >>conftest.$ac_ext 
    4313 cat >>conftest.$ac_ext <<_ACEOF 
    4314 /* end confdefs.h.  */ 
    4315 /* System header to define __stub macros and hopefully few prototypes, 
    4316     which can conflict with char iconv_open (); below. 
    4317     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 
    4318     <limits.h> exists even on freestanding compilers.  */ 
    4319 #ifdef __STDC__ 
    4320 # include <limits.h> 
    4321 #else 
    4322 # include <assert.h> 
    4323 #endif 
    4324 /* Override any gcc2 internal prototype to avoid an error.  */ 
    4325 #ifdef __cplusplus 
    4326 extern "C" 
    4327 
    4328 #endif 
    4329 /* We use char because int might match the return type of a gcc2 
    4330    builtin and then its argument prototype would still apply.  */ 
    4331 char iconv_open (); 
    4332 /* The GNU C library defines this for functions which it implements 
    4333     to always fail with ENOSYS.  Some functions are actually named 
    4334     something starting with __ and the normal name is an alias.  */ 
    4335 #if defined (__stub_iconv_open) || defined (__stub___iconv_open) 
    4336 choke me 
    4337 #else 
    4338 char (*f) () = iconv_open; 
    4339 #endif 
    4340 #ifdef __cplusplus 
    4341 
    4342 #endif 
    4343  
    4344 int 
    4345 main () 
    4346 
    4347 return f != iconv_open; 
    4348   ; 
    4349   return 0; 
    4350 
    4351 _ACEOF 
    4352 rm -f conftest.$ac_objext conftest$ac_exeext 
    4353 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 
    4354   (eval $ac_link) 2>&5 
    4355   ac_status=$? 
    4356   echo "$as_me:$LINENO: \$? = $ac_status" >&5 
    4357   (exit $ac_status); } && 
    4358          { ac_try='test -s conftest$ac_exeext' 
    4359   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
    4360   (eval $ac_try) 2>&5 
    4361   ac_status=$? 
    4362   echo "$as_me:$LINENO: \$? = $ac_status" >&5 
    4363   (exit $ac_status); }; }; then 
    4364   ac_cv_func_iconv_open=yes 
    4365 else 
    4366   echo "$as_me: failed program was:" >&5 
    4367 sed 's/^/| /' conftest.$ac_ext >&5 
    4368  
    4369 ac_cv_func_iconv_open=no 
    4370 fi 
    4371 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 
    4372 fi 
    4373 echo "$as_me:$LINENO: result: $ac_cv_func_iconv_open" >&5 
    4374 echo "${ECHO_T}$ac_cv_func_iconv_open" >&6 
    4375 if test $ac_cv_func_iconv_open = yes; then 
    4376   : 
    4377 else 
    4378  
    4379                 echo "$as_me:$LINENO: checking for main in -liconv" >&5 
     4303        echo "$as_me:$LINENO: checking for main in -liconv" >&5 
    43804304echo $ECHO_N "checking for main in -liconv... $ECHO_C" >&6 
    43814305if test "${ac_cv_lib_iconv_main+set}" = set; then 
     
    44274351if test $ac_cv_lib_iconv_main = yes; then 
    44284352 
    4429                         LIBS="$LIBS -liconv" 
    4430  
    4431 else 
    4432  
    4433                         { { echo "$as_me:$LINENO: error: could not locate libiconv" >&5 
     4353                LIBS="$LIBS -liconv" 
     4354                echo "$as_me:$LINENO: checking if iconv understands Unicode and MacRoman" >&5 
     4355echo $ECHO_N "checking if iconv understands Unicode and MacRoman... $ECHO_C" >&6 
     4356                if test "$cross_compiling" = yes; then 
     4357  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling 
     4358See \`config.log' for more details." >&5 
     4359echo "$as_me: error: cannot run test program while cross compiling 
     4360See \`config.log' for more details." >&2;} 
     4361   { (exit 1); exit 1; }; } 
     4362else 
     4363  cat >conftest.$ac_ext <<_ACEOF 
     4364#line $LINENO "configure" 
     4365/* confdefs.h.  */ 
     4366_ACEOF 
     4367cat confdefs.h >>conftest.$ac_ext 
     4368cat >>conftest.$ac_ext <<_ACEOF 
     4369/* end confdefs.h.  */ 
     4370 
     4371                        #include <iconv.h> 
     4372                        int main(void) { 
     4373                                iconv_t conv = iconv_open("UTF-8", "MacRoman"); 
     4374                                if(conv == (iconv_t) -1) 
     4375                                        return 1; 
     4376                                return 0; 
     4377                        } 
     4378 
     4379_ACEOF 
     4380rm -f conftest$ac_exeext 
     4381if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 
     4382  (eval $ac_link) 2>&5 
     4383  ac_status=$? 
     4384  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     4385  (exit $ac_status); } && { ac_try='./conftest$ac_exeext' 
     4386  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
     4387  (eval $ac_try) 2>&5 
     4388  ac_status=$? 
     4389  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     4390  (exit $ac_status); }; }; then 
     4391 
     4392                        echo "$as_me:$LINENO: result: yes" >&5 
     4393echo "${ECHO_T}yes" >&6 
     4394 
     4395else 
     4396  echo "$as_me: program exited with status $ac_status" >&5 
     4397echo "$as_me: failed program was:" >&5 
     4398sed 's/^/| /' conftest.$ac_ext >&5 
     4399 
     4400( exit $ac_status ) 
     4401 
     4402                        { { echo "$as_me:$LINENO: error: no" >&5 
     4403echo "$as_me: error: no" >&2;} 
     4404   { (exit 1); exit 1; }; } 
     4405 
     4406fi 
     4407rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext 
     4408fi 
     4409 
     4410else 
     4411 
     4412                { { echo "$as_me:$LINENO: error: could not locate libiconv" >&5 
    44344413echo "$as_me: error: could not locate libiconv" >&2;} 
    44354414   { (exit 1); exit 1; }; } 
     
    44374416fi 
    44384417 
    4439  
    4440 fi 
    4441  
    4442  
    4443 else 
    4444  
    4445         { { echo "$as_me:$LINENO: error: could not locate libiconv" >&5 
    4446 echo "$as_me: error: could not locate libiconv" >&2;} 
    4447    { (exit 1); exit 1; }; } 
    44484418 
    44494419fi 
  • wired/trunk/configure.in

    r461 r467  
    2727 
    2828####################################################################### 
    29 # configure flags 
     29# Check flags 
    3030 
    3131# Check for some other user to use than "wired" 
     
    145145# Check for the iconv library 
    146146AC_CHECK_HEADERS([iconv.h], [ 
    147         AC_CHECK_FUNC(iconv_open, [], [ 
    148                 AC_CHECK_LIB(iconv, main, [ 
    149                         LIBS="$LIBS -liconv" 
     147        AC_CHECK_LIB(iconv, main, [ 
     148                LIBS="$LIBS -liconv" 
     149                AC_MSG_CHECKING([if iconv understands Unicode and MacRoman]) 
     150                AC_TRY_RUN([ 
     151                        #include <iconv.h> 
     152                        int main(void) { 
     153                                iconv_t conv = iconv_open("UTF-8", "MacRoman"); 
     154                                if(conv == (iconv_t) -1) 
     155                                        return 1; 
     156                                return 0; 
     157                        } 
    150158                ], [ 
    151                         AC_MSG_ERROR([could not locate libiconv]) 
    152                 ]) 
     159                        AC_MSG_RESULT([yes]) 
     160                ], [ 
     161                        AC_MSG_ERROR([no]) 
     162                ])       
     163        ], [ 
     164                AC_MSG_ERROR([could not locate libiconv]) 
    153165        ]) 
    154 ], [ 
    155         AC_MSG_ERROR([could not locate libiconv]) 
    156166]) 
    157167