PennMUSH Community
Show
Ignore:
Timestamp:
05/19/07 13:30:41 (2 years ago)
Author:
shawnw
Message:

Added basic configure tests for iconv

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • 1.8.3/branches/unicode/UNICODE

    r871 r872  
    99 
    1010* Created bare hdrs/pennstr.h and src/pennstr.c 
     11* configure tests for presence of system <iconv.h>, 
     12  libiconv, iconv(1), iconv(3), iconvctl(3). 
    1113 
    1214Things to do: 
  • 1.8.3/branches/unicode/config.h.in

    r869 r872  
    6262#undef HAVE_SYS_RESOURCE_H 
    6363 
     64#undef HAVE_ICONV_H 
     65 
    6466/* Libraries */ 
    6567 
     
    183185 
    184186#undef UNION_WAIT 
     187 
     188#undef HAVE_ICONV 
     189 
     190#undef HAVE_ICONVCTL 
    185191 
    186192/* Variables and defines */ 
  • 1.8.3/branches/unicode/configure

    r865 r872  
    660660ETAGS 
    661661EXCTAGS 
     662ICONV 
    662663UPTIME 
    663664SENDMAIL 
     
    33683369 
    33693370 
     3371# Extract the first word of "iconv", so it can be a program name with args. 
     3372set dummy iconv; ac_word=$2 
     3373{ echo "$as_me:$LINENO: checking for $ac_word" >&5 
     3374echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } 
     3375if test "${ac_cv_path_ICONV+set}" = set; then 
     3376  echo $ECHO_N "(cached) $ECHO_C" >&6 
     3377else 
     3378  case $ICONV in 
     3379  [\\/]* | ?:[\\/]*) 
     3380  ac_cv_path_ICONV="$ICONV" # Let the user override the test with a path. 
     3381  ;; 
     3382  *) 
     3383  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 
     3384for as_dir in $PATH 
     3385do 
     3386  IFS=$as_save_IFS 
     3387  test -z "$as_dir" && as_dir=. 
     3388  for ac_exec_ext in '' $ac_executable_extensions; do 
     3389  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then 
     3390    ac_cv_path_ICONV="$as_dir/$ac_word$ac_exec_ext" 
     3391    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 
     3392    break 2 
     3393  fi 
     3394done 
     3395done 
     3396IFS=$as_save_IFS 
     3397 
     3398  ;; 
     3399esac 
     3400fi 
     3401ICONV=$ac_cv_path_ICONV 
     3402if test -n "$ICONV"; then 
     3403  { echo "$as_me:$LINENO: result: $ICONV" >&5 
     3404echo "${ECHO_T}$ICONV" >&6; } 
     3405else 
     3406  { echo "$as_me:$LINENO: result: no" >&5 
     3407echo "${ECHO_T}no" >&6; } 
     3408fi 
     3409 
     3410 
    33703411 
    33713412if test "x$CTAGS" = x -a "x$EXCTAGS" != x; then 
     
    73327373 
    73337374 
    7334 for ac_header in sys/un.h ieeefp.h sys/resource.h 
     7375 
     7376for ac_header in sys/un.h ieeefp.h sys/resource.h iconv.h 
    73357377do 
    73367378as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` 
     
    86148656 
    86158657  LIBS="-lcrypt $LIBS" 
     8658 
     8659fi 
     8660 
     8661 
     8662{ echo "$as_me:$LINENO: checking for iconv_open in -liconv" >&5 
     8663echo $ECHO_N "checking for iconv_open in -liconv... $ECHO_C" >&6; } 
     8664if test "${ac_cv_lib_iconv_iconv_open+set}" = set; then 
     8665  echo $ECHO_N "(cached) $ECHO_C" >&6 
     8666else 
     8667  ac_check_lib_save_LIBS=$LIBS 
     8668LIBS="-liconv  $LIBS" 
     8669cat >conftest.$ac_ext <<_ACEOF 
     8670/* confdefs.h.  */ 
     8671_ACEOF 
     8672cat confdefs.h >>conftest.$ac_ext 
     8673cat >>conftest.$ac_ext <<_ACEOF 
     8674/* end confdefs.h.  */ 
     8675 
     8676/* Override any GCC internal prototype to avoid an error. 
     8677   Use char because int might match the return type of a GCC 
     8678   builtin and then its argument prototype would still apply.  */ 
     8679#ifdef __cplusplus 
     8680extern "C" 
     8681#endif 
     8682char iconv_open (); 
     8683int 
     8684main () 
     8685{ 
     8686return iconv_open (); 
     8687  ; 
     8688  return 0; 
     8689} 
     8690_ACEOF 
     8691rm -f conftest.$ac_objext conftest$ac_exeext 
     8692if { (ac_try="$ac_link" 
     8693case "(($ac_try" in 
     8694  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 
     8695  *) ac_try_echo=$ac_try;; 
     8696esac 
     8697eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 
     8698  (eval "$ac_link") 2>conftest.er1 
     8699  ac_status=$? 
     8700  grep -v '^ *+' conftest.er1 >conftest.err 
     8701  rm -f conftest.er1 
     8702  cat conftest.err >&5 
     8703  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     8704  (exit $ac_status); } && 
     8705     { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' 
     8706  { (case "(($ac_try" in 
     8707  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 
     8708  *) ac_try_echo=$ac_try;; 
     8709esac 
     8710eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 
     8711  (eval "$ac_try") 2>&5 
     8712  ac_status=$? 
     8713  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     8714  (exit $ac_status); }; } && 
     8715     { ac_try='test -s conftest$ac_exeext' 
     8716  { (case "(($ac_try" in 
     8717  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 
     8718  *) ac_try_echo=$ac_try;; 
     8719esac 
     8720eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 
     8721  (eval "$ac_try") 2>&5 
     8722  ac_status=$? 
     8723  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     8724  (exit $ac_status); }; }; then 
     8725  ac_cv_lib_iconv_iconv_open=yes 
     8726else 
     8727  echo "$as_me: failed program was:" >&5 
     8728sed 's/^/| /' conftest.$ac_ext >&5 
     8729 
     8730    ac_cv_lib_iconv_iconv_open=no 
     8731fi 
     8732 
     8733rm -f core conftest.err conftest.$ac_objext \ 
     8734      conftest$ac_exeext conftest.$ac_ext 
     8735LIBS=$ac_check_lib_save_LIBS 
     8736fi 
     8737{ echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_iconv_open" >&5 
     8738echo "${ECHO_T}$ac_cv_lib_iconv_iconv_open" >&6; } 
     8739if test $ac_cv_lib_iconv_iconv_open = yes; then 
     8740  cat >>confdefs.h <<_ACEOF 
     8741#define HAVE_LIBICONV 1 
     8742_ACEOF 
     8743 
     8744  LIBS="-liconv $LIBS" 
    86168745 
    86178746fi 
     
    1323413363 
    1323513364fi 
     13365 
     13366 
     13367 
     13368for ac_func in iconv iconvctl 
     13369do 
     13370as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` 
     13371{ echo "$as_me:$LINENO: checking for $ac_func" >&5 
     13372echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } 
     13373if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then 
     13374  echo $ECHO_N "(cached) $ECHO_C" >&6 
     13375else 
     13376  cat >conftest.$ac_ext <<_ACEOF 
     13377/* confdefs.h.  */ 
     13378_ACEOF 
     13379cat confdefs.h >>conftest.$ac_ext 
     13380cat >>conftest.$ac_ext <<_ACEOF 
     13381/* end confdefs.h.  */ 
     13382/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. 
     13383   For example, HP-UX 11i <limits.h> declares gettimeofday.  */ 
     13384#define $ac_func innocuous_$ac_func 
     13385 
     13386/* System header to define __stub macros and hopefully few prototypes, 
     13387    which can conflict with char $ac_func (); below. 
     13388    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 
     13389    <limits.h> exists even on freestanding compilers.  */ 
     13390 
     13391#ifdef __STDC__ 
     13392# include <limits.h> 
     13393#else 
     13394# include <assert.h> 
     13395#endif 
     13396 
     13397#undef $ac_func 
     13398 
     13399/* Override any GCC internal prototype to avoid an error. 
     13400   Use char because int might match the return type of a GCC 
     13401   builtin and then its argument prototype would still apply.  */ 
     13402#ifdef __cplusplus 
     13403extern "C" 
     13404#endif 
     13405char $ac_func (); 
     13406/* The GNU C library defines this for functions which it implements 
     13407    to always fail with ENOSYS.  Some functions are actually named 
     13408    something starting with __ and the normal name is an alias.  */ 
     13409#if defined __stub_$ac_func || defined __stub___$ac_func 
     13410choke me 
     13411#endif 
     13412 
     13413int 
     13414main () 
     13415{ 
     13416return $ac_func (); 
     13417  ; 
     13418  return 0; 
     13419} 
     13420_ACEOF 
     13421rm -f conftest.$ac_objext conftest$ac_exeext 
     13422if { (ac_try="$ac_link" 
     13423case "(($ac_try" in 
     13424  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 
     13425  *) ac_try_echo=$ac_try;; 
     13426esac 
     13427eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 
     13428  (eval "$ac_link") 2>conftest.er1 
     13429  ac_status=$? 
     13430  grep -v '^ *+' conftest.er1 >conftest.err 
     13431  rm -f conftest.er1 
     13432  cat conftest.err >&5 
     13433  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     13434  (exit $ac_status); } && 
     13435     { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' 
     13436  { (case "(($ac_try" in 
     13437  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 
     13438  *) ac_try_echo=$ac_try;; 
     13439esac 
     13440eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 
     13441  (eval "$ac_try") 2>&5 
     13442  ac_status=$? 
     13443  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     13444  (exit $ac_status); }; } && 
     13445     { ac_try='test -s conftest$ac_exeext' 
     13446  { (case "(($ac_try" in 
     13447  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 
     13448  *) ac_try_echo=$ac_try;; 
     13449esac 
     13450eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 
     13451  (eval "$ac_try") 2>&5 
     13452  ac_status=$? 
     13453  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     13454  (exit $ac_status); }; }; then 
     13455  eval "$as_ac_var=yes" 
     13456else 
     13457  echo "$as_me: failed program was:" >&5 
     13458sed 's/^/| /' conftest.$ac_ext >&5 
     13459 
     13460    eval "$as_ac_var=no" 
     13461fi 
     13462 
     13463rm -f core conftest.err conftest.$ac_objext \ 
     13464      conftest$ac_exeext conftest.$ac_ext 
     13465fi 
     13466ac_res=`eval echo '${'$as_ac_var'}'` 
     13467           { echo "$as_me:$LINENO: result: $ac_res" >&5 
     13468echo "${ECHO_T}$ac_res" >&6; } 
     13469if test `eval echo '${'$as_ac_var'}'` = yes; then 
     13470  cat >>confdefs.h <<_ACEOF 
     13471#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 
     13472_ACEOF 
     13473 
     13474fi 
     13475done 
    1323613476 
    1323713477 
     
    1441714657ETAGS!$ETAGS$ac_delim 
    1441814658EXCTAGS!$EXCTAGS$ac_delim 
     14659ICONV!$ICONV$ac_delim 
    1441914660UPTIME!$UPTIME$ac_delim 
    1442014661SENDMAIL!$SENDMAIL$ac_delim 
     
    1444114682_ACEOF 
    1444214683 
    14443   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 83; then 
     14684  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 84; then 
    1444414685    break 
    1444514686  elif $ac_last_try; then 
  • 1.8.3/branches/unicode/configure.in

    r865 r872  
    2929AC_PATH_PROG(ETAGS, etags) 
    3030AC_PATH_PROG(EXCTAGS, exctags) 
     31AC_PATH_PROG(ICONV, iconv) 
    3132 
    3233if test "x$CTAGS" = x -a "x$EXCTAGS" != x; then 
     
    7879AC_CHECK_HEADER(sys/stat.h, [AC_DEFINE(I_SYS_STAT)]) 
    7980AC_CHECK_HEADER(sys/types.h, [AC_DEFINE(I_SYS_TYPES)]) 
    80 AC_CHECK_HEADERS([sys/un.h ieeefp.h sys/resource.h]) 
     81AC_CHECK_HEADERS([sys/un.h ieeefp.h sys/resource.h iconv.h]) 
    8182 
    8283### C language support 
     
    105106AC_CHECK_LIB(intl, gettext) 
    106107AC_CHECK_LIB(crypt, crypt) 
     108AC_CHECK_LIB(iconv, iconv_open) 
    107109LIB_SOCKET_NSL 
    108110 
     
    177179fi 
    178180 
     181AC_CHECK_FUNCS(iconv iconvctl) 
    179182 
    180183### Variables, constants, defines and other misc. stuff 
  • 1.8.3/branches/unicode/src/pennstr.c

    r871 r872  
    99#include <stdlib.h> 
    1010 
     11#ifdef HAVE_ICONV_H 
     12#include <iconv.h> 
     13#endif 
     14 
    1115#include "pennstr.h"