Changeset 34

Show
Ignore:
Timestamp:
07/11/04 11:58:14 (4 years ago)
Author:
morris
Message:

test for iconv() before -liconv

Files:

Legend:

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

    r12 r34  
    42384238_ACEOF 
    42394239 
    4240         echo "$as_me:$LINENO: checking for main in -liconv" >&5 
     4240        echo "$as_me:$LINENO: checking for iconv" >&5 
     4241echo $ECHO_N "checking for iconv... $ECHO_C" >&6 
     4242if test "${ac_cv_func_iconv+set}" = set; then 
     4243  echo $ECHO_N "(cached) $ECHO_C" >&6 
     4244else 
     4245  cat >conftest.$ac_ext <<_ACEOF 
     4246#line $LINENO "configure" 
     4247/* confdefs.h.  */ 
     4248_ACEOF 
     4249cat confdefs.h >>conftest.$ac_ext 
     4250cat >>conftest.$ac_ext <<_ACEOF 
     4251/* end confdefs.h.  */ 
     4252/* System header to define __stub macros and hopefully few prototypes, 
     4253    which can conflict with char iconv (); below. 
     4254    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 
     4255    <limits.h> exists even on freestanding compilers.  */ 
     4256#ifdef __STDC__ 
     4257# include <limits.h> 
     4258#else 
     4259# include <assert.h> 
     4260#endif 
     4261/* Override any gcc2 internal prototype to avoid an error.  */ 
     4262#ifdef __cplusplus 
     4263extern "C" 
     4264
     4265#endif 
     4266/* We use char because int might match the return type of a gcc2 
     4267   builtin and then its argument prototype would still apply.  */ 
     4268char iconv (); 
     4269/* The GNU C library defines this for functions which it implements 
     4270    to always fail with ENOSYS.  Some functions are actually named 
     4271    something starting with __ and the normal name is an alias.  */ 
     4272#if defined (__stub_iconv) || defined (__stub___iconv) 
     4273choke me 
     4274#else 
     4275char (*f) () = iconv; 
     4276#endif 
     4277#ifdef __cplusplus 
     4278
     4279#endif 
     4280 
     4281int 
     4282main () 
     4283
     4284return f != iconv; 
     4285  ; 
     4286  return 0; 
     4287
     4288_ACEOF 
     4289rm -f conftest.$ac_objext conftest$ac_exeext 
     4290if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 
     4291  (eval $ac_link) 2>&5 
     4292  ac_status=$? 
     4293  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     4294  (exit $ac_status); } && 
     4295         { ac_try='test -s conftest$ac_exeext' 
     4296  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
     4297  (eval $ac_try) 2>&5 
     4298  ac_status=$? 
     4299  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     4300  (exit $ac_status); }; }; then 
     4301  ac_cv_func_iconv=yes 
     4302else 
     4303  echo "$as_me: failed program was:" >&5 
     4304sed 's/^/| /' conftest.$ac_ext >&5 
     4305 
     4306ac_cv_func_iconv=no 
     4307fi 
     4308rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 
     4309fi 
     4310echo "$as_me:$LINENO: result: $ac_cv_func_iconv" >&5 
     4311echo "${ECHO_T}$ac_cv_func_iconv" >&6 
     4312if test $ac_cv_func_iconv = yes; then 
     4313  : 
     4314else 
     4315 
     4316                echo "$as_me:$LINENO: checking for main in -liconv" >&5 
    42414317echo $ECHO_N "checking for main in -liconv... $ECHO_C" >&6 
    42424318if test "${ac_cv_lib_iconv_main+set}" = set; then 
     
    42884364if test $ac_cv_lib_iconv_main = yes; then 
    42894365 
    4290                 LIBS="$LIBS -liconv" 
    4291  
    4292                 echo "$as_me:$LINENO: checking if iconv understands Unicode and ISO-8859-1" >&5 
     4366                       LIBS="$LIBS -liconv" 
     4367 
     4368                       echo "$as_me:$LINENO: checking if iconv understands Unicode and ISO-8859-1" >&5 
    42934369echo $ECHO_N "checking if iconv understands Unicode and ISO-8859-1... $ECHO_C" >&6 
    4294                 if test "$cross_compiling" = yes; then 
     4370                       if test "$cross_compiling" = yes; then 
    42954371  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling 
    42964372See \`config.log' for more details." >&5 
     
    43074383/* end confdefs.h.  */ 
    43084384 
    4309                         #include <iconv.h> 
    4310                         int main(void) { 
    4311                                 iconv_t conv = iconv_open("UTF-8", "ISO-8859-1"); 
    4312                                 if(conv == (iconv_t) -1) 
    4313                                         return 1; 
    4314                                 return 0; 
    4315                        
     4385                               #include <iconv.h> 
     4386                               int main(void) { 
     4387                                       iconv_t conv = iconv_open("UTF-8", "ISO-8859-1"); 
     4388                                       if(conv == (iconv_t) -1) 
     4389                                               return 1; 
     4390                                       return 0; 
     4391                               
    43164392 
    43174393_ACEOF 
     
    43284404  (exit $ac_status); }; }; then 
    43294405 
    4330                         echo "$as_me:$LINENO: result: yes" >&5 
     4406                               echo "$as_me:$LINENO: result: yes" >&5 
    43314407echo "${ECHO_T}yes" >&6 
    43324408 
     
    43384414( exit $ac_status ) 
    43394415 
    4340                         { { echo "$as_me:$LINENO: error: no" >&5 
     4416                               { { echo "$as_me:$LINENO: error: no" >&5 
    43414417echo "$as_me: error: no" >&2;} 
    43424418   { (exit 1); exit 1; }; } 
     
    43604436    env CPPFLAGS=\"-I/path/to/include\" LDFLAGS=\"-L/path/to/lib\" ./configure" >&2;} 
    43614437   { (exit 1); exit 1; }; } 
     4438 
     4439 
     4440fi 
    43624441 
    43634442 
  • wire/trunk/configure.in

    r12 r34  
    103103# Check for the iconv library 
    104104AC_CHECK_HEADERS([iconv.h], [ 
    105         AC_CHECK_LIB([iconv], [main], [ 
    106                 LIBS="$LIBS -liconv" 
    107                  
    108                 AC_MSG_CHECKING([if iconv understands Unicode and ISO-8859-1]) 
    109                 AC_TRY_RUN([ 
    110                         #include <iconv.h> 
    111                         int main(void) { 
    112                                 iconv_t conv = iconv_open("UTF-8", "ISO-8859-1"); 
    113                                 if(conv == (iconv_t) -1) 
    114                                         return 1; 
    115                                 return 0; 
    116                         } 
     105        AC_CHECK_FUNC([iconv], [], [ 
     106                AC_CHECK_LIB([iconv], [main], [ 
     107                        LIBS="$LIBS -liconv" 
     108                         
     109                        AC_MSG_CHECKING([if iconv understands Unicode and ISO-8859-1]) 
     110                        AC_TRY_RUN([ 
     111                                #include <iconv.h> 
     112                                int main(void) { 
     113                                        iconv_t conv = iconv_open("UTF-8", "ISO-8859-1"); 
     114                                        if(conv == (iconv_t) -1) 
     115                                                return 1; 
     116                                        return 0; 
     117                                } 
     118                        ], [ 
     119                                AC_MSG_RESULT([yes]) 
     120                        ], [ 
     121                                AC_MSG_ERROR([no]) 
     122                        ])       
    117123                ], [ 
    118                         AC_MSG_RESULT([yes]) 
    119                 ], [ 
    120                         AC_MSG_ERROR([no]) 
    121                 ])       
    122         ], [ 
    123                 WR_MSG_LIB_ERROR([iconv]) 
     124                        WR_MSG_LIB_ERROR([iconv]) 
     125                ]) 
    124126        ]) 
    125127], [