diff --git a/appl/ftp/config.h.in b/appl/ftp/config.h.in index ca2ce1b35..dcec350e5 100644 --- a/appl/ftp/config.h.in +++ b/appl/ftp/config.h.in @@ -6,11 +6,14 @@ #include "../../config.h" +/* Define if you have a working `mmap' system call. */ +#undef HAVE_MMAP + /* Define if you have the gethostbyname function. */ #undef HAVE_GETHOSTBYNAME -/* Define if you have the mmap function. */ -#undef HAVE_MMAP +/* Define if you have the getpagesize function. */ +#undef HAVE_GETPAGESIZE /* Define if you have the setproctitle function. */ #undef HAVE_SETPROCTITLE @@ -18,6 +21,9 @@ /* Define if you have the socket function. */ #undef HAVE_SOCKET +/* Define if you have the valloc function. */ +#undef HAVE_VALLOC + /* Define if you have the header file. */ #undef HAVE_BSD_BSD_H diff --git a/appl/ftp/configure b/appl/ftp/configure index 6d342cdad..bc6ddec74 100755 --- a/appl/ftp/configure +++ b/appl/ftp/configure @@ -1067,7 +1067,7 @@ EOF esac -for ac_func in setproctitle mmap +for ac_func in valloc getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then @@ -1118,6 +1118,153 @@ else fi done +echo $ac_n "checking for working mmap""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_func_mmap'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_mmap=no +else +cat > conftest.$ac_ext < +#include +#include + +#ifndef HAVE_GETPAGESIZE +# include +# ifdef EXEC_PAGESIZE +# define getpagesize() EXEC_PAGESIZE +# else +# ifdef NBPG +# define getpagesize() NBPG * CLSIZE +# ifndef CLSIZE +# define CLSIZE 1 +# endif +# else +# ifdef NBPC +# define getpagesize() NBPC +# else +# define getpagesize() PAGESIZE /* SVR4 */ +# endif +# endif +# endif +#endif + +#ifndef HAVE_VALLOC +# define valloc malloc +#endif + +#ifdef __cplusplus +extern "C" { void *valloc(unsigned), *malloc(unsigned); } +#else +char *valloc(), *malloc(); +#endif + +int +main() +{ + char *buf1, *buf2, *buf3; + int i = getpagesize(), j; + int i2 = i * 2; + int fd; + + buf1 = (char *)valloc(i2); + buf2 = (char *)valloc(i); + buf3 = (char *)malloc(i2); + for (j = 0; j < i2; ++j) + *(buf1 + j) = rand(); + fd = open("conftestmmap", O_CREAT | O_RDWR, 0666); + write(fd, buf1, i2); + mmap(buf2, i, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_PRIVATE, fd, 0); + for (j = 0; j < i; ++j) + if (*(buf1 + j) != *(buf2 + j)) + exit(1); + lseek(fd, (long)i, 0); + read(fd, buf2, i); /* read into mapped memory -- file should not change */ + /* (it does in i386 SVR4.0 - Jim Avera, jima@netcom.com) */ + lseek(fd, (long)0, 0); + read(fd, buf3, i2); + for (j = 0; j < i2; ++j) + if (*(buf1 + j) != *(buf3 + j)) + exit(1); + exit(0); +} + +EOF +{ (eval echo configure:1199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } +if test -s conftest && (./conftest; exit) 2>/dev/null; then + ac_cv_func_mmap=yes +else + ac_cv_func_mmap=no +fi +fi +rm -fr conftest* +fi + +echo "$ac_t""$ac_cv_func_mmap" 1>&6 +if test $ac_cv_func_mmap = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_MMAP 1 +EOF + +fi + + +for ac_func in setproctitle +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +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 < +/* 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 + +; return 0; } +EOF +if { (eval echo configure:1247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* + +fi +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + trap '' 1 2 15 cat > confcache <<\EOF diff --git a/appl/telnet/config.h.in b/appl/telnet/config.h.in index 5ac02d1fb..9626454fa 100644 --- a/appl/telnet/config.h.in +++ b/appl/telnet/config.h.in @@ -70,6 +70,9 @@ /* Define if you have the logout function. */ #undef HAVE_LOGOUT +/* Define if you have the logwtmp function. */ +#undef HAVE_LOGWTMP + /* Define if you have the ptsname function. */ #undef HAVE_PTSNAME diff --git a/appl/telnet/configure b/appl/telnet/configure index 6b3d32c90..4d673c51e 100755 --- a/appl/telnet/configure +++ b/appl/telnet/configure @@ -1691,6 +1691,84 @@ esac +echo $ac_n "checking for logwtmp""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_funclib_logwtmp'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +if eval "test \"\$ac_cv_func_logwtmp\" != yes" ; then + ac_save_LIBS="$LIBS" + for ac_lib in "" util; do + if test -n "$ac_lib"; then + ac_lib="-l$ac_lib" + LIBS="$ac_lib $ac_save_LIBS" + fi + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then + rm -rf conftest* + eval "if test -n \"$ac_lib\";then ac_cv_funclib_logwtmp=$ac_lib; else ac_cv_funclib_logwtmp=yes; fi";break +fi +rm -f conftest* + + done + eval "ac_cv_funclib_logwtmp=\${ac_cv_funclib_logwtmp-no}" + LIBS="$ac_save_LIBS" +fi + +fi + + +eval "ac_res=\$ac_cv_funclib_logwtmp" + +# autoheader tricks *sigh* +: << END +@@@funcs="$funcs logwtmp"@@@ +@@@libs="$libs util"@@@ +END + +eval "ac_tr_func=HAVE_`echo logwtmp | tr '[a-z]' '[A-Z]'`" +eval "ac_tr_lib=HAVE_LIB`echo $ac_res | sed -e 's/-l//' | tr '[a-z]' '[A-Z]'`" + +case "$ac_res" in + yes) + eval "ac_cv_func_logwtmp=yes" + cat >> confdefs.h <&6 + ;; + no) + eval "ac_cv_func_logwtmp=no" + echo "$ac_t""no" 1>&6 + ;; + *) + eval "ac_cv_func_logwtmp=yes" + eval "ac_cv_lib_`echo "$ac_res" | sed 's/-l//'`=yes" + cat >> confdefs.h <> confdefs.h <&6 + + LIBS="$ac_res $LIBS" + ;; +esac + + + for ac_hdr in sys/filio.h sys/ioctl.h sys/ptyvar.h sys/resource.h do @@ -1700,12 +1778,12 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1709: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1787: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1737,12 +1815,12 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1746: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1824: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1774,12 +1852,12 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1783: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1861: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest*