From 1d61424ff6677d10804f3c2a02837b05b5dc9509 Mon Sep 17 00:00:00 2001 From: Unknown User d91-jda Date: Sat, 28 Oct 1995 18:20:04 +0000 Subject: [PATCH] Various fixes for AIX 4.1 git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@186 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/telnet/acconfig.h | 3 ++ appl/telnet/config.h.in | 3 ++ appl/telnet/configure | 68 +++++++++++++++------------------- appl/telnet/configure.in | 11 +++++- appl/telnet/telnetd/sys_term.c | 4 +- 5 files changed, 47 insertions(+), 42 deletions(-) diff --git a/appl/telnet/acconfig.h b/appl/telnet/acconfig.h index e92594246..efec3876f 100644 --- a/appl/telnet/acconfig.h +++ b/appl/telnet/acconfig.h @@ -60,6 +60,9 @@ /* Used with login -p */ #undef LOGIN_ARGS +/* Define if you have setupterm() */ +#undef HAVE_SETUPTERM + /* */ #undef STREAMSPTY diff --git a/appl/telnet/config.h.in b/appl/telnet/config.h.in index 19965b030..5de91ff00 100644 --- a/appl/telnet/config.h.in +++ b/appl/telnet/config.h.in @@ -41,6 +41,9 @@ /* */ #undef OLD_ENVIRON +/* Define if you have setupterm() */ +#undef HAVE_SETUPTERM + /* */ #undef STREAMSPTY diff --git a/appl/telnet/configure b/appl/telnet/configure index 63003ddfe..0e141d920 100755 --- a/appl/telnet/configure +++ b/appl/telnet/configure @@ -870,7 +870,7 @@ fi done -for ac_func in tgetent +for ac_func in tgetent setupterm do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then @@ -921,6 +921,7 @@ else fi done + if test $ac_cv_func_tgetent = no; then # tgetent is not in the default libraries. See if it's in some other. for lib in termcap; do @@ -931,7 +932,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$lib $LIBS" cat > conftest.$ac_ext <&6 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +if test $ac_cv_func_setupterm = no; then + # setupterm is not in the default libraries. See if it's in some other. + for lib in curses; do + echo $ac_n "checking for -l$lib""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_lib_$lib'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -char $ac_func(); int main() { return 0; } int t() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - +setupterm() ; return 0; } EOF if eval $ac_link; then rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" + eval "ac_cv_lib_$lib=yes" else rm -rf conftest* - eval "ac_cv_func_$ac_func=no" + eval "ac_cv_lib_$lib=no" fi rm -f conftest* +LIBS="$ac_save_LIBS" fi -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$lib`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'` - cat >> confdefs.h <> confdefs.h <<\EOF +#define HAVE_SETUPTERM 1 EOF - + + LIBS="$LIBS -l$lib"; break else echo "$ac_t""no" 1>&6 fi -done + done +fi # these two are mainly here for solaris @@ -1025,7 +1017,7 @@ if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < conftest.$ac_ext <&6 else cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < Syntax Error @@ -1274,7 +1266,7 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error diff --git a/appl/telnet/configure.in b/appl/telnet/configure.in index 4f2afc21e..adf69c377 100644 --- a/appl/telnet/configure.in +++ b/appl/telnet/configure.in @@ -148,7 +148,8 @@ AC_REPLACE_FUNCS(getent herror memmove setenv strdup strerror) AC_CHECK_FUNCS(cgetent uname vfork vhangup) -AC_CHECK_FUNCS(tgetent) +AC_CHECK_FUNCS(tgetent setupterm) + if test $ac_cv_func_tgetent = no; then # tgetent is not in the default libraries. See if it's in some other. for lib in termcap; do @@ -157,7 +158,13 @@ if test $ac_cv_func_tgetent = no; then done fi -AC_CHECK_FUNCS(setupterm) +if test $ac_cv_func_setupterm = no; then + # setupterm is not in the default libraries. See if it's in some other. + for lib in curses; do + AC_CHECK_LIB($lib, setupterm, [AC_DEFINE(HAVE_SETUPTERM) + LIBS="$LIBS -l$lib"; break]) + done +fi # these two are mainly here for solaris diff --git a/appl/telnet/telnetd/sys_term.c b/appl/telnet/telnetd/sys_term.c index c636b28d9..d572bb889 100644 --- a/appl/telnet/telnetd/sys_term.c +++ b/appl/telnet/telnetd/sys_term.c @@ -101,7 +101,7 @@ extern struct sysv sysv; #include #undef SE #endif -#if !(defined(__sgi) || defined(__linux)) +#if !(defined(__sgi) || defined(__linux) || defined(_AIX)) #include #endif #ifdef t_erase @@ -1362,7 +1362,7 @@ login_tty(t) * setsid() call above may have set our pgrp, so clear * it out before opening the tty... */ -# if defined(SOLARIS) || defined(__hpux) || defined(__sgi) +# if defined(SOLARIS) || defined(__hpux) || defined(__sgi) || defined(_AIX) (void) setpgrp(); # else (void) setpgrp(0, 0);