URL
https://opencores.org/ocsvn/or1k_old/or1k_old/trunk
Subversion Repositories or1k_old
[/] [or1k_old/] [trunk/] [insight/] [expect/] [configure.in] - Rev 1782
Compare with Previous | Blame | View Log
# Process this file with autoconf to produce a configure script.# while Expect is in alpha/beta, disable caching so as not to confuse# people trying to fix configure bugsdnl CYGNUS LOCAL: allow cachingdefine([AC_CACHE_LOAD], )define([AC_CACHE_SAVE], )dnl END CYGNUS LOCALAC_INIT(expect.h)dnl CYGNUS LOCAL: find aux files in ..AC_CONFIG_AUX_DIR($srcdir/..)dnl END CYGNUS LOCALdnl AC_CANONICAL_SYSTEM# note when updating version numbers here, also update pkgIndex.in (see# comments in Makefile)EXP_MAJOR_VERSION=5EXP_MINOR_VERSION=26EXP_MICRO_VERSION=0EXP_VERSION=$EXP_MAJOR_VERSION.$EXP_MINOR_VERSIONEXP_VERSION_NODOTS=$EXP_MAJOR_VERSION$EXP_MINOR_VERSIONEXP_VERSION_FULL=$EXP_VERSION.$EXP_MICRO_VERSION# Tcl's handling of shared_lib_suffix requires this symbol existVERSION=$EXP_MAJOR_VERSION.$EXP_MINOR_VERSION# Too many people send me configure output without identifying the version.# This forced identification should reduce my pain significantly.echo "configuring Expect $EXP_MAJOR_VERSION.$EXP_MINOR_VERSION.$EXP_MICRO_VERSION"dnl AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)AC_CANONICAL_SYSTEMAC_CONFIG_HEADER(expect_cf.h)# /bin/sh on some systems is too deficient (in particular, Ultrix 4.3# sh lacks unset and we *need* that), but all these systems come with# alternatives, so take user's choice or whatever we're using here and# allow it to be seen by Make.AC_MSG_CHECKING([shell to use within Make])EXP_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}AC_MSG_RESULT($CONFIG_SHELL)# If `configure' is invoked (in)directly via `make', ensure that it# encounters no `make' conflicts.#unset MFLAGS MAKEFLAGSMFLAGS=""MAKEFLAGS=""CY_AC_PATH_TCLCONFIGCY_AC_LOAD_TCLCONFIGCC=$TCL_CCEXP_AND_TCL_LIBS=$TCL_LIBSCY_AC_PATH_TKCONFIGCY_AC_LOAD_TKCONFIGEXP_AND_TK_LIBS=$TK_LIBS# CYGNUS LOCAL dj/cygwinAC_CANONICAL_HOST# If we built a cygwin-specific tcl, use it here.case "${host}" in*-*-cygwin*)if test -d $srcdir/../tcl/cygwin/.thenTCL_BUILD_LIB_SPEC="../tcl/cygwin/libtcl_cygwin.a"# Use the same static lib for installed_expectTCL_LIB_SPEC="../tcl/cygwin/libtcl_cygwin.a"EXP_CYGWIN_ALTTCL='-DCYGWIN_ALTTCL'fi;;esac# An explanation is in order for the strange things going on with the# various LIBS. There are three separate definitions for LIBS. The# reason is that some systems require shared libraries include# references to their dependent libraries, i.e., any additional# libraries that must be linked to. And some systems get upset if the# references are repeated on the link line. So therefore, we create# one for Expect and Tk (EXP_AND_TK_LIBS), one for Expect and Tcl# (EXP_AND_TCL_LIBS), and finally, one for building Expect's own# shared library. Tcl's tclConfig.sh insists that any shared libs# that it "helps" build must pass the libraries as LIBS (see comment# near end of this configure file). I would do but since we're close# to hitting config's max symbols, we take one short cut and pack the# LIBS into EXP_SHLIB_LD_LIBS (which is basically what Tcl wants to do# for us). The point, however, is that there's no separate LIBS or# EXP_LIBS symbol passed out of configure. One additional point for# confusion is that LIBS is what configure uses to do all library# tests, so we have to swap definitions of LIBS peridically. When we# are swapping out the one for Expect's shared library, we save it in# EXP_LIBS. Sigh.dnl AC_PROG_CC insists on sticking crap -g and -O in CFLAGSdnl but I want to control it. Can't just throw it out at thednl end alas, because the user might have defined CFLAGS.dnl CYGNUS LOCAL: just use AC_PROG_CC; we don't care.dnl OLD_CFLAGS=$CFLAGSOLD_CFLAGS=$CFLAGSAC_PROG_CCCFLAGS=$OLD_CFLAGSdnl CFLAGS=$OLD_CFLAGSdnl END CYGNUS LOCALCY_AC_C_WORKS# this'll use a BSD compatible install or our included install-shAC_PROG_INSTALL# Tcl sets TCL_RANLIB appropriately for shared library if --enable-sharedAC_PROG_RANLIBUNSHARED_RANLIB=$RANLIB# these are the other subdirectories we need to configureAC_CONFIG_SUBDIRS(testsuite)# This is for LynxOS, which needs a flag to force true POSIX when# building. The flag varies depending how old the compiler is.# -X is for the old "cc" and "gcc" (based on 1.42)# -mposix is for the new gcc (at least 2.5.8)# This modifies the value of $CC to have the POSIX flag added# so it'll configure correctlyCY_AC_TCL_LYNX_POSIXAC_TYPE_PID_TAC_RETSIGTYPEdnl AC_TIME_WITH_SYS_TIMEAC_HEADER_TIMEAC_HEADER_SYS_WAITdnl CYGNUS LOCAL: always respect CFLAGS.EXP_CFLAGS=""dnl case "${host}" in# Use -g on all systems but Linux where it upsets the dynamic X libraries.dnl i[[3456]]86-*-linux*) EXP_CFLAGS="" ;;dnl esacdnl END CYGNUS LOCALEXP_CFLAGS="$EXP_CFLAGS $EXP_CYGWIN_ALTTCL"AC_MSG_CHECKING([if running Mach])mach=0case "${host}" in# Both Next and pure Mach behave identically with respect# to a few things, so just lump them together as "mach"*-*-mach*) mach=1 ;;*-*-next*) mach=1 ; next=1 ;;esacif test $mach -eq 1 ; thenAC_MSG_RESULT(yes)elseAC_MSG_RESULT(no)fiAC_MSG_CHECKING([if running MachTen])# yet another Mach cloneif test -r /MachTen -a "$cross_compiling" != "yes" ; thenAC_MSG_RESULT(yes)mach=1elseAC_MSG_RESULT(no)fiAC_MSG_CHECKING([if on Pyramid])if test -r /bin/pyr -a "$cross_compiling" != "yes" ; thenAC_MSG_RESULT(yes)pyr=1elseAC_MSG_RESULT(no)pyr=0fiAC_MSG_CHECKING([if on Apollo])if test -r /usr/apollo/bin -a "$cross_compiling" != "yes" ; thenAC_MSG_RESULT(yes)apollo=1elseAC_MSG_RESULT(no)apollo=0fiAC_MSG_CHECKING([if on Interactive])if test "x`(uname -s) 2>/dev/null`" = xIUNIX; thenAC_MSG_RESULT(yes)iunix=1elseAC_MSG_RESULT(no)iunix=0fiAC_MSG_CHECKING([if stty reads stdout])# On some systems stty can't be run in the background (svr4) or get it# wrong because they fail to complain (next, mach), so don't attempt# the test on some systems.stty_reads_stdout=""case "${host}" in*-*-solaris*) stty_reads_stdout=0 ;;*-*-irix*) stty_reads_stdout=0 ;;*-*-sco3.2v[[45]]*) stty_reads_stdout=1 ;;i[[3456]]86-*-sysv4.2MP) stty_reads_stdout=0 ;;i[[3456]]86-*-linux*) stty_reads_stdout=0 ;;# Not sure about old convex but 5.2 definitely reads from stdoutc[[12]]-*-*) stty_reads_stdout=1 ;;*-*-aix[[34]]*) stty_reads_stdout=0 ;;*-*-hpux9*) stty_reads_stdout=0 ;;*-*-hpux10*) stty_reads_stdout=0 ;;*-*-hpux11*) stty_reads_stdout=0 ;;*-*-osf[[234]]*) stty_reads_stdout=0 ;;*-*-ultrix4.4) stty_reads_stdout=0 ;;*-*-dgux*) stty_reads_stdout=0 ;;*-*-cygwin*) stty_reads_stdout=0 ;;esacif test $mach -eq 1 ; thenstty_reads_stdout=1fiif test $apollo -eq 1 ; thenstty_reads_stdout=1fiif test $pyr -eq 1 ; thenstty_reads_stdout=1fi# if we still don't know, testif test x"${stty_reads_stdout}" = x"" ; then/bin/stty > /dev/null 2> /dev/nullif test $? -ne 0 ; thenstty_reads_stdout=1elsestty_reads_stdout=0fifiif test ${stty_reads_stdout} -eq 1 ; thenAC_MSG_RESULT(yes)AC_DEFINE(STTY_READS_STDOUT)elseAC_MSG_RESULT(no)fi# Solaris 2.4 and later requires __EXTENSIONS__ in order to see all sorts# of traditional but nonstandard stuff in header files.AC_MSG_CHECKING([if running Solaris])solaris=0case "${host}" in*-*-solaris*) solaris=1;;esacif test $solaris -eq 1 ; thenAC_MSG_RESULT(yes)AC_DEFINE(SOLARIS)elseAC_MSG_RESULT(no)fi# On a few systems, libm.a is the same as libc.a# Don't bother to test against Tcl and Tk libs, they always include -lmAC_CHECK_FUNC(sin, , LIBS="${LIBS} -lm" )# On Interactive UNIX, -Xp must be added to LIBS in order to find strftime.# This test should really be done by Tcl. So just check Tcl's definition.# If defective, add to all three LIBS. (It's not actually necessary for# EXP_LIBS since -Xp will just be ignored the way that EXP_LIBS is used in# the Makefile, but we include it for consistency.)if test $iunix -eq 1 ; thenEXP_LIBS=$LIBSLIBS=$EXP_AND_TCL_LIBSAC_CHECK_FUNC(strftime, , [EXP_LIBS="${LIBS} -Xp"EXP_AND_TCL_LIBS="${LIBS} -Xp"EXP_AND_TK_LIBS="${LIBS} -Xp"])LIBS=EXP_LIBSfi## Ok, lets find the tcl source trees so we can use the headers#CY_AC_PATH_TCLHif test x"$no_tcl" = x"true" ; thenecho " ERROR: Can't find Tcl headers or library."echo " See README for information on how to obtain Tcl."echo " If Tcl is installed, see INSTALL on how to tell"echo " configure where Tcl is installed."exit 1fiCY_AC_PATH_ITCLH# have to whether we're generating shared libs before configuring debuggerAC_MSG_CHECKING([if generating shared or nonshared library])AC_ARG_ENABLE(shared,[ --enable-shared build libexpect as a shared library],[enable_shared=$enableval], [enable_shared=no])if test "$enable_shared" = "yes" && test "x${TCL_SHLIB_SUFFIX}" != "x" ; thenAC_MSG_RESULT(both shared and unshared)elseAC_MSG_RESULT(unshared)fi# Now that we've found the Tcl sources, configure the debugger# this is a little tricky because it has its own configure script# which produces a Makefile and cf file. We only want the cf file,# so switch to a temporary directory and run the debugger's configure.# Then save the cf file and delete the rest.## Incidentally, the debugger can't depend on Expect's cf file, because# the debugger is designed to be independent of Expect.#test -n "$verbose" && echo "configuring Tcl debugger"tmpdir=./Dbg$$mkdir ${tmpdir}if test "${enable_shared}" = "yes"; thendbg_config_flags='--enable-shared'elsedbg_config_flags='--disable-shared'fi# (cd;pwd) in next several commands converts relative dirs to absolute.# This is required because the debugger src is at a different level in# the filesystem than Expect src (where we are presently), thereby# making the relative pathnames incorrect.if test "x$with_tclconfig" != "x" ; thendbg_config_flags="$dbg_config_flags --with-tclconfig=`(cd ${with_tclconfig}; pwd)`"fiif test "x$with_tcllibdir" != "x" ; thendbg_config_flags="$dbg_config_flags --with-tcllibdir=`(cd ${with_tcllibdir}; pwd)`"fiif test "x$with_tcllib" != "x" ; thendbg_config_flags="$dbg_config_flags --with-tcllib=`(cd ${with_tcllib}; pwd)`"fiif test "x$with_tclinclude" != "x" ; thendbg_config_flags="$dbg_config_flags --with-tclinclude=`(cd ${with_tclinclude}; pwd)`"ficase "$cache_file" in/*)dbg_config_flags="$dbg_config_flags --cache-file=$cache_file";;*)dbg_config_flags="$dbg_config_flags --cache-file=../$cache_file";;esaccp ${srcdir}/Dbgconfigure ${srcdir}/Dbg.h ${srcdir}/Dbg_cf.h.in ${srcdir}/install-sh ${tmpdir}cp $srcdir/DbgMkfl.in ${tmpdir}/Makefile.in(cd $tmpdir; ${CONFIG_SHELL-/bin/sh} Dbgconfigure --with-tclinclude=`echo ${TCLHDIR} | sed -e 's/-I//'` $dbg_config_flags)cp ${tmpdir}/Dbg_cf.h .rm -rf $tmpdirtest -n "$verbose" && echo "configured Tcl debugger"# some people would complain if this explanation wasn't provided...echo "Begin tests for function/library dependencies. Tests may be repeated"echo "up to three times. First test is for building Expect's shared library."echo "Second set is for building with Tcl. Third is for building with Tk."####################################################################### required by Sequent ptx2unset ac_cv_func_gethostnameAC_CHECK_FUNC(gethostname, gethostname=1 , gethostname=0)if test $gethostname -eq 0 ; thenunset ac_cv_lib_inet_gethostnameAC_CHECK_LIB(inet, gethostname, LIBS="$LIBS -linet")fi# save results and retry for TclEXP_LIBS=$LIBSLIBS=$EXP_AND_TCL_LIBSunset ac_cv_func_gethostnameAC_CHECK_FUNC(gethostname, gethostname=1 , gethostname=0)if test $gethostname -eq 0 ; thenunset ac_cv_lib_inet_gethostnameAC_CHECK_LIB(inet, gethostname, LIBS="$LIBS -linet")fi# save Tcl results and retry for TkEXP_AND_TCL_LIBS=$LIBSLIBS=$EXP_AND_TK_LIBSunset ac_cv_func_gethostnameAC_CHECK_FUNC(gethostname, gethostname=1 , gethostname=0)if test $gethostname -eq 0 ; thenunset ac_cv_lib_inet_gethostnameAC_CHECK_LIB(inet, gethostname, LIBS="$LIBS -linet")fi# save Tk results and reset for ExpectEXP_AND_TK_LIBS=$LIBSLIBS=$EXP_LIBS####################################################################### required by Fischman's ISC 4.0unset ac_cv_func_socketAC_CHECK_FUNC(socket, socket=1 , socket=0)if test $socket -eq 0 ; thenunset ac_cv_lib_inet_socketAC_CHECK_LIB(inet, socket, LIBS="$LIBS -linet")fi# save results and retry for TclEXP_LIBS=$LIBSLIBS=$EXP_AND_TCL_LIBSunset ac_cv_func_socketAC_CHECK_FUNC(socket, socket=1 , socket=0)if test $socket -eq 0 ; thenunset ac_cv_lib_inet_socketAC_CHECK_LIB(inet, socket, LIBS="$LIBS -linet")fi# save Tcl results and retry for TkEXP_AND_TCL_LIBS=$LIBSLIBS=$EXP_AND_TK_LIBSunset ac_cv_func_socketAC_CHECK_FUNC(socket, socket=1 , socket=0)if test $socket -eq 0 ; thenunset ac_cv_lib_inet_socketAC_CHECK_LIB(inet, socket, LIBS="$LIBS -linet")fi# save Tk results and reset for ExpectEXP_AND_TK_LIBS=$LIBSLIBS=$EXP_LIBS######################################################################unset ac_cv_func_selectAC_CHECK_FUNC(select, select=1 , select=0)if test $select -eq 0 ; thenunset ac_cv_lib_inet_selectAC_CHECK_LIB(inet, select, LIBS="$LIBS -linet")fi# save results and retry for TclEXP_LIBS=$LIBSLIBS=$EXP_AND_TCL_LIBSunset ac_cv_func_selectAC_CHECK_FUNC(select, select=1 , select=0)if test $select -eq 0 ; thenunset ac_cv_lib_inet_selectAC_CHECK_LIB(inet, select, LIBS="$LIBS -linet")fi# save Tcl results and retry for TkEXP_AND_TCL_LIBS=$LIBSLIBS=$EXP_AND_TK_LIBSunset ac_cv_func_selectAC_CHECK_FUNC(select, select=1 , select=0)if test $select -eq 0 ; thenunset ac_cv_lib_inet_selectAC_CHECK_LIB(inet, select, LIBS="$LIBS -linet")fi# save Tk results and reset for ExpectEXP_AND_TK_LIBS=$LIBSLIBS=$EXP_LIBS######################################################################unset ac_cv_func_getpseudottyAC_CHECK_FUNC(getpseudotty, getpseudotty=1 , getpseudotty=0)if test $getpseudotty -eq 0 ; thenunset ac_cv_lib_seq_getpseudottyAC_CHECK_LIB(seq, getpseudotty)fi# save results and retry for TclEXP_LIBS=$LIBSLIBS=$EXP_AND_TCL_LIBSunset ac_cv_func_getpseudottyAC_CHECK_FUNC(getpseudotty, getpseudotty=1 , getpseudotty=0)if test $getpseudotty -eq 0 ; thenunset ac_cv_lib_seq_getpseudottyAC_CHECK_LIB(seq, getpseudotty)fi# save Tcl results and retry for TkEXP_AND_TCL_LIBS=$LIBSLIBS=$EXP_AND_TK_LIBSunset ac_cv_func_getpseudottyAC_CHECK_FUNC(getpseudotty, getpseudotty=1 , getpseudotty=0)if test $getpseudotty -eq 0 ; thenunset ac_cv_lib_seq_getpseudottyAC_CHECK_LIB(seq, getpseudotty)fi# save Tk results and reset for ExpectEXP_AND_TK_LIBS=$LIBSLIBS=$EXP_LIBS####################################################################### Check for FreeBSD/NetBSD openpty()# CYGNUS LOCAL: Don't do this on Linux. Alpha Linux Red Hat 4.2 has# openpty, but it doesn't work correctly.case "${host}" in*-*-linux*) ;;*)unset ac_cv_func_openptyAC_CHECK_FUNC(openpty, openpty=1 , openpty=0)if test $openpty -eq 0 ; thenunset ac_cv_lib_util_openptyAC_CHECK_LIB(util, openpty, [# we only need to define OPENPTY once, but since we are overriding# the default behavior, we must also handle augment LIBS too.# This needn't be done in the 2nd and 3rd tests.AC_DEFINE(HAVE_OPENPTY)LIBS="$LIBS -lutil"])fi# save results and retry for TclEXP_LIBS=$LIBSLIBS=$EXP_AND_TCL_LIBSunset ac_cv_func_openptyAC_CHECK_FUNC(openpty, openpty=1 , openpty=0)if test $openpty -eq 0 ; thenunset ac_cv_lib_util_openptyAC_CHECK_LIB(util, openpty, [AC_DEFINE(HAVE_OPENPTY)LIBS="$LIBS -lutil"])fi# save Tcl results and retry for TkEXP_AND_TCL_LIBS=$LIBSLIBS=$EXP_AND_TK_LIBSunset ac_cv_func_openptyAC_CHECK_FUNC(openpty, openpty=1 , openpty=0)if test $openpty -eq 0 ; thenunset ac_cv_lib_util_openptyAC_CHECK_LIB(util, openpty, [AC_DEFINE(HAVE_OPENPTY)LIBS="$LIBS -lutil"])fi# save Tk results and reset for ExpectEXP_AND_TK_LIBS=$LIBSLIBS=$EXP_LIBS# CYGNUS LOCAL: Link against luser32 on Cygwin.case "${host}" in*-*-cygwin*) EXP_AND_TCL_LIBS="$EXP_AND_TCL_LIBS -luser32" ;;esac;;esac####################################################################### End of library/func checking############################################################################################################################################## Look for various header files#AC_CHECK_HEADER(sys/sysmacros.h, AC_DEFINE(HAVE_SYSMACROS_H))AC_CHECK_HEADER(stdlib.h, ,AC_DEFINE(NO_STDLIB_H))## Look for inttypes.h. Sometimes there are data type conflicts# with sys/types.h, so we have to use our own special test.#dnl AC_CHECK_HEADER(inttypes.h, AC_DEFINE(HAVE_INTTYPES_H))CY_AC_INTTYPES_H# Oddly, some systems have stdarg but don't support prototypes# Tcl avoids the whole issue by not using stdarg on UNIX at all!dnl AC_CHECK_HEADER(stdarg.h, AC_DEFINE(HAVE_STDARG_H))AC_CHECK_HEADER(varargs.h, AC_DEFINE(HAVE_VARARGS_H))AC_CHECK_HEADER(unistd.h, AC_DEFINE(HAVE_UNISTD_H))AC_CHECK_HEADER(sys/stropts.h, AC_DEFINE(HAVE_STROPTS_H))AC_CHECK_HEADER(sys/sysconfig.h, AC_DEFINE(HAVE_SYSCONF_H))AC_CHECK_HEADER(sys/fcntl.h, AC_DEFINE(HAVE_SYS_FCNTL_H))AC_CHECK_HEADER(sys/select.h, AC_DEFINE(HAVE_SYS_SELECT_H))AC_CHECK_HEADER(sys/time.h, AC_DEFINE(HAVE_SYS_TIME_H))AC_CHECK_HEADER(sys/ptem.h, AC_DEFINE(HAVE_SYS_PTEM_H))AC_CHECK_HEADER(sys/strredir.h, AC_DEFINE(HAVE_STRREDIR_H))AC_CHECK_HEADER(sys/strpty.h, AC_DEFINE(HAVE_STRPTY_H))dnl #echo checking for ucbinclude/sys/ioctl.h (ucb-style ioctl.h under SV)dnl #if test -f /usr/ucbinclude/sys/ioctl.h ; thendnl # AC_DEFINE(HAVE_UCB_IOCTL_H)dnl #fiAC_MSG_CHECKING([for sys/bsdtypes.h])if test "ISC_${ISC}" = "ISC_1" ; thenAC_MSG_RESULT(yes)# if on ISC 1, we need <sys/bsdtypes.h> to get FD_SET macrosAC_HAVE_HEADERS(sys/bsdtypes.h)elseAC_MSG_RESULT(no)fi## Look for functions that may be missing#dnl AC_CHECK_FUNC(memcpy, AC_DEFINE(HAVE_MEMCPY))AC_CHECK_FUNC(memmove, AC_DEFINE(HAVE_MEMMOVE))AC_CHECK_FUNC(sysconf, AC_DEFINE(HAVE_SYSCONF))AC_CHECK_FUNC(strftime, AC_DEFINE(HAVE_STRFTIME))AC_CHECK_FUNC(strchr, AC_DEFINE(HAVE_STRCHR))AC_CHECK_FUNC(timezone, AC_DEFINE(HAVE_TIMEZONE))# dnl check for memcpy by hand# because Unixware 2.0 handles it specially and refuses to compile# autoconf's automatic test that is a call with no argumentsAC_MSG_CHECKING([for memcpy])AC_TRY_LINK(,[char *s1, *s2;memcpy(s1,s2,0);],AC_MSG_RESULT(yes)AC_DEFINE(HAVE_MEMCPY),AC_MSG_RESULT(no))# Some systems only define WNOHANG if _POSIX_SOURCE is defined# The following merely tests that sys/wait.h can be included# and if so that WNOHANG is not defined. The only place I've# seen this is ISC.AC_MSG_CHECKING([if WNOHANG requires _POSIX_SOURCE])AC_TRY_RUN([#include <sys/wait.h>main() {#ifndef WNOHANGreturn 0;#elsereturn 1;#endif}],AC_MSG_RESULT(yes)AC_DEFINE(WNOHANG_REQUIRES_POSIX_SOURCE),AC_MSG_RESULT(no),[case "${host}" in*-*-cygwin*) AC_MSG_RESULT(no) ;;*) AC_MSG_ERROR([Expect can't be cross compiled]) ;;esac])AC_MSG_CHECKING([if any value exists for WNOHANG])rm -rf wnohangAC_TRY_RUN([#include <stdio.h>#include <sys/wait.h>main() {#ifdef WNOHANGFILE *fp = fopen("wnohang","w");fprintf(fp,"%d",WNOHANG);fclose(fp);return 0;#elsereturn 1;#endif}],AC_MSG_RESULT(yes)AC_DEFINE_UNQUOTED(WNOHANG_BACKUP_VALUE, `cat wnohang`)rm -f wnohang,AC_MSG_RESULT(no)AC_DEFINE(WNOHANG_BACKUP_VALUE, 1),[case "${host}" in*-*-cygwin*) AC_MSG_RESULT(yes)AC_DEFINE(WNOHANG_BACKUP_VALUE, 1) ;;*) AC_MSG_ERROR([Expect can't be cross compiled]) ;;esac])## check how signals work## Check for the data type of the mask used in select().# This picks up HP braindamage which defines fd_set and then# proceeds to ignore it and use int.# Pattern matching on int could be loosened.# Can't use ac_header_egrep since that doesn't see prototypes with K&R cpp.AC_MSG_CHECKING([mask type of select])if egrep "select\(size_t, int" /usr/include/sys/time.h >/dev/null 2>&1; thenAC_MSG_RESULT(int)AC_DEFINE(SELECT_MASK_TYPE, int)elseAC_MSG_RESULT(none)fidnl # Check for the data type of the function used in signal(). Thisdnl # must be before the test for rearming.dnl # echo checking return type of signal handlersdnl AC_HEADER_EGREP([(void|sighandler_t).*signal], signal.h, retsigtype=void,AC_DEFINE(RETSIGTYPE, int) retsigtype=int)# FIXME: check if alarm existsAC_MSG_CHECKING([if signals need to be re-armed])AC_TRY_RUN([#include <signal.h>#define RETSIGTYPE $retsigtypeint signal_rearms = 0;RETSIGTYPEchild_sigint_handler(n)int n;{}RETSIGTYPEparent_sigint_handler(n)int n;{signal_rearms++;}main(){signal(SIGINT,parent_sigint_handler);if (0 == fork()) {signal(SIGINT,child_sigint_handler);kill(getpid(),SIGINT);kill(getpid(),SIGINT);kill(getppid(),SIGINT);} else {int status;wait(&status);unlink("core");exit(signal_rearms);}}],AC_MSG_RESULT(yes)AC_DEFINE(REARM_SIG),AC_MSG_RESULT(no),[case "${host}" in*-*-cygwin*) AC_MSG_RESULT(no) ;;*) AC_MSG_WARN([Expect can't be cross compiled]) ;;esac])# HPUX7 has trouble with the big cat so split it# Owen Rees <rtor@ansa.co.uk> 29Mar93SEDDEFS="${SEDDEFS}CONFEOFcat >> conftest.sed <<CONFEOF"## There are multiple versions of getpty, alas.# I don't remember who has the first one, but Convex just added one# so check for it. Unfortunately, there is no header so the only# reasonable way to make sure is to look it we are on a Convex.AC_MSG_CHECKING([if on Convex])convex=0case "${host}" inc[[12]]-*-*) convex=1;;esacif test $convex -eq 1 ; thenAC_MSG_RESULT(yes)AC_DEFINE(CONVEX)elseAC_MSG_RESULT(no)fiEXP_LDFLAGS=AC_MSG_CHECKING([if on NeXT])if test -r /NextApps -a "$cross_compiling" != "yes" ; thenAC_MSG_RESULT(yes)# "-m" flag suppresses complaints about multiple strtodEXP_LDFLAGS="$EXP_LDFLAGS -m"elseAC_MSG_RESULT(no)fiAC_MSG_CHECKING([if on HP])if test "x`(uname) 2>/dev/null`" = xHP-UX; thenAC_MSG_RESULT(yes)hp=1elseAC_MSG_RESULT(no)hp=0fiAC_MSG_CHECKING([sane default stty arguments])DEFAULT_STTY_ARGS="sane"if test $mach -eq 1 ; thenDEFAULT_STTY_ARGS="cooked"fiif test $hp -eq 1 ; thenDEFAULT_STTY_ARGS="sane kill "fiAC_MSG_RESULT($DEFAULT_STTY_ARG)# Look for various features to determine what kind of pty# we have. For some weird reason, ac_compile_check would not# work, but ac_test_program does.#AC_MSG_CHECKING([for HP style pty allocation])# following test fails on DECstations and other things that don't grok -c# but that's ok, since they don't have PTYMs anywayif test -r /dev/ptym/ptyp0 2>/dev/null -a "$cross_compiling" != "yes" ; thenAC_MSG_RESULT(yes)AC_DEFINE(HAVE_PTYM)elseAC_MSG_RESULT(no)fiAC_MSG_CHECKING([for HP style pty trapping])AC_HEADER_EGREP([struct.*request_info], sys/ptyio.h,AC_MSG_RESULT(yes)AC_DEFINE(HAVE_PTYTRAP),AC_MSG_RESULT(no))AC_MSG_CHECKING([for AIX new-style pty allocation])if test -r /dev/ptc -a -r /dev/pts -a "$cross_compiling" != "yes" ; thenAC_MSG_RESULT(yes)AC_DEFINE(HAVE_PTC_PTS)elseAC_MSG_RESULT(no)fiAC_MSG_CHECKING([for SGI old-style pty allocation])if test -r /dev/ptc -a ! -r /dev/pts -a "$cross_compiling" != "yes" ; thenAC_MSG_RESULT(yes)AC_DEFINE(HAVE_PTC)elseAC_MSG_RESULT(no)fi# On SCO OpenServer, two types of ptys are available: SVR4 streams and c-list.# The library routines to open the SVR4 ptys are broken on certain systems and# the SCO command to increase the number of ptys only configure c-list ones# anyway. So we chose these, which have a special numbering scheme.#AC_MSG_CHECKING([for SCO style pty allocation])sco_ptys=""case "${host}" in*-sco3.2v[[45]]*) sco_clist_ptys=1 svr4_ptys_broken=1;;esacif test x"${sco_clist_ptys}" != x"" ; thenAC_MSG_RESULT(yes)AC_DEFINE(HAVE_SCO_CLIST_PTYS)elseAC_MSG_RESULT(no)fiAC_MSG_CHECKING([for SVR4 style pty allocation])if test -r /dev/ptmx -a "x$svr4_ptys_broken" = x -a "$cross_compiling" != "yes" ; thenAC_MSG_RESULT(yes)AC_DEFINE(HAVE_PTMX)# aargg. Some systems need libpt.a to use /dev/ptmxAC_CHECK_FUNC(ptsname, , LIBS="${LIBS} -lpt")# I've never seen Tcl or Tk include -lpt so don't bother with explicit testAC_CHECK_FUNC(ptsname, , EXP_AND_TCL_LIBS="${EXP_AND_TCL_LIBS} -lpt")AC_CHECK_FUNC(ptsname, , EXP_AND_TK_LIBS="${EXP_AND_TK_LIBS} -lpt")# CYGNUS LOCAL: IA-64# On some systems (e.g., IA-64 Linux), we need to define _XOPEN_SOURCE# in order to get a declaration for ptsname. It is safe to simply# define that whenever we are using ptsname.AC_MSG_CHECKING([for NSIG definition with _XOPEN_SOURCE])AC_TRY_COMPILE([/* _XOPEN_SOURCE can remove NSIG on UnixWare or OSF/1. */#define _XOPEN_SOURCE#include <signal.h>char junk[NSIG];],[],AC_DEFINE(_XOPEN_SOURCE)AC_MSG_RESULT(yes),AC_MSG_RESULT(no),)# END CYGNUS LOCALelseAC_MSG_RESULT(no)fi# In OSF/1 case, SVR4 are somewhat different.# Gregory Depp <depp@osf.org> 17Aug93AC_MSG_CHECKING([for OSF/1 style pty allocation])if test -r /dev/ptmx_bsd -a "$cross_compiling" != "yes" ; thenAC_DEFINE(HAVE_PTMX_BSD)AC_MSG_RESULT(yes)elseAC_MSG_RESULT(no)fi# Set the pty handling for Cygwincase "${host}" in*-*-cygwin*) AC_DEFINE(HAVE_PTMX) ;;*) ;;esactcgetattr=0tcsetattr=0AC_CHECK_FUNC(tcgetattr, tcgetattr=1)AC_CHECK_FUNC(tcsetattr, tcsetattr=1)if test $tcgetattr -eq 1 -a $tcsetattr -eq 1 ; thenAC_DEFINE(HAVE_TCSETATTR)AC_DEFINE(POSIX)fi# first check for the pure bsdAC_MSG_CHECKING([for struct sgttyb])AC_TRY_RUN([#include <sgtty.h>main(){struct sgttyb tmp;exit(0);}],AC_MSG_RESULT(yes)AC_DEFINE(HAVE_SGTTYB)PTY_TYPE=sgttyb,AC_MSG_RESULT(no),[case "${host}" in*-*-cygwin*) AC_MSG_RESULT(no) ;;*) AC_MSG_ERROR([Expect can't be cross compiled]) ;;esac])# mach systems have include files for unimplemented features# so avoid doing following test on those systemsif test $mach -eq 0 ; then# next check for the older style ttys# note that if we detect termio.h (only), we still set PTY_TYPE=termios# since that just controls which of pty_XXXX.c file is use and# pty_termios.c is set up to handle pty_termio.AC_MSG_CHECKING([for struct termio])AC_TRY_RUN([#include <termio.h>main(){struct termio tmp;exit(0);}],AC_DEFINE(HAVE_TERMIO)PTY_TYPE=termiosAC_MSG_RESULT(yes),AC_MSG_RESULT(no),[case "${host}" in*-*-cygwin*) AC_MSG_RESULT(no) ;;*) AC_MSG_ERROR([Expect can't be cross compiled]) ;;esac])# now check for the new style ttys (not yet posix)AC_MSG_CHECKING([for struct termios])AC_TRY_RUN([# ifdef HAVE_INTTYPES_H# include <inttypes.h># endif# include <termios.h>main(){struct termios tmp;exit(0);}],AC_DEFINE(HAVE_TERMIOS)PTY_TYPE=termiosAC_MSG_RESULT(yes),AC_MSG_RESULT(no),[case "${host}" in*-*-cygwin*) AC_DEFINE(HAVE_TERMIOS)PTY_TYPE=termiosAC_MSG_RESULT(yes) ;;*) AC_MSG_ERROR([Expect can't be cross compiled]) ;;esac])fiAC_MSG_CHECKING([if TCGETS or TCGETA in termios.h])AC_TRY_RUN([/* including termios.h on Solaris 5.6 fails unless inttypes.h included */#ifdef HAVE_INTTYPES_H#include <inttypes.h>#endif#include <termios.h>main() {#if defined(TCGETS) || defined(TCGETA)return 0;#elsereturn 1;#endif}],AC_DEFINE(HAVE_TCGETS_OR_TCGETA_IN_TERMIOS_H)AC_MSG_RESULT(yes),AC_MSG_RESULT(no),[case "${host}" in*-*-cygwin*) AC_DEFINE(HAVE_TCGETS_OR_TCGETA_IN_TERMIOS_H)AC_MSG_RESULT(yes) ;;*) AC_MSG_ERROR([Expect can't be cross compiled]) ;;esac])AC_MSG_CHECKING([if TIOCGWINSZ in termios.h])AC_TRY_RUN([/* including termios.h on Solaris 5.6 fails unless inttypes.h included */#ifdef HAVE_INTTYPES_H#include <inttypes.h>#endif#include <termios.h>main() {#ifdef TIOCGWINSZreturn 0;#elsereturn 1;#endif}],AC_DEFINE(HAVE_TIOCGWINSZ_IN_TERMIOS_H)AC_MSG_RESULT(yes),AC_MSG_RESULT(no),[case "${host}" in*-*-cygwin*) AC_DEFINE(HAVE_TIOCGWINSZ_IN_TERMIOS_H)AC_MSG_RESULT(yes) ;;*) AC_MSG_ERROR([Expect can't be cross compiled]) ;;esac])# finally check for Cray style ttysAC_MSG_CHECKING([for Cray-style ptys])SETUID=":"AC_TRY_RUN([main(){#ifdef CRAYreturn 0;#elsereturn 1;#endif}],PTY_TYPE=unicosSETUID="chmod u+s"AC_MSG_RESULT(yes),AC_MSG_RESULT(no),[case "${host}" in*-*-cygwin*) AC_MSG_RESULT(no) ;;*) AC_MSG_ERROR([Expect can't be cross compiled]) ;;esac])## Check for select and/or poll. If both exist, we prefer select.# if neither exists, define SIMPLE_EVENT.#select=0poll=0unset ac_cv_func_selectAC_CHECK_FUNC(select, select=1)AC_CHECK_FUNC(poll, poll=1)AC_MSG_CHECKING([event handling])if test $select -eq 1 ; thenEVENT_TYPE=selectEVENT_ABLE=eventAC_MSG_RESULT(via select)elif test $poll -eq 1 ; thenEVENT_TYPE=pollEVENT_ABLE=eventAC_MSG_RESULT(via poll)elseEVENT_TYPE=simpleEVENT_ABLE=noeventAC_MSG_RESULT(none)AC_DEFINE(SIMPLE_EVENT)fiAC_HAVE_FUNCS(_getpty)AC_HAVE_FUNCS(getpty)## check for timezones#AC_MSG_CHECKING([for SV-style timezone])AC_TRY_RUN([extern char *tzname[2];extern int daylight;main(){int *x = &daylight;char **y = tzname;exit(0);}],AC_DEFINE(HAVE_SV_TIMEZONE)AC_MSG_RESULT(yes),AC_MSG_RESULT(no),[case "${host}" in*-*-cygwin*) AC_MSG_RESULT(no) ;;*) AC_MSG_ERROR([Expect can't be cross compiled]) ;;esac])# only look for Tk stuff if we have X11 and user doesn't say not toAC_ARG_WITH(x, [ --with-x whether or not to use X (default yes)], , with_x=yes)if test "$with_x" = "no"; thenno_tk=trueelseCY_AC_PATH_TKHfiif test x"$no_tk" != x"true" ; then# libexpectk no longer exists# X_PROGS="expectk \$(LIBEXPECTK)"X_PROGS=expectk# should really generate following symbol, but I'm hitting configure's limit on substs.X_PROGS_INSTALLED=expectk_installedelseX_PROGS="# no X support on this system"AC_MSG_WARN([No X based programs will be built])echo " WARNING: Can't find Tk headers or library. You can still"echo " build expect, but not expectk. See Expect's README for"echo " information on how to obtain Tk. If Tk is installed, see"echo " Expect's INSTALL on how to tell configure where Tk is"echo " installed."fi# consume these flags so that user can invoke Expect's configure with# the same command as Tcl's configureAC_ARG_ENABLE(load,[ --disable-load disallow dynamic loading],[disable_dl=$enableval], [disable_dl=no])AC_ARG_ENABLE(gcc,[ --enable-gcc allow use of gcc if available],[enable_gcc=$enableval], [enable_gcc=no])# Following comment stolen from Tcl's configure.in:# Note: in the following variable, it's important to use the absolute# path name of the Tcl directory rather than "..": this is because# AIX remembers this path and will attempt to use it at run-time to look# up the Tcl library.if test "${TCL_LIB_VERSIONS_OK}" = "ok"; thenEXP_LIB_VERSION=$EXP_VERSIONelseEXP_LIB_VERSION=$EXP_VERSION_NODOTSfiif test $iunix -eq 1 ; thenEXP_LIB_VERSION=$EXP_VERSION_NODOTSfi# also remove dots on systems that don't support filenames > 14# (are there systems which support shared libs and restrict filename lengths!?)AC_SYS_LONG_FILE_NAMESif test $ac_cv_sys_long_file_names = no; thenEXP_LIB_VERSION=$EXP_VERSION_NODOTSfiEXP_BUILD_LIB_SPEC="-L`pwd` -lexpect${EXP_LIB_VERSION}"EXP_LIB_SPEC="-L\${exec_prefix}/lib -lexpect${EXP_LIB_VERSION}"EXP_UNSHARED_LIB_FILE=libexpect${EXP_LIB_VERSION}.aEXP_BUILD_LIB_SPEC=${EXP_UNSHARED_LIB_FILE}AC_MSG_CHECKING([for type of library to build])if test "$enable_shared" = "yes" && test "x${TCL_SHLIB_SUFFIX}" != "x" ; thenEXP_SHLIB_CFLAGS=$TCL_SHLIB_CFLAGS# EXP_SHARED_LIB_FILE=libexpect$EXP_LIB_VERSION$TCL_SHLIB_SUFFIXeval "EXP_SHARED_LIB_FILE=libexpect${TCL_SHARED_LIB_SUFFIX}"EXP_LIB_FILE=$EXP_SHARED_LIB_FILEEXP_LIB_FILES="$EXP_SHARED_LIB_FILE $EXP_UNSHARED_LIB_FILE"AC_MSG_RESULT(both shared and unshared)elseEXP_SHLIB_CFLAGS=EXP_SHARED_LIB_FILE="reconfigure_Tcl_for_shared_library"EXP_LIB_FILE=$EXP_UNSHARED_LIB_FILEEXP_LIB_FILES="$EXP_UNSHARED_LIB_FILE"AC_MSG_RESULT(unshared)fi# CYGNUS LOCAL# We always link expect statically (against $EXP_UNSHARED_LIB_FILE)# so we can run it out of the build directory without hurting# ourselves and others.dnl EXP_LIB_FILE=$EXP_UNSHARED_LIB_FILE# now broken out into EXP_AND_TCL_LIBS and EXP_AND_TK_LIBS. Had to do this# in order to avoid repeating lib specs to which some systems object.EXP_AND_TCL_LIBS="$EXP_AND_TCL_LIBS $TCL_LD_SEARCH_FLAGS"EXP_AND_TK_LIBS="$EXP_AND_TK_LIBS $TCL_LD_SEARCH_FLAGS"# Sigh - Tcl defines SHLIB_LD_LIBS to be either empty or ${LIBS} and# LIBS is intended to be expanded by Make. But since we're too close# to hitting config's max symbols, pack everything together here and# do test ourselves. Ugh.#if test "x$TCL_SHLIB_LD_LIBS" = "x" ; thenEXP_SHLIB_LD_LIBS=""else# seems a little strange to build in Tcl's build-lib, but# that's what Tk does.EXP_SHLIB_LD_LIBS="$TCL_BUILD_LIB_SPEC $TCL_DL_LIBS $LIBS -lc"fidnl CYGNUS LOCALdnl check for win32 dependenciesCY_AC_CYGWIN32CY_AC_EXEEXT#--------------------------------------------------------------------# This section is based on analogous thing in Tk installation. - DEL# Various manipulations on the search path used at runtime to# find shared libraries:# 2. On systems such as AIX and Ultrix that use "-L" as the# search path option, colons cannot be used to separate# directories from each other. Change colons to " -L".# 3. Create two sets of search flags, one for use in cc lines# and the other for when the linker is invoked directly. In# the second case, '-Wl,' must be stripped off and commas must# be replaced by spaces.#--------------------------------------------------------------------LIB_RUNTIME_DIR='${LIB_RUNTIME_DIR}'# If Tcl and Expect are installed in different places, adjust the library# search path to reflect this.if test "$TCL_EXEC_PREFIX" != "$exec_prefix"; thenLIB_RUNTIME_DIR="${LIB_RUNTIME_DIR}:${TCL_EXEC_PREFIX}"fiif test "${TCL_LD_SEARCH_FLAGS}" = '-L${LIB_RUNTIME_DIR}'; thenLIB_RUNTIME_DIR=`echo ${LIB_RUNTIME_DIR} |sed -e 's/:/ -L/g'`fi# The statement below is very tricky! It actually *evaluates* the# string in TCL_LD_SEARCH_FLAGS, which causes a substitution of the# variable LIB_RUNTIME_DIR.eval "EXP_CC_SEARCH_FLAGS=\"$TCL_LD_SEARCH_FLAGS\""if test "$GCC" = yes; thentrueelseEXP_LD_SEARCH_FLAGS=`echo ${EXP_CC_SEARCH_FLAGS} |sed -e "s|-Wl,||g" -e "s|,| |g"`fi## Set up makefile substitutions#AC_SUBST(EXP_MAJOR_VERSION)AC_SUBST(EXP_MINOR_VERSION)AC_SUBST(EXP_MICRO_VERSION)AC_SUBST(EXP_VERSION_FULL)AC_SUBST(EXP_VERSION)AC_SUBST(CC)AC_SUBST(EXP_CONFIG_SHELL)AC_SUBST(EXP_SHARED_LIB_FILE)AC_SUBST(EXP_UNSHARED_LIB_FILE)AC_SUBST(EXP_SHLIB_CFLAGS)AC_SUBST(EXP_LIB_FILE)AC_SUBST(EXP_LIB_FILES)AC_SUBST(EXP_BUILD_LIB_SPEC)AC_SUBST(EXP_LIB_SPEC)AC_SUBST(EXP_CFLAGS)AC_SUBST(EXP_LDFLAGS)AC_SUBST(EXP_LD_SEARCH_FLAGS)AC_SUBST(EXP_AND_TCL_LIBS)AC_SUBST(EXP_AND_TK_LIBS)AC_SUBST(EXP_SHLIB_LD_LIBS)AC_SUBST(X_PROGS)AC_SUBST(PTY_TYPE)AC_SUBST(EVENT_TYPE)AC_SUBST(EVENT_ABLE)AC_SUBST(SETUID)AC_SUBST(UNSHARED_RANLIB)AC_SUBST(DEFAULT_STTY_ARGS)AC_OUTPUT(Makefile pkgIndex)
