ncftp-3.2.6/0000755000000000000000000000000013021063723011450 5ustar rootwheelncftp-3.2.6/autoconf_local/0000755000000000000000000000000013021063722014437 5ustar rootwheelncftp-3.2.6/autoconf_local/acconfig.h0000644000000000000000000003055113011746464016377 0ustar rootwheel/* acconfig.h This file is in the public domain. Descriptive text for the C preprocessor macros that the distributed Autoconf macros can define. No software package will use all of them; autoheader copies the ones your configure.in uses into your configuration header file templates. The entries are in sort -df order: alphabetical, case insensitive, ignoring punctuation (such as underscores). Although this order can split up related entries, it makes it easier to check whether a given entry is in the file. Leave the following blank line there!! Autoheader needs it. */ #undef alarm_time_t /* Define if on AIX 3. System headers sometimes define this. We just want to avoid a redefinition error message. */ #ifndef _ALL_SOURCE #undef _ALL_SOURCE #endif #undef CAN_USE_SYS_SELECT_H /* Define if using alloca.c. */ #undef C_ALLOCA /* Define if type char is unsigned and you are not using gcc. */ #ifndef __CHAR_UNSIGNED__ #undef __CHAR_UNSIGNED__ #endif /* Define if the closedir function returns void instead of int. */ #undef CLOSEDIR_VOID /* Define to empty if the keyword does not work. */ #undef const /* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. This function is required for alloca.c support on those systems. */ #undef CRAY_STACKSEG_END /* Define for DGUX with . */ #undef DGUX /* Define if you have . */ #undef DIRENT /* Define to the type of elements in the array set by `getgroups'. Usually this is either `int' or `gid_t'. */ #undef GETGROUPS_T #undef gethost_addrptr_t #undef gethostname_size_t /* Define if the `getloadavg' function needs to be run setuid or setgid. */ #undef GETLOADAVG_PRIVILEGED /* Define if the `getpgrp' function takes no argument. */ #undef GETPGRP_VOID /* Define to `int' if doesn't define. */ #undef gid_t /* Define if you have alloca, as a function or macro. */ #undef HAVE_ALLOCA /* Define if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H /* Define if your curses library has this functionality. */ #undef HAVE_BEEP #undef HAVE_CURSES_H /* Define if you don't have vprintf but do have _doprnt. */ #undef HAVE_DOPRNT /* Define if your system has a working fnmatch function. */ #undef HAVE_FNMATCH /* Define if your curses library has this functionality. */ #undef HAVE_GETBEGX /* Define if your curses library has this functionality. */ #undef HAVE_GETBEGYX /* Define if your curses library has this functionality. */ #undef HAVE_GETCURX /* Define if your system has its own `getloadavg' function. */ #undef HAVE_GETLOADAVG /* Define if your curses library has this functionality. */ #undef HAVE_GETMAXX /* Define if your curses library has this functionality. */ #undef HAVE_GETMAXYX /* Define if you have the getmntent function. */ #undef HAVE_GETMNTENT /* Define if your curses library has this functionality. */ #undef HAVE_GETYX /* Define if you have . */ #undef HAVE_HPSECURITY_H /* Define if you have the curses library. */ #undef HAVE_LIBCURSES /* Define if you want to use the Hpwd library, and you also have it's corresponding database library (such as *dbm). */ #undef HAVE_LIBHPWD /* Define if you have the ncurses library. */ #undef HAVE_LIBNCURSES /* Define if you have the readline library, version 2.0 or higher. */ #undef HAVE_LIBREADLINE /* Define if the `long double' type works. */ #undef HAVE_LONG_DOUBLE /* Define if you support file names longer than 14 characters. */ #undef HAVE_LONG_FILE_NAMES /* Define if your compiler supports the "long long" integral type. */ #undef HAVE_LONG_LONG /* Most system's curses library uses a _maxx field instead of maxx. */ #undef HAVE__MAXX /* Define if you have a working `mmap' system call. */ #undef HAVE_MMAP #undef HAVE_MSGHDR_ACCRIGHTS #undef HAVE_MSGHDR_CONTROL #undef HAVE_PR_PASSWD_FG_OLDCRYPT /* Define if you have a _res global variable used by resolve routines. */ #undef HAVE__RES_DEFDNAME /* Define if system calls automatically restart after interruption by a signal. */ #undef HAVE_RESTARTABLE_SYSCALLS /* Define if you have sigsetjmp and siglongjmp. */ #undef HAVE_SIGSETJMP #undef HAVE_SOCKADDR_UN_SUN_LEN #undef HAVE_STATFS_F_BAVAIL #undef HAVE_STATVFS_F_FRSIZE /* Define if your struct stat has st_blksize. */ #undef HAVE_ST_BLKSIZE /* Define if your struct stat has st_blocks. */ #undef HAVE_ST_BLOCKS /* Define if you have the strcoll function and it is properly defined. */ #undef HAVE_STRCOLL /* Define if your struct stat has st_rdev. */ #undef HAVE_ST_RDEV /* Define if you have the strftime function. */ #undef HAVE_STRFTIME /* Define if you have the ANSI # stringizing operator in cpp. */ #undef HAVE_STRINGIZE #undef HAVE_STRUCT_CMSGDHR #undef HAVE_STRUCT_STAT64 /* Define if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define if your curses library has this functionality. */ #undef HAVE_TOUCHWIN /* Define if your struct tm has tm_zone. */ #undef HAVE_TM_ZONE /* Define if you don't have tm_zone but do have the external array tzname. */ #undef HAVE_TZNAME /* Define if you have . */ #undef HAVE_UNISTD_H #undef HAVE_UNIX_DOMAIN_SOCKETS /* Define if utime(file, NULL) sets file's timestamp to the present. */ #undef HAVE_UTIME_NULL /* Define if you have a ut_host field in your struct utmp. */ #undef HAVE_UTMP_UT_HOST #undef HAVE_UTMP_UT_NAME #undef HAVE_UTMP_UT_USER #undef HAVE_UTMP_UT_PID #undef HAVE_UTMP_UT_TIME #undef HAVE_UTMP_UT_TYPE #undef HAVE_UTMPX_UT_SYSLEN #undef HAVE_UTMPX_UT_TYPE #undef HAVE_UTMPX_UT_USER /* Define if you have . */ #undef HAVE_VFORK_H /* Define if you have the vprintf function. */ #undef HAVE_VPRINTF /* Define if you have the wait3 system call. */ #undef HAVE_WAIT3 /* Define as __inline if that's what the C compiler calls it. */ #undef inline /* Define if chown is promiscuous (regular user can give away ownership) */ #undef INSECURE_CHOWN /* Define if int is 16 bits instead of 32. */ #undef INT_16_BITS #undef listen_backlog_t /* Define if long int is 64 bits. */ #undef LONG_64_BITS #undef main_void_return_t /* Define if major, minor, and makedev are declared in . */ #undef MAJOR_IN_MKDEV /* Define if major, minor, and makedev are declared in . */ #undef MAJOR_IN_SYSMACROS /* Define if on MINIX. */ #undef _MINIX /* Define to `int' if doesn't define. */ #undef mode_t /* Define this because you definitely don't have it. Used only for testing configure. */ #undef negative_control_t /* Define if you don't have , but have . */ #undef NDIR /* Define if optind, optarg, etc., need to be declared as extern. */ #undef NEED_GETOPT_EXTERN_DECLS /* Define if exists and declares optind, optarg, etc. */ #undef NEED_GETOPT_H /* Define if you have , and doesn't declare the mem* functions. */ #undef NEED_MEMORY_H /* Define if your struct nlist has an n_un member. */ #undef NLIST_NAME_UNION /* Define if you have . */ #undef NLIST_STRUCT /* Define if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O /* Define if your Fortran 77 compiler doesn't accept -c and -o together. */ #undef F77_NO_MINUS_C_MINUS_O /* Define to `long' if doesn't define. */ #undef off_t #undef OS /* Define to the full path of the Perl program, if you have it. */ #undef PERL /* Define to `int' if doesn't define. */ #undef pid_t /* Define if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE #undef PRAGMA_HDRSTOP /* Define to the full path of $prefix/bin. */ #undef PREFIX_BINDIR /* Define if you need to in order for stat and other things to work. */ #undef _POSIX_SOURCE /* Format string for the printf() family for 64 bit integers. */ #undef PRINTF_LONG_LONG /* Define if printing a "long long" with "%lld" works . */ #undef PRINTF_LONG_LONG_LLD /* Define if printing a "long long" with "%qd" works . */ #undef PRINTF_LONG_LONG_QD /* Format string for the printf() family for 64 bit unsigned integers. */ #undef PRINTF_ULONG_LONG /* Define if your C compiler supports ANSI C function prototyping. */ #undef PROTOTYPES #undef read_return_t #undef read_size_t #undef recv_return_t #undef recv_size_t /* Define as the return type of signal handlers (int or void). */ #undef RETSIGTYPE /* Format string for the scanf() family for 64 bit integers. */ #undef SCANF_LONG_LONG #undef sa_family_t /* Define if scanning a "long long" with "%lld" works. */ #undef SCANF_LONG_LONG_LLD /* Define if scanning a "long long" with "%qd" works. */ #undef SCANF_LONG_LONG_QD /* Format string for the scanf() family for 64 bit unsigned integers. */ #undef SCANF_ULONG_LONG /* Define to the type of arg1 for select(). */ #undef SELECT_TYPE_ARG1 /* Define to the type of args 2, 3 and 4 for select(). */ #undef SELECT_TYPE_ARG234 /* Define to the type of arg5 for select(). */ #undef SELECT_TYPE_ARG5 #undef send_return_t #undef send_size_t /* Define if the `setpgrp' function takes no argument. */ #undef SETPGRP_VOID /* Define if the setvbuf function takes the buffering type as its second argument and the buffer pointer as the third, as on System V before release 3. */ #undef SETVBUF_REVERSED /* Define to `int' if doesn't define. */ #undef sig_atomic_t /* Define to `unsigned' if doesn't define. */ #undef size_t /* Define to sizeof(off_t) */ #undef SIZEOF_OFF_T /* Define to sizeof(off64_t) */ #undef SIZEOF_OFF64_T /* Define to sizeof(int *) */ #undef SIZEOF_PTR /* Define to sizeof(struct stat) */ #undef SIZEOF_STRUCT_STAT /* Define to sizeof(struct stat64), if you have it. */ #undef SIZEOF_STRUCT_STAT64 /* Define to sizeof(struct stat.st_size) */ #undef SIZEOF_ST_SIZE /* Define to sizeof(struct stat64.st_size) */ #undef SIZEOF_STAT64_ST_SIZE #undef SNPRINTF_RETURNS_PTR #undef SNPRINTF_TERMINATES #undef sockaddr_size_t /* If SOCKS library is being used, define the major version (i.e. 5) */ #undef SOCKS #undef sockopt_size_t #undef SPRINTF_RETURNS_PTR /* Define to `long' if doesn't define. */ #undef ssize_t /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define if the `S_IS*' macros in do not work properly. */ #undef STAT_MACROS_BROKEN /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define on System V Release 4. */ #undef SVR4 /* Define if you don't have , but have . */ #undef SYSDIR /* Define if you don't have , but have . */ #undef SYSNDIR /* Define if `sys_siglist' is declared by . */ #undef SYS_SIGLIST_DECLARED /* Define to the full path of the Tar program, if you have it. */ #undef TAR /* Define if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define if your declares struct tm. */ #undef TM_IN_SYS_TIME #undef tv_sec_t #undef tv_usec_t /* Define to `int' if doesn't define. */ #undef uid_t /* Define for Encore UMAX. */ #undef UMAX /* Result of "uname -a" */ #undef UNAME /* Define for Encore UMAX 4.3 that has instead of . */ #undef UMAX4_3 /* Define if you do not have , index, bzero, etc.. */ #undef USG /* Define vfork as fork if vfork does not work. */ #undef vfork /* Define if the closedir function returns void instead of int. */ #undef VOID_CLOSEDIR #undef waddstr_str_t #undef WADDSTR_TYPE_ARG1_CONST /* Define if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ #undef WORDS_BIGENDIAN #undef write_return_t #undef write_size_t /* Define if the X Window System is missing or not being used. */ #undef X_DISPLAY_MISSING /* Define if lex declares yytext as a char * by default, not a char[]. */ #undef YYTEXT_POINTER /* Leave that blank line there!! Autoheader needs it. If you're adding to this file, keep in mind: The entries are in sort -df order: alphabetical, case insensitive, ignoring punctuation (such as underscores). */ ncftp-3.2.6/autoconf_local/aclocal.m40000644000000000000000000044207613021063111016304 0ustar rootwheeldnl NcFTP Software dnl Do not remove these header dnl lines. dnl dnl wi_CACHE_CHECK_GUESS_MESSAGE(MESSAGE, CACHE-ID, COMMANDS) dnl ---define(wi_CACHE_CHECK_GUESS_MESSAGE, AC_DEFUN(wi_CACHE_CHECK_GUESS_MESSAGE, [AC_MSG_CHECKING([$1]) AC_CACHE_VAL([$2], [$3]) AC_MSG_RESULT([$]guess[$]$2) guess="" ]) dnl dnl dnl dnl AC_DEFUN(wi_ARG_WITH_SOCKS5, [ AC_ARG_WITH(socks5,[ --with-socks5 try to find and use the SOCKS5 library],wi_want_socks5=$withval,wi_want_socks5=no) ]) dnl dnl dnl dnl AC_DEFUN(wi_LIB_SOCKS5, [ if test "$wi_want_socks5" != yes ; then ac_cv_lib_socks5_SOCKSinit=no else # Look for the "SOCKS" library for use with Firewalls/Gateways. SOCKS_LIBS='' # First check for extra libraries that may be needed to # link against socks. If we already checked for one or # more of these libraries, we don't want to count them # in the socks-only list. # if test "x$ac_cv_lib_db_main" = "x" ; then AC_CHECK_LIB(db,main,[SOCKS_LIBS="$SOCKS_LIBS -ldb"]) fi if test "x$ac_cv_lib_isode_main" = "x" ; then AC_CHECK_LIB(isode,main,[SOCKS_LIBS="$SOCKS_LIBS -lisode"]) fi if test "x$ac_cv_lib_com_err_main" = "x" ; then AC_CHECK_LIB(com_err,main,[SOCKS_LIBS="$SOCKS_LIBS -lcom_err"]) fi if test "x$ac_cv_lib_crypto_main" = "x" ; then AC_CHECK_LIB(crypto,main,[SOCKS_LIBS="$SOCKS_LIBS -lcrypto"]) fi if test "x$ac_cv_lib_krb5_main" = "x" ; then AC_CHECK_LIB(krb5,main,[SOCKS_LIBS="$SOCKS_LIBS -lkrb5"]) fi if test "x$ac_cv_lib_gssapi_krb5_main" = "x" ; then AC_CHECK_LIB(gssapi_krb5,main,[SOCKS_LIBS="$SOCKS_LIBS -lgssapi_krb5"]) fi AC_CHECK_LIB(socks5,SOCKSinit,[SOCKS_LIBS="$SOCKS_LIBS -lsocks5"]) AC_CHECK_HEADERS(socks.h socks5p.h) if test "$ac_cv_lib_socks5_SOCKSinit" != yes ; then ac_cv_lib_socks5_SOCKSinit=no unset SOCKS_LIBS else AC_SUBST(SOCKS_LIBS) AC_DEFINE(SOCKS,5) fi fi AC_MSG_CHECKING([if SOCKS5 will be used]) AC_MSG_RESULT([$ac_cv_lib_socks5_SOCKSinit]) ]) dnl dnl dnl dnl AC_DEFUN(wi_ARG_ENABLE_DEBUG, [ # if DEBUGBUILD is yes, other macros try to set up a compilation environment # with debugging symbols enabled. Example macros which are affected are # wi_CFLAGS and wi_SFLAG. # AC_ARG_ENABLE(debug, [ --enable-debug enable debugging symbols], [ DEBUGBUILD=no DEBUGCONFIGUREFLAG="" if test "$enableval" != "no" ; then DEBUGBUILD=yes DEBUGCONFIGUREFLAG="--enable-debug" fi ],[ dnl # Argument not specified; default is disabled. DEBUGBUILD=no DEBUGCONFIGUREFLAG="" ]) ]) dnl dnl dnl dnl AC_DEFUN(wi_ARG_DISABLE_CCDV, [ AC_ARG_ENABLE(ccdv,[ --disable-ccdv disable use of ccdv program in Makefiles],use_ccdv="$enableval",use_ccdv=yes) ]) dnl dnl dnl dnl AC_DEFUN(wi_ARG_ENABLE_MACOSX_UNIVERSAL, [ AC_ARG_ENABLE(universal,[ --enable-universal enable production of universal binaries on Mac OS X],use_macosx_universal="$enableval",use_macosx_universal=no) ]) dnl dnl dnl dnl AC_DEFUN(wi_ARG_DISABLE_MACOSX_UNIVERSAL, [ AC_ARG_ENABLE(universal,[ --disable-universal disable production of universal binaries on Mac OS X],use_macosx_universal="$enableval",use_macosx_universal=yes) ]) dnl dnl dnl dnl AC_DEFUN(wi_ARG_DISABLE_PRECOMP, [ AC_ARG_ENABLE(precomp,[ --disable-precomp disable use of precompiled header files],use_precomp="$enableval",use_precomp=yes) ]) dnl dnl dnl dnl AC_DEFUN(wi_CC_PRECOMP, [ AC_CACHE_CHECK([if the C compiler can use precompiled headers], [wi_cv_cc_precomp], [ result="no" if test "${use_macosx_universal}" != no ; then # Precompiling the headers doesn't seem to work when building universal binaries use_precomp=no fi if test "${use_precomp-yes}" != no ; then wi_cv_cc_precomp_type="unknown" rm -f pchtest.h pchtest.p pchtest.c pchtest.o pchtest csetc.pch pchtest.pch pchtest.h.gch cat < pchtest.h /* pchtest.h */ #include #include #include #define FOOBAR 33 /* Make sure it can compile custom headers too */ EOF cat < pchtest.c /* pchtest.c */ #include "pchtest.h" int main(int argc, char **argv) { if (FOOBAR == 33) exit(0); exit(1); } EOF if test "$GCC" = yes ; then # # Try gcc 3.4's built-in implementation first # echo ${CC-cc} $CPPFLAGS pchtest.h -c >&5 ${CC-cc} $CPPFLAGS pchtest.h -c >&5 2>&5 if test -f pchtest.h.gch ; then # # Good, the .gch file was created. # Odds are we're good to go. # echo "Successfully compiled pchtest.h into the precompiled header file pchtest.h.gch." >&5 AC_TRY_COMPILE([#include "pchtest.h"],[if (FOOBAR == 33) exit(0)],[result="yes" ; wi_cv_cc_precomp_type="gcc_gch_files"],[result="no"]) else echo "This version of GCC did not compile pchtest.h into the precompiled header file pchtest.h.gch." >&5 # # See if Apple's implementation works. # echo ${CC-cc} $CPPFLAGS -precomp pchtest.h -o pchtest.p >&5 ${CC-cc} $CPPFLAGS -precomp pchtest.h -o pchtest.p >&5 2>&5 if test -s pchtest.p ; then AC_TRY_COMPILE([#include "pchtest.h"],[if (FOOBAR == 33) exit(0)],[result="yes" ; wi_cv_cc_precomp_type="gcc_dash_precomp"],[result="no"]) fi fi elif test "${result}_${SYS-aix}_${GCC}" = "no_aix_no" ; then # # AIX xlc # echo ${CC-cc} $CPPFLAGS -qusepcomp -qgenpcomp pchtest.c -o pchtest >&5 ${CC-cc} $CPPFLAGS -qusepcomp -qgenpcomp pchtest.c -o pchtest >&5 2>&5 if test -s pchtest ; then result="yes" wi_cv_cc_precomp_type="xlc" wi_CFLAGS_TO_ADD_LATER="$wi_CFLAGS_TO_ADD_LATER -qusepcomp -qgenpcomp" fi else # # IRIX, Compaq C, Sun C # cat < pchtest.c #include "pchtest.h" #pragma hdrstop #include int main(int argc, char **argv) { if (FOOBAR == 33) exit(0); exit(1); } EOF for pchflags in "-xpch=auto" "-pch -no_pch_messages" "-pch" "-LANG:pch" do rm -rf SunWS_cache pchtest.pch pchtest.cpch echo ${CC-cc} $CPPFLAGS $pchflags pchtest.c -o pchtest >&5 ${CC-cc} $CPPFLAGS $pchflags pchtest.c -o pchtest >&5 2>&5 if test -f pchtest.pch ; then result="yes" wi_cv_cc_precomp_type="ccc" wi_CFLAGS_TO_ADD_LATER="$wi_CFLAGS_TO_ADD_LATER $pchflags" AC_DEFINE(PRAGMA_HDRSTOP) break elif test -d SunWS_cache ; then result="yes" wi_cv_cc_precomp_type="SunWS" wi_CFLAGS_TO_ADD_LATER="$wi_CFLAGS_TO_ADD_LATER $pchflags -erroff=E_PCH_CONDITIONAL_PREFIX" AC_DEFINE(PRAGMA_HDRSTOP) break fi done unset pchflags fi rm -rf SunWS_cache pchtest.h pchtest.p pchtest.c pchtest.o pchtest csetc.pch pchtest.pch pchtest.cpch pchtest.h.gch fi wi_cv_cc_precomp="$result" ]) ]) dnl dnl dnl dnl AC_DEFUN(wi_ARG_ENABLE_SSP, [ AC_ARG_ENABLE(ssp,[ --enable-ssp use stack smashing protection if available],use_ssp="$enableval",use_ssp=no) ]) dnl dnl dnl dnl AC_DEFUN(wi_TEST_DASH_L, [ AC_CACHE_CHECK([if shell can test for symlinks], [wi_cv_shell_test_symlinks], [ wi_cv_shell_test_symlinks="no" wi_cv_test_L="false" wi_cv_test_not_L=":" rm -f config.lnk if test ! -f "config.lnk" ; then ln -s /bin/sh${ac_exeext} config.lnk if test -f "config.lnk" ; then ( if test -L config.lnk ; then rm -f config.lnk ; fi ) 2>/dev/null if test ! -f "config.lnk" ; then wi_cv_shell_test_symlinks="yes" wi_cv_test_L='test -L' wi_cv_test_not_L='test ! -L' else ( if test -h config.lnk ; then rm -f config.lnk ; fi ) 2>/dev/null if test ! -f "config.lnk" ; then wi_cv_shell_test_symlinks="yes" wi_cv_test_L='test -h' wi_cv_test_not_L='test ! -h' fi fi fi rm -f config.lnk fi ]) test_L="$wi_cv_test_L" test_not_L="$wi_cv_test_not_L" ]) dnl dnl dnl dnl AC_DEFUN(wi_EXTRA_IDIR, [ incdir="$1" echo "wi_extra_idir $incdir" 1>&5 if test -r "$incdir" ; then case "$CPPFLAGS" in *${incdir}*) echo " + already had $incdir" 1>&5 ;; *) if test "$CPPFLAGS" = "" ; then CPPFLAGS="-I$incdir" else CPPFLAGS="$CPPFLAGS -I$incdir" fi echo " + found $incdir" 1>&5 ;; esac fi ]) dnl dnl dnl dnl AC_DEFUN(wi_EXTRA_LDIR, [ libdir="$1" echo "wi_extra_ldir $libdir" 1>&5 if test -r "$libdir" ; then case "$LDFLAGS" in *${libdir}*) echo " + already had $libdir" 1>&5 ;; *) if test "$LDFLAGS" = "" ; then LDFLAGS="-L$libdir" else LDFLAGS="$LDFLAGS -L$libdir" fi echo " + found $libdir" 1>&5 ;; esac fi ]) dnl dnl dnl dnl AC_DEFUN(wi_GNU_LD, [ AC_MSG_CHECKING([for GNU ld]) wi_cv_prog_ld="ld" result="no" x=`ld --version 2>/dev/null | fgrep GNU` if test "$x" != "" ; then wi_cv_prog_ld="gld" result="yes" fi AC_MSG_RESULT($result) ]) dnl dnl dnl dnl AC_DEFUN(wi_LD_READONLY_TEXT, [ if test "$SYS$wi_cv_prog_ld" = "linuxgld" ; then LDFLAGS="$LDFLAGS -Xlinker -n" fi ]) dnl dnl dnl dnl AC_DEFUN(wi_FUNC_STRSIGNAL, [ case "$OS" in aix4.3*) # It didn't appear until several ML packs # into 4.3.3 # ;; *) AC_CHECK_FUNCS(strsignal) ;; esac ]) dnl dnl dnl dnl AC_DEFUN(wi_FUNC_GETCWD, [ if test "${SYS}" = sunos ; then # Use getwd on SunOS -- getcwd does a "popen("/bin/pwd")" -- aaaccck. # AC_CHECK_FUNCS(getwd) else AC_CHECK_FUNCS(getcwd getwd) fi if test "$ac_cv_func_getcwd" = no && test "$ac_cv_func_getwd" = no ; then AC_WARN(This system does not have either getwd or getcwd?) AC_WARN(I find that a little hard to believe.) AC_WARN(You may want to try -DHAVE_GETWD anyway.) AC_WARN([ This could also mean that your compiler isn't working]) AC_WARN(with this configure script. Check the ./config.log) AC_WARN(and look for anomalies.) fi ]) dnl dnl dnl dnl AC_DEFUN(wi_EXTRA_SYSV_SUNOS_DIRS, [ if test "${SYS-sunos}" = sunos ; then AC_MSG_CHECKING([for System V compatibility directories]) AC_MSG_RESULT([]) wi_EXTRA_IDIR("/usr/5include") wi_EXTRA_LDIR("/usr/5lib") fi ]) dnl dnl dnl If you want to also look for include and lib subdirectories in the dnl $HOME tree, you supply "yes" as the first argument to this macro. dnl dnl If you want to look for subdirectories in include/lib directories, dnl you pass the names in argument 3, otherwise pass a dash. dnl AC_DEFUN(wi_EXTRA_DIRS, [ AC_MSG_CHECKING([for extra include and lib directories]) AC_MSG_RESULT([]) ifelse([$1], yes, [dnl b1=`cd .. ; pwd` b2=`cd ../.. ; pwd` exdirs="$HOME $j $b1 $b2 $prefix $2" if test -x "$HOME/bin/OS" ; then b3=`$HOME/bin/OS` b3="$HOME/$b3" if test -d "$b3" ; then exdirs="$b3 $exdirs" fi fi ],[dnl exdirs="$prefix $2" ]) subexdirs="$3" if test "$subexdirs" = "" ; then subexdirs="-" fi for subexdir in $subexdirs ; do if test "$subexdir" = "-" ; then subexdir="" else subexdir="/$subexdir" fi for exdir in $exdirs ; do case "$exdir" in "/usr"|"/"|"//") if test "$exdir" = "//" ; then exdir="/" ; fi if test "$subexdir" != ""; then incdir="${exdir}/include${subexdir}" wi_EXTRA_IDIR($incdir) libdir="${exdir}/lib${subexdir}" wi_EXTRA_LDIR($libdir) fi ;; *) if test "$subexdir" = ""; then incdir="${exdir}/include${subexdir}" wi_EXTRA_IDIR($incdir) libdir="${exdir}/lib${subexdir}" wi_EXTRA_LDIR($libdir) fi ;; esac done done ]) dnl dnl dnl AC_DEFUN(wi_SSP_CFLAGS, [AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([wi_OS_VAR]) ac_cv_ssp_flags='-fstack-protector-all -D_FORTIFY_SOURCE=2' oldCFLAGS="$CFLAGS" changequote(<<, >>)dnl # remove existing ssp flags, if present CFLAGS=`echo "$CFLAGS" | sed 's/-D_FORTIFY_SOURCE//g'` CFLAGS=`echo "$CFLAGS" | sed 's/-D_FORTIFY_SOURCE=.//g'` CFLAGS=`echo "$CFLAGS" | sed 's/-fstack-prot[a-z\-]*//g'` # try these CFLAGS="$CFLAGS $ac_cv_ssp_flags" changequote([, ])dnl AC_TRY_LINK([ #include char testvar[64]; ],[ strncpy(testvar, "hello world", sizeof(testvar) - 1); ],[],[CFLAGS="$oldCFLAGS" ; ac_cv_ssp_flags="no"]) if test "$SYS" = macosx ; then if test "${use_macosx_universal}" != no ; then CFLAGS="$oldCFLAGS" ; ac_cv_ssp_flags="not compatible with Mac OS X universal" fi fi unset oldCFLAGS AC_MSG_CHECKING([if stack protection CFLAGS can be used]) AC_MSG_RESULT($ac_cv_ssp_flags) ]) dnl dnl dnl AC_DEFUN(wi_MACOSX_UNIVERSAL_CFLAGS, [AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([wi_OS_VAR]) if test "$SYS" = macosx ; then ac_cv_macosx_cflags=no ac_cv_macosx_ldflags=no AC_MSG_CHECKING([if MACOSX_DEPLOYMENT_TARGET environment variable is set]) AC_MSG_RESULT([${MACOSX_DEPLOYMENT_TARGET-no}]) changequote(<<, >>)dnl test_macosx_sdk_path=`/bin/ls -1d /Developer/SDKs/MacOSX10.*u.sdk 2>/dev/null | sed -n 1,1p` if test "${test_macosx_sdk_path}" = "" ; then test_macosx_sdk_path="no" fi case "$test_macosx_sdk_path" in */MacOSX10.4u.sdk) # # On Snow Leopard, you can't use gcc-4.2 to build the # universal binary, but you can use gcc-4.0 if that # is also installed. # case "$wi_cv_gcc_version" in [56789]*|4.[123456789]*) if [ -e "/usr/bin/gcc-4.0" ] ; then CC="/usr/bin/gcc-4.0" GCC="/usr/bin/gcc-4.0" wi_cv_gcc_version="4.0.1" else test_macosx_sdk_path="no" fi ;; esac ;; esac changequote([, ])dnl AC_MSG_CHECKING([if Mac OS X universal SDK is available]) AC_MSG_RESULT([${test_macosx_sdk_path-no}]) if test "${use_macosx_universal}" != no && test "${test_macosx_sdk_path}" != "no" ; then # Note SDK path, e.g., macosx_sdk_path="/Developer/SDKs/MacOSX10.4u.sdk" macosx_sdk_path="$test_macosx_sdk_path" macosx_sdk_ver=`echo "$macosx_sdk_path" | sed 's/^.*OSX1/1/;s/u.sdk.*$//;'` # E.g., "10.4" # Calculate corresponding ver_int, e.g., "10400" macosx_sdk_ver_int_maj=`echo "$macosx_sdk_ver" | cut -d. -f1` macosx_sdk_ver_int_min=`echo "$macosx_sdk_ver" | cut -d. -f2` macosx_sdk_ver_int_minmin=`echo "$macosx_sdk_ver" | cut -d. -f3` macosx_sdk_ver_int=`expr "$macosx_sdk_ver_int_maj" '*' 1000 + "$macosx_sdk_ver_int_min" '*' 100 + "${macosx_sdk_ver_int_minmin-0}"` os_base_int=`expr "$os_int" - '(' "$os_int" '%' 10 ')'` # Add OS X minimum version, if SDK is older than version of OS X on the build machine. if test "$os_base_int" -gt "$macosx_sdk_ver_int" && test "x$MACOSX_DEPLOYMENT_TARGET" = "x" ; then # Thanks, Toshi NAGATA macosx_sdk_path="${macosx_sdk_path} -mmacosx-version-min=${macosx_sdk_ver}" fi # macosx_arch_flags="-arch x86_64 -arch i386 -arch ppc" # This works too macosx_arch_flags="-arch i386 -arch ppc" case "$CFLAGS" in *"-isysroot"*"-arch"*|*"-arch"*"-isysroot"*) # User already had both SDK path and desired architecture(s) in CFLAGS ;; *"-arch"*) ac_cv_macosx_cflags="-isysroot ${macosx_sdk_path}" CFLAGS="${ac_cv_macosx_cflags} ${CFLAGS}" ;; *"-isysroot"*) ac_cv_macosx_cflags="${macosx_arch_flags}" CFLAGS="${ac_cv_macosx_cflags} ${CFLAGS}" ;; *) ac_cv_macosx_cflags="-isysroot ${macosx_sdk_path} ${macosx_arch_flags}" CFLAGS="${ac_cv_macosx_cflags} ${CFLAGS}" ;; esac # # Apparently, only libtool (glibtool) needs this -syslibroot flag. # # case "$LDFLAGS" in # *"-syslibroot"*) # # User already had SDK path in LDFLAGS # ;; # *) # ac_cv_macosx_ldflags="-syslibroot ${macosx_sdk_path}" # LDFLAGS="${ac_cv_macosx_ldflags} ${LDFLAGS}" # ;; # esac fi AC_MSG_CHECKING([if we should add CFLAGS for Mac OS X]) AC_MSG_RESULT($ac_cv_macosx_cflags) dnl AC_MSG_CHECKING(if additional Mac OS X linker flags are needed) dnl AC_MSG_RESULT($ac_cv_macosx_ldflags) fi ]) dnl dnl dnl AC_DEFUN(wi_HPUX_CFLAGS, [AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([wi_OS_VAR]) ac_cv_hpux_flags=no if test "$os" = hp-ux ; then if test "$GCC" = yes ; then if test "$CFLAGS" != "" ; then # Shouldn't be in there. changequote(<<, >>)dnl CFLAGS=`echo "$CFLAGS" | sed 's/-A[ae]//g'` changequote([, ])dnl case "$CFLAGS" in *_HPUX_SOURCE*) ;; *) # This is required for the extended # namespace. # CFLAGS="-D_HPUX_SOURCE $CFLAGS" ;; esac fi else # If you're not using gcc, then you better have a cc/c89 # that is usable. If you have the barebones compiler, it # won't work. The good compiler uses -Aa for the ANSI # compatible stuff. changequote(<<, >>)dnl x=`echo "$CFLAGS" | grep 'A[ae]' 2>/dev/null` changequote([, ])dnl if test "$x" = "" ; then CFLAGS="$CFLAGS -Ae" fi fi ac_cv_hpux_flags=yes AC_MSG_CHECKING(if HP-UX ansi C compiler flags are needed) AC_MSG_RESULT($ac_cv_hpux_flags) fi ]) dnl dnl dnl AC_DEFUN(wi_OS_DEFAULT_CFLAGS, [ AC_MSG_CHECKING(if we should customize your CFLAGS environment variable) wi_replace_O_with_g="no" case "$wi_orig_CFLAGS" in "") wi_replace_O_with_g="no" ;; "-g -O2") wi_replace_O_with_g="no" ;; "-g -O") wi_replace_O_with_g="no" ;; "-O2 -g") wi_replace_O_with_g="no" ;; "-O -g") wi_replace_O_with_g="no" ;; -g) wi_replace_O_with_g="yes" ;; esac # # See if your CFLAGS environment variable wasn't set or exported, # or if you are using a conservative default. If so, we will # add some additional flags for better performance, warning reporting, # etc. # # Note we are now checking the current value of CFLAGS, which may have # been changed by configure. # wi_os_default_cflags="no" case "$CFLAGS" in "") wi_os_default_cflags="yes" ;; "-g -O2") wi_os_default_cflags="yes" ;; "-g -O") wi_os_default_cflags="yes" ;; "-O2 -g") wi_os_default_cflags="yes" ;; "-O -g") wi_os_default_cflags="yes" ;; -g) wi_os_default_cflags="yes" ;; -O) wi_os_default_cflags="yes" ;; -O2) wi_os_default_cflags="yes" ;; esac CC_is_clang="no" case "$CC" in *clang*) CC_is_clang="yes" ;; *) cc_dash_v=`${CC-gcc} -v 2>&1 | grep clang 2>/dev/null` if test -n "$cc_dash_v" ; then CC_is_clang="yes" fi ;; esac if test "$wi_os_default_cflags" = yes ; then if test "$CC_is_clang" = yes ; then wi_os_default_cflags="-Weverything -Wno-unknown-warning-option -Wno-disabled-macro-expansion -Wno-missing-variable-declarations -Wno-date-time" if test "$wi_replace_O_with_g" = yes ; then wi_os_default_cflags="-g $wi_os_default_cflags" else wi_os_default_cflags="-O2 $wi_os_default_cflags" fi elif test "$GCC" = yes ; then # # gcc # wi_gcc_optimizer_flags='' case "$wi_cv_gcc_version" in 2.7.*|2.8.*|2.9*) wi_os_default_cflags="-W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wbad-function-cast -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wmissing-declarations -Winline" ;; [345].*) wi_os_default_cflags="-W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wbad-function-cast -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wmissing-declarations -Winline -Wmissing-format-attribute -Wformat-security" wi_gcc_optimizer_flags='-Wdisabled-optimization' ;; *) wi_os_default_cflags="-W -Wall" ;; esac if test "$wi_replace_O_with_g" = yes ; then wi_os_default_cflags="-g $wi_os_default_cflags" else wi_os_default_cflags="-O2 $wi_os_default_cflags" if test "$wi_gcc_optimizer_flags" != "" ; then wi_os_default_cflags="$wi_os_default_cflags $wi_gcc_optimizer_flags" fi fi case "$OS" in hpux*) wi_os_default_cflags="-D_HPUX_SOURCE $wi_os_default_cflags" ;; bsdos*) wi_os_default_cflags=`echo "$wi_os_default_cflags" | sed 's/\ -Wcast-qual//g'` # avoid va_start() problem wi_os_default_cflags=`echo "$wi_os_default_cflags" | sed 's/\ -Wredundant-decls//g'` ;; openbsd*|unixware*|openunix*) wi_os_default_cflags=`echo "$wi_os_default_cflags" | sed 's/\ -Wredundant-decls//g'` ;; esac else # # regular cc # case "${wi_replace_O_with_g}_${OS}" in no_aix*) wi_os_default_cflags="-O -qinfo=cmp:cnd:dcl:eff:gen:ini:par:pro:rea:use -qlonglong -qro -qroconst -qlanglvl=extended -qsrcmsg -qmaxmem=20480 -qsuppress=1506-469:1506-409" ;; yes_aix*) wi_os_default_cflags="-g -qinfo=cmp:cnd:dcl:eff:gen:ini:par:pro:rea:use -qlonglong -qro -qroconst -qlanglvl=extended -qsrcmsg -qmaxmem=20480 -qsuppress=1506-469:1506-409" ;; no_irix[2345]*|no_irix6.[01234]*) wi_os_default_cflags="-O2 -xansi -fullwarn -use_readonly_const -G0 -rdata_shared" ;; yes_irix[2345]*|yes_irix6.[01234]*) wi_os_default_cflags="-g -xansi -fullwarn -use_readonly_const -G0 -rdata_shared" ;; no_irix*) wi_os_default_cflags="-O2 -IPA -xansi -fullwarn -use_readonly_const -G0 -rdata_shared -woff 1174" ;; yes_irix*) wi_os_default_cflags="-g -xansi -fullwarn -use_readonly_const -G0 -rdata_shared -woff 1174" ;; no_digitalunix*) wi_os_default_cflags="-O4 -std1 -portable -readonly_strings" ;; yes_digitalunix*) wi_os_default_cflags="-g -std1 -portable -readonly_strings" ;; no_hpux*) wi_os_default_cflags="-Ae +O2 +Ovolatile +Olibcalls +ESlit +w1 +DAportable" ;; yes_hpux*) wi_os_default_cflags="-Ae -g +w1 +DAportable" ;; no_solaris*86|no_solaris*intel) # Not really any significant differences # from the sparc flags, but reserved for # future use. # if test "$wi_cv_sunwspro_cc_version2" -ge 530 ; then wi_os_default_cflags="-xipo -xO4 -xc99 -xbuiltin -xstrconst -dalign -Qn -errtags=yes -erroff=E_END_OF_LOOP_CODE_NOT_REACHED -mc" else wi_os_default_cflags="-xO4 -xstrconst -dalign -Qn" fi ;; yes_solaris*86|yes_solaris*intel) if test "$wi_cv_sunwspro_cc_version2" -ge 530 ; then wi_os_default_cflags="-g -xc99 -xstrconst -dalign -Qn -errtags=yes -erroff=E_END_OF_LOOP_CODE_NOT_REACHED" else wi_os_default_cflags="-g -xstrconst -dalign -Qn" fi ;; no_solaris*) if test "$wi_cv_sunwspro_cc_version2" -ge 530 ; then wi_os_default_cflags="-xipo -xO5 -xc99 -xbuiltin -xstrconst -dalign -Qn -errtags=yes -erroff=E_END_OF_LOOP_CODE_NOT_REACHED -mc" else wi_os_default_cflags="-xO4 -xstrconst -dalign -Qn" fi ;; yes_solaris*) if test "$wi_cv_sunwspro_cc_version2" -ge 530 ; then wi_os_default_cflags="-g -xc99 -xstrconst -dalign -Qn -errtags=yes -erroff=E_END_OF_LOOP_CODE_NOT_REACHED" else wi_os_default_cflags="-g -xstrconst -dalign -Qn" fi ;; no_tru64*) wi_os_default_cflags="-O4 -tune host -std1 -readonly_strings -portable -warnprotos -msg_enable level6 -msg_disable longlongtype,hexoctunsign,unusedincl,unnecincl,nestincl,unusedtop,unknownmacro,ignorecallval,strctpadding,truncintasn,truncintcast,trunclongcast,ansialiascast,conststocls,unrefsdecl,subscrbounds2,intconcastsgn,longlongsufx,unreachcode,valuepres,embedcomment" ;; yes_tru64*) wi_os_default_cflags="-g -std1 -readonly_strings -portable -warnprotos -msg_enable level6 -msg_disable longlongtype,hexoctunsign,unusedincl,unnecincl,nestincl,unusedtop,unknownmacro,ignorecallval,strctpadding,truncintasn,truncintcast,trunclongcast,ansialiascast,conststocls,unrefsdecl,subscrbounds2,intconcastsgn,longlongsufx,unreachcode,valuepres,embedcomment" ;; no_unixware*|no_openunix*) wi_os_default_cflags='-O -K inline -K host -Q n' ;; yes_unixware*|yes_openunix*) wi_os_default_cflags='-g -K host -Q n' ;; *) wi_os_default_cflags="no" ;; esac fi fi if test "$wi_os_default_cflags" != "no" ; then CFLAGS="$wi_os_default_cflags" fi AC_MSG_RESULT($wi_os_default_cflags) ]) dnl dnl dnl AC_DEFUN(wi_SFLAG, [AC_REQUIRE([AC_PROG_CC]) AC_MSG_CHECKING([for strip]) changequote({{, }})dnl STRIP="strip" if [ "x$cross_compiling" = "xyes" ] ; then machine=`${CC-gcc} -dumpmachine 2>/dev/null` case "$CC" in *${machine}*) f=`echo "$CC" | sed 's|/[^/]*$||'` if [ -x "$f/${machine}-strip" ] ; then STRIP="$f/${machine}-strip" elif [ -x "$f/strip" ] ; then STRIP="$f/strip" fi ;; esac unset machine f fi changequote([, ])dnl AC_MSG_RESULT([$STRIP]) AC_SUBST(STRIP) if test "$SFLAG" = "" ; then SFLAG="-s" case "$OS" in macosx*) SFLAG='-Wl,-x' ;; esac fi # # Was it ./configure --enable-debug ? # if test "$DEBUGBUILD" = yes ; then # It was directly indicated by the user with --enable-debug. SFLAG="" if test "x$STRIP" = "x" ; then STRIP=":" else STRIP=": #${STRIP}" fi else # Not directly indicated, but maybe their CFLAGS hint at a debug build. case "$CFLAGS" in "-g"|"-g "*|*" -g"|*" -g "*|*"-g"[0-9]*) # SFLAG="# $SFLAG" SFLAG="" if test "x$STRIP" = "x" ; then STRIP=":" else STRIP=": #${STRIP}" fi ;; esac fi STRIPFLAG="$SFLAG" ]) dnl dnl dnl AC_DEFUN(wi_PROG_SUN_WORKSHOP_CC_VERSION, [ AC_REQUIRE([AC_PROG_CC]) if test "${SYS}_${GCC}" != solaris_no ; then wi_cv_cc_is_sunwspro_cc="no" wi_cv_sunwspro_cc_version="0" wi_cv_sunwspro_cc_version2="0" else AC_CACHE_CHECK([if the C compiler is Sun WorkShop C],[wi_cv_cc_is_sunwspro_cc], [ changequote(<<, >>)dnl # # cc: Sun WorkShop 6 update 2 C 5.3 2001/05/15 # usage: cc [ options] files. Use 'cc -flags' for details # # cc: WorkShop Compilers 4.2 30 Oct 1996 C 4.2 # usage: cc [ options] files. Use 'cc -flags' for details # wi_cv_sunwspro_cc_version=`$CC -V 2>&1 | sed -n '/WorkShop.*C\ [1-9]/{s/^.*C/C/;s/^C\ \([^\ ]*\).*/\1/;p;q;}'` case "$wi_cv_sunwspro_cc_version" in [1-9]*) wi_cv_cc_is_sunwspro_cc="yes" ver1=`echo "$wi_cv_sunwspro_cc_version" | cut -d. -f1` ver2=`echo "$wi_cv_sunwspro_cc_version" | cut -d. -f2` ver3=0 wi_cv_sunwspro_cc_version2=`expr "$ver1" '*' 100 + "$ver2" "*" 10 + "$ver3"` unset ver1 ver2 ver3 ;; *) wi_cv_cc_is_sunwspro_cc="no" wi_cv_sunwspro_cc_version="0" wi_cv_sunwspro_cc_version2="0" ;; esac changequote([, ])dnl ]) if test "$wi_cv_cc_is_sunwspro_cc" = yes ; then AC_MSG_CHECKING([output of "cc -V" to determine version of Sun WorkShop C]) AC_MSG_RESULT("version $wi_cv_sunwspro_cc_version") fi fi ]) dnl dnl dnl AC_DEFUN(wi_PROG_GCC_VERSION, [ AC_REQUIRE([AC_PROG_CC]) if test "$GCC" = yes ; then AC_CACHE_CHECK([the version of GCC],[wi_cv_gcc_version], [ changequote(<<, >>)dnl wi_cv_gcc_version=`$CC -v 2>&1 | sed -n '/gcc version/{s/^.*gcc version//;s/^[^1-9]*//;s/\ .*//;p;q;}'` changequote([, ])dnl ]) else wi_cv_gcc_version="0" fi ]) dnl dnl dnl dnl AC_DEFUN(wi_C99, [ AC_MSG_CHECKING([for C99 standard]) result=no saved_CFLAGS="$CFLAGS" for tries in 1 2 do if test "$GCC$tries" = yes2 ; then CFLAGS="-std=gnu99 $CFLAGS" fi AC_TRY_COMPILE([ #include #include #include #include #include /* C99 header */ #include /* C99 header */ _Bool isAfter2007 = false; inline long long int multfunc(long long int x, long long int a, long long int b); long long int testfunc(long long int x, long long int *restrict a, long long int *restrict b); inline long long int multfunc(long long int x, long long int a, long long int b) { return (x * a * b); } /* multfunc */ long long int testfunc(long long int x, long long int *restrict a, long long int *restrict b) { return (multfunc(x, *a, *b)); } /* testfunc */ ],[ // C99 specifies that C++ style comments are supported long long int a = 10LL, b = 100LL; long long int lli = testfunc(9999999999LL, &a, &b); for (long long int x = 0; x < 10; x++) { printf("%lld\n", lli + x); x += 2; time_t t; /* C99 declaration in the middle of the block */ time(&t); if (t > 1167711335) isAfter2007 = true; } ],[ # Yes: C99 result=yes ],[ # No: C99 result=no ]) if test "$result" = yes ; then break ; fi done if test "$result" = no ; then CFLAGS="$saved_CFLAGS" ; fi AC_MSG_RESULT([$result]) unset result saved_CFLAGS tries ]) dnl dnl dnl AC_DEFUN(wi_REQUEST_NO_Y2K_WARNINGS, [ wi_request_no_y2k_warnings=yes ]) dnl dnl dnl AC_DEFUN(wi_CFLAGS_NO_Y2K_WARNINGS, [ AC_REQUIRE([AC_PROG_CC]) if test "x$wi_request_no_y2k_warnings" = xyes ; then case "${wi_cv_gcc_version-0}" in changequote(<<, >>)dnl 0|1.*|2.[012345678].*) changequote([, ])dnl ;; *) case "$CFLAGS" in *-Wno-format-y2k*) ;; *) oldCFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wno-format-y2k" # # Now check if this version of GCC # accepts this flag... # AC_TRY_COMPILE([],[int junk;],[],[CFLAGS="$oldCFLAGS"]) unset oldCFLAGS ;; esac ;; esac fi ]) dnl dnl dnl AC_DEFUN(wi_USE_STATIC_LIBGCC, [ if test "x$ac_cv_prog_gcc" = "xyes" ; then case "$CFLAGS" in *-static-libgcc*) ;; *) oldCFLAGS="$CFLAGS" CFLAGS="$CFLAGS -static-libgcc" # # Now check if this version of GCC # accepts this flag... # AC_TRY_LINK([ #include char testvar[64]; ],[strncpy(testvar, "hello world", sizeof(testvar) - 1);],[],[CFLAGS="$oldCFLAGS"]) unset oldCFLAGS ;; esac fi ]) dnl dnl dnl AC_DEFUN(wi_PROG_LDD, [ AC_CACHE_CHECK([for ldd], [wi_cv_prog_ldd], [ wi_cv_prog_ldd="no" changequote({{, }})dnl cat > conftest.c < #include int main(int argc, char **argv) { (void) printf("%s\n", ((argc > 66) ? argv[0] : "Hello World")); exit(0); } EOF ${CC-cc} $CFLAGS $CPPFLAGS conftest.c -o conftest 1>&5 wi_cv_prog_ldd=`ldd ./conftest 2>&1 | sed -n -e '/lib/{s/.*/yes/g;p;q;}' -e '${s/.*/no/g;p;q;}'` /bin/rm -rf conftest* changequote([, ])dnl ]) ]) dnl dnl dnl AC_DEFUN(wi_STATIC_LIBGCC, [AC_REQUIRE([wi_PROG_LDD]) AC_CACHE_CHECK([if compiled programs use a shared library version of libgcc], [wi_cv_shared_libgcc], [ changequote({{, }})dnl if test "$wi_cv_prog_ldd" = no ; then wi_cv_shared_libgcc="unknown (ldd is not available to check)" else cat > conftest.c < #include int main(int argc, char **argv) { (void) printf("%s\n", ((argc > 66) ? argv[0] : "Hello World")); exit(0); } EOF ${CC-cc} $CFLAGS $CPPFLAGS conftest.c -o conftest 1>&5 wi_cv_shared_libgcc=`ldd ./conftest 2>&1 | sed -n -e '/libgcc/{s/.*/yes/g;p;q;}' -e '${s/.*/no/g;p;q;}'` /bin/rm -rf conftest* fi changequote([, ])dnl ]) if test "$wi_cv_shared_libgcc" != no ; then wi_USE_STATIC_LIBGCC fi ]) dnl dnl dnl AC_DEFUN(wi_CROSS_COMPILER_CFLAGS, [ if test "x$cross_compiling" = "xyes" ; then wi_USE_STATIC_LIBGCC fi ]) dnl dnl dnl AC_DEFUN(wi_OS_SPECIFIC_CFLAGS, [ case "$OS" in "solaris"*"-x86_64") if test "$GCC" = "yes" ; then case "$CFLAGS" in *"-m64"*) ;; *) CFLAGS="-m64 $CFLAGS" ;; esac fi ;; esac ]) dnl dnl dnl AC_DEFUN(wi_PROG_CC, [ if test "x$had_CC" = "x" ; then AC_MSG_CHECKING([for CC environment variable]) AC_MSG_RESULT(["${CC-no}"]) fi AC_MSG_CHECKING([for clang C compiler]) CLANG_CC=`which "clang" 2>/dev/null` old_CC="$CC" CC="$CLANG_CC" AC_TRY_COMPILE([#include ],[extern void exit(int status);],[ AC_MSG_RESULT(["$CLANG_CC"]) ],[ AC_MSG_RESULT(["no"]) unset CLANG_CC ]) CC="$old_CC"; unset old_CC AC_MSG_CHECKING([if CC should now be set]) if test "x$CC" = "x" ; then if test "x$CLANG_CC" != "x" ; then CC="$CLANG_CC" export CC AC_MSG_RESULT(["$CC"]) else AC_MSG_RESULT([no]) fi else AC_MSG_RESULT([no]) fi AC_PROG_CC ]) dnl dnl dnl AC_DEFUN(wi_CFLAGS, [AC_REQUIRE([AC_PROG_CC]) wi_PROG_GCC_VERSION AC_REQUIRE_CPP() wi_PROG_SUN_WORKSHOP_CC_VERSION wi_OS_DEFAULT_CFLAGS wi_OS_SPECIFIC_CFLAGS wi_CFLAGS_NO_Y2K_WARNINGS wi_PROG_LDD if test "$use_ssp" = yes ;then wi_SSP_CFLAGS dnl wi_STATIC_LIBGCC may not be compatible with this fi wi_STATIC_LIBGCC wi_CROSS_COMPILER_CFLAGS changequote(<<, >>)dnl add_O0="no" if [ "$NOOPTCFLAGS" = "" ] ; then NOOPTCFLAGS=`echo "$CFLAGS" | sed 's/[-+]O[0-9A-Za-z]*//g;s/-xO[0-9]//g;s/-Wc,-O3//g;s/-IPA//g;s/-xipo=?[0-9]?//g;s/\ \ */ /g;s/^\ *//;s/\ *$//;'` if [ "$GCC" = "yes" ] ; then add_O0="yes" else case "$CC" in ccc|*/ccc) # Compaq CC add_O0="yes" ;; esac fi fi if [ "$DEBUGCFLAGS" = "" ] ; then DEBUGCFLAGS="-g $NOOPTCFLAGS" fi if [ "$add_O0" = yes ] ; then NOOPTCFLAGS="-O0 $NOOPTCFLAGS" fi changequote([, ])dnl # # Was it ./configure --enable-debug ? # AC_MSG_CHECKING([if this is a debug build]) if test "$DEBUGBUILD" = yes ; then AC_MSG_RESULT(yes) CFLAGS="$DEBUGCFLAGS" else AC_MSG_RESULT(no) fi dnl AC_MSG_CHECKING([NOOPTCFLAGS]) dnl AC_MSG_RESULT($NOOPTCFLAGS) dnl AC_MSG_CHECKING([DEBUGCFLAGS]) dnl AC_MSG_RESULT($DEBUGCFLAGS) dnl AC_MSG_CHECKING([CFLAGS]) dnl AC_MSG_RESULT($CFLAGS) ]) dnl dnl dnl AC_DEFUN(wi_HPUX_GCC___STDC_EXT__, [ CFLAGS=`echo "$CFLAGS" | sed s/-D__STDC_EXT__//g` AC_MSG_CHECKING([if -D__STDC_EXT__ is needed with GCC on HP-UX]) AC_TRY_RUN([ #include main() { #ifdef __STDC_EXT__ if (__STDC_EXT__ == 0) exit(1); /* have __STDC_EXT__=0 */ exit(0); /* have __STDC_EXT__=1 */ #else exit(1); /* do not have __STDC_EXT__ */ #endif }],[ # action if true # # Already have it defined. # AC_MSG_RESULT(no) ],[ # action if false # # Not defined -- we need to define it then. # This is required for the extended # namespace symbols for Large Files. # CFLAGS="-D__STDC_EXT__ $CFLAGS" AC_MSG_RESULT(yes) ],[ # action if cross-compiling, guess CFLAGS="-D__STDC_EXT__ $CFLAGS" AC_MSG_RESULT([(guessing) yes]) ]) ]) dnl dnl dnl AC_DEFUN(wi_ENV_VAR_MESSAGES, [ AC_MSG_CHECKING([if you set and exported the environment variable CC]) if test "x$CC" = x ; then AC_MSG_RESULT([no (configure will try to locate a suitable C compiler)]) had_CC="no" else AC_MSG_RESULT($CC) had_CC="yes" fi AC_MSG_CHECKING([for environment variable CFLAGS]) if test "x$CFLAGS" = x ; then AC_MSG_RESULT([no (we will choose a default set for you)]) else AC_MSG_RESULT($CFLAGS) fi AC_MSG_CHECKING([for environment variable CPPFLAGS]) AC_MSG_RESULT(${CPPFLAGS-no}) AC_MSG_CHECKING([for environment variable LDFLAGS]) AC_MSG_RESULT(${LDFLAGS-no}) AC_MSG_CHECKING([for environment variable LIBS]) AC_MSG_RESULT(${LIBS-no}) ]) dnl dnl dnl dnl AC_DEFUN(wi_DEFINE_SIZEOF_OFF_T, [ if test "x$ac_cv_sizeof_stat_st_size" != x ; then AC_DEFINE_UNQUOTED(SIZEOF_ST_SIZE, $ac_cv_sizeof_stat_st_size) fi if test "x$ac_cv_sizeof_off_t" != x ; then AC_DEFINE_UNQUOTED(SIZEOF_OFF_T, $ac_cv_sizeof_off_t) fi ]) dnl dnl dnl dnl Macro: _LARGEFILE_SOURCE If this macro is defined some extra functions dnl are available which rectify a few shortcomings in all previous dnl standards. Specifically, the functions fseeko and ftello are available. dnl Without these functions the difference between the ISO C interface dnl (fseek, ftell) and the low-level POSIX interface (lseek) would lead to dnl problems. dnl dnl This macro was introduced as part of the Large File Support extension dnl (LFS). dnl dnl Macro: _LARGEFILE64_SOURCE If you define this macro an additional set of dnl functions is made available which enables 32 bit systems to use files of dnl sizes beyond the usual limit of 2GB. This interface is not available if dnl the system does not support files that large. On systems where the dnl natural file size limit is greater than 2GB (i.e., on 64 bit systems) dnl the new functions are identical to the replaced functions. dnl dnl The new functionality is made available by a new set of types and dnl functions which replace the existing ones. The names of these new dnl objects contain 64 to indicate the intention, e.g., off_t vs. off64_t dnl and fseeko vs. fseeko64. dnl dnl This macro was introduced as part of the Large File Support extension dnl (LFS). It is a transition interface for the period when 64 bit offsets dnl are not generally used (see _FILE_OFFSET_BITS). dnl dnl Macro: _FILE_OFFSET_BITS This macro determines which file system dnl interface shall be used, one replacing the other. Whereas dnl _LARGEFILE64_SOURCE makes the 64 bit interface available as an dnl additional interface, _FILE_OFFSET_BITS allows the 64 bit interface to dnl replace the old interface. dnl dnl If _FILE_OFFSET_BITS is undefined, or if it is defined to the value 32, dnl nothing changes. The 32 bit interface is used and types like off_t have dnl a size of 32 bits on 32 bit systems. dnl dnl If the macro is defined to the value 64, the large file interface dnl replaces the old interface. I.e., the functions are not made available dnl under different names (as they are with _LARGEFILE64_SOURCE). Instead dnl the old function names now reference the new functions, e.g., a call to dnl fseeko now indeed calls fseeko64. dnl dnl This macro should only be selected if the system provides mechanisms for dnl handling large files. On 64 bit systems this macro has no effect since dnl the *64 functions are identical to the normal functions. dnl dnl This macro was introduced as part of the Large File Support extension. dnl dnl dnl AC_DEFUN(wi_CFLAGS_LFS, [AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([wi_OS_VAR]) wi_CFLAGS wi_cv_lfs="no" result="no" if test "os_${os}_gcc_${GCC}" = os_hp-ux_gcc_yes ; then wi_HPUX_GCC___STDC_EXT__ fi AC_CHECK_HEADERS([unistd.h]) if test "x$ac_cv_sizeof_stat_st_size" = x ; then wi_SIZEOF_ST_SIZE fi if test "x$ac_cv_sizeof_off_t" = x ; then wi_SIZEOF_OFF_T fi if test "x$ac_cv_sizeof_size_t" = x ; then wi_SIZEOF_SIZE_T fi orig_CFLAGS="$CFLAGS" if test "$ac_cv_sizeof_stat_st_size" -le 4 || test "$ac_cv_sizeof_off_t" -le 4 ; then unset ac_cv_sizeof_stat_st_size ac_cv_sizeof_off_t CFLAGS=`echo "$CFLAGS" | sed 's/-D_LARGEFILE64_SOURCE//g'` case "$CFLAGS" in *-D_LARGEFILE_SOURCE*) result="already included -D_LARGEFILE_SOURCE" ;; *) CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $CFLAGS" DEBUGCFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $DEBUGCFLAGS" NOOPTCFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $NOOPTCFLAGS" result="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" ;; esac wi_cv_lfs="yes" fi if test "x$ac_cv_sizeof_off_t" = x ; then # Recheck, to see if the defines took effect. wi_SIZEOF_ST_SIZE wi_SIZEOF_OFF_T wi_SIZEOF_SIZE_T if test "$ac_cv_sizeof_stat_st_size" -le 4 || test "$ac_cv_sizeof_off_t" -le 4 ; then CFLAGS="$orig_CFLAGS" unset orig_CFLAGS wi_cv_lfs64="yes" CFLAGS="-D_LARGEFILE64_SOURCE $CFLAGS" DEBUGCFLAGS="-D_LARGEFILE64_SOURCE $DEBUGCFLAGS" NOOPTCFLAGS="-D_LARGEFILE64_SOURCE $NOOPTCFLAGS" result="-D_LARGEFILE64_SOURCE" # Re-re-check, to see if the defines took effect. unset ac_cv_sizeof_stat_st_size ac_cv_sizeof_off_t wi_SIZEOF_STAT64_ST_SIZE wi_SIZEOF_OFF64_T wi_SIZEOF_ST_SIZE wi_SIZEOF_OFF_T fi fi AC_MSG_CHECKING([if we should add CFLAGS for Large File Support]) AC_MSG_RESULT($result) unset orig_CFLAGS wi_DEFINE_SIZEOF_OFF_T ]) dnl dnl dnl AC_DEFUN(wi_CFLAGS_LFS64, [AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([wi_OS_VAR]) wi_CFLAGS result="no" wi_cv_lfs64="no" if test "os_${os}_gcc_${GCC}" = os_hp-ux_gcc_yes ; then wi_HPUX_GCC___STDC_EXT__ fi AC_CHECK_HEADERS([unistd.h]) if test "x$ac_cv_sizeof_stat_st_size" = x ; then wi_SIZEOF_ST_SIZE fi if test "x$ac_cv_sizeof_off_t" = x ; then wi_SIZEOF_OFF_T fi if test "$ac_cv_sizeof_stat_st_size" -le 4 || test "$ac_cv_sizeof_off_t" -le 4 ; then unset ac_cv_sizeof_stat_st_size ac_cv_sizeof_off_t case "$CFLAGS" in *-D_LARGEFILE64_SOURCE*) result="already included -D_LARGEFILE64_SOURCE" ;; *) CFLAGS="-D_LARGEFILE64_SOURCE $CFLAGS" DEBUGCFLAGS="-D_LARGEFILE64_SOURCE $DEBUGCFLAGS" NOOPTCFLAGS="-D_LARGEFILE64_SOURCE $NOOPTCFLAGS" result="-D_LARGEFILE64_SOURCE" ;; esac wi_cv_lfs64="yes" wi_SIZEOF_STAT64_ST_SIZE wi_SIZEOF_OFF64_T wi_SIZEOF_ST_SIZE wi_SIZEOF_OFF_T fi wi_DEFINE_SIZEOF_OFF_T AC_MSG_CHECKING([if we should add CFLAGS for LFS64 support]) AC_MSG_RESULT($result) ]) dnl dnl dnl AC_DEFUN(wi_CFLAGS_LFS_OR_LFS64, [ changequote(<<, >>)dnl wi_cv_lfs_type="lfs" if test "$SYS" = "linux" ; then case "$libc" in libc5) wi_cv_lfs_type="lfs64" ;; glibc2.[012]*) wi_cv_lfs_type="lfs64" ;; esac fi case "$OS" in bsdos*) wi_cv_lfs_type="lfs64" ;; freebsd[234]*) wi_cv_lfs_type="lfs64" ;; hpux9.*|hpux10.*) wi_cv_lfs_type="lfs64" ;; solaris2.*|solaris7*) wi_cv_lfs_type="lfs64" ;; esac changequote([, ])dnl if test "$wi_cv_lfs_type" = "lfs64" ; then wi_CFLAGS_LFS64 else wi_CFLAGS_LFS fi ]) dnl dnl dnl AC_DEFUN(wi_CFLAGS_REENTRANT, [AC_REQUIRE([AC_PROG_CC]) result="no" case "$CFLAGS" in *-D_REENTRANT*) result="already included" ;; *) CFLAGS="-D_REENTRANT $CFLAGS" result="-D_REENTRANT" ;; esac AC_MSG_CHECKING([if we should add CFLAGS for reentrancy]) AC_MSG_RESULT($result) ]) dnl dnl dnl AC_DEFUN(wi_PROTOTYPES, [ AC_MSG_CHECKING(if the compiler supports function prototypes) AC_TRY_COMPILE(,[extern void exit(int status);],[wi_cv_prototypes=yes AC_DEFINE(PROTOTYPES)],wi_cv_prototypes=no) AC_MSG_RESULT($wi_cv_prototypes) ]) dnl dnl dnl AC_DEFUN(wi_STRUCT_TIMEVAL_FIELD_TYPES, [ wi_struct_timeval_field_checks="cached" wi_CACHE_CHECK_GUESS_MESSAGE([what type the tv_sec field of struct timeval is],[wi_cv_struct_timeval_tv_sec], [ wi_struct_timeval_field_checks="uncached" wi_PREREQ_UNISTD_H([$0]) AC_TRY_RUN([ /* program */ #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) # define _ALL_SOURCE 1 #endif #ifdef HAVE_UNISTD_H # include #endif #include #include #include #include #include static void neg(void *dst0, size_t siz) { unsigned char *dst = (unsigned char *) dst0; unsigned char *dlim; dlim = dst + siz; while (dst < dlim) *dst++ = (unsigned char) 0xEE; } int main(int argc, char **argv) { FILE *fp; const char *typ; struct timeval tv; #define x tv.tv_sec memset(&tv, 0, sizeof(tv)); fp = stdout; if (argc == 1) { fp = fopen("conftest.out", "w"); if (fp == NULL) { perror("could not write to ./conftest.out"); exit(1); } } neg(&x, sizeof(x)); #ifdef HAVE_LONG_LONG if (sizeof(x) == sizeof(long long)) { typ = "long long"; } else #endif if (sizeof(x) == sizeof(long)) { typ = "long"; } else { typ = "int"; } (void) fprintf(fp, "%s%s\n", (x > 0) ? "unsigned " : "", typ); #undef x #define x tv.tv_usec neg(&x, sizeof(x)); #ifdef HAVE_LONG_LONG if (sizeof(x) == sizeof(long long)) { typ = "long long"; } else #endif if (sizeof(x) == sizeof(long)) { typ = "long"; } else { typ = "int"; } (void) fprintf(fp, "%s%s\n", (x > 0) ? "unsigned " : "", typ); #undef x if (fp != stdout) (void) fclose(fp); exit(0); } ],[ # action if true guess="" if test -f conftest.out ; then wi_cv_struct_timeval_tv_sec="`sed -n '1,1p' conftest.out`" wi_cv_struct_timeval_tv_usec="`sed -n '2,2p' conftest.out`" fi ],[ # action if false guess="" wi_cv_struct_timeval_tv_sec="long" wi_cv_struct_timeval_tv_usec="long" ],[ # action if cross compiling guess="(guessing) " guess2="$guess" wi_cv_struct_timeval_tv_sec="long" wi_cv_struct_timeval_tv_usec="long" ]) rm -f conftest.out ]) if test "$wi_struct_timeval_field_checks" = "uncached" ; then guess="$guess2" AC_MSG_CHECKING([what type the tv_usec field of struct timeval is]) AC_MSG_RESULT([$guess$wi_cv_struct_timeval_tv_usec]) else guess="$guess2" wi_CACHE_CHECK_GUESS_MESSAGE([what type the tv_usec field of struct timeval is],[wi_cv_struct_timeval_tv_usec], [:]) fi AC_DEFINE_UNQUOTED(tv_sec_t, $wi_cv_struct_timeval_tv_sec) AC_DEFINE_UNQUOTED(tv_usec_t, $wi_cv_struct_timeval_tv_usec) ]) dnl dnl dnl AC_DEFUN(wi_VOID_MAIN_RETURN_TYPE, [ AC_CACHE_CHECK([what type main() should return],[wi_cv_main_void_return_t], [ wi_cv_main_void_return_t="int" case "${GCC}_${SYS}" in no_irix*|no_hpux) wi_cv_main_void_return_t="void" ;; esac ]) AC_DEFINE_UNQUOTED(main_void_return_t, $wi_cv_main_void_return_t) ]) dnl dnl dnl AC_DEFUN(wi_INSECURE_CHOWN, [ wi_PREREQ_UNISTD_H([$0]) AC_MSG_CHECKING(if chown can be used to subvert security) AC_TRY_RUN([ #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) # define _ALL_SOURCE 1 #endif #ifdef HAVE_UNISTD_H # include #endif #include #include #include main() { int result; char fn[64]; FILE *fp; struct stat st; setuid(1); /* if you're root, try set to someone else. */ sprintf(fn, "/tmp/fu%06ld", (long) getpid()); unlink(fn); fp = fopen(fn, "w"); if (fp == NULL) exit(1); /* assume the worst */ fprintf(fp, "%s\n", "hello world"); fclose(fp); result = chown(fn, 0, 0); if (stat(fn, &st) < 0) { unlink(fn); exit((result == 0) ? 0 : 1); } unlink(fn); /* exit(0) if the insecure chown to uid 0 succeeded. */ exit((st.st_uid == 0) ? 0 : 1); }],[ # action if true wi_cv_insecure_chown=yes guess="" AC_DEFINE(INSECURE_CHOWN) ],[ # action if false guess="" wi_cv_insecure_chown=no ],[ # action if cross-compiling, guess guess="(guessing) " wi_cv_insecure_chown=no ]) AC_MSG_RESULT($guess$wi_cv_insecure_chown) ]) dnl dnl dnl AC_DEFUN(wi_PREREQ_UNISTD_H, [ if test "x$ac_cv_header_unistd_h" = x ; then AC_MSG_ERROR([Script needs to check for before calling [$1].]) fi ]) AC_DEFUN(wi_GETOPT, [ AC_CACHE_CHECK([how to access getopt() global variables], [wi_cv_getopt_decl], [ wi_PREREQ_UNISTD_H([$0]) AC_TRY_COMPILE([ /* includes */ #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) # define _ALL_SOURCE 1 #endif #ifdef HAVE_UNISTD_H # include #endif #include #include ],[ optind = (optarg == 0) ? 66 : 99; ],[wi_cv_getopt_decl="automatic"],[wi_cv_getopt_decl="unknown"]) if test "$wi_cv_getopt_decl" = unknown ; then AC_TRY_COMPILE([ /* includes */ #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) # define _ALL_SOURCE 1 #endif #ifdef HAVE_UNISTD_H # include #endif #include #include #include ],[ optind = (optarg == 0) ? 66 : 99; ],[ # # Looks like declares the variables as extern. # wi_cv_getopt_decl="getopt.h"],[ # # You'll need to declare them yourself. # wi_cv_getopt_decl="manual" ]) fi ]) if test "$wi_cv_getopt_decl" = "getopt.h" ; then AC_DEFINE(NEED_GETOPT_H) elif test "$wi_cv_getopt_decl" = "manual" ; then AC_DEFINE(NEED_GETOPT_EXTERN_DECLS) fi ]) dnl dnl dnl AC_DEFUN(wi_LIB_SNPRINTF, [ changequote(<<, >>)dnl if [ "$ac_cv_func_snprintf" = "no" ] || [ "$wi_cv_snprintf_terminates" = "no" ] || [ "$wi_cv_snprintf_returns_ptr" = "yes" ] ; then changequote([, ])dnl AC_CHECK_LIB(snprintf,snprintf) if test "$ac_cv_lib_snprintf_snprintf" = yes ; then unset ac_cv_func_snprintf ac_cv_func_vsnprintf AC_CHECK_HEADERS(snprintf.h) AC_CHECK_FUNCS(snprintf vsnprintf) fi fi ]) dnl dnl dnl AC_DEFUN(wi_SNPRINTF_TERMINATES, [ if test "$ac_cv_func_snprintf" != "no" ; then AC_MSG_CHECKING(if snprintf works correctly) wi_PREREQ_UNISTD_H([$0]) AC_TRY_RUN([ /* program */ #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) # define _ALL_SOURCE 1 #endif #ifdef HAVE_UNISTD_H # include #endif #include #include #ifdef HAVE_STRINGS_H #include #endif #include #ifdef HAVE_SNPRINTF_H # include #endif main() { char s[16]; int i, result; for (i=0; i<(int)(sizeof(s)/sizeof(char)); i++) s[i] = 'x'; result = (int) snprintf(s + 1, 10, "%s %s!", "hello", "world"); if (s[10] != '\0') exit(1); /* did not force termination! */ if (s[11] != 'x') exit(2); /* overflow! */ if (s[0] != 'x') exit(3); /* underflow! */ exit(0); } ],[ # action if true wi_cv_snprintf_terminates=yes AC_DEFINE(SNPRINTF_TERMINATES) guess="" x="yes" ],[ # action if false wi_cv_snprintf_terminates=no guess="" x="no" ],[ # action if cross compiling wi_cv_snprintf_terminates=yes AC_DEFINE(SNPRINTF_TERMINATES) guess="(guessing) " x="yes" ]) AC_MSG_RESULT($guess$x) fi ]) dnl dnl dnl AC_DEFUN(wi_SNPRINTF_RETVAL, [ AC_MSG_CHECKING([what snprintf() returns]) AC_TRY_RUN([ /* program */ #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) # define _ALL_SOURCE 1 #endif #ifdef HAVE_UNISTD_H # include #endif #include #include #ifdef HAVE_STRINGS_H #include #endif #include #ifdef HAVE_SNPRINTF_H # include #endif main() { int result; char s[8]; result = (int) snprintf(s, sizeof(s) - 1, "%d", 22); if (result == 2) exit(0); exit(1); } ],[ # action if true wi_cv_snprintf_returns_ptr=no guess="" x="length of data written" ],[ # action if false wi_cv_snprintf_returns_ptr=yes AC_DEFINE(SNPRINTF_RETURNS_PTR) guess="" x="pointer to data" ],[ # action if cross compiling wi_cv_snprintf_returns_ptr=no guess="(guessing) " x="length of data written" ]) AC_MSG_RESULT($guess$x) ]) dnl dnl dnl AC_DEFUN(wi_SNPRINTF, [ dnl Uncache these -- config.cache doesn't cache it right for this case. unset ac_cv_func_snprintf unset ac_cv_func_vsnprintf AC_CHECK_FUNCS(snprintf vsnprintf) if test "$ac_cv_func_snprintf" = yes ; then wi_SNPRINTF_TERMINATES wi_SNPRINTF_RETVAL wi_LIB_SNPRINTF else wi_LIB_SNPRINTF wi_SNPRINTF_TERMINATES wi_SNPRINTF_RETVAL fi ]) dnl dnl dnl AC_DEFUN(wi_HEADER_HPSECURITY_H, [ AC_MSG_CHECKING(for hpsecurity.h) wi_cv_header_hpsecurity_h=no if test -f /usr/include/hpsecurity.h ; then wi_cv_header_hpsecurity_h=yes AC_DEFINE(HAVE_HPSECURITY_H) fi AC_MSG_RESULT($wi_cv_header_hpsecurity_h) ]) dnl dnl dnl AC_DEFUN(wi_HEADER_SYS_SELECT_H, [ wi_PREREQ_UNISTD_H([$0]) # See if is includable after if test "$ac_cv_header_sys_time_h" = no ; then wi_chk_headers="sys/time.h sys/select.h" else wi_chk_headers="sys/time.h" fi AC_CHECK_HEADERS($wi_chk_headers) if test "$ac_cv_header_sys_select_h" = yes ; then AC_MSG_CHECKING([if is compatible with ]) selecth=yes if test "$ac_cv_header_sys_time_h" = yes ; then AC_TRY_COMPILE([ #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) # define _ALL_SOURCE 1 #endif #ifdef HAVE_UNISTD_H # include #endif #include #include #include ],[ fd_set a; struct timeval tmval; tmval.tv_sec = 0;],selecth=yes,selecth=no) fi if test "$selecth" = yes ; then AC_DEFINE(CAN_USE_SYS_SELECT_H) fi AC_MSG_RESULT($selecth) fi ]) dnl dnl dnl AC_DEFUN(wi_LIB_44BSD, [ AC_CHECK_FUNC(strerror,[a=yes],[a=no]) if test "$a" = no ; then # Not in libc, try lib44bsd. AC_CHECK_LIB(44bsd,strerror) fi ]) dnl dnl dnl AC_DEFUN(wi_UNIX_DOMAIN_SOCKETS, [ if test "x$want_unix_domain_sockets" != xno ; then wi_PREREQ_UNISTD_H([$0]) AC_CHECK_HEADERS(sys/un.h) wi_CACHE_CHECK_GUESS_MESSAGE([for UNIX domain sockets], [wi_cv_unix_domain_sockets], [ AC_TRY_RUN([ #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) # define _ALL_SOURCE 1 #endif #ifdef HAVE_UNISTD_H # include #endif #include #include #ifdef HAVE_SYS_UN_H #include #endif main() { int sfd; sfd = socket(AF_UNIX, SOCK_STREAM, 0); if (sfd < 0) exit(1); /* do not have UNIX domain sockets */ close(sfd); exit(0); /* do have UNIX domain sockets */ }],[ # action if true guess="" wi_cv_unix_domain_sockets=yes ],[ # action if false guess="" wi_cv_unix_domain_sockets=no ],[ # action if cross-compiling, guess guess="(guessing) " wi_cv_unix_domain_sockets=yes ]) ]) if test "x$wi_cv_unix_domain_sockets" = xyes ; then AC_DEFINE(HAVE_UNIX_DOMAIN_SOCKETS) fi wi_SOCKADDR_UN_SUN_LEN fi ]) dnl dnl dnl AC_DEFUN(wi_LIB_NSL, [ dnl Note: Check for socket lib first, then nsl. case "$OS" in hpux1[123456789]*) # HP-UX 11 uses NSL for YP services AC_CHECK_LIB(nsl,getpwent) ;; *) AC_CHECK_FUNC(gethostbyname,[a=yes],[a=no]) if test "$a" = no ; then # Not in libc, try libnsl. AC_CHECK_LIB(nsl,gethostbyname) fi ;; esac ]) dnl dnl dnl AC_DEFUN(wi_LIB_SOCKET, [ AC_CHECK_FUNC(socket,[a=yes],[a=no]) if test "$a" = no ; then # Not in libc, try libsocket. AC_CHECK_LIB(socket,socket) fi ]) dnl dnl dnl AC_DEFUN(wi_LIB_RESOLV, [ # See if we could access two well-known sites without help of any special # libraries, like resolv. dnl dnl AC_MSG_WARN([the following check may take several minutes if networking is not up. You may want to bring it up now and restart configure, otherwise please be patient.]) dnl wi_CACHE_CHECK_GUESS_MESSAGE([if we need to look for a separate DNS resolver library], [wi_cv_look_for_resolv], [ wi_PREREQ_UNISTD_H([$0]) AC_TRY_RUN([ #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) # define _ALL_SOURCE 1 #endif #ifdef HAVE_UNISTD_H # include #endif #include #include #include #include main() { struct hostent *hp1, *hp2; hp1 = gethostbyname("ftp.ncftp.com"); if (hp1 == (struct hostent *) 0) { hp2 = gethostbyname("www.ibm.com"); if (hp2 == (struct hostent *) 0) exit(1); } exit(0); }],[ # action if true guess="" wi_cv_look_for_resolv=no ],[ # action if false guess="" wi_cv_look_for_resolv=yes ],[ # action if cross compiling guess="(guessing) " wi_cv_look_for_resolv=yes ])]) if test "$wi_cv_look_for_resolv" = yes ; then AC_CHECK_LIB(resolv,main) else ac_cv_lib_resolv=no fi ]) dnl dnl dnl AC_DEFUN(wi_LIB_TCP_WRAPPERS, [ wi_PREREQ_UNISTD_H([$0]) AC_MSG_CHECKING([for tcp wrappers library (libwrap)]) AC_TRY_LINK([ /* includes */ #ifdef HAVE_UNISTD_H # include #endif #include #include /* These are needed if libwrap.a was compiled with * PROCESS_OPTIONS defined. */ int allow_severity = 1; /* arbitrary for this test */ int deny_severity = 2; /* arbitrary for this test */ ],[ /* function-body */ exit((allow_severity == deny_severity) ? 1 : 0); ],[ dnl ...Don't bother defining this symbol... dnl ...Check for tcpd.h instead... dnl AC_DEFINE(HAVE_LIBWRAP) dnl dnl ...Don't modify LIBS, instead set WRAPLIB... dnl LIBS="-lwrap $LIBS" dnl WRAPLIB="-lwrap" wi_cv_lib_wrap_hosts_access=yes ],[ WRAPLIB="" wi_cv_lib_wrap_hosts_access=no ]) AC_MSG_RESULT($wi_cv_lib_wrap_hosts_access) ]) dnl dnl dnl AC_DEFUN(wi_NET_LIBS, [ # Mostly for SunOS 4 -- needs to come first because other libs depend on it wi_LIB_44BSD wi_LIB_SOCKET if test "$SYS" = unixware ; then case "$OS" in unixware2*) # So far, only UnixWare needs this. AC_CHECK_LIB(gen,syslog) if test -f /usr/ucblib/libucb.a ; then LDFLAGS="$LDFLAGS -L/usr/ucblib" LIBS="$LIBS -lucb" fi if test -f /usr/include/unistd.h ; then ac_cv_header_unistd_h=yes fi # UnixWare 2 needs both lsocket and lnsl, and configure # script won't detect this condition properly because # the libraries are interdependent. # LIBS="$LIBS -lsocket -lnsl" # Now look for socket() # # AC_CHECK_FUNC(socket,[a=yes],[a=no]) # AC_CHECK_FUNC(socket,[a=yes],[a=no]) ;; *) ;; esac fi dnl AC_CHECK_LIB(inet,main) wi_LIB_NSL wi_LIB_RESOLV if test "$SYS" = dynixptx ; then LIBS="$LIBS -lsocket -lnsl" fi ]) dnl dnl dnl dnl AC_DEFUN(wi_DEFINE_UNAME, [ # Get first 127 chars of all uname information. Some folks have # way too much stuff there, so grab only the first 127. unam=`uname -a 2>/dev/null | cut -c1-127 | sed 's-"-\\"-g'` if test "$unam" != "" ; then AC_DEFINE_UNQUOTED(UNAME, "$unam") fi ]) dnl dnl dnl AC_DEFUN(wi_FUNC_SIGSETJMP, [ wi_PREREQ_UNISTD_H([$0]) AC_CACHE_CHECK([for sigsetjmp and siglongjmp], [wi_cv_func_sigsetjmp], [ AC_TRY_LINK([ /* includes */ #ifdef HAVE_UNISTD_H # include #endif #include #include #include #include ],[ /* function-body */ sigjmp_buf sjb; if (sigsetjmp(sjb, 1) != 0) siglongjmp(sjb, 1); /* bogus code, of course. */ exit(0); ],[ wi_cv_func_sigsetjmp=yes ],[ wi_cv_func_sigsetjmp=no ]) ]) if test "$wi_cv_func_sigsetjmp" = yes ; then AC_DEFINE(HAVE_SIGSETJMP) fi ]) dnl dnl dnl AC_DEFUN(wi_UTMP_UT_NAME, [ AC_MSG_CHECKING([for ut_name field in struct utmp]) AC_TRY_LINK([ /* includes */ #include #include #include ],[ struct utmp u; u.ut_name[0] = '\0'; exit(((int) &u.ut_name) & 0xff); /* bogus code, of course. */ ],[ wi_cv_utmp_ut_name=yes AC_DEFINE(HAVE_UTMP_UT_NAME) ],[ wi_cv_utmp_ut_name=no ]) AC_MSG_RESULT($wi_cv_utmp_ut_name) ]) dnl dnl dnl AC_DEFUN(wi_UTMP_UT_TYPE, [ AC_MSG_CHECKING([for ut_type field in struct utmp]) AC_TRY_LINK([ /* includes */ #include #include #include ],[ struct utmp u; u.ut_type[0] = '\0'; exit(((int) &u.ut_type) & 0xff); /* bogus code, of course. */ ],[ wi_cv_utmp_ut_type=yes AC_DEFINE(HAVE_UTMP_UT_TYPE) ],[ wi_cv_utmp_ut_type=no ]) AC_MSG_RESULT($wi_cv_utmp_ut_type) ]) dnl dnl dnl AC_DEFUN(wi_UTMPX_UT_TYPE, [ AC_MSG_CHECKING([for ut_type field in struct utmpx]) AC_TRY_LINK([ /* includes */ #include #include #include ],[ struct utmpx u; u.ut_type = 0; exit(((int) &u.ut_type) & 0xff); /* bogus code, of course. */ ],[ wi_cv_utmpx_ut_type=yes AC_DEFINE(HAVE_UTMPX_UT_TYPE) ],[ wi_cv_utmpx_ut_type=no ]) AC_MSG_RESULT($wi_cv_utmpx_ut_type) ]) dnl dnl dnl AC_DEFUN(wi_UTMPX_UT_SYSLEN, [ AC_MSG_CHECKING([for ut_syslen field in struct utmpx]) AC_TRY_LINK([ /* includes */ #include #include #include ],[ struct utmpx u; u.ut_syslen = 0; exit(((int) &u.ut_syslen) & 0xff); /* bogus code, of course. */ ],[ wi_cv_utmpx_ut_syslen=yes AC_DEFINE(HAVE_UTMPX_UT_SYSLEN) ],[ wi_cv_utmpx_ut_syslen=no ]) AC_MSG_RESULT($wi_cv_utmpx_ut_syslen) ]) dnl dnl dnl AC_DEFUN(wi_UTMPX_UT_USER, [ AC_MSG_CHECKING([for ut_user field in struct utmpx]) AC_TRY_LINK([ /* includes */ #include #include #include ],[ struct utmpx u; u.ut_user = 0; exit(((int) &u.ut_user) & 0xff); /* bogus code, of course. */ ],[ wi_cv_utmpx_ut_user=yes AC_DEFINE(HAVE_UTMPX_UT_USER) ],[ wi_cv_utmpx_ut_user=no ]) AC_MSG_RESULT($wi_cv_utmpx_ut_user) ]) dnl dnl dnl AC_DEFUN(wi_UTMP_UT_USER, [ AC_MSG_CHECKING([for ut_user field in struct utmp]) AC_TRY_LINK([ /* includes */ #include #include #include ],[ struct utmp u; u.ut_user[0] = '\0'; exit(((int) &u.ut_user) & 0xff); /* bogus code, of course. */ ],[ wi_cv_utmp_ut_user=yes AC_DEFINE(HAVE_UTMP_UT_USER) ],[ wi_cv_utmp_ut_user=no ]) AC_MSG_RESULT($wi_cv_utmp_ut_user) ]) dnl dnl dnl AC_DEFUN(wi_UTMP_UT_PID, [ AC_MSG_CHECKING([for ut_pid field in struct utmp]) AC_TRY_LINK([ /* includes */ #include #include #include ],[ struct utmp u; u.ut_pid = 1; exit(((int) &u.ut_pid) & 0xff); /* bogus code, of course. */ ],[ wi_cv_utmp_ut_pid=yes AC_DEFINE(HAVE_UTMP_UT_PID) ],[ wi_cv_utmp_ut_pid=no ]) AC_MSG_RESULT($wi_cv_utmp_ut_pid) ]) dnl dnl dnl AC_DEFUN(wi_UTMP_UT_TIME, [ AC_MSG_CHECKING([for ut_time field in struct utmp]) AC_TRY_LINK([ /* includes */ #include #include #include ],[ struct utmp u; u.ut_time = 1; exit(((int) &u.ut_time) & 0xff); /* bogus code, of course. */ ],[ wi_cv_utmp_ut_time=yes AC_DEFINE(HAVE_UTMP_UT_TIME) ],[ wi_cv_utmp_ut_time=no ]) AC_MSG_RESULT($wi_cv_utmp_ut_time) ]) dnl dnl dnl AC_DEFUN(wi_UTMP_UT_HOST, [ AC_MSG_CHECKING([for ut_host field in struct utmp]) AC_TRY_LINK([ /* includes */ #include #include #include ],[ struct utmp u; u.ut_host[0] = '\0'; exit(((int) &u.ut_host) & 0xff); /* bogus code, of course. */ ],[ wi_cv_utmp_ut_host=yes AC_DEFINE(HAVE_UTMP_UT_HOST) ],[ wi_cv_utmp_ut_host=no ]) AC_MSG_RESULT($wi_cv_utmp_ut_host) ]) dnl dnl dnl AC_DEFUN(wi_SIZEOF_SIZE_T, [ AC_MSG_CHECKING(size of size_t) wi_PREREQ_UNISTD_H([$0]) AC_TRY_RUN([ /* program */ #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) # define _ALL_SOURCE 1 #endif #ifdef HAVE_UNISTD_H # include #endif #include #include #include #include main() { size_t x = 0; FILE *fp; fp = fopen("conftest.out", "w"); if (fp != NULL) { fprintf(fp, "%u\n", (unsigned int) sizeof(x)); fclose(fp); exit(0); /* OK */ } exit(1); /* Not OK */ } ],[ # action if true x=`cat conftest.out` case "$x" in changequote(<<, >>)dnl [0-9]*) changequote([, ])dnl dnl Do not define here... we may redefine it when we re-run this macro. dnl Manually AC_DEFINE_UNQUOTED when you are finished with this macro. dnl AC_DEFINE_UNQUOTED(SIZEOF_SIZE_T, $x) ac_cv_sizeof_size_t="$x" ;; *) x="failed" ac_cv_sizeof_size_t="4" ;; esac rm -f conftest.out ],[ # action if false x="failed" ac_cv_sizeof_size_t="4" rm -f conftest.out ],[ # action if cross compiling x="unknown" ac_cv_sizeof_size_t="4" rm -f conftest.out ]) AC_MSG_RESULT($x) ]) dnl dnl dnl AC_DEFUN(wi_SIZEOF_OFF_T, [ AC_MSG_CHECKING(size of off_t) wi_PREREQ_UNISTD_H([$0]) AC_TRY_RUN([ /* program */ #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) # define _ALL_SOURCE 1 #endif #ifdef HAVE_UNISTD_H # include #endif #include #include #include #include main() { off_t x = 0; FILE *fp; fp = fopen("conftest.out", "w"); if (fp != NULL) { fprintf(fp, "%u\n", (unsigned int) sizeof(x)); fclose(fp); exit(0); /* OK */ } exit(1); /* Not OK */ } ],[ # action if true x=`cat conftest.out` case "$x" in changequote(<<, >>)dnl [0-9]*) changequote([, ])dnl dnl Do not define here... we may redefine it when we re-run this macro. dnl Manually AC_DEFINE_UNQUOTED when you are finished with this macro. dnl AC_DEFINE_UNQUOTED(SIZEOF_OFF_T, $x) ac_cv_sizeof_off_t="$x" ;; *) x="failed" ac_cv_sizeof_off_t="4" ;; esac rm -f conftest.out ],[ # action if false x="failed" ac_cv_sizeof_off_t="4" rm -f conftest.out ],[ # action if cross compiling x="unknown" ac_cv_sizeof_off_t="4" rm -f conftest.out ]) AC_MSG_RESULT($x) ]) dnl dnl dnl AC_DEFUN(wi_SIZEOF_ST_SIZE, [ AC_MSG_CHECKING(size of st_size field in struct stat) wi_PREREQ_UNISTD_H([$0]) AC_TRY_RUN([ /* program */ #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) # define _ALL_SOURCE 1 #endif #ifdef HAVE_UNISTD_H # include #endif #include #include #include #include main() { struct stat x; FILE *fp; fp = fopen("conftest.out", "w"); if (fp != NULL) { fprintf(fp, "%u\n", (unsigned int) sizeof(x.st_size)); fclose(fp); exit(0); /* OK */ } exit(1); /* Not OK */ } ],[ # action if true x=`cat conftest.out` case "$x" in changequote(<<, >>)dnl [0-9]*) changequote([, ])dnl dnl Do not define here... we may redefine it when we re-run this macro. dnl Manually AC_DEFINE_UNQUOTED when you are finished with this macro. dnl AC_DEFINE_UNQUOTED(SIZEOF_ST_SIZE, $x) ac_cv_sizeof_stat_st_size="$x" ;; *) x="failed" ac_cv_sizeof_stat_st_size="4" ;; esac rm -f conftest.out ],[ # action if false x="failed" ac_cv_sizeof_stat_st_size="4" rm -f conftest.out ],[ # action if cross compiling x="unknown" ac_cv_sizeof_stat_st_size="4" rm -f conftest.out ]) AC_MSG_RESULT($x) ]) dnl dnl dnl AC_DEFUN(wi_SIZEOF_OFF64_T, [ AC_MSG_CHECKING(size of off64_t) wi_PREREQ_UNISTD_H([$0]) AC_TRY_RUN([ /* program */ #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) # define _ALL_SOURCE 1 #endif #ifdef HAVE_UNISTD_H # include #endif #include #include #include #include main() { off64_t x = 0; FILE *fp; fp = fopen("conftest.out", "w"); if (fp != NULL) { fprintf(fp, "%u\n", (unsigned int) sizeof(x)); fclose(fp); exit(0); /* OK */ } exit(1); /* Not OK */ } ],[ # action if true x=`cat conftest.out` case "$x" in changequote(<<, >>)dnl [0-9]*) changequote([, ])dnl AC_DEFINE_UNQUOTED(SIZEOF_OFF64_T, $x) ac_cv_sizeof_off64_t="$x" ;; *) x="failed" ac_cv_sizeof_off64_t="4" ;; esac rm -f conftest.out ],[ # action if false x="failed" ac_cv_sizeof_off64_t="4" rm -f conftest.out ],[ # action if cross compiling x="unknown" ac_cv_sizeof_off64_t="8" rm -f conftest.out ]) AC_MSG_RESULT($x) ]) dnl dnl dnl AC_DEFUN(wi_SIZEOF_STAT64_ST_SIZE, [ AC_MSG_CHECKING(size of st_size field in struct stat64) wi_PREREQ_UNISTD_H([$0]) AC_TRY_RUN([ /* program */ #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) # define _ALL_SOURCE 1 #endif #ifdef HAVE_UNISTD_H # include #endif #include #include #include #include main() { struct stat64 x; FILE *fp; fp = fopen("conftest.out", "w"); if (fp != NULL) { fprintf(fp, "%u\n", (unsigned int) sizeof(x.st_size)); fclose(fp); exit(0); /* OK */ } exit(1); /* Not OK */ } ],[ # action if true x=`cat conftest.out` case "$x" in changequote(<<, >>)dnl [0-9]*) changequote([, ])dnl AC_DEFINE_UNQUOTED(SIZEOF_STAT64_ST_SIZE, $x) ac_cv_sizeof_stat64_st_size="$x" ;; *) x="failed" ac_cv_sizeof_stat64_st_size="4" ;; esac rm -f conftest.out ],[ # action if false x="failed" ac_cv_sizeof_stat64_st_size="4" rm -f conftest.out ],[ # action if cross compiling x="unknown" ac_cv_sizeof_stat64_st_size="8" rm -f conftest.out ]) AC_MSG_RESULT($x) ]) dnl dnl dnl AC_DEFUN(wi_STRUCT_STAT64, [ if test "$wi_cv_lfs64" != "yes" ; then AC_MSG_CHECKING([for struct stat64]) AC_MSG_RESULT([not needed]) wi_cv_struct_stat64=no else AC_MSG_CHECKING([for struct stat64]) AC_TRY_LINK([ /* includes */ #include #include #include ],[ struct stat64 st; st.st_size = 0; exit(((int) &st.st_size) & 0xff); /* bogus code, of course. */ ],[ wi_cv_struct_stat64=yes AC_DEFINE(HAVE_STRUCT_STAT64) ],[ wi_cv_struct_stat64=no ]) AC_MSG_RESULT($wi_cv_struct_stat64) fi ]) dnl dnl dnl AC_DEFUN(wi_STRUCT_CMSGHDR, [ AC_CACHE_CHECK([for struct cmsghdr],[wi_cv_struct_cmsghdr], [ AC_TRY_LINK([ /* includes */ #include #include #include #include #include ],[ struct cmsghdr cm; cm.cmsg_len = 0; cm.cmsg_level = 0; cm.cmsg_type = 0; exit(((int) &cm.cmsg_type) & 0xff); /* bogus code, of course. */ ],[ wi_cv_struct_cmsghdr=yes ],[ wi_cv_struct_cmsghdr=no ]) ]) if test "$wi_cv_struct_cmsghdr" = yes ; then AC_DEFINE(HAVE_STRUCT_CMSGDHR) fi ]) dnl dnl dnl AC_DEFUN(wi_MSGHDR_CONTROL, [ AC_CACHE_CHECK([for msg_control field in struct msghdr],[wi_cv_msghdr_control], [ AC_TRY_LINK([ /* includes */ #include #include #include #include #include ],[ struct msghdr m; m.msg_control = &m; m.msg_controllen = sizeof(m); exit(((int) &m.msg_control) & 0xff); /* bogus code, of course. */ ],[ wi_cv_msghdr_control=yes ],[ wi_cv_msghdr_control=no ]) ]) if test "$wi_cv_msghdr_control" = yes ; then AC_DEFINE(HAVE_MSGHDR_CONTROL) fi ]) dnl dnl dnl AC_DEFUN(wi_MSGHDR_ACCRIGHTS, [ AC_CACHE_CHECK([for msg_accrights field in struct msghdr], [wi_cv_msghdr_accrights], [ AC_TRY_LINK([ /* includes */ #include #include #include #include #include ],[ struct msghdr m; m.msg_accrights = &m; m.msg_accrightslen = sizeof(m); exit(((int) &m.msg_accrights) & 0xff); /* bogus code, of course. */ ],[ wi_cv_msghdr_accrights=yes ],[ wi_cv_msghdr_accrights=no ]) ]) if test "$wi_cv_msghdr_accrights" = yes ; then AC_DEFINE(HAVE_MSGHDR_ACCRIGHTS) fi ]) dnl dnl dnl AC_DEFUN(wi_PR_PASSWD_FG_OLDCRYPT, [ AC_MSG_CHECKING([for fg_oldcrypt field in struct pr_passwd]) AC_TRY_LINK([ /* includes */ #include #include #include #include #include #include #include #include #include #if defined(HAVE_USERPW_H) && defined(HAVE_GETUSERPW) /* AIX */ # include #elif defined(HAVE_PWDADJ_H) && defined(HAVE_GETPWANAM) /* SunOS */ # include # ifdef HAVE_SYS_AUDIT_H # include # endif # include #elif defined(HAVE_GETESPWNAM) /* Digital UNIX 4 */ # ifdef HAVE_SYS_SECDEFINES_H # include # endif # ifdef HAVE_SYS_SECURITY_H # include # endif # ifdef HAVE_SYS_AUDIT_H # include # endif # ifdef HAVE_KRB_H # include # endif # ifdef HAVE_PROT_H # include # endif #elif defined(HAVE_GETPRPWNAM) /* SCO Open Server V, Digital UNIX 3, HP-UX 10 */ # ifdef HAVE_SYS_SECDEFINES_H # include # endif # ifdef HAVE_SYS_SECURITY_H # include # endif # ifdef HAVE_SYS_AUDIT_H # include # endif # ifdef HAVE_HPSECURITY_H # include # endif # ifdef HAVE_KRB_H # include # endif # ifdef HAVE_PROT_H # include # endif #endif ],[ struct pr_passwd xu; memset(&xu, 0, sizeof(xu)); if (xu.uflg.fg_oldcrypt != 0) xu.uflg.fg_oldcrypt++; /* bogus code, of course */ exit(0); ],[ wi_cv_pr_passwd_fg_oldcrypt=yes AC_DEFINE(HAVE_PR_PASSWD_FG_OLDCRYPT) ],[ wi_cv_pr_passwd_fg_oldcrypt=no ]) AC_MSG_RESULT($wi_cv_pr_passwd_fg_oldcrypt) ]) dnl dnl dnl AC_DEFUN(wi_SOCKADDR_UN_SUN_LEN, [ AC_CACHE_CHECK([for sun_len field in struct sockaddr_un], [wi_cv_sockaddr_un_sun_len], [ AC_TRY_LINK([ /* includes */ #include #include #include #include #include ],[ struct sockaddr_un uaddr; uaddr.sun_len = strlen("/tmp/test.sock"); exit(((int) uaddr.sun_len); /* bogus code, of course. */ ],[ wi_cv_sockaddr_un_sun_len=yes ],[ wi_cv_sockaddr_un_sun_len=no ]) ]) if test "$wi_cv_sockaddr_un_sun_len" = yes ; then AC_DEFINE(HAVE_SOCKADDR_UN_SUN_LEN) fi ]) dnl dnl dnl AC_DEFUN(wi_STATFS_F_BAVAIL, [ AC_MSG_CHECKING([for f_bavail field in struct statfs]) AC_TRY_LINK([ /* includes */ #include #include #ifdef HAVE_SYS_STATFS_H # include #elif defined(HAVE_SYS_VFS_H) # include #endif ],[ struct statfs st; st.f_bavail = 1; exit((int) st.f_bavail); /* bogus code, of course. */ ],[ wi_cv_statfs_f_bavail=yes AC_DEFINE(HAVE_STATFS_F_BAVAIL) ],[ wi_cv_statfs_f_bavail=no ]) AC_MSG_RESULT($wi_cv_statfs_f_bavail) ]) dnl dnl dnl AC_DEFUN(wi_STATVFS_F_FRSIZE, [ AC_MSG_CHECKING([for f_frsize field in struct statvfs]) AC_TRY_LINK([ /* includes */ #include #include #include ],[ struct statvfs st; st.f_frsize = 1; exit((int) st.f_frsize); /* bogus code, of course. */ ],[ wi_cv_statfs_f_frsize=yes AC_DEFINE(HAVE_STATVFS_F_FRSIZE) ],[ wi_cv_statfs_f_frsize=no ]) AC_MSG_RESULT($wi_cv_statfs_f_frsize) ]) dnl dnl dnl AC_DEFUN(wi_SPRINTF_RETVAL, [ AC_MSG_CHECKING([what sprintf() returns]) AC_TRY_RUN([ /* program */ #include #include main() { int result; char s[8]; result = (int) sprintf(s, "%d", 22); if (result == 2) exit(0); exit(1); } ],[ # action if true wi_cv_sprintf_returns_ptr=no guess="" x="length of data written" ],[ # action if false wi_cv_sprintf_returns_ptr=yes AC_DEFINE(SPRINTF_RETURNS_PTR) guess="" x="pointer to data" ],[ # action if cross compiling wi_cv_sprintf_returns_ptr=no guess="(guessing) " x="length of data written" ]) AC_MSG_RESULT($guess$x) ]) dnl dnl dnl AC_DEFUN(wi_LIB_CRYPT, [ AC_MSG_CHECKING([which library has usable crypt() function]) ac_save_LIBS="$LIBS" crypt_lib=NONE for lib in "c" "crypt" "descrypt" "des" do if test "$lib" = "c" ; then LIBS="$ac_save_LIBS" else LIBS="$ac_save_LIBS -l${lib}" fi wi_PREREQ_UNISTD_H([$0]) AC_TRY_RUN([ /* program */ #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) # define _ALL_SOURCE 1 #endif #ifdef HAVE_UNISTD_H # include #endif #include #include extern char *crypt(const char *key, const char *salt); main() { char cleartext[256]; char *cp; memset(cleartext, 0, sizeof(cleartext)); strcpy(cleartext, "password"); cp = crypt(cleartext, "xx"); if ((cp != NULL) && (strcmp(cp, "xxj31ZMTZzkVA") == 0)) { /* printf("PASS\n"); */ exit(0); } /* printf("FAIL\n"); */ exit(1); } ],[ # action if true crypt_lib="$lib" ],[ # action if false : ],[ # action if cross compiling : ]) if test "$crypt_lib" != NONE ; then break fi done LIBS="$ac_save_LIBS" if test "$crypt_lib" = NONE ; then crypt_lib=c if test "x$cross_compiling" = xyes ; then AC_MSG_RESULT([cannot tell for cross compilations; you may need to add -lcrypt or similar to LIBS manually in the Makefile.]) else AC_MSG_RESULT([none?]) fi else AC_MSG_RESULT([lib${crypt_lib}]) fi if test "$crypt_lib" != c ; then AC_CHECK_LIB(${lib},crypt) fi ]) dnl dnl dnl AC_DEFUN(wi_TEST, [ changequote(<^, ^>)dnl changequote([, ])dnl ]) dnl dnl dnl AC_DEFUN(wi__RES_DEFDNAME, [ AC_MSG_CHECKING([for useable _res global variable]) AC_TRY_LINK([ /* includes */ #include #include #include #include #include #include #ifdef HAVE_ARPA_NAMESER_H # include #endif #ifdef HAVE_RESOLV_H # include #endif ],[ /* function-body */ int len; res_init(); len = (int) strlen(_res.defdname); ],[ wi_cv__res_defdname=yes AC_DEFINE(HAVE__RES_DEFDNAME) ],[ wi_cv__res_defdname=no ]) AC_MSG_RESULT($wi_cv__res_defdname) ]) dnl dnl dnl dnl AC_DEFUN(wi_TYPE_SIG_ATOMIC_T, [ wi_PREREQ_UNISTD_H([$0]) AC_MSG_CHECKING([for sig_atomic_t]) AC_TRY_LINK([ /* includes */ #ifdef HAVE_UNISTD_H #include #endif #include #include #include /* MG: for IRIX */ #if STDC_HEADERS #include #include #endif ],[ /* function-body */ sig_atomic_t sample; sample = (sig_atomic_t) getpid(); /* bogus code, of course */ exit((sample > 0) ? 0 : 1); ],[ ac_cv_type_sig_atomic_t=yes ],[ ac_cv_type_sig_atomic_t=no ]) AC_MSG_RESULT($ac_cv_type_sig_atomic_t) if test $ac_cv_type_sig_atomic_t = no ; then AC_DEFINE(sig_atomic_t, int) fi ]) dnl dnl dnl dnl AC_DEFUN(wi_LIB_READLINE, [ AC_MSG_CHECKING([for GNU Readline library, version 2.0 or newer]) wi_cv_lib_readline=no wi_cv_lib_readline_result=no ac_save_LIBS="$LIBS" # Note: $LIBCURSES is permitted to be empty. if test "x$cross_compiling" = xyes ; then if test "x$LIBCURSES" = x ; then LIBREADLINE="-lreadline -lcurses" else LIBREADLINE="-lreadline ${LIBCURSES}" fi LIBS="$ac_save_LIBS $LIBREADLINE" guess="(guessing) " wi_cv_lib_readline=yes else for LIBREADLINE in "-lreadline" "-lreadline $LIBCURSES" "-lreadline -ltermcap" "-lreadline -lncurses" "-lreadline -lcurses" do LIBS="$ac_save_LIBS $LIBREADLINE" AC_TRY_RUN([ /* program */ #include #include main(int argc, char **argv) { /* Note: don't actually call readline, * since it may block; * We just want to see if it * (dynamic) linked in okay. */ if (argc == 0) /* never true */ readline(0); exit(0); } ],[ # action if true guess="" wi_cv_lib_readline=yes ],[ # action if false guess="" wi_cv_lib_readline=no ],[ # action if cross compiling guess="(guessing) " wi_cv_lib_readline=yes ]) if test "x$wi_cv_lib_readline" = xyes ; then break ; fi done fi # Now try it again, to be sure it is recent enough. # rl_function_of_keyseq appeared in version 2.0 # dnl AC_CHECK_FUNC(rl_function_of_keyseq, [wi_cv_lib_readline=yes],[ dnl wi_cv_lib_readline=no;wi_cv_lib_readline_result="no (it is present but too old to use)" dnl ]) AC_TRY_LINK([ /* includes */ ],[ /* function-body */ readline(0); rl_function_of_keyseq(0); ],[ wi_cv_lib_readline=yes ],[ wi_cv_lib_readline=no wi_cv_lib_readline_result="no (it is present but too old to use)" ]) if test "$wi_cv_lib_readline" = no ; then LIBREADLINE="" # restore LIBS LIBS="$ac_save_LIBS" else rm -f readline.ver touch readline.ver AC_TRY_RUN([ /* program */ #include #include #include extern char *rl_library_version; main() { FILE *fp; double d; sscanf(rl_library_version, "%lf", &d); fp = fopen("readline.ver", "w"); if (fp == NULL) exit(1); if (fprintf(fp, "%s\n", rl_library_version) < 0) exit(1); if (fprintf(fp, "%03d\n", (int) (d * 100.0)) < 0) exit(1); if (fclose(fp) < 0) exit(1); exit(0); } ],[ # action if true rl_library_version=`sed -n 1,1p readline.ver 2>/dev/null` guess="" rlver=`sed -n 2,2p readline.ver 2>/dev/null` rm -f readline.ver ],[ # action if false rl_library_version='' guess="" rlver='' rm -f readline.ver ],[ # action if cross compiling rl_library_version='' guess="(guessing) " rlver='' rm -f readline.ver ]) case "$rlver" in ???) wi_cv_lib_readline_result="yes, installed version is $rl_library_version" ;; *) # Test using current LIBS. AC_TRY_LINK([ /* includes */ extern int rl_completion_append_character; ],[ /* function-body */ readline(0); rl_completion_append_character = 0; ],[ rlver="210" ],[ rlver="200" ]) if test "$rlver" = "210" ; then wi_cv_lib_readline_result="yes, version 2.1 or higher" else wi_cv_lib_readline_result="yes, version 2.0" fi ;; esac wi_cv_lib_readline=yes # restore LIBS LIBS="$ac_save_LIBS" fi AC_MSG_RESULT($wi_cv_lib_readline_result) AC_SUBST(LIBREADLINE) if test "$wi_cv_lib_readline" = yes ; then # Now verify that all the headers are installed. # AC_REQUIRE_CPP() unset ac_cv_header_readline_chardefs_h unset ac_cv_header_readline_history_h unset ac_cv_header_readline_keymaps_h unset ac_cv_header_readline_readline_h unset ac_cv_header_readline_tilde_h AC_CHECK_HEADERS([readline/chardefs.h readline/history.h readline/keymaps.h readline/readline.h readline/tilde.h]) for xxwi in \ "$ac_cv_header_readline_chardefs_h" \ "$ac_cv_header_readline_history_h" \ "$ac_cv_header_readline_keymaps_h" \ "$ac_cv_header_readline_readline_h" \ "$ac_cv_header_readline_tilde_h" do if test "$xxwi" = no ; then break fi done if test "$xxwi" = no ; then AC_MSG_WARN([GNU Readline headers are not installed or could not be found -- GNU Readline will not be used.]) wi_cv_lib_readline=no wi_cv_lib_readline_result="no (headers not installed)" else AC_DEFINE_UNQUOTED(HAVE_LIBREADLINE, $rlver) fi fi ]) dnl dnl dnl AC_DEFUN(wi_USE_LONG_LONG, [ wi_PREREQ_UNISTD_H([$0]) AC_MSG_CHECKING([for 64-bit integral type: long long]) LONGEST_INT="long" AC_TRY_RUN([ /* program */ #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) # define _ALL_SOURCE 1 #endif #ifdef HAVE_UNISTD_H # include #endif #include #include long long hugeNumvar = 1; main() { long long hugeNumtoo = 2; if (hugeNumtoo > hugeNumvar) hugeNumvar++; if (sizeof(hugeNumvar) < 8) exit(1); exit(0); } ],[ # action if true guess="" wi_cv_type_long_long=yes LONGEST_INT="long long" ],[ # action if false guess="" wi_cv_type_long_long=no ],[ # action if cross compiling guess="(guessing) " wi_cv_type_long_long=yes LONGEST_INT="long long" ]) AC_MSG_RESULT($guess$wi_cv_type_long_long) if test "$wi_cv_type_long_long" = yes ; then AC_MSG_CHECKING([how to print a 64-bit integral type]) wi_cv_printf_long_long=fail AC_TRY_RUN([ /* program */ #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) # define _ALL_SOURCE 1 #endif #ifdef HAVE_UNISTD_H # include #endif #include #include #include #include main() { char s[80]; long long hugeNum; hugeNum = (long long) 1000000000; hugeNum = hugeNum * (long long) 99; hugeNum = hugeNum + (long long) 1; (void) sprintf(s, "%lld", hugeNum); exit((strcmp(s, "99000000001") == 0) ? 0 : 1); } ],[ # action if true guess="" wi_cv_printf_long_long="%lld" ],[ # action if false guess="" ],[ # action if cross compiling guess="(guessing) " wi_cv_printf_long_long="%lld" ]) if test "$wi_cv_printf_long_long" = fail ; then AC_TRY_RUN([ /* program */ #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) # define _ALL_SOURCE 1 #endif #ifdef HAVE_UNISTD_H # include #endif #include #include #include #include main() { char s[80]; long long hugeNum; hugeNum = (long long) 1000000000; hugeNum = hugeNum * (long long) 99; hugeNum = hugeNum + (long long) 1; (void) sprintf(s, "%qd", hugeNum); exit((strcmp(s, "99000000001") == 0) ? 0 : 1); } ],[ # action if true wi_cv_printf_long_long="%qd" ],[ # action if false : ],[ # action if cross compiling : ]) fi if test "$wi_cv_printf_long_long" = fail ; then wi_cv_printf_long_long_msg_result='cannot print' else wi_cv_printf_long_long_msg_result="$wi_cv_printf_long_long" fi AC_MSG_RESULT($guess$wi_cv_printf_long_long_msg_result) AC_MSG_CHECKING([how to scan a 64-bit integral type]) wi_cv_scanf_long_long=fail AC_TRY_RUN([ /* program */ #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) # define _ALL_SOURCE 1 #endif #ifdef HAVE_UNISTD_H # include #endif #include #include #include #include main() { long long hugeNum, justAsHugeNum; hugeNum = (long long) 1000000000; hugeNum = hugeNum * (long long) 99; hugeNum = hugeNum + (long long) 1; justAsHugeNum = (long long) 0; --justAsHugeNum; sscanf("99000000001", "%lld", &justAsHugeNum); if (memcmp(&hugeNum, &justAsHugeNum, sizeof(hugeNum)) == 0) exit(0); exit(1); } ],[ # action if true guess="" wi_cv_scanf_long_long="%lld" ],[ # action if false guess="" ],[ # action if cross compiling guess="(guessing) " wi_cv_scanf_long_long="%lld" ]) if test "$wi_cv_scanf_long_long" = fail ; then AC_TRY_RUN([ /* program */ #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) # define _ALL_SOURCE 1 #endif #ifdef HAVE_UNISTD_H # include #endif #include #include #include #include main() { long long hugeNum, justAsHugeNum; hugeNum = (long long) 1000000000; hugeNum = hugeNum * (long long) 99; hugeNum = hugeNum + (long long) 1; justAsHugeNum = (long long) 0; --justAsHugeNum; sscanf("99000000001", "%qd", &justAsHugeNum); if (memcmp(&hugeNum, &justAsHugeNum, sizeof(hugeNum)) == 0) exit(0); exit(1); } ],[ # action if true wi_cv_scanf_long_long="%qd" ],[ # action if false : ],[ # action if cross compiling : ]) fi if test "$wi_cv_scanf_long_long" = fail ; then wi_cv_scanf_long_long_msg_result='cannot scan' else wi_cv_scanf_long_long_msg_result="$wi_cv_scanf_long_long" fi AC_MSG_RESULT($guess$wi_cv_scanf_long_long_msg_result) fi AC_MSG_CHECKING([if everything was available to use the 64-bit integral type]) if test "$wi_cv_type_long_long" = no ; then wi_cv_use_long_long_msg_result="no (long long type not available)" wi_cv_use_long_long="no" wi_cv_scanf_long_long="fail" wi_cv_prihtf_long_long="fail" LONGEST_INT="long" elif test "$wi_cv_printf_long_long" = fail ; then wi_cv_use_long_long_msg_result="no (libc printf() does not support them)" wi_cv_use_long_long="no" wi_cv_scanf_long_long="fail" wi_cv_prihtf_long_long="fail" LONGEST_INT="long" elif test "$wi_cv_scanf_long_long" = fail ; then wi_cv_use_long_long_msg_result="no (libc scanf() does not support them)" wi_cv_use_long_long="no" wi_cv_scanf_long_long="fail" wi_cv_prihtf_long_long="fail" LONGEST_INT="long" else AC_DEFINE(HAVE_LONG_LONG) if test "$wi_cv_printf_long_long$wi_cv_scanf_long_long" = "%lld%qd" ; then # FreeBSD 3.2 has %lld and %qd, but we want to # run on 3.1 and 3.0. # wi_cv_printf_long_long="%qd" fi wi_cv_printf_ulong_long=`echo "$wi_cv_printf_long_long" | sed 's/d$/u/;'` wi_cv_scanf_ulong_long=`echo "$wi_cv_scanf_long_long" | sed 's/d$/u/;'` AC_DEFINE_UNQUOTED(PRINTF_LONG_LONG, "$wi_cv_printf_long_long") AC_DEFINE_UNQUOTED(SCANF_LONG_LONG , "$wi_cv_scanf_long_long") AC_DEFINE_UNQUOTED(PRINTF_ULONG_LONG, "$wi_cv_printf_ulong_long") AC_DEFINE_UNQUOTED(SCANF_ULONG_LONG , "$wi_cv_scanf_ulong_long") if test "$wi_cv_printf_long_long" = "%qd" ; then AC_DEFINE(PRINTF_LONG_LONG_QD) else AC_DEFINE(PRINTF_LONG_LONG_LLD) fi if test "$wi_cv_scanf_long_long" = "%qd" ; then AC_DEFINE(SCANF_LONG_LONG_QD) else AC_DEFINE(SCANF_LONG_LONG_LLD) fi wi_cv_use_long_long="yes" wi_cv_use_long_long_msg_result="yes" fi AC_MSG_RESULT($wi_cv_use_long_long_msg_result) ]) dnl dnl dnl AC_DEFUN(wi_REMOVE_UNKNOWN_PREPROCESSING_DIRECTIVES_FROM_FILE, [ AC_REQUIRE([wi_TEST_DASH_L]) h_file="$1" if test -f "$h_file" && $test_not_L "$h_file" ; then h_tmp=`echo "$h_file" | sed 's/\.h/.tmp/;'` changequote(<<, >>)dnl remove_cpp_warning=yes if [ "$SYS" = linux ] ; then # # We need to retain #warning on Linux # remove_cpp_warning=no fi if [ "$GCC" = yes ] ; then # # GCC accepts #warning # remove_cpp_warning=no fi if [ "$remove_cpp_warning" = yes ] ; then # # Remove "#warning", since compiler will complain about it # not being recognized. # sed 's/^\([\ \ ]*#[\ \ ]*warning.*\)/\/* \1 *\//;' "$h_file" > "$h_tmp" cmp -s "$h_file" "$h_tmp" if test $? -ne 0 ; then mv "$h_tmp" "$h_file" chmod a+r "$h_file" fi rm -f "$h_tmp" unset h_tmp longest_int_subst fi changequote([, ])dnl fi unset h_file remove_cpp_warning ]) dnl dnl dnl AC_DEFUN(wi_SUBST_LONGEST_INT_HEADER, [ AC_REQUIRE([wi_TEST_DASH_L]) h_file="$1" if test -f "$h_file" && $test_not_L "$h_file" ; then h_tmp=`echo "$h_file" | sed 's/\.h/.tmp/;'` dnl dnl LONGEST_INT should most often be "long long" if wi_USE_LONG_LONG has been run dnl longest_int_subst="${LONGEST_INT-long}" dnl changequote({{, }})dnl if sed 's!\ */\*\ set\ by\ configure\ at\ .*\*/!!' "$h_file" > "$h_tmp" ; then touch -r "$h_file" "$h_tmp" if cmp -s "$h_file" "$h_tmp" ; then : else /bin/mv "$h_tmp" "$h_file" chmod a+r "$h_file" fi fi if sed 's/^#define longest_int.*/#define longest_int '"$longest_int_subst"'/;s/^#define longest_uint.*/#define longest_uint unsigned '"$longest_int_subst"'/;' "$h_file" > "$h_tmp" ; then if cmp -s "$h_file" "$h_tmp" ; then datestr=`date '+%Y-%m-%d %H:%M:%S'` sed '/^#define longest_u?int/{s!$! /* set by configure at '"${datestr}"' */!;}' "$h_tmp" > "$h_file" unset datestr /bin/rm -f "$h_tmp" chmod a+r "$h_file" fi fi /bin/rm -f "$h_tmp" unset h_tmp longest_int_subst fi unset h_file changequote([, ])dnl ]) dnl dnl dnl AC_DEFUN(wi_SUBST_STAT_HEADER, [ AC_REQUIRE([wi_TEST_DASH_L]) h_file="$1" if test -f "$h_file" && $test_not_L "$h_file" ; then h_tmp=`echo "$h_file" | sed 's/\.h/.tmp/;'` dnl dnl wi_cv_struct_stat64=yes dnl changequote({{, }})dnl if sed 's!\ */\*\ set\ by\ configure\ at\ .*\*/!!' "$h_file" > "$h_tmp" ; then touch -r "$h_file" "$h_tmp" if cmp -s "$h_file" "$h_tmp" ; then : else /bin/mv "$h_tmp" "$h_file" chmod a+r "$h_file" fi fi if test "x$wi_cv_struct_stat64" = xyes ; then if sed 's/^#define Stat .*/#define Stat stat64/;s/^#define Lstat .*/#define Lstat lstat64/;s/^#define Fstat .*/#define Fstat fstat64/;' "$h_file" > "$h_tmp" ; then if cmp -s "$h_file" "$h_tmp" ; then : else datestr=`date '+%Y-%m-%d %H:%M:%S'` sed '/^#define [SLFs]*tat /{s!$! /* set by configure at '"${datestr}"' */!;}' "$h_tmp" > "$h_file" unset datestr /bin/rm -f "$h_tmp" chmod a+r "$h_file" fi fi else if sed 's/^#define Stat .*/#define Stat stat/;s/^#define Lstat .*/#define Lstat lstat/;s/^#define Fstat .*/#define Fstat fstat/;' "$h_file" > "$h_tmp" ; then if cmp -s "$h_file" "$h_tmp" ; then : else datestr=`date '+%Y-%m-%d %H:%M:%S'` sed '/^#define [SLFs]*tat /{s!$! /* set by configure at '"${datestr}"' */!;}' "$h_tmp" > "$h_file" unset datestr /bin/rm -f "$h_tmp" chmod a+r "$h_file" fi fi fi /bin/rm -f "$h_tmp" unset h_tmp longest_int_subst fi unset h_file changequote([, ])dnl ]) dnl dnl dnl dnl AC_DEFUN(wi_MANDIR, [ if test "x$mandir" = 'x${prefix}/man' ; then # Mandir is at default value -- try to see # if $prefix/share/man would be better. # # $prefix is probably set to NONE. # p=`cd / ; cd $prefix 2>/dev/null ; pwd` if test "x$p" = "x/" ; then p="/usr/local" fi if test -d "$p/share/man" ; then mandir="$p/share/man" fi fi ]) dnl dnl dnl dnl AC_DEFUN(wi_SUMMARIZE_COMPILER_FLAGS, [ AC_MSG_CHECKING([CC]) AC_MSG_RESULT([$CC]) AC_MSG_CHECKING([CFLAGS]) AC_MSG_RESULT([$CFLAGS]) AC_MSG_CHECKING([CPPFLAGS]) AC_MSG_RESULT([$CPPFLAGS]) AC_MSG_CHECKING([DEFS]) AC_MSG_RESULT([$DEFS]) AC_MSG_CHECKING([NDEFS]) AC_MSG_RESULT([$NDEFS]) AC_MSG_CHECKING([LDFLAGS]) AC_MSG_RESULT([$LDFLAGS]) AC_MSG_CHECKING([LIBS]) AC_MSG_RESULT([$LIBS]) # # Also take the opportunity to do some post-configure clean-up # /bin/rm -rf "conftest.dSYM" "a.out" ]) dnl dnl dnl dnl AC_DEFUN(wi_BEAUTIFY_ENVIRONMENT_VARIABLES, [ changequote(<<, >>)dnl LIBS=`echo "$LIBS" | sed 's/^ *//;s/ *$//;s/ */ /g'` LDFLAGS=`echo "$LDFLAGS" | sed 's/^ *//;s/ *$//;s/ */ /g'` CPPFLAGS=`echo "$CPPFLAGS" | sed 's/^ *//;s/ *$//;s/ */ /g'` CFLAGS=`echo "$CFLAGS $wi_CFLAGS_TO_ADD_LATER" | sed 's/^ *//;s/ *$//;s/ */ /g'` DEFS=`echo "$DEFS" | sed 's/^ *//;s/ *$//;s/ */ /g'` changequote([, ])dnl ]) dnl dnl dnl dnl AC_DEFUN(wi_PATH_PWD, [ AC_PATH_PROG(wi_PWD, "pwd", "pwd") ]) dnl dnl dnl dnl AC_DEFUN(wi_BASENAME, [ $1=`echo "[$]$1" | sed -n ' s-//*-/-g s-/*$-- s-^/$-- s-^.*/-- p q'`dnl ]) dnl dnl dnl dnl AC_DEFUN(wi_DIRNAME, [ changequote({{, }})dnl $1=`echo "{{$}}$1" | sed -n ' s-//*-/-g s-/*$-- /^\/\/*[^/]*$/{ c\\ / p q } /^[^/]*$/{ c\\ . p q } /./{ s-/[^/]*$-- p q }'`dnl changequote([, ])dnl ]) dnl dnl dnl dnl AC_DEFUN(wi_RESOLVE_PATH, [ AC_REQUIRE([wi_PATH_PWD]) wi_path="$1" if test -d "$wi_path" ; then wi_resolved_path=`cd "$wi_path" ; $wi_PWD 2>/dev/null` elif test ! -f "$wi_path" ; then wi_resolved_path="$wi_path" else wi_parent_dir="$wi_path" wi_file_name="$wi_path" wi_DIRNAME(wi_parent_dir) wi_BASENAME(wi_file_name) wi_resolved_path=`cd "$wi_parent_dir" ; $wi_PWD 2>/dev/null` if test "x$wi_resolved_path" != x ; then wi_resolved_path="$wi_resolved_path/$wi_file_name" fi unset wi_parent_dir wi_file_name fi if test "x$wi_resolved_path" = x ; then $2="[$]$1" else $2="$wi_resolved_path" fi unset wi_resolved_path wi_path ]) dnl dnl dnl dnl AC_DEFUN(wi_PATH_MKTEMP, [ AC_PATH_PROG(MKTEMP, "mktemp", "") ]) dnl dnl dnl dnl AC_DEFUN(wi_PATH_PERL, [ AC_PATH_PROG(PERL, "perl", "perl") ]) dnl dnl dnl dnl AC_DEFUN(wi_PROG_PERL, [ AC_REQUIRE([wi_PATH_PERL]) if test "x$PERL" != "x" ; then AC_DEFINE_UNQUOTED(PERL, "$PERL") fi AC_SUBST(PERL) ]) dnl dnl dnl dnl AC_DEFUN(wi_CREATE_AC_TMPDIR, [ AC_REQUIRE([wi_PATH_MKTEMP]) changequote({{, }})dnl wi_tmpdir="" if [ "x$MKTEMP" != "x" ] ; then # Ignore error from mktemp, since some old versions of Linux # print an error about not supporting -d. # wi_tmpdir=`"$MKTEMP" -d /tmp/configure.XXXXXXXXXX 2>/dev/null` if [ $? -ne 0 ] ; then wi_tmpdir="" fi fi if [ "x$wi_tmpdir" = "x" ] ; then for wi_tmpdir in . $TMPDIR $TEMPDIR /tmp ABORT do if [ "$wi_tmpdir" = ABORT ] ; then echo "Cannot create temporary directory." exit 1 fi wi_tmpdir="$wi_tmpdir/config_tmp.$$" if [ -d "$wi_tmpdir" ] || [ -f "$wi_tmpdir" ] ; then echo "Will not create temporary directory." exit 1 fi mkdir "$wi_tmpdir" if [ $? -eq 0 ] && [ -d "$wi_tmpdir" ] ; then break ; fi done fi changequote([, ])dnl # Use the temporary directory here... $1 # Done using the temporary directory here. rm -r "$wi_tmpdir" unset wi_tmpdir ]) dnl dnl dnl dnl AC_DEFUN(wi_FUNC_SELECT_ARGTYPES, [ wi_PREREQ_UNISTD_H([$0]) AC_MSG_CHECKING([types of arguments for select()]) AC_CACHE_VAL(ac_cv_func_select_arg234,dnl [AC_CACHE_VAL(ac_cv_func_select_arg1,dnl [AC_CACHE_VAL(ac_cv_func_select_arg5,dnl [for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do AC_TRY_COMPILE(dnl [#if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) /* MG */ # define _ALL_SOURCE 1 /* MG */ #endif #ifdef HAVE_UNISTD_H /* MG */ #include #endif /* MG */ #include /* MG: always incl */ #include /* MG: always incl */ #ifdef HAVE_SYS_SELECT_H #include #endif #include /* MG: always incl */ extern select ($ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5);],,dnl [ac_not_found=no ; break 3],ac_not_found=yes) done done done ])dnl AC_CACHE_VAL ])dnl AC_CACHE_VAL ])dnl AC_CACHE_VAL if test "$ac_not_found" = yes; then ac_cv_func_select_arg1=int ac_cv_func_select_arg234='int *' ac_cv_func_select_arg5='struct timeval *' fi AC_MSG_RESULT([$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5]) AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG1,$ac_cv_func_select_arg1) AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG234,($ac_cv_func_select_arg234)) AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG5,($ac_cv_func_select_arg5)) ]) dnl dnl dnl dnl AC_DEFUN(wi_CREATE_PRPP_SCRIPT, [ changequote({{, }})dnl cat << 'EOF' > "{{$1}}" #!/usr/bin/perl -w # # prpp.pl # # Feed the output of your CPP to this to print a list of function prototypes. # #use strict; my ($c) = ""; my ($unputc) = ""; my ($line) = ""; my ($lines) = ""; my ($cline) = ""; my ($skipping) = 0; my ($numclines) = 0; MAINLOOP: while (1) { if ($unputc ne "") { $c = $unputc; $unputc = ""; } else { last unless (read(STDIN, $c, 1) == 1); } if ($c eq "{") { $skipping++; } elsif ($c eq "}") { --$skipping; $unputc = ";"; } elsif ($skipping) { next MAINLOOP; } elsif ($c eq ";") { if ($line =~ m/^\s*(\S.*\S)\s*$/s) { $lines .= {{$}}1; $line = ""; } if ($lines =~ m/^\s*(extern\s*)?(\S.*\S)\s*$/s) { $cline = {{$}}2; $cline =~ s/\s+/\ /g; if ($cline =~ /^typedef/) { $cline = ""; } elsif ($cline =~ /\(.*\)$/) { # found a proto print $cline, ";\n"; $numclines++; } else { $cline = ""; } } $lines = ""; $line = ""; } elsif ($c eq "\n") { if ($line =~ m/^\s*(\S.*\S)\s*$/s) { $lines .= {{$}}1 . " "; $line = ""; } } elsif (($c eq "#") && ($line eq "")) { # Looks like a preprocessor line, kill it { last MAINLOOP if (read(STDIN, $c, 1) != 1); last if ($c eq "\n"); redo; } } elsif ($c =~ /^\s$/) { $line .= " " if ($line ne ""); } elsif (! $skipping) { $line .= $c; } } exit(($numclines == 0) ? 1 : 0); EOF chmod 755 "{{$1}}" changequote([, ])dnl ]) dnl dnl dnl dnl dnl wi_CHECK_TYPE(TYPE, DEFAULT, INCLUDES) AC_DEFUN(wi_CHECK_TYPE, [AC_REQUIRE([AC_HEADER_STDC])dnl AC_MSG_CHECKING(for $1) AC_CACHE_VAL(ac_cv_type_$1, [AC_EGREP_CPP(dnl changequote(<<,>>)dnl <<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl changequote([,]), [ #ifdef HAVE_UNISTD_H #include #endif #include #if STDC_HEADERS #include #include #endif $3], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl AC_MSG_RESULT($ac_cv_type_$1) if test $ac_cv_type_$1 = no; then AC_DEFINE($1, $2) fi ]) dnl dnl dnl dnl AC_DEFUN(wi_UNISTD_FUNC_PARAM_TYPES, [ AC_REQUIRE([AC_PROG_CPP]) AC_REQUIRE([wi_PATH_PERL]) AC_REQUIRE([AC_TYPE_SIZE_T]) AC_REQUIRE([wi_PATH_MKTEMP]) wi_PREREQ_UNISTD_H([$0]) AC_CACHE_CHECK([for return type from write], [wi_cv_write_return_t], [ used_cache_for_wi_unistd_fpt="no" wi_CREATE_AC_TMPDIR([ wi_CREATE_PRPP_SCRIPT([$wi_tmpdir/prpp.pl]) changequote({{, }})dnl cat << 'EOF' > "$wi_tmpdir/unistd.c" #include #include #include #include #include #include #include main() { exit(0); } EOF cat << 'EOF' > "$wi_tmpdir/sed.sh" #!/bin/sh if [ {{$}}# -eq 0 ] ; then exit 1 ; fi x="{{$}}1" sed -n 's/extern//;s/static//; /[\ \*]'"$x"'\ *(/{ s/^.*'"$x"'\ *(/(/ s/)\ *[;,].*$/)/ /ssize_t/{ c\ ssize_t } /size_t/{ c\ size_t } /socklen_t/{ c\ socklen_t } /unsigned int/{ c\ unsigned int } /unsigned long/{ c\ unsigned long } /long/{ c\ long } q }' | sed 's/int int/int/g' EOF chmod 755 "$wi_tmpdir/sed.sh" cat << 'EOF' > "$wi_tmpdir/sed2.sh" #!/bin/sh if [ {{$}}# -eq 0 ] ; then exit 1 ; fi x="{{$}}1" sed -n 's/extern//;s/static//; /[\ \*]'"$x"'\ *(/{ s/^.*'"$x"'\ *(/(/ s/)\ *[;,].*$/)/ /const char/{ c\ const char * } /char/{ c\ char * } /const/{ c\ const void } q }' EOF chmod 755 "$wi_tmpdir/sed2.sh" $CPP "-I${srcdir-.}" "$wi_tmpdir/unistd.c" > "$wi_tmpdir/unistd.i" if [ -s "$wi_tmpdir/unistd.i" ] ; then "$PERL" "$wi_tmpdir/prpp.pl" < "$wi_tmpdir/unistd.i" > "$wi_tmpdir/protos.h" fi if [ -f "$wi_tmpdir/protos.h" ] ; then # # Check the return type of write() # x="write" wi_cv_write_return_t=`sed -n 's/extern//;s/static//; s/__attribute__((__cdecl__))//; /[\ \*]'"$x"'\ *(/{ s/'"$x"'\ *(.*// s/^\ *// s/\ *$// p;q }' "$wi_tmpdir/protos.h"` # # Check what type write() expects for the size parameter # x="write" wi_cv_write_size_t=`/bin/sh "$wi_tmpdir/sed.sh" "$x" < "$wi_tmpdir/protos.h"` # # Check the return type of send() # x="send" wi_cv_send_return_t=`sed -n 's/extern//;s/static//; s/__attribute__((__cdecl__))//; /[\ \*]'"$x"'\ *(/{ s/'"$x"'\ *(.*// s/^\ *// s/\ *$// p;q }' "$wi_tmpdir/protos.h"` # # Check what type send() expects for the size parameter # Tru64 is one example where send() differs from write() :-( # x="send" wi_cv_send_size_t=`/bin/sh "$wi_tmpdir/sed.sh" "$x" < "$wi_tmpdir/protos.h"` # # Check what type connect() expects for the size parameter # x="connect" wi_cv_sockaddr_size_t=`/bin/sh "$wi_tmpdir/sed.sh" "$x" < "$wi_tmpdir/protos.h"` # # Check what type setsockopt() expects for the size parameter # x="setsockopt" wi_cv_sockopt_size_t=`/bin/sh "$wi_tmpdir/sed.sh" "$x" < "$wi_tmpdir/protos.h"` # # Check what type listen() expects for the backlog parameter # x="listen" wi_cv_listen_backlog_t=`/bin/sh "$wi_tmpdir/sed.sh" "$x" < "$wi_tmpdir/protos.h"` # # Check what type alarm() expects for the seconds parameter # x="alarm" wi_cv_alarm_time_t=`/bin/sh "$wi_tmpdir/sed.sh" "$x" < "$wi_tmpdir/protos.h"` # # Check what type gethostbyaddr() expects for the addr parameter # x="gethostbyaddr" wi_cv_gethost_addrptr_t=`/bin/sh "$wi_tmpdir/sed2.sh" "$x" < "$wi_tmpdir/protos.h"` # # Check what type gethostname() expects for the size parameter # x="gethostname" wi_cv_gethostname_size_t=`/bin/sh "$wi_tmpdir/sed.sh" "$x" < "$wi_tmpdir/protos.h"` fi if [ "x$wi_cv_write_return_t" = "x" ] ; then wi_cv_write_return_t="int" fi if [ "x$wi_cv_write_size_t" = "x" ] ; then wi_cv_write_size_t="int" fi if [ "x$wi_cv_send_return_t" = "x" ] ; then wi_cv_send_return_t="int" fi if [ "x$wi_cv_send_size_t" = "x" ] ; then wi_cv_send_size_t="int" fi if [ "x$wi_cv_sockaddr_size_t" = "x" ] ; then wi_cv_sockaddr_size_t="int" fi if [ "x$wi_cv_sockopt_size_t" = "x" ] ; then wi_cv_sockopt_size_t="int" fi if [ "x$wi_cv_listen_backlog_t" = "x" ] ; then wi_cv_listen_backlog_t="int" fi if [ "x$wi_cv_alarm_time_t" = "x" ] ; then wi_cv_alarm_time_t="int" fi if [ "x$wi_cv_gethost_addrptr_t" = "x" ] ; then wi_cv_gethost_addrptr_t="struct in_addr *" fi if [ "$wi_cv_gethost_addrptr_t" = "const void" ] ; then wi_cv_gethost_addrptr_t="const struct in_addr *" fi if [ "x$wi_cv_gethostname_size_t" = "x" ] ; then wi_cv_gethostname_size_t="int" fi changequote([, ])dnl ]) ]) if test "x$used_cache_for_wi_unistd_fpt" = "xno" ; then AC_MSG_CHECKING([for size parameter to write]) AC_MSG_RESULT([$wi_cv_write_size_t]) AC_MSG_CHECKING([for return type from send]) AC_MSG_RESULT([$wi_cv_send_return_t]) AC_MSG_CHECKING([for size parameter to send]) AC_MSG_RESULT([$wi_cv_send_size_t]) AC_MSG_CHECKING([for size parameter to connect]) AC_MSG_RESULT([$wi_cv_sockaddr_size_t]) AC_MSG_CHECKING([for size parameter to setsockopt]) AC_MSG_RESULT([$wi_cv_sockopt_size_t]) AC_MSG_CHECKING([for backlog parameter to listen]) AC_MSG_RESULT([$wi_cv_listen_backlog_t]) AC_MSG_CHECKING([for seconds parameter to alarm]) AC_MSG_RESULT([$wi_cv_alarm_time_t]) AC_MSG_CHECKING([for address parameter to gethostbyaddr]) AC_MSG_RESULT([$wi_cv_gethost_addrptr_t]) AC_MSG_CHECKING([for size parameter to gethostname]) AC_MSG_RESULT([$wi_cv_gethostname_size_t]) else AC_CACHE_CHECK([for size parameter to write],[wi_cv_write_size_t],[:]) AC_CACHE_CHECK([for return type from send],[wi_cv_send_return_t],[:]) AC_CACHE_CHECK([for size parameter to send],[wi_cv_send_size_t],[:]) AC_CACHE_CHECK([for size parameter to connect],[wi_cv_sockaddr_size_t],[:]) AC_CACHE_CHECK([for size parameter to setsockopt],[wi_cv_sockopt_size_t],[:]) AC_CACHE_CHECK([for backlog parameter to listen],[wi_cv_listen_backlog_t],[:]) AC_CACHE_CHECK([for seconds parameter to alarm],[wi_cv_alarm_time_t],[:]) AC_CACHE_CHECK([for address parameter to gethostbyaddr],[wi_cv_gethost_addrptr_t],[:]) AC_CACHE_CHECK([for size parameter to gethostname],[wi_cv_gethostname_size_t],[:]) fi unset used_cache_for_wi_unistd_fpt AC_DEFINE_UNQUOTED(write_return_t, $wi_cv_write_return_t) AC_DEFINE_UNQUOTED(write_size_t, $wi_cv_write_size_t) AC_DEFINE_UNQUOTED(read_return_t, $wi_cv_write_return_t) AC_DEFINE_UNQUOTED(read_size_t, $wi_cv_write_size_t) AC_DEFINE_UNQUOTED(send_return_t, $wi_cv_send_return_t) AC_DEFINE_UNQUOTED(send_size_t, $wi_cv_send_size_t) AC_DEFINE_UNQUOTED(recv_return_t, $wi_cv_send_return_t) AC_DEFINE_UNQUOTED(recv_size_t, $wi_cv_send_size_t) AC_DEFINE_UNQUOTED(sockaddr_size_t, $wi_cv_sockaddr_size_t) AC_DEFINE_UNQUOTED(sockopt_size_t, $wi_cv_sockopt_size_t) AC_DEFINE_UNQUOTED(listen_backlog_t, $wi_cv_listen_backlog_t) AC_DEFINE_UNQUOTED(alarm_time_t, $wi_cv_alarm_time_t) AC_DEFINE_UNQUOTED(gethost_addrptr_t, $wi_cv_gethost_addrptr_t) AC_DEFINE_UNQUOTED(gethostname_size_t, $wi_cv_gethostname_size_t) ]) dnl dnl dnl dnl AC_DEFUN(wi_PATH_GNU_TAR_OR_TAR, [ AC_PATH_PROG(TAR, "gtar", "") if test "x$TAR" = "x" ; then unset TAR unset ac_cv_path_TAR AC_PATH_PROG(TAR, "tar", "") fi ]) dnl dnl dnl dnl AC_DEFUN(wi_PROG_TAR, [ AC_REQUIRE([wi_PATH_GNU_TAR_OR_TAR]) if test "x$TAR" != "x" ; then AC_DEFINE_UNQUOTED(TAR, "$TAR") fi AC_SUBST(TAR) ]) dnl dnl dnl dnl AC_DEFUN(wi_CREATE_TAR_FILES, [ AC_REQUIRE([wi_PATH_GNU_TAR_OR_TAR]) AC_MSG_CHECKING([how to create TAR files]) changequote(<<, >>)dnl x="" if [ -x /usr/bin/what ] ; then x=`/usr/bin/what "$TAR" 2>&1 | sed -n 's/.*pax.*/pax/g;/pax/p'` elif [ -x /bin/what ] ; then x=`/bin/what "$TAR" 2>&1 | sed -n 's/.*pax.*/pax/g;/pax/p'` fi if [ "x$x" != "xpax" ] ; then # The junk above is because Mac OS X Server's tar freaks out # and does not exit if you do "tar --help". # x=`"$TAR" --help 2>&1 | sed -n 's/.*owner=NAME.*/owner=NAME/g;/owner=NAME/p'` fi TARFLAGS="cvf" case "$x" in *owner=NAME*) case "$OS" in cygwin*) ;; macosx*) TARFLAGS="-c --owner=root --group=wheel --verbose -f" ;; *) if grep '^root:' /etc/group >/dev/null 2>&1 ; then TARFLAGS="-c --owner=root --group=root --verbose -f" elif grep '^wheel:' /etc/group >/dev/null 2>&1 ; then TARFLAGS="-c --owner=root --group=wheel --verbose -f" fi ;; esac ;; esac changequote([, ])dnl AC_SUBST(TARFLAGS) AC_MSG_RESULT([$TAR $TARFLAGS]) ]) dnl dnl dnl dnl AC_DEFUN(wi_PROG_CCDV_NO_CREATE, [ if test "x$use_ccdv" = "xno" ; then AC_MSG_CHECKING([for ccdv]) AC_MSG_RESULT([(disabled)]) else AC_PATH_PROG(CCDV, "CCDV", "") CCDV="$wi_cv_path_ccdv" if test "x$CCDV" != x ; then CCDV="@$CCDV " # trailing space needed fi AC_SUBST(CCDV) fi ]) dnl dnl dnl dnl AC_DEFUN(wi_PROG_CCDV, [ if test "x$use_ccdv" = "xno" ; then AC_MSG_CHECKING([for ccdv]) AC_MSG_RESULT([(disabled)]) else unset wi_cv_path_ccdv # can't use cache if it was a temp prog last time wi_used_cache_path_ccdv="yes" AC_CACHE_CHECK([for ccdv], [wi_cv_path_ccdv], [ wi_used_cache_path_ccdv="no" for CCDV in /usr/bin/ccdv /usr/local/bin/ccdv /usr/ccs/bin/ccdv NONE do if test "$CCDV" = NONE ; then CCDV="" ; break ; fi $CCDV >/dev/null 2>&1 if test $? -eq 96 ; then break fi done if test "x$CCDV" = "x" ; then changequote({{, }})dnl cat > ccdv.c << 'EOF' /* ccdv.c * * Copyright (C) 2002-2003, by Mike Gleason, NcFTP Software. * All Rights Reserved. * * Licensed under the GNU Public License. */ #include #include #include #include #include #include #include #include #include #define SETCOLOR_SUCCESS (gANSIEscapes ? "\033\1331;32m" : "") #define SETCOLOR_FAILURE (gANSIEscapes ? "\033\1331;31m" : "") #define SETCOLOR_WARNING (gANSIEscapes ? "\033\1331;33m" : "") #define SETCOLOR_NORMAL (gANSIEscapes ? "\033\1330;39m" : "") #define TEXT_BLOCK_SIZE 8192 #define INDENT 2 #define TERMS "vt100:vt102:vt220:vt320:xterm:xterm-color:xterm-256color:ansi:linux:scoterm:scoansi:dtterm:cons25:cygwin:screen" size_t gNBufUsed = 0, gNBufAllocated = 0; char *gBuf = NULL; int gCCPID; char gAction[64] = ""; char gTarget[64] = ""; char gAr[32] = ""; char gArLibraryTarget[64] = ""; int gDumpCmdArgs = 0; char gArgsStr[800]; int gColumns = 80; int gANSIEscapes = 0; int gExitStatus = 95; static void DumpFormattedOutput(void) { char *cp; char spaces[8 + 1] = " "; char *saved; int curcol; int i; curcol = 0; saved = NULL; for (cp = gBuf + ((gDumpCmdArgs == 0) ? strlen(gArgsStr) : 0); ; cp++) { if (*cp == '\0') { if (saved != NULL) { cp = saved; saved = NULL; } else break; } if (*cp == '\r') continue; if (*cp == '\t') { saved = cp + 1; cp = spaces + 8 - (8 - ((curcol - INDENT - 1) % 8)); } if (curcol == 0) { for (i = INDENT; --i >= 0; ) putchar(' '); curcol = INDENT; } putchar(*cp); if (++curcol == (gColumns - 1)) { putchar('\n'); curcol = 0; } else if (*cp == '\n') curcol = 0; } free(gBuf); } /* DumpFormattedOutput */ /* Difftime(), only for timeval structures. */ static void TimeValSubtract(struct timeval *tdiff, struct timeval *t1, struct timeval *t0) { tdiff->tv_sec = t1->tv_sec - t0->tv_sec; tdiff->tv_usec = t1->tv_usec - t0->tv_usec; if (tdiff->tv_usec < 0) { tdiff->tv_sec--; tdiff->tv_usec += 1000000; } } /* TimeValSubtract */ static void Wait(void) { int pid2, status; do { status = 0; pid2 = (int) waitpid(gCCPID, &status, 0); } while (((pid2 >= 0) && (! WIFEXITED(status))) || ((pid2 < 0) && (errno == EINTR))); if (WIFEXITED(status)) gExitStatus = WEXITSTATUS(status); } /* Wait */ static int SlurpProgress(int fd) { char s1[71]; char *newbuf; int nready; size_t ntoread; ssize_t nread; struct timeval now, tnext, tleft; fd_set ss; fd_set ss2; const char *trail = "/-\\|", *trailcp; trailcp = trail; snprintf(s1, sizeof(s1), "%s%s%s... ", gAction, gTarget[0] ? " " : "", gTarget); printf("\r%-70s%-9s", s1, ""); fflush(stdout); gettimeofday(&now, NULL); tnext = now; tnext.tv_sec++; tleft.tv_sec = 1; tleft.tv_usec = 0; FD_ZERO(&ss2); FD_SET(fd, &ss2); for(;;) { if (gNBufUsed == (gNBufAllocated - 1)) { if ((newbuf = (char *) realloc(gBuf, gNBufAllocated + TEXT_BLOCK_SIZE)) == NULL) { perror("ccdv: realloc"); return (-1); } gNBufAllocated += TEXT_BLOCK_SIZE; gBuf = newbuf; } for (;;) { ss = ss2; nready = select(fd + 1, &ss, NULL, NULL, &tleft); if (nready == 1) break; if (nready < 0) { if (errno != EINTR) { perror("ccdv: select"); return (-1); } continue; } gettimeofday(&now, NULL); if ((now.tv_sec > tnext.tv_sec) || ((now.tv_sec == tnext.tv_sec) && (now.tv_usec >= tnext.tv_usec))) { tnext = now; tnext.tv_sec++; tleft.tv_sec = 1; tleft.tv_usec = 0; printf("\r%-71s%c%-7s", s1, *trailcp, ""); fflush(stdout); if (*++trailcp == '\0') trailcp = trail; } else { TimeValSubtract(&tleft, &tnext, &now); } } ntoread = (gNBufAllocated - gNBufUsed - 1); nread = read(fd, gBuf + gNBufUsed, ntoread); if (nread < 0) { if (errno == EINTR) continue; perror("ccdv: read"); return (-1); } else if (nread == 0) { break; } gNBufUsed += nread; gBuf[gNBufUsed] = '\0'; } snprintf(s1, sizeof(s1), "%s%s%s: ", gAction, gTarget[0] ? " " : "", gTarget); Wait(); if (gExitStatus == 0) { printf("\r%-70s", s1); printf("[%s%s%s]", ((gNBufUsed - strlen(gArgsStr)) < 4) ? SETCOLOR_SUCCESS : SETCOLOR_WARNING, "OK", SETCOLOR_NORMAL); printf("%-5s\n", " "); } else { printf("\r%-70s", s1); printf("[%s%s%s]", SETCOLOR_FAILURE, "ERROR", SETCOLOR_NORMAL); printf("%-2s\n", " "); gDumpCmdArgs = 1; /* print cmd when there are errors */ } fflush(stdout); return (0); } /* SlurpProgress */ static int SlurpAll(int fd) { char *newbuf; size_t ntoread; ssize_t nread; printf("%s%s%s.\n", gAction, gTarget[0] ? " " : "", gTarget); fflush(stdout); for(;;) { if (gNBufUsed == (gNBufAllocated - 1)) { if ((newbuf = (char *) realloc(gBuf, gNBufAllocated + TEXT_BLOCK_SIZE)) == NULL) { perror("ccdv: realloc"); return (-1); } gNBufAllocated += TEXT_BLOCK_SIZE; gBuf = newbuf; } ntoread = (gNBufAllocated - gNBufUsed - 1); nread = read(fd, gBuf + gNBufUsed, ntoread); if (nread < 0) { if (errno == EINTR) continue; perror("ccdv: read"); return (-1); } else if (nread == 0) { break; } gNBufUsed += nread; gBuf[gNBufUsed] = '\0'; } Wait(); gDumpCmdArgs = (gExitStatus != 0); /* print cmd when there are errors */ return (0); } /* SlurpAll */ static const char * Basename(const char *path) { const char *cp; cp = strrchr(path, '/'); if (cp == NULL) return (path); return (cp + 1); } /* Basename */ static const char * Extension(const char *path) { const char *cp = path; cp = strrchr(path, '.'); if (cp == NULL) return (""); return (cp); } /* Extension */ static void Usage(void) { fprintf(stderr, "Usage: ccdv /path/to/cc CFLAGS...\n\n"); fprintf(stderr, "I wrote this to reduce the deluge Make output to make finding actual problems\n"); fprintf(stderr, "easier. It is intended to be invoked from Makefiles, like this. Instead of:\n\n"); fprintf(stderr, "\t.c.o:\n"); fprintf(stderr, "\t\t$(CC) $(CFLAGS) $(DEFS) $(CPPFLAGS) $< -c\n"); fprintf(stderr, "\nRewrite your rule so it looks like:\n\n"); fprintf(stderr, "\t.c.o:\n"); fprintf(stderr, "\t\t@ccdv $(CC) $(CFLAGS) $(DEFS) $(CPPFLAGS) $< -c\n\n"); fprintf(stderr, "ccdv 1.1.0 is Free under the GNU Public License. Enjoy!\n"); fprintf(stderr, " -- Mike Gleason, NcFTP Software \n"); exit(96); } /* Usage */ int main(int argc, char **argv) { int pipe1[2]; int devnull; char emerg[256]; int fd; int nread; int i; int cc = 0, pch = 0; const char *quote; if (argc < 2) Usage(); snprintf(gAction, sizeof(gAction), "Running %s", Basename(argv[1])); memset(gArgsStr, 0, sizeof(gArgsStr)); for (i = 1; i < argc; i++) { quote = (strchr(argv[i], ' ') != NULL) ? "\"" : ""; snprintf(gArgsStr + strlen(gArgsStr), sizeof(gArgsStr) - strlen(gArgsStr), "%s%s%s%s%s", (i == 1) ? "" : " ", quote, argv[i], quote, (i == (argc - 1)) ? "\n" : ""); if ((strcmp(argv[i], "-o") == 0) && ((i + 1) < argc)) { if (strcasecmp(Extension(argv[i + 1]), ".o") != 0) { strcpy(gAction, "Linking"); snprintf(gTarget, sizeof(gTarget), "%s", Basename(argv[i + 1])); } } else if (strchr("-+/", (int) argv[i][0]) != NULL) { continue; } else if (strncasecmp(Extension(argv[i]), ".c", 2) == 0) { cc++; snprintf(gTarget, sizeof(gTarget), "%s", Basename(argv[i])); } else if ((strncasecmp(Extension(argv[i]), ".h", 2) == 0) && (cc == 0)) { pch++; snprintf(gTarget, sizeof(gTarget), "%s", Basename(argv[i])); } else if ((i == 1) && (strcmp(Basename(argv[i]), "ar") == 0)) { snprintf(gAr, sizeof(gAr), "%s", Basename(argv[i])); } else if ((gArLibraryTarget[0] == '\0') && (strcasecmp(Extension(argv[i]), ".a") == 0)) { snprintf(gArLibraryTarget, sizeof(gArLibraryTarget), "%s", Basename(argv[i])); } } if ((gAr[0] != '\0') && (gArLibraryTarget[0] != '\0')) { strcpy(gAction, "Creating library"); snprintf(gTarget, sizeof(gTarget), "%s", gArLibraryTarget); } else if (pch > 0) { strcpy(gAction, "Precompiling"); } else if (cc > 0) { strcpy(gAction, "Compiling"); } if (pipe(pipe1) < 0) { perror("ccdv: pipe"); exit(97); } (void) close(0); devnull = open("/dev/null", O_RDWR, 00666); if ((devnull != 0) && (dup2(devnull, 0) == 0)) close(devnull); gCCPID = (int) fork(); if (gCCPID < 0) { (void) close(pipe1[0]); (void) close(pipe1[1]); perror("ccdv: fork"); exit(98); } else if (gCCPID == 0) { /* Child */ (void) close(pipe1[0]); /* close read end */ if (pipe1[1] != 1) { /* use write end on stdout */ (void) dup2(pipe1[1], 1); (void) close(pipe1[1]); } (void) dup2(1, 2); /* use write end on stderr */ execvp(argv[1], argv + 1); perror(argv[1]); exit(99); } /* parent */ (void) close(pipe1[1]); /* close write end */ fd = pipe1[0]; /* use read end */ gColumns = (getenv("COLUMNS") != NULL) ? atoi(getenv("COLUMNS")) : 80; gANSIEscapes = (getenv("TERM") != NULL) && (strstr(TERMS, getenv("TERM")) != NULL); gBuf = (char *) malloc(TEXT_BLOCK_SIZE); if (gBuf == NULL) goto panic; gNBufUsed = 0; gNBufAllocated = TEXT_BLOCK_SIZE; if (strlen(gArgsStr) < (gNBufAllocated - 1)) { strcpy(gBuf, gArgsStr); gNBufUsed = strlen(gArgsStr); } if (isatty(1)) { if (SlurpProgress(fd) < 0) goto panic; } else { if (SlurpAll(fd) < 0) goto panic; } DumpFormattedOutput(); exit(gExitStatus); panic: gDumpCmdArgs = 1; /* print cmd when there are errors */ DumpFormattedOutput(); while ((nread = read(fd, emerg, (size_t) sizeof(emerg))) > 0) (void) write(2, emerg, (size_t) nread); Wait(); exit(gExitStatus); } /* main */ /* eof ccdv.c */ EOF changequote([, ])dnl ${CC-cc} $DEFS $CPPFLAGS $CFLAGS "ccdv.c" -o "ccdv" >/dev/null 2>&1 rm -f ccdv.c ccdv.o ccdv.c.gz.uu ccdv.c.gz strip ./ccdv >/dev/null 2>&1 ./ccdv >/dev/null 2>&1 if test $? -eq 96 ; then CCDV="./ccdv" else rm -f ccdv fi fi if test "x$CCDV" != x ; then wi_RESOLVE_PATH([$CCDV], [CCDV]) wi_cv_path_ccdv="$CCDV" CCDV="@$CCDV " # trailing space needed else wi_cv_path_ccdv="" fi ]) if test "$wi_used_cache_path_ccdv" = yes ; then CCDV="$wi_cv_path_ccdv" if test "x$CCDV" != x ; then CCDV="@$CCDV " # trailing space needed fi fi AC_SUBST(CCDV) fi ]) dnl dnl dnl dnl AC_DEFUN(wi_HEADER_CURSES, [ AC_MSG_CHECKING([for curses library headers]) if test "$wi_cv_ncurses" != "no" ; then AC_CHECK_HEADERS(ncurses.h curses.h termios.h termio.h sgtty.h sys/ioctl.h) else AC_CHECK_HEADERS(curses.h termios.h termio.h sgtty.h sys/ioctl.h) fi dnl needed for Solaris 7 if test "$ac_cv_header_curses_h" = no ; then if test -f /usr/include/curses.h ; then AC_DEFINE(HAVE_CURSES_H) ac_cv_header_curses_h=yes fi fi ]) dnl dnl dnl dnl AC_DEFUN(wi_LIB_CURSES, [ wi_HEADER_CURSES AC_MSG_CHECKING([for curses library]) wi_cv_lib_curses=no wi_cv_lib_curses_result=no ac_save_LIBS="$LIBS" for LIBCURSES in "-lncurses" "-lcurses" "-lcurses -ltermcap" "-ltermcap -lcurses" do if test "x$LIBCURSES-$wi_cv_ncurses" = "x-lncurses-no" ; then # This should never work LIBCURSES="-lkdfjkdjfs" fi LIBS="$ac_save_LIBS $LIBCURSES" AC_TRY_LINK([ /* includes */ #include #include #ifdef HAVE_NCURSES_H # define NCURSES_OPAQUE 0 # include #else # include #endif ],[ /* function body */ if (strcmp("jimmy", "floyd") == 0) initscr(); exit(0); ],[ linked_with_LIBCURSES=yes ],[ linked_with_LIBCURSES=no ]) if test "x$linked_with_LIBCURSES" != "xyes" ; then continue ; fi AC_TRY_RUN([ /* program */ #include #include #ifdef HAVE_NCURSES_H # define NCURSES_OPAQUE 0 # include #else # include #endif main(int argc, char **argv) { /* Note: don't actually call curses, since it may block; * We just want to see if it (dynamic) linked in okay. */ if (argc == 0) initscr(); exit(0); } ],[ # action if true wi_cv_lib_curses=yes guess="" wi_cv_lib_curses_result="yes" ],[ # action if false wi_cv_lib_curses=no guess="" ],[ # action if cross compiling wi_cv_lib_curses=yes wi_cv_lib_curses_result="yes" guess="(guessing) " ]) if test "$wi_cv_lib_curses" = yes ; then break ; fi done # restore LIBS LIBS="$ac_save_LIBS" if test "$wi_cv_lib_curses_result" != "no" ; then case "$LIBCURSES" in "-lncurses") AC_DEFINE(HAVE_LIBNCURSES) ;; "-lcurses") AC_DEFINE(HAVE_LIBCURSES) ;; "-lcurses -ltermcap") AC_DEFINE(HAVE_LIBCURSES) ;; "-ltermcap -lcurses") AC_DEFINE(HAVE_LIBCURSES) ;; esac else LIBCURSES='' fi AC_SUBST(LIBCURSES) AC_MSG_RESULT([$wi_cv_lib_curses_result]) ]) dnl dnl dnl dnl AC_DEFUN(wi_CURSES_FUNC_PARAM_TYPES, [ AC_REQUIRE([AC_PROG_CPP]) AC_REQUIRE([wi_PATH_PERL]) AC_REQUIRE([wi_PATH_MKTEMP]) wi_PREREQ_UNISTD_H([$0]) AC_CACHE_CHECK([string parameter to waddstr], [wi_cv_waddstr_str_t], [ used_cache_for_wi_curses_fpt="no" wi_CREATE_AC_TMPDIR([ wi_CREATE_PRPP_SCRIPT([$wi_tmpdir/prpp.pl]) changequote({{, }})dnl cat << 'EOF' > "$wi_tmpdir/curses.c" #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) # define _ALL_SOURCE 1 #endif #include #ifdef HAVE_UNISTD_H # include #endif #include #include #include #include #ifdef HAVE_NCURSES_H # define NCURSES_OPAQUE 0 # include #else # include #endif main() { exit(0); } EOF cat << 'EOF' > "$wi_tmpdir/sed2.sh" #!/bin/sh if [ {{$}}# -eq 0 ] ; then exit 1 ; fi x="{{$}}1" sed -n 's/extern//;s/static//; /[\ \*]'"$x"'\ *(/{ s/^.*'"$x"'\ *(/(/ s/)\ *[;,].*$/)/ /const char/{ c\ const char * } /char/{ c\ char * } /const/{ c\ const void } q }' EOF chmod 755 "$wi_tmpdir/sed2.sh" $CPP "-I${srcdir-.}" "$wi_tmpdir/curses.c" > "$wi_tmpdir/curses.i" if [ -s "$wi_tmpdir/curses.i" ] ; then "$PERL" "$wi_tmpdir/prpp.pl" < "$wi_tmpdir/curses.i" > "$wi_tmpdir/protos.h" fi if [ -f "$wi_tmpdir/protos.h" ] ; then # # Check what type waddstr() expects for the string parameter # x="waddstr" wi_cv_waddstr_str_t=`/bin/sh "$wi_tmpdir/sed2.sh" "$x" < "$wi_tmpdir/protos.h"` fi if [ "x$wi_cv_waddstr_str_t" = "x" ] ; then wi_cv_waddstr_str_t="const char *" fi changequote([, ])dnl ]) ]) dnl if test "x$used_cache_for_wi_curses_fpt" = "xno" ; then dnl AC_MSG_CHECKING([string parameter to waddstr]) dnl AC_MSG_RESULT([$wi_cv_waddstr_str_t]) dnl else dnl AC_CACHE_CHECK([string parameter to waddstr],[wi_cv_waddstr_str_t],[:]) dnl fi unset used_cache_for_wi_curses_fpt AC_DEFINE_UNQUOTED(waddstr_str_t, $wi_cv_waddstr_str_t) if test "$wi_cv_waddstr_str_t" = "const char *" ; then AC_DEFINE(WADDSTR_TYPE_ARG1_CONST) fi ]) dnl dnl dnl dnl AC_DEFUN(wi_CURSES_FEATURES, [ if test "$wi_cv_lib_curses" = "yes" ; then wi_PREREQ_UNISTD_H([$0]) # Then $LIBCURSES is a list of curses and support libraries. ac_save_LIBS="$LIBS"; LIBS="$LIBS $LIBCURSES"; wi_CURSES_FUNC_PARAM_TYPES # maxx or _maxx AC_MSG_CHECKING([whether curses structure has maxx or _maxx field]) AC_TRY_COMPILE([ /* includes */ #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) # define _ALL_SOURCE 1 #endif #ifdef HAVE_UNISTD_H # include #endif #include #include #include #include #ifdef HAVE_NCURSES_H # define NCURSES_OPAQUE 0 # include #else # include #endif ],[ WINDOW *w; w = newwin(10, 10, 1, 1); w->maxx = 0; ],[ AC_MSG_RESULT([maxx]) ],[ AC_DEFINE(HAVE__MAXX) AC_MSG_RESULT([_maxx]) ]) if test "${SYS-hpux}" = hpux ; then AC_CHECK_FUNCS(__getcurx __getcury __getmaxx __getmaxy __getbegx __getbegy) fi # getcurx AC_MSG_CHECKING([for getcurx() functionality in curses library]) AC_TRY_LINK([ /* includes */ #ifdef HAVE_UNISTD_H # include #endif #include #include #include #include #ifdef HAVE_NCURSES_H # define NCURSES_OPAQUE 0 # include #else # include #endif ],[ /* function-body */ WINDOW *junk = 0; int mx = 0; mx = getcurx(junk); exit(0); ],[ AC_DEFINE(HAVE_GETCURX) AC_MSG_RESULT([yes]) ],[ AC_MSG_RESULT([no]) ]) # getyx AC_MSG_CHECKING([for getyx() functionality in curses library]) AC_TRY_LINK([ /* includes */ #ifdef HAVE_UNISTD_H # include #endif #include #include #include #include #ifdef HAVE_NCURSES_H # define NCURSES_OPAQUE 0 # include #else # include #endif ],[ /* function-body */ WINDOW *junk = 0; int mx = 0, my = 0; getyx(junk, my, mx); exit(0); ],[ AC_DEFINE(HAVE_GETYX) AC_MSG_RESULT([yes]) ],[ AC_MSG_RESULT([no]) ]) # getmaxx AC_MSG_CHECKING([for getmaxx() functionality in curses library]) AC_TRY_LINK([ /* includes */ #ifdef HAVE_UNISTD_H # include #endif #include #include #include #include #ifdef HAVE_NCURSES_H # define NCURSES_OPAQUE 0 # include #else # include #endif ],[ /* function-body */ WINDOW *junk = 0; int mx = 0; mx = getmaxx(junk); exit(0); ],[ AC_DEFINE(HAVE_GETMAXX) AC_MSG_RESULT([yes]) ],[ AC_MSG_RESULT([no]) ]) # getmaxyx AC_MSG_CHECKING([for getmaxyx() functionality in curses library]) AC_TRY_LINK([ /* includes */ #ifdef HAVE_UNISTD_H # include #endif #include #include #include #include #ifdef HAVE_NCURSES_H # define NCURSES_OPAQUE 0 # include #else # include #endif ],[ /* function-body */ WINDOW *junk = 0; int mx = 0, my = 0; getmaxyx(junk, my, mx); exit(my < 0 ? my : 0); ],[ AC_DEFINE(HAVE_GETMAXYX) AC_MSG_RESULT([yes]) ],[ AC_MSG_RESULT([no]) ]) # getbegx AC_MSG_CHECKING([for getbegx() functionality in curses library]) AC_TRY_LINK([ /* includes */ #ifdef HAVE_UNISTD_H # include #endif #include #include #include #include #ifdef HAVE_NCURSES_H # define NCURSES_OPAQUE 0 # include #else # include #endif ],[ /* function-body */ WINDOW *junk = 0; int mx = 0; mx = getbegx(junk); exit(0); ],[ AC_DEFINE(HAVE_GETBEGX) AC_MSG_RESULT([yes]) ],[ AC_MSG_RESULT([no]) ]) # getbegyx AC_MSG_CHECKING([for getbegyx() functionality in curses library]) AC_TRY_LINK([ /* includes */ #ifdef HAVE_UNISTD_H # include #endif #include #include #include #include #ifdef HAVE_NCURSES_H # define NCURSES_OPAQUE 0 # include #else # include #endif ],[ /* function-body */ WINDOW *junk = 0; int mx = 0, my = 0; getbegyx(junk, my, mx); exit(my < 0 ? my : 0); ],[ AC_DEFINE(HAVE_GETBEGYX) AC_MSG_RESULT([yes]) ],[ AC_MSG_RESULT([no]) ]) # touchwin AC_MSG_CHECKING([for touchwin() functionality in curses library]) AC_TRY_LINK([ /* includes */ #ifdef HAVE_UNISTD_H # include #endif #include #include #include #include #ifdef HAVE_NCURSES_H # define NCURSES_OPAQUE 0 # include #else # include #endif ],[ /* function-body */ WINDOW *junk = 0; touchwin(junk); exit(0); ],[ AC_DEFINE(HAVE_TOUCHWIN) AC_MSG_RESULT([yes]) ],[ AC_MSG_RESULT([no]) ]) # beep AC_MSG_CHECKING([for beep() functionality in curses library]) AC_TRY_LINK([ /* includes */ #ifdef HAVE_UNISTD_H # include #endif #include #include #include #include #ifdef HAVE_NCURSES_H # define NCURSES_OPAQUE 0 # include #else # include #endif ],[ /* function-body */ beep(); exit(getpid() & 1); ],[ AC_DEFINE(HAVE_BEEP) AC_MSG_RESULT([yes]) ],[ AC_MSG_RESULT([no]) ]) AC_CHECK_FUNCS(keypad nodelay curs_set doupdate wnoutrefresh) LIBS="$ac_save_LIBS"; fi ]) dnl dnl dnl AC_DEFUN(wi_SHADOW_FUNCS, [ AC_CHECK_FUNCS(md5_crypt md5crypt bcrypt getspnam crypt_set_format) if test "$ac_cv_func_getspnam" = no ; then unset ac_cv_func_getspnam AC_CHECK_LIB(gen,getspnam) if test "$ac_cv_lib_gen_getspnam" = yes ; then AC_CHECK_FUNCS(getspnam) fi elif test "$ac_cv_func_getspnam" = yes ; then # Special hack to be sure UnixWare 7.1 uses -lgen for getspnam. # The reason we do this is so that the binary can be used on # SCO 5.0.6 with the UDK compatibility libraries installed, # For some reason, on UW7.1 getspnam is in the standard library and # libgen, but on SCO/UDK it is only in libgen. # case "$OS" in unixware2*) ;; unixware*) AC_CHECK_LIB(gen,getspnam) ;; esac fi # AIX # case "$SYS" in "aix"|"") AC_CHECK_FUNCS(getuserpw) ;; *) ;; esac # C2: SCO Open Server 5; Digital UNIX AC_CHECK_FUNCS(set_auth_parameters bigcrypt) # C2: Digital UNIX 3.2, 4.0; SCO Open Server 5; HP-UX 11 AC_CHECK_FUNCS(getprpwnam) # Digital UNIX 4.0 AC_CHECK_FUNCS(getespwnam get_num_crypts get_crypt_name) # Digital Unix 4.0 AC_CHECK_FUNCS(dispcrypt) # SunOS AC_CHECK_FUNCS(getpwanam) ]) dnl dnl dnl AC_DEFUN(wi_SHADOW_HEADERS, [ AC_CHECK_HEADERS(shadow.h crypt.h) # AIX AC_CHECK_HEADERS(userpw.h) # SunOS AC_CHECK_HEADERS(pwdadj.h) # HP-UX # # Bug in header on these version 10 which cause is it not # to get detected. # wi_HEADER_HPSECURITY_H # SCO Open Server, Digital UNIX AC_CHECK_HEADERS(sys/security.h sys/audit.h krb.h prot.h) # Digital UNIX AC_CHECK_HEADERS(sys/secdefines.h) # Digital UNIX wi_PR_PASSWD_FG_OLDCRYPT ]) dnl dnl dnl AC_DEFUN(wi_SHADOW_LIBS, [ check_for_libcrypt=yes # AIX security library is libs.a AC_CHECK_LIB(s,getuserpw) if test "$ac_cv_lib_s" = yes ; then check_for_libcrypt=no elif test "$ac_cv_lib_s_getuserpw" = yes ; then check_for_libcrypt=no fi # SCO OpenServer 5 stuff for shadow password AC_CHECK_LIB(x,nap) AC_CHECK_LIB(prot,getprpwnam) # Digital UNIX AC_CHECK_LIB(security,endprpwent) # HP-UX AC_CHECK_LIB(sec,getprpwnam) if test "$ac_cv_lib_sec_getprpwnam" = no ; then # DYNIX/ptx AC_CHECK_LIB(sec,getspnam) fi if test "$check_for_libcrypt" = yes ; then wi_LIB_CRYPT fi AC_CHECK_FUNCS(crypt) ]) dnl dnl dnl AC_DEFUN(wi_OS_VAR, [ # # Take note if the user is or is not exporting a CFLAGS env var. # wi_orig_CFLAGS="$CFLAGS" wi_CFLAGS_TO_ADD_LATER="" changequote(!@, @!)dnl if [ -x "$HOME/bin/OS" ] ; then HOME_OS=`$HOME/bin/OS 2>/dev/null` HOME_OS="$HOME/$HOME_OS" else HOME_OS="$HOME" fi host=`uname -n 2>/dev/null | tr '[A-Z]' '[a-z]'` os=`uname -s 2>/dev/null | tr '[A-Z]' '[a-z]'` if [ "$os" = "TvoPT" ] ; then os="sunos" ; fi dnl work around inability to use $1 os_v=`uname -v 2>/dev/null | sed 's/^[^0-9.]*//;s/[^0-9.].*$//;'` os_r=`uname -r 2>/dev/null | sed 's/^[^0-9.]*//;s/[^0-9.].*$//;'` os_r1=`echo "${os_r}" | cut -c1` arch=`uname -m 2>/dev/null | tr '[A-Z]' '[a-z]'` archp=`uname -p 2>/dev/null | tr '[A-Z]' '[a-z]'` OS='' SYS='' NDEFS='' unset CDPATH # Not relevant here, but needs to be done eventually. # Special case a few systems where if your CFLAGS appear # to want to generate for 32 bit, use that mode rather # than 64 bit. # case "$os,$CFLAGS" in irix64,*-n32*) os=irix # then go to regular "irix" instead of "irix64" below. ;; esac case "$os" in osf1) case "$os_r" in 3*|4*) OS="digitalunix${os_r}-$arch" SYS=digitalunix NDEFS="$NDEFS -DDIGITAL_UNIX=$os_r1" ;; *) OS="tru64unix${os_r}-$arch" SYS=tru64unix NDEFS="$NDEFS -DTRU64UNIX=$os_r1" ;; esac ;; aix) os_lev=`/usr/bin/oslevel 2>/dev/null` if [ "$os_lev" = "" ] ; then if [ "$os_r" = "" ] ; then os_r=0 ; fi OS="aix${os_v}.${os_r}" os_int=`expr $os_v$os_r '*' 10` else os_v=`echo "$os_lev" | cut -d. -f1-3` os_v1=`echo "$os_v" | cut -d. -f1` os_v2=`echo "$os_v" | cut -d. -f2` if [ "$os_v2" = "" ] ; then os_v2=0 ; fi os_v3=`echo "$os_v" | cut -d. -f3` if [ "$os_v3" = "" ] ; then os_v3=0 ; fi os_int=`expr "$os_v1" '*' 100 + "$os_v2" '*' 10 + "$os_v3"` OS="aix${os_v}" fi SYS=aix NDEFS="$NDEFS -DAIX=${os_int}" ;; irix) OS="irix${os_r}" SYS=irix NDEFS="$NDEFS -DIRIX=$os_r1" ;; irix64) OS="irix64_${os_r}" SYS=irix64 NDEFS="$NDEFS -DIRIX=$os_r1 -DIRIX64=$os_r1" ;; hp-ux) os_r=`echo "${os_r}" | cut -d. -f2-` os_r1=`echo "$os_r" | cut -d. -f1` os_r2=`echo "${os_r}" | cut -d. -f2` os_int=`expr "$os_r1" '*' 100 + "$os_r2"` if [ "$arch" != "ia64" ] ; then arch="hppa" fi OS="hpux${os_r}-$arch" SYS=hpux NDEFS="$NDEFS -DHPUX=$os_int" ;; freebsd) if [ "$arch" = "amd64" ] ; then arch="x86_64" ; fi OS="freebsd${os_r}-$arch" os_r1=`echo "$os_r" | cut -d. -f1` os_r2=`echo "$os_r" | cut -d. -f2` if [ "$os_r2" = "" ] ; then os_r2=0 ; fi os_r3=`echo "$os_r" | cut -d. -f3` if [ "$os_r3" = "" ] ; then os_r3=0 ; fi os_int=`expr "$os_r1" '*' 100 + "$os_r2" '*' 10 + "$os_r3"` SYS=freebsd NDEFS="$NDEFS -DFREEBSD=$os_int" ;; netbsd) if [ "$arch" = "amd64" ] ; then arch="x86_64" ; fi OS="netbsd${os_r}-$arch" os_r1=`echo "$os_r" | cut -d. -f1` os_r2=`echo "$os_r" | cut -d. -f2` if [ "$os_r2" = "" ] ; then os_r2=0 ; fi os_r3=`echo "$os_r" | cut -d. -f3` if [ "$os_r3" = "" ] ; then os_r3=0 ; fi os_int=`expr "$os_r1" '*' 100 + "$os_r2" '*' 10 + "$os_r3"` NDEFS="$NDEFS -DNETBSD=$os_int" SYS=netbsd ;; openbsd) if [ "$arch" = "amd64" ] ; then arch="x86_64" ; fi OS="openbsd${os_r}-$arch" os_r1=`echo "$os_r" | cut -d. -f1` os_r2=`echo "$os_r" | cut -d. -f2` if [ "$os_r2" = "" ] ; then os_r2=0 ; fi os_r3=`echo "$os_r" | cut -d. -f3` if [ "$os_r3" = "" ] ; then os_r3=0 ; fi os_int=`expr "$os_r1" '*' 100 + "$os_r2" '*' 10 + "$os_r3"` SYS=openbsd NDEFS="$NDEFS -DOPENBSD=$os_int" ;; sco*) OS=scosv SYS=sco os_v1=`echo "$os_v" | cut -d. -f1` case "$os_v1" in [1-9]) os_v2=`echo "$os_v" | cut -d. -f2` if [ "$os_v2" = "" ] ; then os_v2=0 ; fi os_v3=`echo "$os_v" | cut -d. -f3` if [ "$os_v3" = "" ] ; then os_v3=0 ; fi os_int=`expr "$os_v1" '*' 100 + "$os_v2" '*' 10 + "$os_v3"` NDEFS="$NDEFS -DSCO=$os_int" ;; *) NDEFS="$NDEFS -DSCO=1" ;; esac ;; dynix*) OS="dynixptx${os_v}" SYS=dynixptx os_v1=`echo "$os_v" | cut -d. -f1` os_v2=`echo "$os_v" | cut -d. -f2` os_v3=`echo "$os_v" | cut -d. -f3` if [ "$os_v3" = "" ] ; then os_v3=0 ; fi os_int=`expr "$os_v1" '*' 100 + "$os_v2" '*' 10 + "$os_v3"` NDEFS="$NDEFS -DDYNIX=$os_int" ;; linux) case "$arch" in *86) arch=x86 ;; esac libc="" [ -z "$os_r" ] && os_r="2.2.26" os_r1=`echo "$os_r" | cut -d. -f1` os_r2=`echo "$os_r" | cut -d. -f2` os_r3=`echo "$os_r" | cut -d- -f1 | cut -d. -f3` os_int=`expr "$os_r1" '*' 10000 + "$os_r2" '*' 1000 + "$os_r3"` NDEFS="$NDEFS -DLINUX=$os_int" vertest="./vertest.$$" rm -f "$vertest" "$vertest.c" cat < "$vertest.c" #include #include main() { const char *ver = gnu_get_libc_version(); const char *rel = gnu_get_libc_release(); fprintf(stdout, "glibc%s\n", ver); exit(0); } EOF echo $ac_n "checking version of C library""... $ac_c" 1>&6 echo "configure:: checking version of C library" >&5 ${CC-cc} $DEFS $CPPFLAGS $CFLAGS "$vertest.c" -o "$vertest" >/dev/null 2>&1 if [ -x "$vertest" ] ; then libc=`$vertest 2>/dev/null` ; fi rm -f "$vertest" "$vertest.c" if [ "$libc" = "" ] ; then libc_sysroot=`"${CC-gcc}" -v 2>&1 | sed -n '/with-libc_sysroot/{s/^.*--with-libc_sysroot=//;s/ .*//;p;q;}'` # Only results in non-empty with a GCC cross-compiler libc_file=`/bin/ls -1 -t "${libc_sysroot}"/lib/libc.so.* 2>/dev/null | sed -n 1,1p` if [ "$libc_file" != "" ] ; then libc_file=`echo "$libc_file" | sed 's|^.*/||'` libc_file="$libc_sysroot/lib/$libc_file" elif [ -f "$libc_sysroot/usr/lib/libc.a" ] ; then libc_file="$libc_sysroot/usr/lib/libc.a" else libc_file="/error" fi libc=`strings -n 40 "$libc_file" 2>/dev/null | fgrep 'GNU C Library' | sed 's/^.*version //;s/[^0-9\.].*$//;' | sed -n 1,1p` if [ "$libc" != "" ] ; then libc="glibc${libc}" fi fi case "$libc" in glibc*) echo "$libc" 1>&6 glibc_r=`echo "$libc" | sed 's/glibc//'` glibc_r1=`echo "$glibc_r" | cut -d. -f1` glibc_r2=`echo "$glibc_r" | cut -d. -f2` glibc_r3=`echo "$glibc_r" | cut -d- -f1 | cut -d. -f3` if test "$glibc_r1" = "" ; then glibc_r1=0 ; fi if test "$glibc_r2" = "" ; then glibc_r2=0 ; fi if test "$glibc_r3" = "" ; then glibc_r3=0 ; fi glibc_int=`expr "$glibc_r1" '*' 10000 + "$glibc_r2" '*' 100 + "$glibc_r3"` NDEFS="$NDEFS -DLINUX_GLIBC=$glibc_int" libc="glibc${glibc_r1}.${glibc_r2}" OS="linux-$arch" ;; *) if test -f /lib/libc-2.1.3.so ; then NDEFS="$NDEFS -DLINUX_GLIBC=20103" libc="glibc2.1" OS="linux-$arch" elif test -f /lib/libc-2.1.2.so ; then NDEFS="$NDEFS -DLINUX_GLIBC=20102" libc="glibc2.1" OS="linux-$arch" elif test -f /lib/libc-2.1.1.so ; then NDEFS="$NDEFS -DLINUX_GLIBC=20101" libc="glibc2.1" OS="linux-$arch" elif test -f /lib/libc.so.6 ; then NDEFS="$NDEFS -DLINUX_GLIBC=20000" libc="glibc2.0" OS="linux-$arch" elif test -f /lib/libc.so.6.1 ; then NDEFS="$NDEFS -DLINUX_GLIBC=20001" libc="glibc2.0" OS="linux-$arch" else NDEFS="$NDEFS -DLINUX_LIBC=5" libc="libc5" OS="linux-$arch" fi echo "$libc" 1>&6 ;; esac SYS=linux ;; bsd/os) OS="bsdos${os_r}" SYS=bsdos NDEFS="$NDEFS -DBSDOS=$os_r1" ;; ultrix) OS="ultrix-$arch" SYS=ultrix NDEFS="$NDEFS -DULTRIX" ;; unixware) OS="unixware${os_v}" SYS=unixware os_v1=`echo "$os_v" | cut -d. -f1` case "$os_v1" in [1-9]) os_v2=`echo "$os_v" | cut -d. -f2` os_v3=`echo "$os_v" | cut -d. -f3` if [ "$os_v3" = "" ] ; then os_v3=0 ; fi os_int=`expr "$os_v1" '*' 100 + "$os_v2" '*' 10 + "$os_v3"` NDEFS="$NDEFS -DUNIXWARE=$os_int" ;; *) NDEFS="$NDEFS -DUNIXWARE=1" ;; esac ;; openunix) OS="openunix${os_v}" SYS=openunix os_v1=`echo "$os_v" | cut -d. -f1` os_v2=`echo "$os_v" | cut -d. -f2` os_v3=`echo "$os_v" | cut -d. -f3` if [ "$os_v3" = "" ] ; then os_v3=0 ; fi os_int=`expr "$os_v1" '*' 100 + "$os_v2" '*' 10 + "$os_v3"` NDEFS="$NDEFS -DOPENUNIX=$os_int -DUNIXWARE=$os_int" ;; macos*|darwin|rhapsody) OS="macosx" SYS="macosx" os_v=`perl -e '{open(F, "< /System/Library/CoreServices/SystemVersion.plist") or exit(2); my ($doc) = ""; my ($line); while (defined($line = )) { $doc .= $line; } close(F); $doc =~ s/\s+//gs; if ($doc =~ /ProductVersion<\/key>([^<]+)<\/string>/) { print $1, "\n"; exit(0); } exit(1); }' 2>/dev/null` if [ "$os_v" = "" ] && [ -x "$HOME/bin/macosver" ] ; then os_v=`"$HOME/bin/macosver" 2>/dev/null` fi if [ "$os_v" = "" ] ; then cat > "$HOME/macosver.c" < ProductBuildVersion 5S66 ProductName Mac OS X ProductVersion 10.1.5 */ #include #include #include #include main() { char line[256], *cp, *cp2; FILE *fp; fp = fopen("/System/Library/CoreServices/SystemVersion.plist", "r"); if (fp != NULL) { memset(line, 0, sizeof(line)); while (fgets(line, sizeof(line) - 1, fp) != NULL) { cp = strstr(line, "ProductVersion"); if (cp != NULL) { memset(line, 0, sizeof(line)); if (fgets(line, sizeof(line) - 2, fp) != NULL) { for (cp = line; ((*cp != '\0') && (! isdigit(*cp))); ) cp++; for (cp2 = cp; ((*cp2 != '\0') && (! isspace(*cp2)) && (*cp2 != '<') && (*cp2 != '>')); ) cp2++; cp2[0] = '\0'; fclose(fp); fprintf(stdout, "%s\n", cp); exit(0); } } } } fclose(fp); exit(1); } EOF ${CC-cc} "$HOME/macosver.c" -o "$HOME/macosver" > /dev/null 2>&1 os_v=`"$HOME/macosver" 2>/dev/null` mv "$HOME/macosver" "$HOME/bin/macosver" 2>/dev/null rm -f "$HOME/macosver.c" "$HOME/macosver" fi if [ "$os_v" != "" ] ; then OS="macosx${os_v}" os_v1=`echo "$os_v" | cut -d. -f1` os_v2=`echo "$os_v" | cut -d. -f2` os_v3=`echo "$os_v" | cut -d. -f3` if [ "$os_v3" = "" ] ; then os_v3=0 ; fi os_int=`expr "$os_v1" '*' 1000 + "$os_v2" '*' 100 + "$os_v3"` NDEFS="$NDEFS -DMACOSX=$os_int" else NDEFS="$NDEFS -DMACOSX" fi ;; sunos) if [ "$arch" = "" ] ; then arch="sparc" ; fi if [ "$archp" = "" ] ; then archp="$arch" ; fi case "$os_r" in 5.*) case "$os_r" in 5.[023456]*|5.1) os_r=`echo "$os_r" | sed 's/^5/2/;'` os_r1=`echo "$os_r" | cut -d. -f1` os_r2=`echo "$os_r" | cut -d. -f2` if [ "$os_r2" = "" ] ; then os_r2=0 ; fi os_r3=`echo "$os_r" | cut -d. -f3` if [ "$os_r3" = "" ] ; then os_r3=0 ; fi os_int=`expr "$os_r1" '*' 100 + "$os_r2" '*' 10 + "$os_r3"` ;; 5.[789]*|5.1[0-9]*) os_r1=`echo "$os_r" | cut -d. -f2` os_r2=`echo "$os_r" | cut -d. -f3` if [ "$os_r2" = "" ] ; then os_r2=0 ; fi os_r3=`echo "$os_r" | cut -d. -f4` if [ "$os_r3" = "" ] ; then os_r3=0 ; fi os_int=`expr "$os_r1" '*' 100 + "$os_r2" '*' 10 + "$os_r3"` os_r=`echo "$os_r" | cut -c3-` ;; esac case "`/usr/bin/isainfo -n 2>/dev/null`" in amd64) OS="solaris${os_r}-x86_64" ;; *86) OS="solaris${os_r}-x86" ;; sparcv9*|sparcv1[0-9]*) OS="solaris${os_r}-sparc64" ;; *) OS="solaris${os_r}-$archp" ;; esac NDEFS="$NDEFS -DSOLARIS=$os_int" SYS=solaris ;; 4.*) OS="sunos${os_r}-sparc" NDEFS="$NDEFS -DSUNOS=\\\"$os_r\\\"" SYS=sunos ;; *) os_r1=`echo "$os_r" | cut -d. -f1` if [ "$os_r1" = "" ] ; then os_r1=0 ; fi os_r2=`echo "$os_r" | cut -d. -f2` if [ "$os_r2" = "" ] ; then os_r2=0 ; fi os_r3=`echo "$os_r" | cut -d. -f3` if [ "$os_r3" = "" ] ; then os_r3=0 ; fi os_int=`expr "$os_r1" '*' 100 + "$os_r2" '*' 10 + "$os_r3"` OS="solaris${os_r}-$archp" NDEFS="$NDEFS -DSOLARIS=$os_int" SYS=solaris ;; esac ;; *) OS="$os" SYS="$os" if grep Novell /usr/include/sys/types.h ; then OS="unixware${os_v}" SYS="unixware" fi ;; esac if [ "x$wi_cv_OS" != "x" ] && [ "$wi_cv_OS" != "$OS" ] ; then changequote([, ]) AC_MSG_ERROR([Your config.cache file is invalid. It was created on $wi_cv_OS, but this machine is running $OS. Remove the config.cache file if you wish to continue.]) fi wi_cv_OS="$OS" if test "x$HOME_OS" = "x" && test "x$OS" != "x" ; then HOME_OS="$HOME/$OS" fi AC_SUBST(NDEFS) AC_SUBST(OS) AC_SUBST(host) AC_SUBST(SYS) AC_SUBST(HOME_OS) AC_MSG_CHECKING([platform]) AC_MSG_RESULT(["$OS"]) ]) dnl dnl dnl AC_DEFUN(wi_SIZEOF_PTR, [ AC_MSG_CHECKING(size of pointer) wi_PREREQ_UNISTD_H([$0]) AC_TRY_RUN([ /* program */ #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) # define _ALL_SOURCE 1 #endif #ifdef HAVE_UNISTD_H # include #endif #include #include #include main() { FILE *fp; fp = fopen("conftest.out", "w"); if (fp != NULL) { fprintf(fp, "%u\n", (unsigned int) sizeof(int *)); fclose(fp); exit(0); /* OK */ } exit(1); /* Not OK */ } ],[ # action if true x=`cat conftest.out` case "$x" in changequote(<<, >>)dnl [0-9]*) changequote([, ])dnl AC_DEFINE_UNQUOTED(SIZEOF_PTR, $x) ac_cv_sizeof_ptr="$x" ;; *) x="failed" ;; esac rm -f conftest.out ],[ # action if false x="failed" rm -f conftest.out ],[ # action if cross compiling x="unknown" rm -f conftest.out ]) AC_MSG_RESULT($x) ]) dnl dnl dnl AC_DEFUN(wi_SIZEOF_STRUCT_STAT, [ AC_MSG_CHECKING(size of struct stat) wi_PREREQ_UNISTD_H([$0]) AC_TRY_RUN([ /* program */ #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) # define _ALL_SOURCE 1 #endif #ifdef HAVE_UNISTD_H # include #endif #include #include #include #include main() { struct stat x; FILE *fp; fp = fopen("conftest.out", "w"); if (fp != NULL) { fprintf(fp, "%u\n", (unsigned int) sizeof(x)); fclose(fp); exit(0); /* OK */ } exit(1); /* Not OK */ } ],[ # action if true x=`cat conftest.out` case "$x" in changequote(<<, >>)dnl [0-9]*) changequote([, ])dnl AC_DEFINE_UNQUOTED(SIZEOF_STRUCT_STAT, $x) ac_cv_sizeof_struct_stat="$x" ;; *) x="failed" ;; esac rm -f conftest.out ],[ # action if false x="failed" rm -f conftest.out ],[ # action if cross compiling x="unknown" rm -f conftest.out ]) AC_MSG_RESULT($x) ]) dnl dnl dnl AC_DEFUN(wi_SIZEOF_STRUCT_STAT64, [ AC_MSG_CHECKING(size of struct stat64) wi_PREREQ_UNISTD_H([$0]) AC_TRY_RUN([ /* program */ #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) # define _ALL_SOURCE 1 #endif #ifdef HAVE_UNISTD_H # include #endif #include #include #include #include main() { struct stat64 x; FILE *fp; fp = fopen("conftest.out", "w"); if (fp != NULL) { fprintf(fp, "%u\n", (unsigned int) sizeof(x)); fclose(fp); exit(0); /* OK */ } exit(1); /* Not OK */ } ],[ # action if true x=`cat conftest.out` case "$x" in changequote(<<, >>)dnl [0-9]*) changequote([, ])dnl AC_DEFINE_UNQUOTED(SIZEOF_STRUCT_STAT64, $x) ac_cv_sizeof_struct_stat64="$x" ;; *) x="failed" ;; esac rm -f conftest.out ],[ # action if false x="failed" rm -f conftest.out ],[ # action if cross compiling x="unknown" rm -f conftest.out ]) AC_MSG_RESULT($x) ]) dnl dnl dnl dnl AC_DEFUN(wi_FUNC_MMAP, [AC_CHECK_HEADERS(stdlib.h unistd.h sys/stat.h sys/types.h) AC_CHECK_FUNCS(getpagesize) wi_CACHE_CHECK_GUESS_MESSAGE(for working mmap, ac_cv_func_mmap_fixed_mapped, [AC_TRY_RUN([ /* Thanks to Mike Haertel and Jim Avera for this test. Here is a matrix of mmap possibilities: mmap private not fixed mmap private fixed at somewhere currently unmapped mmap private fixed at somewhere already mapped mmap shared not fixed mmap shared fixed at somewhere currently unmapped mmap shared fixed at somewhere already mapped For private mappings, we should verify that changes cannot be read() back from the file, nor mmap's back from the file at a different address. (There have been systems where private was not correctly implemented like the infamous i386 svr4.0, and systems where the VM page cache was not coherent with the filesystem buffer cache like early versions of FreeBSD and possibly contemporary NetBSD.) For shared mappings, we should conversely verify that changes get propogated back to all the places they're supposed to be. Grep wants private fixed already mapped. The main things grep needs to know about mmap are: * does it exist and is it safe to write into the mmap'd area * how to use it (BSD variants) */ #include #include #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_STDLIB_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if HAVE_UNISTD_H # include #endif /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H # define HAVE_SYS_PARAM_H 1 # endif # ifdef _SC_PAGESIZE # define getpagesize() sysconf(_SC_PAGESIZE) # else /* no _SC_PAGESIZE */ # ifdef HAVE_SYS_PARAM_H # include # ifdef EXEC_PAGESIZE # define getpagesize() EXEC_PAGESIZE # else /* no EXEC_PAGESIZE */ # ifdef NBPG # define getpagesize() NBPG * CLSIZE # ifndef CLSIZE # define CLSIZE 1 # endif /* no CLSIZE */ # else /* no NBPG */ # ifdef NBPC # define getpagesize() NBPC # else /* no NBPC */ # ifdef PAGESIZE # define getpagesize() PAGESIZE # endif /* PAGESIZE */ # endif /* no NBPC */ # endif /* no NBPG */ # endif /* no EXEC_PAGESIZE */ # else /* no HAVE_SYS_PARAM_H */ # define getpagesize() 8192 /* punt totally */ # endif /* no HAVE_SYS_PARAM_H */ # endif /* no _SC_PAGESIZE */ #endif /* no HAVE_GETPAGESIZE */ #if !HAVE_STDLIB_H /* MG */ #ifdef __cplusplus extern "C" { void *malloc(unsigned); } #else char *malloc(); #endif #endif /* MG */ int main() { char *data, *data2, *data3; int i, pagesize; int fd; pagesize = getpagesize(); /* * First, make a file with some known garbage in it. */ data = malloc(pagesize); if (!data) exit(1); for (i = 0; i < pagesize; ++i) *(data + i) = rand(); umask(0); fd = creat("conftestmmap", 0600); if (fd < 0) exit(1); if (write(fd, data, pagesize) != pagesize) exit(1); close(fd); /* * Next, try to mmap the file at a fixed address which * already has something else allocated at it. If we can, * also make sure that we see the same garbage. */ fd = open("conftestmmap", O_RDWR); if (fd < 0) exit(1); data2 = malloc(2 * pagesize); if (!data2) exit(1); data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, 0L)) exit(1); for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data2 + i)) exit(1); /* * Finally, make sure that changes to the mapped area * do not percolate back to the file as seen by read(). * (This is a bug on some variants of i386 svr4.0.) */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; data3 = malloc(pagesize); if (!data3) exit(1); if (read(fd, data3, pagesize) != pagesize) exit(1); for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data3 + i)) exit(1); close(fd); unlink("conftestmmap"); exit(0); } ],[ # action if true guess="" ac_cv_func_mmap_fixed_mapped=yes ],[ # action if false guess="" ac_cv_func_mmap_fixed_mapped=no ],[ # cross compiling, so have to guess... # just look for existence of mmap. # AC_CHECK_FUNCS(mmap) guess="(guessing) " ac_cv_func_mmap_fixed_mapped=$ac_cv_func_mmap ])]) if test $ac_cv_func_mmap_fixed_mapped = yes; then AC_DEFINE(HAVE_MMAP) fi ]) dnl dnl dnl dnl AC_DEFUN(wi_FUNC_SETVBUF, [ AC_MSG_CHECKING([whether setvbuf behavior can be checked]) if test "x$cross_compiling" = "xyes" ; then AC_MSG_RESULT([no]) else AC_MSG_RESULT([yes]) dnl AC_FUNC_SETVBUF_REVERSED AC_CACHE_CHECK(whether setvbuf arguments are reversed, ac_cv_func_setvbuf_reversed, [AC_TRY_RUN([#include /* If setvbuf has the reversed format, exit 0. */ main () { /* This call has the arguments reversed. A reversed system may check and see that the address of main is not _IOLBF, _IONBF, or _IOFBF, and return nonzero. */ if (setvbuf(stdout, _IOLBF, (char *) main, BUFSIZ) != 0) exit(1); putc('\r', stdout); exit(0); /* Non-reversed systems segv here. */ }], ac_cv_func_setvbuf_reversed=yes, ac_cv_func_setvbuf_reversed=no, ac_cv_func_setvbuf_reversed=no) rm -f core core.* *.core]) if test $ac_cv_func_setvbuf_reversed = yes; then AC_DEFINE(SETVBUF_REVERSED) fi fi ]) dnl dnl dnl dnl AC_DEFUN(wi_FUNC_SETPGRP, [ if test "x$ac_cv_func_setpgid" = "x" ; then AC_CHECK_FUNCS(setpgid setpgrp) fi AC_MSG_CHECKING([if setpgrp behavior needs to be checked]) if test "x$ac_cv_func_setpgid" = "xyes" ; then # OK, we will be using setpgid instead of setpgrp then... AC_MSG_RESULT([no]) ac_cv_func_setpgrp_void=dontcare elif test "x$cross_compiling" = "xyes" ; then AC_MSG_RESULT([yes]) AC_MSG_CHECKING([whether setpgrp takes no argument]) case "`uname -a`" in *BSD*|*bsd*) ac_cv_func_setpgrp_void="no" ;; *) ac_cv_func_setpgrp_void="yes" AC_DEFINE(SETPGRP_VOID) ;; esac AC_MSG_RESULT(["${ac_cv_func_setpgrp_void}?"]) else # We're not cross compiling, so we can try this check AC_MSG_RESULT([yes]) AC_FUNC_SETPGRP fi ]) dnl dnl dnl dnl AC_DEFUN(wi_PROG_RANLIB, [ changequote({{, }})dnl if test "x$cross_compiling" = "xyes" ; then # Help out if the cross ranlib isn't in your path, # for example, maybe you set CC=/path/to/cross-gcc # rather than put PATH=/path/to/crosstools:$PATH # and let cc be found in your PATH. # machine=`${CC-gcc} -dumpmachine 2>/dev/null` case "$CC" in *${machine}*) f=`echo "$CC" | sed 's|/[^/]*$||'` if [ -x "$f/${machine}-ranlib" ] ; then RANLIB="$f/${machine}-ranlib" elif [ -x "$f/ranlib" ] ; then RANLIB="$f/ranlib" fi ;; esac unset machine f fi changequote([, ])dnl AC_PROG_RANLIB ]) dnl dnl dnl dnl AC_DEFUN(wi_PROG_AR, [ AC_MSG_CHECKING([for ar]) changequote({{, }})dnl AR="ar" if [ "x$cross_compiling" = "xyes" ] ; then machine=`${CC-gcc} -dumpmachine 2>/dev/null` case "$CC" in *${machine}*) f=`echo "$CC" | sed 's|/[^/]*$||'` if [ -x "$f/${machine}-ar" ] ; then AR="$f/${machine}-ar" elif [ -x "$f/ar" ] ; then AR="$f/ar" fi ;; esac unset machine f fi changequote([, ])dnl AC_MSG_RESULT([$AR]) AC_SUBST(AR) ]) ncftp-3.2.6/config.h.in0000644000000000000000000003407013011746657013514 0ustar rootwheel/* config.h.in. Generated automatically from configure.in by autoheader. */ #undef alarm_time_t #undef CAN_USE_SYS_SELECT_H /* Define if using alloca.c. */ #undef C_ALLOCA /* Define to empty if the keyword does not work. */ #undef const /* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. This function is required for alloca.c support on those systems. */ #undef CRAY_STACKSEG_END #undef gethost_addrptr_t #undef gethostname_size_t /* Define to `int' if doesn't define. */ #undef gid_t /* Define if you have alloca, as a function or macro. */ #undef HAVE_ALLOCA /* Define if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H /* Define if your curses library has this functionality. */ #undef HAVE_BEEP #undef HAVE_CURSES_H /* Define if your curses library has this functionality. */ #undef HAVE_GETBEGX /* Define if your curses library has this functionality. */ #undef HAVE_GETBEGYX /* Define if your curses library has this functionality. */ #undef HAVE_GETCURX /* Define if your curses library has this functionality. */ #undef HAVE_GETMAXX /* Define if your curses library has this functionality. */ #undef HAVE_GETMAXYX /* Define if your curses library has this functionality. */ #undef HAVE_GETYX /* Define if you have the curses library. */ #undef HAVE_LIBCURSES /* Define if you have the ncurses library. */ #undef HAVE_LIBNCURSES /* Define if you support file names longer than 14 characters. */ #undef HAVE_LONG_FILE_NAMES /* Define if your compiler supports the "long long" integral type. */ #undef HAVE_LONG_LONG /* Most system's curses library uses a _maxx field instead of maxx. */ #undef HAVE__MAXX #undef HAVE_MSGHDR_ACCRIGHTS #undef HAVE_MSGHDR_CONTROL /* Define if you have a _res global variable used by resolve routines. */ #undef HAVE__RES_DEFDNAME /* Define if you have sigsetjmp and siglongjmp. */ #undef HAVE_SIGSETJMP #undef HAVE_SOCKADDR_UN_SUN_LEN #undef HAVE_STRUCT_CMSGDHR #undef HAVE_STRUCT_STAT64 /* Define if your curses library has this functionality. */ #undef HAVE_TOUCHWIN #undef HAVE_UNIX_DOMAIN_SOCKETS #undef listen_backlog_t #undef main_void_return_t /* Define to `int' if doesn't define. */ #undef mode_t /* Define this because you definitely don't have it. Used only for testing configure. */ #undef negative_control_t /* Define if optind, optarg, etc., need to be declared as extern. */ #undef NEED_GETOPT_EXTERN_DECLS /* Define if exists and declares optind, optarg, etc. */ #undef NEED_GETOPT_H /* Define to `long' if doesn't define. */ #undef off_t /* Define to `int' if doesn't define. */ #undef pid_t #undef PRAGMA_HDRSTOP /* Define to the full path of $prefix/bin. */ #undef PREFIX_BINDIR /* Format string for the printf() family for 64 bit integers. */ #undef PRINTF_LONG_LONG /* Define if printing a "long long" with "%lld" works . */ #undef PRINTF_LONG_LONG_LLD /* Define if printing a "long long" with "%qd" works . */ #undef PRINTF_LONG_LONG_QD /* Format string for the printf() family for 64 bit unsigned integers. */ #undef PRINTF_ULONG_LONG #undef read_return_t #undef read_size_t #undef recv_return_t #undef recv_size_t /* Format string for the scanf() family for 64 bit integers. */ #undef SCANF_LONG_LONG #undef sa_family_t /* Define if scanning a "long long" with "%lld" works. */ #undef SCANF_LONG_LONG_LLD /* Define if scanning a "long long" with "%qd" works. */ #undef SCANF_LONG_LONG_QD /* Format string for the scanf() family for 64 bit unsigned integers. */ #undef SCANF_ULONG_LONG /* Define to the type of arg1 for select(). */ #undef SELECT_TYPE_ARG1 /* Define to the type of args 2, 3 and 4 for select(). */ #undef SELECT_TYPE_ARG234 /* Define to the type of arg5 for select(). */ #undef SELECT_TYPE_ARG5 #undef send_return_t #undef send_size_t /* Define if the `setpgrp' function takes no argument. */ #undef SETPGRP_VOID /* Define if the setvbuf function takes the buffering type as its second argument and the buffer pointer as the third, as on System V before release 3. */ #undef SETVBUF_REVERSED /* Define to `int' if doesn't define. */ #undef sig_atomic_t /* Define to `unsigned' if doesn't define. */ #undef size_t /* Define to sizeof(off_t) */ #undef SIZEOF_OFF_T /* Define to sizeof(off64_t) */ #undef SIZEOF_OFF64_T /* Define to sizeof(struct stat.st_size) */ #undef SIZEOF_ST_SIZE /* Define to sizeof(struct stat64.st_size) */ #undef SIZEOF_STAT64_ST_SIZE #undef SNPRINTF_RETURNS_PTR #undef SNPRINTF_TERMINATES #undef sockaddr_size_t /* If SOCKS library is being used, define the major version (i.e. 5) */ #undef SOCKS #undef sockopt_size_t /* Define to `long' if doesn't define. */ #undef ssize_t /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to the full path of the Tar program, if you have it. */ #undef TAR /* Define if you can safely include both and . */ #undef TIME_WITH_SYS_TIME #undef tv_sec_t #undef tv_usec_t /* Define to `int' if doesn't define. */ #undef uid_t /* Result of "uname -a" */ #undef UNAME #undef waddstr_str_t #undef WADDSTR_TYPE_ARG1_CONST #undef write_return_t #undef write_size_t /* Define if you have the __getbegx function. */ #undef HAVE___GETBEGX /* Define if you have the __getbegy function. */ #undef HAVE___GETBEGY /* Define if you have the __getcurx function. */ #undef HAVE___GETCURX /* Define if you have the __getcury function. */ #undef HAVE___GETCURY /* Define if you have the __getmaxx function. */ #undef HAVE___GETMAXX /* Define if you have the __getmaxy function. */ #undef HAVE___GETMAXY /* Define if you have the _posix_getpwnam_r function. */ #undef HAVE__POSIX_GETPWNAM_R /* Define if you have the _posix_getpwuid_r function. */ #undef HAVE__POSIX_GETPWUID_R /* Define if you have the curs_set function. */ #undef HAVE_CURS_SET /* Define if you have the doupdate function. */ #undef HAVE_DOUPDATE /* Define if you have the fstat64 function. */ #undef HAVE_FSTAT64 /* Define if you have the getcwd function. */ #undef HAVE_GETCWD /* Define if you have the getdomainname function. */ #undef HAVE_GETDOMAINNAME /* Define if you have the gethostbyaddr_r function. */ #undef HAVE_GETHOSTBYADDR_R /* Define if you have the gethostbyname2_r function. */ #undef HAVE_GETHOSTBYNAME2_R /* Define if you have the gethostbyname_r function. */ #undef HAVE_GETHOSTBYNAME_R /* Define if you have the gethostname function. */ #undef HAVE_GETHOSTNAME /* Define if you have the getlogin_r function. */ #undef HAVE_GETLOGIN_R /* Define if you have the getpass function. */ #undef HAVE_GETPASS /* Define if you have the getpassphrase function. */ #undef HAVE_GETPASSPHRASE /* Define if you have the getpwnam_r function. */ #undef HAVE_GETPWNAM_R /* Define if you have the getpwuid_r function. */ #undef HAVE_GETPWUID_R /* Define if you have the getservbyname_r function. */ #undef HAVE_GETSERVBYNAME_R /* Define if you have the getservbyport_r function. */ #undef HAVE_GETSERVBYPORT_R /* Define if you have the getwd function. */ #undef HAVE_GETWD /* Define if you have the gmtime_r function. */ #undef HAVE_GMTIME_R /* Define if you have the gnu_get_libc_release function. */ #undef HAVE_GNU_GET_LIBC_RELEASE /* Define if you have the gnu_get_libc_version function. */ #undef HAVE_GNU_GET_LIBC_VERSION /* Define if you have the inet_aton function. */ #undef HAVE_INET_ATON /* Define if you have the inet_ntop function. */ #undef HAVE_INET_NTOP /* Define if you have the keypad function. */ #undef HAVE_KEYPAD /* Define if you have the llseek function. */ #undef HAVE_LLSEEK /* Define if you have the localtime_r function. */ #undef HAVE_LOCALTIME_R /* Define if you have the lseek64 function. */ #undef HAVE_LSEEK64 /* Define if you have the lstat64 function. */ #undef HAVE_LSTAT64 /* Define if you have the memmove function. */ #undef HAVE_MEMMOVE /* Define if you have the mktime function. */ #undef HAVE_MKTIME /* Define if you have the nodelay function. */ #undef HAVE_NODELAY /* Define if you have the open64 function. */ #undef HAVE_OPEN64 /* Define if you have the pathconf function. */ #undef HAVE_PATHCONF /* Define if you have the readdir_r function. */ #undef HAVE_READDIR_R /* Define if you have the readlink function. */ #undef HAVE_READLINK /* Define if you have the recvfile function. */ #undef HAVE_RECVFILE /* Define if you have the res_init function. */ #undef HAVE_RES_INIT /* Define if you have the sendfile function. */ #undef HAVE_SENDFILE /* Define if you have the sendfilev function. */ #undef HAVE_SENDFILEV /* Define if you have the sendfilev64 function. */ #undef HAVE_SENDFILEV64 /* Define if you have the setlocale function. */ #undef HAVE_SETLOCALE /* Define if you have the setpgid function. */ #undef HAVE_SETPGID /* Define if you have the setpgrp function. */ #undef HAVE_SETPGRP /* Define if you have the setsid function. */ #undef HAVE_SETSID /* Define if you have the setvbuf function. */ #undef HAVE_SETVBUF /* Define if you have the sigaction function. */ #undef HAVE_SIGACTION /* Define if you have the sigsetjmp function. */ #undef HAVE_SIGSETJMP /* Define if you have the snprintf function. */ #undef HAVE_SNPRINTF /* Define if you have the stat64 function. */ #undef HAVE_STAT64 /* Define if you have the strcasecmp function. */ #undef HAVE_STRCASECMP /* Define if you have the strcoll function. */ #undef HAVE_STRCOLL /* Define if you have the strdup function. */ #undef HAVE_STRDUP /* Define if you have the strerror function. */ #undef HAVE_STRERROR /* Define if you have the strncoll function. */ #undef HAVE_STRNCOLL /* Define if you have the strstr function. */ #undef HAVE_STRSTR /* Define if you have the strtoq function. */ #undef HAVE_STRTOQ /* Define if you have the symlink function. */ #undef HAVE_SYMLINK /* Define if you have the sysconf function. */ #undef HAVE_SYSCONF /* Define if you have the sysctl function. */ #undef HAVE_SYSCTL /* Define if you have the sysinfo function. */ #undef HAVE_SYSINFO /* Define if you have the syslog function. */ #undef HAVE_SYSLOG /* Define if you have the tcgetattr function. */ #undef HAVE_TCGETATTR /* Define if you have the uname function. */ #undef HAVE_UNAME /* Define if you have the vsnprintf function. */ #undef HAVE_VSNPRINTF /* Define if you have the waitpid function. */ #undef HAVE_WAITPID /* Define if you have the wnoutrefresh function. */ #undef HAVE_WNOUTREFRESH /* Define if you have the header file. */ #undef HAVE_ARPA_NAMESER_H /* Define if you have the header file. */ #undef HAVE_CURSES_H /* Define if you have the header file. */ #undef HAVE_GNU_LIBC_VERSION_H /* Define if you have the header file. */ #undef HAVE_LOCALE_H /* Define if you have the header file. */ #undef HAVE_NCURSES_H /* Define if you have the header file. */ #undef HAVE_NET_ERRNO_H /* Define if you have the header file. */ #undef HAVE_NSERVE_H /* Define if you have the header file. */ #undef HAVE_RESOLV_H /* Define if you have the header file. */ #undef HAVE_SGTTY_H /* Define if you have the header file. */ #undef HAVE_SNPRINTF_H /* Define if you have the header file. */ #undef HAVE_SOCKS_H /* Define if you have the header file. */ #undef HAVE_SOCKS5P_H /* Define if you have the header file. */ #undef HAVE_STRING_H /* Define if you have the header file. */ #undef HAVE_STRINGS_H /* Define if you have the header file. */ #undef HAVE_SYS_ID_H /* Define if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define if you have the header file. */ #undef HAVE_SYS_SENDFILE_H /* Define if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define if you have the header file. */ #undef HAVE_SYS_SYSTEMINFO_H /* Define if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define if you have the header file. */ #undef HAVE_SYS_UN_H /* Define if you have the header file. */ #undef HAVE_SYS_UTSNAME_H /* Define if you have the header file. */ #undef HAVE_SYSLOG_H /* Define if you have the header file. */ #undef HAVE_TERMIO_H /* Define if you have the header file. */ #undef HAVE_TERMIOS_H /* Define if you have the header file. */ #undef HAVE_TIME_H /* Define if you have the header file. */ #undef HAVE_UNISTD_H /* Define if you have the header file. */ #undef HAVE_UTIME_H /* Define if you have the header file. */ #undef HAVE_VALIDATOR_VALIDATOR_H /* Define if you have the 44bsd library (-l44bsd). */ #undef HAVE_LIB44BSD /* Define if you have the dl library (-ldl). */ #undef HAVE_LIBDL /* Define if you have the gen library (-lgen). */ #undef HAVE_LIBGEN /* Define if you have the nsl library (-lnsl). */ #undef HAVE_LIBNSL /* Define if you have the pthread library (-lpthread). */ #undef HAVE_LIBPTHREAD /* Define if you have the resolv library (-lresolv). */ #undef HAVE_LIBRESOLV /* Define if you have the sendfile library (-lsendfile). */ #undef HAVE_LIBSENDFILE /* Define if you have the snprintf library (-lsnprintf). */ #undef HAVE_LIBSNPRINTF /* Define if you have the socket library (-lsocket). */ #undef HAVE_LIBSOCKET /* Define if you have the sres library (-lsres). */ #undef HAVE_LIBSRES /* Define if you have the ssl library (-lssl). */ #undef HAVE_LIBSSL /* Define if you want local DNSSEC validation support */ #undef DNSSEC_LOCAL_VALIDATION ncftp-3.2.6/configure0000755000000000000000000117130413021063123013360 0ustar rootwheel#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # Defaults: ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: ac_help="$ac_help --disable-ccdv disable use of ccdv program in Makefiles" ac_help="$ac_help --without-curses do not try to find and use the curses library" ac_help="$ac_help --enable-debug enable debugging symbols" ac_help="$ac_help --without-ncurses do not try to find and use the ncurses library" ac_help="$ac_help --disable-precomp disable use of precompiled header files" ac_help="$ac_help --with-socks5 try to find and use the SOCKS5 library" ac_help="$ac_help --enable-ssp use stack smashing protection if available" ac_help="$ac_help --disable-universal disable production of universal binaries on Mac OS X" ac_help="$ac_help --with-dnssec-local-validation Enable local DNSSEC validation using libval (no)" # Initialize some variables set by options. # The variables have the same names as the options, with # dashes changed to underlines. build=NONE cache_file=./config.cache exec_prefix=NONE host=NONE no_create= nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= target=NONE verbose= x_includes=NONE x_libraries=NONE bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. ac_max_here_lines=12 ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi case "$ac_option" in -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) ac_optarg= ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case "$ac_option" in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir="$ac_optarg" ;; -build | --build | --buil | --bui | --bu) ac_prev=build ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build="$ac_optarg" ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file="$ac_optarg" ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir="$ac_optarg" ;; -disable-* | --disable-*) ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` eval "enable_${ac_feature}=no" ;; -enable-* | --enable-*) ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "enable_${ac_feature}='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix="$ac_optarg" ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he) # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat << EOF Usage: configure [options] [host] Options: [defaults in brackets after descriptions] Configuration: --cache-file=FILE cache test results in FILE --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [same as prefix] --bindir=DIR user executables in DIR [EPREFIX/bin] --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] --libexecdir=DIR program executables in DIR [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data in DIR [PREFIX/share] --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data in DIR [PREFIX/com] --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] --libdir=DIR object code libraries in DIR [EPREFIX/lib] --includedir=DIR C header files in DIR [PREFIX/include] --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] --infodir=DIR info documentation in DIR [PREFIX/info] --mandir=DIR man documentation in DIR [PREFIX/man] --srcdir=DIR find the sources in DIR [configure dir or ..] --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names EOF cat << EOF Host type: --build=BUILD configure for building on BUILD [BUILD=HOST] --host=HOST configure for HOST [guessed] --target=TARGET configure for TARGET [TARGET=HOST] Features and packages: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR EOF if test -n "$ac_help"; then echo "--enable and --with options recognized:$ac_help" fi exit 0 ;; -host | --host | --hos | --ho) ac_prev=host ;; -host=* | --host=* | --hos=* | --ho=*) host="$ac_optarg" ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir="$ac_optarg" ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir="$ac_optarg" ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir="$ac_optarg" ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir="$ac_optarg" ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir="$ac_optarg" ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir="$ac_optarg" ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir="$ac_optarg" ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix="$ac_optarg" ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix="$ac_optarg" ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix="$ac_optarg" ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name="$ac_optarg" ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir="$ac_optarg" ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir="$ac_optarg" ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site="$ac_optarg" ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir="$ac_optarg" ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir="$ac_optarg" ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target="$ac_optarg" ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers) echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "with_${ac_package}='$ac_optarg'" ;; -without-* | --without-*) ac_package=`echo $ac_option|sed -e 's/-*without-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` eval "with_${ac_package}=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes="$ac_optarg" ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries="$ac_optarg" ;; -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } ;; *) if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then echo "configure: warning: $ac_option: invalid host type" 1>&2 fi if test "x$nonopt" != xNONE; then { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } fi nonopt="$ac_option" ;; esac done if test -n "$ac_prev"; then { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } fi trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 # File descriptor usage: # 0 standard input # 1 file creation # 2 errors and warnings # 3 some systems may open it to /dev/tty # 4 used on the Kubota Titan # 6 checking for... messages and results # 5 compiler messages saved in config.log if test "$silent" = yes; then exec 6>/dev/null else exec 6>&1 fi exec 5>./config.log echo "\ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. " 1>&5 # Strip out --no-create and --no-recursion so they do not pile up. # Also quote any args containing shell metacharacters. ac_configure_args= for ac_arg do case "$ac_arg" in -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ac_configure_args="$ac_configure_args '$ac_arg'" ;; *) ac_configure_args="$ac_configure_args $ac_arg" ;; esac done # NLS nuisances. # Only set these to C if already set. These must not be set unconditionally # because not all systems understand e.g. LANG=C (notably SCO). # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! # Non-C LC_CTYPE values break the ctype check. if test "${LANG+set}" = set; then LANG=C; export LANG; fi if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo > confdefs.h # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. ac_unique_file=ncftp/main.c # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_prog=$0 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } else { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } fi fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then echo "loading site script $ac_site_file" . "$ac_site_file" fi done if test -r "$cache_file"; then echo "loading cache $cache_file" . $cache_file else echo "creating cache $cache_file" > $cache_file fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross ac_exeext= ac_objext=o if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else ac_n= ac_c='\c' ac_t= fi # Check whether --enable-ccdv or --disable-ccdv was given. if test "${enable_ccdv+set}" = set; then enableval="$enable_ccdv" use_ccdv="$enableval" else use_ccdv=yes fi # Check whether --with-curses or --without-curses was given. if test "${with_curses+set}" = set; then withval="$with_curses" nc_cv_curses=$withval else nc_cv_curses=yes fi # if DEBUGBUILD is yes, other macros try to set up a compilation environment # with debugging symbols enabled. Example macros which are affected are # wi_CFLAGS and wi_SFLAG. # # Check whether --enable-debug or --disable-debug was given. if test "${enable_debug+set}" = set; then enableval="$enable_debug" DEBUGBUILD=no DEBUGCONFIGUREFLAG="" if test "$enableval" != "no" ; then DEBUGBUILD=yes DEBUGCONFIGUREFLAG="--enable-debug" fi else DEBUGBUILD=no DEBUGCONFIGUREFLAG="" fi # Check whether --with-ncurses or --without-ncurses was given. if test "${with_ncurses+set}" = set; then withval="$with_ncurses" nc_cv_ncurses=$withval else nc_cv_ncurses=yes fi # Check whether --enable-precomp or --disable-precomp was given. if test "${enable_precomp+set}" = set; then enableval="$enable_precomp" use_precomp="$enableval" else use_precomp=yes fi # Check whether --with-socks5 or --without-socks5 was given. if test "${with_socks5+set}" = set; then withval="$with_socks5" wi_want_socks5=$withval else wi_want_socks5=no fi # Check whether --enable-ssp or --disable-ssp was given. if test "${enable_ssp+set}" = set; then enableval="$enable_ssp" use_ssp="$enableval" else use_ssp=no fi # Check whether --enable-universal or --disable-universal was given. if test "${enable_universal+set}" = set; then enableval="$enable_universal" use_macosx_universal="$enableval" else use_macosx_universal=yes fi echo $ac_n "checking if you set and exported the environment variable CC""... $ac_c" 1>&6 echo "configure:640: checking if you set and exported the environment variable CC" >&5 if test "x$CC" = x ; then echo "$ac_t""no (configure will try to locate a suitable C compiler)" 1>&6 had_CC="no" else echo "$ac_t""$CC" 1>&6 had_CC="yes" fi echo $ac_n "checking for environment variable CFLAGS""... $ac_c" 1>&6 echo "configure:649: checking for environment variable CFLAGS" >&5 if test "x$CFLAGS" = x ; then echo "$ac_t""no (we will choose a default set for you)" 1>&6 else echo "$ac_t""$CFLAGS" 1>&6 fi echo $ac_n "checking for environment variable CPPFLAGS""... $ac_c" 1>&6 echo "configure:656: checking for environment variable CPPFLAGS" >&5 echo "$ac_t""${CPPFLAGS-no}" 1>&6 echo $ac_n "checking for environment variable LDFLAGS""... $ac_c" 1>&6 echo "configure:659: checking for environment variable LDFLAGS" >&5 echo "$ac_t""${LDFLAGS-no}" 1>&6 echo $ac_n "checking for environment variable LIBS""... $ac_c" 1>&6 echo "configure:662: checking for environment variable LIBS" >&5 echo "$ac_t""${LIBS-no}" 1>&6 if test "x$had_CC" = "x" ; then echo $ac_n "checking for CC environment variable""... $ac_c" 1>&6 echo "configure:668: checking for CC environment variable" >&5 echo "$ac_t"""${CC-no}"" 1>&6 fi echo $ac_n "checking for clang C compiler""... $ac_c" 1>&6 echo "configure:673: checking for clang C compiler" >&5 CLANG_CC=`which "clang" 2>/dev/null` old_CC="$CC" CC="$CLANG_CC" cat > conftest.$ac_ext < int main() { extern void exit(int status); ; return 0; } EOF if { (eval echo configure:685: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t"""$CLANG_CC"" 1>&6 else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* echo "$ac_t"""no"" 1>&6 unset CLANG_CC fi rm -rf conftest* CC="$old_CC"; unset old_CC echo $ac_n "checking if CC should now be set""... $ac_c" 1>&6 echo "configure:703: checking if CC should now be set" >&5 if test "x$CC" = "x" ; then if test "x$CLANG_CC" != "x" ; then CC="$CLANG_CC" export CC echo "$ac_t"""$CC"" 1>&6 else echo "$ac_t""no" 1>&6 fi else echo "$ac_t""no" 1>&6 fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:718: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="gcc" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:748: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" break fi done IFS="$ac_save_ifs" if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# -gt 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift set dummy "$ac_dir/$ac_word" "$@" shift ac_cv_prog_CC="$@" fi fi fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$CC"; then case "`uname -s`" in *win32* | *WIN32*) # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:799: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="cl" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi ;; esac fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 echo "configure:831: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF #line 842 "configure" #include "confdefs.h" main(){return(0);} EOF if { (eval echo configure:847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_cc_cross=no else ac_cv_prog_cc_cross=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cc_works=no fi rm -fr conftest* ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 echo "configure:873: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 echo "configure:878: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no fi fi echo "$ac_t""$ac_cv_prog_gcc" 1>&6 if test $ac_cv_prog_gcc = yes; then GCC=yes else GCC= fi ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 echo "configure:906: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then ac_cv_prog_cc_g=yes else ac_cv_prog_cc_g=no fi rm -rf conftest* fi echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 if test "$ac_test_CFLAGS" = set; then CFLAGS="$ac_save_CFLAGS" elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi # # Take note if the user is or is not exporting a CFLAGS env var. # wi_orig_CFLAGS="$CFLAGS" wi_CFLAGS_TO_ADD_LATER="" if [ -x "$HOME/bin/OS" ] ; then HOME_OS=`$HOME/bin/OS 2>/dev/null` HOME_OS="$HOME/$HOME_OS" else HOME_OS="$HOME" fi host=`uname -n 2>/dev/null | tr '[A-Z]' '[a-z]'` os=`uname -s 2>/dev/null | tr '[A-Z]' '[a-z]'` if [ "$os" = "TvoPT" ] ; then os="sunos" ; fi os_v=`uname -v 2>/dev/null | sed 's/^[^0-9.]*//;s/[^0-9.].*$//;'` os_r=`uname -r 2>/dev/null | sed 's/^[^0-9.]*//;s/[^0-9.].*$//;'` os_r1=`echo "${os_r}" | cut -c1` arch=`uname -m 2>/dev/null | tr '[A-Z]' '[a-z]'` archp=`uname -p 2>/dev/null | tr '[A-Z]' '[a-z]'` OS='' SYS='' NDEFS='' unset CDPATH # Not relevant here, but needs to be done eventually. # Special case a few systems where if your CFLAGS appear # to want to generate for 32 bit, use that mode rather # than 64 bit. # case "$os,$CFLAGS" in irix64,*-n32*) os=irix # then go to regular "irix" instead of "irix64" below. ;; esac case "$os" in osf1) case "$os_r" in 3*|4*) OS="digitalunix${os_r}-$arch" SYS=digitalunix NDEFS="$NDEFS -DDIGITAL_UNIX=$os_r1" ;; *) OS="tru64unix${os_r}-$arch" SYS=tru64unix NDEFS="$NDEFS -DTRU64UNIX=$os_r1" ;; esac ;; aix) os_lev=`/usr/bin/oslevel 2>/dev/null` if [ "$os_lev" = "" ] ; then if [ "$os_r" = "" ] ; then os_r=0 ; fi OS="aix${os_v}.${os_r}" os_int=`expr $os_v$os_r '*' 10` else os_v=`echo "$os_lev" | cut -d. -f1-3` os_v1=`echo "$os_v" | cut -d. -f1` os_v2=`echo "$os_v" | cut -d. -f2` if [ "$os_v2" = "" ] ; then os_v2=0 ; fi os_v3=`echo "$os_v" | cut -d. -f3` if [ "$os_v3" = "" ] ; then os_v3=0 ; fi os_int=`expr "$os_v1" '*' 100 + "$os_v2" '*' 10 + "$os_v3"` OS="aix${os_v}" fi SYS=aix NDEFS="$NDEFS -DAIX=${os_int}" ;; irix) OS="irix${os_r}" SYS=irix NDEFS="$NDEFS -DIRIX=$os_r1" ;; irix64) OS="irix64_${os_r}" SYS=irix64 NDEFS="$NDEFS -DIRIX=$os_r1 -DIRIX64=$os_r1" ;; hp-ux) os_r=`echo "${os_r}" | cut -d. -f2-` os_r1=`echo "$os_r" | cut -d. -f1` os_r2=`echo "${os_r}" | cut -d. -f2` os_int=`expr "$os_r1" '*' 100 + "$os_r2"` if [ "$arch" != "ia64" ] ; then arch="hppa" fi OS="hpux${os_r}-$arch" SYS=hpux NDEFS="$NDEFS -DHPUX=$os_int" ;; freebsd) if [ "$arch" = "amd64" ] ; then arch="x86_64" ; fi OS="freebsd${os_r}-$arch" os_r1=`echo "$os_r" | cut -d. -f1` os_r2=`echo "$os_r" | cut -d. -f2` if [ "$os_r2" = "" ] ; then os_r2=0 ; fi os_r3=`echo "$os_r" | cut -d. -f3` if [ "$os_r3" = "" ] ; then os_r3=0 ; fi os_int=`expr "$os_r1" '*' 100 + "$os_r2" '*' 10 + "$os_r3"` SYS=freebsd NDEFS="$NDEFS -DFREEBSD=$os_int" ;; netbsd) if [ "$arch" = "amd64" ] ; then arch="x86_64" ; fi OS="netbsd${os_r}-$arch" os_r1=`echo "$os_r" | cut -d. -f1` os_r2=`echo "$os_r" | cut -d. -f2` if [ "$os_r2" = "" ] ; then os_r2=0 ; fi os_r3=`echo "$os_r" | cut -d. -f3` if [ "$os_r3" = "" ] ; then os_r3=0 ; fi os_int=`expr "$os_r1" '*' 100 + "$os_r2" '*' 10 + "$os_r3"` NDEFS="$NDEFS -DNETBSD=$os_int" SYS=netbsd ;; openbsd) if [ "$arch" = "amd64" ] ; then arch="x86_64" ; fi OS="openbsd${os_r}-$arch" os_r1=`echo "$os_r" | cut -d. -f1` os_r2=`echo "$os_r" | cut -d. -f2` if [ "$os_r2" = "" ] ; then os_r2=0 ; fi os_r3=`echo "$os_r" | cut -d. -f3` if [ "$os_r3" = "" ] ; then os_r3=0 ; fi os_int=`expr "$os_r1" '*' 100 + "$os_r2" '*' 10 + "$os_r3"` SYS=openbsd NDEFS="$NDEFS -DOPENBSD=$os_int" ;; sco*) OS=scosv SYS=sco os_v1=`echo "$os_v" | cut -d. -f1` case "$os_v1" in [1-9]) os_v2=`echo "$os_v" | cut -d. -f2` if [ "$os_v2" = "" ] ; then os_v2=0 ; fi os_v3=`echo "$os_v" | cut -d. -f3` if [ "$os_v3" = "" ] ; then os_v3=0 ; fi os_int=`expr "$os_v1" '*' 100 + "$os_v2" '*' 10 + "$os_v3"` NDEFS="$NDEFS -DSCO=$os_int" ;; *) NDEFS="$NDEFS -DSCO=1" ;; esac ;; dynix*) OS="dynixptx${os_v}" SYS=dynixptx os_v1=`echo "$os_v" | cut -d. -f1` os_v2=`echo "$os_v" | cut -d. -f2` os_v3=`echo "$os_v" | cut -d. -f3` if [ "$os_v3" = "" ] ; then os_v3=0 ; fi os_int=`expr "$os_v1" '*' 100 + "$os_v2" '*' 10 + "$os_v3"` NDEFS="$NDEFS -DDYNIX=$os_int" ;; linux) case "$arch" in *86) arch=x86 ;; esac libc="" [ -z "$os_r" ] && os_r="2.2.26" os_r1=`echo "$os_r" | cut -d. -f1` os_r2=`echo "$os_r" | cut -d. -f2` os_r3=`echo "$os_r" | cut -d- -f1 | cut -d. -f3` os_int=`expr "$os_r1" '*' 10000 + "$os_r2" '*' 1000 + "$os_r3"` NDEFS="$NDEFS -DLINUX=$os_int" vertest="./vertest.$$" rm -f "$vertest" "$vertest.c" cat < "$vertest.c" #include #include main() { const char *ver = gnu_get_libc_version(); const char *rel = gnu_get_libc_release(); fprintf(stdout, "glibc%s\n", ver); exit(0); } EOF echo $ac_n "checking version of C library""... $ac_c" 1>&6 echo "configure:: checking version of C library" >&5 ${CC-cc} $DEFS $CPPFLAGS $CFLAGS "$vertest.c" -o "$vertest" >/dev/null 2>&1 if [ -x "$vertest" ] ; then libc=`$vertest 2>/dev/null` ; fi rm -f "$vertest" "$vertest.c" if [ "$libc" = "" ] ; then libc_sysroot=`"${CC-gcc}" -v 2>&1 | sed -n '/with-libc_sysroot/{s/^.*--with-libc_sysroot=//;s/ .*//;p;q;}'` # Only results in non-empty with a GCC cross-compiler libc_file=`/bin/ls -1 -t "${libc_sysroot}"/lib/libc.so.* 2>/dev/null | sed -n 1,1p` if [ "$libc_file" != "" ] ; then libc_file=`echo "$libc_file" | sed 's|^.*/||'` libc_file="$libc_sysroot/lib/$libc_file" elif [ -f "$libc_sysroot/usr/lib/libc.a" ] ; then libc_file="$libc_sysroot/usr/lib/libc.a" else libc_file="/error" fi libc=`strings -n 40 "$libc_file" 2>/dev/null | fgrep 'GNU C Library' | sed 's/^.*version //;s/[^0-9\.].*$//;' | sed -n 1,1p` if [ "$libc" != "" ] ; then libc="glibc${libc}" fi fi case "$libc" in glibc*) echo "$libc" 1>&6 glibc_r=`echo "$libc" | sed 's/glibc//'` glibc_r1=`echo "$glibc_r" | cut -d. -f1` glibc_r2=`echo "$glibc_r" | cut -d. -f2` glibc_r3=`echo "$glibc_r" | cut -d- -f1 | cut -d. -f3` if test "$glibc_r1" = "" ; then glibc_r1=0 ; fi if test "$glibc_r2" = "" ; then glibc_r2=0 ; fi if test "$glibc_r3" = "" ; then glibc_r3=0 ; fi glibc_int=`expr "$glibc_r1" '*' 10000 + "$glibc_r2" '*' 100 + "$glibc_r3"` NDEFS="$NDEFS -DLINUX_GLIBC=$glibc_int" libc="glibc${glibc_r1}.${glibc_r2}" OS="linux-$arch" ;; *) if test -f /lib/libc-2.1.3.so ; then NDEFS="$NDEFS -DLINUX_GLIBC=20103" libc="glibc2.1" OS="linux-$arch" elif test -f /lib/libc-2.1.2.so ; then NDEFS="$NDEFS -DLINUX_GLIBC=20102" libc="glibc2.1" OS="linux-$arch" elif test -f /lib/libc-2.1.1.so ; then NDEFS="$NDEFS -DLINUX_GLIBC=20101" libc="glibc2.1" OS="linux-$arch" elif test -f /lib/libc.so.6 ; then NDEFS="$NDEFS -DLINUX_GLIBC=20000" libc="glibc2.0" OS="linux-$arch" elif test -f /lib/libc.so.6.1 ; then NDEFS="$NDEFS -DLINUX_GLIBC=20001" libc="glibc2.0" OS="linux-$arch" else NDEFS="$NDEFS -DLINUX_LIBC=5" libc="libc5" OS="linux-$arch" fi echo "$libc" 1>&6 ;; esac SYS=linux ;; bsd/os) OS="bsdos${os_r}" SYS=bsdos NDEFS="$NDEFS -DBSDOS=$os_r1" ;; ultrix) OS="ultrix-$arch" SYS=ultrix NDEFS="$NDEFS -DULTRIX" ;; unixware) OS="unixware${os_v}" SYS=unixware os_v1=`echo "$os_v" | cut -d. -f1` case "$os_v1" in [1-9]) os_v2=`echo "$os_v" | cut -d. -f2` os_v3=`echo "$os_v" | cut -d. -f3` if [ "$os_v3" = "" ] ; then os_v3=0 ; fi os_int=`expr "$os_v1" '*' 100 + "$os_v2" '*' 10 + "$os_v3"` NDEFS="$NDEFS -DUNIXWARE=$os_int" ;; *) NDEFS="$NDEFS -DUNIXWARE=1" ;; esac ;; openunix) OS="openunix${os_v}" SYS=openunix os_v1=`echo "$os_v" | cut -d. -f1` os_v2=`echo "$os_v" | cut -d. -f2` os_v3=`echo "$os_v" | cut -d. -f3` if [ "$os_v3" = "" ] ; then os_v3=0 ; fi os_int=`expr "$os_v1" '*' 100 + "$os_v2" '*' 10 + "$os_v3"` NDEFS="$NDEFS -DOPENUNIX=$os_int -DUNIXWARE=$os_int" ;; macos*|darwin|rhapsody) OS="macosx" SYS="macosx" os_v=`perl -e '{open(F, "< /System/Library/CoreServices/SystemVersion.plist") or exit(2); my ($doc) = ""; my ($line); while (defined($line = )) { $doc .= $line; } close(F); $doc =~ s/\s+//gs; if ($doc =~ /ProductVersion<\/key>([^<]+)<\/string>/) { print , "\n"; exit(0); } exit(1); }' 2>/dev/null` if [ "$os_v" = "" ] && [ -x "$HOME/bin/macosver" ] ; then os_v=`"$HOME/bin/macosver" 2>/dev/null` fi if [ "$os_v" = "" ] ; then cat > "$HOME/macosver.c" < ProductBuildVersion 5S66 ProductName Mac OS X ProductVersion 10.1.5 */ #include #include #include #include main() { char line[256], *cp, *cp2; FILE *fp; fp = fopen("/System/Library/CoreServices/SystemVersion.plist", "r"); if (fp != NULL) { memset(line, 0, sizeof(line)); while (fgets(line, sizeof(line) - 1, fp) != NULL) { cp = strstr(line, "ProductVersion"); if (cp != NULL) { memset(line, 0, sizeof(line)); if (fgets(line, sizeof(line) - 2, fp) != NULL) { for (cp = line; ((*cp != '\0') && (! isdigit(*cp))); ) cp++; for (cp2 = cp; ((*cp2 != '\0') && (! isspace(*cp2)) && (*cp2 != '<') && (*cp2 != '>')); ) cp2++; cp2[0] = '\0'; fclose(fp); fprintf(stdout, "%s\n", cp); exit(0); } } } } fclose(fp); exit(1); } EOF ${CC-cc} "$HOME/macosver.c" -o "$HOME/macosver" > /dev/null 2>&1 os_v=`"$HOME/macosver" 2>/dev/null` mv "$HOME/macosver" "$HOME/bin/macosver" 2>/dev/null rm -f "$HOME/macosver.c" "$HOME/macosver" fi if [ "$os_v" != "" ] ; then OS="macosx${os_v}" os_v1=`echo "$os_v" | cut -d. -f1` os_v2=`echo "$os_v" | cut -d. -f2` os_v3=`echo "$os_v" | cut -d. -f3` if [ "$os_v3" = "" ] ; then os_v3=0 ; fi os_int=`expr "$os_v1" '*' 1000 + "$os_v2" '*' 100 + "$os_v3"` NDEFS="$NDEFS -DMACOSX=$os_int" else NDEFS="$NDEFS -DMACOSX" fi ;; sunos) if [ "$arch" = "" ] ; then arch="sparc" ; fi if [ "$archp" = "" ] ; then archp="$arch" ; fi case "$os_r" in 5.*) case "$os_r" in 5.[023456]*|5.1) os_r=`echo "$os_r" | sed 's/^5/2/;'` os_r1=`echo "$os_r" | cut -d. -f1` os_r2=`echo "$os_r" | cut -d. -f2` if [ "$os_r2" = "" ] ; then os_r2=0 ; fi os_r3=`echo "$os_r" | cut -d. -f3` if [ "$os_r3" = "" ] ; then os_r3=0 ; fi os_int=`expr "$os_r1" '*' 100 + "$os_r2" '*' 10 + "$os_r3"` ;; 5.[789]*|5.1[0-9]*) os_r1=`echo "$os_r" | cut -d. -f2` os_r2=`echo "$os_r" | cut -d. -f3` if [ "$os_r2" = "" ] ; then os_r2=0 ; fi os_r3=`echo "$os_r" | cut -d. -f4` if [ "$os_r3" = "" ] ; then os_r3=0 ; fi os_int=`expr "$os_r1" '*' 100 + "$os_r2" '*' 10 + "$os_r3"` os_r=`echo "$os_r" | cut -c3-` ;; esac case "`/usr/bin/isainfo -n 2>/dev/null`" in amd64) OS="solaris${os_r}-x86_64" ;; *86) OS="solaris${os_r}-x86" ;; sparcv9*|sparcv1[0-9]*) OS="solaris${os_r}-sparc64" ;; *) OS="solaris${os_r}-$archp" ;; esac NDEFS="$NDEFS -DSOLARIS=$os_int" SYS=solaris ;; 4.*) OS="sunos${os_r}-sparc" NDEFS="$NDEFS -DSUNOS=\\\"$os_r\\\"" SYS=sunos ;; *) os_r1=`echo "$os_r" | cut -d. -f1` if [ "$os_r1" = "" ] ; then os_r1=0 ; fi os_r2=`echo "$os_r" | cut -d. -f2` if [ "$os_r2" = "" ] ; then os_r2=0 ; fi os_r3=`echo "$os_r" | cut -d. -f3` if [ "$os_r3" = "" ] ; then os_r3=0 ; fi os_int=`expr "$os_r1" '*' 100 + "$os_r2" '*' 10 + "$os_r3"` OS="solaris${os_r}-$archp" NDEFS="$NDEFS -DSOLARIS=$os_int" SYS=solaris ;; esac ;; *) OS="$os" SYS="$os" if grep Novell /usr/include/sys/types.h ; then OS="unixware${os_v}" SYS="unixware" fi ;; esac if [ "x$wi_cv_OS" != "x" ] && [ "$wi_cv_OS" != "$OS" ] ; then { echo "configure: error: Your config.cache file is invalid. It was created on $wi_cv_OS, but this machine is running $OS. Remove the config.cache file if you wish to continue." 1>&2; exit 1; } fi wi_cv_OS="$OS" if test "x$HOME_OS" = "x" && test "x$OS" != "x" ; then HOME_OS="$HOME/$OS" fi echo $ac_n "checking platform""... $ac_c" 1>&6 echo "configure:1394: checking platform" >&5 echo "$ac_t"""$OS"" 1>&6 case "$os" in linux) OS="linux-$arch-$libc" ;; esac if test -f sh/install-sh ; then chmod 755 sh/*.sh sh/config.* sh/install-sh ; fi ac_aux_dir= for ac_dir in sh $srcdir/sh; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break fi done if test -z "$ac_aux_dir"; then { echo "configure: error: can not find install-sh or install.sh in sh $srcdir/sh" 1>&2; exit 1; } fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. echo $ac_n "checking if the C compiler can use precompiled headers""... $ac_c" 1>&6 echo "configure:1426: checking if the C compiler can use precompiled headers" >&5 if eval "test \"`echo '$''{'wi_cv_cc_precomp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else result="no" if test "${use_macosx_universal}" != no ; then # Precompiling the headers doesn't seem to work when building universal binaries use_precomp=no fi if test "${use_precomp-yes}" != no ; then wi_cv_cc_precomp_type="unknown" rm -f pchtest.h pchtest.p pchtest.c pchtest.o pchtest csetc.pch pchtest.pch pchtest.h.gch cat < pchtest.h /* pchtest.h */ #include #include #include #define FOOBAR 33 /* Make sure it can compile custom headers too */ EOF cat < pchtest.c /* pchtest.c */ #include "pchtest.h" int main(int argc, char **argv) { if (FOOBAR == 33) exit(0); exit(1); } EOF if test "$GCC" = yes ; then # # Try gcc 3.4's built-in implementation first # echo ${CC-cc} $CPPFLAGS pchtest.h -c >&5 ${CC-cc} $CPPFLAGS pchtest.h -c >&5 2>&5 if test -f pchtest.h.gch ; then # # Good, the .gch file was created. # Odds are we're good to go. # echo "Successfully compiled pchtest.h into the precompiled header file pchtest.h.gch." >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* result="yes" ; wi_cv_cc_precomp_type="gcc_gch_files" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* result="no" fi rm -rf conftest* else echo "This version of GCC did not compile pchtest.h into the precompiled header file pchtest.h.gch." >&5 # # See if Apple's implementation works. # echo ${CC-cc} $CPPFLAGS -precomp pchtest.h -o pchtest.p >&5 ${CC-cc} $CPPFLAGS -precomp pchtest.h -o pchtest.p >&5 2>&5 if test -s pchtest.p ; then cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* result="yes" ; wi_cv_cc_precomp_type="gcc_dash_precomp" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* result="no" fi rm -rf conftest* fi fi elif test "${result}_${SYS-aix}_${GCC}" = "no_aix_no" ; then # # AIX xlc # echo ${CC-cc} $CPPFLAGS -qusepcomp -qgenpcomp pchtest.c -o pchtest >&5 ${CC-cc} $CPPFLAGS -qusepcomp -qgenpcomp pchtest.c -o pchtest >&5 2>&5 if test -s pchtest ; then result="yes" wi_cv_cc_precomp_type="xlc" wi_CFLAGS_TO_ADD_LATER="$wi_CFLAGS_TO_ADD_LATER -qusepcomp -qgenpcomp" fi else # # IRIX, Compaq C, Sun C # cat < pchtest.c #include "pchtest.h" #pragma hdrstop #include int main(int argc, char **argv) { if (FOOBAR == 33) exit(0); exit(1); } EOF for pchflags in "-xpch=auto" "-pch -no_pch_messages" "-pch" "-LANG:pch" do rm -rf SunWS_cache pchtest.pch pchtest.cpch echo ${CC-cc} $CPPFLAGS $pchflags pchtest.c -o pchtest >&5 ${CC-cc} $CPPFLAGS $pchflags pchtest.c -o pchtest >&5 2>&5 if test -f pchtest.pch ; then result="yes" wi_cv_cc_precomp_type="ccc" wi_CFLAGS_TO_ADD_LATER="$wi_CFLAGS_TO_ADD_LATER $pchflags" cat >> confdefs.h <<\EOF #define PRAGMA_HDRSTOP 1 EOF break elif test -d SunWS_cache ; then result="yes" wi_cv_cc_precomp_type="SunWS" wi_CFLAGS_TO_ADD_LATER="$wi_CFLAGS_TO_ADD_LATER $pchflags -erroff=E_PCH_CONDITIONAL_PREFIX" cat >> confdefs.h <<\EOF #define PRAGMA_HDRSTOP 1 EOF break fi done unset pchflags fi rm -rf SunWS_cache pchtest.h pchtest.p pchtest.c pchtest.o pchtest csetc.pch pchtest.pch pchtest.cpch pchtest.h.gch fi wi_cv_cc_precomp="$result" fi echo "$ac_t""$wi_cv_cc_precomp" 1>&6 wi_request_no_y2k_warnings=yes echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 echo "configure:1581: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # This must be in double quotes, not single quotes, because CPP may get # substituted into the Makefile and "${CC-cc}" will confuse make. CPP="${CC-cc} -E" # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1602: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1619: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1636: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP=/lib/cpp fi rm -rf conftest* fi rm -rf conftest* fi rm -rf conftest* ac_cv_prog_CPP="$CPP" fi CPP="$ac_cv_prog_CPP" else ac_cv_prog_CPP="$CPP" fi echo "$ac_t""$CPP" 1>&6 wi_cv_lfs_type="lfs" if test "$SYS" = "linux" ; then case "$libc" in libc5) wi_cv_lfs_type="lfs64" ;; glibc2.[012]*) wi_cv_lfs_type="lfs64" ;; esac fi case "$OS" in bsdos*) wi_cv_lfs_type="lfs64" ;; freebsd[234]*) wi_cv_lfs_type="lfs64" ;; hpux9.*|hpux10.*) wi_cv_lfs_type="lfs64" ;; solaris2.*|solaris7*) wi_cv_lfs_type="lfs64" ;; esac if test "$wi_cv_lfs_type" = "lfs64" ; then if test "$GCC" = yes ; then echo $ac_n "checking the version of GCC""... $ac_c" 1>&6 echo "configure:1694: checking the version of GCC" >&5 if eval "test \"`echo '$''{'wi_cv_gcc_version'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else wi_cv_gcc_version=`$CC -v 2>&1 | sed -n '/gcc version/{s/^.*gcc version//;s/^[^1-9]*//;s/\ .*//;p;q;}'` fi echo "$ac_t""$wi_cv_gcc_version" 1>&6 else wi_cv_gcc_version="0" fi if test "${SYS}_${GCC}" != solaris_no ; then wi_cv_cc_is_sunwspro_cc="no" wi_cv_sunwspro_cc_version="0" wi_cv_sunwspro_cc_version2="0" else echo $ac_n "checking if the C compiler is Sun WorkShop C""... $ac_c" 1>&6 echo "configure:1717: checking if the C compiler is Sun WorkShop C" >&5 if eval "test \"`echo '$''{'wi_cv_cc_is_sunwspro_cc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # # cc: Sun WorkShop 6 update 2 C 5.3 2001/05/15 # usage: cc [ options] files. Use 'cc -flags' for details # # cc: WorkShop Compilers 4.2 30 Oct 1996 C 4.2 # usage: cc [ options] files. Use 'cc -flags' for details # wi_cv_sunwspro_cc_version=`$CC -V 2>&1 | sed -n '/WorkShop.*C\ [1-9]/{s/^.*C/C/;s/^C\ \([^\ ]*\).*/\1/;p;q;}'` case "$wi_cv_sunwspro_cc_version" in [1-9]*) wi_cv_cc_is_sunwspro_cc="yes" ver1=`echo "$wi_cv_sunwspro_cc_version" | cut -d. -f1` ver2=`echo "$wi_cv_sunwspro_cc_version" | cut -d. -f2` ver3=0 wi_cv_sunwspro_cc_version2=`expr "$ver1" '*' 100 + "$ver2" "*" 10 + "$ver3"` unset ver1 ver2 ver3 ;; *) wi_cv_cc_is_sunwspro_cc="no" wi_cv_sunwspro_cc_version="0" wi_cv_sunwspro_cc_version2="0" ;; esac fi echo "$ac_t""$wi_cv_cc_is_sunwspro_cc" 1>&6 if test "$wi_cv_cc_is_sunwspro_cc" = yes ; then echo $ac_n "checking output of "cc -V" to determine version of Sun WorkShop C""... $ac_c" 1>&6 echo "configure:1751: checking output of "cc -V" to determine version of Sun WorkShop C" >&5 echo "$ac_t"""version $wi_cv_sunwspro_cc_version"" 1>&6 fi fi echo $ac_n "checking if we should customize your CFLAGS environment variable""... $ac_c" 1>&6 echo "configure:1758: checking if we should customize your CFLAGS environment variable" >&5 wi_replace_O_with_g="no" case "$wi_orig_CFLAGS" in "") wi_replace_O_with_g="no" ;; "-g -O2") wi_replace_O_with_g="no" ;; "-g -O") wi_replace_O_with_g="no" ;; "-O2 -g") wi_replace_O_with_g="no" ;; "-O -g") wi_replace_O_with_g="no" ;; -g) wi_replace_O_with_g="yes" ;; esac # # See if your CFLAGS environment variable wasn't set or exported, # or if you are using a conservative default. If so, we will # add some additional flags for better performance, warning reporting, # etc. # # Note we are now checking the current value of CFLAGS, which may have # been changed by configure. # wi_os_default_cflags="no" case "$CFLAGS" in "") wi_os_default_cflags="yes" ;; "-g -O2") wi_os_default_cflags="yes" ;; "-g -O") wi_os_default_cflags="yes" ;; "-O2 -g") wi_os_default_cflags="yes" ;; "-O -g") wi_os_default_cflags="yes" ;; -g) wi_os_default_cflags="yes" ;; -O) wi_os_default_cflags="yes" ;; -O2) wi_os_default_cflags="yes" ;; esac CC_is_clang="no" case "$CC" in *clang*) CC_is_clang="yes" ;; *) cc_dash_v=`${CC-gcc} -v 2>&1 | grep clang 2>/dev/null` if test -n "$cc_dash_v" ; then CC_is_clang="yes" fi ;; esac if test "$wi_os_default_cflags" = yes ; then if test "$CC_is_clang" = yes ; then wi_os_default_cflags="-Weverything -Wno-unknown-warning-option -Wno-disabled-macro-expansion -Wno-missing-variable-declarations -Wno-date-time" if test "$wi_replace_O_with_g" = yes ; then wi_os_default_cflags="-g $wi_os_default_cflags" else wi_os_default_cflags="-O2 $wi_os_default_cflags" fi elif test "$GCC" = yes ; then # # gcc # wi_gcc_optimizer_flags='' case "$wi_cv_gcc_version" in 2.7.*|2.8.*|2.9*) wi_os_default_cflags="-W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wbad-function-cast -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wmissing-declarations -Winline" ;; 345.*) wi_os_default_cflags="-W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wbad-function-cast -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wmissing-declarations -Winline -Wmissing-format-attribute -Wformat-security" wi_gcc_optimizer_flags='-Wdisabled-optimization' ;; *) wi_os_default_cflags="-W -Wall" ;; esac if test "$wi_replace_O_with_g" = yes ; then wi_os_default_cflags="-g $wi_os_default_cflags" else wi_os_default_cflags="-O2 $wi_os_default_cflags" if test "$wi_gcc_optimizer_flags" != "" ; then wi_os_default_cflags="$wi_os_default_cflags $wi_gcc_optimizer_flags" fi fi case "$OS" in hpux*) wi_os_default_cflags="-D_HPUX_SOURCE $wi_os_default_cflags" ;; bsdos*) wi_os_default_cflags=`echo "$wi_os_default_cflags" | sed 's/\ -Wcast-qual//g'` # avoid va_start() problem wi_os_default_cflags=`echo "$wi_os_default_cflags" | sed 's/\ -Wredundant-decls//g'` ;; openbsd*|unixware*|openunix*) wi_os_default_cflags=`echo "$wi_os_default_cflags" | sed 's/\ -Wredundant-decls//g'` ;; esac else # # regular cc # case "${wi_replace_O_with_g}_${OS}" in no_aix*) wi_os_default_cflags="-O -qinfo=cmp:cnd:dcl:eff:gen:ini:par:pro:rea:use -qlonglong -qro -qroconst -qlanglvl=extended -qsrcmsg -qmaxmem=20480 -qsuppress=1506-469:1506-409" ;; yes_aix*) wi_os_default_cflags="-g -qinfo=cmp:cnd:dcl:eff:gen:ini:par:pro:rea:use -qlonglong -qro -qroconst -qlanglvl=extended -qsrcmsg -qmaxmem=20480 -qsuppress=1506-469:1506-409" ;; no_irix2345*|no_irix6.01234*) wi_os_default_cflags="-O2 -xansi -fullwarn -use_readonly_const -G0 -rdata_shared" ;; yes_irix2345*|yes_irix6.01234*) wi_os_default_cflags="-g -xansi -fullwarn -use_readonly_const -G0 -rdata_shared" ;; no_irix*) wi_os_default_cflags="-O2 -IPA -xansi -fullwarn -use_readonly_const -G0 -rdata_shared -woff 1174" ;; yes_irix*) wi_os_default_cflags="-g -xansi -fullwarn -use_readonly_const -G0 -rdata_shared -woff 1174" ;; no_digitalunix*) wi_os_default_cflags="-O4 -std1 -portable -readonly_strings" ;; yes_digitalunix*) wi_os_default_cflags="-g -std1 -portable -readonly_strings" ;; no_hpux*) wi_os_default_cflags="-Ae +O2 +Ovolatile +Olibcalls +ESlit +w1 +DAportable" ;; yes_hpux*) wi_os_default_cflags="-Ae -g +w1 +DAportable" ;; no_solaris*86|no_solaris*intel) # Not really any significant differences # from the sparc flags, but reserved for # future use. # if test "$wi_cv_sunwspro_cc_version2" -ge 530 ; then wi_os_default_cflags="-xipo -xO4 -xc99 -xbuiltin -xstrconst -dalign -Qn -errtags=yes -erroff=E_END_OF_LOOP_CODE_NOT_REACHED -mc" else wi_os_default_cflags="-xO4 -xstrconst -dalign -Qn" fi ;; yes_solaris*86|yes_solaris*intel) if test "$wi_cv_sunwspro_cc_version2" -ge 530 ; then wi_os_default_cflags="-g -xc99 -xstrconst -dalign -Qn -errtags=yes -erroff=E_END_OF_LOOP_CODE_NOT_REACHED" else wi_os_default_cflags="-g -xstrconst -dalign -Qn" fi ;; no_solaris*) if test "$wi_cv_sunwspro_cc_version2" -ge 530 ; then wi_os_default_cflags="-xipo -xO5 -xc99 -xbuiltin -xstrconst -dalign -Qn -errtags=yes -erroff=E_END_OF_LOOP_CODE_NOT_REACHED -mc" else wi_os_default_cflags="-xO4 -xstrconst -dalign -Qn" fi ;; yes_solaris*) if test "$wi_cv_sunwspro_cc_version2" -ge 530 ; then wi_os_default_cflags="-g -xc99 -xstrconst -dalign -Qn -errtags=yes -erroff=E_END_OF_LOOP_CODE_NOT_REACHED" else wi_os_default_cflags="-g -xstrconst -dalign -Qn" fi ;; no_tru64*) wi_os_default_cflags="-O4 -tune host -std1 -readonly_strings -portable -warnprotos -msg_enable level6 -msg_disable longlongtype,hexoctunsign,unusedincl,unnecincl,nestincl,unusedtop,unknownmacro,ignorecallval,strctpadding,truncintasn,truncintcast,trunclongcast,ansialiascast,conststocls,unrefsdecl,subscrbounds2,intconcastsgn,longlongsufx,unreachcode,valuepres,embedcomment" ;; yes_tru64*) wi_os_default_cflags="-g -std1 -readonly_strings -portable -warnprotos -msg_enable level6 -msg_disable longlongtype,hexoctunsign,unusedincl,unnecincl,nestincl,unusedtop,unknownmacro,ignorecallval,strctpadding,truncintasn,truncintcast,trunclongcast,ansialiascast,conststocls,unrefsdecl,subscrbounds2,intconcastsgn,longlongsufx,unreachcode,valuepres,embedcomment" ;; no_unixware*|no_openunix*) wi_os_default_cflags='-O -K inline -K host -Q n' ;; yes_unixware*|yes_openunix*) wi_os_default_cflags='-g -K host -Q n' ;; *) wi_os_default_cflags="no" ;; esac fi fi if test "$wi_os_default_cflags" != "no" ; then CFLAGS="$wi_os_default_cflags" fi echo "$ac_t""$wi_os_default_cflags" 1>&6 case "$OS" in "solaris"*"-x86_64") if test "$GCC" = "yes" ; then case "$CFLAGS" in *"-m64"*) ;; *) CFLAGS="-m64 $CFLAGS" ;; esac fi ;; esac if test "x$wi_request_no_y2k_warnings" = xyes ; then case "${wi_cv_gcc_version-0}" in 0|1.*|2.[012345678].*) ;; *) case "$CFLAGS" in *-Wno-format-y2k*) ;; *) oldCFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wno-format-y2k" # # Now check if this version of GCC # accepts this flag... # cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CFLAGS="$oldCFLAGS" fi rm -rf conftest* unset oldCFLAGS ;; esac ;; esac fi echo $ac_n "checking for ldd""... $ac_c" 1>&6 echo "configure:2024: checking for ldd" >&5 if eval "test \"`echo '$''{'wi_cv_prog_ldd'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else wi_cv_prog_ldd="no" cat > conftest.c < #include int main(int argc, char **argv) { (void) printf("%s\n", ((argc > 66) ? argv[0] : "Hello World")); exit(0); } EOF ${CC-cc} $CFLAGS $CPPFLAGS conftest.c -o conftest 1>&5 wi_cv_prog_ldd=`ldd ./conftest 2>&1 | sed -n -e '/lib/{s/.*/yes/g;p;q;}' -e '${s/.*/no/g;p;q;}'` /bin/rm -rf conftest* fi echo "$ac_t""$wi_cv_prog_ldd" 1>&6 if test "$use_ssp" = yes ;then ac_cv_ssp_flags='-fstack-protector-all -D_FORTIFY_SOURCE=2' oldCFLAGS="$CFLAGS" # remove existing ssp flags, if present CFLAGS=`echo "$CFLAGS" | sed 's/-D_FORTIFY_SOURCE//g'` CFLAGS=`echo "$CFLAGS" | sed 's/-D_FORTIFY_SOURCE=.//g'` CFLAGS=`echo "$CFLAGS" | sed 's/-fstack-prot[a-z\-]*//g'` # try these CFLAGS="$CFLAGS $ac_cv_ssp_flags" cat > conftest.$ac_ext < char testvar[64]; int main() { strncpy(testvar, "hello world", sizeof(testvar) - 1); ; return 0; } EOF if { (eval echo configure:2071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CFLAGS="$oldCFLAGS" ; ac_cv_ssp_flags="no" fi rm -rf conftest* if test "$SYS" = macosx ; then if test "${use_macosx_universal}" != no ; then CFLAGS="$oldCFLAGS" ; ac_cv_ssp_flags="not compatible with Mac OS X universal" fi fi unset oldCFLAGS echo $ac_n "checking if stack protection CFLAGS can be used""... $ac_c" 1>&6 echo "configure:2087: checking if stack protection CFLAGS can be used" >&5 echo "$ac_t""$ac_cv_ssp_flags" 1>&6 fi echo $ac_n "checking if compiled programs use a shared library version of libgcc""... $ac_c" 1>&6 echo "configure:2093: checking if compiled programs use a shared library version of libgcc" >&5 if eval "test \"`echo '$''{'wi_cv_shared_libgcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$wi_cv_prog_ldd" = no ; then wi_cv_shared_libgcc="unknown (ldd is not available to check)" else cat > conftest.c < #include int main(int argc, char **argv) { (void) printf("%s\n", ((argc > 66) ? argv[0] : "Hello World")); exit(0); } EOF ${CC-cc} $CFLAGS $CPPFLAGS conftest.c -o conftest 1>&5 wi_cv_shared_libgcc=`ldd ./conftest 2>&1 | sed -n -e '/libgcc/{s/.*/yes/g;p;q;}' -e '${s/.*/no/g;p;q;}'` /bin/rm -rf conftest* fi fi echo "$ac_t""$wi_cv_shared_libgcc" 1>&6 if test "$wi_cv_shared_libgcc" != no ; then if test "x$ac_cv_prog_gcc" = "xyes" ; then case "$CFLAGS" in *-static-libgcc*) ;; *) oldCFLAGS="$CFLAGS" CFLAGS="$CFLAGS -static-libgcc" # # Now check if this version of GCC # accepts this flag... # cat > conftest.$ac_ext < char testvar[64]; int main() { strncpy(testvar, "hello world", sizeof(testvar) - 1); ; return 0; } EOF if { (eval echo configure:2142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CFLAGS="$oldCFLAGS" fi rm -rf conftest* unset oldCFLAGS ;; esac fi fi if test "x$cross_compiling" = "xyes" ; then if test "x$ac_cv_prog_gcc" = "xyes" ; then case "$CFLAGS" in *-static-libgcc*) ;; *) oldCFLAGS="$CFLAGS" CFLAGS="$CFLAGS -static-libgcc" # # Now check if this version of GCC # accepts this flag... # cat > conftest.$ac_ext < char testvar[64]; int main() { strncpy(testvar, "hello world", sizeof(testvar) - 1); ; return 0; } EOF if { (eval echo configure:2183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CFLAGS="$oldCFLAGS" fi rm -rf conftest* unset oldCFLAGS ;; esac fi fi add_O0="no" if [ "$NOOPTCFLAGS" = "" ] ; then NOOPTCFLAGS=`echo "$CFLAGS" | sed 's/[-+]O[0-9A-Za-z]*//g;s/-xO[0-9]//g;s/-Wc,-O3//g;s/-IPA//g;s/-xipo=?[0-9]?//g;s/\ \ */ /g;s/^\ *//;s/\ *$//;'` if [ "$GCC" = "yes" ] ; then add_O0="yes" else case "$CC" in ccc|*/ccc) # Compaq CC add_O0="yes" ;; esac fi fi if [ "$DEBUGCFLAGS" = "" ] ; then DEBUGCFLAGS="-g $NOOPTCFLAGS" fi if [ "$add_O0" = yes ] ; then NOOPTCFLAGS="-O0 $NOOPTCFLAGS" fi # # Was it ./configure --enable-debug ? # echo $ac_n "checking if this is a debug build""... $ac_c" 1>&6 echo "configure:2223: checking if this is a debug build" >&5 if test "$DEBUGBUILD" = yes ; then echo "$ac_t""yes" 1>&6 CFLAGS="$DEBUGCFLAGS" else echo "$ac_t""no" 1>&6 fi result="no" wi_cv_lfs64="no" if test "os_${os}_gcc_${GCC}" = os_hp-ux_gcc_yes ; then CFLAGS=`echo "$CFLAGS" | sed s/-D__STDC_EXT__//g` echo $ac_n "checking if -D__STDC_EXT__ is needed with GCC on HP-UX""... $ac_c" 1>&6 echo "configure:2237: checking if -D__STDC_EXT__ is needed with GCC on HP-UX" >&5 if test "$cross_compiling" = yes; then # action if cross-compiling, guess CFLAGS="-D__STDC_EXT__ $CFLAGS" echo "$ac_t""(guessing) yes" 1>&6 else cat > conftest.$ac_ext < main() { #ifdef __STDC_EXT__ if (__STDC_EXT__ == 0) exit(1); /* have __STDC_EXT__=0 */ exit(0); /* have __STDC_EXT__=1 */ #else exit(1); /* do not have __STDC_EXT__ */ #endif } EOF if { (eval echo configure:2262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true # # Already have it defined. # echo "$ac_t""no" 1>&6 else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false # # Not defined -- we need to define it then. # This is required for the extended # namespace symbols for Large Files. # CFLAGS="-D__STDC_EXT__ $CFLAGS" echo "$ac_t""yes" 1>&6 fi rm -fr conftest* fi fi for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:2295: checking for $ac_hdr" >&5 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:2305: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -rf conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done if test "x$ac_cv_sizeof_stat_st_size" = x ; then echo $ac_n "checking size of st_size field in struct stat""... $ac_c" 1>&6 echo "configure:2334: checking size of st_size field in struct stat" >&5 if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for before calling wi_SIZEOF_ST_SIZE." 1>&2; exit 1; } fi if test "$cross_compiling" = yes; then # action if cross compiling x="unknown" ac_cv_sizeof_stat_st_size="4" rm -f conftest.out else cat > conftest.$ac_ext < #endif #include #include #include #include main() { struct stat x; FILE *fp; fp = fopen("conftest.out", "w"); if (fp != NULL) { fprintf(fp, "%u\n", (unsigned int) sizeof(x.st_size)); fclose(fp); exit(0); /* OK */ } exit(1); /* Not OK */ } EOF if { (eval echo configure:2379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true x=`cat conftest.out` case "$x" in [0-9]*) ac_cv_sizeof_stat_st_size="$x" ;; *) x="failed" ac_cv_sizeof_stat_st_size="4" ;; esac rm -f conftest.out else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false x="failed" ac_cv_sizeof_stat_st_size="4" rm -f conftest.out fi rm -fr conftest* fi echo "$ac_t""$x" 1>&6 fi if test "x$ac_cv_sizeof_off_t" = x ; then echo $ac_n "checking size of off_t""... $ac_c" 1>&6 echo "configure:2415: checking size of off_t" >&5 if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for before calling wi_SIZEOF_OFF_T." 1>&2; exit 1; } fi if test "$cross_compiling" = yes; then # action if cross compiling x="unknown" ac_cv_sizeof_off_t="4" rm -f conftest.out else cat > conftest.$ac_ext < #endif #include #include #include #include main() { off_t x = 0; FILE *fp; fp = fopen("conftest.out", "w"); if (fp != NULL) { fprintf(fp, "%u\n", (unsigned int) sizeof(x)); fclose(fp); exit(0); /* OK */ } exit(1); /* Not OK */ } EOF if { (eval echo configure:2460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true x=`cat conftest.out` case "$x" in [0-9]*) ac_cv_sizeof_off_t="$x" ;; *) x="failed" ac_cv_sizeof_off_t="4" ;; esac rm -f conftest.out else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false x="failed" ac_cv_sizeof_off_t="4" rm -f conftest.out fi rm -fr conftest* fi echo "$ac_t""$x" 1>&6 fi if test "$ac_cv_sizeof_stat_st_size" -le 4 || test "$ac_cv_sizeof_off_t" -le 4 ; then unset ac_cv_sizeof_stat_st_size ac_cv_sizeof_off_t case "$CFLAGS" in *-D_LARGEFILE64_SOURCE*) result="already included -D_LARGEFILE64_SOURCE" ;; *) CFLAGS="-D_LARGEFILE64_SOURCE $CFLAGS" DEBUGCFLAGS="-D_LARGEFILE64_SOURCE $DEBUGCFLAGS" NOOPTCFLAGS="-D_LARGEFILE64_SOURCE $NOOPTCFLAGS" result="-D_LARGEFILE64_SOURCE" ;; esac wi_cv_lfs64="yes" echo $ac_n "checking size of st_size field in struct stat64""... $ac_c" 1>&6 echo "configure:2509: checking size of st_size field in struct stat64" >&5 if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for before calling wi_SIZEOF_STAT64_ST_SIZE." 1>&2; exit 1; } fi if test "$cross_compiling" = yes; then # action if cross compiling x="unknown" ac_cv_sizeof_stat64_st_size="8" rm -f conftest.out else cat > conftest.$ac_ext < #endif #include #include #include #include main() { struct stat64 x; FILE *fp; fp = fopen("conftest.out", "w"); if (fp != NULL) { fprintf(fp, "%u\n", (unsigned int) sizeof(x.st_size)); fclose(fp); exit(0); /* OK */ } exit(1); /* Not OK */ } EOF if { (eval echo configure:2554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true x=`cat conftest.out` case "$x" in [0-9]*) cat >> confdefs.h <&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false x="failed" ac_cv_sizeof_stat64_st_size="4" rm -f conftest.out fi rm -fr conftest* fi echo "$ac_t""$x" 1>&6 echo $ac_n "checking size of off64_t""... $ac_c" 1>&6 echo "configure:2592: checking size of off64_t" >&5 if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for before calling wi_SIZEOF_OFF64_T." 1>&2; exit 1; } fi if test "$cross_compiling" = yes; then # action if cross compiling x="unknown" ac_cv_sizeof_off64_t="8" rm -f conftest.out else cat > conftest.$ac_ext < #endif #include #include #include #include main() { off64_t x = 0; FILE *fp; fp = fopen("conftest.out", "w"); if (fp != NULL) { fprintf(fp, "%u\n", (unsigned int) sizeof(x)); fclose(fp); exit(0); /* OK */ } exit(1); /* Not OK */ } EOF if { (eval echo configure:2637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true x=`cat conftest.out` case "$x" in [0-9]*) cat >> confdefs.h <&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false x="failed" ac_cv_sizeof_off64_t="4" rm -f conftest.out fi rm -fr conftest* fi echo "$ac_t""$x" 1>&6 echo $ac_n "checking size of st_size field in struct stat""... $ac_c" 1>&6 echo "configure:2675: checking size of st_size field in struct stat" >&5 if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for before calling wi_SIZEOF_ST_SIZE." 1>&2; exit 1; } fi if test "$cross_compiling" = yes; then # action if cross compiling x="unknown" ac_cv_sizeof_stat_st_size="4" rm -f conftest.out else cat > conftest.$ac_ext < #endif #include #include #include #include main() { struct stat x; FILE *fp; fp = fopen("conftest.out", "w"); if (fp != NULL) { fprintf(fp, "%u\n", (unsigned int) sizeof(x.st_size)); fclose(fp); exit(0); /* OK */ } exit(1); /* Not OK */ } EOF if { (eval echo configure:2720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true x=`cat conftest.out` case "$x" in [0-9]*) ac_cv_sizeof_stat_st_size="$x" ;; *) x="failed" ac_cv_sizeof_stat_st_size="4" ;; esac rm -f conftest.out else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false x="failed" ac_cv_sizeof_stat_st_size="4" rm -f conftest.out fi rm -fr conftest* fi echo "$ac_t""$x" 1>&6 echo $ac_n "checking size of off_t""... $ac_c" 1>&6 echo "configure:2754: checking size of off_t" >&5 if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for before calling wi_SIZEOF_OFF_T." 1>&2; exit 1; } fi if test "$cross_compiling" = yes; then # action if cross compiling x="unknown" ac_cv_sizeof_off_t="4" rm -f conftest.out else cat > conftest.$ac_ext < #endif #include #include #include #include main() { off_t x = 0; FILE *fp; fp = fopen("conftest.out", "w"); if (fp != NULL) { fprintf(fp, "%u\n", (unsigned int) sizeof(x)); fclose(fp); exit(0); /* OK */ } exit(1); /* Not OK */ } EOF if { (eval echo configure:2799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true x=`cat conftest.out` case "$x" in [0-9]*) ac_cv_sizeof_off_t="$x" ;; *) x="failed" ac_cv_sizeof_off_t="4" ;; esac rm -f conftest.out else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false x="failed" ac_cv_sizeof_off_t="4" rm -f conftest.out fi rm -fr conftest* fi echo "$ac_t""$x" 1>&6 fi if test "x$ac_cv_sizeof_stat_st_size" != x ; then cat >> confdefs.h <> confdefs.h <&6 echo "configure:2847: checking if we should add CFLAGS for LFS64 support" >&5 echo "$ac_t""$result" 1>&6 else if test "$GCC" = yes ; then echo $ac_n "checking the version of GCC""... $ac_c" 1>&6 echo "configure:2858: checking the version of GCC" >&5 if eval "test \"`echo '$''{'wi_cv_gcc_version'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else wi_cv_gcc_version=`$CC -v 2>&1 | sed -n '/gcc version/{s/^.*gcc version//;s/^[^1-9]*//;s/\ .*//;p;q;}'` fi echo "$ac_t""$wi_cv_gcc_version" 1>&6 else wi_cv_gcc_version="0" fi if test "${SYS}_${GCC}" != solaris_no ; then wi_cv_cc_is_sunwspro_cc="no" wi_cv_sunwspro_cc_version="0" wi_cv_sunwspro_cc_version2="0" else echo $ac_n "checking if the C compiler is Sun WorkShop C""... $ac_c" 1>&6 echo "configure:2881: checking if the C compiler is Sun WorkShop C" >&5 if eval "test \"`echo '$''{'wi_cv_cc_is_sunwspro_cc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # # cc: Sun WorkShop 6 update 2 C 5.3 2001/05/15 # usage: cc [ options] files. Use 'cc -flags' for details # # cc: WorkShop Compilers 4.2 30 Oct 1996 C 4.2 # usage: cc [ options] files. Use 'cc -flags' for details # wi_cv_sunwspro_cc_version=`$CC -V 2>&1 | sed -n '/WorkShop.*C\ [1-9]/{s/^.*C/C/;s/^C\ \([^\ ]*\).*/\1/;p;q;}'` case "$wi_cv_sunwspro_cc_version" in [1-9]*) wi_cv_cc_is_sunwspro_cc="yes" ver1=`echo "$wi_cv_sunwspro_cc_version" | cut -d. -f1` ver2=`echo "$wi_cv_sunwspro_cc_version" | cut -d. -f2` ver3=0 wi_cv_sunwspro_cc_version2=`expr "$ver1" '*' 100 + "$ver2" "*" 10 + "$ver3"` unset ver1 ver2 ver3 ;; *) wi_cv_cc_is_sunwspro_cc="no" wi_cv_sunwspro_cc_version="0" wi_cv_sunwspro_cc_version2="0" ;; esac fi echo "$ac_t""$wi_cv_cc_is_sunwspro_cc" 1>&6 if test "$wi_cv_cc_is_sunwspro_cc" = yes ; then echo $ac_n "checking output of "cc -V" to determine version of Sun WorkShop C""... $ac_c" 1>&6 echo "configure:2915: checking output of "cc -V" to determine version of Sun WorkShop C" >&5 echo "$ac_t"""version $wi_cv_sunwspro_cc_version"" 1>&6 fi fi echo $ac_n "checking if we should customize your CFLAGS environment variable""... $ac_c" 1>&6 echo "configure:2922: checking if we should customize your CFLAGS environment variable" >&5 wi_replace_O_with_g="no" case "$wi_orig_CFLAGS" in "") wi_replace_O_with_g="no" ;; "-g -O2") wi_replace_O_with_g="no" ;; "-g -O") wi_replace_O_with_g="no" ;; "-O2 -g") wi_replace_O_with_g="no" ;; "-O -g") wi_replace_O_with_g="no" ;; -g) wi_replace_O_with_g="yes" ;; esac # # See if your CFLAGS environment variable wasn't set or exported, # or if you are using a conservative default. If so, we will # add some additional flags for better performance, warning reporting, # etc. # # Note we are now checking the current value of CFLAGS, which may have # been changed by configure. # wi_os_default_cflags="no" case "$CFLAGS" in "") wi_os_default_cflags="yes" ;; "-g -O2") wi_os_default_cflags="yes" ;; "-g -O") wi_os_default_cflags="yes" ;; "-O2 -g") wi_os_default_cflags="yes" ;; "-O -g") wi_os_default_cflags="yes" ;; -g) wi_os_default_cflags="yes" ;; -O) wi_os_default_cflags="yes" ;; -O2) wi_os_default_cflags="yes" ;; esac CC_is_clang="no" case "$CC" in *clang*) CC_is_clang="yes" ;; *) cc_dash_v=`${CC-gcc} -v 2>&1 | grep clang 2>/dev/null` if test -n "$cc_dash_v" ; then CC_is_clang="yes" fi ;; esac if test "$wi_os_default_cflags" = yes ; then if test "$CC_is_clang" = yes ; then wi_os_default_cflags="-Weverything -Wno-unknown-warning-option -Wno-disabled-macro-expansion -Wno-missing-variable-declarations -Wno-date-time" if test "$wi_replace_O_with_g" = yes ; then wi_os_default_cflags="-g $wi_os_default_cflags" else wi_os_default_cflags="-O2 $wi_os_default_cflags" fi elif test "$GCC" = yes ; then # # gcc # wi_gcc_optimizer_flags='' case "$wi_cv_gcc_version" in 2.7.*|2.8.*|2.9*) wi_os_default_cflags="-W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wbad-function-cast -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wmissing-declarations -Winline" ;; 345.*) wi_os_default_cflags="-W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wbad-function-cast -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wmissing-declarations -Winline -Wmissing-format-attribute -Wformat-security" wi_gcc_optimizer_flags='-Wdisabled-optimization' ;; *) wi_os_default_cflags="-W -Wall" ;; esac if test "$wi_replace_O_with_g" = yes ; then wi_os_default_cflags="-g $wi_os_default_cflags" else wi_os_default_cflags="-O2 $wi_os_default_cflags" if test "$wi_gcc_optimizer_flags" != "" ; then wi_os_default_cflags="$wi_os_default_cflags $wi_gcc_optimizer_flags" fi fi case "$OS" in hpux*) wi_os_default_cflags="-D_HPUX_SOURCE $wi_os_default_cflags" ;; bsdos*) wi_os_default_cflags=`echo "$wi_os_default_cflags" | sed 's/\ -Wcast-qual//g'` # avoid va_start() problem wi_os_default_cflags=`echo "$wi_os_default_cflags" | sed 's/\ -Wredundant-decls//g'` ;; openbsd*|unixware*|openunix*) wi_os_default_cflags=`echo "$wi_os_default_cflags" | sed 's/\ -Wredundant-decls//g'` ;; esac else # # regular cc # case "${wi_replace_O_with_g}_${OS}" in no_aix*) wi_os_default_cflags="-O -qinfo=cmp:cnd:dcl:eff:gen:ini:par:pro:rea:use -qlonglong -qro -qroconst -qlanglvl=extended -qsrcmsg -qmaxmem=20480 -qsuppress=1506-469:1506-409" ;; yes_aix*) wi_os_default_cflags="-g -qinfo=cmp:cnd:dcl:eff:gen:ini:par:pro:rea:use -qlonglong -qro -qroconst -qlanglvl=extended -qsrcmsg -qmaxmem=20480 -qsuppress=1506-469:1506-409" ;; no_irix2345*|no_irix6.01234*) wi_os_default_cflags="-O2 -xansi -fullwarn -use_readonly_const -G0 -rdata_shared" ;; yes_irix2345*|yes_irix6.01234*) wi_os_default_cflags="-g -xansi -fullwarn -use_readonly_const -G0 -rdata_shared" ;; no_irix*) wi_os_default_cflags="-O2 -IPA -xansi -fullwarn -use_readonly_const -G0 -rdata_shared -woff 1174" ;; yes_irix*) wi_os_default_cflags="-g -xansi -fullwarn -use_readonly_const -G0 -rdata_shared -woff 1174" ;; no_digitalunix*) wi_os_default_cflags="-O4 -std1 -portable -readonly_strings" ;; yes_digitalunix*) wi_os_default_cflags="-g -std1 -portable -readonly_strings" ;; no_hpux*) wi_os_default_cflags="-Ae +O2 +Ovolatile +Olibcalls +ESlit +w1 +DAportable" ;; yes_hpux*) wi_os_default_cflags="-Ae -g +w1 +DAportable" ;; no_solaris*86|no_solaris*intel) # Not really any significant differences # from the sparc flags, but reserved for # future use. # if test "$wi_cv_sunwspro_cc_version2" -ge 530 ; then wi_os_default_cflags="-xipo -xO4 -xc99 -xbuiltin -xstrconst -dalign -Qn -errtags=yes -erroff=E_END_OF_LOOP_CODE_NOT_REACHED -mc" else wi_os_default_cflags="-xO4 -xstrconst -dalign -Qn" fi ;; yes_solaris*86|yes_solaris*intel) if test "$wi_cv_sunwspro_cc_version2" -ge 530 ; then wi_os_default_cflags="-g -xc99 -xstrconst -dalign -Qn -errtags=yes -erroff=E_END_OF_LOOP_CODE_NOT_REACHED" else wi_os_default_cflags="-g -xstrconst -dalign -Qn" fi ;; no_solaris*) if test "$wi_cv_sunwspro_cc_version2" -ge 530 ; then wi_os_default_cflags="-xipo -xO5 -xc99 -xbuiltin -xstrconst -dalign -Qn -errtags=yes -erroff=E_END_OF_LOOP_CODE_NOT_REACHED -mc" else wi_os_default_cflags="-xO4 -xstrconst -dalign -Qn" fi ;; yes_solaris*) if test "$wi_cv_sunwspro_cc_version2" -ge 530 ; then wi_os_default_cflags="-g -xc99 -xstrconst -dalign -Qn -errtags=yes -erroff=E_END_OF_LOOP_CODE_NOT_REACHED" else wi_os_default_cflags="-g -xstrconst -dalign -Qn" fi ;; no_tru64*) wi_os_default_cflags="-O4 -tune host -std1 -readonly_strings -portable -warnprotos -msg_enable level6 -msg_disable longlongtype,hexoctunsign,unusedincl,unnecincl,nestincl,unusedtop,unknownmacro,ignorecallval,strctpadding,truncintasn,truncintcast,trunclongcast,ansialiascast,conststocls,unrefsdecl,subscrbounds2,intconcastsgn,longlongsufx,unreachcode,valuepres,embedcomment" ;; yes_tru64*) wi_os_default_cflags="-g -std1 -readonly_strings -portable -warnprotos -msg_enable level6 -msg_disable longlongtype,hexoctunsign,unusedincl,unnecincl,nestincl,unusedtop,unknownmacro,ignorecallval,strctpadding,truncintasn,truncintcast,trunclongcast,ansialiascast,conststocls,unrefsdecl,subscrbounds2,intconcastsgn,longlongsufx,unreachcode,valuepres,embedcomment" ;; no_unixware*|no_openunix*) wi_os_default_cflags='-O -K inline -K host -Q n' ;; yes_unixware*|yes_openunix*) wi_os_default_cflags='-g -K host -Q n' ;; *) wi_os_default_cflags="no" ;; esac fi fi if test "$wi_os_default_cflags" != "no" ; then CFLAGS="$wi_os_default_cflags" fi echo "$ac_t""$wi_os_default_cflags" 1>&6 case "$OS" in "solaris"*"-x86_64") if test "$GCC" = "yes" ; then case "$CFLAGS" in *"-m64"*) ;; *) CFLAGS="-m64 $CFLAGS" ;; esac fi ;; esac if test "x$wi_request_no_y2k_warnings" = xyes ; then case "${wi_cv_gcc_version-0}" in 0|1.*|2.[012345678].*) ;; *) case "$CFLAGS" in *-Wno-format-y2k*) ;; *) oldCFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wno-format-y2k" # # Now check if this version of GCC # accepts this flag... # cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CFLAGS="$oldCFLAGS" fi rm -rf conftest* unset oldCFLAGS ;; esac ;; esac fi echo $ac_n "checking for ldd""... $ac_c" 1>&6 echo "configure:3188: checking for ldd" >&5 if eval "test \"`echo '$''{'wi_cv_prog_ldd'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else wi_cv_prog_ldd="no" cat > conftest.c < #include int main(int argc, char **argv) { (void) printf("%s\n", ((argc > 66) ? argv[0] : "Hello World")); exit(0); } EOF ${CC-cc} $CFLAGS $CPPFLAGS conftest.c -o conftest 1>&5 wi_cv_prog_ldd=`ldd ./conftest 2>&1 | sed -n -e '/lib/{s/.*/yes/g;p;q;}' -e '${s/.*/no/g;p;q;}'` /bin/rm -rf conftest* fi echo "$ac_t""$wi_cv_prog_ldd" 1>&6 if test "$use_ssp" = yes ;then ac_cv_ssp_flags='-fstack-protector-all -D_FORTIFY_SOURCE=2' oldCFLAGS="$CFLAGS" # remove existing ssp flags, if present CFLAGS=`echo "$CFLAGS" | sed 's/-D_FORTIFY_SOURCE//g'` CFLAGS=`echo "$CFLAGS" | sed 's/-D_FORTIFY_SOURCE=.//g'` CFLAGS=`echo "$CFLAGS" | sed 's/-fstack-prot[a-z\-]*//g'` # try these CFLAGS="$CFLAGS $ac_cv_ssp_flags" cat > conftest.$ac_ext < char testvar[64]; int main() { strncpy(testvar, "hello world", sizeof(testvar) - 1); ; return 0; } EOF if { (eval echo configure:3235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CFLAGS="$oldCFLAGS" ; ac_cv_ssp_flags="no" fi rm -rf conftest* if test "$SYS" = macosx ; then if test "${use_macosx_universal}" != no ; then CFLAGS="$oldCFLAGS" ; ac_cv_ssp_flags="not compatible with Mac OS X universal" fi fi unset oldCFLAGS echo $ac_n "checking if stack protection CFLAGS can be used""... $ac_c" 1>&6 echo "configure:3251: checking if stack protection CFLAGS can be used" >&5 echo "$ac_t""$ac_cv_ssp_flags" 1>&6 fi echo $ac_n "checking if compiled programs use a shared library version of libgcc""... $ac_c" 1>&6 echo "configure:3257: checking if compiled programs use a shared library version of libgcc" >&5 if eval "test \"`echo '$''{'wi_cv_shared_libgcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$wi_cv_prog_ldd" = no ; then wi_cv_shared_libgcc="unknown (ldd is not available to check)" else cat > conftest.c < #include int main(int argc, char **argv) { (void) printf("%s\n", ((argc > 66) ? argv[0] : "Hello World")); exit(0); } EOF ${CC-cc} $CFLAGS $CPPFLAGS conftest.c -o conftest 1>&5 wi_cv_shared_libgcc=`ldd ./conftest 2>&1 | sed -n -e '/libgcc/{s/.*/yes/g;p;q;}' -e '${s/.*/no/g;p;q;}'` /bin/rm -rf conftest* fi fi echo "$ac_t""$wi_cv_shared_libgcc" 1>&6 if test "$wi_cv_shared_libgcc" != no ; then if test "x$ac_cv_prog_gcc" = "xyes" ; then case "$CFLAGS" in *-static-libgcc*) ;; *) oldCFLAGS="$CFLAGS" CFLAGS="$CFLAGS -static-libgcc" # # Now check if this version of GCC # accepts this flag... # cat > conftest.$ac_ext < char testvar[64]; int main() { strncpy(testvar, "hello world", sizeof(testvar) - 1); ; return 0; } EOF if { (eval echo configure:3306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CFLAGS="$oldCFLAGS" fi rm -rf conftest* unset oldCFLAGS ;; esac fi fi if test "x$cross_compiling" = "xyes" ; then if test "x$ac_cv_prog_gcc" = "xyes" ; then case "$CFLAGS" in *-static-libgcc*) ;; *) oldCFLAGS="$CFLAGS" CFLAGS="$CFLAGS -static-libgcc" # # Now check if this version of GCC # accepts this flag... # cat > conftest.$ac_ext < char testvar[64]; int main() { strncpy(testvar, "hello world", sizeof(testvar) - 1); ; return 0; } EOF if { (eval echo configure:3347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CFLAGS="$oldCFLAGS" fi rm -rf conftest* unset oldCFLAGS ;; esac fi fi add_O0="no" if [ "$NOOPTCFLAGS" = "" ] ; then NOOPTCFLAGS=`echo "$CFLAGS" | sed 's/[-+]O[0-9A-Za-z]*//g;s/-xO[0-9]//g;s/-Wc,-O3//g;s/-IPA//g;s/-xipo=?[0-9]?//g;s/\ \ */ /g;s/^\ *//;s/\ *$//;'` if [ "$GCC" = "yes" ] ; then add_O0="yes" else case "$CC" in ccc|*/ccc) # Compaq CC add_O0="yes" ;; esac fi fi if [ "$DEBUGCFLAGS" = "" ] ; then DEBUGCFLAGS="-g $NOOPTCFLAGS" fi if [ "$add_O0" = yes ] ; then NOOPTCFLAGS="-O0 $NOOPTCFLAGS" fi # # Was it ./configure --enable-debug ? # echo $ac_n "checking if this is a debug build""... $ac_c" 1>&6 echo "configure:3387: checking if this is a debug build" >&5 if test "$DEBUGBUILD" = yes ; then echo "$ac_t""yes" 1>&6 CFLAGS="$DEBUGCFLAGS" else echo "$ac_t""no" 1>&6 fi wi_cv_lfs="no" result="no" if test "os_${os}_gcc_${GCC}" = os_hp-ux_gcc_yes ; then CFLAGS=`echo "$CFLAGS" | sed s/-D__STDC_EXT__//g` echo $ac_n "checking if -D__STDC_EXT__ is needed with GCC on HP-UX""... $ac_c" 1>&6 echo "configure:3401: checking if -D__STDC_EXT__ is needed with GCC on HP-UX" >&5 if test "$cross_compiling" = yes; then # action if cross-compiling, guess CFLAGS="-D__STDC_EXT__ $CFLAGS" echo "$ac_t""(guessing) yes" 1>&6 else cat > conftest.$ac_ext < main() { #ifdef __STDC_EXT__ if (__STDC_EXT__ == 0) exit(1); /* have __STDC_EXT__=0 */ exit(0); /* have __STDC_EXT__=1 */ #else exit(1); /* do not have __STDC_EXT__ */ #endif } EOF if { (eval echo configure:3426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true # # Already have it defined. # echo "$ac_t""no" 1>&6 else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false # # Not defined -- we need to define it then. # This is required for the extended # namespace symbols for Large Files. # CFLAGS="-D__STDC_EXT__ $CFLAGS" echo "$ac_t""yes" 1>&6 fi rm -fr conftest* fi fi for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:3459: checking for $ac_hdr" >&5 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:3469: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -rf conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done if test "x$ac_cv_sizeof_stat_st_size" = x ; then echo $ac_n "checking size of st_size field in struct stat""... $ac_c" 1>&6 echo "configure:3498: checking size of st_size field in struct stat" >&5 if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for before calling wi_SIZEOF_ST_SIZE." 1>&2; exit 1; } fi if test "$cross_compiling" = yes; then # action if cross compiling x="unknown" ac_cv_sizeof_stat_st_size="4" rm -f conftest.out else cat > conftest.$ac_ext < #endif #include #include #include #include main() { struct stat x; FILE *fp; fp = fopen("conftest.out", "w"); if (fp != NULL) { fprintf(fp, "%u\n", (unsigned int) sizeof(x.st_size)); fclose(fp); exit(0); /* OK */ } exit(1); /* Not OK */ } EOF if { (eval echo configure:3543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true x=`cat conftest.out` case "$x" in [0-9]*) ac_cv_sizeof_stat_st_size="$x" ;; *) x="failed" ac_cv_sizeof_stat_st_size="4" ;; esac rm -f conftest.out else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false x="failed" ac_cv_sizeof_stat_st_size="4" rm -f conftest.out fi rm -fr conftest* fi echo "$ac_t""$x" 1>&6 fi if test "x$ac_cv_sizeof_off_t" = x ; then echo $ac_n "checking size of off_t""... $ac_c" 1>&6 echo "configure:3579: checking size of off_t" >&5 if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for before calling wi_SIZEOF_OFF_T." 1>&2; exit 1; } fi if test "$cross_compiling" = yes; then # action if cross compiling x="unknown" ac_cv_sizeof_off_t="4" rm -f conftest.out else cat > conftest.$ac_ext < #endif #include #include #include #include main() { off_t x = 0; FILE *fp; fp = fopen("conftest.out", "w"); if (fp != NULL) { fprintf(fp, "%u\n", (unsigned int) sizeof(x)); fclose(fp); exit(0); /* OK */ } exit(1); /* Not OK */ } EOF if { (eval echo configure:3624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true x=`cat conftest.out` case "$x" in [0-9]*) ac_cv_sizeof_off_t="$x" ;; *) x="failed" ac_cv_sizeof_off_t="4" ;; esac rm -f conftest.out else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false x="failed" ac_cv_sizeof_off_t="4" rm -f conftest.out fi rm -fr conftest* fi echo "$ac_t""$x" 1>&6 fi if test "x$ac_cv_sizeof_size_t" = x ; then echo $ac_n "checking size of size_t""... $ac_c" 1>&6 echo "configure:3660: checking size of size_t" >&5 if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for before calling wi_SIZEOF_SIZE_T." 1>&2; exit 1; } fi if test "$cross_compiling" = yes; then # action if cross compiling x="unknown" ac_cv_sizeof_size_t="4" rm -f conftest.out else cat > conftest.$ac_ext < #endif #include #include #include #include main() { size_t x = 0; FILE *fp; fp = fopen("conftest.out", "w"); if (fp != NULL) { fprintf(fp, "%u\n", (unsigned int) sizeof(x)); fclose(fp); exit(0); /* OK */ } exit(1); /* Not OK */ } EOF if { (eval echo configure:3705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true x=`cat conftest.out` case "$x" in [0-9]*) ac_cv_sizeof_size_t="$x" ;; *) x="failed" ac_cv_sizeof_size_t="4" ;; esac rm -f conftest.out else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false x="failed" ac_cv_sizeof_size_t="4" rm -f conftest.out fi rm -fr conftest* fi echo "$ac_t""$x" 1>&6 fi orig_CFLAGS="$CFLAGS" if test "$ac_cv_sizeof_stat_st_size" -le 4 || test "$ac_cv_sizeof_off_t" -le 4 ; then unset ac_cv_sizeof_stat_st_size ac_cv_sizeof_off_t CFLAGS=`echo "$CFLAGS" | sed 's/-D_LARGEFILE64_SOURCE//g'` case "$CFLAGS" in *-D_LARGEFILE_SOURCE*) result="already included -D_LARGEFILE_SOURCE" ;; *) CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $CFLAGS" DEBUGCFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $DEBUGCFLAGS" NOOPTCFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $NOOPTCFLAGS" result="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" ;; esac wi_cv_lfs="yes" fi if test "x$ac_cv_sizeof_off_t" = x ; then # Recheck, to see if the defines took effect. echo $ac_n "checking size of st_size field in struct stat""... $ac_c" 1>&6 echo "configure:3759: checking size of st_size field in struct stat" >&5 if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for before calling wi_SIZEOF_ST_SIZE." 1>&2; exit 1; } fi if test "$cross_compiling" = yes; then # action if cross compiling x="unknown" ac_cv_sizeof_stat_st_size="4" rm -f conftest.out else cat > conftest.$ac_ext < #endif #include #include #include #include main() { struct stat x; FILE *fp; fp = fopen("conftest.out", "w"); if (fp != NULL) { fprintf(fp, "%u\n", (unsigned int) sizeof(x.st_size)); fclose(fp); exit(0); /* OK */ } exit(1); /* Not OK */ } EOF if { (eval echo configure:3804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true x=`cat conftest.out` case "$x" in [0-9]*) ac_cv_sizeof_stat_st_size="$x" ;; *) x="failed" ac_cv_sizeof_stat_st_size="4" ;; esac rm -f conftest.out else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false x="failed" ac_cv_sizeof_stat_st_size="4" rm -f conftest.out fi rm -fr conftest* fi echo "$ac_t""$x" 1>&6 echo $ac_n "checking size of off_t""... $ac_c" 1>&6 echo "configure:3838: checking size of off_t" >&5 if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for before calling wi_SIZEOF_OFF_T." 1>&2; exit 1; } fi if test "$cross_compiling" = yes; then # action if cross compiling x="unknown" ac_cv_sizeof_off_t="4" rm -f conftest.out else cat > conftest.$ac_ext < #endif #include #include #include #include main() { off_t x = 0; FILE *fp; fp = fopen("conftest.out", "w"); if (fp != NULL) { fprintf(fp, "%u\n", (unsigned int) sizeof(x)); fclose(fp); exit(0); /* OK */ } exit(1); /* Not OK */ } EOF if { (eval echo configure:3883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true x=`cat conftest.out` case "$x" in [0-9]*) ac_cv_sizeof_off_t="$x" ;; *) x="failed" ac_cv_sizeof_off_t="4" ;; esac rm -f conftest.out else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false x="failed" ac_cv_sizeof_off_t="4" rm -f conftest.out fi rm -fr conftest* fi echo "$ac_t""$x" 1>&6 echo $ac_n "checking size of size_t""... $ac_c" 1>&6 echo "configure:3917: checking size of size_t" >&5 if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for before calling wi_SIZEOF_SIZE_T." 1>&2; exit 1; } fi if test "$cross_compiling" = yes; then # action if cross compiling x="unknown" ac_cv_sizeof_size_t="4" rm -f conftest.out else cat > conftest.$ac_ext < #endif #include #include #include #include main() { size_t x = 0; FILE *fp; fp = fopen("conftest.out", "w"); if (fp != NULL) { fprintf(fp, "%u\n", (unsigned int) sizeof(x)); fclose(fp); exit(0); /* OK */ } exit(1); /* Not OK */ } EOF if { (eval echo configure:3962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true x=`cat conftest.out` case "$x" in [0-9]*) ac_cv_sizeof_size_t="$x" ;; *) x="failed" ac_cv_sizeof_size_t="4" ;; esac rm -f conftest.out else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false x="failed" ac_cv_sizeof_size_t="4" rm -f conftest.out fi rm -fr conftest* fi echo "$ac_t""$x" 1>&6 if test "$ac_cv_sizeof_stat_st_size" -le 4 || test "$ac_cv_sizeof_off_t" -le 4 ; then CFLAGS="$orig_CFLAGS" unset orig_CFLAGS wi_cv_lfs64="yes" CFLAGS="-D_LARGEFILE64_SOURCE $CFLAGS" DEBUGCFLAGS="-D_LARGEFILE64_SOURCE $DEBUGCFLAGS" NOOPTCFLAGS="-D_LARGEFILE64_SOURCE $NOOPTCFLAGS" result="-D_LARGEFILE64_SOURCE" # Re-re-check, to see if the defines took effect. unset ac_cv_sizeof_stat_st_size ac_cv_sizeof_off_t echo $ac_n "checking size of st_size field in struct stat64""... $ac_c" 1>&6 echo "configure:4006: checking size of st_size field in struct stat64" >&5 if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for before calling wi_SIZEOF_STAT64_ST_SIZE." 1>&2; exit 1; } fi if test "$cross_compiling" = yes; then # action if cross compiling x="unknown" ac_cv_sizeof_stat64_st_size="8" rm -f conftest.out else cat > conftest.$ac_ext < #endif #include #include #include #include main() { struct stat64 x; FILE *fp; fp = fopen("conftest.out", "w"); if (fp != NULL) { fprintf(fp, "%u\n", (unsigned int) sizeof(x.st_size)); fclose(fp); exit(0); /* OK */ } exit(1); /* Not OK */ } EOF if { (eval echo configure:4051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true x=`cat conftest.out` case "$x" in [0-9]*) cat >> confdefs.h <&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false x="failed" ac_cv_sizeof_stat64_st_size="4" rm -f conftest.out fi rm -fr conftest* fi echo "$ac_t""$x" 1>&6 echo $ac_n "checking size of off64_t""... $ac_c" 1>&6 echo "configure:4089: checking size of off64_t" >&5 if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for before calling wi_SIZEOF_OFF64_T." 1>&2; exit 1; } fi if test "$cross_compiling" = yes; then # action if cross compiling x="unknown" ac_cv_sizeof_off64_t="8" rm -f conftest.out else cat > conftest.$ac_ext < #endif #include #include #include #include main() { off64_t x = 0; FILE *fp; fp = fopen("conftest.out", "w"); if (fp != NULL) { fprintf(fp, "%u\n", (unsigned int) sizeof(x)); fclose(fp); exit(0); /* OK */ } exit(1); /* Not OK */ } EOF if { (eval echo configure:4134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true x=`cat conftest.out` case "$x" in [0-9]*) cat >> confdefs.h <&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false x="failed" ac_cv_sizeof_off64_t="4" rm -f conftest.out fi rm -fr conftest* fi echo "$ac_t""$x" 1>&6 echo $ac_n "checking size of st_size field in struct stat""... $ac_c" 1>&6 echo "configure:4172: checking size of st_size field in struct stat" >&5 if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for before calling wi_SIZEOF_ST_SIZE." 1>&2; exit 1; } fi if test "$cross_compiling" = yes; then # action if cross compiling x="unknown" ac_cv_sizeof_stat_st_size="4" rm -f conftest.out else cat > conftest.$ac_ext < #endif #include #include #include #include main() { struct stat x; FILE *fp; fp = fopen("conftest.out", "w"); if (fp != NULL) { fprintf(fp, "%u\n", (unsigned int) sizeof(x.st_size)); fclose(fp); exit(0); /* OK */ } exit(1); /* Not OK */ } EOF if { (eval echo configure:4217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true x=`cat conftest.out` case "$x" in [0-9]*) ac_cv_sizeof_stat_st_size="$x" ;; *) x="failed" ac_cv_sizeof_stat_st_size="4" ;; esac rm -f conftest.out else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false x="failed" ac_cv_sizeof_stat_st_size="4" rm -f conftest.out fi rm -fr conftest* fi echo "$ac_t""$x" 1>&6 echo $ac_n "checking size of off_t""... $ac_c" 1>&6 echo "configure:4251: checking size of off_t" >&5 if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for before calling wi_SIZEOF_OFF_T." 1>&2; exit 1; } fi if test "$cross_compiling" = yes; then # action if cross compiling x="unknown" ac_cv_sizeof_off_t="4" rm -f conftest.out else cat > conftest.$ac_ext < #endif #include #include #include #include main() { off_t x = 0; FILE *fp; fp = fopen("conftest.out", "w"); if (fp != NULL) { fprintf(fp, "%u\n", (unsigned int) sizeof(x)); fclose(fp); exit(0); /* OK */ } exit(1); /* Not OK */ } EOF if { (eval echo configure:4296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true x=`cat conftest.out` case "$x" in [0-9]*) ac_cv_sizeof_off_t="$x" ;; *) x="failed" ac_cv_sizeof_off_t="4" ;; esac rm -f conftest.out else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false x="failed" ac_cv_sizeof_off_t="4" rm -f conftest.out fi rm -fr conftest* fi echo "$ac_t""$x" 1>&6 fi fi echo $ac_n "checking if we should add CFLAGS for Large File Support""... $ac_c" 1>&6 echo "configure:4331: checking if we should add CFLAGS for Large File Support" >&5 echo "$ac_t""$result" 1>&6 unset orig_CFLAGS if test "x$ac_cv_sizeof_stat_st_size" != x ; then cat >> confdefs.h <> confdefs.h <&6 echo "configure:4363: checking if we should add CFLAGS for reentrancy" >&5 echo "$ac_t""$result" 1>&6 if test "$SYS" = macosx ; then ac_cv_macosx_cflags=no ac_cv_macosx_ldflags=no echo $ac_n "checking if MACOSX_DEPLOYMENT_TARGET environment variable is set""... $ac_c" 1>&6 echo "configure:4373: checking if MACOSX_DEPLOYMENT_TARGET environment variable is set" >&5 echo "$ac_t""${MACOSX_DEPLOYMENT_TARGET-no}" 1>&6 test_macosx_sdk_path=`/bin/ls -1d /Developer/SDKs/MacOSX10.*u.sdk 2>/dev/null | sed -n 1,1p` if test "${test_macosx_sdk_path}" = "" ; then test_macosx_sdk_path="no" fi case "$test_macosx_sdk_path" in */MacOSX10.4u.sdk) # # On Snow Leopard, you can't use gcc-4.2 to build the # universal binary, but you can use gcc-4.0 if that # is also installed. # case "$wi_cv_gcc_version" in [56789]*|4.[123456789]*) if [ -e "/usr/bin/gcc-4.0" ] ; then CC="/usr/bin/gcc-4.0" GCC="/usr/bin/gcc-4.0" wi_cv_gcc_version="4.0.1" else test_macosx_sdk_path="no" fi ;; esac ;; esac echo $ac_n "checking if Mac OS X universal SDK is available""... $ac_c" 1>&6 echo "configure:4401: checking if Mac OS X universal SDK is available" >&5 echo "$ac_t""${test_macosx_sdk_path-no}" 1>&6 if test "${use_macosx_universal}" != no && test "${test_macosx_sdk_path}" != "no" ; then # Note SDK path, e.g., macosx_sdk_path="/Developer/SDKs/MacOSX10.4u.sdk" macosx_sdk_path="$test_macosx_sdk_path" macosx_sdk_ver=`echo "$macosx_sdk_path" | sed 's/^.*OSX1/1/;s/u.sdk.*$//;'` # E.g., "10.4" # Calculate corresponding ver_int, e.g., "10400" macosx_sdk_ver_int_maj=`echo "$macosx_sdk_ver" | cut -d. -f1` macosx_sdk_ver_int_min=`echo "$macosx_sdk_ver" | cut -d. -f2` macosx_sdk_ver_int_minmin=`echo "$macosx_sdk_ver" | cut -d. -f3` macosx_sdk_ver_int=`expr "$macosx_sdk_ver_int_maj" '*' 1000 + "$macosx_sdk_ver_int_min" '*' 100 + "${macosx_sdk_ver_int_minmin-0}"` os_base_int=`expr "$os_int" - '(' "$os_int" '%' 10 ')'` # Add OS X minimum version, if SDK is older than version of OS X on the build machine. if test "$os_base_int" -gt "$macosx_sdk_ver_int" && test "x$MACOSX_DEPLOYMENT_TARGET" = "x" ; then # Thanks, Toshi NAGATA macosx_sdk_path="${macosx_sdk_path} -mmacosx-version-min=${macosx_sdk_ver}" fi # macosx_arch_flags="-arch x86_64 -arch i386 -arch ppc" # This works too macosx_arch_flags="-arch i386 -arch ppc" case "$CFLAGS" in *"-isysroot"*"-arch"*|*"-arch"*"-isysroot"*) # User already had both SDK path and desired architecture(s) in CFLAGS ;; *"-arch"*) ac_cv_macosx_cflags="-isysroot ${macosx_sdk_path}" CFLAGS="${ac_cv_macosx_cflags} ${CFLAGS}" ;; *"-isysroot"*) ac_cv_macosx_cflags="${macosx_arch_flags}" CFLAGS="${ac_cv_macosx_cflags} ${CFLAGS}" ;; *) ac_cv_macosx_cflags="-isysroot ${macosx_sdk_path} ${macosx_arch_flags}" CFLAGS="${ac_cv_macosx_cflags} ${CFLAGS}" ;; esac # # Apparently, only libtool (glibtool) needs this -syslibroot flag. # # case "$LDFLAGS" in # *"-syslibroot"*) # # User already had SDK path in LDFLAGS # ;; # *) # ac_cv_macosx_ldflags="-syslibroot ${macosx_sdk_path}" # LDFLAGS="${ac_cv_macosx_ldflags} ${LDFLAGS}" # ;; # esac fi echo $ac_n "checking if we should add CFLAGS for Mac OS X""... $ac_c" 1>&6 echo "configure:4455: checking if we should add CFLAGS for Mac OS X" >&5 echo "$ac_t""$ac_cv_macosx_cflags" 1>&6 fi echo $ac_n "checking for strip""... $ac_c" 1>&6 echo "configure:4461: checking for strip" >&5 STRIP="strip" if [ "x$cross_compiling" = "xyes" ] ; then machine=`${CC-gcc} -dumpmachine 2>/dev/null` case "$CC" in *${machine}*) f=`echo "$CC" | sed 's|/[^/]*$||'` if [ -x "$f/${machine}-strip" ] ; then STRIP="$f/${machine}-strip" elif [ -x "$f/strip" ] ; then STRIP="$f/strip" fi ;; esac unset machine f fi echo "$ac_t""$STRIP" 1>&6 if test "$SFLAG" = "" ; then SFLAG="-s" case "$OS" in macosx*) SFLAG='-Wl,-x' ;; esac fi # # Was it ./configure --enable-debug ? # if test "$DEBUGBUILD" = yes ; then # It was directly indicated by the user with --enable-debug. SFLAG="" if test "x$STRIP" = "x" ; then STRIP=":" else STRIP=": #${STRIP}" fi else # Not directly indicated, but maybe their CFLAGS hint at a debug build. case "$CFLAGS" in "-g"|"-g "*|*" -g"|*" -g "*|*"-g"0-9*) # SFLAG="# $SFLAG" SFLAG="" if test "x$STRIP" = "x" ; then STRIP=":" else STRIP=": #${STRIP}" fi ;; esac fi STRIPFLAG="$SFLAG" echo $ac_n "checking for object suffix""... $ac_c" 1>&6 echo "configure:4515: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -rf conftest* if test "x${SYS}" = "xmacosx" ; then ac_cv_objext="o" else echo 'int i = 1;' > conftest.$ac_ext if { (eval echo configure:4524: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;; esac done else { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; } fi fi rm -rf conftest* fi echo "$ac_t""$ac_cv_objext" 1>&6 OBJEXT=$ac_cv_objext ac_objext=$ac_cv_objext echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 echo "configure:4543: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_cygwin=no fi rm -rf conftest* rm -rf conftest* fi echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 echo "configure:4576: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_mingw32=no fi rm -rf conftest* rm -rf conftest* fi echo "$ac_t""$ac_cv_mingw32" 1>&6 MINGW32= test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 echo "configure:4607: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$CYGWIN" = yes || test "$MINGW32" = yes; then ac_cv_exeext=.exe elif test "x${SYS}" = "xmacosx" ; then ac_cv_exeext="" else rm -rf conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= if { (eval echo configure:4619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done else { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } fi rm -rf conftest* test x"${ac_cv_exeext}" = x && ac_cv_exeext=no fi fi EXEEXT="" test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} echo "$ac_t""${ac_cv_exeext}" 1>&6 ac_exeext=$EXEEXT # Get first 127 chars of all uname information. Some folks have # way too much stuff there, so grab only the first 127. unam=`uname -a 2>/dev/null | cut -c1-127 | sed 's-"-\\"-g'` if test "$unam" != "" ; then cat >> confdefs.h <&6 echo "configure:4653: checking for System V compatibility directories" >&5 echo "$ac_t""" 1>&6 incdir=""/usr/5include"" echo "wi_extra_idir $incdir" 1>&5 if test -r "$incdir" ; then case "$CPPFLAGS" in *${incdir}*) echo " + already had $incdir" 1>&5 ;; *) if test "$CPPFLAGS" = "" ; then CPPFLAGS="-I$incdir" else CPPFLAGS="$CPPFLAGS -I$incdir" fi echo " + found $incdir" 1>&5 ;; esac fi libdir=""/usr/5lib"" echo "wi_extra_ldir $libdir" 1>&5 if test -r "$libdir" ; then case "$LDFLAGS" in *${libdir}*) echo " + already had $libdir" 1>&5 ;; *) if test "$LDFLAGS" = "" ; then LDFLAGS="-L$libdir" else LDFLAGS="$LDFLAGS -L$libdir" fi echo " + found $libdir" 1>&5 ;; esac fi fi if test "${prefix-NONE}" != "NONE" && test "$prefix" != "/usr/local" && test "$prefix" != "/usr"; then cat >> confdefs.h <&6 echo "configure:4705: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #include #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:4718: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* ac_cv_header_stdc=yes else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_stdc=no fi rm -rf conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "memchr" >/dev/null 2>&1; then : else rm -rf conftest* ac_cv_header_stdc=no fi rm -rf conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "free" >/dev/null 2>&1; then : else rm -rf conftest* ac_cv_header_stdc=no fi rm -rf conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF if { (eval echo configure:4785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* ac_cv_header_stdc=no fi rm -fr conftest* fi fi fi echo "$ac_t""$ac_cv_header_stdc" 1>&6 if test $ac_cv_header_stdc = yes; then cat >> confdefs.h <<\EOF #define STDC_HEADERS 1 EOF fi for ac_hdr in arpa/nameser.h gnu/libc-version.h locale.h net/errno.h nserve.h resolv.h sgtty.h string.h strings.h sys/id.h sys/ioctl.h syslog.h sys/sendfile.h sys/socket.h sys/time.h sys/types.h sys/utsname.h sys/systeminfo.h termio.h termios.h time.h utime.h unistd.h gnu/libc-version.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:4812: checking for $ac_hdr" >&5 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:4822: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -rf conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 echo "configure:4849: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #include int main() { struct tm *tp; ; return 0; } EOF if { (eval echo configure:4863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_time=no fi rm -rf conftest* fi echo "$ac_t""$ac_cv_header_time" 1>&6 if test $ac_cv_header_time = yes; then cat >> confdefs.h <<\EOF #define TIME_WITH_SYS_TIME 1 EOF fi if test "x$want_unix_domain_sockets" != xno ; then if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for before calling wi_UNIX_DOMAIN_SOCKETS." 1>&2; exit 1; } fi for ac_hdr in sys/un.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:4894: checking for $ac_hdr" >&5 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:4904: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -rf conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done echo $ac_n "checking for UNIX domain sockets""... $ac_c" 1>&6 echo "configure:4931: checking for UNIX domain sockets" >&5 if eval "test \"`echo '$''{'wi_cv_unix_domain_sockets'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then # action if cross-compiling, guess guess="(guessing) " wi_cv_unix_domain_sockets=yes else cat > conftest.$ac_ext < #endif #include #include #ifdef HAVE_SYS_UN_H #include #endif main() { int sfd; sfd = socket(AF_UNIX, SOCK_STREAM, 0); if (sfd < 0) exit(1); /* do not have UNIX domain sockets */ close(sfd); exit(0); /* do have UNIX domain sockets */ } EOF if { (eval echo configure:4970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true guess="" wi_cv_unix_domain_sockets=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false guess="" wi_cv_unix_domain_sockets=no fi rm -fr conftest* fi fi echo "$ac_t""$guess$wi_cv_unix_domain_sockets" 1>&6 guess="" if test "x$wi_cv_unix_domain_sockets" = xyes ; then cat >> confdefs.h <<\EOF #define HAVE_UNIX_DOMAIN_SOCKETS 1 EOF fi echo $ac_n "checking for sun_len field in struct sockaddr_un""... $ac_c" 1>&6 echo "configure:5004: checking for sun_len field in struct sockaddr_un" >&5 if eval "test \"`echo '$''{'wi_cv_sockaddr_un_sun_len'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #include #include #include int main() { struct sockaddr_un uaddr; uaddr.sun_len = strlen("/tmp/test.sock"); exit(((int) uaddr.sun_len); /* bogus code, of course. */ ; return 0; } EOF if { (eval echo configure:5029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* wi_cv_sockaddr_un_sun_len=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* wi_cv_sockaddr_un_sun_len=no fi rm -rf conftest* fi echo "$ac_t""$wi_cv_sockaddr_un_sun_len" 1>&6 if test "$wi_cv_sockaddr_un_sun_len" = yes ; then cat >> confdefs.h <<\EOF #define HAVE_SOCKADDR_UN_SUN_LEN 1 EOF fi fi SIO_OBJS_U='' SIO_SOBJS_U='' if test "$wi_cv_unix_domain_sockets" = yes ; then SIO_OBJS_U='$(OBJS_U) ' SIO_SOBJS_U='$(SOBJS_U) ' fi # Mostly for SunOS 4 -- needs to come first because other libs depend on it echo $ac_n "checking for strerror""... $ac_c" 1>&6 echo "configure:5071: checking for strerror" >&5 if eval "test \"`echo '$''{'ac_cv_func_strerror'+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. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char strerror(); int main() { /* 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_strerror) || defined (__stub___strerror) choke me #else strerror(); #endif ; return 0; } EOF if { (eval echo configure:5099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strerror=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_strerror=no" fi rm -rf conftest* fi if eval "test \"`echo '$ac_cv_func_'strerror`\" = yes"; then echo "$ac_t""yes" 1>&6 a=yes else echo "$ac_t""no" 1>&6 a=no fi if test "$a" = no ; then # Not in libc, try lib44bsd. echo $ac_n "checking for strerror in -l44bsd""... $ac_c" 1>&6 echo "configure:5122: checking for strerror in -l44bsd" >&5 ac_lib_var=`echo 44bsd'_'strerror | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-l44bsd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -rf conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_lib=HAVE_LIB`echo 44bsd | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 fi fi echo $ac_n "checking for socket""... $ac_c" 1>&6 echo "configure:5173: checking for socket" >&5 if eval "test \"`echo '$''{'ac_cv_func_socket'+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. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char socket(); int main() { /* 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_socket) || defined (__stub___socket) choke me #else socket(); #endif ; return 0; } EOF if { (eval echo configure:5201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_socket=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_socket=no" fi rm -rf conftest* fi if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then echo "$ac_t""yes" 1>&6 a=yes else echo "$ac_t""no" 1>&6 a=no fi if test "$a" = no ; then # Not in libc, try libsocket. echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 echo "configure:5224: checking for socket in -lsocket" >&5 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -rf conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 fi fi if test "$SYS" = unixware ; then case "$OS" in unixware2*) # So far, only UnixWare needs this. echo $ac_n "checking for syslog in -lgen""... $ac_c" 1>&6 echo "configure:5278: checking for syslog in -lgen" >&5 ac_lib_var=`echo gen'_'syslog | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lgen $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -rf conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 fi if test -f /usr/ucblib/libucb.a ; then LDFLAGS="$LDFLAGS -L/usr/ucblib" LIBS="$LIBS -lucb" fi if test -f /usr/include/unistd.h ; then ac_cv_header_unistd_h=yes fi # UnixWare 2 needs both lsocket and lnsl, and configure # script won't detect this condition properly because # the libraries are interdependent. # LIBS="$LIBS -lsocket -lnsl" # Now look for socket() # # AC_CHECK_FUNC(socket,[a=yes],[a=no]) # echo $ac_n "checking for socket""... $ac_c" 1>&6 echo "configure:5344: checking for socket" >&5 if eval "test \"`echo '$''{'ac_cv_func_socket'+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. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char socket(); int main() { /* 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_socket) || defined (__stub___socket) choke me #else socket(); #endif ; return 0; } EOF if { (eval echo configure:5372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_socket=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_socket=no" fi rm -rf conftest* fi if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then echo "$ac_t""yes" 1>&6 a=yes else echo "$ac_t""no" 1>&6 a=no fi ;; *) ;; esac fi case "$OS" in hpux1123456789*) # HP-UX 11 uses NSL for YP services echo $ac_n "checking for getpwent in -lnsl""... $ac_c" 1>&6 echo "configure:5405: checking for getpwent in -lnsl" >&5 ac_lib_var=`echo nsl'_'getpwent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -rf conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 fi ;; *) echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 echo "configure:5455: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+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. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname(); int main() { /* 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_gethostbyname) || defined (__stub___gethostbyname) choke me #else gethostbyname(); #endif ; return 0; } EOF if { (eval echo configure:5483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_gethostbyname=no" fi rm -rf conftest* fi if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then echo "$ac_t""yes" 1>&6 a=yes else echo "$ac_t""no" 1>&6 a=no fi if test "$a" = no ; then # Not in libc, try libnsl. echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 echo "configure:5506: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -rf conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 fi fi ;; esac # See if we could access two well-known sites without help of any special # libraries, like resolv. echo $ac_n "checking if we need to look for a separate DNS resolver library""... $ac_c" 1>&6 echo "configure:5561: checking if we need to look for a separate DNS resolver library" >&5 if eval "test \"`echo '$''{'wi_cv_look_for_resolv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for before calling wi_LIB_RESOLV." 1>&2; exit 1; } fi if test "$cross_compiling" = yes; then # action if cross compiling guess="(guessing) " wi_cv_look_for_resolv=yes else cat > conftest.$ac_ext < #endif #include #include #include #include main() { struct hostent *hp1, *hp2; hp1 = gethostbyname("ftp.ncftp.com"); if (hp1 == (struct hostent *) 0) { hp2 = gethostbyname("www.ibm.com"); if (hp2 == (struct hostent *) 0) exit(1); } exit(0); } EOF if { (eval echo configure:5606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true guess="" wi_cv_look_for_resolv=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false guess="" wi_cv_look_for_resolv=yes fi rm -fr conftest* fi fi echo "$ac_t""$guess$wi_cv_look_for_resolv" 1>&6 guess="" if test "$wi_cv_look_for_resolv" = yes ; then echo $ac_n "checking for main in -lresolv""... $ac_c" 1>&6 echo "configure:5634: checking for main in -lresolv" >&5 ac_lib_var=`echo resolv'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -rf conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 fi else ac_cv_lib_resolv=no fi if test "$SYS" = dynixptx ; then LIBS="$LIBS -lsocket -lnsl" fi if test "$wi_want_socks5" != yes ; then ac_cv_lib_socks5_SOCKSinit=no else # Look for the "SOCKS" library for use with Firewalls/Gateways. SOCKS_LIBS='' # First check for extra libraries that may be needed to # link against socks. If we already checked for one or # more of these libraries, we don't want to count them # in the socks-only list. # if test "x$ac_cv_lib_db_main" = "x" ; then echo $ac_n "checking for main in -ldb""... $ac_c" 1>&6 echo "configure:5700: checking for main in -ldb" >&5 ac_lib_var=`echo db'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldb $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -rf conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 SOCKS_LIBS="$SOCKS_LIBS -ldb" else echo "$ac_t""no" 1>&6 fi fi if test "x$ac_cv_lib_isode_main" = "x" ; then echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6 echo "configure:5738: checking for main in -lisode" >&5 ac_lib_var=`echo isode'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lisode $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -rf conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 SOCKS_LIBS="$SOCKS_LIBS -lisode" else echo "$ac_t""no" 1>&6 fi fi if test "x$ac_cv_lib_com_err_main" = "x" ; then echo $ac_n "checking for main in -lcom_err""... $ac_c" 1>&6 echo "configure:5776: checking for main in -lcom_err" >&5 ac_lib_var=`echo com_err'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lcom_err $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -rf conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 SOCKS_LIBS="$SOCKS_LIBS -lcom_err" else echo "$ac_t""no" 1>&6 fi fi if test "x$ac_cv_lib_crypto_main" = "x" ; then echo $ac_n "checking for main in -lcrypto""... $ac_c" 1>&6 echo "configure:5814: checking for main in -lcrypto" >&5 ac_lib_var=`echo crypto'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lcrypto $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -rf conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 SOCKS_LIBS="$SOCKS_LIBS -lcrypto" else echo "$ac_t""no" 1>&6 fi fi if test "x$ac_cv_lib_krb5_main" = "x" ; then echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6 echo "configure:5852: checking for main in -lkrb5" >&5 ac_lib_var=`echo krb5'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lkrb5 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -rf conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 SOCKS_LIBS="$SOCKS_LIBS -lkrb5" else echo "$ac_t""no" 1>&6 fi fi if test "x$ac_cv_lib_gssapi_krb5_main" = "x" ; then echo $ac_n "checking for main in -lgssapi_krb5""... $ac_c" 1>&6 echo "configure:5890: checking for main in -lgssapi_krb5" >&5 ac_lib_var=`echo gssapi_krb5'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lgssapi_krb5 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -rf conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 SOCKS_LIBS="$SOCKS_LIBS -lgssapi_krb5" else echo "$ac_t""no" 1>&6 fi fi echo $ac_n "checking for SOCKSinit in -lsocks5""... $ac_c" 1>&6 echo "configure:5928: checking for SOCKSinit in -lsocks5" >&5 ac_lib_var=`echo socks5'_'SOCKSinit | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lsocks5 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -rf conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 SOCKS_LIBS="$SOCKS_LIBS -lsocks5" else echo "$ac_t""no" 1>&6 fi for ac_hdr in socks.h socks5p.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:5971: checking for $ac_hdr" >&5 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:5981: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -rf conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done if test "$ac_cv_lib_socks5_SOCKSinit" != yes ; then ac_cv_lib_socks5_SOCKSinit=no unset SOCKS_LIBS else cat >> confdefs.h <<\EOF #define SOCKS 5 EOF fi fi echo $ac_n "checking if SOCKS5 will be used""... $ac_c" 1>&6 echo "configure:6020: checking if SOCKS5 will be used" >&5 echo "$ac_t""$ac_cv_lib_socks5_SOCKSinit" 1>&6 case "$OS" in solaris8-*) saved_LIBS="$LIBS" echo $ac_n "checking for sendfilev in -lsendfile""... $ac_c" 1>&6 echo "configure:6027: checking for sendfilev in -lsendfile" >&5 ac_lib_var=`echo sendfile'_'sendfilev | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lsendfile $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -rf conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_lib=HAVE_LIB`echo sendfile | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 fi for ac_func in sendfilev sendfilev64 do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:6076: checking for $ac_func" >&5 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. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* 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:6104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -rf 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 LIBS="$saved_LIBS" echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 echo "configure:6130: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -rf conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 fi ;; solaris9-*|solaris1[0-9]-*) echo $ac_n "checking for sendfilev in -lsendfile""... $ac_c" 1>&6 echo "configure:6179: checking for sendfilev in -lsendfile" >&5 ac_lib_var=`echo sendfile'_'sendfilev | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lsendfile $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -rf conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_lib=HAVE_LIB`echo sendfile | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 fi for ac_func in sendfilev sendfilev64 do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:6228: checking for $ac_func" >&5 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. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* 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:6256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -rf 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 ;; esac LIBCURSES='' if test "$nc_cv_curses" = yes ; then echo $ac_n "checking for curses library headers""... $ac_c" 1>&6 echo "configure:6288: checking for curses library headers" >&5 if test "$wi_cv_ncurses" != "no" ; then for ac_hdr in ncurses.h curses.h termios.h termio.h sgtty.h sys/ioctl.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:6294: checking for $ac_hdr" >&5 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:6304: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -rf conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done else for ac_hdr in curses.h termios.h termio.h sgtty.h sys/ioctl.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:6335: checking for $ac_hdr" >&5 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:6345: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -rf conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done fi if test "$ac_cv_header_curses_h" = no ; then if test -f /usr/include/curses.h ; then cat >> confdefs.h <<\EOF #define HAVE_CURSES_H 1 EOF ac_cv_header_curses_h=yes fi fi echo $ac_n "checking for curses library""... $ac_c" 1>&6 echo "configure:6383: checking for curses library" >&5 wi_cv_lib_curses=no wi_cv_lib_curses_result=no ac_save_LIBS="$LIBS" for LIBCURSES in "-lncurses" "-lcurses" "-lcurses -ltermcap" "-ltermcap -lcurses" do if test "x$LIBCURSES-$wi_cv_ncurses" = "x-lncurses-no" ; then # This should never work LIBCURSES="-lkdfjkdjfs" fi LIBS="$ac_save_LIBS $LIBCURSES" cat > conftest.$ac_ext < #include #ifdef HAVE_NCURSES_H # define NCURSES_OPAQUE 0 # include #else # include #endif int main() { /* function body */ if (strcmp("jimmy", "floyd") == 0) initscr(); exit(0); ; return 0; } EOF if { (eval echo configure:6419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* linked_with_LIBCURSES=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* linked_with_LIBCURSES=no fi rm -rf conftest* if test "x$linked_with_LIBCURSES" != "xyes" ; then continue ; fi if test "$cross_compiling" = yes; then # action if cross compiling wi_cv_lib_curses=yes wi_cv_lib_curses_result="yes" guess="(guessing) " else cat > conftest.$ac_ext < #include #ifdef HAVE_NCURSES_H # define NCURSES_OPAQUE 0 # include #else # include #endif main(int argc, char **argv) { /* Note: don't actually call curses, since it may block; * We just want to see if it (dynamic) linked in okay. */ if (argc == 0) initscr(); exit(0); } EOF if { (eval echo configure:6469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true wi_cv_lib_curses=yes guess="" wi_cv_lib_curses_result="yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false wi_cv_lib_curses=no guess="" fi rm -fr conftest* fi if test "$wi_cv_lib_curses" = yes ; then break ; fi done # restore LIBS LIBS="$ac_save_LIBS" if test "$wi_cv_lib_curses_result" != "no" ; then case "$LIBCURSES" in "-lncurses") cat >> confdefs.h <<\EOF #define HAVE_LIBNCURSES 1 EOF ;; "-lcurses") cat >> confdefs.h <<\EOF #define HAVE_LIBCURSES 1 EOF ;; "-lcurses -ltermcap") cat >> confdefs.h <<\EOF #define HAVE_LIBCURSES 1 EOF ;; "-ltermcap -lcurses") cat >> confdefs.h <<\EOF #define HAVE_LIBCURSES 1 EOF ;; esac else LIBCURSES='' fi echo "$ac_t""$wi_cv_lib_curses_result" 1>&6 fi # Check whether user wants DNSSEC local validation support # Check whether --with-dnssec-local-validation or --without-dnssec-local-validation was given. if test "${with_dnssec_local_validation+set}" = set; then withval="$with_dnssec_local_validation" want_dnssec=$withval else want_dnssec=no fi if ! test "x-$want_dnssec" = "x-no" ; then for ac_hdr in validator/validator.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:6547: checking for $ac_hdr" >&5 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:6557: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -rf conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done if test "$ac_cv_header_validator_validator_h" != yes; then { echo "configure: error: Can't find validator.h" 1>&2; exit 1; } fi echo $ac_n "checking for SHA1_Init in -lssl""... $ac_c" 1>&6 echo "configure:6587: checking for SHA1_Init in -lssl" >&5 ac_lib_var=`echo ssl'_'SHA1_Init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lssl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -rf conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_lib=HAVE_LIB`echo ssl | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 { echo "configure: error: Can't find SSL library" 1>&2; exit 1; } fi echo $ac_n "checking for query_send in -lsres""... $ac_c" 1>&6 echo "configure:6635: checking for query_send in -lsres" >&5 ac_lib_var=`echo sres'_'query_send | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lsres $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -rf conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_lib=HAVE_LIB`echo sres | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 { echo "configure: error: Can't find libsres" 1>&2; exit 1; } fi echo $ac_n "checking for p_val_status in -lval""... $ac_c" 1>&6 echo "configure:6683: checking for p_val_status in -lval" >&5 ac_lib_var=`echo val'_'p_val_status | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lval $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -rf conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 LIBS="$LIBS -lval" have_val_res_query=yes else echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_rwlock_init in -lpthread""... $ac_c" 1>&6 echo "configure:6722: checking for pthread_rwlock_init in -lpthread" >&5 ac_lib_var=`echo pthread'_'pthread_rwlock_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -rf conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_lib=HAVE_LIB`echo pthread | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 fi echo $ac_n "checking for p_val_status in -lval-threads""... $ac_c" 1>&6 echo "configure:6769: checking for p_val_status in -lval-threads" >&5 ac_lib_var=`echo val-threads'_'p_val_status | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lval-threads $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -rf conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 have_val_res_query=yes LIBS="-lval-threads $LIBS" LIBVAL_SUFFIX="-threads" else echo "$ac_t""no" 1>&6 { echo "configure: error: Can't find libval or libval-threads" 1>&2; exit 1; } fi fi cat >> confdefs.h <<\EOF #define DNSSEC_LOCAL_VALIDATION 1 EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 echo "configure:6823: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } ; return 0; } EOF if { (eval echo configure:6877: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_c_const=no fi rm -rf conftest* fi echo "$ac_t""$ac_cv_c_const" 1>&6 if test $ac_cv_c_const = no; then cat >> confdefs.h <<\EOF #define const EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 echo "configure:6898: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS #include #include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_size_t=yes else rm -rf conftest* ac_cv_type_size_t=no fi rm -rf conftest* fi echo "$ac_t""$ac_cv_type_size_t" 1>&6 if test $ac_cv_type_size_t = no; then cat >> confdefs.h <<\EOF #define size_t unsigned EOF fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 echo "configure:6931: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS #include #include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_off_t=yes else rm -rf conftest* ac_cv_type_off_t=no fi rm -rf conftest* fi echo "$ac_t""$ac_cv_type_off_t" 1>&6 if test $ac_cv_type_off_t = no; then cat >> confdefs.h <<\EOF #define off_t long EOF fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 echo "configure:6964: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS #include #include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_mode_t=yes else rm -rf conftest* ac_cv_type_mode_t=no fi rm -rf conftest* fi echo "$ac_t""$ac_cv_type_mode_t" 1>&6 if test $ac_cv_type_mode_t = no; then cat >> confdefs.h <<\EOF #define mode_t int EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 echo "configure:6997: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS #include #include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_pid_t=yes else rm -rf conftest* ac_cv_type_pid_t=no fi rm -rf conftest* fi echo "$ac_t""$ac_cv_type_pid_t" 1>&6 if test $ac_cv_type_pid_t = no; then cat >> confdefs.h <<\EOF #define pid_t int EOF fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 echo "configure:7030: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "uid_t" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_uid_t=yes else rm -rf conftest* ac_cv_type_uid_t=no fi rm -rf conftest* fi echo "$ac_t""$ac_cv_type_uid_t" 1>&6 if test $ac_cv_type_uid_t = no; then cat >> confdefs.h <<\EOF #define uid_t int EOF cat >> confdefs.h <<\EOF #define gid_t int EOF fi echo $ac_n "checking what type main() should return""... $ac_c" 1>&6 echo "configure:7065: checking what type main() should return" >&5 if eval "test \"`echo '$''{'wi_cv_main_void_return_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else wi_cv_main_void_return_t="int" case "${GCC}_${SYS}" in no_irix*|no_hpux) wi_cv_main_void_return_t="void" ;; esac fi echo "$ac_t""$wi_cv_main_void_return_t" 1>&6 cat >> confdefs.h < before calling wi_USE_LONG_LONG." 1>&2; exit 1; } fi echo $ac_n "checking for 64-bit integral type: long long""... $ac_c" 1>&6 echo "configure:7092: checking for 64-bit integral type: long long" >&5 LONGEST_INT="long" if test "$cross_compiling" = yes; then # action if cross compiling guess="(guessing) " wi_cv_type_long_long=yes LONGEST_INT="long long" else cat > conftest.$ac_ext < #endif #include #include long long hugeNumvar = 1; main() { long long hugeNumtoo = 2; if (hugeNumtoo > hugeNumvar) hugeNumvar++; if (sizeof(hugeNumvar) < 8) exit(1); exit(0); } EOF if { (eval echo configure:7131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true guess="" wi_cv_type_long_long=yes LONGEST_INT="long long" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false guess="" wi_cv_type_long_long=no fi rm -fr conftest* fi echo "$ac_t""$guess$wi_cv_type_long_long" 1>&6 if test "$wi_cv_type_long_long" = yes ; then echo $ac_n "checking how to print a 64-bit integral type""... $ac_c" 1>&6 echo "configure:7157: checking how to print a 64-bit integral type" >&5 wi_cv_printf_long_long=fail if test "$cross_compiling" = yes; then # action if cross compiling guess="(guessing) " wi_cv_printf_long_long="%lld" else cat > conftest.$ac_ext < #endif #include #include #include #include main() { char s[80]; long long hugeNum; hugeNum = (long long) 1000000000; hugeNum = hugeNum * (long long) 99; hugeNum = hugeNum + (long long) 1; (void) sprintf(s, "%lld", hugeNum); exit((strcmp(s, "99000000001") == 0) ? 0 : 1); } EOF if { (eval echo configure:7197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true guess="" wi_cv_printf_long_long="%lld" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false guess="" fi rm -fr conftest* fi if test "$wi_cv_printf_long_long" = fail ; then if test "$cross_compiling" = yes; then # action if cross compiling : else cat > conftest.$ac_ext < #endif #include #include #include #include main() { char s[80]; long long hugeNum; hugeNum = (long long) 1000000000; hugeNum = hugeNum * (long long) 99; hugeNum = hugeNum + (long long) 1; (void) sprintf(s, "%qd", hugeNum); exit((strcmp(s, "99000000001") == 0) ? 0 : 1); } EOF if { (eval echo configure:7256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true wi_cv_printf_long_long="%qd" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false : fi rm -fr conftest* fi fi if test "$wi_cv_printf_long_long" = fail ; then wi_cv_printf_long_long_msg_result='cannot print' else wi_cv_printf_long_long_msg_result="$wi_cv_printf_long_long" fi echo "$ac_t""$guess$wi_cv_printf_long_long_msg_result" 1>&6 echo $ac_n "checking how to scan a 64-bit integral type""... $ac_c" 1>&6 echo "configure:7286: checking how to scan a 64-bit integral type" >&5 wi_cv_scanf_long_long=fail if test "$cross_compiling" = yes; then # action if cross compiling guess="(guessing) " wi_cv_scanf_long_long="%lld" else cat > conftest.$ac_ext < #endif #include #include #include #include main() { long long hugeNum, justAsHugeNum; hugeNum = (long long) 1000000000; hugeNum = hugeNum * (long long) 99; hugeNum = hugeNum + (long long) 1; justAsHugeNum = (long long) 0; --justAsHugeNum; sscanf("99000000001", "%lld", &justAsHugeNum); if (memcmp(&hugeNum, &justAsHugeNum, sizeof(hugeNum)) == 0) exit(0); exit(1); } EOF if { (eval echo configure:7329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true guess="" wi_cv_scanf_long_long="%lld" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false guess="" fi rm -fr conftest* fi if test "$wi_cv_scanf_long_long" = fail ; then if test "$cross_compiling" = yes; then # action if cross compiling : else cat > conftest.$ac_ext < #endif #include #include #include #include main() { long long hugeNum, justAsHugeNum; hugeNum = (long long) 1000000000; hugeNum = hugeNum * (long long) 99; hugeNum = hugeNum + (long long) 1; justAsHugeNum = (long long) 0; --justAsHugeNum; sscanf("99000000001", "%qd", &justAsHugeNum); if (memcmp(&hugeNum, &justAsHugeNum, sizeof(hugeNum)) == 0) exit(0); exit(1); } EOF if { (eval echo configure:7391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true wi_cv_scanf_long_long="%qd" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false : fi rm -fr conftest* fi fi if test "$wi_cv_scanf_long_long" = fail ; then wi_cv_scanf_long_long_msg_result='cannot scan' else wi_cv_scanf_long_long_msg_result="$wi_cv_scanf_long_long" fi echo "$ac_t""$guess$wi_cv_scanf_long_long_msg_result" 1>&6 fi echo $ac_n "checking if everything was available to use the 64-bit integral type""... $ac_c" 1>&6 echo "configure:7422: checking if everything was available to use the 64-bit integral type" >&5 if test "$wi_cv_type_long_long" = no ; then wi_cv_use_long_long_msg_result="no (long long type not available)" wi_cv_use_long_long="no" wi_cv_scanf_long_long="fail" wi_cv_prihtf_long_long="fail" LONGEST_INT="long" elif test "$wi_cv_printf_long_long" = fail ; then wi_cv_use_long_long_msg_result="no (libc printf() does not support them)" wi_cv_use_long_long="no" wi_cv_scanf_long_long="fail" wi_cv_prihtf_long_long="fail" LONGEST_INT="long" elif test "$wi_cv_scanf_long_long" = fail ; then wi_cv_use_long_long_msg_result="no (libc scanf() does not support them)" wi_cv_use_long_long="no" wi_cv_scanf_long_long="fail" wi_cv_prihtf_long_long="fail" LONGEST_INT="long" else cat >> confdefs.h <<\EOF #define HAVE_LONG_LONG 1 EOF if test "$wi_cv_printf_long_long$wi_cv_scanf_long_long" = "%lld%qd" ; then # FreeBSD 3.2 has %lld and %qd, but we want to # run on 3.1 and 3.0. # wi_cv_printf_long_long="%qd" fi wi_cv_printf_ulong_long=`echo "$wi_cv_printf_long_long" | sed 's/d$/u/;'` wi_cv_scanf_ulong_long=`echo "$wi_cv_scanf_long_long" | sed 's/d$/u/;'` cat >> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <<\EOF #define PRINTF_LONG_LONG_QD 1 EOF else cat >> confdefs.h <<\EOF #define PRINTF_LONG_LONG_LLD 1 EOF fi if test "$wi_cv_scanf_long_long" = "%qd" ; then cat >> confdefs.h <<\EOF #define SCANF_LONG_LONG_QD 1 EOF else cat >> confdefs.h <<\EOF #define SCANF_LONG_LONG_LLD 1 EOF fi wi_cv_use_long_long="yes" wi_cv_use_long_long_msg_result="yes" fi echo "$ac_t""$wi_cv_use_long_long_msg_result" 1>&6 wi_struct_timeval_field_checks="cached" echo $ac_n "checking what type the tv_sec field of struct timeval is""... $ac_c" 1>&6 echo "configure:7501: checking what type the tv_sec field of struct timeval is" >&5 if eval "test \"`echo '$''{'wi_cv_struct_timeval_tv_sec'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else wi_struct_timeval_field_checks="uncached" if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for before calling wi_STRUCT_TIMEVAL_FIELD_TYPES." 1>&2; exit 1; } fi if test "$cross_compiling" = yes; then # action if cross compiling guess="(guessing) " guess2="$guess" wi_cv_struct_timeval_tv_sec="long" wi_cv_struct_timeval_tv_usec="long" else cat > conftest.$ac_ext < #endif #include #include #include #include #include static void neg(void *dst0, size_t siz) { unsigned char *dst = (unsigned char *) dst0; unsigned char *dlim; dlim = dst + siz; while (dst < dlim) *dst++ = (unsigned char) 0xEE; } int main(int argc, char **argv) { FILE *fp; const char *typ; struct timeval tv; #define x tv.tv_sec memset(&tv, 0, sizeof(tv)); fp = stdout; if (argc == 1) { fp = fopen("conftest.out", "w"); if (fp == NULL) { perror("could not write to ./conftest.out"); exit(1); } } neg(&x, sizeof(x)); #ifdef HAVE_LONG_LONG if (sizeof(x) == sizeof(long long)) { typ = "long long"; } else #endif if (sizeof(x) == sizeof(long)) { typ = "long"; } else { typ = "int"; } (void) fprintf(fp, "%s%s\n", (x > 0) ? "unsigned " : "", typ); #undef x #define x tv.tv_usec neg(&x, sizeof(x)); #ifdef HAVE_LONG_LONG if (sizeof(x) == sizeof(long long)) { typ = "long long"; } else #endif if (sizeof(x) == sizeof(long)) { typ = "long"; } else { typ = "int"; } (void) fprintf(fp, "%s%s\n", (x > 0) ? "unsigned " : "", typ); #undef x if (fp != stdout) (void) fclose(fp); exit(0); } EOF if { (eval echo configure:7602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true guess="" if test -f conftest.out ; then wi_cv_struct_timeval_tv_sec="`sed -n '1,1p' conftest.out`" wi_cv_struct_timeval_tv_usec="`sed -n '2,2p' conftest.out`" fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false guess="" wi_cv_struct_timeval_tv_sec="long" wi_cv_struct_timeval_tv_usec="long" fi rm -fr conftest* fi rm -f conftest.out fi echo "$ac_t""$guess$wi_cv_struct_timeval_tv_sec" 1>&6 guess="" if test "$wi_struct_timeval_field_checks" = "uncached" ; then guess="$guess2" echo $ac_n "checking what type the tv_usec field of struct timeval is""... $ac_c" 1>&6 echo "configure:7636: checking what type the tv_usec field of struct timeval is" >&5 echo "$ac_t""$guess$wi_cv_struct_timeval_tv_usec" 1>&6 else guess="$guess2" echo $ac_n "checking what type the tv_usec field of struct timeval is""... $ac_c" 1>&6 echo "configure:7641: checking what type the tv_usec field of struct timeval is" >&5 if eval "test \"`echo '$''{'wi_cv_struct_timeval_tv_usec'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else : fi echo "$ac_t""$guess$wi_cv_struct_timeval_tv_usec" 1>&6 guess="" fi cat >> confdefs.h <> confdefs.h <&6 echo "configure:7665: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$PERL" in /*) ac_cv_path_PERL="$PERL" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_PERL="$PERL" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_PERL="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_PERL" && ac_cv_path_PERL=""perl"" ;; esac fi PERL="$ac_cv_path_PERL" if test -n "$PERL"; then echo "$ac_t""$PERL" 1>&6 else echo "$ac_t""no" 1>&6 fi # Extract the first word of ""mktemp"", so it can be a program name with args. set dummy "mktemp"; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:7703: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MKTEMP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$MKTEMP" in /*) ac_cv_path_MKTEMP="$MKTEMP" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_MKTEMP="$MKTEMP" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_MKTEMP="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_MKTEMP" && ac_cv_path_MKTEMP="""" ;; esac fi MKTEMP="$ac_cv_path_MKTEMP" if test -n "$MKTEMP"; then echo "$ac_t""$MKTEMP" 1>&6 else echo "$ac_t""no" 1>&6 fi if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for before calling wi_UNISTD_FUNC_PARAM_TYPES." 1>&2; exit 1; } fi echo $ac_n "checking for return type from write""... $ac_c" 1>&6 echo "configure:7748: checking for return type from write" >&5 if eval "test \"`echo '$''{'wi_cv_write_return_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else used_cache_for_wi_unistd_fpt="no" wi_tmpdir="" if [ "x$MKTEMP" != "x" ] ; then # Ignore error from mktemp, since some old versions of Linux # print an error about not supporting -d. # wi_tmpdir=`"$MKTEMP" -d /tmp/configure.XXXXXXXXXX 2>/dev/null` if [ $? -ne 0 ] ; then wi_tmpdir="" fi fi if [ "x$wi_tmpdir" = "x" ] ; then for wi_tmpdir in . $TMPDIR $TEMPDIR /tmp ABORT do if [ "$wi_tmpdir" = ABORT ] ; then echo "Cannot create temporary directory." exit 1 fi wi_tmpdir="$wi_tmpdir/config_tmp.$$" if [ -d "$wi_tmpdir" ] || [ -f "$wi_tmpdir" ] ; then echo "Will not create temporary directory." exit 1 fi mkdir "$wi_tmpdir" if [ $? -eq 0 ] && [ -d "$wi_tmpdir" ] ; then break ; fi done fi # Use the temporary directory here... cat << 'EOF' > "$wi_tmpdir/prpp.pl" #!/usr/bin/perl -w # # prpp.pl # # Feed the output of your CPP to this to print a list of function prototypes. # #use strict; my ($c) = ""; my ($unputc) = ""; my ($line) = ""; my ($lines) = ""; my ($cline) = ""; my ($skipping) = 0; my ($numclines) = 0; MAINLOOP: while (1) { if ($unputc ne "") { $c = $unputc; $unputc = ""; } else { last unless (read(STDIN, $c, 1) == 1); } if ($c eq "{") { $skipping++; } elsif ($c eq "}") { --$skipping; $unputc = ";"; } elsif ($skipping) { next MAINLOOP; } elsif ($c eq ";") { if ($line =~ m/^\s*(\S.*\S)\s*$/s) { $lines .= $1; $line = ""; } if ($lines =~ m/^\s*(extern\s*)?(\S.*\S)\s*$/s) { $cline = $2; $cline =~ s/\s+/\ /g; if ($cline =~ /^typedef/) { $cline = ""; } elsif ($cline =~ /\(.*\)$/) { # found a proto print $cline, ";\n"; $numclines++; } else { $cline = ""; } } $lines = ""; $line = ""; } elsif ($c eq "\n") { if ($line =~ m/^\s*(\S.*\S)\s*$/s) { $lines .= $1 . " "; $line = ""; } } elsif (($c eq "#") && ($line eq "")) { # Looks like a preprocessor line, kill it { last MAINLOOP if (read(STDIN, $c, 1) != 1); last if ($c eq "\n"); redo; } } elsif ($c =~ /^\s$/) { $line .= " " if ($line ne ""); } elsif (! $skipping) { $line .= $c; } } exit(($numclines == 0) ? 1 : 0); EOF chmod 755 "$wi_tmpdir/prpp.pl" cat << 'EOF' > "$wi_tmpdir/unistd.c" #include #include #include #include #include #include #include main() { exit(0); } EOF cat << 'EOF' > "$wi_tmpdir/sed.sh" #!/bin/sh if [ $# -eq 0 ] ; then exit 1 ; fi x="$1" sed -n 's/extern//;s/static//; /[\ \*]'"$x"'\ *(/{ s/^.*'"$x"'\ *(/(/ s/)\ *[;,].*$/)/ /ssize_t/{ c\ ssize_t } /size_t/{ c\ size_t } /socklen_t/{ c\ socklen_t } /unsigned int/{ c\ unsigned int } /unsigned long/{ c\ unsigned long } /long/{ c\ long } q }' | sed 's/int int/int/g' EOF chmod 755 "$wi_tmpdir/sed.sh" cat << 'EOF' > "$wi_tmpdir/sed2.sh" #!/bin/sh if [ $# -eq 0 ] ; then exit 1 ; fi x="$1" sed -n 's/extern//;s/static//; /[\ \*]'"$x"'\ *(/{ s/^.*'"$x"'\ *(/(/ s/)\ *[;,].*$/)/ /const char/{ c\ const char * } /char/{ c\ char * } /const/{ c\ const void } q }' EOF chmod 755 "$wi_tmpdir/sed2.sh" $CPP "-I${srcdir-.}" "$wi_tmpdir/unistd.c" > "$wi_tmpdir/unistd.i" if [ -s "$wi_tmpdir/unistd.i" ] ; then "$PERL" "$wi_tmpdir/prpp.pl" < "$wi_tmpdir/unistd.i" > "$wi_tmpdir/protos.h" fi if [ -f "$wi_tmpdir/protos.h" ] ; then # # Check the return type of write() # x="write" wi_cv_write_return_t=`sed -n 's/extern//;s/static//; s/__attribute__((__cdecl__))//; /[\ \*]'"$x"'\ *(/{ s/'"$x"'\ *(.*// s/^\ *// s/\ *$// p;q }' "$wi_tmpdir/protos.h"` # # Check what type write() expects for the size parameter # x="write" wi_cv_write_size_t=`/bin/sh "$wi_tmpdir/sed.sh" "$x" < "$wi_tmpdir/protos.h"` # # Check the return type of send() # x="send" wi_cv_send_return_t=`sed -n 's/extern//;s/static//; s/__attribute__((__cdecl__))//; /[\ \*]'"$x"'\ *(/{ s/'"$x"'\ *(.*// s/^\ *// s/\ *$// p;q }' "$wi_tmpdir/protos.h"` # # Check what type send() expects for the size parameter # Tru64 is one example where send() differs from write() :-( # x="send" wi_cv_send_size_t=`/bin/sh "$wi_tmpdir/sed.sh" "$x" < "$wi_tmpdir/protos.h"` # # Check what type connect() expects for the size parameter # x="connect" wi_cv_sockaddr_size_t=`/bin/sh "$wi_tmpdir/sed.sh" "$x" < "$wi_tmpdir/protos.h"` # # Check what type setsockopt() expects for the size parameter # x="setsockopt" wi_cv_sockopt_size_t=`/bin/sh "$wi_tmpdir/sed.sh" "$x" < "$wi_tmpdir/protos.h"` # # Check what type listen() expects for the backlog parameter # x="listen" wi_cv_listen_backlog_t=`/bin/sh "$wi_tmpdir/sed.sh" "$x" < "$wi_tmpdir/protos.h"` # # Check what type alarm() expects for the seconds parameter # x="alarm" wi_cv_alarm_time_t=`/bin/sh "$wi_tmpdir/sed.sh" "$x" < "$wi_tmpdir/protos.h"` # # Check what type gethostbyaddr() expects for the addr parameter # x="gethostbyaddr" wi_cv_gethost_addrptr_t=`/bin/sh "$wi_tmpdir/sed2.sh" "$x" < "$wi_tmpdir/protos.h"` # # Check what type gethostname() expects for the size parameter # x="gethostname" wi_cv_gethostname_size_t=`/bin/sh "$wi_tmpdir/sed.sh" "$x" < "$wi_tmpdir/protos.h"` fi if [ "x$wi_cv_write_return_t" = "x" ] ; then wi_cv_write_return_t="int" fi if [ "x$wi_cv_write_size_t" = "x" ] ; then wi_cv_write_size_t="int" fi if [ "x$wi_cv_send_return_t" = "x" ] ; then wi_cv_send_return_t="int" fi if [ "x$wi_cv_send_size_t" = "x" ] ; then wi_cv_send_size_t="int" fi if [ "x$wi_cv_sockaddr_size_t" = "x" ] ; then wi_cv_sockaddr_size_t="int" fi if [ "x$wi_cv_sockopt_size_t" = "x" ] ; then wi_cv_sockopt_size_t="int" fi if [ "x$wi_cv_listen_backlog_t" = "x" ] ; then wi_cv_listen_backlog_t="int" fi if [ "x$wi_cv_alarm_time_t" = "x" ] ; then wi_cv_alarm_time_t="int" fi if [ "x$wi_cv_gethost_addrptr_t" = "x" ] ; then wi_cv_gethost_addrptr_t="struct in_addr *" fi if [ "$wi_cv_gethost_addrptr_t" = "const void" ] ; then wi_cv_gethost_addrptr_t="const struct in_addr *" fi if [ "x$wi_cv_gethostname_size_t" = "x" ] ; then wi_cv_gethostname_size_t="int" fi # Done using the temporary directory here. rm -r "$wi_tmpdir" unset wi_tmpdir fi echo "$ac_t""$wi_cv_write_return_t" 1>&6 if test "x$used_cache_for_wi_unistd_fpt" = "xno" ; then echo $ac_n "checking for size parameter to write""... $ac_c" 1>&6 echo "configure:8059: checking for size parameter to write" >&5 echo "$ac_t""$wi_cv_write_size_t" 1>&6 echo $ac_n "checking for return type from send""... $ac_c" 1>&6 echo "configure:8062: checking for return type from send" >&5 echo "$ac_t""$wi_cv_send_return_t" 1>&6 echo $ac_n "checking for size parameter to send""... $ac_c" 1>&6 echo "configure:8065: checking for size parameter to send" >&5 echo "$ac_t""$wi_cv_send_size_t" 1>&6 echo $ac_n "checking for size parameter to connect""... $ac_c" 1>&6 echo "configure:8068: checking for size parameter to connect" >&5 echo "$ac_t""$wi_cv_sockaddr_size_t" 1>&6 echo $ac_n "checking for size parameter to setsockopt""... $ac_c" 1>&6 echo "configure:8071: checking for size parameter to setsockopt" >&5 echo "$ac_t""$wi_cv_sockopt_size_t" 1>&6 echo $ac_n "checking for backlog parameter to listen""... $ac_c" 1>&6 echo "configure:8074: checking for backlog parameter to listen" >&5 echo "$ac_t""$wi_cv_listen_backlog_t" 1>&6 echo $ac_n "checking for seconds parameter to alarm""... $ac_c" 1>&6 echo "configure:8077: checking for seconds parameter to alarm" >&5 echo "$ac_t""$wi_cv_alarm_time_t" 1>&6 echo $ac_n "checking for address parameter to gethostbyaddr""... $ac_c" 1>&6 echo "configure:8080: checking for address parameter to gethostbyaddr" >&5 echo "$ac_t""$wi_cv_gethost_addrptr_t" 1>&6 echo $ac_n "checking for size parameter to gethostname""... $ac_c" 1>&6 echo "configure:8083: checking for size parameter to gethostname" >&5 echo "$ac_t""$wi_cv_gethostname_size_t" 1>&6 else echo $ac_n "checking for size parameter to write""... $ac_c" 1>&6 echo "configure:8087: checking for size parameter to write" >&5 if eval "test \"`echo '$''{'wi_cv_write_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else : fi echo "$ac_t""$wi_cv_write_size_t" 1>&6 echo $ac_n "checking for return type from send""... $ac_c" 1>&6 echo "configure:8096: checking for return type from send" >&5 if eval "test \"`echo '$''{'wi_cv_send_return_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else : fi echo "$ac_t""$wi_cv_send_return_t" 1>&6 echo $ac_n "checking for size parameter to send""... $ac_c" 1>&6 echo "configure:8105: checking for size parameter to send" >&5 if eval "test \"`echo '$''{'wi_cv_send_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else : fi echo "$ac_t""$wi_cv_send_size_t" 1>&6 echo $ac_n "checking for size parameter to connect""... $ac_c" 1>&6 echo "configure:8114: checking for size parameter to connect" >&5 if eval "test \"`echo '$''{'wi_cv_sockaddr_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else : fi echo "$ac_t""$wi_cv_sockaddr_size_t" 1>&6 echo $ac_n "checking for size parameter to setsockopt""... $ac_c" 1>&6 echo "configure:8123: checking for size parameter to setsockopt" >&5 if eval "test \"`echo '$''{'wi_cv_sockopt_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else : fi echo "$ac_t""$wi_cv_sockopt_size_t" 1>&6 echo $ac_n "checking for backlog parameter to listen""... $ac_c" 1>&6 echo "configure:8132: checking for backlog parameter to listen" >&5 if eval "test \"`echo '$''{'wi_cv_listen_backlog_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else : fi echo "$ac_t""$wi_cv_listen_backlog_t" 1>&6 echo $ac_n "checking for seconds parameter to alarm""... $ac_c" 1>&6 echo "configure:8141: checking for seconds parameter to alarm" >&5 if eval "test \"`echo '$''{'wi_cv_alarm_time_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else : fi echo "$ac_t""$wi_cv_alarm_time_t" 1>&6 echo $ac_n "checking for address parameter to gethostbyaddr""... $ac_c" 1>&6 echo "configure:8150: checking for address parameter to gethostbyaddr" >&5 if eval "test \"`echo '$''{'wi_cv_gethost_addrptr_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else : fi echo "$ac_t""$wi_cv_gethost_addrptr_t" 1>&6 echo $ac_n "checking for size parameter to gethostname""... $ac_c" 1>&6 echo "configure:8159: checking for size parameter to gethostname" >&5 if eval "test \"`echo '$''{'wi_cv_gethostname_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else : fi echo "$ac_t""$wi_cv_gethostname_size_t" 1>&6 fi unset used_cache_for_wi_unistd_fpt cat >> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <&6 echo "configure:8227: checking for negative_control_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_negative_control_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #endif #include #if STDC_HEADERS #include #include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "(^|[^a-zA-Z_0-9])negative_control_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_negative_control_t=yes else rm -rf conftest* ac_cv_type_negative_control_t=no fi rm -rf conftest* fi echo "$ac_t""$ac_cv_type_negative_control_t" 1>&6 if test $ac_cv_type_negative_control_t = no; then cat >> confdefs.h <<\EOF #define negative_control_t long EOF fi echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 echo "configure:8265: checking for ssize_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #endif #include #if STDC_HEADERS #include #include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_ssize_t=yes else rm -rf conftest* ac_cv_type_ssize_t=no fi rm -rf conftest* fi echo "$ac_t""$ac_cv_type_ssize_t" 1>&6 if test $ac_cv_type_ssize_t = no; then cat >> confdefs.h <<\EOF #define ssize_t long EOF fi echo $ac_n "checking for sa_family_t""... $ac_c" 1>&6 echo "configure:8303: checking for sa_family_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_sa_family_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #endif #include #if STDC_HEADERS #include #include #endif #include #include #include #include EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "(^|[^a-zA-Z_0-9])sa_family_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_sa_family_t=yes else rm -rf conftest* ac_cv_type_sa_family_t=no fi rm -rf conftest* fi echo "$ac_t""$ac_cv_type_sa_family_t" 1>&6 if test $ac_cv_type_sa_family_t = no; then cat >> confdefs.h <<\EOF #define sa_family_t unsigned short EOF fi if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for before calling wi_FUNC_SELECT_ARGTYPES." 1>&2; exit 1; } fi echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6 echo "configure:8351: checking types of arguments for select()" >&5 if eval "test \"`echo '$''{'ac_cv_func_select_arg234'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if eval "test \"`echo '$''{'ac_cv_func_select_arg1'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if eval "test \"`echo '$''{'ac_cv_func_select_arg5'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do cat > conftest.$ac_ext < #endif /* MG */ #include /* MG: always incl */ #include /* MG: always incl */ #ifdef HAVE_SYS_SELECT_H #include #endif #include /* MG: always incl */ extern select ($ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5); int main() { ; return 0; } EOF if { (eval echo configure:8384: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_not_found=no ; break 3 else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_not_found=yes fi rm -rf conftest* done done done fi fi fi if test "$ac_not_found" = yes; then ac_cv_func_select_arg1=int ac_cv_func_select_arg234='int *' ac_cv_func_select_arg5='struct timeval *' fi echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6 cat >> confdefs.h <> confdefs.h <> confdefs.h <&6 echo "configure:8425: checking for struct stat64" >&5 echo "$ac_t""not needed" 1>&6 wi_cv_struct_stat64=no else echo $ac_n "checking for struct stat64""... $ac_c" 1>&6 echo "configure:8430: checking for struct stat64" >&5 cat > conftest.$ac_ext < #include #include int main() { struct stat64 st; st.st_size = 0; exit(((int) &st.st_size) & 0xff); /* bogus code, of course. */ ; return 0; } EOF if { (eval echo configure:8449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* wi_cv_struct_stat64=yes cat >> confdefs.h <<\EOF #define HAVE_STRUCT_STAT64 1 EOF else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* wi_cv_struct_stat64=no fi rm -rf conftest* echo "$ac_t""$wi_cv_struct_stat64" 1>&6 fi if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for before calling wi_TYPE_SIG_ATOMIC_T." 1>&2; exit 1; } fi echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6 echo "configure:8477: checking for sig_atomic_t" >&5 cat > conftest.$ac_ext < #endif #include #include #include /* MG: for IRIX */ #if STDC_HEADERS #include #include #endif int main() { /* function-body */ sig_atomic_t sample; sample = (sig_atomic_t) getpid(); /* bogus code, of course */ exit((sample > 0) ? 0 : 1); ; return 0; } EOF if { (eval echo configure:8504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_type_sig_atomic_t=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_type_sig_atomic_t=no fi rm -rf conftest* echo "$ac_t""$ac_cv_type_sig_atomic_t" 1>&6 if test $ac_cv_type_sig_atomic_t = no ; then cat >> confdefs.h <<\EOF #define sig_atomic_t int EOF fi echo $ac_n "checking how to access getopt() global variables""... $ac_c" 1>&6 echo "configure:8528: checking how to access getopt() global variables" >&5 if eval "test \"`echo '$''{'wi_cv_getopt_decl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for before calling wi_GETOPT." 1>&2; exit 1; } fi cat > conftest.$ac_ext < #endif #include #include int main() { optind = (optarg == 0) ? 66 : 99; ; return 0; } EOF if { (eval echo configure:8558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wi_cv_getopt_decl="automatic" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* wi_cv_getopt_decl="unknown" fi rm -rf conftest* if test "$wi_cv_getopt_decl" = unknown ; then cat > conftest.$ac_ext < #endif #include #include #include int main() { optind = (optarg == 0) ? 66 : 99; ; return 0; } EOF if { (eval echo configure:8593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # # Looks like declares the variables as extern. # wi_cv_getopt_decl="getopt.h" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* # # You'll need to declare them yourself. # wi_cv_getopt_decl="manual" fi rm -rf conftest* fi fi echo "$ac_t""$wi_cv_getopt_decl" 1>&6 if test "$wi_cv_getopt_decl" = "getopt.h" ; then cat >> confdefs.h <<\EOF #define NEED_GETOPT_H 1 EOF elif test "$wi_cv_getopt_decl" = "manual" ; then cat >> confdefs.h <<\EOF #define NEED_GETOPT_EXTERN_DECLS 1 EOF fi echo $ac_n "checking for useable _res global variable""... $ac_c" 1>&6 echo "configure:8631: checking for useable _res global variable" >&5 cat > conftest.$ac_ext < #include #include #include #include #include #ifdef HAVE_ARPA_NAMESER_H # include #endif #ifdef HAVE_RESOLV_H # include #endif int main() { /* function-body */ int len; res_init(); len = (int) strlen(_res.defdname); ; return 0; } EOF if { (eval echo configure:8660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* wi_cv__res_defdname=yes cat >> confdefs.h <<\EOF #define HAVE__RES_DEFDNAME 1 EOF else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* wi_cv__res_defdname=no fi rm -rf conftest* echo "$ac_t""$wi_cv__res_defdname" 1>&6 echo $ac_n "checking for struct cmsghdr""... $ac_c" 1>&6 echo "configure:8681: checking for struct cmsghdr" >&5 if eval "test \"`echo '$''{'wi_cv_struct_cmsghdr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #include #include #include int main() { struct cmsghdr cm; cm.cmsg_len = 0; cm.cmsg_level = 0; cm.cmsg_type = 0; exit(((int) &cm.cmsg_type) & 0xff); /* bogus code, of course. */ ; return 0; } EOF if { (eval echo configure:8708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* wi_cv_struct_cmsghdr=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* wi_cv_struct_cmsghdr=no fi rm -rf conftest* fi echo "$ac_t""$wi_cv_struct_cmsghdr" 1>&6 if test "$wi_cv_struct_cmsghdr" = yes ; then cat >> confdefs.h <<\EOF #define HAVE_STRUCT_CMSGDHR 1 EOF fi echo $ac_n "checking for msg_control field in struct msghdr""... $ac_c" 1>&6 echo "configure:8734: checking for msg_control field in struct msghdr" >&5 if eval "test \"`echo '$''{'wi_cv_msghdr_control'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #include #include #include int main() { struct msghdr m; m.msg_control = &m; m.msg_controllen = sizeof(m); exit(((int) &m.msg_control) & 0xff); /* bogus code, of course. */ ; return 0; } EOF if { (eval echo configure:8760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* wi_cv_msghdr_control=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* wi_cv_msghdr_control=no fi rm -rf conftest* fi echo "$ac_t""$wi_cv_msghdr_control" 1>&6 if test "$wi_cv_msghdr_control" = yes ; then cat >> confdefs.h <<\EOF #define HAVE_MSGHDR_CONTROL 1 EOF fi echo $ac_n "checking for msg_accrights field in struct msghdr""... $ac_c" 1>&6 echo "configure:8786: checking for msg_accrights field in struct msghdr" >&5 if eval "test \"`echo '$''{'wi_cv_msghdr_accrights'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #include #include #include int main() { struct msghdr m; m.msg_accrights = &m; m.msg_accrightslen = sizeof(m); exit(((int) &m.msg_accrights) & 0xff); /* bogus code, of course. */ ; return 0; } EOF if { (eval echo configure:8812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* wi_cv_msghdr_accrights=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* wi_cv_msghdr_accrights=no fi rm -rf conftest* fi echo "$ac_t""$wi_cv_msghdr_accrights" 1>&6 if test "$wi_cv_msghdr_accrights" = yes ; then cat >> confdefs.h <<\EOF #define HAVE_MSGHDR_ACCRIGHTS 1 EOF fi if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for before calling wi_HEADER_SYS_SELECT_H." 1>&2; exit 1; } fi # See if is includable after if test "$ac_cv_header_sys_time_h" = no ; then wi_chk_headers="sys/time.h sys/select.h" else wi_chk_headers="sys/time.h" fi for ac_hdr in $wi_chk_headers do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:8852: checking for $ac_hdr" >&5 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:8862: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -rf conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done if test "$ac_cv_header_sys_select_h" = yes ; then echo $ac_n "checking if is compatible with ""... $ac_c" 1>&6 echo "configure:8890: checking if is compatible with " >&5 selecth=yes if test "$ac_cv_header_sys_time_h" = yes ; then cat > conftest.$ac_ext < #endif #include #include #include int main() { fd_set a; struct timeval tmval; tmval.tv_sec = 0; ; return 0; } EOF if { (eval echo configure:8914: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* selecth=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* selecth=no fi rm -rf conftest* fi if test "$selecth" = yes ; then cat >> confdefs.h <<\EOF #define CAN_USE_SYS_SELECT_H 1 EOF fi echo "$ac_t""$selecth" 1>&6 fi if test "${SYS}" = sunos ; then # Use getwd on SunOS -- getcwd does a "popen("/bin/pwd")" -- aaaccck. # for ac_func in getwd do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:8943: checking for $ac_func" >&5 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. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* 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:8971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -rf 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 else for ac_func in getcwd getwd do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:8999: checking for $ac_func" >&5 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. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* 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:9027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -rf 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 fi if test "$ac_cv_func_getcwd" = no && test "$ac_cv_func_getwd" = no ; then echo "configure: warning: This system does not have either getwd or getcwd?" 1>&2 echo "configure: warning: I find that a little hard to believe." 1>&2 echo "configure: warning: You may want to try -DHAVE_GETWD anyway." 1>&2 echo "configure: warning: This could also mean that your compiler isn't working" 1>&2 echo "configure: warning: with this configure script. Check the ./config.log" 1>&2 echo "configure: warning: and look for anomalies." 1>&2 fi for ac_func in fstat64 getdomainname gethostname getpass getpassphrase gnu_get_libc_release gnu_get_libc_version inet_aton inet_ntop llseek lseek64 lstat64 memmove mktime open64 pathconf readlink recvfile res_init sendfile setlocale setpgid setpgrp setsid setvbuf sigaction sigsetjmp stat64 strcasecmp strcoll strdup strerror strncoll strstr strtoq symlink sysconf sysctl sysinfo syslog tcgetattr uname waitpid do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:9065: checking for $ac_func" >&5 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. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* 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:9093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -rf 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 for ac_func in gethostbyaddr_r gethostbyname_r gethostbyname2_r getlogin_r getpwnam_r _posix_getpwnam_r getpwuid_r _posix_getpwuid_r getservbyname_r getservbyport_r gmtime_r localtime_r readdir_r do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:9120: checking for $ac_func" >&5 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. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* 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:9148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -rf 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 unset ac_cv_func_snprintf unset ac_cv_func_vsnprintf for ac_func in snprintf vsnprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:9179: checking for $ac_func" >&5 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. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* 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:9207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -rf 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 if test "$ac_cv_func_snprintf" = yes ; then if test "$ac_cv_func_snprintf" != "no" ; then echo $ac_n "checking if snprintf works correctly""... $ac_c" 1>&6 echo "configure:9235: checking if snprintf works correctly" >&5 if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for before calling wi_SNPRINTF_TERMINATES." 1>&2; exit 1; } fi if test "$cross_compiling" = yes; then # action if cross compiling wi_cv_snprintf_terminates=yes cat >> confdefs.h <<\EOF #define SNPRINTF_TERMINATES 1 EOF guess="(guessing) " x="yes" else cat > conftest.$ac_ext < #endif #include #include #ifdef HAVE_STRINGS_H #include #endif #include #ifdef HAVE_SNPRINTF_H # include #endif main() { char s[16]; int i, result; for (i=0; i<(int)(sizeof(s)/sizeof(char)); i++) s[i] = 'x'; result = (int) snprintf(s + 1, 10, "%s %s!", "hello", "world"); if (s[10] != '\0') exit(1); /* did not force termination! */ if (s[11] != 'x') exit(2); /* overflow! */ if (s[0] != 'x') exit(3); /* underflow! */ exit(0); } EOF if { (eval echo configure:9292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true wi_cv_snprintf_terminates=yes cat >> confdefs.h <<\EOF #define SNPRINTF_TERMINATES 1 EOF guess="" x="yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false wi_cv_snprintf_terminates=no guess="" x="no" fi rm -fr conftest* fi echo "$ac_t""$guess$x" 1>&6 fi echo $ac_n "checking what snprintf() returns""... $ac_c" 1>&6 echo "configure:9323: checking what snprintf() returns" >&5 if test "$cross_compiling" = yes; then # action if cross compiling wi_cv_snprintf_returns_ptr=no guess="(guessing) " x="length of data written" else cat > conftest.$ac_ext < #endif #include #include #ifdef HAVE_STRINGS_H #include #endif #include #ifdef HAVE_SNPRINTF_H # include #endif main() { int result; char s[8]; result = (int) snprintf(s, sizeof(s) - 1, "%d", 22); if (result == 2) exit(0); exit(1); } EOF if { (eval echo configure:9366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true wi_cv_snprintf_returns_ptr=no guess="" x="length of data written" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false wi_cv_snprintf_returns_ptr=yes cat >> confdefs.h <<\EOF #define SNPRINTF_RETURNS_PTR 1 EOF guess="" x="pointer to data" fi rm -fr conftest* fi echo "$ac_t""$guess$x" 1>&6 if [ "$ac_cv_func_snprintf" = "no" ] || [ "$wi_cv_snprintf_terminates" = "no" ] || [ "$wi_cv_snprintf_returns_ptr" = "yes" ] ; then echo $ac_n "checking for snprintf in -lsnprintf""... $ac_c" 1>&6 echo "configure:9397: checking for snprintf in -lsnprintf" >&5 ac_lib_var=`echo snprintf'_'snprintf | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lsnprintf $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -rf conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_lib=HAVE_LIB`echo snprintf | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 fi if test "$ac_cv_lib_snprintf_snprintf" = yes ; then unset ac_cv_func_snprintf ac_cv_func_vsnprintf for ac_hdr in snprintf.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:9449: checking for $ac_hdr" >&5 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:9459: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -rf conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done for ac_func in snprintf vsnprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:9488: checking for $ac_func" >&5 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. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* 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:9516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -rf 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 fi fi else if [ "$ac_cv_func_snprintf" = "no" ] || [ "$wi_cv_snprintf_terminates" = "no" ] || [ "$wi_cv_snprintf_returns_ptr" = "yes" ] ; then echo $ac_n "checking for snprintf in -lsnprintf""... $ac_c" 1>&6 echo "configure:9547: checking for snprintf in -lsnprintf" >&5 ac_lib_var=`echo snprintf'_'snprintf | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lsnprintf $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -rf conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_lib=HAVE_LIB`echo snprintf | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 fi if test "$ac_cv_lib_snprintf_snprintf" = yes ; then unset ac_cv_func_snprintf ac_cv_func_vsnprintf for ac_hdr in snprintf.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:9599: checking for $ac_hdr" >&5 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:9609: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -rf conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done for ac_func in snprintf vsnprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:9638: checking for $ac_func" >&5 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. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* 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:9666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -rf 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 fi fi if test "$ac_cv_func_snprintf" != "no" ; then echo $ac_n "checking if snprintf works correctly""... $ac_c" 1>&6 echo "configure:9696: checking if snprintf works correctly" >&5 if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for before calling wi_SNPRINTF_TERMINATES." 1>&2; exit 1; } fi if test "$cross_compiling" = yes; then # action if cross compiling wi_cv_snprintf_terminates=yes cat >> confdefs.h <<\EOF #define SNPRINTF_TERMINATES 1 EOF guess="(guessing) " x="yes" else cat > conftest.$ac_ext < #endif #include #include #ifdef HAVE_STRINGS_H #include #endif #include #ifdef HAVE_SNPRINTF_H # include #endif main() { char s[16]; int i, result; for (i=0; i<(int)(sizeof(s)/sizeof(char)); i++) s[i] = 'x'; result = (int) snprintf(s + 1, 10, "%s %s!", "hello", "world"); if (s[10] != '\0') exit(1); /* did not force termination! */ if (s[11] != 'x') exit(2); /* overflow! */ if (s[0] != 'x') exit(3); /* underflow! */ exit(0); } EOF if { (eval echo configure:9753: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true wi_cv_snprintf_terminates=yes cat >> confdefs.h <<\EOF #define SNPRINTF_TERMINATES 1 EOF guess="" x="yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false wi_cv_snprintf_terminates=no guess="" x="no" fi rm -fr conftest* fi echo "$ac_t""$guess$x" 1>&6 fi echo $ac_n "checking what snprintf() returns""... $ac_c" 1>&6 echo "configure:9784: checking what snprintf() returns" >&5 if test "$cross_compiling" = yes; then # action if cross compiling wi_cv_snprintf_returns_ptr=no guess="(guessing) " x="length of data written" else cat > conftest.$ac_ext < #endif #include #include #ifdef HAVE_STRINGS_H #include #endif #include #ifdef HAVE_SNPRINTF_H # include #endif main() { int result; char s[8]; result = (int) snprintf(s, sizeof(s) - 1, "%d", 22); if (result == 2) exit(0); exit(1); } EOF if { (eval echo configure:9827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true wi_cv_snprintf_returns_ptr=no guess="" x="length of data written" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* # action if false wi_cv_snprintf_returns_ptr=yes cat >> confdefs.h <<\EOF #define SNPRINTF_RETURNS_PTR 1 EOF guess="" x="pointer to data" fi rm -fr conftest* fi echo "$ac_t""$guess$x" 1>&6 fi if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for before calling wi_FUNC_SIGSETJMP." 1>&2; exit 1; } fi echo $ac_n "checking for sigsetjmp and siglongjmp""... $ac_c" 1>&6 echo "configure:9864: checking for sigsetjmp and siglongjmp" >&5 if eval "test \"`echo '$''{'wi_cv_func_sigsetjmp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #endif #include #include #include #include int main() { /* function-body */ sigjmp_buf sjb; if (sigsetjmp(sjb, 1) != 0) siglongjmp(sjb, 1); /* bogus code, of course. */ exit(0); ; return 0; } EOF if { (eval echo configure:9894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* wi_cv_func_sigsetjmp=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* wi_cv_func_sigsetjmp=no fi rm -rf conftest* fi echo "$ac_t""$wi_cv_func_sigsetjmp" 1>&6 if test "$wi_cv_func_sigsetjmp" = yes ; then cat >> confdefs.h <<\EOF #define HAVE_SIGSETJMP 1 EOF fi if test "x$ac_cv_func_setpgid" = "x" ; then for ac_func in setpgid setpgrp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:9924: checking for $ac_func" >&5 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. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* 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:9952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -rf 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 fi echo $ac_n "checking if setpgrp behavior needs to be checked""... $ac_c" 1>&6 echo "configure:9978: checking if setpgrp behavior needs to be checked" >&5 if test "x$ac_cv_func_setpgid" = "xyes" ; then # OK, we will be using setpgid instead of setpgrp then... echo "$ac_t""no" 1>&6 ac_cv_func_setpgrp_void=dontcare elif test "x$cross_compiling" = "xyes" ; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 echo "configure:9986: checking whether setpgrp takes no argument" >&5 case "`uname -a`" in *BSD*|*bsd*) ac_cv_func_setpgrp_void="no" ;; *) ac_cv_func_setpgrp_void="yes" cat >> confdefs.h <<\EOF #define SETPGRP_VOID 1 EOF ;; esac echo "$ac_t"""${ac_cv_func_setpgrp_void}?"" 1>&6 else # We're not cross compiling, so we can try this check echo "$ac_t""yes" 1>&6 echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 echo "configure:10004: checking whether setpgrp takes no argument" >&5 if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < #endif /* * If this system has a BSD-style setpgrp, which takes arguments, exit * successfully. */ main() { if (setpgrp(1,1) == -1) exit(0); else exit(1); } EOF if { (eval echo configure:10032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_setpgrp_void=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* ac_cv_func_setpgrp_void=yes fi rm -fr conftest* fi fi echo "$ac_t""$ac_cv_func_setpgrp_void" 1>&6 if test $ac_cv_func_setpgrp_void = yes; then cat >> confdefs.h <<\EOF #define SETPGRP_VOID 1 EOF fi fi echo $ac_n "checking whether setvbuf behavior can be checked""... $ac_c" 1>&6 echo "configure:10059: checking whether setvbuf behavior can be checked" >&5 if test "x$cross_compiling" = "xyes" ; then echo "$ac_t""no" 1>&6 else echo "$ac_t""yes" 1>&6 echo $ac_n "checking whether setvbuf arguments are reversed""... $ac_c" 1>&6 echo "configure:10065: checking whether setvbuf arguments are reversed" >&5 if eval "test \"`echo '$''{'ac_cv_func_setvbuf_reversed'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ac_cv_func_setvbuf_reversed=no else cat > conftest.$ac_ext < /* If setvbuf has the reversed format, exit 0. */ main () { /* This call has the arguments reversed. A reversed system may check and see that the address of main is not _IOLBF, _IONBF, or _IOFBF, and return nonzero. */ if (setvbuf(stdout, _IOLBF, (char *) main, BUFSIZ) != 0) exit(1); putc('\r', stdout); exit(0); /* Non-reversed systems segv here. */ } EOF if { (eval echo configure:10087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_setvbuf_reversed=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* ac_cv_func_setvbuf_reversed=no fi rm -fr conftest* fi rm -f core core.* *.core fi echo "$ac_t""$ac_cv_func_setvbuf_reversed" 1>&6 if test $ac_cv_func_setvbuf_reversed = yes; then cat >> confdefs.h <<\EOF #define SETVBUF_REVERSED 1 EOF fi fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 echo "configure:10114: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF if { (eval echo configure:10126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_alloca_h=no fi rm -rf conftest* fi echo "$ac_t""$ac_cv_header_alloca_h" 1>&6 if test $ac_cv_header_alloca_h = yes; then cat >> confdefs.h <<\EOF #define HAVE_ALLOCA_H 1 EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 echo "configure:10147: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < # define alloca _alloca # else # if HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); # endif # endif # endif # endif #endif int main() { char *p = (char *) alloca(1); ; return 0; } EOF if { (eval echo configure:10180: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_func_alloca_works=no fi rm -rf conftest* fi echo "$ac_t""$ac_cv_func_alloca_works" 1>&6 if test $ac_cv_func_alloca_works = yes; then cat >> confdefs.h <<\EOF #define HAVE_ALLOCA 1 EOF fi if test $ac_cv_func_alloca_works = no; then # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. ALLOCA=alloca.${ac_objext} cat >> confdefs.h <<\EOF #define C_ALLOCA 1 EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 echo "configure:10212: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5 | egrep "webecray" >/dev/null 2>&1; then rm -rf conftest* ac_cv_os_cray=yes else rm -rf conftest* ac_cv_os_cray=no fi rm -rf conftest* fi echo "$ac_t""$ac_cv_os_cray" 1>&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:10242: checking for $ac_func" >&5 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. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* 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:10270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -rf conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <&6 fi done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 echo "configure:10297: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext < addr) ? 1 : -1; } main () { exit (find_stack_direction() < 0); } EOF if { (eval echo configure:10324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* ac_cv_c_stack_direction=-1 fi rm -fr conftest* fi fi echo "$ac_t""$ac_cv_c_stack_direction" 1>&6 cat >> confdefs.h < before calling wi_CURSES_FEATURES." 1>&2; exit 1; } fi # Then $LIBCURSES is a list of curses and support libraries. ac_save_LIBS="$LIBS"; LIBS="$LIBS $LIBCURSES"; if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for before calling wi_CURSES_FUNC_PARAM_TYPES." 1>&2; exit 1; } fi echo $ac_n "checking string parameter to waddstr""... $ac_c" 1>&6 echo "configure:10365: checking string parameter to waddstr" >&5 if eval "test \"`echo '$''{'wi_cv_waddstr_str_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else used_cache_for_wi_curses_fpt="no" wi_tmpdir="" if [ "x$MKTEMP" != "x" ] ; then # Ignore error from mktemp, since some old versions of Linux # print an error about not supporting -d. # wi_tmpdir=`"$MKTEMP" -d /tmp/configure.XXXXXXXXXX 2>/dev/null` if [ $? -ne 0 ] ; then wi_tmpdir="" fi fi if [ "x$wi_tmpdir" = "x" ] ; then for wi_tmpdir in . $TMPDIR $TEMPDIR /tmp ABORT do if [ "$wi_tmpdir" = ABORT ] ; then echo "Cannot create temporary directory." exit 1 fi wi_tmpdir="$wi_tmpdir/config_tmp.$$" if [ -d "$wi_tmpdir" ] || [ -f "$wi_tmpdir" ] ; then echo "Will not create temporary directory." exit 1 fi mkdir "$wi_tmpdir" if [ $? -eq 0 ] && [ -d "$wi_tmpdir" ] ; then break ; fi done fi # Use the temporary directory here... cat << 'EOF' > "$wi_tmpdir/prpp.pl" #!/usr/bin/perl -w # # prpp.pl # # Feed the output of your CPP to this to print a list of function prototypes. # #use strict; my ($c) = ""; my ($unputc) = ""; my ($line) = ""; my ($lines) = ""; my ($cline) = ""; my ($skipping) = 0; my ($numclines) = 0; MAINLOOP: while (1) { if ($unputc ne "") { $c = $unputc; $unputc = ""; } else { last unless (read(STDIN, $c, 1) == 1); } if ($c eq "{") { $skipping++; } elsif ($c eq "}") { --$skipping; $unputc = ";"; } elsif ($skipping) { next MAINLOOP; } elsif ($c eq ";") { if ($line =~ m/^\s*(\S.*\S)\s*$/s) { $lines .= $1; $line = ""; } if ($lines =~ m/^\s*(extern\s*)?(\S.*\S)\s*$/s) { $cline = $2; $cline =~ s/\s+/\ /g; if ($cline =~ /^typedef/) { $cline = ""; } elsif ($cline =~ /\(.*\)$/) { # found a proto print $cline, ";\n"; $numclines++; } else { $cline = ""; } } $lines = ""; $line = ""; } elsif ($c eq "\n") { if ($line =~ m/^\s*(\S.*\S)\s*$/s) { $lines .= $1 . " "; $line = ""; } } elsif (($c eq "#") && ($line eq "")) { # Looks like a preprocessor line, kill it { last MAINLOOP if (read(STDIN, $c, 1) != 1); last if ($c eq "\n"); redo; } } elsif ($c =~ /^\s$/) { $line .= " " if ($line ne ""); } elsif (! $skipping) { $line .= $c; } } exit(($numclines == 0) ? 1 : 0); EOF chmod 755 "$wi_tmpdir/prpp.pl" cat << 'EOF' > "$wi_tmpdir/curses.c" #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) # define _ALL_SOURCE 1 #endif #include #ifdef HAVE_UNISTD_H # include #endif #include #include #include #include #ifdef HAVE_NCURSES_H # define NCURSES_OPAQUE 0 # include #else # include #endif main() { exit(0); } EOF cat << 'EOF' > "$wi_tmpdir/sed2.sh" #!/bin/sh if [ $# -eq 0 ] ; then exit 1 ; fi x="$1" sed -n 's/extern//;s/static//; /[\ \*]'"$x"'\ *(/{ s/^.*'"$x"'\ *(/(/ s/)\ *[;,].*$/)/ /const char/{ c\ const char * } /char/{ c\ char * } /const/{ c\ const void } q }' EOF chmod 755 "$wi_tmpdir/sed2.sh" $CPP "-I${srcdir-.}" "$wi_tmpdir/curses.c" > "$wi_tmpdir/curses.i" if [ -s "$wi_tmpdir/curses.i" ] ; then "$PERL" "$wi_tmpdir/prpp.pl" < "$wi_tmpdir/curses.i" > "$wi_tmpdir/protos.h" fi if [ -f "$wi_tmpdir/protos.h" ] ; then # # Check what type waddstr() expects for the string parameter # x="waddstr" wi_cv_waddstr_str_t=`/bin/sh "$wi_tmpdir/sed2.sh" "$x" < "$wi_tmpdir/protos.h"` fi if [ "x$wi_cv_waddstr_str_t" = "x" ] ; then wi_cv_waddstr_str_t="const char *" fi # Done using the temporary directory here. rm -r "$wi_tmpdir" unset wi_tmpdir fi echo "$ac_t""$wi_cv_waddstr_str_t" 1>&6 unset used_cache_for_wi_curses_fpt cat >> confdefs.h <> confdefs.h <<\EOF #define WADDSTR_TYPE_ARG1_CONST 1 EOF fi # maxx or _maxx echo $ac_n "checking whether curses structure has maxx or _maxx field""... $ac_c" 1>&6 echo "configure:10569: checking whether curses structure has maxx or _maxx field" >&5 cat > conftest.$ac_ext < #endif #include #include #include #include #ifdef HAVE_NCURSES_H # define NCURSES_OPAQUE 0 # include #else # include #endif int main() { WINDOW *w; w = newwin(10, 10, 1, 1); w->maxx = 0; ; return 0; } EOF if { (eval echo configure:10602: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""maxx" 1>&6 else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE__MAXX 1 EOF echo "$ac_t""_maxx" 1>&6 fi rm -rf conftest* if test "${SYS-hpux}" = hpux ; then for ac_func in __getcurx __getcury __getmaxx __getmaxy __getbegx __getbegy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:10625: checking for $ac_func" >&5 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. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* 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:10653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -rf 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 fi # getcurx echo $ac_n "checking for getcurx() functionality in curses library""... $ac_c" 1>&6 echo "configure:10681: checking for getcurx() functionality in curses library" >&5 cat > conftest.$ac_ext < #endif #include #include #include #include #ifdef HAVE_NCURSES_H # define NCURSES_OPAQUE 0 # include #else # include #endif int main() { /* function-body */ WINDOW *junk = 0; int mx = 0; mx = getcurx(junk); exit(0); ; return 0; } EOF if { (eval echo configure:10714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_GETCURX 1 EOF echo "$ac_t""yes" 1>&6 else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* echo "$ac_t""no" 1>&6 fi rm -rf conftest* # getyx echo $ac_n "checking for getyx() functionality in curses library""... $ac_c" 1>&6 echo "configure:10735: checking for getyx() functionality in curses library" >&5 cat > conftest.$ac_ext < #endif #include #include #include #include #ifdef HAVE_NCURSES_H # define NCURSES_OPAQUE 0 # include #else # include #endif int main() { /* function-body */ WINDOW *junk = 0; int mx = 0, my = 0; getyx(junk, my, mx); exit(0); ; return 0; } EOF if { (eval echo configure:10768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_GETYX 1 EOF echo "$ac_t""yes" 1>&6 else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* echo "$ac_t""no" 1>&6 fi rm -rf conftest* # getmaxx echo $ac_n "checking for getmaxx() functionality in curses library""... $ac_c" 1>&6 echo "configure:10789: checking for getmaxx() functionality in curses library" >&5 cat > conftest.$ac_ext < #endif #include #include #include #include #ifdef HAVE_NCURSES_H # define NCURSES_OPAQUE 0 # include #else # include #endif int main() { /* function-body */ WINDOW *junk = 0; int mx = 0; mx = getmaxx(junk); exit(0); ; return 0; } EOF if { (eval echo configure:10821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_GETMAXX 1 EOF echo "$ac_t""yes" 1>&6 else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* echo "$ac_t""no" 1>&6 fi rm -rf conftest* # getmaxyx echo $ac_n "checking for getmaxyx() functionality in curses library""... $ac_c" 1>&6 echo "configure:10842: checking for getmaxyx() functionality in curses library" >&5 cat > conftest.$ac_ext < #endif #include #include #include #include #ifdef HAVE_NCURSES_H # define NCURSES_OPAQUE 0 # include #else # include #endif int main() { /* function-body */ WINDOW *junk = 0; int mx = 0, my = 0; getmaxyx(junk, my, mx); exit(my < 0 ? my : 0); ; return 0; } EOF if { (eval echo configure:10874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_GETMAXYX 1 EOF echo "$ac_t""yes" 1>&6 else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* echo "$ac_t""no" 1>&6 fi rm -rf conftest* # getbegx echo $ac_n "checking for getbegx() functionality in curses library""... $ac_c" 1>&6 echo "configure:10895: checking for getbegx() functionality in curses library" >&5 cat > conftest.$ac_ext < #endif #include #include #include #include #ifdef HAVE_NCURSES_H # define NCURSES_OPAQUE 0 # include #else # include #endif int main() { /* function-body */ WINDOW *junk = 0; int mx = 0; mx = getbegx(junk); exit(0); ; return 0; } EOF if { (eval echo configure:10928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_GETBEGX 1 EOF echo "$ac_t""yes" 1>&6 else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* echo "$ac_t""no" 1>&6 fi rm -rf conftest* # getbegyx echo $ac_n "checking for getbegyx() functionality in curses library""... $ac_c" 1>&6 echo "configure:10949: checking for getbegyx() functionality in curses library" >&5 cat > conftest.$ac_ext < #endif #include #include #include #include #ifdef HAVE_NCURSES_H # define NCURSES_OPAQUE 0 # include #else # include #endif int main() { /* function-body */ WINDOW *junk = 0; int mx = 0, my = 0; getbegyx(junk, my, mx); exit(my < 0 ? my : 0); ; return 0; } EOF if { (eval echo configure:10981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_GETBEGYX 1 EOF echo "$ac_t""yes" 1>&6 else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* echo "$ac_t""no" 1>&6 fi rm -rf conftest* # touchwin echo $ac_n "checking for touchwin() functionality in curses library""... $ac_c" 1>&6 echo "configure:11002: checking for touchwin() functionality in curses library" >&5 cat > conftest.$ac_ext < #endif #include #include #include #include #ifdef HAVE_NCURSES_H # define NCURSES_OPAQUE 0 # include #else # include #endif int main() { /* function-body */ WINDOW *junk = 0; touchwin(junk); exit(0); ; return 0; } EOF if { (eval echo configure:11032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_TOUCHWIN 1 EOF echo "$ac_t""yes" 1>&6 else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* echo "$ac_t""no" 1>&6 fi rm -rf conftest* # beep echo $ac_n "checking for beep() functionality in curses library""... $ac_c" 1>&6 echo "configure:11053: checking for beep() functionality in curses library" >&5 cat > conftest.$ac_ext < #endif #include #include #include #include #ifdef HAVE_NCURSES_H # define NCURSES_OPAQUE 0 # include #else # include #endif int main() { /* function-body */ beep(); exit(getpid() & 1); ; return 0; } EOF if { (eval echo configure:11082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_BEEP 1 EOF echo "$ac_t""yes" 1>&6 else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* echo "$ac_t""no" 1>&6 fi rm -rf conftest* for ac_func in keypad nodelay curs_set doupdate wnoutrefresh do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:11104: checking for $ac_func" >&5 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. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* 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:11132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -rf 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 LIBS="$ac_save_LIBS"; fi if test "x$LIBCURSES" = "x" ; then VIS_DPROGS="# ../bin/ncftpbookmarks${EXEEXT}" else VIS_DPROGS="../bin/ncftpbookmarks${EXEEXT}" fi echo $ac_n "checking for long file names""... $ac_c" 1>&6 echo "configure:11169: checking for long file names" >&5 if eval "test \"`echo '$''{'ac_cv_sys_long_file_names'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_sys_long_file_names=yes # Test for long file names in all the places we know might matter: # . the current directory, where building will happen # $prefix/lib where we will be installing things # $exec_prefix/lib likewise # eval it to expand exec_prefix. # $TMPDIR if set, where it might want to write temporary files # if $TMPDIR is not set: # /tmp where it might want to write temporary files # /var/tmp likewise # /usr/tmp likewise if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then ac_tmpdirs="$TMPDIR" else ac_tmpdirs='/tmp /var/tmp /usr/tmp' fi for ac_dir in . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do test -d $ac_dir || continue test -w $ac_dir || continue # It is less confusing to not echo anything here. (echo 1 > $ac_dir/conftest9012345) 2>/dev/null (echo 2 > $ac_dir/conftest9012346) 2>/dev/null val=`cat $ac_dir/conftest9012345 2>/dev/null` if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then ac_cv_sys_long_file_names=no rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null break fi rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null done fi echo "$ac_t""$ac_cv_sys_long_file_names" 1>&6 if test $ac_cv_sys_long_file_names = yes; then cat >> confdefs.h <<\EOF #define HAVE_LONG_FILE_NAMES 1 EOF fi echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 echo "configure:11213: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftestmake <<\EOF all: @echo 'ac_maketemp="${MAKE}"' EOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftestmake fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$ac_t""yes" 1>&6 SET_MAKE= else echo "$ac_t""no" 1>&6 SET_MAKE="MAKE=${MAKE-make}" fi # Extract the first word of ""gtar"", so it can be a program name with args. set dummy "gtar"; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:11243: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_TAR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$TAR" in /*) ac_cv_path_TAR="$TAR" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_TAR="$TAR" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_TAR="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_TAR" && ac_cv_path_TAR="""" ;; esac fi TAR="$ac_cv_path_TAR" if test -n "$TAR"; then echo "$ac_t""$TAR" 1>&6 else echo "$ac_t""no" 1>&6 fi if test "x$TAR" = "x" ; then unset TAR unset ac_cv_path_TAR # Extract the first word of ""tar"", so it can be a program name with args. set dummy "tar"; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:11282: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_TAR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$TAR" in /*) ac_cv_path_TAR="$TAR" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_TAR="$TAR" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_TAR="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_TAR" && ac_cv_path_TAR="""" ;; esac fi TAR="$ac_cv_path_TAR" if test -n "$TAR"; then echo "$ac_t""$TAR" 1>&6 else echo "$ac_t""no" 1>&6 fi fi if test "x$TAR" != "x" ; then cat >> confdefs.h <&6 echo "configure:11330: checking how to create TAR files" >&5 x="" if [ -x /usr/bin/what ] ; then x=`/usr/bin/what "$TAR" 2>&1 | sed -n 's/.*pax.*/pax/g;/pax/p'` elif [ -x /bin/what ] ; then x=`/bin/what "$TAR" 2>&1 | sed -n 's/.*pax.*/pax/g;/pax/p'` fi if [ "x$x" != "xpax" ] ; then # The junk above is because Mac OS X Server's tar freaks out # and does not exit if you do "tar --help". # x=`"$TAR" --help 2>&1 | sed -n 's/.*owner=NAME.*/owner=NAME/g;/owner=NAME/p'` fi TARFLAGS="cvf" case "$x" in *owner=NAME*) case "$OS" in cygwin*) ;; macosx*) TARFLAGS="-c --owner=root --group=wheel --verbose -f" ;; *) if grep '^root:' /etc/group >/dev/null 2>&1 ; then TARFLAGS="-c --owner=root --group=root --verbose -f" elif grep '^wheel:' /etc/group >/dev/null 2>&1 ; then TARFLAGS="-c --owner=root --group=wheel --verbose -f" fi ;; esac ;; esac echo "$ac_t""$TAR $TARFLAGS" 1>&6 if test "x$cross_compiling" = "xyes" ; then # Help out if the cross ranlib isn't in your path, # for example, maybe you set CC=/path/to/cross-gcc # rather than put PATH=/path/to/crosstools:$PATH # and let cc be found in your PATH. # machine=`${CC-gcc} -dumpmachine 2>/dev/null` case "$CC" in *${machine}*) f=`echo "$CC" | sed 's|/[^/]*$||'` if [ -x "$f/${machine}-ranlib" ] ; then RANLIB="$f/${machine}-ranlib" elif [ -x "$f/ranlib" ] ; then RANLIB="$f/ranlib" fi ;; esac unset machine f fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:11388: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_RANLIB="ranlib" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" fi fi RANLIB="$ac_cv_prog_RANLIB" if test -n "$RANLIB"; then echo "$ac_t""$RANLIB" 1>&6 else echo "$ac_t""no" 1>&6 fi echo $ac_n "checking for ar""... $ac_c" 1>&6 echo "configure:11418: checking for ar" >&5 AR="ar" if [ "x$cross_compiling" = "xyes" ] ; then machine=`${CC-gcc} -dumpmachine 2>/dev/null` case "$CC" in *${machine}*) f=`echo "$CC" | sed 's|/[^/]*$||'` if [ -x "$f/${machine}-ar" ] ; then AR="$f/${machine}-ar" elif [ -x "$f/ar" ] ; then AR="$f/ar" fi ;; esac unset machine f fi echo "$ac_t""$AR" 1>&6 # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 echo "configure:11449: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi done ;; esac done IFS="$ac_save_IFS" fi if test "${ac_cv_path_install+set}" = set; then INSTALL="$ac_cv_path_install" else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL="$ac_install_sh" fi fi echo "$ac_t""$INSTALL" 1>&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Extract the first word of ""pwd"", so it can be a program name with args. set dummy "pwd"; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:11505: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_wi_PWD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$wi_PWD" in /*) ac_cv_path_wi_PWD="$wi_PWD" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_wi_PWD="$wi_PWD" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_wi_PWD="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_wi_PWD" && ac_cv_path_wi_PWD=""pwd"" ;; esac fi wi_PWD="$ac_cv_path_wi_PWD" if test -n "$wi_PWD"; then echo "$ac_t""$wi_PWD" 1>&6 else echo "$ac_t""no" 1>&6 fi if test "x$use_ccdv" = "xno" ; then echo $ac_n "checking for ccdv""... $ac_c" 1>&6 echo "configure:11542: checking for ccdv" >&5 echo "$ac_t""(disabled)" 1>&6 else unset wi_cv_path_ccdv # can't use cache if it was a temp prog last time wi_used_cache_path_ccdv="yes" echo $ac_n "checking for ccdv""... $ac_c" 1>&6 echo "configure:11548: checking for ccdv" >&5 if eval "test \"`echo '$''{'wi_cv_path_ccdv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else wi_used_cache_path_ccdv="no" for CCDV in /usr/bin/ccdv /usr/local/bin/ccdv /usr/ccs/bin/ccdv NONE do if test "$CCDV" = NONE ; then CCDV="" ; break ; fi $CCDV >/dev/null 2>&1 if test $? -eq 96 ; then break fi done if test "x$CCDV" = "x" ; then cat > ccdv.c << 'EOF' /* ccdv.c * * Copyright (C) 2002-2003, by Mike Gleason, NcFTP Software. * All Rights Reserved. * * Licensed under the GNU Public License. */ #include #include #include #include #include #include #include #include #include #define SETCOLOR_SUCCESS (gANSIEscapes ? "\033\1331;32m" : "") #define SETCOLOR_FAILURE (gANSIEscapes ? "\033\1331;31m" : "") #define SETCOLOR_WARNING (gANSIEscapes ? "\033\1331;33m" : "") #define SETCOLOR_NORMAL (gANSIEscapes ? "\033\1330;39m" : "") #define TEXT_BLOCK_SIZE 8192 #define INDENT 2 #define TERMS "vt100:vt102:vt220:vt320:xterm:xterm-color:xterm-256color:ansi:linux:scoterm:scoansi:dtterm:cons25:cygwin:screen" size_t gNBufUsed = 0, gNBufAllocated = 0; char *gBuf = NULL; int gCCPID; char gAction[64] = ""; char gTarget[64] = ""; char gAr[32] = ""; char gArLibraryTarget[64] = ""; int gDumpCmdArgs = 0; char gArgsStr[800]; int gColumns = 80; int gANSIEscapes = 0; int gExitStatus = 95; static void DumpFormattedOutput(void) { char *cp; char spaces[8 + 1] = " "; char *saved; int curcol; int i; curcol = 0; saved = NULL; for (cp = gBuf + ((gDumpCmdArgs == 0) ? strlen(gArgsStr) : 0); ; cp++) { if (*cp == '\0') { if (saved != NULL) { cp = saved; saved = NULL; } else break; } if (*cp == '\r') continue; if (*cp == '\t') { saved = cp + 1; cp = spaces + 8 - (8 - ((curcol - INDENT - 1) % 8)); } if (curcol == 0) { for (i = INDENT; --i >= 0; ) putchar(' '); curcol = INDENT; } putchar(*cp); if (++curcol == (gColumns - 1)) { putchar('\n'); curcol = 0; } else if (*cp == '\n') curcol = 0; } free(gBuf); } /* DumpFormattedOutput */ /* Difftime(), only for timeval structures. */ static void TimeValSubtract(struct timeval *tdiff, struct timeval *t1, struct timeval *t0) { tdiff->tv_sec = t1->tv_sec - t0->tv_sec; tdiff->tv_usec = t1->tv_usec - t0->tv_usec; if (tdiff->tv_usec < 0) { tdiff->tv_sec--; tdiff->tv_usec += 1000000; } } /* TimeValSubtract */ static void Wait(void) { int pid2, status; do { status = 0; pid2 = (int) waitpid(gCCPID, &status, 0); } while (((pid2 >= 0) && (! WIFEXITED(status))) || ((pid2 < 0) && (errno == EINTR))); if (WIFEXITED(status)) gExitStatus = WEXITSTATUS(status); } /* Wait */ static int SlurpProgress(int fd) { char s1[71]; char *newbuf; int nready; size_t ntoread; ssize_t nread; struct timeval now, tnext, tleft; fd_set ss; fd_set ss2; const char *trail = "/-\\|", *trailcp; trailcp = trail; snprintf(s1, sizeof(s1), "%s%s%s... ", gAction, gTarget[0] ? " " : "", gTarget); printf("\r%-70s%-9s", s1, ""); fflush(stdout); gettimeofday(&now, NULL); tnext = now; tnext.tv_sec++; tleft.tv_sec = 1; tleft.tv_usec = 0; FD_ZERO(&ss2); FD_SET(fd, &ss2); for(;;) { if (gNBufUsed == (gNBufAllocated - 1)) { if ((newbuf = (char *) realloc(gBuf, gNBufAllocated + TEXT_BLOCK_SIZE)) == NULL) { perror("ccdv: realloc"); return (-1); } gNBufAllocated += TEXT_BLOCK_SIZE; gBuf = newbuf; } for (;;) { ss = ss2; nready = select(fd + 1, &ss, NULL, NULL, &tleft); if (nready == 1) break; if (nready < 0) { if (errno != EINTR) { perror("ccdv: select"); return (-1); } continue; } gettimeofday(&now, NULL); if ((now.tv_sec > tnext.tv_sec) || ((now.tv_sec == tnext.tv_sec) && (now.tv_usec >= tnext.tv_usec))) { tnext = now; tnext.tv_sec++; tleft.tv_sec = 1; tleft.tv_usec = 0; printf("\r%-71s%c%-7s", s1, *trailcp, ""); fflush(stdout); if (*++trailcp == '\0') trailcp = trail; } else { TimeValSubtract(&tleft, &tnext, &now); } } ntoread = (gNBufAllocated - gNBufUsed - 1); nread = read(fd, gBuf + gNBufUsed, ntoread); if (nread < 0) { if (errno == EINTR) continue; perror("ccdv: read"); return (-1); } else if (nread == 0) { break; } gNBufUsed += nread; gBuf[gNBufUsed] = '\0'; } snprintf(s1, sizeof(s1), "%s%s%s: ", gAction, gTarget[0] ? " " : "", gTarget); Wait(); if (gExitStatus == 0) { printf("\r%-70s", s1); printf("[%s%s%s]", ((gNBufUsed - strlen(gArgsStr)) < 4) ? SETCOLOR_SUCCESS : SETCOLOR_WARNING, "OK", SETCOLOR_NORMAL); printf("%-5s\n", " "); } else { printf("\r%-70s", s1); printf("[%s%s%s]", SETCOLOR_FAILURE, "ERROR", SETCOLOR_NORMAL); printf("%-2s\n", " "); gDumpCmdArgs = 1; /* print cmd when there are errors */ } fflush(stdout); return (0); } /* SlurpProgress */ static int SlurpAll(int fd) { char *newbuf; size_t ntoread; ssize_t nread; printf("%s%s%s.\n", gAction, gTarget[0] ? " " : "", gTarget); fflush(stdout); for(;;) { if (gNBufUsed == (gNBufAllocated - 1)) { if ((newbuf = (char *) realloc(gBuf, gNBufAllocated + TEXT_BLOCK_SIZE)) == NULL) { perror("ccdv: realloc"); return (-1); } gNBufAllocated += TEXT_BLOCK_SIZE; gBuf = newbuf; } ntoread = (gNBufAllocated - gNBufUsed - 1); nread = read(fd, gBuf + gNBufUsed, ntoread); if (nread < 0) { if (errno == EINTR) continue; perror("ccdv: read"); return (-1); } else if (nread == 0) { break; } gNBufUsed += nread; gBuf[gNBufUsed] = '\0'; } Wait(); gDumpCmdArgs = (gExitStatus != 0); /* print cmd when there are errors */ return (0); } /* SlurpAll */ static const char * Basename(const char *path) { const char *cp; cp = strrchr(path, '/'); if (cp == NULL) return (path); return (cp + 1); } /* Basename */ static const char * Extension(const char *path) { const char *cp = path; cp = strrchr(path, '.'); if (cp == NULL) return (""); return (cp); } /* Extension */ static void Usage(void) { fprintf(stderr, "Usage: ccdv /path/to/cc CFLAGS...\n\n"); fprintf(stderr, "I wrote this to reduce the deluge Make output to make finding actual problems\n"); fprintf(stderr, "easier. It is intended to be invoked from Makefiles, like this. Instead of:\n\n"); fprintf(stderr, "\t.c.o:\n"); fprintf(stderr, "\t\t$(CC) $(CFLAGS) $(DEFS) $(CPPFLAGS) $< -c\n"); fprintf(stderr, "\nRewrite your rule so it looks like:\n\n"); fprintf(stderr, "\t.c.o:\n"); fprintf(stderr, "\t\t@ccdv $(CC) $(CFLAGS) $(DEFS) $(CPPFLAGS) $< -c\n\n"); fprintf(stderr, "ccdv 1.1.0 is Free under the GNU Public License. Enjoy!\n"); fprintf(stderr, " -- Mike Gleason, NcFTP Software \n"); exit(96); } /* Usage */ int main(int argc, char **argv) { int pipe1[2]; int devnull; char emerg[256]; int fd; int nread; int i; int cc = 0, pch = 0; const char *quote; if (argc < 2) Usage(); snprintf(gAction, sizeof(gAction), "Running %s", Basename(argv[1])); memset(gArgsStr, 0, sizeof(gArgsStr)); for (i = 1; i < argc; i++) { quote = (strchr(argv[i], ' ') != NULL) ? "\"" : ""; snprintf(gArgsStr + strlen(gArgsStr), sizeof(gArgsStr) - strlen(gArgsStr), "%s%s%s%s%s", (i == 1) ? "" : " ", quote, argv[i], quote, (i == (argc - 1)) ? "\n" : ""); if ((strcmp(argv[i], "-o") == 0) && ((i + 1) < argc)) { if (strcasecmp(Extension(argv[i + 1]), ".o") != 0) { strcpy(gAction, "Linking"); snprintf(gTarget, sizeof(gTarget), "%s", Basename(argv[i + 1])); } } else if (strchr("-+/", (int) argv[i][0]) != NULL) { continue; } else if (strncasecmp(Extension(argv[i]), ".c", 2) == 0) { cc++; snprintf(gTarget, sizeof(gTarget), "%s", Basename(argv[i])); } else if ((strncasecmp(Extension(argv[i]), ".h", 2) == 0) && (cc == 0)) { pch++; snprintf(gTarget, sizeof(gTarget), "%s", Basename(argv[i])); } else if ((i == 1) && (strcmp(Basename(argv[i]), "ar") == 0)) { snprintf(gAr, sizeof(gAr), "%s", Basename(argv[i])); } else if ((gArLibraryTarget[0] == '\0') && (strcasecmp(Extension(argv[i]), ".a") == 0)) { snprintf(gArLibraryTarget, sizeof(gArLibraryTarget), "%s", Basename(argv[i])); } } if ((gAr[0] != '\0') && (gArLibraryTarget[0] != '\0')) { strcpy(gAction, "Creating library"); snprintf(gTarget, sizeof(gTarget), "%s", gArLibraryTarget); } else if (pch > 0) { strcpy(gAction, "Precompiling"); } else if (cc > 0) { strcpy(gAction, "Compiling"); } if (pipe(pipe1) < 0) { perror("ccdv: pipe"); exit(97); } (void) close(0); devnull = open("/dev/null", O_RDWR, 00666); if ((devnull != 0) && (dup2(devnull, 0) == 0)) close(devnull); gCCPID = (int) fork(); if (gCCPID < 0) { (void) close(pipe1[0]); (void) close(pipe1[1]); perror("ccdv: fork"); exit(98); } else if (gCCPID == 0) { /* Child */ (void) close(pipe1[0]); /* close read end */ if (pipe1[1] != 1) { /* use write end on stdout */ (void) dup2(pipe1[1], 1); (void) close(pipe1[1]); } (void) dup2(1, 2); /* use write end on stderr */ execvp(argv[1], argv + 1); perror(argv[1]); exit(99); } /* parent */ (void) close(pipe1[1]); /* close write end */ fd = pipe1[0]; /* use read end */ gColumns = (getenv("COLUMNS") != NULL) ? atoi(getenv("COLUMNS")) : 80; gANSIEscapes = (getenv("TERM") != NULL) && (strstr(TERMS, getenv("TERM")) != NULL); gBuf = (char *) malloc(TEXT_BLOCK_SIZE); if (gBuf == NULL) goto panic; gNBufUsed = 0; gNBufAllocated = TEXT_BLOCK_SIZE; if (strlen(gArgsStr) < (gNBufAllocated - 1)) { strcpy(gBuf, gArgsStr); gNBufUsed = strlen(gArgsStr); } if (isatty(1)) { if (SlurpProgress(fd) < 0) goto panic; } else { if (SlurpAll(fd) < 0) goto panic; } DumpFormattedOutput(); exit(gExitStatus); panic: gDumpCmdArgs = 1; /* print cmd when there are errors */ DumpFormattedOutput(); while ((nread = read(fd, emerg, (size_t) sizeof(emerg))) > 0) (void) write(2, emerg, (size_t) nread); Wait(); exit(gExitStatus); } /* main */ /* eof ccdv.c */ EOF ${CC-cc} $DEFS $CPPFLAGS $CFLAGS "ccdv.c" -o "ccdv" >/dev/null 2>&1 rm -f ccdv.c ccdv.o ccdv.c.gz.uu ccdv.c.gz strip ./ccdv >/dev/null 2>&1 ./ccdv >/dev/null 2>&1 if test $? -eq 96 ; then CCDV="./ccdv" else rm -f ccdv fi fi if test "x$CCDV" != x ; then wi_path="$CCDV" if test -d "$wi_path" ; then wi_resolved_path=`cd "$wi_path" ; $wi_PWD 2>/dev/null` elif test ! -f "$wi_path" ; then wi_resolved_path="$wi_path" else wi_parent_dir="$wi_path" wi_file_name="$wi_path" wi_parent_dir=`echo "$wi_parent_dir" | sed -n ' s-//*-/-g s-/*$-- /^\/\/*[^/]*$/{ c\\ / p q } /^[^/]*$/{ c\\ . p q } /./{ s-/[^/]*$-- p q }'` wi_file_name=`echo "$wi_file_name" | sed -n ' s-//*-/-g s-/*$-- s-^/$-- s-^.*/-- p q'` wi_resolved_path=`cd "$wi_parent_dir" ; $wi_PWD 2>/dev/null` if test "x$wi_resolved_path" != x ; then wi_resolved_path="$wi_resolved_path/$wi_file_name" fi unset wi_parent_dir wi_file_name fi if test "x$wi_resolved_path" = x ; then CCDV="$$CCDV" else CCDV="$wi_resolved_path" fi unset wi_resolved_path wi_path wi_cv_path_ccdv="$CCDV" CCDV="@$CCDV " # trailing space needed else wi_cv_path_ccdv="" fi fi echo "$ac_t""$wi_cv_path_ccdv" 1>&6 if test "$wi_used_cache_path_ccdv" = yes ; then CCDV="$wi_cv_path_ccdv" if test "x$CCDV" != x ; then CCDV="@$CCDV " # trailing space needed fi fi fi if test "x$mandir" = 'x${prefix}/man' ; then # Mandir is at default value -- try to see # if $prefix/share/man would be better. # # $prefix is probably set to NONE. # p=`cd / ; cd $prefix 2>/dev/null ; pwd` if test "x$p" = "x/" ; then p="/usr/local" fi if test -d "$p/share/man" ; then mandir="$p/share/man" fi fi echo $ac_n "checking if shell can test for symlinks""... $ac_c" 1>&6 echo "configure:12058: checking if shell can test for symlinks" >&5 if eval "test \"`echo '$''{'wi_cv_shell_test_symlinks'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else wi_cv_shell_test_symlinks="no" wi_cv_test_L="false" wi_cv_test_not_L=":" rm -f config.lnk if test ! -f "config.lnk" ; then ln -s /bin/sh${ac_exeext} config.lnk if test -f "config.lnk" ; then ( if test -L config.lnk ; then rm -f config.lnk ; fi ) 2>/dev/null if test ! -f "config.lnk" ; then wi_cv_shell_test_symlinks="yes" wi_cv_test_L='test -L' wi_cv_test_not_L='test ! -L' else ( if test -h config.lnk ; then rm -f config.lnk ; fi ) 2>/dev/null if test ! -f "config.lnk" ; then wi_cv_shell_test_symlinks="yes" wi_cv_test_L='test -h' wi_cv_test_not_L='test ! -h' fi fi fi rm -f config.lnk fi fi echo "$ac_t""$wi_cv_shell_test_symlinks" 1>&6 test_L="$wi_cv_test_L" test_not_L="$wi_cv_test_not_L" h_file="libncftp/ncftp.h" if test -f "$h_file" && $test_not_L "$h_file" ; then h_tmp=`echo "$h_file" | sed 's/\.h/.tmp/;'` longest_int_subst="${LONGEST_INT-long}" if sed 's!\ */\*\ set\ by\ configure\ at\ .*\*/!!' "$h_file" > "$h_tmp" ; then touch -r "$h_file" "$h_tmp" if cmp -s "$h_file" "$h_tmp" ; then : else /bin/mv "$h_tmp" "$h_file" chmod a+r "$h_file" fi fi if sed 's/^#define longest_int.*/#define longest_int '"$longest_int_subst"'/;s/^#define longest_uint.*/#define longest_uint unsigned '"$longest_int_subst"'/;' "$h_file" > "$h_tmp" ; then if cmp -s "$h_file" "$h_tmp" ; then datestr=`date '+%Y-%m-%d %H:%M:%S'` sed '/^#define longest_u?int/{s!$! /* set by configure at '"${datestr}"' */!;}' "$h_tmp" > "$h_file" unset datestr /bin/rm -f "$h_tmp" chmod a+r "$h_file" fi fi /bin/rm -f "$h_tmp" unset h_tmp longest_int_subst fi unset h_file h_file="libncftp/ncftp.h" if test -f "$h_file" && $test_not_L "$h_file" ; then h_tmp=`echo "$h_file" | sed 's/\.h/.tmp/;'` if sed 's!\ */\*\ set\ by\ configure\ at\ .*\*/!!' "$h_file" > "$h_tmp" ; then touch -r "$h_file" "$h_tmp" if cmp -s "$h_file" "$h_tmp" ; then : else /bin/mv "$h_tmp" "$h_file" chmod a+r "$h_file" fi fi if test "x$wi_cv_struct_stat64" = xyes ; then if sed 's/^#define Stat .*/#define Stat stat64/;s/^#define Lstat .*/#define Lstat lstat64/;s/^#define Fstat .*/#define Fstat fstat64/;' "$h_file" > "$h_tmp" ; then if cmp -s "$h_file" "$h_tmp" ; then : else datestr=`date '+%Y-%m-%d %H:%M:%S'` sed '/^#define [SLFs]*tat /{s!$! /* set by configure at '"${datestr}"' */!;}' "$h_tmp" > "$h_file" unset datestr /bin/rm -f "$h_tmp" chmod a+r "$h_file" fi fi else if sed 's/^#define Stat .*/#define Stat stat/;s/^#define Lstat .*/#define Lstat lstat/;s/^#define Fstat .*/#define Fstat fstat/;' "$h_file" > "$h_tmp" ; then if cmp -s "$h_file" "$h_tmp" ; then : else datestr=`date '+%Y-%m-%d %H:%M:%S'` sed '/^#define [SLFs]*tat /{s!$! /* set by configure at '"${datestr}"' */!;}' "$h_tmp" > "$h_file" unset datestr /bin/rm -f "$h_tmp" chmod a+r "$h_file" fi fi fi /bin/rm -f "$h_tmp" unset h_tmp longest_int_subst fi unset h_file h_file="libncftp/ncftp.h" if test -f "$h_file" && $test_not_L "$h_file" ; then h_tmp=`echo "$h_file" | sed 's/\.h/.tmp/;'` remove_cpp_warning=yes if [ "$SYS" = linux ] ; then # # We need to retain #warning on Linux # remove_cpp_warning=no fi if [ "$GCC" = yes ] ; then # # GCC accepts #warning # remove_cpp_warning=no fi if [ "$remove_cpp_warning" = yes ] ; then # # Remove "#warning", since compiler will complain about it # not being recognized. # sed 's/^\([\ \ ]*#[\ \ ]*warning.*\)/\/* \1 *\//;' "$h_file" > "$h_tmp" cmp -s "$h_file" "$h_tmp" if test $? -ne 0 ; then mv "$h_tmp" "$h_file" chmod a+r "$h_file" fi rm -f "$h_tmp" unset h_tmp longest_int_subst fi fi unset h_file remove_cpp_warning LIBSET='$(LIB)' Z30='#' case "$HOME" in *lcompile*) ;; *) if test -x /usr/local/bin/incrementor ; then Z30=' -@/usr/local/bin/incrementor -b -f version.c -f version.o' fi ;; esac wi_path="$srcdir" if test -d "$wi_path" ; then wi_resolved_path=`cd "$wi_path" ; $wi_PWD 2>/dev/null` elif test ! -f "$wi_path" ; then wi_resolved_path="$wi_path" else wi_parent_dir="$wi_path" wi_file_name="$wi_path" wi_parent_dir=`echo "$wi_parent_dir" | sed -n ' s-//*-/-g s-/*$-- /^\/\/*[^/]*$/{ c\\ / p q } /^[^/]*$/{ c\\ . p q } /./{ s-/[^/]*$-- p q }'` wi_file_name=`echo "$wi_file_name" | sed -n ' s-//*-/-g s-/*$-- s-^/$-- s-^.*/-- p q'` wi_resolved_path=`cd "$wi_parent_dir" ; $wi_PWD 2>/dev/null` if test "x$wi_resolved_path" != x ; then wi_resolved_path="$wi_resolved_path/$wi_file_name" fi unset wi_parent_dir wi_file_name fi if test "x$wi_resolved_path" = x ; then MAINDIR="$$srcdir" else MAINDIR="$wi_resolved_path" fi unset wi_resolved_path wi_path wi_path="$MAINDIR/libncftp/ncftp.h" if test -d "$wi_path" ; then wi_resolved_path=`cd "$wi_path" ; $wi_PWD 2>/dev/null` elif test ! -f "$wi_path" ; then wi_resolved_path="$wi_path" else wi_parent_dir="$wi_path" wi_file_name="$wi_path" wi_parent_dir=`echo "$wi_parent_dir" | sed -n ' s-//*-/-g s-/*$-- /^\/\/*[^/]*$/{ c\\ / p q } /^[^/]*$/{ c\\ . p q } /./{ s-/[^/]*$-- p q }'` wi_file_name=`echo "$wi_file_name" | sed -n ' s-//*-/-g s-/*$-- s-^/$-- s-^.*/-- p q'` wi_resolved_path=`cd "$wi_parent_dir" ; $wi_PWD 2>/dev/null` if test "x$wi_resolved_path" != x ; then wi_resolved_path="$wi_resolved_path/$wi_file_name" fi unset wi_parent_dir wi_file_name fi if test "x$wi_resolved_path" = x ; then libncftp_h="$$MAINDIR/libncftp/ncftp.h" else libncftp_h="$wi_resolved_path" fi unset wi_resolved_path wi_path libncftp_h=`echo "$libncftp_h" | sed -n ' s-//*-/-g s-/*$-- /^\/\/*[^/]*$/{ c\\ / p q } /^[^/]*$/{ c\\ . p q } /./{ s-/[^/]*$-- p q }'` wi_path="$MAINDIR/sio/sio.h" if test -d "$wi_path" ; then wi_resolved_path=`cd "$wi_path" ; $wi_PWD 2>/dev/null` elif test ! -f "$wi_path" ; then wi_resolved_path="$wi_path" else wi_parent_dir="$wi_path" wi_file_name="$wi_path" wi_parent_dir=`echo "$wi_parent_dir" | sed -n ' s-//*-/-g s-/*$-- /^\/\/*[^/]*$/{ c\\ / p q } /^[^/]*$/{ c\\ . p q } /./{ s-/[^/]*$-- p q }'` wi_file_name=`echo "$wi_file_name" | sed -n ' s-//*-/-g s-/*$-- s-^/$-- s-^.*/-- p q'` wi_resolved_path=`cd "$wi_parent_dir" ; $wi_PWD 2>/dev/null` if test "x$wi_resolved_path" != x ; then wi_resolved_path="$wi_resolved_path/$wi_file_name" fi unset wi_parent_dir wi_file_name fi if test "x$wi_resolved_path" = x ; then sio_h="$$MAINDIR/sio/sio.h" else sio_h="$wi_resolved_path" fi unset wi_resolved_path wi_path sio_h=`echo "$sio_h" | sed -n ' s-//*-/-g s-/*$-- /^\/\/*[^/]*$/{ c\\ / p q } /^[^/]*$/{ c\\ . p q } /./{ s-/[^/]*$-- p q }'` wi_path="$MAINDIR/Strn/Strn.h" if test -d "$wi_path" ; then wi_resolved_path=`cd "$wi_path" ; $wi_PWD 2>/dev/null` elif test ! -f "$wi_path" ; then wi_resolved_path="$wi_path" else wi_parent_dir="$wi_path" wi_file_name="$wi_path" wi_parent_dir=`echo "$wi_parent_dir" | sed -n ' s-//*-/-g s-/*$-- /^\/\/*[^/]*$/{ c\\ / p q } /^[^/]*$/{ c\\ . p q } /./{ s-/[^/]*$-- p q }'` wi_file_name=`echo "$wi_file_name" | sed -n ' s-//*-/-g s-/*$-- s-^/$-- s-^.*/-- p q'` wi_resolved_path=`cd "$wi_parent_dir" ; $wi_PWD 2>/dev/null` if test "x$wi_resolved_path" != x ; then wi_resolved_path="$wi_resolved_path/$wi_file_name" fi unset wi_parent_dir wi_file_name fi if test "x$wi_resolved_path" = x ; then strn_h="$$MAINDIR/Strn/Strn.h" else strn_h="$wi_resolved_path" fi unset wi_resolved_path wi_path strn_h=`echo "$strn_h" | sed -n ' s-//*-/-g s-/*$-- /^\/\/*[^/]*$/{ c\\ / p q } /^[^/]*$/{ c\\ . p q } /./{ s-/[^/]*$-- p q }'` CPPFLAGS="-I${MAINDIR} -I${libncftp_h} -I${sio_h} -I${strn_h} $CPPFLAGS" LDFLAGS="-L${libncftp_h} -L${sio_h} -L${strn_h} $LDFLAGS" LIBS=`echo "$LIBS" | sed 's/^ *//;s/ *$//;s/ */ /g'` LDFLAGS=`echo "$LDFLAGS" | sed 's/^ *//;s/ *$//;s/ */ /g'` CPPFLAGS=`echo "$CPPFLAGS" | sed 's/^ *//;s/ *$//;s/ */ /g'` CFLAGS=`echo "$CFLAGS $wi_CFLAGS_TO_ADD_LATER" | sed 's/^ *//;s/ *$//;s/ */ /g'` DEFS=`echo "$DEFS" | sed 's/^ *//;s/ *$//;s/ */ /g'` LIBNCFTP_PRECOMP="libncftp/pch.mk.none" SIO_PRECOMP="sio/pch.mk.none" if test "${wi_cv_cc_precomp}_${wi_cv_cc_precomp_type}" = "yes_gcc_gch_files" ; then LIBNCFTP_PRECOMP="libncftp/pch.mk.gcc-gch" SIO_PRECOMP="sio/pch.mk.gcc-gch" elif test "${wi_cv_cc_precomp}_${SYS}" = "yes_macosx" ; then LIBNCFTP_PRECOMP="libncftp/pch.mk.$SYS" SIO_PRECOMP="sio/pch.mk.$SYS" fi LIBNCFTP_VERSION=`sed -n '/kLibraryVersion/{ s/^[^0-9]*// s/\ .*$// p q }' libncftp/ncftp.h` NCFTP_VERSION=`sed -n '/gVersion\[\]/{ s/^[^0-9]*// s/\/.*$// p q }' ncftp/version.c` SIO_VERSION=`sed -n '/kSioVersion/{ s/^[^0-9]*// s/\ .*$// p q }' sio/sio.h` STRN_VERSION=`sed -n '/gStrnLibVersion\[\]/{ s/^[^0-9]*// s/\".*$// p q }' Strn/Strncpy.c` echo $ac_n "checking CC""... $ac_c" 1>&6 echo "configure:12541: checking CC" >&5 echo "$ac_t""$CC" 1>&6 echo $ac_n "checking CFLAGS""... $ac_c" 1>&6 echo "configure:12544: checking CFLAGS" >&5 echo "$ac_t""$CFLAGS" 1>&6 echo $ac_n "checking CPPFLAGS""... $ac_c" 1>&6 echo "configure:12547: checking CPPFLAGS" >&5 echo "$ac_t""$CPPFLAGS" 1>&6 echo $ac_n "checking DEFS""... $ac_c" 1>&6 echo "configure:12550: checking DEFS" >&5 echo "$ac_t""$DEFS" 1>&6 echo $ac_n "checking NDEFS""... $ac_c" 1>&6 echo "configure:12553: checking NDEFS" >&5 echo "$ac_t""$NDEFS" 1>&6 echo $ac_n "checking LDFLAGS""... $ac_c" 1>&6 echo "configure:12556: checking LDFLAGS" >&5 echo "$ac_t""$LDFLAGS" 1>&6 echo $ac_n "checking LIBS""... $ac_c" 1>&6 echo "configure:12559: checking LIBS" >&5 echo "$ac_t""$LIBS" 1>&6 # # Also take the opportunity to do some post-configure clean-up # /bin/rm -rf "conftest.dSYM" "a.out" trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs. It is not useful on other systems. # If it contains results you don't want to keep, you may remove or edit it. # # By default, configure uses ./config.cache as the cache file, # creating it if it does not exist already. You can give configure # the --cache-file=FILE option to use a different cache file; that is # what configure does when it calls configure scripts in # subdirectories, so they share the cache. # Giving --cache-file=/dev/null disables caching, for debugging configure. # config.status only pays attention to the cache file if you give it the # --recheck option to rerun configure. # EOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). sed -n \ -e "s/'/'\\\\''/g" \ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ;; esac >> confcache if cmp -s $cache_file confcache; then : else if test -w $cache_file; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Any assignment to VPATH causes Sun make to only execute # the first set of double-colon rules, so remove it if not needed. # If there is a colon in the path, we need to keep it. if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' fi trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 DEFS=-DHAVE_CONFIG_H # Without the "./", some shells look in PATH for config.status. : ${CONFIG_STATUS=./config.status} echo creating $CONFIG_STATUS rm -f $CONFIG_STATUS cat > $CONFIG_STATUS </dev/null | sed 1q`: # # $0 $ac_configure_args # # Compiler output produced by configure, useful for debugging # configure, is in ./config.log if it exists. ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" for ac_option do case "\$ac_option" in -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; *) echo "\$ac_cs_usage"; exit 1 ;; esac done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" trap 'rm -fr `echo "Makefile Makefile.bin ncftp/Makefile libncftp/Makefile Strn/Makefile sio/Makefile sh_util/Makefile vis/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF $ac_vpsub $extrasub s%@SHELL@%$SHELL%g s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g s%@FFLAGS@%$FFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g s%@exec_prefix@%$exec_prefix%g s%@prefix@%$prefix%g s%@program_transform_name@%$program_transform_name%g s%@bindir@%$bindir%g s%@sbindir@%$sbindir%g s%@libexecdir@%$libexecdir%g s%@datadir@%$datadir%g s%@sysconfdir@%$sysconfdir%g s%@sharedstatedir@%$sharedstatedir%g s%@localstatedir@%$localstatedir%g s%@libdir@%$libdir%g s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@CC@%$CC%g s%@NDEFS@%$NDEFS%g s%@OS@%$OS%g s%@host@%$host%g s%@SYS@%$SYS%g s%@HOME_OS@%$HOME_OS%g s%@CPP@%$CPP%g s%@STRIP@%$STRIP%g s%@OBJEXT@%$OBJEXT%g s%@EXEEXT@%$EXEEXT%g s%@SIO_OBJS_U@%$SIO_OBJS_U%g s%@SIO_SOBJS_U@%$SIO_SOBJS_U%g s%@SOCKS_LIBS@%$SOCKS_LIBS%g s%@LIBCURSES@%$LIBCURSES%g s%@PERL@%$PERL%g s%@MKTEMP@%$MKTEMP%g s%@ALLOCA@%$ALLOCA%g s%@SET_MAKE@%$SET_MAKE%g s%@TAR@%$TAR%g s%@TARFLAGS@%$TARFLAGS%g s%@RANLIB@%$RANLIB%g s%@AR@%$AR%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@wi_PWD@%$wi_PWD%g s%@CCDV@%$CCDV%g /@LIBNCFTP_PRECOMP@/r $LIBNCFTP_PRECOMP s%@LIBNCFTP_PRECOMP@%%g /@SIO_PRECOMP@/r $SIO_PRECOMP s%@SIO_PRECOMP@%%g s%@SFLAG@%$SFLAG%g s%@MAKE@%$MAKE%g s%@Z30@%$Z30%g s%@LIBSET@%$LIBSET%g s%@MAINDIR@%$MAINDIR%g s%@NCFTP_VERSION@%$NCFTP_VERSION%g s%@LIBNCFTP_VERSION@%$LIBNCFTP_VERSION%g s%@SIO_VERSION@%$SIO_VERSION%g s%@STRN_VERSION@%$STRN_VERSION%g s%@VIS_DPROGS@%$VIS_DPROGS%g s%@SIZEOF_OFF_T@%$SIZEOF_OFF_T%g s%@SIZEOF_ST_SIZE@%$SIZEOF_ST_SIZE%g CEOF EOF cat >> $CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. ac_file=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_cmds # Line after last line for current file. ac_more_lines=: ac_sed_cmds="" while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file else sed "${ac_end}q" conftest.subs > conftest.s$ac_file fi if test ! -s conftest.s$ac_file; then ac_more_lines=false rm -f conftest.s$ac_file else if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f conftest.s$ac_file" else ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" fi ac_file=`expr $ac_file + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_cmds` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" # A "../" for each directory in $ac_dir_suffix. ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` else ac_dir_suffix= ac_dots= fi case "$ac_given_srcdir" in .) srcdir=. if test -z "$ac_dots"; then top_srcdir=. else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; *) # Relative path. srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" top_srcdir="$ac_dots$ac_given_srcdir" ;; esac case "$ac_given_INSTALL" in [/$]*) INSTALL="$ac_given_INSTALL" ;; *) INSTALL="$ac_dots$ac_given_INSTALL" ;; esac echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." case "$ac_file" in *Makefile*) ac_comsub="1i\\ # $configure_input" ;; *) ac_comsub= ;; esac ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g s%@INSTALL@%$INSTALL%g " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done rm -f conftest.s* # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' ac_dC='\3' ac_dD='%g' # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='\([ ]\)%\1#\2define\3' ac_uC=' ' ac_uD='\4%g' # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_eB='$%\1#\2define\3' ac_eC=' ' ac_eD='%g' if test "${CONFIG_HEADERS+set}" != set; then EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF fi for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac echo creating $ac_file rm -f conftest.frag conftest.in conftest.out ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` cat $ac_file_inputs > conftest.in EOF # Transform confdefs.h into a sed script conftest.vals that substitutes # the proper values into config.h.in to produce config.h. And first: # Protect against being on the right side of a sed subst in config.status. # Protect against being in an unquoted here document in config.status. rm -f conftest.vals cat > conftest.hdr <<\EOF s/[\\&%]/\\&/g s%[\\$`]%\\&%g s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp s%ac_d%ac_u%gp s%ac_u%ac_e%gp EOF sed -n -f conftest.hdr confdefs.h > conftest.vals rm -f conftest.hdr # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >> conftest.vals <<\EOF s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% EOF # Break up conftest.vals because some shells have a limit on # the size of here documents, and old seds have small limits too. rm -f conftest.tail while : do ac_lines=`grep -c . conftest.vals` # grep -c gives empty output for an empty file on some AIX systems. if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi # Write a limited-size here document to conftest.frag. echo ' cat > conftest.frag <> $CONFIG_STATUS sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS echo 'CEOF sed -f conftest.frag conftest.in > conftest.out rm -f conftest.in mv conftest.out conftest.in ' >> $CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail rm -f conftest.vals mv conftest.tail conftest.vals done rm -f conftest.vals cat >> $CONFIG_STATUS <<\EOF rm -f conftest.frag conftest.h echo "/* $ac_file. Generated automatically by configure. */" > conftest.h cat conftest.in >> conftest.h rm -f conftest.in if cmp -s $ac_file conftest.h 2>/dev/null; then echo "$ac_file is unchanged" rm -f conftest.h else # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" fi rm -f $ac_file mv conftest.h $ac_file fi fi; done EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF /bin/rm -f ./ncftp/readln.o exit 0 EOF chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 ncftp-3.2.6/configure.in0000644000000000000000000002233413021061276013766 0ustar rootwheeldnl Process this file with autoconf to produce a configure script. dnl AC_INIT(ncftp/main.c) AC_PREREQ(2.13) AC_CONFIG_HEADER(config.h) wi_ARG_DISABLE_CCDV AC_ARG_WITH(curses,[ --without-curses do not try to find and use the curses library],nc_cv_curses=$withval,nc_cv_curses=yes) wi_ARG_ENABLE_DEBUG AC_ARG_WITH(ncurses,[ --without-ncurses do not try to find and use the ncurses library],nc_cv_ncurses=$withval,nc_cv_ncurses=yes) wi_ARG_DISABLE_PRECOMP dnl AC_ARG_WITH(readline,[ --without-readline do not try to find and use the readline library],nc_cv_readline=$withval,nc_cv_readline=yes) wi_ARG_WITH_SOCKS5 wi_ARG_ENABLE_SSP wi_ARG_DISABLE_MACOSX_UNIVERSAL dnl --------------------------------------------------------------------------- dnl Environment and compiler settings. dnl --------------------------------------------------------------------------- dnl wi_ENV_VAR_MESSAGES wi_PROG_CC wi_OS_VAR case "$os" in linux) OS="linux-$arch-$libc" ;; esac if test -f sh/install-sh ; then chmod 755 sh/*.sh sh/config.* sh/install-sh ; fi AC_CONFIG_AUX_DIR([sh]) wi_CC_PRECOMP wi_REQUEST_NO_Y2K_WARNINGS wi_CFLAGS_LFS_OR_LFS64 wi_CFLAGS_REENTRANT wi_MACOSX_UNIVERSAL_CFLAGS wi_SFLAG AC_OBJEXT AC_EXEEXT wi_DEFINE_UNAME wi_EXTRA_SYSV_SUNOS_DIRS dnl For better curses library on SunOS 4 dnl Try to use PATH rather than hardcode the installation path, if possible. if test "${prefix-NONE}" != "NONE" && test "$prefix" != "/usr/local" && test "$prefix" != "/usr"; then AC_DEFINE_UNQUOTED(PREFIX_BINDIR, "$prefix/bin") fi dnl --------------------------------------------------------------------------- dnl Checks for header files. dnl --------------------------------------------------------------------------- dnl AC_HEADER_STDC dnl Readline headers #ifdefs for string.h, sio needs strings.h for AIX AC_CHECK_HEADERS(arpa/nameser.h gnu/libc-version.h locale.h net/errno.h nserve.h resolv.h sgtty.h string.h strings.h sys/id.h sys/ioctl.h syslog.h sys/sendfile.h sys/socket.h sys/time.h sys/types.h sys/utsname.h sys/systeminfo.h termio.h termios.h time.h utime.h unistd.h gnu/libc-version.h) AC_TIME_WITH_SYS_TIME dnl # sio wi_UNIX_DOMAIN_SOCKETS SIO_OBJS_U='' SIO_SOBJS_U='' if test "$wi_cv_unix_domain_sockets" = yes ; then SIO_OBJS_U='$(OBJS_U) ' SIO_SOBJS_U='$(SOBJS_U) ' fi AC_SUBST(SIO_OBJS_U) AC_SUBST(SIO_SOBJS_U) dnl # sio dnl --------------------------------------------------------------------------- dnl Checks for libraries. dnl --------------------------------------------------------------------------- dnl wi_NET_LIBS wi_LIB_SOCKS5 case "$OS" in solaris8-*) dnl dnl Older Solaris 8 versions don't have it, but we try to dnl manually dynamically load the library if available. dnl saved_LIBS="$LIBS" AC_CHECK_LIB(sendfile,sendfilev) AC_CHECK_FUNCS(sendfilev sendfilev64) LIBS="$saved_LIBS" AC_CHECK_LIB(dl,dlopen) ;; changequote(<<, >>)dnl solaris9-*|solaris1[0-9]-*) changequote([, ])dnl AC_CHECK_LIB(sendfile,sendfilev) AC_CHECK_FUNCS(sendfilev sendfilev64) ;; esac LIBCURSES='' if test "$nc_cv_curses" = yes ; then wi_LIB_CURSES fi dnl if test "$nc_cv_readline" = yes ; then dnl wi_LIB_READLINE dnl fi dnl dnl DNSSEC dnl # Check whether user wants DNSSEC local validation support AC_ARG_WITH(dnssec-local-validation, [ --with-dnssec-local-validation Enable local DNSSEC validation using libval (no)], want_dnssec=$withval, want_dnssec=no) if ! test "x-$want_dnssec" = "x-no" ; then AC_CHECK_HEADERS(validator/validator.h) if test "$ac_cv_header_validator_validator_h" != yes; then AC_MSG_ERROR(Can't find validator.h) fi AC_CHECK_LIB(ssl, SHA1_Init,,AC_MSG_ERROR([Can't find SSL library])) AC_CHECK_LIB(sres, query_send,,AC_MSG_ERROR([Can't find libsres])) AC_CHECK_LIB(val, p_val_status, LIBS="$LIBS -lval" have_val_res_query=yes, [ AC_CHECK_LIB(pthread, pthread_rwlock_init) AC_CHECK_LIB(val-threads, p_val_status, have_val_res_query=yes LIBS="-lval-threads $LIBS" LIBVAL_SUFFIX="-threads", AC_MSG_ERROR(Can't find libval or libval-threads)) ]) AC_DEFINE(DNSSEC_LOCAL_VALIDATION, 1, [Define if you want local DNSSEC validation support]) fi dnl --------------------------------------------------------------------------- dnl Checks for typedefs, structures, and compiler characteristics. dnl --------------------------------------------------------------------------- dnl AC_C_CONST AC_TYPE_SIZE_T AC_TYPE_OFF_T AC_TYPE_MODE_T AC_TYPE_PID_T AC_TYPE_UID_T wi_VOID_MAIN_RETURN_TYPE wi_USE_LONG_LONG wi_STRUCT_TIMEVAL_FIELD_TYPES wi_UNISTD_FUNC_PARAM_TYPES wi_CHECK_TYPE(negative_control_t, long, []) wi_CHECK_TYPE(ssize_t, long, []) wi_CHECK_TYPE(sa_family_t, unsigned short, [#include #include #include #include ]) wi_FUNC_SELECT_ARGTYPES wi_STRUCT_STAT64 wi_TYPE_SIG_ATOMIC_T wi_GETOPT wi__RES_DEFDNAME dnl # sio wi_STRUCT_CMSGHDR dnl # sio wi_MSGHDR_CONTROL dnl # sio wi_MSGHDR_ACCRIGHTS dnl # sio wi_HEADER_SYS_SELECT_H dnl # sio dnl --------------------------------------------------------------------------- dnl Checks for library functions. dnl --------------------------------------------------------------------------- dnl wi_FUNC_GETCWD AC_CHECK_FUNCS(fstat64 getdomainname gethostname getpass getpassphrase gnu_get_libc_release gnu_get_libc_version inet_aton inet_ntop llseek lseek64 lstat64 memmove mktime open64 pathconf readlink recvfile res_init sendfile setlocale setpgid setpgrp setsid setvbuf sigaction sigsetjmp stat64 strcasecmp strcoll strdup strerror strncoll strstr strtoq symlink sysconf sysctl sysinfo syslog tcgetattr uname waitpid) AC_CHECK_FUNCS(gethostbyaddr_r gethostbyname_r gethostbyname2_r getlogin_r getpwnam_r _posix_getpwnam_r getpwuid_r _posix_getpwuid_r getservbyname_r getservbyport_r gmtime_r localtime_r readdir_r) wi_SNPRINTF wi_FUNC_SIGSETJMP wi_FUNC_SETPGRP wi_FUNC_SETVBUF AC_FUNC_ALLOCA dnl Only needed for Linux, and for one function in Sio. wi_CURSES_FEATURES if test "x$LIBCURSES" = "x" ; then VIS_DPROGS="# ../bin/ncftpbookmarks${EXEEXT}" else VIS_DPROGS="../bin/ncftpbookmarks${EXEEXT}" fi dnl --------------------------------------------------------------------------- dnl Checks for system characteristics. dnl --------------------------------------------------------------------------- dnl AC_SYS_LONG_FILE_NAMES AC_PROG_MAKE_SET wi_PROG_TAR wi_CREATE_TAR_FILES wi_PROG_RANLIB wi_PROG_AR AC_PROG_INSTALL wi_PROG_CCDV wi_MANDIR wi_SUBST_LONGEST_INT_HEADER([libncftp/ncftp.h]) wi_SUBST_STAT_HEADER([libncftp/ncftp.h]) wi_REMOVE_UNKNOWN_PREPROCESSING_DIRECTIVES_FROM_FILE([libncftp/ncftp.h]) LIBSET='$(LIB)' Z30='#' case "$HOME" in *lcompile*) ;; *) if test -x /usr/local/bin/incrementor ; then Z30=' -@/usr/local/bin/incrementor -b -f version.c -f version.o' fi ;; esac wi_RESOLVE_PATH([$srcdir], MAINDIR) wi_RESOLVE_PATH([$MAINDIR/libncftp/ncftp.h], [libncftp_h]) wi_DIRNAME(libncftp_h) wi_RESOLVE_PATH([$MAINDIR/sio/sio.h], [sio_h]) wi_DIRNAME(sio_h) wi_RESOLVE_PATH([$MAINDIR/Strn/Strn.h], [strn_h]) wi_DIRNAME(strn_h) CPPFLAGS="-I${MAINDIR} -I${libncftp_h} -I${sio_h} -I${strn_h} $CPPFLAGS" LDFLAGS="-L${libncftp_h} -L${sio_h} -L${strn_h} $LDFLAGS" wi_BEAUTIFY_ENVIRONMENT_VARIABLES dnl --------------------------------------------------------------------------- dnl Extra steps to work with precompiled headers. dnl --------------------------------------------------------------------------- dnl LIBNCFTP_PRECOMP="libncftp/pch.mk.none" SIO_PRECOMP="sio/pch.mk.none" if test "${wi_cv_cc_precomp}_${wi_cv_cc_precomp_type}" = "yes_gcc_gch_files" ; then LIBNCFTP_PRECOMP="libncftp/pch.mk.gcc-gch" SIO_PRECOMP="sio/pch.mk.gcc-gch" elif test "${wi_cv_cc_precomp}_${SYS}" = "yes_macosx" ; then LIBNCFTP_PRECOMP="libncftp/pch.mk.$SYS" SIO_PRECOMP="sio/pch.mk.$SYS" fi AC_SUBST_FILE(LIBNCFTP_PRECOMP) AC_SUBST_FILE(SIO_PRECOMP) dnl --------------------------------------------------------------------------- dnl Version lookups for Makefile variables. dnl --------------------------------------------------------------------------- dnl changequote(<<, >>)dnl LIBNCFTP_VERSION=`sed -n '/kLibraryVersion/{ s/^[^0-9]*// s/\ .*$// p q }' libncftp/ncftp.h` NCFTP_VERSION=`sed -n '/gVersion\[\]/{ s/^[^0-9]*// s/\/.*$// p q }' ncftp/version.c` SIO_VERSION=`sed -n '/kSioVersion/{ s/^[^0-9]*// s/\ .*$// p q }' sio/sio.h` STRN_VERSION=`sed -n '/gStrnLibVersion\[\]/{ s/^[^0-9]*// s/\".*$// p q }' Strn/Strncpy.c` changequote([, ])dnl dnl --------------------------------------------------------------------------- dnl Create Makefiles and config.h files. dnl --------------------------------------------------------------------------- dnl wi_SUMMARIZE_COMPILER_FLAGS AC_SUBST(CC) AC_SUBST(CFLAGS) AC_SUBST(CPPFLAGS) AC_SUBST(LDFLAGS) AC_SUBST(LIBS) AC_SUBST(SFLAG) AC_SUBST(DEFS) AC_SUBST(MAKE) AC_SUBST(Z30) AC_SUBST(LIBSET) AC_SUBST(MAINDIR) AC_SUBST(NCFTP_VERSION) AC_SUBST(LIBNCFTP_VERSION) AC_SUBST(SIO_VERSION) AC_SUBST(STRN_VERSION) AC_SUBST(VIS_DPROGS) AC_SUBST(SIZEOF_OFF_T) AC_SUBST(SIZEOF_ST_SIZE) AC_OUTPUT_COMMANDS([/bin/rm -f ./ncftp/readln.o]) AC_OUTPUT([Makefile Makefile.bin ncftp/Makefile libncftp/Makefile Strn/Makefile sio/Makefile sh_util/Makefile vis/Makefile]) ncftp-3.2.6/doc/0000755000000000000000000000000013021063722012214 5ustar rootwheelncftp-3.2.6/doc/CHANGELOG.txt0000644000000000000000000013463113021063632014254 0ustar rootwheelNcFTP Change Log: ================ 3.2.6, 2016-12-04 + If a recursive download operation is also requested with delete mode, attempt to remove empty directories after all files have completed successfully. + No longer trying to utime() after every single block on downloads, which could cause noticable performance degradation when the local filesystem was not local. + Changed behavior of resuming downloads where the timestamp wasn't preserved (because of the utime change, above). The new behavior is to resume the download when the local copy has a recent timestamp (less than a week). + You can now disable use of MFMT like you could similarly disable SITE UTIME (e.g., "-o noMFMT" and "-o noSITE_UTIME"). + Now able to use sendfile() for uploads, on Linux/FreeBSD/Mac. Progress reports work too, with a small performance penalty. Ncftpput has a "-s" option to toggle whether it is used (defaults to on in ncftpput and ncftpbatch, off in ncftp). + Ncftpbatch/spooler now use larger buffers for pathnames, allowing for deeper directory trees. + Ncftpbatch/spooler now interpret a received SIGUSR1 as a hint to exit when the current file has finished. + Ncftpbatch/spooler now interpret a received SIGUSR2 to request it to stop sleeping and recheck the queue immediately. + Ncftpbatch/spooler's spool files now allow for you to specify that the local and/or remote file be renamed after a successful transfer. + Ncftpbatch/spooler now a little less chatty by reducing the number of PWD/CWD operations. + Ncftpbatch/spooler now log some xfer stats in its general log file, and ncftpspooler has a new "-x" option to specify a separate xfer log file. + Ncftpbatch/spooler now use a larger default maximum for its log file (10 MiB rather than 200 kB), and ncftpspooler has an -O command line option that can set this limit. Use "-O 0" for no maximum. + Ncftpbatch/spooler now try to present time in local timezone rather than UTC where possible. + Ncftpbatch/spooler now support multiple items per transaction (spool) file. 3.2.5, 2011-01-01 + Fixed a problem on Mac OS X Snow Leopard for universal binary support. + ncftpls now prefers that you omit the leading dash when you use the -x option. For example, if you wanted to try "ls -lrt", then try doing "ncftpls -x lrt" rather than "ncftpls -x -lrt". + If a server's MLSx output returns both the "UNIX.mode" and the "perm" parameters, UNIX.mode will take precedence (Thanks, Jay Kulpinski). + confirm-close is now off by default. 3.2.4.1, 2010-05-16 + Fixed a bug in Ncftpget/put/ls which could ignore the username (-u) and password (-p) command line parameters. 3.2.4, 2010-04-07 + Ncftpget and ncftpput can now read $HOME/.ncftp/bookmarks and take a bookmark name in place of a hostname. If the hostname specified is not fully qualified (i.e. does not contain a period), then bookmarks will be queried; if no bookmarks match, then a local hostname is assumed. Bookmarks are also queried for the config file option, -f, when the file specified by -f does not exist. + Compatibility fixes for FreeBSD 8. + Support for local validation of DNSSEC when combined with libraries available from the DNSSEC Tools project (Thanks, Robert Story). + Microsoft disabled recursive directory listings altogether when fixing KB975254 (Thanks, Andrew Coggeshall). When entire directories are downloaded, instead of using "LIST -R" for one efficient listing of all files, the directories are manually traversed with one directory listing for each subdirectory. This will improve reliability of recursive downloads, except for the case when their are circular symbolic links (which is why "LIST -R" had been favored, which the server can easily handle). + Compatibility fixes for Mac OS X for building from source code (Thanks, Mathieu Rene) 3.2.3, 2009-07-28 + Large File Support has been updated internally to use newer APIs, rather than the transitional API. + You can now specify an IP address for binding the local end of sockets. Useful if you need connections to originate from a specific IP on the system. + Bug fixed where binding an ephemeral port number in a specified range (rare) may not have used all available retries for binding. + Local writes now "retry" when the write returns less than the full number of bytes specified, and will call write() again to write out the remaining bytes. This bug is very rare since local write almost always write out the full number of bytes. This bug may have been limited to a particular type of filesystem. + Using a higher resolution timer on Windows, so that the timer no longer wraps over after a month. + The minimum version of Windows that the source code will now compile on is Windows 2000, although with a little tweaking you could compile for Windows NT 4 again. + Compatibility fix for Mac OS X when compiling from source to build universal binaries (Thanks, Toshi NAGATA) + Compatibility fix for FreeBSD, where a connection attempt may have failed with "Operation now in progress." + Fixed a bug where the global firewall pref files were not read if the user's home directory was the root directory. + Using MFMT command to set remote timestamps, if available, in preference to SITE UTIME or MDTM. + New configure flag, --enable-ssp, will turn on stack smashing protection (if available by compiler) by adding to CFLAGS. + Host, user, and pass fields have been increased in size. + Bug fixed where the firewall preference files were ignored for the root user. + Ncftpls now has a "-Z" option that will disable doing the actual directory listing. This is useful for use with the "-Y" option to send a raw FTP command without doing a listing. 3.2.2, 2008-08-18 + Fixed an assertion failure in NcFTP's "help" command that appeared in a 2008-08-09 release. + PASV mode will now be retried, in case of a transient failure. (Thanks, Steven Frank). + The directory listing parser now can recognize dates in the format of YYYY-mm-dd HH:MM[:SS]. + Fixed feature detection for WS_FTP servers. + Workaround bug in REST on WS_FTP 6.0 (Thanks, Dan Nelson). + Fixed a problem where doing a get on a remote file that did not exist, but a file by the same name existed locally, would err out but truncate the local file anyway. + Fix for ncftpget on Windows to write in binary to stdout when needed (Thanks, Michael Langguth). + HOME, END, and DEL keys may work on more terminal types (Thanks, Anton Khramov). + You can now type just ".." or the absolute path of a directory in the ncftp command shell to "cd" to the directory (Thanks, Anton Khramov). + Added command aliases "mv" and "ll" which alias to "rename" and "dir" respectively (Thanks, Anton Khramov). + ncftpbatch now has an -L option to specify the name of a log file to write progress meter output to. Combined with "tail -f", this can be used to monitor a batch file transfer in progress. + On Mac OS X, the configure script will now try to build universal binaries by default. If you don't want that, pass --disable-universal to configure. + The default connect timeout has been reduced from 30 to 10 seconds to reflect the increase in the typical user's network speed. 3.2.1, 2007-07-29 + Now a little more tolerant of FTP servers who send their internal network IP addresses in their PASV response. When this is detected, it will be ignored and the data connection will connect to the same IP that is used for the control connection. + Resuming of uploads can now work for servers that do not support REST + STOR. The APPE command will be used instead. + Fixed problem with Resume All [R!] in ncftp, which was just appending to subsequent files rather than resuming them. (Thanks, Terry Brown) + ncftpput for version 3.2.0 did not work correctly when both -f and -c/-C were used. This has now been fixed. In addition, the host command line argument is optional when the config file specifies the host. + Various small fixes. 3.2.0, 2006-08-05 + Fixed problem where ncftpbatch may requeue downloads when the local file was the same as the remote file. + ncftpls has been enhanced so that using the new -m option will have it try a machine-readable list command. These commands need to be implemented on the remote server for it to work. + ncftpls can now try to attempt to filter the files with a wildcard with the new -i option. For this option to work, this functionality must be properly implemented in the FTP server software. + ncftpls can also now behave similar to /usr/bin/find, with the new -g option. When invoked with -gg, it appends a slash to directory pathnames so you can distinguish files from directories. + Fixed a problem with ASCII translation where a CR+LF may not have been converted to the local text EOLN format if the CR+LF was split over an internal block boundary. The ASCII translation code has been rewritten so it is also more tolerant of malformatted text, such as CR+CR+LF end-of-lines. + You can now edit remote files, thanks to . The new "edit" command downloads to a temporary file, runs your $EDITOR, and uploads any changes back to the remote server. Naturally this requires both read and write permission on the remote server. + Handling "~" in paths a little better. Try to expand it to the remote home directory for remote commands, and the local home directory for local commands. + Progress meters now output to stderr. This eliminates a problem when using ncftpput with "-c" mode, which would result in a corrupted file. + More careful about trimming the $HOME/.ncftp/log file so it does not get too small. + You can now resume uploads when uploading into a temporary file (e.g. ncftpput's -S and -T options for using a temporary suffix or prefix). + The utility programs' "-X" option has been enhanced so it will automatically translate some /usr/bin/ftp commands into the raw RFC 959 FTP protcool commands that are required for this feature. + Fixes for Cygwin. + Some fixes for largefile support on Windows. + You can now resume transfers in ASCII mode, rather than just binary. + Fixed a problem with recursive uploads for Windows. + Opening a site with a bookmark no longer assumes that the server's software has the same configuration (i.e. if it did not support SIZE before, it now checks for SIZE each time rather than assuming each time the site is opened that the server does not support SIZE). + You can now use an empty password if your user account does not have a password. + Fixed a problem in the "ls" implementation for international month names. + Fixed a bug where Type of Service socket options were being set with IPPROTO_TCP instead of IPPROTO_IP. 3.1.9, 2005-04-06 + Renamed internal library function getline() to gl_getline() to avoid namespace collision with glibc. + Renamed internal library function Duration() to FTPDuration() to avoid namespace collision on Mac OS X. + Recognize additional error response codes to SITE UTIME, to prevent using it if the server doesn't support it. + If the server does not support setting timestamps in MDTM, quit trying it if it fails the first time. + Do not allow control characters such as NUL, CR, LF in FTP URLs, to avoid command injection as described by Albert Puigsech Galicia . + Fixed a problem where a timed-out transfer may have been detected but still locked up the process (Thanks, IWAI, Masaharu). + Ncftpget and ncftpput now accept a "-C" parameter which is similar to the "-c" option (ftp "cat" mode), where stdin (stdout) is not used and the filename is specified as a parameter instead. This is useful if you don't want to specify a password on the command line. + Ncftpput now allows the "-m" option in conjunction with the "-c" or "-C" options. + Small compatibility fixes for Mac OS X, Solaris 10, Linux. 3.1.8.1, 2004-07-27 + A fix for some DNS resolution problems on Linux. 3.1.8, 2004-07-07 + Ncftpget, ncftpput, and ncftpls now try to erase the arguments to the -u/-p/-j (user, password, account) options so they do not show in a "ps" command (Thanks, Konstantin Gavrilenko). + Recognize broken IBM mainframe FTP servers and work around them. + Working around a problem with ProFTPD 1.2.9 and later which would cause recursive downloads to fail. + Fixed a bug where ncftpput in recursive mode could lock up if you used a trailing slash on the directory to upload. + For the malicious server problem that was addressed in 3.1.5, enhanced the fix for better compatibility with mainframe FTP servers. + Ncftpget, ncftpput, and ncftpls, and ncftp's open command now accept an additional advanced option (-o) which lets you do things like disable NcFTP's use of SITE UTIME, FEAT, HELP SITE, etc. + Several HP-UX 10 compatibility bugs fixed (Thanks, Laurent FAILLIE). + A couple of looping problems with ncftpbatch fixed (Thanks, George Goffe). + Bug fixed with the upload socket buffer not being set (Thanks, ybobble). + The utility programs now accept "-" for the config file name used with "-f" to denote standard input (Thanks, Jeremy Monin). + Bug fixed with ncftpput when using both -c and -A (Thanks, Ken Woodmansee). + Support for boldface text in Windows version (Thanks, Adam Gates). 3.1.7, 2004-01-07 + Fixed a memory leak introduced in 3.1.6. + Fixed problem where it was assumed that daylight saving's time occurred at the same time each year for all timezones. + Bug fixed with running a shell escape. + Ncftpget now uses passive-with-fall-back-to-port mode like ncftpput and ncftpls. + Problem fixed with "ls -a" where occasionally a row with ".." and another file would be omitted. + Ncftpbatch now uses the UTC timezone for spool files. + The configure script can now detect when the config.cache file has been improperly recycled from a machine with a different OS. + The Windows version now uses the USERPROFILE environment variable, if it was set, as the location of the user's home directory. + Recognize broken DG/UX servers and work around them. 3.1.6, 2003-08-25 + Fixed an important bug that was causing socket leaks on Windows. + Added support for GCC 3.4 precompiled headers. + Aborting transfers is now more robust. + Re-fixed a problem where high ASCII characters at the NcFTP prompt could cause it to exit. + Bug fixed where timeouts may not have worked. + To the improved ASCII handling from 3.1.5, added another case where we workaround files sent by a buggy FTP server implementation whose files have CR+CR+LF end-of-lines. + More fixes related to the above, as well as few other fixes from Martin Storsj. + Bug fixed where an upload filename could have been limited to 127 characters. + Firewall exception hosts are no longer case sensitive. + Bug fixed in ncftpput's "-c" option so it works with the "-f" option (Thanks, ITO Tsuyoshi). + Ncftpbatch will now try to temporarily skip a failing host in the current run (Thanks, Eric Engstrom). + Bug fixed where a several minute delay would be incurred if you tried to transfer a file that did not exist. + For the malicious server problem that was addressed in 3.1.5, enhanced the fix for better compatibility with Serv-U and WS_FTP servers. 3.1.5, 2002-10-13 + Problem fixed where a malicious or trojaned FTP server could send back pathnames with directories different from the directory requested. For example, if you did: cd /pub ; get *.zip the malicious server could send back a pathname like ../../../some/other/dir/filename.here rather than pathnames such as filename.zip and trick NcFTP into writing into a different local pathname if your user privileges had permission to write it. For details, see the CERT Vulnerability Note, at http://www.kb.cert.org/vuls/id/210409 + Bug fixed where cd messages from remote server were not being displayed. + It's now possible to capture the output of the progress reports from ncftpget/put by redirecting descriptor(s) to a file. Previous releases required a "tty" to enable progress reports. + Compatibility fixes for AIX, Linux, Mac OS X, IRIX 6.2 and SunOS 4. + Be less pedantic about incorrectly formatted multi-line responses. + Bug fixed where NcFTP could hang at exit. + For ASCII transfers, try harder to handle non-native end-of-line formats. 3.1.4, 2002-07-02 + Bug fixed in Win32 port which could cause NcFTP to mis-parse output from Roxen FTP servers. + We now try to have ncftpbatch leave a core file for debugging if it exits with SIGSEGV, SIGBUS, or SIGILL. + Fixed(?) an elusive bug which had been present for the past few versions which could cause ncftpbatch to infinite loop or sleep too long. + New configure flag, --disable-ccdv. + Compatibility fixes for C++ and Linux. + Fixed a socket leak and a crash on Win32. + A few minor fixes for firewall logins (Thanks, Jochen Schnapka). + By default, proxy connections for PORT are no longer allowed. This is mostly an extra security precaution, to eliminate cases where someone could hijack a data connection by connecting to us after we issue PORT but before the server could connect to us. + ncftpls now accepts a "-R" flag which is equivalent to "-x -lR". + Bugs fixed in configure script for our "--with-*" arguments (Thanks, David Kaelbling). + A few new firewalls (permutations of type 1). (Thanks, Felix Buenemann) 3.1.3, 2002-03-27 + Bug fixed on Solaris where a socket could be left in non-blocking mode. + Ls parsing is now more forgiving of weird /bin/ls implementations (AIX). + Be more lenient on broken server implementations which include extra blank lines in the control connection conversation. + Fix for ncftpget which was exiting with code 3 if URL mode was used and the file already existed. + Fix for resume prompts which in some cases was printing dates in the format like "Sun Feb 20:02:15 CST 2002" instead of "Sun Feb 24 20:02:15 CST 2002". (I.e. the day of the month was missing.) + Compatibility fixes for IRIX 5.x and AIX 4.2.x. + Compatibility fixes for Cygwin (Thanks, Charles Wilson ). + Some extra debugging information is now logged to the trace logs. + When running the Windows bookmark editor in standalone mode, the program may not have launched NcFTP correctly with the selected bookmark (Thanks, Jochen.Erwied AT mbs-software.de). 3.1.2, 2002-01-30: + A fix for the local hostname detection code which could result with only the first character of the domain appended, rather than the entire domain (Thanks, Bernhard Sadlowski ). + Another bug fixed in local hostname detection where looking up the host by IP address was not done correctly. + Fixed a few portability problems on HP-UX 10.20 which were introduced in 3.1.0. + Fixed bug with readdir_r usage on Solaris, which could cause crashes when doing "put -R", among other things. + On Linux, use gethostbyname2_r() to specify that we only want IPv4 addresses returned. + Reversing behavior from 3.1.0 where we did a shutdown() on the half of the socket that wasn't used. We suspect this was causing some firewalls and routers to panic and assume the whole connection was to be closed. + Bug fixed where an unresolvable hostname caused a pointless connection attempt which would fail. + Shell utilities now print an error message when incompatible flags are used in conjunction with "-b" or "-c". + A few fixes for ncftpbatch. + Numerous fixes for SOCKS5. 3.1.1, 2001-12-23: + Fixed bugs with our use of gethostbyname_r/addr_r on Linux. + Fixed bugs with our implementation of stat64() on Windows, which caused problems when querying information about local directories. + Source distributions now include install-sh again. + Bug fixed with Win32 version of ncftpbookmarks, which could look in $HOME/.ncftp rather than $HOME/ncftp. Many Win32 users weren't affected, since the HOME environment variable is not always set. 3.1.0, 2001-12-17: + ACCT is now always sent if the server requests it and you're going through the firewall. + Bug fixed where puts could delay a few seconds unnecessarily after the file had been sent. + Bug fixed where passwords were saved if you chose to autosave bookmarks. NcFTP also makes an effort to avoid saving passwords in the history and trace files if you foolishly use passwords on your command lines. + Bug fixed on Win32 port where putting a file that did not exist could cause a crash. + The "-r" (recursive) flag is back for "bgget" and "bgput". We now spool the directory by creating individual spool files for each file in the directory, which should increase reliability and usability of this feature. + The binary packages should be a bit leaner, since ncftpls wasn't getting stripped. + Library optimizations should result in less unneeded code included with programs that use the libraries. The binaries should be smaller as a result. + Recursive uploading has been substantially reworked. "put -R" should now work better, especially on the Win32 port. Arbitrary pathname sizes have also been removed, so directory trees should only be limited by available memory and stack space. + Huge number of lint fixes. NcFTP now compiles cleanly on several platforms even with extra warning options enabled. + Large number of internal changes to the configure scripts. + Using my cool hack, "ccdv", in Makefiles. Originally this became a necessity since some platforms could have $CFLAGS 4 or 5 lines long! Besides streamlining the build process so that lint warnings can easily be spotted, the builds are pleasing to the eye with ANSI color if your $TERM supports it. + Fixed bug where Win32 $HOME bug fixed for 3.0.4 wasn't fixed for ncftpbookmarks. + Fixes for large file support for the Win32 port. + Bugs fixed in Win32 port of ncftpbatch. + A few bug fixes for getline. + The default ASCII extensions list no longer include ".sh", since Sun apparently distributes the JDK as a shell script with binary data appended. 3.0.4, 2001-10-24: + Workaround new "feature" of glibc which defines printf as a macro if gcc is version 2.97 or later. + Bug fixed from 3.0.3 that caused ^Z (suspend) to quit ncftp when it was brought back to the foreground. + Bug fixed where large file support (LFS) was disabled on most systems. + New "ncftpspooler" utility program (actually a hard link to "ncftpbatch") serves as a "Global batch FTP job processor daemon." + The utility program ncftpget now has a "-c" flag like ncftpput has. + Utility programs can now accept more than one -W/-X/-Y option, if multiple commands are needed. + When changing directories, programs will try to change to the full path first, then fall back to using "change one subdir at a time" mode. + Bug fixed where using the "delete local file after upload" option and the "upload into temp file, then rename" option, the local file would get deleted anyway if the rename failed. + Compatibility fixes for HP-UX. + Internal limits increased to handle longer command lines and more parameters. + Improvement to the reliability of the Win32 version by using the _snprintf and _vsnprintf functions rather than sprintf and vsprintf. + A few more tweaks for MS-DOS pathname compatibility. + A tweak for better compatibility with Microsoft IIS. + A few tweaks for Cygwin support. + Fixes for --sysconfdir configure option courtesy of Christian Wiesgerber. + SOCKS5 is back in, but we don't support it. + Improved Y2K bug detection in remote servers. + Changed naming format for bgget/put spool files. The contents are now documented; see the ncftpspooler man page. + Bug fixed in Win32 port which used $HOME rather than $HOME/ncftp as the UNIX equivalent of the $HOME/.ncftp directory. Since most folks won't have a $HOME environment variable on Win32, you'll probably not notice the change. 3.0.3, 2001-04-11: + Preference options can now be "file" completed on the command line with the set/show/prefs commands. + NcFTP directory changes are now always one subdirectory at a time, for better portability on remote servers with non-UNIX filesystems. + NcFTP tries to maintain the current directory itself, like /bin/ksh and Bash do, which means that symlinks remain part of the current working directory when possible. For example, on ftp.freesoftware.com if your current directory is /pub and you "cd linux", NcFTP will use /pub/linux as the current directory, even though the canonical directory on the server is /.0/linux. This is also useful for things like Linux's Kernel.org mirrors, so if you bgget a kernel.tar.gz file the "virtual" current directory is used rather than a specific-machine's layout. + Mac OS X support added. No Mac or Aqua specific features yet. + NcFTP now has an option to automatically use ASCII mode for transfers if the file's extension corresponds to a textual data file type. + Using homegrown gl_getpass in place of getpass() and getpassphrase for all platforms, not just Windows.. + Incorporating a few getline suggestions from Ken Cox. + Configuration tweaks for Cygwin port. + Removed some arbitrary buffer size limits. + Lint fixes. + Curses configuration fixes for HP-UX. + Shell utilities now have a "-bb" flag which is just like "-b" only the job is submitted only (and no ncftpbatch is spawned). + More problems fixed with interaction with Windows FTP servers. + Better compatibility with non-standard extensions to the FTP which allow for TCP Large Windows (specifically, SITE BUFSIZE). + Win32 port had a bug which leaked file handles. + Miscellaneous Win32 port fixes. + Changed default anonymous password to NcFTP@, since no one really cares any more about using a real e-mail address. + Bug fixed where some types of servers' features might not be queried. + Fixed some inconsistencies with the -a and -A flags among NcFTP and the shell utilities. "-a" is now ASCII mode across the board, and "-A" is the flag to use for append mode (which not many people use anyway). + Bug fixed where the flag for delete after upload (-DD) was being ignored. + You can now do "set yes-i-know-about-NcFTPd yes" from a NcFTP prompt to get it to quit plugging NcFTPd every 7th time you run the program. + Like the system-wide /etc/ncftp.firewall and /etc/ncftp.firewall.fixed files for global preferences, there is now the equivalent for regular preference files (/etc/ncftp.prefs_v3 and /etc/ncftp.prefs_v3.fixed). + The ncftpbatch spool files now support some additional options for sending additional FTP commands. The options are called "pre-command", "post-command", and "per-file-command". This is useful if you need to send some odd SITE command before transfer, for example. + Similarly, ncftpget and ncftpput have new -W/-X/-Y switches so you can send pre/each/post commands. (i.e. "-W SITE MY_WEIRD_IBM_MAINFRAME_OPTION"). + Bug fixed where NcFTP was not taking advantage of re-using a currently open host when exiting and launching ncftpbatch. If you bgget a file from within NcFTP, then exit while the host is still connected, ncftpbatch is supposed to inherit that existing context without having to reopen the host. + When using a URL with ncftpget, you can do "-a" to have it use ASCII. Prior versions forced to you use the little-known URL syntax to specify ASCII mode (btw, example of that is "ftp://ftp.foo.com/pub/README.TXT;a") + Bug fixed where our handling of the TCP_NODELAY option was not getting enabled. + A few tweaks for C++ compatibility. 3.0.2, 2000-10-18: + Fixed bug introduced in 3.0.1 which stripped off the leading slash for the directory parameter of ncftpget and ncftpput. + Problem where NcFTP would not timeout a hung data transfer fixed. + Improved support for large files (> 2 GB). + Increased some internal buffers to handle longer response lines. + Pagers are now enabled on the Win32 port. + Format bug in quote and site commands fixed. + Possibly fix problem with Solaris 2.5 complaining about "pollable event." + Win32 port bug fixed where NcFTP was not stripping off the quotation marks on your HOME or NCFTPDIR environment variable. + Fixed bug where your firewall information could be ignored. + Utilities now accept a "-j" flag for an account (ACCT) if you need to use that in addition to a USER and PASSword. + License has been changed. 3.0.1, 2000-03-27: + ncftpput has been changed to cd to the destination directory on the remote host before storing files. In addition, it does it one subdirectory node at a time, like URL mode does for ncftpget. + Bug fixed where the "ncftpbookmarks --dimensions-terse" hack could be closed and generate a SIGPIPE which caused it to exit uncleanly, and possibly leave the terminal state hosed. + Added a snippet from Felix von Leitner to get the terminal width fairly painlessly, so the aforementioned hack should not be necessary in many cases. + Dtterm and vt220 added to the short list of vt100ish term types. + Win32 version bug fixed where ncftpbookmarks was not honoring the HOME enviornment variable, instead writing data to the install directory under Program Files. + Win32 version now uses Wise installer instead of InstallShield. 3.0.0, 2000-03-19: + New "redial-delay" preference setting, so you can easily set it and forget it rather than doing "-r 30" on each open. + NcFTP's "file exists" prompt now includes options to apply the same action to all files in the batch. This should alleviate concerns by users who didn't want to babysit NcFTP through a large batch of files which exist locally. + Work around Y2K bug in old wu-ftpd servers. + Work around broken Novell 5.00 ftp servers. + Fixed a getline problem where entering a character with the high-bit set would cause NcFTP to exit. + NcFTP now no longer complains when you redirect a file into it as stdin. + NcFTP's getline now recognizes alternate escape sequences for the arrow keys. + NcFTP now allows a user to cancel an mget at the "file exists" prompt. + Continue redialing if the server returns a bad user reply, since some servers do their "too many users logged in check" at that time. + Try harder to display remote connect banner. + Fixed bug in remote mkdir which would fail if the subdirectory was in the root directory. + A few small memory leaks plugged. + Try to remove extraneous slashes from paths when possible, since Win32 doesn't like them. + Win32 version tries harder to sleep the actual number of seconds requested even if means busy waiting, since Sleep() may return immediately if the system has nothing else to do. + Win32 version now checks for a HOME or NCFTPDIR environment variable. + Win32 version of ncftpbookmarks no longer locks up when trying to send a bookmark back to NcFTP. + The firewall password no longer echoes to the screen on the Win32 version. + NcFTP tries harder to get the actual screen width so that getline can use the whole line for input. ncftpbookmarks has to be built and installed where NcFTP can find it for this ugly hack to work. + NcFTP now sends your anonymous password to batch jobs, rather than having NcFTPBatch compute a default value. + Shell utilities now default to PASV-then-PORT mode like NcFTP does, rather than use PORT only. + NcFTPGet and Put are now better about reporting a server error, rather than simply printing the worthless "could not start data transfer" message. + Getline now handles emacs ^W sequence. Beta21, 1999-10-03: + Included HTML versions of the manual pages. This is mostly for the Win32 port. + Bug fixed in ncftpls which was printing lines with \r\n instead of just \n. + NcFTP 3 is now covered by the Artistic License. See the LICENSE.txt file for details. + The "prefs" file is now called "prefs_v3" for better coexistence with NcFTP 2. Beta20, 1999-09-29: + Win32 (Windows 95/98/NT) supported natively! You can download a pre-fab Setup, or build it yourself from the same source base that is used for UNIX. + Readline is out, Getline is in! + Using my "sio" library in conjunction with LibNcFTP. This was done to be consistent with other platforms, which don't use alarm() and signal handline. + Change of licensing. Specifically, GPL was shown the door. NcFTP is, has always been, and will continue to be free software. + Firewall type 6 bug fixed. + "put -f" fixed. + When the server asks for a password, NcFTP will print the text, in case you need that for a one-time password scheme like S/Key. + "get -R" asks for all files by using the equivalent of /bin/ls -lRa on the remote server. + A couple of small fixes for Cygwin, although in light of native support for Windows this seems moot. Beta19, 1999-06-09: + Changed behavior so when auto-resume is off (still the default) NcFTP will automatically continue without prompting if the remote file's size and timestamp exactly match an existing local file. This will make auto-resume=no a more friendly default, since you'll still get prompted when the files differ, but won't bother you like beta 18 did if the files are the same. + Bug fixed where "get -f" on an existing file would still have the existing file prompt come up. + Work around bug with "-s" linker flag on IRIX 6.5. + Small fixes to support Mac OS X Server. + Using inet_ntop function if available to work around IRIX DNS resolution problems. + NcFTP's "rm -r" fixed to better handle empty directories and .dotfiles. + Using SITE RETRBUFSIZE/RBUFSIZ/STORBUFSIZE/SBUFSIZ commands, if available, to try and coordinate large TCP window support between client and server. + Special case the IIS FTP server, so if it prints directory listings in DOS mode, then NcFTP can parse them for file completion. + A few more changes for Cygwin/32. + Workaround definition of "lines" by AIX headers. + Yet another permutation of firewall added. + NcFTP 3 now keeps a simple transfer log like NcFTP 2 did. + Bug fixed in ncftpbatch which was looping if the file to get already existed and was identical to the remote file. + Local commands now work better with wildcards. + Bug fixed where one of the firewall handlers was not prompting you for your firewall password. + Bug fixed where logging in succeeded but NcFTP could not "pwd" caused a crash. + You can now "ncftp -F" to dump a new firewall configuration template to stdout. Beta18, 1999-02-19: + Bug fixed which caused downloads from servers other than wu-ftpd and NcFTPd to skip the first byte in the file. + NcFTP's new prompting-before-transferring feature had a bug which occasionally caused it to detect a non-existant remote file as existant. Beta17, 1999-02-09: + New feature: NcFTP now prompts you by default when you try to get/put a file that already exists. + A few resume bugs fixed in both get and put. + New "jobs" command to list any running "ncftpbatch" tasks. + Shell utilities now honor the ~/.ncftp/firewall file so they can use the firewall settings. + If you're using the global version of the .firewall file, as /etc/ncftp.firewall, you can also set the "passive" setting in there. + Better large-file support for FreeBSD. + Capitulated to using the "install" utility in the Makefile. + Using autoconf-2.13 and new functionality to assist in configuring for UNIX on Win32 environments. + Avoiding problems in Solaris 7 headers which cause curses to not be autodetected. + Various improvements in FTP engine, including new support for proposed FTP standard.. + TCP Large Window support, for those of you with obnoxiously large pipes to the internet. Use the new "so-bufsize" option for "set", and "-B" options with ncftpget/put. + NcFTP now notes the server type, when possible, and works-around problems with certain ones. Beta16, 1998-11-30: + NcFTP now does timestamp checking in addition to size checking to determine when to reget/reput. NcFTP 2 did this, but NcFTP 3 will not be as aggressive to reduce the number of timezone synchronization problems. + Fixed a problem where if the remote server suddenly disconnected NcFTP would report the wrong error. + NcFTP tries to print a message when it doesn't need to get a file. + Fixed more problems related to NcFTP being inconsistent about printing startup messages and responses from the remote server. + User names, passwords, and accounts maximum length extended. + NcFTP now tries reput by default (ncftpput still does not). + Bug fixed in ncftpbatch which caused relative directory paths on the second and successive transfers on the same host to fail. + ncftpbatch now unspools an entry if a directory did not exist at connect time. + Account option added to shell utilties. + More readline band-aids. Beta15(2), 1998-11-10: + --bindir change was not pointing to ncftpbatch correctly. + "get -R -a" is now detected and treated as "get -R". + getpassphrase() function is used in place of getpass(), where available. Beta15, 1998-11-05: + NcFTP can now cope with cd'ing to unreadable directories. + The curses support (i.e. ncftpbookmarks) is now much more portable (for example, FreeBSD 3, SunOS 4, BSD/OS). Still, your best bet is to install ncurses if you can. At least one system's curses (HP-UX) compiles fine but doesn't work worth jack, so use ncurses there. + Firewall not being used correctly when you ran NcFTP with a host from the shell command-line. + Bug fixed where 32 spaces were being printed before running the pager. + configure now recognizes --bindir. + NcFTP now tries to print "server said" for a server related error, so NcFTP quits getting blamed for server problems. + More readline band-aids. + Rare problem fixed where a null pointer was being passed to a socket library function was causing core dumps and, in some cases, kernel panics. + Problem fixed with the new auto-TAR feature if the directory to download was a first level directory. + When auto-TAR mode is on, you can tell in the progress meter. + When auto-TAR is used for the first time, a one-time message is printed. + Bug fixed when using -R with a directory URL. + Doing a better job about displaying login and welcome messages. + Memory leak found and fixed. + Failed logins as non-anonymous no longer continue redialing and refailing. + Problem fixed where firewall user's firewall password could be logged in the trace log. + URLs displayed include the port number, if non-standard. + ncftpbatch resets it's exponential waiting period. + Problem fixed where uploading invalid files wasn't considered an error. + Local filesystem commands (lmkdir, etc) weren't handling files with spaces in them correctly. Beta14, 1998-06-24: + Firewall Type 5 now works. + "cd" command now properly recognizes a wildcard. + NcFTP was failing to report an error when a wildcard did not match anything. + Progress reports on downloads had a bug where it wouldn't update as often as it should have been. + A "put" on a short file is now more likely to errout with a timeout error when the remote host is not responsive. + Bookmarks and commands now readline-complete without regards to case sensitivity. Beta13, 1998-06-21: + Big change again -- NcFTP now automatically tries to take advantage of servers that do on-the-fly TAR. NcFTP can dynamically fallback to the regular, non-TAR method when needed, so this should be somewhat transparent. You can tell when NcFTP uses TAR when the progress meter shows only a directory being downloaded, instead of individual items within the directory tree. Of course the advantage to using TAR mode is that the exact timestamps, permissions, etc can be preserved, as well as reducing the number of total connections to the server. + Bug fixed for regular get -R mode, which was causing failures on some servers. + There is a now a "local directory" field for bookmarks. This is only settable using the Bookmark Editor. + Bug fixed where NcFTP wouldn't always fallback to PORT from PASV. + Bug fixed where NcFTP was not handling relative pathnames with more than one node correctly (i.e. "foo" was okay, but "foo/bar" was not.) + The "-@" flag has been enhanced a little so it accepts a few more types of date/time specifications. + Bug fixed where NcFTP could be fooled into thinking a bookmark was not saved. + Trying harder to print the host list if the Bookmark Editor is not installed. + Main usage message was not always printed. + Small tweaks to the progress meters. + Shell utilities now identify themselves using CLNT command. + Completion bug fixed where a "/" was being appended for bookmarks and commands. Beta12, 1998-06-04: + Big change -- curses is back, in limited form. The bookmark editor runs as the fullscreen applet that NcFTP 2.4 has. It is a separate program now (ncftpbookmarks) which is run by NcFTP (or you can run it in stand-alone mode). Note that if you have problems getting the curses support to work, you do NOT have to build ncftpbookmarks. To do that, remove the config.cache file and "./configure --disable-curses". + Bookmark completion and command name completion added. + Recursive remote deletes are now possible (i.e. rm -r). + Shell command ("!") back. + Bug fixed where NcFTP would ignore ls output from OS/2 servers. + Bug fixed where a trailing slash was confusing put -R. + Bug fixed where a trailing slash was confusing file completion. + ncftpget and ncftpput now have a "-b" flag which lets you submit a batch job to ncftpbatch. Now you don't need to run ncftp, open the site, and do bgget commands. + NcFTP now accepts URLs with the open command. + A bit more lenient when using directory URLs with NcFTP without the proper trailing slash. + Various small configure script bugs fixed. Beta11, 1998-05-10: + Another problem with Auto-resume-downloads fixed. + The xterm title setting feature is now configurable from "prefs" and is off by default. + Problem fixed where files newer than the current date could be listed as the year before. + Small firewall support problem fixed. Beta10, 1998-05-03: + Several problems with Auto-resume-downloads fixed. + Several problems with Redial fixed. It is on by default -- let me know the specifics if it fails. + Problem fixed where a multiple get would try re-downloading files over and over again. + Problem fixed where if a multiple get failed the files that were downloaded successfully were deleted. + Bug fixed where "get -R" would create files as directories. + Master source drive lost -- some things had to be restored from backup and rebuilt entirely (such as the configure script stuff). So, many things which were fixed may suddenly be un-fixed again. + Readline completion works with local directories and remote symlinks. + NcFTP recovers better from aborted transfers. + New signal handling, which will hopefully have the same behavior across platforms. + A few minor firewall problems fixed. + You can now have system-wide firewall settings stored in /etc/ncftp.firewall and /etc/ncftp.firewall.fixed, if you create them from a ~/.ncftp/firewall file. + You can now spool transfers to FTP servers on non-standard ports. + NcFTP now changes your xterm window title. + Bug fixed with spool files using the firewall's IP number. + ncftpbatch now works on case-insensitive filesystems. + configure's readline check now runs the test program to be sure it was linked correctly. Beta9, 1998-01-25: + Bug fixed that was introduced in b8 that caused a crash after a transfer. + Readline completion with should work better. + Bookmark lookups changed to full bookmark name only. + Configure bug where scanf("%qd") wasn't checked right. Beta8, 1998-01-18: + Bug fix that broke the firewall support that used to work in Beta 6. + Bug fixes with RESTarting. + Smarter about using 64-bit or 32-bit mode (long longs or longs). + Yet another firewall added. + Fixes for HP-UX. + Readline 2.1 dependency worked around, so that Readline 2.0 is useable. + Unsupported -J flag added to use an ACCT name. + Uses NcFTPd's new "CLNT" command to specify FTP client type. + Hack so "open -u host" works like it did in earlier versions of NcFTP. Beta7, 1997-12-28: + Should now be able to retrieve very large files (> 2 gig), depending on the libc and OS. + Namespace collision with GNU libc fixed (errno field). + get -R xxx now creates a ./xxx directory instead of dropping xxx/* in the local directory. + New firewall type added. + Many file completion tweaks. + Another bug fixed where ASCII mode was getting turned on. + If you use a firewall, the firewall is now responsible for resolving host names. + Bug fixed with bgget/bgput with absolute pathnames. + Plug frequency reduced. + Bug fixed where command-line switches were not overriding bookmark settings. + Bug fixed where "set" commands were not taking effect until the current connection was closed. + StatBar progress meter revised. + ncftp_batch back-off revised. + ncftpget transfer type bug fixed. Beta6, 1997-11-21: + Bookmark command bug fixed. + Bug with bookmarks fixed that could save the transfer type as ASCII. + Symlink hidden command added (only works with NcFTPd). + Including man page for ncftpls + Mkdir dirties cache + site and quote fixed Beta5, 1997-11-19: + Fixes for AIX 4.1 + Bug in put -R fixed. Beta4, 1997-11-18: + Bug fixed that caused pdir/pls to act like ls. + Fixes for SunOS. + ncftpls added. + The philbar is back; you can now choose it as a progress meter if you don't like the statbar. + Checking for ncftpbatch before trying to run it. Beta3, 1997-11-17: + Try not to use Readline when it is older than 2.0, or when its headers aren't installed correctly. + Fix for get -R, which could cause a crash during the post-downloading cleanup. + A little extra tracing for the firewall code. Beta2, 1997-11-15: + Fix for unrecognized ls flags that would cause a crash. + NcFTP 3.0 prefers GNU Readline version 2.1, but it should now also work with version 2.0. + A few portability/lint fixes. ncftp-3.2.6/doc/FIREWALLS_AND_PROXIES.txt0000644000000000000000000000171506774544547016236 0ustar rootwheelThis version of NcFTP supports various FTP proxy servers. Note that NcFTP does _not_ work with HTTP proxies that accept FTP URLs. Why? Because they accept HTTP requests, silly, not FTP, which this program does. Examples of HTTP proxies are Netscape Proxy Server, Squid, and Apache's proxy server. To use the FTP proxy support, first build and install NcFTP. Then run "ncftp". The first time it is run, it generates a $HOME/.ncftp/firewall file. Quit "ncftp" and edit this file with The One True (tm) text editor, vi, or some inferior text editing tool. :-) Another way to print a copy of the firewall configuration template is to run "ncftp -F > firewall". You may have to experiment with various combinations of options in the firewall file. Ask your network administrator to assist you, if needed. You may also find you must use passive, or perhaps must not use passive. Use the "set passive off" or "set passive on" command from within NcFTP to change this. ncftp-3.2.6/doc/html/0000755000000000000000000000000013021063722013160 5ustar rootwheelncftp-3.2.6/doc/html/bug.html0000644000000000000000000000721207723206052014634 0ustar rootwheel NcFTP Client

How to Report Bugs in NcFTP Client

Because each FTP server program has its own quirks and unique interpretation of the FTP protocol, most bugs in NcFTP Client are caused by an unexpected interaction with a particular type of server software. What helps us fix our own bugs or work-around server bugs is the actual FTP protocol dialogue that was exchanged, and we call this a FTP protocol trace.

NcFTP Client (the interactive ncftp program) automatically stores the trace in the file $HOME/.ncftp/trace. Simply run ncftp, recreate the problem, quit the program, and inspect the $HOME/.ncftp/trace file.

The other programs (ncftpget, ncftpput, etc.) have a special command-line option (-d) which saves the trace to a log file. For example, if your original command was:

    ncftpget ftp.freebsd.org . /pub/FreeBSD/README.TXT
Then here is the same thing, with the trace information saved to /tmp/ncftpget.log:

    ncftpget -d /tmp/ncftpget.log ftp.freebsd.org . /pub/FreeBSD/README.TXT

A sample $HOME/.ncftp/trace file follows. When sending us your bug report, please include a trace with your e-mail. This will help us diagnose the problem, and recreate the problem as closely as possible.

    SESSION STARTED at:  Wed Aug 27 14:18:41 2003
       Program Version:  NcFTP 3.1.6/102 Aug 25 2003, 08:04 PM
       Library Version:  LibNcFTP 3.1.6 (August 24, 2003)
            Process ID:  1174
              Platform:  linux-x86
              Hostname:  pc.example.com  (rc=3)
              Terminal:  vt100
    14:18:41  Fw: firewall.example.com  Type: 0  User: joseph  Pass: ********  Port: 21
    14:18:41  FwExceptions: .example.com,localhost,localdomain
    14:18:51  > o ftp.example.com
    
    14:18:51  Resolving ftp.example.com...
    14:18:51  Connecting to 172.16.75.25...
    14:18:51  LibNcFTP 3.1.6 (August 24, 2003) compiled for linux-x86
    14:18:51  Uname: Linux|pc|2.4.20|#2 SMP Mon Feb 17 15:36:45 CST 2003|i686
    14:18:51  Glibc: 2.2.4 (stable)
    14:18:51  Remote server is running wu-ftpd.
    14:18:51  Logging in...
    14:18:51  220: ftp.example.com FTP server (Version wu-2.6.1-18) ready.
    14:18:51  Connected to 172.16.75.25.
    14:18:51  Cmd: USER anonymous
    14:18:51  331: Guest login ok, send your complete e-mail address as password.
    14:18:51  Cmd: PASS joseph@example.com
    14:18:51  Logging in...
    14:18:51  230: Guest login ok, access restrictions apply.
    14:18:51  Cmd: PWD
    14:18:51  257: "/" is current directory.
    14:18:51  Logged in to 172.16.75.25 as anonymous.
    14:19:31  > get secretfile.txt
    
    14:19:31  Cmd: SIZE secretfile.txt
    14:19:31  550: secretfile.txt: No such file or directory.
    14:19:31  Cmd: PASV
    14:19:31  227: Entering Passive Mode (172,16,75,25,49,39)
    14:19:31  Cmd: RETR secretfile.txt
    14:19:31  550: secretfile.txt: No such file or directory.
    14:19:44  > quit
    
    14:19:46  Cmd: QUIT
    14:19:46  221: You have transferred 0 bytes in 0 files.
    14:19:46       Total traffic for this session was 1011 bytes in 0 transfers.
    14:19:46       Thank you for using the FTP service on ftp.example.com.
    SESSION ENDED at:    Wed Aug 27 14:19:46 2003
ncftp-3.2.6/doc/html/changelog.html0000644000000000000000000015745711515211517016023 0ustar rootwheel NcFTP Client: Change Log

3.2.5, 2011-01-17

  • Fixed a problem on Mac OS X Snow Leopard for universal binary support.

  • ncftpls now prefers that you omit the leading dash when you use the -x option. For example, if you wanted to try "ls -lrt", then try doing "ncftpls -x lrt" rather than "ncftpls -x -lrt".

  • If a server's MLSx output returns both the "UNIX.mode" and the "perm" parameters, UNIX.mode will take precedence (Thanks, Jay Kulpinski).

  • confirm-close is now off by default.

3.2.4, 2010-04-07

  • Ncftpget and ncftpput can now read $HOME/.ncftp/bookmarks and take a bookmark name in place of a hostname. If the hostname specified is not fully qualified (i.e. does not contain a period), then bookmarks will be queried; if no bookmarks match, then a local hostname is assumed. Bookmarks are also queried for the config file option, -f, when the file specified by -f does not exist.

  • Compatibility fixes for FreeBSD 8.

  • Support for local validation of DNSSEC when combined with libraries available from the DNSSEC Tools project (Thanks, Robert Story).

  • Microsoft disabled recursive directory listings altogether when fixing KB975254 (Thanks, Andrew Coggeshall). When entire directories are downloaded, instead of using "LIST -R" for one efficient listing of all files, the directories are manually traversed with one directory listing for each subdirectory. This will improve reliability of recursive downloads, except for the case when their are circular symbolic links (which is why "LIST -R" had been favored, which the server can easily handle).

  • Compatibility fixes for Mac OS X for building from source code (Thanks, Mathieu Rene)

3.2.3, 2009-07-28

  • Large File Support has been updated internally to use newer APIs, rather than the transitional API.

  • You can now specify an IP address for binding the local end of sockets. Useful if you need connections to originate from a specific IP on the system.

  • Bug fixed where binding an ephemeral port number in a specified range (rare) may not have used all available retries for binding.

  • Local writes now "retry" when the write returns less than the full number of bytes specified, and will call write() again to write out the remaining bytes. This bug is very rare since local write almost always write out the full number of bytes. This bug may have been limited to a particular type of filesystem.

  • Using a higher resolution timer on Windows, so that the timer no longer wraps over after a month.

  • The minimum version of Windows that the source code will now compile on is Windows 2000, although with a little tweaking you could compile for Windows NT 4 again.

  • Compatibility fix for Mac OS X when compiling from source to build universal binaries (Thanks, Toshi NAGATA)

  • Compatibility fix for FreeBSD, where a connection attempt may have failed with "Operation now in progress."

  • Fixed a bug where the global firewall pref files were not read if the user's home directory was the root directory.

  • Using MFMT command to set remote timestamps, if available, in preference to SITE UTIME or MDTM.

  • New configure flag, --enable-ssp, will turn on stack smashing protection (if available by compiler) by adding to CFLAGS.

  • Host, user, and pass fields have been increased in size.

  • Bug fixed where the firewall preference files were ignored for the root user.

  • Ncftpls now has a "-Z" option that will disable doing the actual directory listing. This is useful for use with the "-Y" option to send a raw FTP command without doing a listing.

3.2.2, 2008-08-18

  • Fixed an assertion failure in NcFTP's "help" command that appeared in a 2008-08-09 release.

  • PASV mode will now be retried, in case of a transient failure. (Thanks, Steven Frank).

  • The directory listing parser now can recognize dates in the format of YYYY-mm-dd HH:MM[:SS].

  • Fixed feature detection for WS_FTP servers.

  • Workaround bug in REST on WS_FTP 6.0 (Thanks, Dan Nelson).

  • Fixed a problem where doing a get on a remote file that did not exist, but a file by the same name existed locally, would err out but truncate the local file anyway.

  • Fix for ncftpget on Windows to write in binary to stdout when needed (Thanks, Michael Langguth).

  • HOME, END, and DEL keys may work on more terminal types (Thanks, Anton Khramov).

  • You can now type just ".." or the absolute path of a directory in the ncftp command shell to "cd" to the directory (Thanks, Anton Khramov).

  • Added command aliases "mv" and "ll" which alias to "rename" and "dir" respectively (Thanks, Anton Khramov).

  • ncftpbatch now has an -L option to specify the name of a log file to write progress meter output to. Combined with "tail -f", this can be used to monitor a batch file transfer in progress.

  • On Mac OS X, the configure script will now try to build universal binaries by default. If you don't want that, pass --disable-universal to configure.

  • The default connect timeout has been reduced from 30 to 10 seconds to reflect the increase in the typical user's network speed.

3.2.1, 2007-07-29

  • Now a little more tolerant of FTP servers who send their internal network IP addresses in their PASV response. When this is detected, it will be ignored and the data connection will connect to the same IP that is used for the control connection.

  • Resuming of uploads can now work for servers that do not support REST + STOR. The APPE command will be used instead.

  • Fixed problem with Resume All [R!] in ncftp, which was just appending to subsequent files rather than resuming them. (Thanks, Terry Brown)

  • ncftpput for version 3.2.0 did not work correctly when both -f and -c/-C were used. This has now been fixed. In addition, the host command line argument is optional when the config file specifies the host.

  • Various small fixes.

3.2.0, 2006-08-05

  • Fixed problem where ncftpbatch may requeue downloads when the local file was the same as the remote file.

  • ncftpls has been enhanced so that using the new -m option will have it try a machine-readable list command. These commands need to be implemented on the remote server for it to work.

  • ncftpls can now try to attempt to filter the files with a wildcard with the new -i option. For this option to work, this functionality must be properly implemented in the FTP server software.

  • ncftpls can also now behave similar to /usr/bin/find, with the new -g option. When invoked with -gg, it appends a slash to directory pathnames so you can distinguish files from directories.

  • Fixed a problem with ASCII translation where a CR+LF may not have been converted to the local text EOLN format if the CR+LF was split over an internal block boundary. The ASCII translation code has been rewritten so it is also more tolerant of malformatted text, such as CR+CR+LF end-of-lines.

  • You can now edit remote files, thanks to <jess AT thrysoee.dk>. The new "edit" command downloads to a temporary file, runs your $EDITOR, and uploads any changes back to the remote server. Naturally this requires both read and write permission on the remote server.

  • Handling "~" in paths a little better. Try to expand it to the remote home directory for remote commands, and the local home directory for local commands.

  • Progress meters now output to stderr. This eliminates a problem when using ncftpput with "-c" mode, which would result in a corrupted file.

  • More careful about trimming the $HOME/.ncftp/log file so it does not get too small.

  • You can now resume uploads when uploading into a temporary file (e.g. ncftpput's -S and -T options for using a temporary suffix or prefix).

  • The utility programs' "-X" option has been enhanced so it will automatically translate some /usr/bin/ftp commands into the raw RFC 959 FTP protcool commands that are required for this feature.

  • Fixes for Cygwin.

  • Some fixes for largefile support on Windows.

  • You can now resume transfers in ASCII mode, rather than just binary.

  • Fixed a problem with recursive uploads for Windows.

  • Opening a site with a bookmark no longer assumes that the server's software has the same configuration (i.e. if it did not support SIZE before, it now checks for SIZE each time rather than assuming each time the site is opened that the server does not support SIZE).

  • You can now use an empty password if your user account does not have a password.

  • Fixed a problem in the "ls" implementation for international month names.

  • Fixed a bug where Type of Service socket options were being set with IPPROTO_TCP instead of IPPROTO_IP.

3.1.9, 2005-04-06

  • Renamed internal library function getline() to gl_getline() to avoid namespace collision with glibc.

  • Renamed internal library function Duration() to FTPDuration() to avoid namespace collision on Mac OS X.

  • Recognize additional error response codes to SITE UTIME, to prevent using it if the server doesn't support it.

  • If the server does not support setting timestamps in MDTM, quit trying it if it fails the first time.

  • Do not allow control characters such as NUL, CR, LF in FTP URLs, to avoid command injection as described by Albert Puigsech Galicia <ripe AT 7a69ezine.org>.

  • Fixed a problem where a timed-out transfer may have been detected but still locked up the process (Thanks, IWAI, Masaharu).

  • Ncftpget and ncftpput now accept a "-C" parameter which is similar to the "-c" option (ftp "cat" mode), where stdin (stdout) is not used and the filename is specified as a parameter instead. This is useful if you don't want to specify a password on the command line.

  • Ncftpput now allows the "-m" option in conjunction with the "-c" or "-C" options.

  • Small compatibility fixes for Mac OS X, Solaris 10, Linux.

3.1.8.1, 2004-07-27

  • A fix for some DNS resolution problems on Linux.

3.1.8, 2004-07-07

  • Ncftpget, ncftpput, and ncftpls now try to erase the arguments to the -u/-p/-j (user, password, account) options so they do not show in a "ps" command (Thanks, Konstantin Gavrilenko).

  • Recognize broken IBM mainframe FTP servers and work around them.

  • Working around a problem with ProFTPD 1.2.9 and later which would cause recursive downloads to fail.

  • Fixed a bug where ncftpput in recursive mode could lock up if you used a trailing slash on the directory to upload.

  • For the malicious server problem that was addressed in 3.1.5, enhanced the fix for better compatibility with mainframe FTP servers.

  • Ncftpget, ncftpput, and ncftpls, and ncftp's open command now accept an additional advanced option (-o) which lets you do things like disable NcFTP's use of SITE UTIME, FEAT, HELP SITE, etc.

  • Several HP-UX 10 compatibility bugs fixed (Thanks, Laurent FAILLIE).

  • A couple of looping problems with ncftpbatch fixed (Thanks, George Goffe).

  • Bug fixed with the upload socket buffer not being set (Thanks, ybobble).

  • The utility programs now accept "-" for the config file name used with "-f" to denote standard input (Thanks, Jeremy Monin).

  • Bug fixed with ncftpput when using both -c and -A (Thanks, Ken Woodmansee).

  • Support for boldface text in Windows version (Thanks, Adam Gates).

3.1.7, 2004-01-07

  • Fixed a memory leak introduced in 3.1.6.

  • Fixed problem where it was assumed that daylight saving's time occurred at the same time each year for all timezones.

  • Bug fixed with running a shell escape.

  • Ncftpget now uses passive-with-fall-back-to-port mode like ncftpput and ncftpls.

  • Problem fixed with "ls -a" where occasionally a row with ".." and another file would be omitted.

  • Ncftpbatch now uses the UTC timezone for spool files.

  • The configure script can now detect when the config.cache file has been improperly recycled from a machine with a different OS.

  • The Windows version now uses the USERPROFILE environment variable, if it was set, as the location of the user's home directory.

  • Recognize broken DG/UX servers and work around them.

3.1.6, 2003-08-25

  • Fixed an important bug that was causing socket leaks on Windows.

  • Added support for GCC 3.4 precompiled headers.

  • Aborting transfers is now more robust.

  • Re-fixed a problem where high ASCII characters at the NcFTP prompt could cause it to exit.

  • Bug fixed where timeouts may not have worked.

  • To the improved ASCII handling from 3.1.5, added another case where we workaround files sent by a buggy FTP server implementation whose files have CR+CR+LF end-of-lines.

  • More fixes related to the above, as well as few other fixes from Martin Storsj.

  • Bug fixed where an upload filename could have been limited to 127 characters.

  • Firewall exception hosts are no longer case sensitive.

  • Bug fixed in ncftpput's "-c" option so it works with the "-f" option (Thanks, ITO Tsuyoshi).

  • Ncftpbatch will now try to temporarily skip a failing host in the current run (Thanks, Eric Engstrom).

  • Bug fixed where a several minute delay would be incurred if you tried to transfer a file that did not exist.

  • For the malicious server problem that was addressed in 3.1.5, enhanced the fix for better compatibility with Serv-U and WS_FTP servers.

3.1.5, 2002-10-13

  • Problem fixed where a malicious or trojaned FTP server could send back pathnames with directories different from the directory requested. For example, if you did: cd /pub ; get *.zip the malicious server could send back a pathname like ../../../some/other/dir/filename.here rather than pathnames such as filename.zip and trick NcFTP into writing into a different local pathname if your user privileges had permission to write it.

  • Bug fixed where cd messages from remote server were not being displayed.

  • It's now possible to capture the output of the progress reports from ncftpget/put by redirecting descriptor(s) to a file. Previous releases required a "tty" to enable progress reports.

  • Compatibility fixes for AIX, Linux, Mac OS X, IRIX 6.2 and SunOS 4.

  • Be less pedantic about incorrectly formatted multi-line responses.

  • Bug fixed where NcFTP could hang at exit.

  • For ASCII transfers, try harder to handle non-native end-of-line formats.

3.1.4, 2002-07-02

  • Bug fixed in Win32 port which could cause NcFTP to mis-parse output from Roxen FTP servers.

  • We now try to have ncftpbatch leave a core file for debugging if it exits with SIGSEGV, SIGBUS, or SIGILL.

  • Fixed(?) an elusive bug which had been present for the past few versions which could cause ncftpbatch to infinite loop or sleep too long.

  • New configure flag, --disable-ccdv.

  • Compatibility fixes for C++ and Linux.

  • Fixed a socket leak and a crash on Win32.

  • A few minor fixes for firewall logins (Thanks, Jochen Schnapka).

  • By default, proxy connections for PORT are no longer allowed. This is mostly an extra security precaution, to eliminate cases where someone could hijack a data connection by connecting to us after we issue PORT but before the server could connect to us.

  • ncftpls now accepts a "-R" flag which is equivalent to "-x -lR".

  • Bugs fixed in configure script for our "--with-*" arguments (Thanks, David Kaelbling).

  • A few new firewalls (permutations of type 1). (Thanks, Felix Buenemann)

3.1.3, 2002-03-27

  • Bug fixed on Solaris where a socket could be left in non-blocking mode.

  • Ls parsing is now more forgiving of weird /bin/ls implementations (AIX).

  • Be more lenient on broken server implementations which include extra blank lines in the control connection conversation.

  • Fix for ncftpget which was exiting with code 3 if URL mode was used and the file already existed.

  • Fix for resume prompts which in some cases was printing dates in the format like "Sun Feb 20:02:15 CST 2002" instead of "Sun Feb 24 20:02:15 CST 2002". (I.e. the day of the month was missing.)

  • Compatibility fixes for IRIX 5.x and AIX 4.2.x.

  • Compatibility fixes for Cygwin (Thanks, Charles Wilson <cwilson AT ece.gatech.edu>).

  • Some extra debugging information is now logged to the trace logs.

  • When running the Windows bookmark editor in standalone mode, the program may not have launched NcFTP correctly with the selected bookmark (Thanks, Jochen.Erwied AT mbs-software.de).

3.1.2, 2002-01-30:

  • A fix for the local hostname detection code which could result with only the first character of the domain appended, rather than the entire domain (Thanks, Bernhard Sadlowski <sadlowsk AT mathematik.uni-bielefeld.de>).

  • Another bug fixed in local hostname detection where looking up the host by IP address was not done correctly.

  • Fixed a few portability problems on HP-UX 10.20 which were introduced in 3.1.0.

  • Fixed bug with readdir_r usage on Solaris, which could cause crashes when doing "put -R", among other things.

  • On Linux, use gethostbyname2_r() to specify that we only want IPv4 addresses returned.

  • Reversing behavior from 3.1.0 where we did a shutdown() on the half of the socket that wasn't used. We suspect this was causing some firewalls and routers to panic and assume the whole connection was to be closed.

  • Bug fixed where an unresolvable hostname caused a pointless connection attempt which would fail.

  • Shell utilities now print an error message when incompatible flags are used in conjunction with "-b" or "-c".

  • A few fixes for ncftpbatch.

  • Numerous fixes for SOCKS5.

3.1.1, 2001-12-23:

  • Fixed bugs with our use of gethostbyname_r/addr_r on Linux.

  • Fixed bugs with our implementation of stat64() on Windows, which caused problems when querying information about local directories.

  • Source distributions now include install-sh again.

  • Bug fixed with Win32 version of ncftpbookmarks, which could look in $HOME/.ncftp rather than $HOME/ncftp. Many Win32 users weren't affected, since the HOME environment variable is not always set.

3.1.0, 2001-12-17:

  • ACCT is now always sent if the server requests it and you're going through the firewall.

  • Bug fixed where puts could delay a few seconds unnecessarily after the file had been sent.

  • Bug fixed where passwords were saved if you chose to autosave bookmarks. NcFTP also makes an effort to avoid saving passwords in the history and trace files if you foolishly use passwords on your command lines.

  • Bug fixed on Win32 port where putting a file that did not exist could cause a crash.

  • The "-r" (recursive) flag is back for "bgget" and "bgput". We now spool the directory by creating individual spool files for each file in the directory, which should increase reliability and usability of this feature.

  • The binary packages should be a bit leaner, since ncftpls wasn't getting stripped.

  • Library optimizations should result in less unneeded code included with programs that use the libraries. The binaries should be smaller as a result.

  • Recursive uploading has been substantially reworked. "put -R" should now work better, especially on the Win32 port. Arbitrary pathname sizes have also been removed, so directory trees should only be limited by available memory and stack space.

  • Huge number of lint fixes. NcFTP now compiles cleanly on several platforms even with extra warning options enabled.

  • Large number of internal changes to the configure scripts.

  • Using my cool hack, "ccdv", in Makefiles. Originally this became a necessity since some platforms could have $CFLAGS 4 or 5 lines long! Besides streamlining the build process so that lint warnings can easily be spotted, the builds are pleasing to the eye with ANSI color if your $TERM supports it.

  • Fixed bug where Win32 $HOME bug fixed for 3.0.4 wasn't fixed for ncftpbookmarks.

  • Fixes for large file support for the Win32 port.

  • Bugs fixed in Win32 port of ncftpbatch.

  • A few bug fixes for getline.

  • The default ASCII extensions list no longer include ".sh", since Sun apparently distributes the JDK as a shell script with binary data appended.

3.0.4, 2001-10-24:

  • Workaround new "feature" of glibc which defines printf as a macro if gcc is version 2.97 or later.

  • Bug fixed from 3.0.3 that caused ^Z (suspend) to quit ncftp when it was brought back to the foreground.

  • Bug fixed where large file support (LFS) was disabled on most systems.

  • New "ncftpspooler" utility program (actually a hard link to "ncftpbatch") serves as a "Global batch FTP job processor daemon."

  • The utility program ncftpget now has a "-c" flag like ncftpput has.

  • Utility programs can now accept more than one -W/-X/-Y option, if multiple commands are needed.

  • When changing directories, programs will try to change to the full path first, then fall back to using "change one subdir at a time" mode.

  • Bug fixed where using the "delete local file after upload" option and the "upload into temp file, then rename" option, the local file would get deleted anyway if the rename failed.

  • Compatibility fixes for HP-UX.

  • Internal limits increased to handle longer command lines and more parameters.

  • Improvement to the reliability of the Win32 version by using the _snprintf and _vsnprintf functions rather than sprintf and vsprintf.

  • A few more tweaks for MS-DOS pathname compatibility.

  • A tweak for better compatibility with Microsoft IIS.

  • A few tweaks for Cygwin support.

  • Fixes for --sysconfdir configure option courtesy of Christian Wiesgerber.

  • SOCKS5 is back in, but we don't support it.

  • Improved Y2K bug detection in remote servers.

  • Changed naming format for bgget/put spool files. The contents are now documented; see the ncftpspooler man page.

  • Bug fixed in Win32 port which used $HOME rather than $HOME/ncftp as the UNIX equivalent of the $HOME/.ncftp directory. Since most folks won't have a $HOME environment variable on Win32, you'll probably not notice the change.

3.0.3, 2001-04-11:

  • Preference options can now be "file" completed on the command line with the set/show/prefs commands.

  • NcFTP directory changes are now always one subdirectory at a time, for better portability on remote servers with non-UNIX filesystems.

  • NcFTP tries to maintain the current directory itself, like /bin/ksh and Bash do, which means that symlinks remain part of the current working directory when possible. For example, on ftp.freesoftware.com if your current directory is /pub and you "cd linux", NcFTP will use /pub/linux as the current directory, even though the canonical directory on the server is /.0/linux. This is also useful for things like Linux's Kernel.org mirrors, so if you bgget a kernel.tar.gz file the "virtual" current directory is used rather than a specific-machine's layout.

  • Mac OS X support added. No Mac or Aqua specific features yet.

  • NcFTP now has an option to automatically use ASCII mode for transfers if the file's extension corresponds to a textual data file type.

  • Using homegrown gl_getpass in place of getpass() and getpassphrase for all platforms, not just Windows..

  • Incorporating a few getline suggestions from Ken Cox.

  • Configuration tweaks for Cygwin port.

  • Removed some arbitrary buffer size limits.

  • Lint fixes.

  • Curses configuration fixes for HP-UX.

  • Shell utilities now have a "-bb" flag which is just like "-b" only the job is submitted only (and no ncftpbatch is spawned).

  • More problems fixed with interaction with Windows FTP servers.

  • Better compatibility with non-standard extensions to the FTP which allow for TCP Large Windows (specifically, SITE BUFSIZE).

  • Win32 port had a bug which leaked file handles.

  • Miscellaneous Win32 port fixes.

  • Changed default anonymous password to NcFTP@, since no one really cares any more about using a real e-mail address.

  • Bug fixed where some types of servers' features might not be queried.

  • Fixed some inconsistencies with the -a and -A flags among NcFTP and the shell utilities. "-a" is now ASCII mode across the board, and "-A" is the flag to use for append mode (which not many people use anyway).

  • Bug fixed where the flag for delete after upload (-DD) was being ignored.

  • You can now do "set yes-i-know-about-NcFTPd yes" from a NcFTP prompt to get it to quit plugging NcFTPd every 7th time you run the program.

  • Like the system-wide /etc/ncftp.firewall and /etc/ncftp.firewall.fixed files for global preferences, there is now the equivalent for regular preference files (/etc/ncftp.prefs_v3 and /etc/ncftp.prefs_v3.fixed).

  • The ncftpbatch spool files now support some additional options for sending additional FTP commands. The options are called "pre-command", "post-command", and "per-file-command". This is useful if you need to send some odd SITE command before transfer, for example.

  • Similarly, ncftpget and ncftpput have new -W/-X/-Y switches so you can send pre/each/post commands. (i.e. "-W SITE MY_WEIRD_IBM_MAINFRAME_OPTION").

  • Bug fixed where NcFTP was not taking advantage of re-using a currently open host when exiting and launching ncftpbatch. If you bgget a file from within NcFTP, then exit while the host is still connected, ncftpbatch is supposed to inherit that existing context without having to reopen the host.

  • When using a URL with ncftpget, you can do "-a" to have it use ASCII. Prior versions forced to you use the little-known URL syntax to specify ASCII mode (btw, example of that is "ftp://ftp.foo.com/pub/README.TXT;a")

  • Bug fixed where our handling of the TCP_NODELAY option was not getting enabled.

  • A few tweaks for C++ compatibility.

3.0.2, 2000-10-18:

  • Fixed bug introduced in 3.0.1 which stripped off the leading slash for the directory parameter of ncftpget and ncftpput.

  • Problem where NcFTP would not timeout a hung data transfer fixed.

  • Improved support for large files (> 2 GB).

  • Increased some internal buffers to handle longer response lines.

  • Pagers are now enabled on the Win32 port.

  • Format bug in quote and site commands fixed.

  • Possibly fix problem with Solaris 2.5 complaining about "pollable event."

  • Win32 port bug fixed where NcFTP was not stripping off the quotation marks on your HOME or NCFTPDIR environment variable.

  • Fixed bug where your firewall information could be ignored.

  • Utilities now accept a "-j" flag for an account (ACCT) if you need to use that in addition to a USER and PASSword.

  • License has been changed.

3.0.1, 2000-03-27:

  • ncftpput has been changed to cd to the destination directory on the remote host before storing files. In addition, it does it one subdirectory node at a time, like URL mode does for ncftpget.

  • Bug fixed where the "ncftpbookmarks --dimensions-terse" hack could be closed and generate a SIGPIPE which caused it to exit uncleanly, and possibly leave the terminal state hosed.

  • Added a snippet from Felix von Leitner <leitner AT fefe.de> to get the terminal width fairly painlessly, so the aforementioned hack should not be necessary in many cases.

  • Dtterm and vt220 added to the short list of vt100ish term types.

  • Win32 version bug fixed where ncftpbookmarks was not honoring the HOME enviornment variable, instead writing data to the install directory under Program Files.

  • Win32 version now uses Wise installer instead of InstallShield.

3.0.0, 2000-03-19:

  • New "redial-delay" preference setting, so you can easily set it and forget it rather than doing "-r 30" on each open.

  • NcFTP's "file exists" prompt now includes options to apply the same action to all files in the batch. This should alleviate concerns by users who didn't want to babysit NcFTP through a large batch of files which exist locally.

  • Work around Y2K bug in old wu-ftpd servers.

  • Work around broken Novell 5.00 ftp servers.

  • Fixed a getline problem where entering a character with the high-bit set would cause NcFTP to exit.

  • NcFTP now no longer complains when you redirect a file into it as stdin.

  • NcFTP's getline now recognizes alternate escape sequences for the arrow keys.

  • NcFTP now allows a user to cancel an mget at the "file exists" prompt.

  • Continue redialing if the server returns a bad user reply, since some servers do their "too many users logged in check" at that time.

  • Try harder to display remote connect banner.

  • Fixed bug in remote mkdir which would fail if the subdirectory was in the root directory.

  • A few small memory leaks plugged.

  • Try to remove extraneous slashes from paths when possible, since Win32 doesn't like them.

  • Win32 version tries harder to sleep the actual number of seconds requested even if means busy waiting, since Sleep() may return immediately if the system has nothing else to do.

  • Win32 version now checks for a HOME or NCFTPDIR environment variable.

  • Win32 version of ncftpbookmarks no longer locks up when trying to send a bookmark back to NcFTP.

  • The firewall password no longer echoes to the screen on the Win32 version.

  • NcFTP tries harder to get the actual screen width so that getline can use the whole line for input. ncftpbookmarks has to be built and installed where NcFTP can find it for this ugly hack to work.

  • NcFTP now sends your anonymous password to batch jobs, rather than having NcFTPBatch compute a default value.

  • Shell utilities now default to PASV-then-PORT mode like NcFTP does, rather than use PORT only.

  • NcFTPGet and Put are now better about reporting a server error, rather than simply printing the worthless "could not start data transfer" message.

  • Getline now handles emacs ^W sequence.

  • Included HTML versions of the manual pages. This is mostly for the Win32 port.

  • Bug fixed in ncftpls which was printing lines with \r\n instead of just \n.

  • NcFTP 3 is now covered by the Artistic License. See the LICENSE.txt file for details.

  • The "prefs" file is now called "prefs_v3" for better coexistence with NcFTP 2.

  • Win32 (Windows 95/98/NT) supported natively! You can download a pre-fab Setup, or build it yourself from the same source base that is used for UNIX.

  • Readline is out, Getline is in!

  • Using my "sio" library in conjunction with LibNcFTP. This was done to be consistent with other platforms, which don't use alarm() and signal handline.

  • Change of licensing. Specifically, GPL was shown the door. NcFTP is, has always been, and will continue to be free software.

  • Firewall type 6 bug fixed.

  • "put -f" fixed.

  • When the server asks for a password, NcFTP will print the text, in case you need that for a one-time password scheme like S/Key.

  • "get -R" asks for all files by using the equivalent of /bin/ls -lRa on the remote server.

  • A couple of small fixes for Cygwin, although in light of native support for Windows this seems moot.

  • Changed behavior so when auto-resume is off (still the default) NcFTP will automatically continue without prompting if the remote file's size and timestamp exactly match an existing local file. This will make auto-resume=no a more friendly default, since you'll still get prompted when the files differ, but won't bother you like beta 18 did if the files are the same.

  • Bug fixed where "get -f" on an existing file would still have the existing file prompt come up.

  • Work around bug with "-s" linker flag on IRIX 6.5.

  • Small fixes to support Mac OS X Server.

  • Using inet_ntop function if available to work around IRIX DNS resolution problems.

  • NcFTP's "rm -r" fixed to better handle empty directories and .dotfiles.

  • Using SITE RETRBUFSIZE/RBUFSIZ/STORBUFSIZE/SBUFSIZ commands, if available, to try and coordinate large TCP window support between client and server.

  • Special case the IIS FTP server, so if it prints directory listings in DOS mode, then NcFTP can parse them for file completion.

  • A few more changes for Cygwin/32.

  • Workaround definition of "lines" by AIX headers.

  • Yet another permutation of firewall added.

  • NcFTP 3 now keeps a simple transfer log like NcFTP 2 did.

  • Bug fixed in ncftpbatch which was looping if the file to get already existed and was identical to the remote file.

  • Local commands now work better with wildcards.

  • Bug fixed where one of the firewall handlers was not prompting you for your firewall password.

  • Bug fixed where logging in succeeded but NcFTP could not "pwd" caused a crash.

  • You can now "ncftp -F" to dump a new firewall configuration template to stdout.

  • Bug fixed which caused downloads from servers other than wu-ftpd and NcFTPd to skip the first byte in the file.

  • NcFTP's new prompting-before-transferring feature had a bug which occasionally caused it to detect a non-existant remote file as existant.

  • New feature: NcFTP now prompts you by default when you try to get/put a file that already exists.

  • A few resume bugs fixed in both get and put.

  • New "jobs" command to list any running "ncftpbatch" tasks.

  • Shell utilities now honor the ~/.ncftp/firewall file so they can use the firewall settings.

  • If you're using the global version of the .firewall file, as /etc/ncftp.firewall, you can also set the "passive" setting in there.

  • Better large-file support for FreeBSD.

  • Capitulated to using the "install" utility in the Makefile.

  • Using autoconf-2.13 and new functionality to assist in configuring for UNIX on Win32 environments.

  • Avoiding problems in Solaris 7 headers which cause curses to not be autodetected.

  • Various improvements in FTP engine, including new support for proposed FTP standard..

  • TCP Large Window support, for those of you with obnoxiously large pipes to the internet. Use the new "so-bufsize" option for "set", and "-B" options with ncftpget/put.

  • NcFTP now notes the server type, when possible, and works-around problems with certain ones.

  • NcFTP now does timestamp checking in addition to size checking to determine when to reget/reput. NcFTP 2 did this, but NcFTP 3 will not be as aggressive to reduce the number of timezone synchronization problems.

  • Fixed a problem where if the remote server suddenly disconnected NcFTP would report the wrong error.

  • NcFTP tries to print a message when it doesn't need to get a file.

  • Fixed more problems related to NcFTP being inconsistent about printing startup messages and responses from the remote server.

  • User names, passwords, and accounts maximum length extended.

  • NcFTP now tries reput by default (ncftpput still does not).

  • Bug fixed in ncftpbatch which caused relative directory paths on the second and successive transfers on the same host to fail.

  • ncftpbatch now unspools an entry if a directory did not exist at connect time.

  • Account option added to shell utilties.

  • More readline band-aids.

  • --bindir change was not pointing to ncftpbatch correctly.

  • "get -R -a" is now detected and treated as "get -R".

  • getpassphrase() function is used in place of getpass(), where available.

  • NcFTP can now cope with cd'ing to unreadable directories.

  • The curses support (i.e. ncftpbookmarks) is now much more portable (for example, FreeBSD 3, SunOS 4, BSD/OS). Still, your best bet is to install ncurses if you can. At least one system's curses (HP-UX) compiles fine but doesn't work worth jack, so use ncurses there.

  • Firewall not being used correctly when you ran NcFTP with a host from the shell command-line.

  • Bug fixed where 32 spaces were being printed before running the pager.

  • configure now recognizes --bindir.

  • NcFTP now tries to print "server said" for a server related error, so NcFTP quits getting blamed for server problems.

  • More readline band-aids.

  • Rare problem fixed where a null pointer was being passed to a socket library function was causing core dumps and, in some cases, kernel panics.

  • Problem fixed with the new auto-TAR feature if the directory to download was a first level directory.

  • When auto-TAR mode is on, you can tell in the progress meter.

  • When auto-TAR is used for the first time, a one-time message is printed.

  • Bug fixed when using -R with a directory URL.

  • Doing a better job about displaying login and welcome messages.

  • Memory leak found and fixed.

  • Failed logins as non-anonymous no longer continue redialing and refailing.

  • Problem fixed where firewall user's firewall password could be logged in the trace log.

  • URLs displayed include the port number, if non-standard.

  • ncftpbatch resets it's exponential waiting period.

  • Problem fixed where uploading invalid files wasn't considered an error.

  • Local filesystem commands (lmkdir, etc) weren't handling files with spaces in them correctly.

  • Firewall Type 5 now works.

  • "cd" command now properly recognizes a wildcard.

  • NcFTP was failing to report an error when a wildcard did not match anything.

  • Progress reports on downloads had a bug where it wouldn't update as often as it should have been.

  • A "put" on a short file is now more likely to errout with a timeout error when the remote host is not responsive.

  • Bookmarks and commands now readline-complete without regards to case sensitivity.

  • Big change again -- NcFTP now automatically tries to take advantage of servers that do on-the-fly TAR. NcFTP can dynamically fallback to the regular, non-TAR method when needed, so this should be somewhat transparent. You can tell when NcFTP uses TAR when the progress meter shows only a directory being downloaded, instead of individual items within the directory tree. Of course the advantage to using TAR mode is that the exact timestamps, permissions, etc can be preserved, as well as reducing the number of total connections to the server.

  • Bug fixed for regular get -R mode, which was causing failures on some servers.

  • There is a now a "local directory" field for bookmarks. This is only settable using the Bookmark Editor.

  • Bug fixed where NcFTP wouldn't always fallback to PORT from PASV.

  • Bug fixed where NcFTP was not handling relative pathnames with more than one node correctly (i.e. "foo" was okay, but "foo/bar" was not.)

  • The "-@" flag has been enhanced a little so it accepts a few more types of date/time specifications.

  • Bug fixed where NcFTP could be fooled into thinking a bookmark was not saved.

  • Trying harder to print the host list if the Bookmark Editor is not installed.

  • Main usage message was not always printed.

  • Small tweaks to the progress meters.

  • Shell utilities now identify themselves using CLNT command.

  • Completion bug fixed where a "/" was being appended for bookmarks and commands.

  • Big change -- curses is back, in limited form. The bookmark editor runs as the fullscreen applet that NcFTP 2.4 has. It is a separate program now (ncftpbookmarks) which is run by NcFTP (or you can run it in stand-alone mode). Note that if you have problems getting the curses support to work, you do NOT have to build ncftpbookmarks. To do that, remove the config.cache file and "./configure --disable-curses".

  • Bookmark completion and command name completion added.

  • Recursive remote deletes are now possible (i.e. rm -r).

  • Shell command ("!") back.

  • Bug fixed where NcFTP would ignore ls output from OS/2 servers.

  • Bug fixed where a trailing slash was confusing put -R.

  • Bug fixed where a trailing slash was confusing file completion.

  • ncftpget and ncftpput now have a "-b" flag which lets you submit a batch job to ncftpbatch. Now you don't need to run ncftp, open the site, and do bgget commands.

  • NcFTP now accepts URLs with the open command.

  • A bit more lenient when using directory URLs with NcFTP without the proper trailing slash.

  • Various small configure script bugs fixed.

  • Another problem with Auto-resume-downloads fixed.

  • The xterm title setting feature is now configurable from "prefs" and is off by default.

  • Problem fixed where files newer than the current date could be listed as the year before.

  • Small firewall support problem fixed.

  • Several problems with Auto-resume-downloads fixed.

  • Several problems with Redial fixed. It is on by default -- let me know the specifics if it fails.

  • Problem fixed where a multiple get would try re-downloading files over and over again.

  • Problem fixed where if a multiple get failed the files that were downloaded successfully were deleted.

  • Bug fixed where "get -R" would create files as directories.

  • Master source drive lost -- some things had to be restored from backup and rebuilt entirely (such as the configure script stuff). So, many things which were fixed may suddenly be un-fixed again.

  • Readline completion works with local directories and remote symlinks.

  • NcFTP recovers better from aborted transfers.

  • New signal handling, which will hopefully have the same behavior across platforms.

  • A few minor firewall problems fixed.

  • You can now have system-wide firewall settings stored in /etc/ncftp.firewall and /etc/ncftp.firewall.fixed, if you create them from a ~/.ncftp/firewall file.

  • You can now spool transfers to FTP servers on non-standard ports.

  • NcFTP now changes your xterm window title.

  • Bug fixed with spool files using the firewall's IP number.

  • ncftpbatch now works on case-insensitive filesystems.

  • configure's readline check now runs the test program to be sure it was linked correctly.

  • Bug fixed that was introduced in b8 that caused a crash after a transfer.

  • Readline completion with <TAB><TAB> should work better.

  • Bookmark lookups changed to full bookmark name only.

  • Configure bug where scanf("%qd") wasn't checked right.

  • Bug fix that broke the firewall support that used to work in Beta 6.

  • Bug fixes with RESTarting.

  • Smarter about using 64-bit or 32-bit mode (long longs or longs).

  • Yet another firewall added.

  • Fixes for HP-UX.

  • Readline 2.1 dependency worked around, so that Readline 2.0 is useable.

  • Unsupported -J flag added to use an ACCT name.

  • Uses NcFTPd's new "CLNT" command to specify FTP client type.

  • Hack so "open -u host" works like it did in earlier versions of NcFTP.

  • Should now be able to retrieve very large files (> 2 gig), depending on the libc and OS.

  • Namespace collision with GNU libc fixed (errno field).

  • get -R xxx now creates a ./xxx directory instead of dropping xxx/* in the local directory.

  • New firewall type added.

  • Many file completion tweaks.

  • Another bug fixed where ASCII mode was getting turned on.

  • If you use a firewall, the firewall is now responsible for resolving host names.

  • Bug fixed with bgget/bgput with absolute pathnames.

  • Plug frequency reduced.

  • Bug fixed where command-line switches were not overriding bookmark settings.

  • Bug fixed where "set" commands were not taking effect until the current connection was closed.

  • StatBar progress meter revised.

  • ncftp_batch back-off revised.

  • ncftpget transfer type bug fixed.

  • Bookmark command bug fixed.

  • Bug with bookmarks fixed that could save the transfer type as ASCII.

  • Symlink hidden command added (only works with NcFTPd).

  • Including man page for ncftpls

  • Mkdir dirties cache

  • site and quote fixed

  • Fixes for AIX 4.1

  • Bug in put -R fixed.

  • Bug fixed that caused pdir/pls to act like ls.

  • Fixes for SunOS.

  • ncftpls added.

  • The philbar is back; you can now choose it as a progress meter if you don't like the statbar.

  • Checking for ncftpbatch before trying to run it.

  • Try not to use Readline when it is older than 2.0, or when its headers aren't installed correctly.

  • Fix for get -R, which could cause a crash during the post-downloading cleanup.

  • A little extra tracing for the firewall code.

  • Fix for unrecognized ls flags that would cause a crash.

  • NcFTP 3.0 prefers GNU Readline version 2.1, but it should now also work with version 2.0.

  • A few portability/lint fixes.

ncftp-3.2.6/doc/html/faq.html0000644000000000000000000001252511161223771014627 0ustar rootwheel NcFTP Client: Frequently Asked Questions

Documentation Links

You can also download the source code or compiled executables which contain the documentation.

Frequently Asked Questions about NcFTP

  1. Q. Is there a registration or licensing fee to use NcFTP Client?

    A. No, it is free! We would appreciate a donation if you find it useful. Your support allows us to keep maintaining the project!


  2. Q. How do I connect to a non-standard port number?

    A. Use the -P option (i.e. ncftp -P 2121 ftp.example.com). This works with all the programs as well as the open command in the NcFTP shell.


  3. Q. Does NcFTP support any secure FTP modes a la SFTP/SSL/SSH Tunnels?

    A. NcFTP does not have any built-in support for encryption or secure FTP of any type. We do not support any type of interaction with hacks such as FTP over SSH tunnels. We may implement a secure FTP mode at a future date, but please do not ask for an ETA.


  4. Q. How do I login to a server using a regular username instead of anonymous?

    A. Use the -u option (i.e. ncftp -u joeuser ftp.example.com). This works with all the programs as well as the open command in the NcFTP shell.


  5. Q. Do the utility programs (ncftpget, ncftpput, ncftpls, ncftpbatch) use my preferences or bookmarks files in $HOME/.ncftp?

    A. No. The utility programs have a complete set of command-line switches and the current behavior is to require the user to explicity choose each option needed.


  6. Q. How do I change NcFTP's redial delay from 20 seconds?

    A. From within the NcFTP shell, you can simply do set redial-delay 60 to set it to 60 seconds. When using the utility programs, you need to use the -r flag to specify both the number of redials and the redial delay, such as ncftpget -r 3,60 ... which would try 3 dials with a delay of 60 seconds between each.

    Note that you cannot change what ncftpbatch uses, since it is uses an internal algorithm to wait progressively longer between redials.


  7. Q. How do I make the default behavior to always ask for a username/password rather than using anonymous logins?

    A. Sorry, you can't do that unless you want to hack on the source code.


  8. Q. My macros from NcFTP 2 or NcFTP 1 do not work with NcFTP version 3!

    A. We removed that feature as it was unnecessary bloat which 99% of the users were not using. Besides, you should use the command-line utility programs if you need to do any kind of automation.


  9. Q. NcFTP doesn't always preserve the timestamps of downloaded files. When using other client programs to download the identical file from the same server, they are preserving the timestamp.

    A. Those client programs are probably parsing the date and time from the directory listing. That should not be done because most servers use local time for their directory listings rather than GMT. NcFTP would rather preserve the timestamps only when the server implements MDTM, which requires that the time be in GMT. This guarantees that if the time is preserved, it is the correct time, and not some half-assed guess which could be hours off.


  10. Q. What happened to Visual Mode like NcFTP 2.4.3 used?

    A. That was removed because of too many problems with the Curses library. Specifically, there were too many bugs, ambiguities, and missing features with various implementations of curses.

    However, NcFTP 3 still tries to use curses for the bookmark editor, ncftpbookmarks. When you do an open without a hostname from the NcFTP shell, you will get the visual bookmark editor if it could be compiled and installed. This way, if curses is too broken, you can build and run the NcFTP shell without it.


  11. Q. NcFTP's command-line editor seems to work differently than the one with Bash.

    A. That's because NcFTP doesn't use GNU Readline by default.

ncftp-3.2.6/doc/html/index.html0000644000000000000000000000423312023662015015160 0ustar rootwheel NcFTP Documentation Index

Documentation:

Online Resources

ncftp-3.2.6/doc/html/ncftp.html0000644000000000000000000012031212023657660015172 0ustar rootwheel ncftp(1) manual page

Table of Contents

Name

    NcFTP - Browser program for the File Transfer Protocol

Synopsis

    ncftp [host]

    ncftp [ftp://host.name/directory/]

Description

The purpose of ncftp is to provide a powerful and flexible interface to the Internet standard File Transfer Protocol. It is intended to replace the stock ftp program that comes with the system.

Although the program appears to be rather spartan, you'll find that ncftp has a wealth of valuable performance and usage features. The program was designed with an emphasis on usability, and it does as much as it can for you automatically so you can do what you expect to do with a file transfer program, which is transfer files between two interconnected systems.

Some of the cooler features include progress meters, filename completion, command-line editing, background processing, auto-resume downloads, bookmarking, cached directory listings, host redialing, working with firewalls and proxies, downloading entire directory trees, etc., etc.

The ncftp distribution comes with the useful utility programs ncftpget(1) and ncftpput(1) which were designed to do command-line FTP. In particular, they are very handy for shell scripts. This version of ncftp no longer does command-line FTP, since the main ncftp program is more of a browser-type program.

Options

The program allows you to specify a host or directory URL on the command line. This is a synonym for running ncftp and then using the open command. A few command-line flags are allowed with this mode:

    -u XX Use username XX instead of anonymous.
    -p XX Use password XX with the username.
    -j XX Use account XX in supplement to the username and password (deprecated)
    -P XX Use port number XX instead of the default FTP service port (21).

Introduction to the Command Shell

Upon running the program you are presented a command prompt where you type commands to the program's shell. Usually you will want to open a remote filesystem to transfer files to and from your local machine's filesystem. To do that, you need to know the symbolic name of the remote system, or its Internet Protocol (IP) address. For example, a symbolic name might be ``typhoon.unl.edu,'' and its IP address could be ``129.93.33.24.'' To open a connection to that system, you use the program's open command:

    open typhoon.unl.edu
    open 129.93.33.24

Both of these try to open the machine called typhoon at the University of Nebraska. Using the symbolic name is the preferred way, because IP addresses may change without notice, while the symbolic names usually stay the same.

When you open a remote filesystem, you need to have permission. The FTP Protocol's authentication system is very similar to that of logging in to your account. You have to give an account name, and its password for access to that account's files. However, most remote systems that have anything you might be interested in don't require an account name for use. You can often get anonymous access to a remote filesystem and exchange files that have been made publicly accessible. The program attempts to get anonymous permission to a remote system by default. What actually happens is that the program tries to use ``anonymous'' as the account name, and when prompted for a password, uses your E-mail address as a courtesy to the remote system's maintainer. You can have the program try to use a specific account also. That will be explained later.

After the open command completes successfully, you are connected to the remote system and logged in. You should now see the command prompt change to reflect the name of the current remote directory. To see what's in the current remote directory, you can use the program's ls and dir commands. The former is terse, preferring more remote files in less screen space, and the latter is more verbose, giving detailed information about each item in the directory.

You can use the program's cd command to move to other directories on the remote system. The cd command behaves very much like the command of the same name in the Bourne and Korn shell.

The purpose of the program is to exchange data with other systems. You can use the program's get command to copy a file from the remote system to your local system:

    get README.txt

The program will display the progress of the transfer on the screen, so you can tell how much needs to be done before the transfer finishes. When the transfer does finish, then you can enter more commands to the program's command shell.

You can use the program's put command to copy a file from your system to the remote system:

    put something.tar

When you are finished using the remote system, you can open another one or use the quit

Before quitting, you may want to save the current FTP session's settings for later. You can use the bookmark command to save an entry into your $HOME/.ncftp/bookmarks file. When you use the bookmark command, you also specify a bookmark name, so the next time instead of opening the full hostname you can use the name of the bookmark. A bookmark acts just like one for your web browser, so it saves the remote directory you were in, the account name you used, etc., and other information it learned so that the next time you use the bookmark it should require as little effort from you as possible.

 

Command Reference

help
The first command to know is help. If you just type
      help
    from the command shell, the program prints the names of all of the supported commands. From there, you can get specific help for a command by typing the command after, for example:
      help open
    prints information about the open command.
 
ascii
This command sets the transfer type to ASCII text. This is useful for text-only transfers because the concept of text files differs between operating systems. For example on UNIX, a text file denotes line breaks with the linefeed character, while on MS-DOS a line break is denoted by both a carriage return character and a line feed character. Therefore, for data transfers that you consider the data as text you can use ascii to ensure that both the remote system and local system translate accordingly. The default transfer type that ncftp uses is not ASCII, but straight binary.
 
bgget, bgput
These commands correspond to the get and put commands explained below, except that they do the job in the background. Normally when you do a get then the program does the download immediately, and does not return control to you until the download completes. The background transfers are nice because you can continue browsing the remote filesystem and even open other systems. In fact, they are done by a daemon process, so even if you log off your UNIX host the daemon should still do your transfers. The daemon will also automatically continue to retry the transfers until they finish. To tell when background jobs have finished, you have to examine the $HOME/.ncftp/spool/log file, or run the jobs command from within NcFTP.
 
Both the bgget and bgput commands allow you to schedule when to do the transfers. They take a ``-@'' parameter, whose argument is a date of the form YYYYMMDDhhmmss (four digit year, month, day, hour, minute, second). For example, to schedule a download at 3 AM on November 6, you could try:
      bgget -@ 19971106030000 /pub/idstuff/quake/q2_100.zip
       
bgstart
This command tells ncftp to immediately start the background transfers you've requested, which simply runs a copy of the ncftpbatch program which is responsible for the background jobs. Normally the program will start the background job as soon as you close the current site, open a new site, or quit the program. The reason for this is because since so many users still use slow dialup links that starting the transfers would slow things to a crawl, making it difficult to browse the remote system. An added bonus of starting the background job when you close the site is that ncftp can pass off that open connection to the ncftpbatch program. That is nice when the site is always busy, so that the background job doesn't have to wait and get re-logged on to do its job.
 
binary
Sets the transfer type to raw binary, so that no translation is done on the data transferred. This is the default anyway, since most files are in binary.
 
bookmark
Saves the current session settings for later use. This is useful to save the remote system and remote working directory so you can quickly resume where you left off some other time. The bookmark data is stored in your $HOME/.ncftp/bookmarks file.
 
bookmarks
Lists the contents of your $HOME/.ncftp/bookmarks file in a human-readable format. You can use this command to recall the bookmark name of a previously saved bookmark, so that you can use the open command with it.
 
cat
Acts like the ``/bin/cat'' UNIX command, only for remote files. This downloads the file you specify and dumps it directly to the screen. You will probably find the page command more useful, since that lets you view the file one screen at a time instead of printing the entire file at once.
 
cd
Changes the working directory on the remote host. Use this command to move to different areas on the remote server. If you just opened a new site, you might be in the root directory. Perhaps there was a directory called ``/pub/news/comp.sources.d'' that someone told you about. From the root directory, you could:
      cd pub
      cd news
      cd comp.sources.d
    or, more concisely,
      cd /pub/news/comp.sources.d
Then, commands such as get, put, and ls could be used to refer to items in that directory.  Some shells in the UNIX environment have a feature I like, which is switching to the previous directory. Like those shells, you can do:
      cd -

    to change to the last directory you were in.

 
chmod
Acts like the ``/bin/chmod'' UNIX command, only for remote files. However, this is not a standard command, so remote FTP servers may not support it.
 
close
Disconnects you from the remote server. The program does this for you automatically when needed, so you can simply open other sites or quit the program without worrying about closing the connection by hand.
 
debug
This command is mostly for internal testing. You could type
      debug 1
to turn debugging mode on.  Then you could see all messages between the program and the remote server, and things that are only printed in debugging mode. However, this information is also available in the $HOME/.ncftp/trace file, which is created each time you run ncftp. If you need to report a bug, send a trace file if you can.
 
dir
Prints a detailed directory listing. It tries to behave like UNIX's ``/bin/ls -l'' command. If the remote server seems to be a UNIX host, you can also use the same flags you would with ls, for instance
      dir -rt
    would try to act like
      /bin/ls -lrt

    would on UNIX.

     

edit
Downloads into a temporary file for editing on the local host, then uploads the changed file back to the remote host.
 
get
Copies files from the current working directory on the remote host to your machine's current working directory. To place a copy of ``README'' and ``README.too'' in your local directory, you could try:

      get README README.too

    You could also accomplish that by using a wildcard expression, such as:
      get README*
This command is similar to the behavior of other FTP programs' mget command. To retrieve a remote file but give it a different name on your host, you can use the ``-z'' flag. This example shows how to download a file called ReadMe.txt but name it locally as README:
      get -z ReadMe.txt README
The program tries to ``resume'' downloads by default.  This means that if the remote FTP server lost the connection and was only able to send 490 kilobytes of a 500 kilobyte file, you could reconnect to the FTP server and do another get on the same file name and it would get the last 10 kilobytes, instead of retrieving the entire file again. There are some occasions where you may not want that behavior. To turn it off you can use the ``-f'' flag.
 
There are also times where you want to append to an existing file. You can do this by using the ``-A'' flag, for example
      get -A log.11

    would append to a file named ``log.11'' if it existed locally.

    Another thing you can do is delete a remote file after you download it. This can be useful when a remote host expects a file to be removed when it has been retrieved. Use the double-D flag, such as ``get -DD'' to do this.

 
The get command lets you retrieve entire directory trees, too. Although it may not work with some remote systems, you can try ``get -R'' with a directory to download the directory and its contents.
 
When using the ``-R'' flag, you can also use the ``-T'' flag to disable automatic on-the-fly TAR mode for downloading whole directory trees.  The program uses TAR whenever possible since this usually preserves symbolic links and file permissions. TAR mode can also result in faster transfers for directories containing many small files, since a single data connection can be used rather than an FTP data connection for each small file. The downside to using TAR is that it forces downloading of the whole directory, even if you had previously downloaded a portion of it earlier, so you may want to use this option if you want to resume downloading of a directory.
 
jobs
Views the list of currently executing NcFTP background tasks. This actually just runs ncftpbatch -l for you.
 
lcd
The lcd command is the first of a few ``l'' commands that work with the local host. This changes the current working directory on the local host. If you want to download files into a different local directory, you could use lcd to change to that directory and then do your downloads.
 
lchmod
Runs ``/bin/chmod'' on the local host.
 
lls
Another local command that comes in handy is the lls command, which runs ``/bin/ls'' on the local host and displays the results in the program's window. You can use the same flags with lls as you would in your command shell, so you can do things like:
      lcd ~/doclls -lrt p*.txt
       
lmkdir
Runs ``/bin/mkdir'' on the local host.
 
lookup

    The program also has a built-in interface to the name service via the lookup command. This means you can lookup entries for remote hosts, like:

      lookup cse.unl.edu ftp.cs.unl.edu sphygmomanometer.unl.edu

    prints:

      cse.unl.edu               129.93.33.1
      typhoon.unl.edu           129.93.33.24
      sphygmomanometer.unl.edu  129.93.33.126

    There is also a more detailed option, enabled with ``-v,'' i.e.:

      lookup -v cse.unl.edu ftp.cs.unl.edu

    prints:

      cse.unl.edu:
          Name:     cse.unl.edu
          Address:  129.93.33.1
      
      ftp.cs.unl.edu:
          Name:     typhoon.unl.edu
          Alias:    ftp.cs.unl.edu
          Address:  129.93.33.24

    You can also give IP addresses, so this would work too:

      lookup 129.93.33.24

    prints:

      typhoon.unl.edu           129.93.33.24
lpage
Views a local file one page at a time, with your preferred $PAGER program.
 
lpwd
Prints the current local directory. Use this command when you forget where you are on your local machine.
 
lrename
Runs ``/bin/mv'' on the local host.
 
lrm
Runs ``/bin/rm'' on the local host.
 
lrmdir
Runs ``/bin/rmdir'' on the local host.
 
ls
Prints a directory listing from the remote system. It tries to behave like UNIX's ``/bin/ls -CF'' command. If the remote server seems to be a UNIX host, you can also use the same flags you would with ls, for instance
      ls -rt
    would try to act like
      /bin/ls -CFrt

    would on UNIX.

ncftp has a powerful built-in system for dealing with directory listings. It tries to cache each one, so if you list the same directory, odds are it will display instantly. Behind the scenes, ncftp always tries a long listing, and then reformats it as it needs to. So even if your first listing of a directory was a regular ``ls'' which displayed the files in columns, your next listing could be ``ls -lrt'' and ncftp would still use the cached directory listing to quickly display the information for you!
 
mkdir
Creates a new directory on the remote host. For many public archives, you won't have the proper access permissions to do that.
 
open
Establishes an FTP control connection to a remote host. By default, ncftp logs in anonymously to the remote host. You may want to use a specific user account when you log in, so you can use the ``-u'' flag to specify which user. This example shows how to open the host ``bowser.nintendo.co.jp'' using the username ``mario:''
      open -u mario bowser.nintendo.co.jp

    Here is a list of flags you can use with the open command:

      -u XX Use username XX instead of anonymous.
      -p XX Use password XX with the username.
      -j XX Use account XX in supplement to the username and password (deprecated)
      -P XX Use port number XX instead of the default FTP service port (21).
page
Browses a remote file one page at a time, using your $PAGER program. This is useful for reading README's on the remote host without downloading them first.
 
pdir, pls
These commands are equivalent to dir and ls respectively, only they feed their output to your pager. These commands are useful if the directory listing scrolls off your screen.
 
put
Copies files from the local host to the remote machine's current working directory. To place a copy of ``xx.zip'' and ``yy.zip'' in the remote directory, you could try:
      put xx.zip yy.zip
    You could also accomplish that by using a wildcard expression, such as:
      put *.zip
This command is similar to the behavior of other FTP programs' mput command. To send a remote file but give it a different name on your host, you can use the ``-z'' flag. This example shows how to upload a file called ``ncftpd-2.0.6.tar.gz'' but name it remotely as ``NFTPD206.TGZ:''
      put -z ncftpd-2.0.6.tar.gz NFTPD206.TGZ
The program does not try to ``resume'' uploads by default. If you do want to resume an upload, use the ``-z'' flag.
 
There are also times where you want to append to an existing remote file. You can do this by using the ``-A'' flag, for example
      put -A log11.txt

    would append to a file named ``log11.txt'' if it existed on the remote server.

Another thing you can do is delete a local file after you upload it. Use the double-D flag, such as ``put -DD'' to do this.
 
The put command lets you send entire directory trees, too. It should work on all remote systems, so you can try ``put -R'' with a directory to upload the directory and its contents.
 
pwd
Prints the current remote working directory. A portion of the pathname is also displayed in the shell's prompt.
 
quit
Of course, when you finish using the program, type quit to end the program (You could also use bye, exit, or ^D).
 
quote
This can be used to send a direct FTP Protocol command to the remote server. Generally this isn't too useful to the average user.
 
rename
If you need to change the name of a remote file, you can use the rename command, like:
      rename SPHYGMTR.TAR sphygmomanometer-2.3.1.tar

 

rhelp
Sends a help request to the remote server. The list of FTP Protocol commands is often printed, and sometimes some other information that is actually useful, like how to reach the site administrator.  Depending on the remote server, you may be able to give a parameter to the server also, like:
      rhelp NLST
    One server responded:
      Syntax: NLST [ <sp> path-name ]
rm
If you need to delete a remote file you can try the rm command. Much of the time this won't work because you won't have the proper access permissions. This command doesn't accept any flags, so you can't nuke a whole tree by using ``-rf'' flags like you can on UNIX.
 
rmdir
Similarly, the rmdir command removes a directory. Depending on the remote server, you may be able to remove a non-empty directory, so be careful.
 
set
This lets you configure some program variables, which are saved between runs in the $HOME/.ncftp/prefs file. The basic syntax is:
      set <option> <value>
    For example, to change the value you use for the anonymous password, you might do:
      set anon-password ncftp@example.com
show
This lets you display program variables. You can do ``show all'' to display all of them, or give a variable name to just display that one, such as:
      show anon-password
site
One obscure command you may have to use someday is site. The FTP Protocol allows for ``site specific'' commands. These ``site'' commands vary of course, such as:
      site chmod 644 README

    Actually, ncftp's chmod command really does the above.

    Try doing one of these to see what the remote server supports, if any:

      rhelp SITE
      site help

type
You may need to change transfer types during the course of a session with a server. You can use the type command to do this. Try one of these:
      type ascii
      type binary
      type image
The ascii command is equivalent to ``type a'', and the binary command is equivalent to ``type i'' and ``type b''.
 
umask
Sets the process' umask on the remote server, if it has any concept of a umask, i.e.:
      umask 077

    However, this is not a standard command, so remote FTP servers may not support it.


version
This command dumps some information about the particular edition of the program you are using, and how it was installed on your system.
 

Variable Reference

anon-password
Specifies what to use for the password when logging in anonymously. Internet convention has been to use your E-mail address as a courtesy to the site administrator. If you change this, be aware that some sites require (i.e. they check for) valid E-mail addresses.
 
auto-ascii
If set to a list of pipe-character delimited extensions, files with these extensions will be sent in ASCII mode even if binary mode is currently in effect. This option allows you to transfer most files in binary, with the exception of a few well-known file types that should be sent in ASCII. This option is enabled by default, and set to a list of common extensions (e.g., .txt and .html).
 
auto-resume
NcFTP 3 now prompts the user by default when you try to download a file that already exists locally, or upload a file that already exists remotely. Older versions of the program automatically guessed whether to overwrite the existing file or attempt to resume where it left off, but sometimes the program would guess wrong. If you would prefer that the program always guess which action to take, set this variable to yes, otherwise, leave it set to no and the program will prompt you for which action to take.
 
autosave-bookmark-changes
With the advent of version 3 of NcFTP, the program treats bookmarks more like they would with your web browser, which means that once you bookmark the site, the remote directory is static. If you set this variable to yes, then the program will automatically update the bookmark's starting remote directory with the directory you were in when you closed the site. This behavior would be more like that of NcFTP version 2.
 
confirm-close
By default the program will ask you when a site you haven't bookmarked is about to be closed. To turn this prompt off, you can set this variable to no.
 
connect-timeout
Previous versions of the program used a single timeout value for everything. You can now have different values for different operations. However, you probably do not need to change these from the defaults unless you have special requirements.
 
The connect-timeout variable controls how long to wait, in seconds, for a connection establishment to complete before considering it hopeless. You can choose to not use a timeout at all by setting this to -1.
 
control-timeout
This is the timer used when ncftp sends an FTP command over the control connection to the remote server. If the server hasn't replied in that many seconds, it considers the session lost.
 
logsize
This is controls how large the transfer log ($HOME/.ncftp/log) can grow to, in kilobytes. The default is 200, for 200kB; if you don't want a log, set this to 0.
 
pager
This is the external program to use to view a text file, and is more by default.
 
passive
This controls ncftp's behavior for data connections, and can be set to one of on, off, or the default, optional. When passive mode is on, ncftp uses the FTP command primitive PASV to have the client establish data connections to the server. The default FTP protocol behavior is to use the FTP command primitive PORT which has the server establish data connections to the client. The default setting for this variable, optional, allows ncftp to choose whichever method it deems necessary.
 
progress-meter
You can change how the program reports file transfer status. Select from meter 2, 1, or 0.
 
redial-delay

    When a host is busy or unavailable, the program waits this number of seconds before trying again.  The smallest you can set this is to 10 seconds -- so if you were planning on being inconsiderate, think again.

save-passwords
If you set this variable to yes, the program will save passwords along with the bookmarks you save. While this makes non-anonymous logins more convenient, this can be very dangerous since your account information is now sitting in the $HOME/.ncftp/bookmarks file. The passwords aren't in clear text, but it is still trivial to decode them if someone wants to make a modest effort.
 
show-status-in-xterm-titlebar
If set to yes and operating from within an xterm window, the program will change the window's titlebar accordingly.
 
so-bufsize
If your operating system supports TCP Large Windows, you can try setting this variable to the number of bytes to set the TCP/IP socket buffer to. This option won't be of much use unless the remote server also supports large window sizes and is pre-configured with them enabled.
 
xfer-timeout
This timer controls how long to wait for data blocks to complete. Don't set this too low or else your transfers will timeout without completing.
 

Firewall and Proxy Configuration

You may find that your network administrator has placed a firewall between your machine and the Internet, and that you cannot reach external hosts.

The answer may be as simple as setting ncftp to use passive mode only, which you can do from a ncftp command prompt like this:

    set passive yes

The reason for this is because many firewalls do not allow incoming connections to the site, but do allow users to establish outgoing connections. A passive data connection is established by the client to the server, whereas the default is for the server to establish the connection to the client, which firewalls may object to. Of course, you now may have problems with sites whose primitive FTP servers do not support passive mode.

Otherwise, if you know you need to have ncftp communicate directly with a firewall or proxy, you can try editing the separate $HOME/.ncftp/firewall configuration file. This file is created automatically the first time you run the program, and contains all the information you need to get the program to work in this setup.

The basics of this process are configuring a firewall (proxy) host to go through, a user account and password for authentication on the firewall, and which type of firewall method to use. You can also setup an exclusion list, so that ncftp does not use the firewall for hosts on the local network.

 

Files

    $HOME/.ncftp/bookmarks
    Saves bookmark and host information.
    $HOME/.ncftp/firewall
    Firewall access configuration file.
    $HOME/.ncftp/prefs
    Program preferences.
    $HOME/.ncftp/trace
    Debugging output for entire program run.
    $HOME/.ncftp/v3init
    Used to tell if this version of the program has run before.
    $HOME/.ncftp/spool/
    Directory where background jobs are stored in the form of spool configuration files.
    $HOME/.ncftp/spool/log
    Information for background data transfer processes.

Environment

    PATH
    User's search path, used to find the ncftpbatch program, pager, and some other system utilities.
    PAGER
    Program to use to view text files one page at a time.
    TERM
    If the program was compiled with support for GNU Readline it will need to know how to manipulate the terminal correctly for line-editing, etc. The pager program will also take advantage of this setting.
    HOME
    By default, the program writes its configuration data in a .ncftp subdirectory of the HOME directory.
    NCFTPDIR
    If set, the program will use this directory instead of $HOME/.ncftp. This variable is optional except for those users whose home directory is the root directory.
    COLUMNS
    Both the built-in ls command and the external ls command need this to determine how many screen columns the terminal has.

Bugs

    There are no such sites named bowser.nintendo.co.jp or sphygmomanometer.unl.edu.

    Auto-resume should check the file timestamps instead of relying upon just the file sizes, but it is difficult to do this reliably within FTP.

    Directory caching and recursive downloads depend on UNIX-like behavior of the remote host.

 

Author

    Mike Gleason, NcFTP Software.

 

See Also

 

Thanks

    Thanks to everyone who uses the program. Your support is what drives me to improve the program!

    I thank Dale Botkin and Tim Russell at my former ISP, Probe Technology.

    Ideas and some code contributed by my partner, Phil Dietz.

    Thanks to Brad Mittelstedt and Chris Tjon, for driving and refining the development of the backbone of this project, LibNcFTP.

    I'd like to thank my former system administrators, most notably Charles Daniel, for making testing on a variety of platforms possible, letting me have some extra disk space, and for maintaining the UNL FTP site.

    For testing versions 1 and 2 above and beyond the call of duty, I am especially grateful to: Phil Dietz, Kok Hon Yin, and Andrey A. Chernov (ache@astral.msk.su).

    Thanks to Tim MacKenzie (t.mackenzie@trl.oz.au) for the original filename completion code for version 2.3.0 and 2.4.2.

    Thanks to DaviD W. Sanderson (dws@ora.com), for helping me out with the man page.

    Thanks to those of you at UNL who appreciate my work.

    Thanks to Red Hat Software for honoring my licensing agreement, but more importantly, thanks for providing a solid and affordable development platform.

 

Apologies

    To the users, for not being able to respond personally to most of your inquiries.

    To Phil, for things not being the way they should be.


Table of Contents

ncftp-3.2.6/doc/html/ncftpbatch.html0000644000000000000000000000554512023657706016207 0ustar rootwheel ncftpbatch(1) manual page

Name

ncftpbatch - Batch FTP job processor daemon

Synopsis

ncftpbatch -d

ncftpbatch -l

ncftpbatch -D

Options

Command line flags:

-d
Begin background processing of FTP jobs in the current user's $HOME/.ncftp/spool directory. This returns immediately, because a daemon process is spawned and ran in the background.
-l
Lists the contents of the user's job queue.
-D
This is like -d, except that the process does not become a background daemon process.

Description

This program is responsible for processing background FTP requests. It is normally only run by ncftp and not manually by a human being, however you can run it to manually process the FTP job queue.

The jobs are spool files written to a user's $HOME/.ncftp/spool directory and have a special format and file-naming convention (which contains when the job is to be run). ncftp runs this program when it needs to, but if the ncftpbatch daemon dies unexpectedly the jobs that are left in the queue will not be processed until another instance of ncftpbatch is run.

ncftpget and ncftpput can also be used to submit jobs for batch processing, using those utilities' -b command-line flag. If desired, you can also manually create the spool files although this procedure is not documented here (see the manual page for ncftpspooler for more information on how to do that).

Diagnostics

ncftpbatch writes to its own log file, the $HOME/.ncftp/spool/log file. This file should be examined to determine if any ncftpbatch processes are actively working on jobs.

Author

Mike Gleason, NcFTP Software.

See Also

ncftpput(1), ncftpget(1), ncftp(1), ftp(1), rcp(1), tftp(1).

LibNcFTP (http://www.ncftp.com/libncftp/).

ncftp-3.2.6/doc/html/ncftpget.html0000644000000000000000000002476112023657715015706 0ustar rootwheel ncftpget(1) manual page

Name

ncftpget - Internet file transfer program for scripts

Synopsis

ncftpget [options] remote-host local-directory remote-files...

ncftpget [options] bookmark-name local-directory remote-files...

ncftpget -f login.cfg [options] local-directory remote-files...

ncftpget [options] ftp://url.style.host/path/name

ncftpget -c [options] remote-host remote-file > stdout

ncftpget -C [options] remote-host remote-file local-path-name

ncftpget -c [options] ftp://url.style.host/path/name > stdout

Options

Command line flags:
-u XX
Use username XX instead of anonymous.
-p XX
Use password XX with the username.
-P XX
Use port number XX instead of the default FTP service port (21).
-j XX
Use account XX in supplement to the username and password (deprecated).
-d XX
Use the file XX for debug logging.
-a
Use ASCII transfer type instead of binary.
-t XX
Timeout after XX seconds.
-v/-V
Do (do not) use progress meters. The default is to use progress meters if the output stream is a TTY.
-f XX
Read the file XX for host, user, and password information.
-c
Read from remote host and write locally to standard out.
-C
Read from remote host and write locally to specified pathname.
-A
Append to local files, instead of overwriting them.
-z/-Z
Do (do not) try to resume transfers. The default is to try to resume (-z).
-E
Use regular (PORT) data connections.
-F
Use passive (PASV) data connections.  The default is to use passive, but to fallback to regular if the passive connection fails or times out.
-DD
Delete remote file after successfully downloading it.
-R
Recursive mode; copy whole directory trees.
-T
Do not use automatic on-the-fly TAR mode for downloading whole directory trees.  The program uses TAR whenever possible since this usually preserves symbolic links and file permissions. TAR mode can also result in faster transfers for directories containing many small files, since a single data connection can be used rather than an FTP data connection for each small file. The downside to using TAR is that it forces downloading of the whole directory, even if you had previously downloaded a portion of it earlier, so you may want to use this option if you want to resume downloading of a directory.
-r XX
Redial a maximum of XX times until connected to the remote FTP server.
-b
Run in background (by submitting a job to ncftpbatch).
-bb
Similar to -b option, but only submits the batch job. You will need to run ncftpbatch for the batch job to be processed. This is useful if you already have a ncftpbatch process running, or wish to have better control of when batch jobs are processed.

For example, if you wanted to do background processing of three files all on the same remote server, it is more polite to use just one ncftpbatch process to process the three jobs sequentially, rather than having three ncftpbatch processes open three simultaneous FTP sessions to the same server.

-B XX
Try setting the TCP/IP socket buffer size to XX bytes.
-W XX
Send raw FTP command XX after logging in.
-X XX
Send raw FTP command XX after each file transferred.
-Y XX
Send raw FTP command XX before logging out.

The -W, -X, and -Y options are useful for advanced users who need to tweak behavior on some servers. For example, users accessing mainframes might need to send some special SITE commands to set blocksize and record format information.

For these options, you can use them multiple times each if you need to send multiple commands. For the -X option, you can use the cookie %s to expand into the name of the file that was transferred.

-o XX
Set advanced option XX.

This option is used primarily for debugging. It sets the value of an internal variable to an integer value. An example usage would be: -o useFEAT=0,useCLNT=1 which in this case, disables use of the FEAT command and enables use of the CLNT command. The available variables include: usePASV, useSIZE, useMDTM, useREST, useNLST_a, useNLST_d, useFEAT, useMLSD, useMLST, useCLNT, useHELP_SITE, useSITE_UTIME, STATfileParamWorks, NLSTfileParamWorks, require20, allowProxyForPORT, doNotGetStartCWD.

Description

The purpose of ncftpget is to do file transfers from the command-line without entering an interactive shell. This lets you write shell scripts or other unattended processes that can do FTP. It is also useful for advanced users who want to retrieve files from the shell command line without entering an interactive FTP program such as ncftp.

One particularly useful feature of this program is that you can give it a uniform resource locator as the only argument and the program will download that file. You can then copy and paste from your web browser or newsreader and use that URL. Example:

$ cd /tmp
$ ncftpget ftp://ftp.ncftp.com/pub/ncftp/ncftp.tar.Z
$ zcat ncftp.tar.Z | tar xf -

By default the program tries to open the remote host and login anonymously, but you can specify a username and password information. The -u option is used to specify the username to login as, and the -p option is used to specify the password. If you are running the program from the shell, you may omit the -p option and the program will prompt you for the password.

Using the -u and -p options are not recommended, because your account information is exposed to anyone who can see your shell script or your process information. For example, someone using the ps program could see your password while the program runs.

You may use the -f option instead to specify a file with the account information. However, this is still not secure because anyone who has read access to the information file can see the account information. Nevertheless, if you choose to use the -f option the file should look something like this:

host sphygmomanometer.ncftp.com
user gleason
pass mypasswd

Don't forget to change the permissions on this file so no one else can read them.

The -d option is very useful when you are trying to diagnose why a file transfer is failing. It prints out the entire FTP conversation to the file you specify, so you can get an idea of what went wrong. If you specify the special name stdout as the name of the debugging output file, the output will instead print to the screen. Example:

$ ncftpget -d stdout bowser.nintendo.co.jp . /pub/ncftp/README
220: FTP server ready.
Connected to bowser.nintendo.co.jp.
Cmd: USER anonymous
331: Guest login ok, send your complete e-mail address as password.
Cmd: PASS xxxxxxxx
230: Welcome!
Logged in to bowser.nintendo.co.jp as anonymous.
Cmd: TYPE I
200: Type set to I.
Cmd: PORT 192,168,9,37,6,76
200: PORT command successful.
Cmd: RETR /pub/README
550: /pub/README: File in use.
Cmd: QUIT
221: Goodbye.

Using ASCII mode is helpful when the text format of your host differs from that of the remote host. For example, if you are retrieving a .TXT file from a Windows-based host to a UNIX system, you could use the -a flag which would use ASCII transfer mode so that the file created on the UNIX system would be in the UNIX text format instead of the MS-DOS text format.

You can retrieve an entire directory tree of files by using the -R flag. However, this will work only if the remote FTP server is a UNIX server, or emulates UNIX's list output. Example:

$ ncftpget -R ftp.ncftp.com /tmp /pub/ncftp

This would create a /tmp/ncftp hierarchy.

Diagnostics

ncftpget returns the following exit values:

  1. Success.
  2. Could not connect to remote host.
  3. Could not connect to remote host - timed out.
  4. Transfer failed.
  5. Transfer failed - timed out.
  6. Directory change failed.
  7. Directory change failed - timed out.
  8. Malformed URL.
  9. Usage error.
  10. Error in login configuration file.
  11. Library initialization failed.
  12. Session initialization failed.

Author

Mike Gleason, NcFTP Software.

See Also

ncftpput(1), ncftpget(1), ncftp(1), ftp(1), rcp(1), tftp(1).

LibNcFTP (http://www.ncftp.com/libncftp/).

ncftp-3.2.6/doc/html/ncftpls.html0000644000000000000000000001773512023657766015556 0ustar rootwheel ncftpls(1) manual page

Name

ncftpls - Internet file transfer program for scripts

Synopsis

ncftpls [options] ftp://url.style/host/path/name/

Options

Command line flags:
-m
Use a machine readable list format, if the server supports it. This requires that the server software support the MLSD extensions, and many implementations do not support these features.
-1
Most basic format, one item per line.
-l
Long list format.
-C
Columnized list format. This is the default list format.
-R
Recurse all subdirectories while listing.
-a
Show all files, if the server allows it (as in /bin/ls -a).
-i XX
Filter the listing (if the server supports it) with the wildcard XX.
-x -XX
List command flags to use on the remote server.
-u XX
Use username XX instead of anonymous.
-p XX
Use password XX with the username.
-P XX
Use port number XX instead of the default FTP service port (21).
-d XX
Use the file XX for debug logging.
-t XX
Timeout after XX seconds.
-E
Use regular (PORT) data connections.
-F
Use passive (PASV) data connections.  The default is to use passive, but to fallback to regular if the passive connection fails or times out.
-r XX
Redial a maximum of XX times until connected to the remote FTP server.
-W XX
Send raw FTP command XX after logging in.
-X XX
Send raw FTP command XX after each file transferred.
-Y XX
Send raw FTP command XX before logging out.

The -W, -X, and -Y options are useful for advanced users who need to tweak behavior on some servers. For example, users accessing mainframes might need to send some special SITE commands to set blocksize and record format information.

For these options, you can use them multiple times each if you need to send multiple commands. For the -X option, you can use the cookie %s to expand into the name of the file that was transferred.

-o XX
Set advanced option XX.

This option is used primarily for debugging. It sets the value of an internal variable to an integer value. An example usage would be: -o useFEAT=0,useCLNT=1 which in this case, disables use of the FEAT command and enables use of the CLNT command. The available variables include: usePASV, useSIZE, useMDTM, useREST, useNLST_a, useNLST_d, useFEAT, useMLSD, useMLST, useCLNT, useHELP_SITE, useSITE_UTIME, STATfileParamWorks, NLSTfileParamWorks, require20, allowProxyForPORT, doNotGetStartCWD.

Description

The purpose of ncftpls is to do remote directory listings using the File Transfer Protocol without entering an interactive shell. This lets you write shell scripts or other unattended processes that can do FTP.

The default behavior is to print the directory listing in columnized format (i.e. ls -CF), but that is not very useful for scripting. This example uses the -1 flag, to print one file per line:

$ ncftpls -1 ftp://ftp.ncftp.com/ncftp/

Better yet, try the machine readable format:

$ ncftpls -m ftp://ftp.ncftp.com/ncftp/
type=cdir;modify=20050407005654;UNIX.mode=0755 /ncftp
type=pdir;modify=20010521005346;UNIX.mode=0755 /
type=dir;modify=20050512221217;UNIX.mode=0755 binaries
type=file;size=95832;modify=19971122045900;UNIX.mode=0644 ncftp-1.9.5.tar.gz
type=file;size=192937;modify=19980320033600;UNIX.mode=0644 ncftp-2.4.3.tar.gz
type=file;size=409722;modify=20050325011837;UNIX.mode=0644 ncftp-3.1.9-src.tar.bz2
type=file;size=516060;modify=20050325011837;UNIX.mode=0644 ncftp-3.1.9-src.tar.gz
type=file;size=655834;modify=20050325011837;UNIX.mode=0644 ncftp-3.1.9-src.zip

Regrettably, many servers won't work with the machine redable option, since they don't support the required FTP server software extensions (MLSD) that make this possible. Also beware that the fields shown may vary, as well as the order. See the official machine readable list format documentation for details.

You can also do a remote "ls -l", by using ncftpls -l. If you want to try other flags (but be careful, the remote server may not support them), you have to use them with the -x flag. For example, if you wanted to do a remote "ls -lrt", you could do this:

$ ncftpls -x "-lrt" ftp://ftp.ncftp.com/ncftp/

If you wanted to filter the listing, say, to show just files that ended in the extension .TXT, you could try the -i flag, like this:

$ ncftpls -1 -i '*.TXT' ftp://ftp.freebsd.org/pub/FreeBSD/

Filtering may not work, since it depends on the FTP server software implementation. Here's a better way which does not depend on the server:

$ ncftpls -1 ftp://ftp.freebsd.org/pub/FreeBSD/ | grep -i '\.TXT$' 

By default the program tries to open the remote host and login anonymously, but you can specify a username and password information like you can with ncftpget or ncftpput.

Note that the standard specifies that URL pathnames are are relative pathnames. For FTP, this means that URLs specify relative pathnames from the start directory, which for user logins, are typically the user's home directory. If you want to use absolute pathnames, you need to include a literal slash, using the "%2F" code for a "/" character. Examples:

$ ncftpls -u linus ftp://ftp.kernel.org/%2Fusr/src/
$ ncftpls ftp://steve@ftp.apple.com/%2Fetc/

Diagnostics

ncftpls returns the following exit values:

  1. Success.
  2. Could not connect to remote host.
  3. Could not connect to remote host - timed out.
  4. Transfer failed.
  5. Transfer failed - timed out.
  6. Directory change failed.
  7. Directory change failed - timed out.
  8. Malformed URL.
  9. Usage error.
  10. Error in login configuration file.
  11. Library initialization failed.
  12. Session initialization failed.

Author

Mike Gleason, NcFTP Software.

See Also

ncftpput(1), ncftpget(1), ncftp(1), ftp(1), rcp(1), tftp(1).

LibNcFTP (http://www.ncftp.com/libncftp/).

ncftp-3.2.6/doc/html/ncftpput.html0000644000000000000000000002435312023660010015712 0ustar rootwheel ncftpput(1) manual page

Name

ncftpput - Internet file transfer program for scripts

Synopsis

ncftpput [options] remote-host remote-directory local-files...

ncftpput [options] bookmark-name remote-directory local-files...

ncftpput -f login.cfg [options] remote-directory local-files...

ncftpput -c remote-host remote-path-name < stdin

ncftpput -C remote-host local-path-name remote-path-name

Options

Command line flags:
-u XX
Use username XX instead of anonymous.
-p XX
Use password XX with the username.
-P XX
Use port number XX instead of the default FTP service port (21).
-j XX
Use account XX in supplement to the username and password (deprecated).
-d XX
Use the file XX for debug logging.
-a
Use ASCII transfer type instead of binary.
-m
Attempt to make the remote destination directory before copying.
-t XX
Timeout after XX seconds.
-U XX
Use value XX for the umask.
-v/-V
Do (do not) use progress meters. The default is to use progress meters if the output stream is a TTY.
-f XX
Read the file XX for host, user, and password information.
-c
Read locally from standard input and write remotely to specified pathname.
-C
Similar to -c, except a local pathname is specified rather than reading from standard input.
-A
Append to remote files, instead of overwriting them.
-T XX
Upload into temporary files prefixed by XX.
-S XX
Upload into temporary files suffixed by XX.
-R
Recursive mode; copy whole directory trees.
-r XX
Redial a maximum of XX times until connected to the remote FTP server.
-z/-Z
Do (do not) try to resume transfers. The default is to not try to resume (-Z).
-E
Use regular (PORT) data connections.
-F
Use passive (PASV) data connections.  The default is to use passive, but to fallback to regular if the passive connection fails or times out.
-DD
Delete local file after successfully uploading it.
-y
Try using "SITE UTIME" to preserve timestamps on remote host. Not many remote FTP servers support this, so it may not work.
-b
Run in background (by submitting a job to ncftpbatch).
-bb
Similar to -b option, but only submits the batch job. You will need to run ncftpbatch for the batch job to be processed. This is useful if you already have a ncftpbatch process running, or wish to have better control of when batch jobs are processed.

For example, if you wanted to do background processing of three files all on the same remote server, it is more polite to use just one ncftpbatch process to process the three jobs sequentially, rather than having three ncftpbatch processes open three simultaneous FTP sessions to the same server.

-B XX
Try setting the TCP/IP socket buffer size to XX bytes.
-W XX
Send raw FTP command XX after logging in.
-X XX
Send raw FTP command XX after each file transferred.
-Y XX
Send raw FTP command XX before logging out.

The -W, -X, and -Y options are useful for advanced users who need to tweak behavior on some servers. For example, users accessing mainframes might need to send some special SITE commands to set blocksize and record format information.

For these options, you can use them multiple times each if you need to send multiple commands. For the -X option, you can use the cookie %s to expand into the name of the file that was transferred.

-o XX
Set advanced option XX.

This option is used primarily for debugging. It sets the value of an internal variable to an integer value. An example usage would be: -o useFEAT=0,useCLNT=1 which in this case, disables use of the FEAT command and enables use of the CLNT command. The available variables include: usePASV, useSIZE, useMDTM, useREST, useNLST_a, useNLST_d, useFEAT, useMLSD, useMLST, useCLNT, useHELP_SITE, useSITE_UTIME, STATfileParamWorks, NLSTfileParamWorks, require20, allowProxyForPORT, doNotGetStartCWD.

Description

The purpose of ncftpput is to do file transfers from the command-line without entering an interactive shell. This lets you write shell scripts or other unattended processes that can do FTP. It is also useful for advanced users who want to send files from the shell command line without entering an interactive FTP program such as ncftp.

By default the program tries to open the remote host and login anonymously, but you can specify a username and password information. The -u option is used to specify the username to login as, and the -p option is used to specify the password. If you are running the program from the shell, you may omit the -p option and the program will prompt you for the password.

Using the -u and -p options are not recommended, because your account information is exposed to anyone who can see your shell script or your process information. For example, someone using the ps program could see your password while the program runs.

You may use the -f option instead to specify a file with the account information. However, this is still not secure because anyone who has read access to the information file can see the account information. Nevertheless, if you choose to use the -f option the file should look something like this:

host sphygmomanometer.ncftp.com
user gleason
pass mypasswd
Don't forget to change the permissions on this file so no one else can read them.

The -d option is very useful when you are trying to diagnose why a file transfer is failing. It prints out the entire FTP conversation to the file you specify, so you can get an idea of what went wrong. If you specify the special name stdout as the name of the debugging output file, the output will instead print to the screen.

Using ASCII mode is helpful when the text format of your host differs from that of the remote host. For example, if you are sending a text file from a UNIX system to a Windows-based host, you could use the -a flag which would use ASCII transfer mode so that the file created on the Windows machine would be in its native text format instead of the UNIX text format.

You can upload an entire directory tree of files by using the -R flag. Example:

$ ncftpput -R pikachu.nintendo.co.jp /incoming /tmp/stuff
This would create a /incoming/stuff hierarchy on the remote host.

The -T and -S options are useful when you want to upload file to the remote host, but you don't want to use the destination pathname until the file is complete. Using these options, you will not destroy a remote file by the same name until your file is finished. These options are also useful when a remote process on the remote host polls a specific filename, and you don't want that process to see that file until you know the file is finished sending. Here is an example that uploads to the file /pub/incoming/README, using the filename /pub/incoming/README.tmp as a temporary filename:

$ ncftpput -S .tmp bowser.nintendo.co.jp /pub/incoming /a/README

A neat way to pipe the output from any local command into a remote file is to use the -c option, which denotes that you're using stdin as input. The following example shows how to make a backup and store it on a remote machine:

$ tar cf - / | ncftpput -c sonic.sega.co.jp /usr/local/backup.tar

Diagnostics

ncftpput returns the following exit values:

  1. Success.
  2. Could not connect to remote host.
  3. Could not connect to remote host - timed out.
  4. Transfer failed.
  5. Transfer failed - timed out.
  6. Directory change failed.
  7. Directory change failed - timed out.
  8. Malformed URL.
  9. Usage error.
  10. Error in login configuration file.
  11. Library initialization failed.
  12. Session initialization failed.

Author

Mike Gleason, NcFTP Software.

See Also

ncftpput(1), ncftpget(1), ncftp(1), ftp(1), rcp(1), tftp(1).

LibNcFTP (http://www.ncftp.com/libncftp/).

ncftp-3.2.6/doc/html/ncftpspooler.html0000644000000000000000000003346512023660021016573 0ustar rootwheel ncftpspooler(1) manual page

Name

    ncftpspooler - Global batch FTP job processor daemon

Synopsis

    ncftpspooler -d [options]

    ncftpspooler -l [options]

Options

Command line flags:

    -d
    Begin background processing of FTP jobs in the designated FTP job queue directory.

    -D
    This is like -d, except that the process does not become a background daemon process.
    -q XX
    Use this option to specify a directory to use as the FTP job queue instead of the default directory, /var/spool/ncftp.

    -o XX
    Use this option to specify a filename to use as the log file. By default, (and rather inappropriately) the program simply uses a file called log in the job queue directory. If you don't want a log, use this option to specify /dev/null.

    -l
    Lists the contents of the job queue directory.

    -s XX
    When the job queue is empty, the program sleeps 120 seconds and then checks again to see if a new job has been submitted. Use this option to change the number of seconds used for this delay.

Description

The ncftpspooler program evolved from the ncftpbatch program. The ncftpbatch program was originally designed as a ``personal FTP spooler'' which would process a single background job a particular user and exit when it finished; the ncftpspooler program is a ``global FTP spooler'' which stays running and processes background jobs as they are submitted.

The job queue directory is monitored for specially-named and formatted text files. Each file serves as a single FTP job. The name of the job file contains the type of FTP job (get or put), a timestamp indicating the earliest the job should be processed, and optionally some additional information to make it easier to create unique job files (i.e. a sequence number). The contents of the job files have information such as the remote server machine to FTP to, username, password, remote pathname, etc.

Your job queue directory must be readable and writable by the user that you plan to run ncftpspooler as, so that jobs can be removed or renamed within the queue.

More importantly, the user that is running the program will need adequate privileges to access the local files that are involved in the FTPing. I.e., if your spooler is going to be processing jobs which upload files to remote servers, then the user will need read permission on the local files that will be uploaded (and directory access permission the parent directories). Likewise, if your spooler is going to be processing jobs which download files, then the user would need to be able to write to the local directories.

Once you have created your spool directory with appropriate permissions and ownerships, you can run ncftpspooler -d to launch the spooler daemon. You can run additional spoolers if you want to process more than FTP job from the same job queue directory simultaneously. You can then monitor the log file (i.e., using tail -f ) to track the progress of the spooler. Most of the time it won't be doing anything, unless job files have appeared in the job queue directory.

Job File Names

When the ncftpspooler program monitors the job queue directory, it ignores any files that do not follow the naming convention for job files. The job files must be prefixed in the format of X-YYYYMMDD-hhmmss where X denotes a job type, YYYY is the four-digit year, MM is the two-digit month number, DD is the two-digit day of the month, hh is the two-digit hour of the day (00-23), mm is the two-digit minute, and ss is the two-digit second. The date and time represent the earliest time you want the job to be run.

The job type can be g for a get (download from remote host), or p for aput (upload to remote host).

As an example, if you wanted to schedule an upload to occur at 11:45 PM on December 7, 2001, a job file could be named

    p-20011207-234500

In practice, the job files include additional information such as a sequence number or process ID. This makes it easier to create unique job file names. Here is the same example, with a process ID and a sequence number:

    p-20011207-234500-1234-2

When submitting job files to the queue directory, be sure to use a dash character after the hhmmss field if you choose to append any additional data to the job file name.

Job File Contents

Job files are ordinary text files, so that they can be created by hand. Each line of the file is a key-pair in the format variable=value, or is a comment line beginning with an octothorpe character (#), or is a blank line. Here is an example job file:

    # This is a NcFTP spool file entry.
    job-name=g-20011016-100656-008299-1
    op=get
    hostname=ftp.freebsd.org
    xtype=I
    passive=1
    remote-dir=pub/FreeBSD
    local-dir=/tmp
    remote-file=README.TXT
    local-file=readme.txt
    

Job files are flexible since they follow an easy-to-use format and do not have many requirements, but there are a few mandatory parameters that must appear for the spooler to be able to process the job.

    op
    The operation (job type) to perform. Valid values are get and put.

    hostname
    The remote host to FTP to. This may be an IP address or a DNS name (i.e. ftp.example.com).

For a regular get job, these parameters are required:

    remote-file
    The pathname of the file to download from the remote server.

    local-file
    The pathname to use on the local server for the downloaded file.

For a regular put job, these parameters are required:

    local-file
    The pathname of the file to upload to the remote server.

    remote-file
    The pathname to use on the remote server for the uploaded file.

For a recursive get job, these parameters are required:

    remote-file
    The pathname of the file or directory to download from the remote server.

    local-dir
    The directory pathname to use on the local server to contain the downloaded items.

For a recursive put job, these parameters are required:

    local-file
    The pathname of the file or directory to upload to the remote server.

    remote-dir
    The directory pathname to use on the remote server to contain the uploaded items.

The rest of the parameters are optional. The spooler will attempt to use reasonable defaults for these parameters if necessary.

    user
    The username to use to login to the remote server. Defaults to ``anonymous'' for guest access.

    pass
    The password to use in conjunction with the username to login to the remote server.

    acct
    The account to use in conjunction with the username to login to the remote server. The need to specify this parameter is extremely rare.

    port
    The port number to use in conjunction with the remote hostname to connect to the remote server. Defaults to the standard FTP port number, 21.

    host-ip
    The IP address to use in conjunction with the remote hostname to connect to the remote server. This parameter can be used in place of the host_name parameter, but one or the other must be used. This parameter is commonly included along with the hostname parameter as supplemental information.

    xtype
    The transfer type to use. Defaults to binary transfer type (TYPE I). Valid values are I for binary, A for ASCII text.

    passive
    Whether to use FTP passive data connections (PASV) or FTP active data connections (PORT). Valid values are 0 for active, 1 for passive, or 2 to try passive, then fallback to active. The default is 2.

    recursive
    This can be used to transfer entire directory trees. By default, only a single file is transferred. Valid values are yes or no.

    delete
    This can be used to delete the source file on the source machine after successfully transferring the file to the destination machine. By default, source files are not deleted. Valid values are yes or no.

    job-name
    This isn't used by the program, but can be used by an entity which is automatically generating job files. As an example, when using the -bbb flag with ncftpput, it creates a job file on stdout with a job-name parameter so you can easily copy the file to the job queue directory with the suggested job name as the job file name.

    pre-ftp-command
    post-ftp-command
    These parameters correspond to the -W, and -Y options of ncftpget and ncftpput. It is important to note that these refer to RFC959 File Transfer Protocol commands and not shell commands, nor commands used from within /usr/bin/ftp or ncftp.

    pre-shell-command
    post-shell-command
    These parameters provide hooks so you can run a custom program when an item is processed by the spooler. Valid values are pathnames to scripts or executable programs. Note that the value must not contain any command-line arguments -- if you want to do that, create a shell script and have it run your program with the command-line arguments it requires.

Generally speaking, post-shell-command is much more useful than pre-shell-command since if you need to use these options you're more likely to want to do something after the FTP transfer has completed rather than before. For example, you might want to run a shell script which pages an administrator to notify her that her 37 gigabyte file download has completed.

When your custom program is run, it receives on standard input the contents of the job file (i.e. several lines of variable=value key-pairs), as well as additional data the spooler may provide, such as a result key-pair with a textual description of the job's completion status.

post-shell-command update a log file named /var/log/ncftp_spooler.

    #!/usr/bin/perl -w
    
    use strict;
    
    my ($line);
    my (%params) = ();
    
    while (defined($line = <STDIN>)) {
    	$params{$1} = $2 if ($line =~ /^([^=\#\s]+)=(.*)/);
    }
    
    if ((defined($params{"result"})) && ($params{"result"} =~ /^Succeeded/)) {
    	open(LOG, ">> /var/log/ncftp_spooler.log") or exit(1);
    	print LOG "DOWNLOAD" if ($params{"op"} eq "get");
    	print LOG "UPLOAD" if ($params{"op"} eq "put");
    	print LOG " ", $params{"local-file"}, "\n";
    	close(LOG);
    }
    

Diagnostics

The log file should be examined to determine if any ncftpspooler processes are actively working on jobs. The log contains copious amounts of useful information, including the entire FTP control connection conversation between the FTP client and server.

Bugs

The recursive option may not be reliable since ncftpspooler depends on functionality which may or may not be present in the remote server software. Additionally, even if the functionality is available, ncftpspooler may need to use heuristics which cannot be considered 100% accurate. Therefore it is best to create individual jobs for each file in the directory tree, rather than a single recursive directory job.

For resumption of downloads to work, the remote server must support the FTP SIZE and MDTM primitives. Most modern FTP server software can do this, but there are still a number of bare-bones ftpd implementations which do not. In these cases, ncftpspooler will re-download the file in entirety each time until the download succeeds.

The program needs to be improved to detect jobs that have no chance of ever completing successfully. There are still a number of cases where jobs can get spooled but get retried over and over again until a vigilant sysadmin manually removes the jobs.

The spool files may contain usernames and passwords stored in cleartext. These files should not be readable by any user except the user running the program!

Author

Mike Gleason, NcFTP Software.

See Also

ncftpput(1), ncftpget(1), ncftp(1), ftp(1), rcp(1), tftp(1).

LibNcFTP (http://www.ncftp.com/libncftp/).

ncftp-3.2.6/doc/LICENSE.txt0000644000000000000000000001456010465207715014060 0ustar rootwheel The Clarified Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder as specified below. "Copyright Holder" is whoever is named in the copyright or copyrights for the package. "You" is you, if you're thinking about copying or distributing this Package. "Distribution fee" is a fee you charge for providing a copy of this Package to another party. "Freely Available" means that no fee is charged for the right to use the item, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain, or those made Freely Available, or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major network archive site allowing unrestricted access to them, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. e) permit and encourage anyone who receives a copy of the modified Package permission to make your modifications Freely Available in some specific way. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) give non-standard executables non-standard names, and clearly document the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. e) offer the machine-readable source of the Package, with your modifications, by mail order. 5. You may charge a distribution fee for any distribution of this Package. If you offer support for this Package, you may charge any fee you choose for that support. You may not charge a license fee for the right to use this Package itself. You may distribute this Package in aggregate with other (possibly commercial and possibly nonfree) programs as part of a larger (possibly commercial and possibly nonfree) software distribution, and charge license fees for other parts of that software distribution, provided that you do not advertise this Package as a product of your own. If the Package includes an interpreter, You may embed this Package's interpreter within an executable of yours (by linking); this shall be construed as a mere form of aggregation, provided that the complete Standard Version of the interpreter is so embedded. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whoever generated them, and may be sold commercially, and may be aggregated with this Package. If such scripts or library files are aggregated with this Package via the so-called "undump" or "unexec" methods of producing a binary executable image, then distribution of such an image shall neither be construed as a distribution of this Package nor shall it fall under the restrictions of Paragraphs 3 and 4, provided that you do not represent such an executable image as a Standard Version of this Package. 7. C subroutines (or comparably compiled subroutines in other languages) supplied by you and linked into this Package in order to emulate subroutines and variables of the language defined by this Package shall not be considered part of this Package, but are the equivalent of input as in Paragraph 6, provided these subroutines do not change the language in any way that would cause it to fail the regression tests for the language. 8. Aggregation of the Standard Version of the Package with a commercial distribution is always permitted provided that the use of this Package is embedded; that is, when no overt attempt is made to make this Package's interfaces visible to the end user of the commercial distribution. Such use shall not be construed as a distribution of this Package. 9. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End ncftp-3.2.6/doc/Location_of_Programs_is_C_Windows.txt0000644000000000000000000000065411360746320021545 0ustar rootwheelThe executables (ncftp.exe, ncftpget.exe, ncftpput.exe, etc.) are installed in %windir%, e.g., C:\Windows or C:\Winnt. This directory was chosen solely for the reason that it is in the Path environment variable, so that the programs can be easily invoked from with Command Prompt without typing the full pathname. You may move them to another directory if desired. There is no dependence on the installation directory. ncftp-3.2.6/doc/man/0000755000000000000000000000000013021063722012767 5ustar rootwheelncftp-3.2.6/doc/man/ncftp.10000644000000000000000000010527211356713675014214 0ustar rootwheel.\"------- .\" Man page portability notes .\" .\" These are some notes on conventions to maintain for greatest .\" portability of this man page to various other versions of .\" nroff. .\" .\" When you want a \ to appear in the output, use \e in the man page. .\" (NOTE this comes up in the rc grammar, where to print out '\n' the .\" man page must contain '\en'.) .\" .\" Evidently not all versions of nroff allow the omission of the .\" terminal " on a macro argument. Thus what could be written .\" .\" .Cr "exec >[2] err.out .\" .\" in true nroffs must be written .\" .\" .Cr "exec >[2] err.out" .\" .\" instead. .\" .\" Use symbolic font names (e.g. R, I, B) instead of the standard .\" font positions 1, 2, 3. Note that for Xf to work the standard .\" font names must be single characters. .\" .\" Note that sentences should end at the end of a line. nroff and .\" troff will supply the correct intersentence spacing, but only if .\" the sentences end at the end of a line. Explicit spaces, if given, .\" are apparently honored and the normal intersentence spacing is .\" supressed. .\" .\" DaviD W. Sanderson .\"------- .\" Dd distance to space vertically before a "display" .\" These are what n/troff use for interparagraph distance .\"------- .if t .nr Dd .4v .if n .nr Dd 1v .\"------- .\" Sp space down the interparagraph distance .\"------- .de Sp .sp \\n(Ddu .. .\"------- .\" Ds begin a display, indented .5 inches from the surrounding text. .\" .\" Note that uses of Ds and De may NOT be nested. .\"------- .de Ds .Sp .in +0.5i .nf .. .\"------- .\" De end a display (no trailing vertical spacing) .\"------- .de De .fi .in .. .\"------- .\" Xs begins a display paragraph, indented .5 inches from the surrounding .\" text. Same as Ds, almost. .\"------- .de Xs .IP .in +0.5i .nf .. .\"------- .\" Xe end a display (no trailing vertical spacing) .\"------- .de Xe .fi .in .IP .. .TH ncftp 1 "NcFTP Software" ncftp .SH NAME ncftp - Browser program for the File Transfer Protocol .SH "SYNOPSIS" .PP .B ncftp .RI [ "host" ] .PP .B ncftp .RI [ "ftp://host.name/directory/" ] .\"------- .SH "DESCRIPTION" .\"------- .PP The purpose of .I ncftp is to provide a powerful and flexible interface to the Internet standard .IR "File Transfer Protocol" . It is intended to replace the stock .I ftp program that comes with the system. .PP Although the program appears to be rather spartan, you'll find that .I ncftp has a wealth of valuable performance and usage features. The program was designed with an emphasis on usability, and it does as much as it can for you automatically so you can do what you expect to do with a file transfer program, which is transfer files between two interconnected systems. .PP Some of the cooler features include progress meters, filename completion, command-line editing, background processing, auto-resume downloads, bookmarking, cached directory listings, host redialing, working with firewalls and proxies, downloading entire directory trees, etc., etc. .PP The .I ncftp distribution comes with the useful utility programs .IR ncftpget "(1)" and .IR ncftpput "(1)" which were designed to do command-line FTP. In particular, they are very handy for shell scripts. This version of .I ncftp no longer does command-line FTP, since the main .I ncftp program is more of a browser-type program. .\"------- .SS "OPTIONS" .\"------- The program allows you to specify a host or directory URL on the command line. This is a synonym for running .I ncftp and then using the .I open command. A few command-line flags are allowed with this mode: .TP 8 .BI "-u " "XX" Use username .I XX instead of anonymous. .TP 8 .BI "-p " "XX" Use password .I XX with the username. .TP 8 .BI "-j " "XX" Use account .I XX in supplement to the username and password (deprecated). .TP 8 .BI "-P " "XX" Use port number .I XX instead of the default FTP service port (21). .\"------- .SS "INTRODUCTION TO THE COMMAND SHELL" .\"------- .PP Upon running the program you are presented a command prompt where you type commands to the program's shell. Usually you will want to open a remote filesystem to transfer files to and from your local machine's filesystem. To do that, you need to know the symbolic name of the remote system, or its .I "Internet Protocol" (IP) address. For example, a symbolic name might be ``typhoon\.unl\.edu,'' and its IP address could be ``129.93.33.24.'' To open a connection to that system, you use the program's .I open command: .Ds open typhoon.unl.edu open 129.93.33.24 .De .PP Both of these try to open the machine called typhoon at the .IR "University of Nebraska" "." Using the symbolic name is the preferred way, because IP addresses may change without notice, while the symbolic names usually stay the same. .PP When you open a remote filesystem, you need to have permission. The .IR "FTP Protocol" "'s" authentication system is very similar to that of logging in to your account. You have to give an account name, and its password for access to that account's files. However, most remote systems that have anything you might be interested in don't require an account name for use. You can often get anonymous access to a remote filesystem and exchange files that have been made publicly accessible. The program attempts to get anonymous permission to a remote system by default. What actually happens is that the program tries to use ``anonymous'' as the account name, and when prompted for a password, uses your E-mail address as a courtesy to the remote system's maintainer. You can have the program try to use a specific account also. That will be explained later. .PP After the .I open command completes successfully, you are connected to the remote system and logged in. You should now see the command prompt change to reflect the name of the current remote directory. To see what's in the current remote directory, you can use the program's .IR "ls" " and " "dir" commands. The former is terse, preferring more remote files in less screen space, and the latter is more verbose, giving detailed information about each item in the directory. .PP You can use the program's .IR cd command to move to other directories on the remote system. The cd command behaves very much like the command of the same name in the .IR "Bourne" " and " "Korn" " shell." .PP The purpose of the program is to exchange data with other systems. You can use the program's .IR get command to copy a file from the remote system to your local system: .Ds get README.txt .De .PP The program will display the progress of the transfer on the screen, so you can tell how much needs to be done before the transfer finishes. When the transfer does finish, then you can enter more commands to the program's command shell. .PP You can use the program's .IR put command to copy a file from your system to the remote system: .Ds put something.tar .De .PP When you are finished using the remote system, you can open another one or use the .IR quit .PP Before quitting, you may want to save the current FTP session's settings for later. You can use the .IR bookmark command to save an entry into your $HOME/.ncftp/bookmarks file. When you use the .I bookmark command, you also specify a bookmark name, so the next time instead of opening the full hostname you can use the name of the bookmark. A bookmark acts just like one for your web browser, so it saves the remote directory you were in, the account name you used, etc., and other information it learned so that the next time you use the bookmark it should require as little effort from you as possible. .\"------- .SS "COMMAND REFERENCE" .\"------- .IP help The first command to know is .IR help "." If you just type .Xs help .Xe from the command shell, the program prints the names of all of the supported commands. From there, you can get specific help for a command by typing the command after, for example: .Xs help open .Xe prints information about the .I open command. .\"------- .IP ascii .\"------- This command sets the transfer type to ASCII text. This is useful for text-only transfers because the concept of text files differs between operating systems. For example on UNIX, a text file denotes line breaks with the linefeed character, while on MS-DOS a line break is denoted by both a carriage return character and a line feed character. Therefore, for data transfers that you consider the data as text you can use .I ascii to ensure that both the remote system and local system translate accordingly. The default transfer type that .I ncftp uses is not ASCII, but straight binary. .\"------- .IP "bgget and bgput" .\"------- These commands correspond to the .IR get " and " put commands explained below, except that they do the job in the background. Normally when you do a .I get then the program does the download immediately, and does not return control to you until the download completes. The background transfers are nice because you can continue browsing the remote filesystem and even open other systems. In fact, they are done by a daemon process, so even if you log off your UNIX host the daemon should still do your transfers. The daemon will also automatically continue to retry the transfers until they finish. To tell when background jobs have finished, you have to examine the .I $HOME/.ncftp/spool/log file, or run the .I jobs command from within .IR NcFTP "." .IP Both the .IR bgget " and " bgput commands allow you to schedule when to do the transfers. They take a ``\-@'' parameter, whose argument is a date of the form YYYYMMDDhhmmss (four digit year, month, day, hour, minute, second). For example, to schedule a download at 3 AM on November 6, you could try: .Xs bgget \-@ 19971106030000 /pub/idstuff/quake/q2_100\.zip .De .\"------- .IP bgstart .\"------- This command tells .I ncftp to immediately start the background transfers you've requested, which simply runs a copy of the .I ncftpbatch program which is responsible for the background jobs. Normally the program will start the background job as soon as you close the current site, open a new site, or quit the program. The reason for this is because since so many users still use slow dialup links that starting the transfers would slow things to a crawl, making it difficult to browse the remote system. An added bonus of starting the background job when you close the site is that .I ncftp can pass off that open connection to the .I ncftpbatch program. That is nice when the site is always busy, so that the background job doesn't have to wait and get re-logged on to do its job. .\"------- .IP binary .\"------- Sets the transfer type to raw binary, so that no translation is done on the data transferred. This is the default anyway, since most files are in binary. .\"------- .IP bookmark .\"------- Saves the current session settings for later use. This is useful to save the remote system and remote working directory so you can quickly resume where you left off some other time. The bookmark data is stored in your .I $HOME/.ncftp/bookmarks file. .\"------- .IP bookmarks .\"------- Lists the contents of your .I $HOME/.ncftp/bookmarks file in a human-readable format. You can use this command to recall the bookmark name of a previously saved bookmark, so that you can use the .I open command with it. .\"------- .IP cat .\"------- Acts like the ``/bin/cat'' .I UNIX command, only for remote files. This downloads the file you specify and dumps it directly to the screen. You will probably find the .I page command more useful, since that lets you view the file one screen at a time instead of printing the entire file at once. .\"------- .IP cd .\"------- Changes the working directory on the remote host. Use this command to move to different areas on the remote server. If you just opened a new site, you might be in the root directory. Perhaps there was a directory called ``/pub/news/comp\.sources\.d'' that someone told you about. From the root directory, you could: .Xs cd pub cd news cd comp.sources.d .Xe or, more concisely, .Xs cd /pub/news/comp.sources.d .Xe Then, commands such as .IR "get" ", " "put" ", and " "ls" could be used to refer to items in that directory. .IP Some shells in the .I UNIX environment have a feature I like, which is switching to the previous directory. Like those shells, you can do: .Xs cd - .Xe to change to the last directory you were in. .\"------- .IP chmod .\"------- Acts like the ``/bin/chmod'' .I UNIX command, only for remote files. However, this is not a standard command, so remote FTP servers may not support it. .\"------- .IP close .\"------- Disconnects you from the remote server. The program does this for you automatically when needed, so you can simply open other sites or quit the program without worrying about closing the connection by hand. .\"------- .IP debug .\"------- This command is mostly for internal testing. You could type .Xs debug 1 .Xe to turn debugging mode on. Then you could see all messages between the program and the remote server, and things that are only printed in debugging mode. However, this information is also available in the .I $HOME/.ncftp/trace file, which is created each time you run .IR ncftp "." If you need to report a bug, send a .I trace file if you can. .\"------- .IP dir .\"------- Prints a detailed directory listing. It tries to behave like .IR UNIX "'s" ``/bin/ls -l'' command. If the remote server seems to be a .I UNIX host, you can also use the same flags you would with .IR "ls" ", for instance" .Xs dir -rt .Xe would try to act like .Xs /bin/ls -lrt .Xe would on .IR UNIX "." .\"------- .IP edit .\"------- Downloads into a temporary file for editing on the local host, then uploads the changed file back to the remote host. .\"------- .IP get .\"------- Copies files from the current working directory on the remote host to your machine's current working directory. To place a copy of ``README'' and ``README.too'' in your local directory, you could try: .Xs get README README.too .Xe You could also accomplish that by using a wildcard expression, such as: .Xs get README* .Xe This command is similar to the behavior of other FTP programs' .I mget command. To retrieve a remote file but give it a different name on your host, you can use the ``\-z'' flag. This example shows how to download a file called .I ReadMe.txt but name it locally as .IR README ":" .Xs get -z ReadMe.txt README .Xe The program tries to ``resume'' downloads by default. This means that if the remote FTP server lost the connection and was only able to send 490 kilobytes of a 500 kilobyte file, you could reconnect to the FTP server and do another .I get on the same file name and it would get the last 10 kilobytes, instead of retrieving the entire file again. There are some occasions where you may not want that behavior. To turn it off you can use the ``\-f'' flag. .IP There are also times where you want to append to an existing file. You can do this by using the ``\-A'' flag, for example .Xs get -A log.11 .Xe would append to a file named ``log\.11'' if it existed locally. .IP Another thing you can do is delete a remote file after you download it. This can be useful when a remote host expects a file to be removed when it has been retrieved. Use the double\-D flag, such as ``get\ \-DD'' to do this. .IP The .I get command lets you retrieve entire directory trees, too. Although it may not work with some remote systems, you can try ``get\ \-R'' with a directory to download the directory and its contents. .IP When using the ``\-R'' flag, you can also use the ``\-T'' flag to disable automatic on-the-fly TAR mode for downloading whole directory trees. The program uses TAR whenever possible since this usually preserves symbolic links and file permissions. TAR mode can also result in faster transfers for directories containing many small files, since a single data connection can be used rather than an FTP data connection for each small file. The downside to using TAR is that it forces downloading of the whole directory, even if you had previously downloaded a portion of it earlier, so you may want to use this option if you want to resume downloading of a directory. .\"------- .IP jobs .\"------- Views the list of currently executing .I NcFTP background tasks. This actually just runs .I ncftpbatch \-l for you. .\"------- .IP lcd .\"------- The .I lcd command is the first of a few ``l'' commands that work with the local host. This changes the current working directory on the local host. If you want to download files into a different local directory, you could use .I lcd to change to that directory and then do your downloads. .\"------- .IP lchmod .\"------- Runs ``/bin/chmod'' on the local host. .\"------- .IP lls .\"------- Another local command that comes in handy is the .I lls command, which runs ``/bin/ls'' on the local host and displays the results in the program's window. You can use the same flags with .I lls as you would in your command shell, so you can do things like: .Xs lcd ~/doc lls -lrt p*.txt .De .\"------- .IP lmkdir .\"------- Runs ``/bin/mkdir'' on the local host. .\"------- .IP lookup .\"------- The program also has a built-in interface to the name service via the .I lookup command. This means you can lookup entries for remote hosts, like: .Xs lookup cse.unl.edu ftp.cs.unl.edu sphygmomanometer.unl.edu .Xe prints: .Xs cse\.unl\.edu\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 129\.93\.33\.1 typhoon\.unl\.edu\ \ \ \ \ \ \ \ \ \ \ 129\.93\.33\.24 sphygmomanometer\.unl\.edu\ \ 129\.93\.33\.126 .Xe There is also a more detailed option, enabled with ``\-v,'' i.e.: .Xs lookup -v cse.unl.edu ftp.cs.unl.edu .Xe prints: .Xs cse.unl.edu: \ \ \ \ Name:\ \ \ \ \ cse\.unl.edu \ \ \ \ Address:\ \ 129\.93.33.1 ftp\.cs.unl.edu: \ \ \ \ Name:\ \ \ \ \ typhoon\.unl.edu \ \ \ \ Alias:\ \ \ \ ftp\.cs.unl.edu \ \ \ \ Address:\ \ 129\.93.33.24 .Xe You can also give .I IP addresses, so this would work too: .Xs lookup 129.93.33.24 .Xe prints: .Xs typhoon\.unl\.edu\ \ \ \ \ \ \ \ \ \ \ 129\.93\.33\.24 .De .\"------- .IP lpage .\"------- Views a local file one page at a time, with your preferred $PAGER program. .\"------- .IP lpwd .\"------- Prints the current local directory. Use this command when you forget where you are on your local machine. .\"------- .IP lrename .\"------- Runs ``/bin/mv'' on the local host. .\"------- .IP lrm .\"------- Runs ``/bin/rm'' on the local host. .\"------- .IP lrmdir .\"------- Runs ``/bin/rmdir'' on the local host. .\"------- .IP ls .\"------- Prints a directory listing from the remote system. It tries to behave like .IR UNIX "'s" ``/bin/ls\ \-CF'' command. If the remote server seems to be a .I UNIX host, you can also use the same flags you would with .IR "ls" ", for instance" .Xs ls -rt .Xe would try to act like .Xs /bin/ls -CFrt .Xe would on .IR UNIX "." .IP .I ncftp has a powerful built-in system for dealing with directory listings. It tries to cache each one, so if you list the same directory, odds are it will display instantly. Behind the scenes, .I ncftp always tries a long listing, and then reformats it as it needs to. So even if your first listing of a directory was a regular ``ls'' which displayed the files in columns, your next listing could be ``ls\ \-lrt'' and .I ncftp would still use the cached directory listing to quickly display the information for you! .\"------- .IP mkdir .\"------- Creates a new directory on the remote host. For many public archives, you won't have the proper access permissions to do that. .\"------- .IP open .\"------- Establishes an FTP control connection to a remote host. By default, .I ncftp logs in anonymously to the remote host. You may want to use a specific user account when you log in, so you can use the ``\-u'' flag to specify which user. This example shows how to .I open the host ``bowser\.nintendo\.co\.jp'' using the username ``mario:'' .Xs open -u mario bowser.nintendo.co.jp .De .IP Here is a list of options available for use with the .I open command: .IP .BI "-u " "XX" Use username .I XX instead of anonymous. .IP .BI "-p " "XX" Use password .I XX with the username. .IP .BI "-j " "XX" Use account .I XX in supplement to the username and password (deprecated). .IP .BI "-P " "XX" Use port number .I XX instead of the default FTP service port (21). .\"------- .IP page .\"------- Browses a remote file one page at a time, using your $PAGER program. This is useful for reading README's on the remote host without downloading them first. .\"------- .IP "pdir and pls" .\"------- These commands are equivalent to .IR "dir" " and " "ls" respectively, only they feed their output to your pager. These commands are useful if the directory listing scrolls off your screen. .\"------- .IP put .\"------- Copies files from the local host to the remote machine's current working directory. To place a copy of ``xx.zip'' and ``yy.zip'' in the remote directory, you could try: .Xs put xx.zip yy.zip .Xe You could also accomplish that by using a wildcard expression, such as: .Xs put *.zip .Xe This command is similar to the behavior of other FTP programs' .I mput command. To send a remote file but give it a different name on your host, you can use the ``\-z'' flag. This example shows how to upload a file called ``ncftpd\-2\.0\.6\.tar\.gz'' but name it remotely as ``NFTPD206\.TGZ:'' .Xs put -z ncftpd-2.0.6.tar.gz NFTPD206.TGZ .Xe The program .I does not try to ``resume'' uploads by default. If you do want to resume an upload, use the ``\-z'' flag. .IP There are also times where you want to append to an existing remote file. You can do this by using the ``\-A'' flag, for example .Xs put -A log11.txt .Xe would append to a file named ``log11\.txt'' if it existed on the remote server. .IP Another thing you can do is delete a local file after you upload it. Use the double\-D flag, such as ``put\ \-DD'' to do this. .IP The .I put command lets you send entire directory trees, too. It should work on all remote systems, so you can try ``put\ \-R'' with a directory to upload the directory and its contents. .\"------- .IP pwd .\"------- Prints the current remote working directory. A portion of the pathname is also displayed in the shell's prompt. .\"------- .IP quit .\"------- Of course, when you finish using the program, type .I quit to end the program (You could also use .IR "bye" ", " "exit" ", or " "^D" ")." .\"------- .IP quote .\"------- This can be used to send a direct .I FTP Protocol command to the remote server. Generally this isn't too useful to the average user. .\"------- .IP rename .\"------- If you need to change the name of a remote file, you can use the .I rename command, like: .Xs rename SPHYGMTR.TAR sphygmomanometer-2.3.1.tar .De .\"------- .IP rhelp .\"------- Sends a help request to the remote server. The list of .I FTP Protocol commands is often printed, and sometimes some other information that is actually useful, like how to reach the site administrator. .IP Depending on the remote server, you may be able to give a parameter to the server also, like: .Xs rhelp NLST .Xe One server responded: .Xs Syntax: NLST [ path-name ] .De .\"------- .IP rm .\"------- If you need to delete a remote file you can try the .I rm command. Much of the time this won't work because you won't have the proper access permissions. This command doesn't accept any flags, so you can't nuke a whole tree by using ``\-rf'' flags like you can on .IR UNIX "." .\"------- .IP rmdir .\"------- Similarly, the .I rmdir command removes a directory. Depending on the remote server, you may be able to remove a non-empty directory, so be careful. .\"------- .IP set .\"------- This lets you configure some program variables, which are saved between runs in the .I $HOME/.ncftp/prefs file. The basic syntax is: .Xs set