Changeset 89

Show
Ignore:
Timestamp:
07/23/04 04:54:27 (4 years ago)
Author:
morris
Message:

better test for termcap functions

Files:

Legend:

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

    r88 r89  
    45654565 
    45664566# Check for the termcap library 
    4567 echo "$as_me:$LINENO: checking for main in -ltermcap" >&5 
    4568 echo $ECHO_N "checking for main in -ltermcap... $ECHO_C" >&6 
    4569 if test "${ac_cv_lib_termcap_main+set}" = set; then 
     4567 
     4568for ac_header in term.h 
     4569do 
     4570as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` 
     4571if eval "test \"\${$as_ac_Header+set}\" = set"; then 
     4572  echo "$as_me:$LINENO: checking for $ac_header" >&5 
     4573echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 
     4574if eval "test \"\${$as_ac_Header+set}\" = set"; then 
     4575  echo $ECHO_N "(cached) $ECHO_C" >&6 
     4576fi 
     4577echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 
     4578echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 
     4579else 
     4580  # Is the header compilable? 
     4581echo "$as_me:$LINENO: checking $ac_header usability" >&5 
     4582echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 
     4583cat >conftest.$ac_ext <<_ACEOF 
     4584#line $LINENO "configure" 
     4585/* confdefs.h.  */ 
     4586_ACEOF 
     4587cat confdefs.h >>conftest.$ac_ext 
     4588cat >>conftest.$ac_ext <<_ACEOF 
     4589/* end confdefs.h.  */ 
     4590$ac_includes_default 
     4591#include <$ac_header> 
     4592_ACEOF 
     4593rm -f conftest.$ac_objext 
     4594if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 
     4595  (eval $ac_compile) 2>&5 
     4596  ac_status=$? 
     4597  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     4598  (exit $ac_status); } && 
     4599         { ac_try='test -s conftest.$ac_objext' 
     4600  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
     4601  (eval $ac_try) 2>&5 
     4602  ac_status=$? 
     4603  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     4604  (exit $ac_status); }; }; then 
     4605  ac_header_compiler=yes 
     4606else 
     4607  echo "$as_me: failed program was:" >&5 
     4608sed 's/^/| /' conftest.$ac_ext >&5 
     4609 
     4610ac_header_compiler=no 
     4611fi 
     4612rm -f conftest.$ac_objext conftest.$ac_ext 
     4613echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 
     4614echo "${ECHO_T}$ac_header_compiler" >&6 
     4615 
     4616# Is the header present? 
     4617echo "$as_me:$LINENO: checking $ac_header presence" >&5 
     4618echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 
     4619cat >conftest.$ac_ext <<_ACEOF 
     4620#line $LINENO "configure" 
     4621/* confdefs.h.  */ 
     4622_ACEOF 
     4623cat confdefs.h >>conftest.$ac_ext 
     4624cat >>conftest.$ac_ext <<_ACEOF 
     4625/* end confdefs.h.  */ 
     4626#include <$ac_header> 
     4627_ACEOF 
     4628if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 
     4629  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 
     4630  ac_status=$? 
     4631  grep -v '^ *+' conftest.er1 >conftest.err 
     4632  rm -f conftest.er1 
     4633  cat conftest.err >&5 
     4634  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     4635  (exit $ac_status); } >/dev/null; then 
     4636  if test -s conftest.err; then 
     4637    ac_cpp_err=$ac_c_preproc_warn_flag 
     4638  else 
     4639    ac_cpp_err= 
     4640  fi 
     4641else 
     4642  ac_cpp_err=yes 
     4643fi 
     4644if test -z "$ac_cpp_err"; then 
     4645  ac_header_preproc=yes 
     4646else 
     4647  echo "$as_me: failed program was:" >&5 
     4648sed 's/^/| /' conftest.$ac_ext >&5 
     4649 
     4650  ac_header_preproc=no 
     4651fi 
     4652rm -f conftest.err conftest.$ac_ext 
     4653echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 
     4654echo "${ECHO_T}$ac_header_preproc" >&6 
     4655 
     4656# So?  What about this header? 
     4657case $ac_header_compiler:$ac_header_preproc in 
     4658  yes:no ) 
     4659    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 
     4660echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} 
     4661    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 
     4662echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} 
     4663    ( 
     4664      cat <<\_ASBOX 
     4665## ------------------------------------ ## 
     4666## Report this to bug-autoconf@gnu.org. ## 
     4667## ------------------------------------ ## 
     4668_ASBOX 
     4669    ) | 
     4670      sed "s/^/$as_me: WARNING:     /" >&2 
     4671    ;; 
     4672  no:yes ) 
     4673    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 
     4674echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} 
     4675    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 
     4676echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} 
     4677    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 
     4678echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} 
     4679    ( 
     4680      cat <<\_ASBOX 
     4681## ------------------------------------ ## 
     4682## Report this to bug-autoconf@gnu.org. ## 
     4683## ------------------------------------ ## 
     4684_ASBOX 
     4685    ) | 
     4686      sed "s/^/$as_me: WARNING:     /" >&2 
     4687    ;; 
     4688esac 
     4689echo "$as_me:$LINENO: checking for $ac_header" >&5 
     4690echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 
     4691if eval "test \"\${$as_ac_Header+set}\" = set"; then 
     4692  echo $ECHO_N "(cached) $ECHO_C" >&6 
     4693else 
     4694  eval "$as_ac_Header=$ac_header_preproc" 
     4695fi 
     4696echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 
     4697echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 
     4698 
     4699fi 
     4700if test `eval echo '${'$as_ac_Header'}'` = yes; then 
     4701  cat >>confdefs.h <<_ACEOF 
     4702#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 
     4703_ACEOF 
     4704 
     4705        echo "$as_me:$LINENO: checking for tgoto" >&5 
     4706echo $ECHO_N "checking for tgoto... $ECHO_C" >&6 
     4707if test "${ac_cv_func_tgoto+set}" = set; then 
     4708  echo $ECHO_N "(cached) $ECHO_C" >&6 
     4709else 
     4710  cat >conftest.$ac_ext <<_ACEOF 
     4711#line $LINENO "configure" 
     4712/* confdefs.h.  */ 
     4713_ACEOF 
     4714cat confdefs.h >>conftest.$ac_ext 
     4715cat >>conftest.$ac_ext <<_ACEOF 
     4716/* end confdefs.h.  */ 
     4717/* System header to define __stub macros and hopefully few prototypes, 
     4718    which can conflict with char tgoto (); below. 
     4719    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 
     4720    <limits.h> exists even on freestanding compilers.  */ 
     4721#ifdef __STDC__ 
     4722# include <limits.h> 
     4723#else 
     4724# include <assert.h> 
     4725#endif 
     4726/* Override any gcc2 internal prototype to avoid an error.  */ 
     4727#ifdef __cplusplus 
     4728extern "C" 
     4729
     4730#endif 
     4731/* We use char because int might match the return type of a gcc2 
     4732   builtin and then its argument prototype would still apply.  */ 
     4733char tgoto (); 
     4734/* The GNU C library defines this for functions which it implements 
     4735    to always fail with ENOSYS.  Some functions are actually named 
     4736    something starting with __ and the normal name is an alias.  */ 
     4737#if defined (__stub_tgoto) || defined (__stub___tgoto) 
     4738choke me 
     4739#else 
     4740char (*f) () = tgoto; 
     4741#endif 
     4742#ifdef __cplusplus 
     4743
     4744#endif 
     4745 
     4746int 
     4747main () 
     4748
     4749return f != tgoto; 
     4750  ; 
     4751  return 0; 
     4752
     4753_ACEOF 
     4754rm -f conftest.$ac_objext conftest$ac_exeext 
     4755if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 
     4756  (eval $ac_link) 2>&5 
     4757  ac_status=$? 
     4758  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     4759  (exit $ac_status); } && 
     4760         { ac_try='test -s conftest$ac_exeext' 
     4761  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
     4762  (eval $ac_try) 2>&5 
     4763  ac_status=$? 
     4764  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     4765  (exit $ac_status); }; }; then 
     4766  ac_cv_func_tgoto=yes 
     4767else 
     4768  echo "$as_me: failed program was:" >&5 
     4769sed 's/^/| /' conftest.$ac_ext >&5 
     4770 
     4771ac_cv_func_tgoto=no 
     4772fi 
     4773rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 
     4774fi 
     4775echo "$as_me:$LINENO: result: $ac_cv_func_tgoto" >&5 
     4776echo "${ECHO_T}$ac_cv_func_tgoto" >&6 
     4777if test $ac_cv_func_tgoto = yes; then 
     4778  : 
     4779else 
     4780 
     4781                echo "$as_me:$LINENO: checking for tgoto in -ltermcap" >&5 
     4782echo $ECHO_N "checking for tgoto in -ltermcap... $ECHO_C" >&6 
     4783if test "${ac_cv_lib_termcap_tgoto+set}" = set; then 
    45704784  echo $ECHO_N "(cached) $ECHO_C" >&6 
    45714785else 
     
    45804794/* end confdefs.h.  */ 
    45814795 
    4582  
     4796/* Override any gcc2 internal prototype to avoid an error.  */ 
     4797#ifdef __cplusplus 
     4798extern "C" 
     4799#endif 
     4800/* We use char because int might match the return type of a gcc2 
     4801   builtin and then its argument prototype would still apply.  */ 
     4802char tgoto (); 
    45834803int 
    45844804main () 
    45854805{ 
    4586 main (); 
     4806tgoto (); 
    45874807  ; 
    45884808  return 0; 
     
    46014821  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
    46024822  (exit $ac_status); }; }; then 
    4603   ac_cv_lib_termcap_main=yes 
     4823  ac_cv_lib_termcap_tgoto=yes 
    46044824else 
    46054825  echo "$as_me: failed program was:" >&5 
    46064826sed 's/^/| /' conftest.$ac_ext >&5 
    46074827 
    4608 ac_cv_lib_termcap_main=no 
     4828ac_cv_lib_termcap_tgoto=no 
    46094829fi 
    46104830rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 
    46114831LIBS=$ac_check_lib_save_LIBS 
    46124832fi 
    4613 echo "$as_me:$LINENO: result: $ac_cv_lib_termcap_main" >&5 
    4614 echo "${ECHO_T}$ac_cv_lib_termcap_main" >&6 
    4615 if test $ac_cv_lib_termcap_main = yes; then 
    4616  
    4617         LIBS="$LIBS -ltermcap" 
    4618  
    4619 fi 
     4833echo "$as_me:$LINENO: result: $ac_cv_lib_termcap_tgoto" >&5 
     4834echo "${ECHO_T}$ac_cv_lib_termcap_tgoto" >&6 
     4835if test $ac_cv_lib_termcap_tgoto = yes; then 
     4836 
     4837                        LIBS="$LIBS -ltermcap" 
     4838 
     4839else 
     4840 
     4841                        echo "$as_me:$LINENO: checking for tgoto in -lcurses" >&5 
     4842echo $ECHO_N "checking for tgoto in -lcurses... $ECHO_C" >&6 
     4843if test "${ac_cv_lib_curses_tgoto+set}" = set; then 
     4844  echo $ECHO_N "(cached) $ECHO_C" >&6 
     4845else 
     4846  ac_check_lib_save_LIBS=$LIBS 
     4847LIBS="-lcurses  $LIBS" 
     4848cat >conftest.$ac_ext <<_ACEOF 
     4849#line $LINENO "configure" 
     4850/* confdefs.h.  */ 
     4851_ACEOF 
     4852cat confdefs.h >>conftest.$ac_ext 
     4853cat >>conftest.$ac_ext <<_ACEOF 
     4854/* end confdefs.h.  */ 
     4855 
     4856/* Override any gcc2 internal prototype to avoid an error.  */ 
     4857#ifdef __cplusplus 
     4858extern "C" 
     4859#endif 
     4860/* We use char because int might match the return type of a gcc2 
     4861   builtin and then its argument prototype would still apply.  */ 
     4862char tgoto (); 
     4863int 
     4864main () 
     4865
     4866tgoto (); 
     4867  ; 
     4868  return 0; 
     4869
     4870_ACEOF 
     4871rm -f conftest.$ac_objext conftest$ac_exeext 
     4872if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 
     4873  (eval $ac_link) 2>&5 
     4874  ac_status=$? 
     4875  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     4876  (exit $ac_status); } && 
     4877         { ac_try='test -s conftest$ac_exeext' 
     4878  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
     4879  (eval $ac_try) 2>&5 
     4880  ac_status=$? 
     4881  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     4882  (exit $ac_status); }; }; then 
     4883  ac_cv_lib_curses_tgoto=yes 
     4884else 
     4885  echo "$as_me: failed program was:" >&5 
     4886sed 's/^/| /' conftest.$ac_ext >&5 
     4887 
     4888ac_cv_lib_curses_tgoto=no 
     4889fi 
     4890rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 
     4891LIBS=$ac_check_lib_save_LIBS 
     4892fi 
     4893echo "$as_me:$LINENO: result: $ac_cv_lib_curses_tgoto" >&5 
     4894echo "${ECHO_T}$ac_cv_lib_curses_tgoto" >&6 
     4895if test $ac_cv_lib_curses_tgoto = yes; then 
     4896 
     4897                                LIBS="$LIBS -lcurses" 
     4898 
     4899fi 
     4900 
     4901 
     4902fi 
     4903 
     4904 
     4905fi 
     4906 
     4907 
     4908fi 
     4909 
     4910done 
    46204911 
    46214912 
  • wire/trunk/configure.in

    r88 r89  
    150150 
    151151# Check for the termcap library 
    152 AC_CHECK_LIB([termcap], [main], [ 
    153         LIBS="$LIBS -ltermcap" 
     152AC_CHECK_HEADERS([term.h], [ 
     153        AC_CHECK_FUNC([tgoto], [], [ 
     154                AC_CHECK_LIB([termcap], [tgoto], [ 
     155                        LIBS="$LIBS -ltermcap" 
     156                ], [ 
     157                        AC_CHECK_LIB([curses], [tgoto], [ 
     158                                LIBS="$LIBS -lcurses" 
     159                        ]) 
     160                ]) 
     161        ]) 
    154162]) 
    155163