Changeset 96

Show
Ignore:
Timestamp:
08/02/04 23:12:33 (4 years ago)
Author:
morris
Message:

test for termcap.h and termios.h

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wire/trunk/config.h.in

    r78 r96  
    180180#undef HAVE_SYS_TYPES_H 
    181181 
     182/* Define to 1 if you have the <termcap.h> header file. */ 
     183#undef HAVE_TERMCAP_H 
     184 
    182185/* Define to 1 if you have the <termios.h> header file. */ 
    183186#undef HAVE_TERMIOS_H 
     187 
     188/* Define to 1 if you have the <term.h> header file. */ 
     189#undef HAVE_TERM_H 
    184190 
    185191/* Define to 1 if you have the `uname' function. */ 
  • wire/trunk/configure

    r92 r96  
    35103510 
    35113511 
     3512# Check if we need the network services library 
     3513echo "$as_me:$LINENO: checking for inet_aton" >&5 
     3514echo $ECHO_N "checking for inet_aton... $ECHO_C" >&6 
     3515if test "${ac_cv_func_inet_aton+set}" = set; then 
     3516  echo $ECHO_N "(cached) $ECHO_C" >&6 
     3517else 
     3518  cat >conftest.$ac_ext <<_ACEOF 
     3519#line $LINENO "configure" 
     3520/* confdefs.h.  */ 
     3521_ACEOF 
     3522cat confdefs.h >>conftest.$ac_ext 
     3523cat >>conftest.$ac_ext <<_ACEOF 
     3524/* end confdefs.h.  */ 
     3525/* System header to define __stub macros and hopefully few prototypes, 
     3526    which can conflict with char inet_aton (); below. 
     3527    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 
     3528    <limits.h> exists even on freestanding compilers.  */ 
     3529#ifdef __STDC__ 
     3530# include <limits.h> 
     3531#else 
     3532# include <assert.h> 
     3533#endif 
     3534/* Override any gcc2 internal prototype to avoid an error.  */ 
     3535#ifdef __cplusplus 
     3536extern "C" 
     3537{ 
     3538#endif 
     3539/* We use char because int might match the return type of a gcc2 
     3540   builtin and then its argument prototype would still apply.  */ 
     3541char inet_aton (); 
     3542/* The GNU C library defines this for functions which it implements 
     3543    to always fail with ENOSYS.  Some functions are actually named 
     3544    something starting with __ and the normal name is an alias.  */ 
     3545#if defined (__stub_inet_aton) || defined (__stub___inet_aton) 
     3546choke me 
     3547#else 
     3548char (*f) () = inet_aton; 
     3549#endif 
     3550#ifdef __cplusplus 
     3551} 
     3552#endif 
     3553 
     3554int 
     3555main () 
     3556{ 
     3557return f != inet_aton; 
     3558  ; 
     3559  return 0; 
     3560} 
     3561_ACEOF 
     3562rm -f conftest.$ac_objext conftest$ac_exeext 
     3563if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 
     3564  (eval $ac_link) 2>&5 
     3565  ac_status=$? 
     3566  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     3567  (exit $ac_status); } && 
     3568         { ac_try='test -s conftest$ac_exeext' 
     3569  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
     3570  (eval $ac_try) 2>&5 
     3571  ac_status=$? 
     3572  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     3573  (exit $ac_status); }; }; then 
     3574  ac_cv_func_inet_aton=yes 
     3575else 
     3576  echo "$as_me: failed program was:" >&5 
     3577sed 's/^/| /' conftest.$ac_ext >&5 
     3578 
     3579ac_cv_func_inet_aton=no 
     3580fi 
     3581rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 
     3582fi 
     3583echo "$as_me:$LINENO: result: $ac_cv_func_inet_aton" >&5 
     3584echo "${ECHO_T}$ac_cv_func_inet_aton" >&6 
     3585if test $ac_cv_func_inet_aton = yes; then 
     3586  : 
     3587else 
     3588 
     3589        echo "$as_me:$LINENO: checking for inet_aton in -lresolv" >&5 
     3590echo $ECHO_N "checking for inet_aton in -lresolv... $ECHO_C" >&6 
     3591if test "${ac_cv_lib_resolv_inet_aton+set}" = set; then 
     3592  echo $ECHO_N "(cached) $ECHO_C" >&6 
     3593else 
     3594  ac_check_lib_save_LIBS=$LIBS 
     3595LIBS="-lresolv  $LIBS" 
     3596cat >conftest.$ac_ext <<_ACEOF 
     3597#line $LINENO "configure" 
     3598/* confdefs.h.  */ 
     3599_ACEOF 
     3600cat confdefs.h >>conftest.$ac_ext 
     3601cat >>conftest.$ac_ext <<_ACEOF 
     3602/* end confdefs.h.  */ 
     3603 
     3604/* Override any gcc2 internal prototype to avoid an error.  */ 
     3605#ifdef __cplusplus 
     3606extern "C" 
     3607#endif 
     3608/* We use char because int might match the return type of a gcc2 
     3609   builtin and then its argument prototype would still apply.  */ 
     3610char inet_aton (); 
     3611int 
     3612main () 
     3613{ 
     3614inet_aton (); 
     3615  ; 
     3616  return 0; 
     3617} 
     3618_ACEOF 
     3619rm -f conftest.$ac_objext conftest$ac_exeext 
     3620if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 
     3621  (eval $ac_link) 2>&5 
     3622  ac_status=$? 
     3623  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     3624  (exit $ac_status); } && 
     3625         { ac_try='test -s conftest$ac_exeext' 
     3626  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
     3627  (eval $ac_try) 2>&5 
     3628  ac_status=$? 
     3629  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     3630  (exit $ac_status); }; }; then 
     3631  ac_cv_lib_resolv_inet_aton=yes 
     3632else 
     3633  echo "$as_me: failed program was:" >&5 
     3634sed 's/^/| /' conftest.$ac_ext >&5 
     3635 
     3636ac_cv_lib_resolv_inet_aton=no 
     3637fi 
     3638rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 
     3639LIBS=$ac_check_lib_save_LIBS 
     3640fi 
     3641echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_inet_aton" >&5 
     3642echo "${ECHO_T}$ac_cv_lib_resolv_inet_aton" >&6 
     3643if test $ac_cv_lib_resolv_inet_aton = yes; then 
     3644 
     3645                LIBS="$LIBS -lresolv" 
     3646 
     3647fi 
     3648 
     3649 
     3650fi 
     3651 
     3652 
     3653 
    35123654# Check for the OpenSSL crypto library 
    35133655echo "$as_me:$LINENO: checking for ANSI C header files" >&5 
     
    59256067 
    59266068 
     6069 
    59276070for ac_header in  \ 
    59286071        arpa/inet.h \ 
     
    59376080        sys/socket.h \ 
    59386081        sys/time.h \ 
     6082        termcap.h \ 
    59396083        termios.h \ 
    59406084        unistd.h \ 
  • wire/trunk/configure.in

    r92 r96  
    9292        AC_CHECK_LIB([nsl], [gethostent], [ 
    9393                LIBS="$LIBS -lnsl" 
     94        ]) 
     95]) 
     96 
     97 
     98# Check if we need the network services library 
     99AC_CHECK_FUNC([inet_aton], [], [ 
     100        AC_CHECK_LIB([resolv], [inet_aton], [ 
     101                LIBS="$LIBS -lresolv" 
    94102        ]) 
    95103]) 
     
    219227        sys/socket.h \ 
    220228        sys/time.h \ 
     229        termcap.h \ 
    221230        termios.h \ 
    222231        unistd.h \ 
  • wire/trunk/wire/client.c

    r95 r96  
    1 /* $Id: client.c,v 1.22 2004/07/28 11:28:22 morris Exp $ */ 
     1/* $Id: client.c,v 1.23 2004/08/02 21:12:33 morris Exp $ */ 
    22 
    33/* 
     
    14311431 
    14321432 
     1433 
    14331434void wr_msg_411(int argc, char *argv[]) { 
    14341435        wr_list_node_t  *node; 
  • wire/trunk/wire/main.c

    r95 r96  
    1 /* $Id: main.c,v 1.35 2004/07/28 11:28:22 morris Exp $ */ 
     1/* $Id: main.c,v 1.36 2004/08/02 21:12:33 morris Exp $ */ 
    22 
    33/* 
     
    4242#include <dirent.h> 
    4343#include <libgen.h> 
     44 
     45#ifdef HAVE_TERMCAP_H 
    4446#include <termcap.h> 
     47#endif 
     48 
     49#ifdef HAVE_TERMIOS_H 
    4550#include <termios.h> 
     51#endif 
     52 
    4653#include <readline/readline.h> 
    4754#include <readline/history.h>