From 2c5b8ec6d95cf68650265941530e5ce38c8dd6d9 Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Thu, 9 Dec 2004 09:47:41 +0000 Subject: Merge oe-devel@oe-devel.bkbits.net:openembedded into hyperion.kergoth.com:/home/kergoth/code/openembedded 2004/12/09 03:39:39-06:00 kergoth.com!kergoth Break people's builds again.. this time moving the packages into a packages/ subdir to clean things up a bit. BKrev: 41b81f3dvlp3rU7_8MUXLcI8LDdDoA --- ncftp/ncftp/acinclude.m4 | 4950 ---------------------------------------------- ncftp/ncftp_3.1.7.bb | 0 ncftp/ncftp_3.1.8.bb | 0 3 files changed, 4950 deletions(-) delete mode 100644 ncftp/ncftp/acinclude.m4 delete mode 100644 ncftp/ncftp_3.1.7.bb delete mode 100644 ncftp/ncftp_3.1.8.bb (limited to 'ncftp') diff --git a/ncftp/ncftp/acinclude.m4 b/ncftp/ncftp/acinclude.m4 deleted file mode 100644 index e7d4bd0602..0000000000 --- a/ncftp/ncftp/acinclude.m4 +++ /dev/null @@ -1,4950 +0,0 @@ -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 -AH_TEMPLATE([SOCKS], [define if using the socks library]) -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_DISABLE_PRECOMP], [ -AC_ARG_ENABLE(ccdv,[ --disable-precomp disable use of precompiled header files],use_precomp="$enableval",use_precomp=yes) -]) -dnl -dnl -dnl -dnl -AH_TEMPLATE([PRAGMA_HDRSTOP], []) -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_precomp-yes}" != no ; then - wi_cv_cc_precomp_type="unknown" - /bin/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" - -main() -{ - 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 - # - cat < pchtest.c -#include "pchtest.h" -#pragma hdrstop -#include - -main() { exit(0); } -EOF - for pchflags in "-pch -no_pch_messages" "-pch" "-LANG:pch" - do - /bin/rm -f pchtest.pch - 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 - fi - done - unset pchflags - fi - /bin/rm -f pchtest.h pchtest.p pchtest.c pchtest.o pchtest csetc.pch pchtest.pch pchtest.h.gch - fi - wi_cv_cc_precomp="$result" -]) -]) -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=":" -/bin/rm -f config.lnk -if test ! -f "config.lnk" ; then - /bin/ln -s /bin/ln config.lnk - if test -f "config.lnk" ; then - ( if test -L config.lnk ; then /bin/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 /bin/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 - /bin/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" -if test -r $incdir ; then - case "$CPPFLAGS" in - *${incdir}*) - # echo " + already had $incdir" 1>&6 - ;; - *) - if test "$CPPFLAGS" = "" ; then - CPPFLAGS="-I$incdir" - else - CPPFLAGS="$CPPFLAGS -I$incdir" - fi - echo " + found $incdir" 1>&6 - ;; - esac -fi -]) -dnl -dnl -dnl -dnl -AC_DEFUN([wi_EXTRA_LDIR], [ -libdir="$1" -if test -r $libdir ; then - case "$LDFLAGS" in - *${libdir}*) - # echo " + already had $libdir" 1>&6 - ;; - *) - if test "$LDFLAGS" = "" ; then - LDFLAGS="-L$libdir" - else - LDFLAGS="$LDFLAGS -L$libdir" - fi - echo " + found $libdir" 1>&6 - ;; - 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_HPUX_CFLAGS], -[AC_MSG_CHECKING(if HP-UX ansi C compiler flags are needed) -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 -fi -AC_MSG_RESULT($ac_cv_hpux_flags) -]) -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 - -if test "$wi_os_default_cflags" = yes ; then - if 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" - ;; - 3.*) - 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*) - 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" - ;; - 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" - ;; - 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]) -STRIP="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 - SFLAG="" - STRIP=":" -fi -case "$CFLAGS" in - "-g"|"-g "*|*" -g"|*" -g "*|*"-g"[0-9]*) - # SFLAG="# $SFLAG" - SFLAG="" - STRIP=":" - ;; -esac -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 -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_CFLAGS], [AC_REQUIRE([AC_PROG_CC]) - wi_PROG_GCC_VERSION - AC_REQUIRE_CPP() - wi_PROG_SUN_WORKSHOP_CC_VERSION - wi_OS_DEFAULT_CFLAGS - wi_CFLAGS_NO_Y2K_WARNINGS -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//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 - AC_MSG_CHECKING([NOOPTCFLAGS]) - AC_MSG_RESULT($NOOPTCFLAGS) - AC_MSG_CHECKING([DEBUGCFLAGS]) - AC_MSG_RESULT($DEBUGCFLAGS) - AC_MSG_CHECKING([CFLAGS]) - AC_MSG_RESULT($CFLAGS) -]) -dnl -dnl -dnl -AC_DEFUN([wi_HPUX_GCC___STDC_EXT__], [ -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(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 (you may want to do that since configure scripts look for gcc first)]) -else - AC_MSG_RESULT($CC) -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 -AC_DEFUN([wi_CFLAGS_LFS64], [AC_REQUIRE([AC_PROG_CC]) -AC_REQUIRE([wi_OS_VAR]) -wi_CFLAGS -if test "os_${os}_gcc_${GCC}" = os_hp-ux_gcc_yes ; then - wi_HPUX_GCC___STDC_EXT__ -fi -case "$CFLAGS" in - *-D_LARGEFILE64_SOURCE*) - ;; - *) - CFLAGS="-D_LARGEFILE64_SOURCE $CFLAGS" - DEBUGCFLAGS="-D_LARGEFILE64_SOURCE $DEBUGCFLAGS" - NOOPTCFLAGS="-D_LARGEFILE64_SOURCE $NOOPTCFLAGS" - ;; -esac -AC_MSG_CHECKING([if we should add to CFLAGS for LFS64 support]) -AC_MSG_RESULT($CFLAGS) -]) -dnl -dnl -dnl -AC_DEFUN([wi_CFLAGS_REENTRANT], [AC_REQUIRE([AC_PROG_CC]) -case "$CFLAGS" in - *-D_REENTRANT*) - ;; - *) - CFLAGS="-D_REENTRANT $CFLAGS" - ;; -esac -AC_MSG_CHECKING([if we should add -D_REENTRANT to CFLAGS]) -AC_MSG_RESULT($CFLAGS) -]) -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 - -AH_TEMPLATE([tv_sec_t], [type of the tv_sec field of struct timeval]) -AH_TEMPLATE([tv_usec_t], [type of the tv_usec field of struct timeval]) -AC_DEFUN([wi_STRUCT_TIMEVAL_FIELD_TYPES], [ -wi_struct_timeval_field_checks="cached" -AC_CACHE_CHECK([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 - 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 - wi_cv_struct_timeval_tv_sec="long" - wi_cv_struct_timeval_tv_usec="long" -],[ - # action if cross compiling - wi_cv_struct_timeval_tv_sec="long" - wi_cv_struct_timeval_tv_usec="long" -]) - /bin/rm -f conftest.out -]) -if test "$wi_struct_timeval_field_checks" = "uncached" ; then - AC_MSG_CHECKING([what type the tv_usec field of struct timeval is]) - AC_MSG_RESULT([$wi_cv_struct_timeval_tv_usec]) -else - AC_CACHE_CHECK([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 -AH_TEMPLATE([main_void_return_t], [type that main() should return]) -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 -AH_TEMPLATE([INSECURE_CHOWN], [define if chown can be used to subvert security]) -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 - AC_DEFINE(INSECURE_CHOWN) -],[ - # action if false - wi_cv_insecure_chown=no -],[ - # action if cross-compiling, guess - wi_cv_insecure_chown=no -]) - -AC_MSG_RESULT($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 -]) - -AH_TEMPLATE([NEED_GETOPT_H], [define if we need to include for the getopt() global variables]) -AH_TEMPLATE([NEED_GETOPT_EXTERN_DECLS], [define if we need extern declarations for the getopt() global variables]) -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; -],[wi_cv_getopt_decl="getopt.h"],[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], [ -if test "$ac_cv_func_snprintf" = "no" ; then - 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 -AH_TEMPLATE([SNPRINTF_TERMINATES], [define if snprintf works correctly]) -AC_DEFUN([wi_SNPRINTF_TERMINATES], [ -if test "$ac_cv_func_snprintf" != "no" ; then -AC_MSG_CHECKING(if snprintf works correctly) - if test "$ac_cv_func_snprintf" = "no" ; then - AC_CHECK_LIB(snprintf,snprintf) - 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 -#ifdef HAVE_STRINGS_H -#include -#endif -#include - -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) - x="yes"; -],[ - # action if false - wi_cv_snprintf_terminates=no - x="no"; -],[ - # action if cross compiling - wi_cv_snprintf_terminates=no - x="unknown"; -]) -AC_MSG_RESULT($x) -fi -]) -dnl -dnl -dnl -AC_DEFUN([wi_SNPRINTF], [ -wi_SPRINTF_RETVAL -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) -wi_SNPRINTF_TERMINATES -wi_LIB_SNPRINTF -]) -dnl -dnl -dnl - -AH_TEMPLATE([HAVE_HPSECURITY_H], [define if we have hpsecurity.h]) -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 -AH_TEMPLATE([CAN_USE_SYS_SELECT_H], [define if we can use sys/select.h]) -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 -AH_TEMPLATE([HAVE_UNIX_DOMAIN_SOCKETS], [define if UNIX domain sockets are available]) -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) - AC_CACHE_CHECK([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 - wi_cv_unix_domain_sockets=yes -],[ - # action if false - wi_cv_unix_domain_sockets=no -],[ - # action if cross-compiling, guess - 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 -AC_CACHE_CHECK([if we need to look for -lresolv], [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); -}],wi_cv_look_for_resolv=no,wi_cv_look_for_resolv=yes,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 -AH_TEMPLATE([UNAME], [uname -a output]) -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 -AH_TEMPLATE([HAVE_SIGSETJMP], [define if we have sigsetjmp and siglongjmp]) -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 -AH_TEMPLATE([HAVE_UTMP_UT_NAME], [define if struct utmp has the ut_name field]) -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 -AH_TEMPLATE([HAVE_UTMPX_UT_SYSLEN], [define if struct utmpx has the ut_syslen field]) -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 -AH_TEMPLATE([HAVE_UTMP_UT_USER], [define if struct utmp has the ut_user field]) -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 -AH_TEMPLATE([HAVE_UTMP_UT_PID], [define if struct utmp has the ut_pid field]) -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 -AH_TEMPLATE([HAVE_UTMP_UT_TIME], [define if struct utmp has the ut_time field]) -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 -AH_TEMPLATE([HAVE_UTMP_UT_HOST], [define if struct utmp has the ut_host field]) -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 -dnl -AH_TEMPLATE([HAVE_STRUCT_STAT64], [define if we have struct stat64]) -AC_DEFUN([wi_STRUCT_STAT64], [ -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) -]) -dnl -dnl -dnl -AH_TEMPLATE([HAVE_STRUCT_CMSGDHR], [define if we have struct cmsghdr]) -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 -AH_TEMPLATE([HAVE_MSGHDR_CONTROL], [define if struct msghdr has the msg_control field]) -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 -AH_TEMPLATE([HAVE_MSGHDR_ACCRIGHTS], [define if struct msghdr has the msg_accrights field]) -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 -AH_TEMPLATE([HAVE_PR_PASSWD_FG_OLDCRYPT], [define if struct pr_passwd has the fg_oldcrypt field]) -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 -AH_TEMPLATE([HAVE_SOCKADDR_UN_SUN_LEN], [define if struct sockaddr_un has the sun_len field]) -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 -AH_TEMPLATE([HAVE_STATFS_F_BAVAIL], [define if struct statfs has the f_bavail field]) -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 -AH_TEMPLATE([HAVE_STATVFS_F_FRSIZE], [define if struct statvfs has the f_frsize field]) -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 -AH_TEMPLATE([SPRINTF_RETURNS_PTR], [define if sprintf returns a pointer to the data]) -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 - x="length of data written"; -],[ - # action if false - wi_cv_sprintf_returns_ptr=yes - AC_DEFINE(SPRINTF_RETURNS_PTR) - x="pointer to data"; -],[ - # action if cross compiling - wi_cv_sprintf_returns_ptr=no - x="unknown"; -]) -AC_MSG_RESULT($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 - AC_MSG_RESULT([none?]) -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 -AH_TEMPLATE([HAVE__RES_DEFDNAME], [define if _res global variable is usable]) -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 -AH_TEMPLATE([sig_atomic_t], [type to use for sig_atomic_t]) -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. -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 - wi_cv_lib_readline=yes -],[ - # action if false - wi_cv_lib_readline=no -],[ - # action if cross compiling - wi_cv_lib_readline=no -]) - - if test "$wi_cv_lib_readline" = yes ; then break ; fi -done - -# 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 - /bin/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` - rlver=`sed -n 2,2p readline.ver 2>/dev/null` - /bin/rm -f readline.ver - ],[ - # action if false - rl_library_version='' - rlver='' - /bin/rm -f readline.ver - ],[ - # action if cross compiling - rl_library_version='' - rlver='' - /bin/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 -AH_TEMPLATE([HAVE_LONG_LONG], [define if we have the long long type]) -AH_TEMPLATE([PRINTF_LONG_LONG], [define if printf supports long long]) -AH_TEMPLATE([SCANF_LONG_LONG], [define if scanf supports long long]) -AH_TEMPLATE([PRINTF_ULONG_LONG], [define if printf supports unsigned long long]) -AH_TEMPLATE([SCANF_ULONG_LONG], [define if scanf supports unsigned long long]) -AH_TEMPLATE([PRINTF_LONG_LONG_QD], [define if using %qd for long long in printf]) -AH_TEMPLATE([SCANF_LONG_LONG_QD], [define if using %qd for long long in scanf]) -AH_TEMPLATE([PRINTF_LONG_LONG_LLD], [define if using %lld for long long in printf]) -AH_TEMPLATE([SCANF_LONG_LONG_LLD], [define if using %lld for long long in scanf]) -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 - wi_cv_type_long_long=yes - LONGEST_INT="long long" -],[ - # action if false - wi_cv_type_long_long=no -],[ - # action if cross compiling - wi_cv_type_long_long=no -]) -AC_MSG_RESULT($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 - wi_cv_printf_long_long="%lld" -],[ - # action if false - : -],[ - # action if cross compiling - : -]) - - -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($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 - wi_cv_scanf_long_long="%lld" -],[ - # action if false - : -],[ - # action if cross compiling - : -]) - - -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($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 - /bin/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 - 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 - cmp -s "$h_file" "$h_tmp" - if test $? -ne 0 ; then - mv "$h_tmp" "$h_file" - chmod a+r "$h_file" - fi - fi - /bin/rm -f "$h_tmp" - unset h_tmp longest_int_subst -fi -unset h_file -]) -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 - 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 - cmp -s "$h_file" "$h_tmp" - if test $? -ne 0 ; then - mv "$h_tmp" "$h_file" - 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 - cmp -s "$h_file" "$h_tmp" - if test $? -ne 0 ; then - mv "$h_tmp" "$h_file" - chmod a+r "$h_file" - fi