Expect

Changes On Branch expect-5-31-branch
Login

Changes On Branch expect-5-31-branch

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch expect-5-31-branch Excluding Merge-Ins

This is equivalent to a diff from 40fecde99d to 2aad6778b7

1999-12-31
01:02
Scriptics reported memory leak. Was bug in parse_expect_args. Leaf check-in: 2aad6778b7 user: libes tags: trunk, expect-5-31-branch, master-UNNAMED-BRANCH
1999-12-22
17:45
Clib was hanging because status_pipe wasn't being closed. check-in: c5e0b402df user: libes tags: trunk, expect-5-31-branch, master-UNNAMED-BRANCH
1999-12-04
06:18
Fixes to library. Testing new fix to system command. check-in: 6b8599b569 user: libes tags: trunk, expect-5-31-branch, master-UNNAMED-BRANCH
1999-11-02
02:11
Touched file so that it is newer than configure.in. Leaf check-in: 40fecde99d user: wart tags: trunk, scriptics-sc-1-0-branch, master-UNNAMED-BRANCH
02:02
merged configure.in check-in: 997b5a3fdf user: libes tags: trunk, scriptics-sc-1-0-branch, master-UNNAMED-BRANCH

Changes to HISTORY.

1
2
3
4
5











































6
7
8
9
10
11
12
This is the HISTORY file for Expect.  Modifications made by Cygnus
support are in ChangeLog. - Don

Date	Version	Description
-------	-------	------------------------------------------------------











































11/1/99 5.31.3	Shlomi Mahlab <[email protected]> noted all.tcl in CVS
		but not distribution.

		More notes from Keith Brown on HP cc complaints in exp_pty.c.

10/28/99 5.31.2	"Keith Brown" <[email protected]> noted that HP cc
		objected to auto aggregate initialization in





>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
This is the HISTORY file for Expect.  Modifications made by Cygnus
support are in ChangeLog. - Don

Date	Version	Description
-------	-------	------------------------------------------------------
		Scriptics reported memory leak.  Was bug in parse_expect_args.

		"Michael P. Reilly" <[email protected]> noted clib was hanging
		in spawn code.  status_pipe wasn't being closed.

		Egil Kvaleberg <[email protected]> provided fix due to new gcc
		which defines strchr as a macro.

		Dave Morrison <[email protected]> noted some printfs
		in exp_log.c that misinterpreted embedded %'s with resulting
		core dumps.

		Dick Goodwin <[email protected]> noted that "system echo
		foo" returned with no apparent effect.  Due to closeonexec
		in expect's channel driver.  Added skip if std channel.
		Fixed similar bug in stty command.  Minor bug left in stty
		which isn't passing output back from underlying exec.

		Stacy W. Smith <[email protected]> provided patch that uses
		sigsetjmp instead of setjmp that he says fixes a problem he
		encountered with C lib where it stopped timing out in expect()
		as if the signals were corrupted.  The man page doesn't
		explain the difference between these calls in a way that makes
		sense as to why they should make a difference, but I'll the
		names are certainly suggestive so I'll try it.  He says "it
		  appears that the linux setjmp behaves a little differently
		  compared to setjmp on some other OSs.  Specifically, setjmp
		  on linux does not save the signal context.  It seems most
		  BSDish OSs do save the signal context with setjmp.  On those
		  machines, it appears setjmp(env) is equivalent to
		  sigsetjmp(env,1) whereas on linux, setjmp(env) is equivalent
		  to sigsetjmp(env,0).  My patch made a (probably bad)
		  assumption that if siglongjmp() exists that we should use
		  the sigXXX versions.  I specifically tested for siglongjmp 
		  rather than sigsetjmp because on linux, sigsetjmp is just a
		  #define for  __sigsetjmp.  It appears that linux will give
		  the BSD behaviour if  __FAVOR_BSD is defined, but I didn't
		  know what other implications that might have.

		Michael Schumacher provided fix so that test for whether
		configure was out-of-date worked when not using the default
		build dir.

11/1/99 5.31.3	Shlomi Mahlab <[email protected]> noted all.tcl in CVS
		but not distribution.

		More notes from Keith Brown on HP cc complaints in exp_pty.c.

10/28/99 5.31.2	"Keith Brown" <[email protected]> noted that HP cc
		objected to auto aggregate initialization in

Changes to configure.

588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
else
  echo "$ac_t""no" 1>&6
fi

found=no
echo $ac_n "checking configure up to date""... $ac_c" 1>&6
echo "configure:595: checking configure up to date" >&5
for i in `cd ${srcdir} ; ls -tr configure configure.in Makefile.in` ; do
  newest=$i
done
if test "configure" = "$newest" ; then
  echo "$ac_t""yes" 1>&6
else
  echo "$ac_t""no" 1>&6
fi
if test $found = "no" -a "$newest" != "configure" ; then
  echo "configure: warning: configure appears to be old (configure.in and/or Makefile.in are newer) and the autoconf program to fix this situation was not found.  If you've no idea what this means, enter the command \"touch configure\" and restart configure." 1>&2
  exit
fi

ac_aux_dir=
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
  if test -f $ac_dir/install-sh; then
    ac_aux_dir=$ac_dir







|


|




|
|







588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
else
  echo "$ac_t""no" 1>&6
fi

found=no
echo $ac_n "checking configure up to date""... $ac_c" 1>&6
echo "configure:595: checking configure up to date" >&5
for i in `ls -tr ${srcdir}/configure ${srcdir}/configure.in ${srcdir}/Makefile.in` ; do
  newest=$i
done
if test "$srcdir/configure" = "$newest" ; then
  echo "$ac_t""yes" 1>&6
else
  echo "$ac_t""no" 1>&6
fi
if test $found = "no" -a "$newest" != "$srcdir/configure" ; then
  echo "configure: warning: $srcdir/configure appears to be old ($srcdir/configure.in and/or $srcdir/Makefile.in are newer) and the autoconf program to fix this situation was not found.  If you've no idea what this means, enter the command \"touch $srcdir/configure\" and restart $srcdir/configure." 1>&2
  exit
fi

ac_aux_dir=
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
  if test -f $ac_dir/install-sh; then
    ac_aux_dir=$ac_dir
4733
4734
4735
4736
4737
4738
4739















4740




































4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
#define HAVE_TIMEZONE 1
EOF

else
  echo "$ac_t""no" 1>&6
fi





















































# 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 arguments
echo $ac_n "checking for memcpy""... $ac_c" 1>&6
echo "configure:4746: checking for memcpy" >&5
cat > conftest.$ac_ext <<EOF
#line 4748 "configure"
#include "confdefs.h"

int main() {

char *s1, *s2;
memcpy(s1,s2,0);

; return 0; }
EOF
if { (eval echo configure:4758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
	cat >> confdefs.h <<\EOF
#define HAVE_MEMCPY 1
EOF

	







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>




|

|









|







4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
#define HAVE_TIMEZONE 1
EOF

else
  echo "$ac_t""no" 1>&6
fi

echo $ac_n "checking for siglongjmp""... $ac_c" 1>&6
echo "configure:4742: checking for siglongjmp" >&5
if eval "test \"`echo '$''{'ac_cv_func_siglongjmp'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4747 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char siglongjmp(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char siglongjmp();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_siglongjmp) || defined (__stub___siglongjmp)
choke me
#else
siglongjmp();
#endif

; return 0; }
EOF
if { (eval echo configure:4770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_siglongjmp=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_siglongjmp=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'siglongjmp`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define HAVE_SIGLONGJMP 1
EOF

else
  echo "$ac_t""no" 1>&6
fi


# 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 arguments
echo $ac_n "checking for memcpy""... $ac_c" 1>&6
echo "configure:4797: checking for memcpy" >&5
cat > conftest.$ac_ext <<EOF
#line 4799 "configure"
#include "confdefs.h"

int main() {

char *s1, *s2;
memcpy(s1,s2,0);

; return 0; }
EOF
if { (eval echo configure:4809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
	cat >> confdefs.h <<\EOF
#define HAVE_MEMCPY 1
EOF

	
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
rm -f conftest*

# 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.
echo $ac_n "checking if WNOHANG requires _POSIX_SOURCE""... $ac_c" 1>&6
echo "configure:4780: checking if WNOHANG requires _POSIX_SOURCE" >&5
if test "$cross_compiling" = yes; then
  { echo "configure: error: Expect can't be cross compiled" 1>&2; exit 1; }

else
  cat > conftest.$ac_ext <<EOF
#line 4786 "configure"
#include "confdefs.h"

#include <sys/wait.h>
main() {
#ifndef WNOHANG
	return 0;
#else
	return 1;
#endif
}
EOF
if { (eval echo configure:4798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  echo "$ac_t""yes" 1>&6
	cat >> confdefs.h <<\EOF
#define WNOHANG_REQUIRES_POSIX_SOURCE 1
EOF


else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  echo "$ac_t""no" 1>&6

fi
rm -fr conftest*
fi


echo $ac_n "checking if any value exists for WNOHANG""... $ac_c" 1>&6
echo "configure:4818: checking if any value exists for WNOHANG" >&5
rm -rf wnohang
if test "$cross_compiling" = yes; then
  { echo "configure: error: Expect can't be cross compiled" 1>&2; exit 1; }

else
  cat > conftest.$ac_ext <<EOF
#line 4825 "configure"
#include "confdefs.h"

#include <stdio.h>
#include <sys/wait.h>
main() {
#ifdef WNOHANG
	FILE *fp = fopen("wnohang","w");
	fprintf(fp,"%d",WNOHANG);
	fclose(fp);
	return 0;
#else
	return 1;
#endif
}
EOF
if { (eval echo configure:4841: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  echo "$ac_t""yes" 1>&6
	cat >> confdefs.h <<EOF
#define WNOHANG_BACKUP_VALUE `cat wnohang`
EOF

	rm -f wnohang







|





|











|



















|






|















|







4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
rm -f conftest*

# 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.
echo $ac_n "checking if WNOHANG requires _POSIX_SOURCE""... $ac_c" 1>&6
echo "configure:4831: checking if WNOHANG requires _POSIX_SOURCE" >&5
if test "$cross_compiling" = yes; then
  { echo "configure: error: Expect can't be cross compiled" 1>&2; exit 1; }

else
  cat > conftest.$ac_ext <<EOF
#line 4837 "configure"
#include "confdefs.h"

#include <sys/wait.h>
main() {
#ifndef WNOHANG
	return 0;
#else
	return 1;
#endif
}
EOF
if { (eval echo configure:4849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  echo "$ac_t""yes" 1>&6
	cat >> confdefs.h <<\EOF
#define WNOHANG_REQUIRES_POSIX_SOURCE 1
EOF


else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  echo "$ac_t""no" 1>&6

fi
rm -fr conftest*
fi


echo $ac_n "checking if any value exists for WNOHANG""... $ac_c" 1>&6
echo "configure:4869: checking if any value exists for WNOHANG" >&5
rm -rf wnohang
if test "$cross_compiling" = yes; then
  { echo "configure: error: Expect can't be cross compiled" 1>&2; exit 1; }

else
  cat > conftest.$ac_ext <<EOF
#line 4876 "configure"
#include "confdefs.h"

#include <stdio.h>
#include <sys/wait.h>
main() {
#ifdef WNOHANG
	FILE *fp = fopen("wnohang","w");
	fprintf(fp,"%d",WNOHANG);
	fclose(fp);
	return 0;
#else
	return 1;
#endif
}
EOF
if { (eval echo configure:4892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  echo "$ac_t""yes" 1>&6
	cat >> confdefs.h <<EOF
#define WNOHANG_BACKUP_VALUE `cat wnohang`
EOF

	rm -f wnohang
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
#	"union wait" correctly.  It's needed because of weirdness in
#	HP-UX where "union wait" is defined in both the BSD and SYS-V
#	environments.  Checking the usability of WIFEXITED seems to do
#	the trick.
#--------------------------------------------------------------------

echo $ac_n "checking union wait""... $ac_c" 1>&6
echo "configure:4874: checking union wait" >&5
cat > conftest.$ac_ext <<EOF
#line 4876 "configure"
#include "confdefs.h"
#include <sys/types.h> 
#include <sys/wait.h>
int main() {

union wait x;
WIFEXITED(x);		/* Generates compiler error if WIFEXITED
			 * uses an int. */

; return 0; }
EOF
if { (eval echo configure:4888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  tcl_ok=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  tcl_ok=no







|

|











|







4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
#	"union wait" correctly.  It's needed because of weirdness in
#	HP-UX where "union wait" is defined in both the BSD and SYS-V
#	environments.  Checking the usability of WIFEXITED seems to do
#	the trick.
#--------------------------------------------------------------------

echo $ac_n "checking union wait""... $ac_c" 1>&6
echo "configure:4925: checking union wait" >&5
cat > conftest.$ac_ext <<EOF
#line 4927 "configure"
#include "confdefs.h"
#include <sys/types.h> 
#include <sys/wait.h>
int main() {

union wait x;
WIFEXITED(x);		/* Generates compiler error if WIFEXITED
			 * uses an int. */

; return 0; }
EOF
if { (eval echo configure:4939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  tcl_ok=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  tcl_ok=no
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944

# 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.
echo $ac_n "checking mask type of select""... $ac_c" 1>&6
echo "configure:4918: checking mask type of select" >&5
if egrep "select\(size_t, int" /usr/include/sys/time.h >/dev/null 2>&1; then
  echo "$ac_t""int" 1>&6
  cat >> confdefs.h <<\EOF
#define SELECT_MASK_TYPE int
EOF

else
  echo "$ac_t""none" 1>&6
fi


# FIXME: check if alarm exists
echo $ac_n "checking if signals need to be re-armed""... $ac_c" 1>&6
echo "configure:4932: checking if signals need to be re-armed" >&5
if test "$cross_compiling" = yes; then
  echo "configure: warning: Expect can't be cross compiled" 1>&2

else
  cat > conftest.$ac_ext <<EOF
#line 4938 "configure"
#include "confdefs.h"

#include <signal.h>
#define RETSIGTYPE $retsigtype

int signal_rearms = 0;








|













|





|







4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995

# 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.
echo $ac_n "checking mask type of select""... $ac_c" 1>&6
echo "configure:4969: checking mask type of select" >&5
if egrep "select\(size_t, int" /usr/include/sys/time.h >/dev/null 2>&1; then
  echo "$ac_t""int" 1>&6
  cat >> confdefs.h <<\EOF
#define SELECT_MASK_TYPE int
EOF

else
  echo "$ac_t""none" 1>&6
fi


# FIXME: check if alarm exists
echo $ac_n "checking if signals need to be re-armed""... $ac_c" 1>&6
echo "configure:4983: checking if signals need to be re-armed" >&5
if test "$cross_compiling" = yes; then
  echo "configure: warning: Expect can't be cross compiled" 1>&2

else
  cat > conftest.$ac_ext <<EOF
#line 4989 "configure"
#include "confdefs.h"

#include <signal.h>
#define RETSIGTYPE $retsigtype

int signal_rearms = 0;

4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983

		wait(&status);
		unlink("core");
		exit(signal_rearms);
	}
}
EOF
if { (eval echo configure:4977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  echo "$ac_t""yes" 1>&6
	cat >> confdefs.h <<\EOF
#define REARM_SIG 1
EOF









|







5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034

		wait(&status);
		unlink("core");
		exit(signal_rearms);
	}
}
EOF
if { (eval echo configure:5028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  echo "$ac_t""yes" 1>&6
	cat >> confdefs.h <<\EOF
#define REARM_SIG 1
EOF


5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
#

# 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.
echo $ac_n "checking if on Convex""... $ac_c" 1>&6
echo "configure:5008: checking if on Convex" >&5
convex=0
case "${host}" in
  c[12]-*-*)		convex=1;;
esac

if test $convex -eq 1 ; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define CONVEX 1
EOF

else
  echo "$ac_t""no" 1>&6
fi

EXP_LDFLAGS="$LDFLAGS"

echo $ac_n "checking if on NeXT""... $ac_c" 1>&6
echo "configure:5027: checking if on NeXT" >&5
if test -r /NextApps ; then
  echo "$ac_t""yes" 1>&6
  # "-m" flag suppresses complaints about multiple strtod
  EXP_LDFLAGS="$EXP_LDFLAGS -m"
else
  echo "$ac_t""no" 1>&6
fi


echo $ac_n "checking if on HP""... $ac_c" 1>&6
echo "configure:5038: checking if on HP" >&5
if test "x`(uname) 2>/dev/null`" = xHP-UX; then
  echo "$ac_t""yes" 1>&6
  hp=1
else
  echo "$ac_t""no" 1>&6
  hp=0
fi

echo $ac_n "checking sane default stty arguments""... $ac_c" 1>&6
echo "configure:5048: checking sane default stty arguments" >&5
DEFAULT_STTY_ARGS="sane"

if test $mach -eq 1 ; then
	DEFAULT_STTY_ARGS="cooked"
fi

if test $hp -eq 1 ; then
	DEFAULT_STTY_ARGS="sane kill "
fi

echo "$ac_t""$DEFAULT_STTY_ARG" 1>&6

# 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.
#
echo $ac_n "checking for HP style pty allocation""... $ac_c" 1>&6
echo "configure:5066: checking for HP style pty allocation" >&5
# following test fails on DECstations and other things that don't grok -c
# but that's ok, since they don't have PTYMs anyway
if test -r /dev/ptym/ptyp0 2>/dev/null ; then
    echo "$ac_t""yes" 1>&6
    cat >> confdefs.h <<\EOF
#define HAVE_PTYM 1
EOF

else
    echo "$ac_t""no" 1>&6
fi

echo $ac_n "checking for HP style pty trapping""... $ac_c" 1>&6
echo "configure:5080: checking for HP style pty trapping" >&5
cat > conftest.$ac_ext <<EOF
#line 5082 "configure"
#include "confdefs.h"
#include <sys/ptyio.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "struct.*request_info" >/dev/null 2>&1; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6







|


















|










|









|

















|













|

|







5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
#

# 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.
echo $ac_n "checking if on Convex""... $ac_c" 1>&6
echo "configure:5059: checking if on Convex" >&5
convex=0
case "${host}" in
  c[12]-*-*)		convex=1;;
esac

if test $convex -eq 1 ; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define CONVEX 1
EOF

else
  echo "$ac_t""no" 1>&6
fi

EXP_LDFLAGS="$LDFLAGS"

echo $ac_n "checking if on NeXT""... $ac_c" 1>&6
echo "configure:5078: checking if on NeXT" >&5
if test -r /NextApps ; then
  echo "$ac_t""yes" 1>&6
  # "-m" flag suppresses complaints about multiple strtod
  EXP_LDFLAGS="$EXP_LDFLAGS -m"
else
  echo "$ac_t""no" 1>&6
fi


echo $ac_n "checking if on HP""... $ac_c" 1>&6
echo "configure:5089: checking if on HP" >&5
if test "x`(uname) 2>/dev/null`" = xHP-UX; then
  echo "$ac_t""yes" 1>&6
  hp=1
else
  echo "$ac_t""no" 1>&6
  hp=0
fi

echo $ac_n "checking sane default stty arguments""... $ac_c" 1>&6
echo "configure:5099: checking sane default stty arguments" >&5
DEFAULT_STTY_ARGS="sane"

if test $mach -eq 1 ; then
	DEFAULT_STTY_ARGS="cooked"
fi

if test $hp -eq 1 ; then
	DEFAULT_STTY_ARGS="sane kill "
fi

echo "$ac_t""$DEFAULT_STTY_ARG" 1>&6

# 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.
#
echo $ac_n "checking for HP style pty allocation""... $ac_c" 1>&6
echo "configure:5117: checking for HP style pty allocation" >&5
# following test fails on DECstations and other things that don't grok -c
# but that's ok, since they don't have PTYMs anyway
if test -r /dev/ptym/ptyp0 2>/dev/null ; then
    echo "$ac_t""yes" 1>&6
    cat >> confdefs.h <<\EOF
#define HAVE_PTYM 1
EOF

else
    echo "$ac_t""no" 1>&6
fi

echo $ac_n "checking for HP style pty trapping""... $ac_c" 1>&6
echo "configure:5131: checking for HP style pty trapping" >&5
cat > conftest.$ac_ext <<EOF
#line 5133 "configure"
#include "confdefs.h"
#include <sys/ptyio.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "struct.*request_info" >/dev/null 2>&1; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157



































































































5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
  echo "$ac_t""no" 1>&6

fi
rm -f conftest*


echo $ac_n "checking for AIX new-style pty allocation""... $ac_c" 1>&6
echo "configure:5104: checking for AIX new-style pty allocation" >&5
if test -r /dev/ptc -a -r /dev/pts ; then
    echo "$ac_t""yes" 1>&6
    cat >> confdefs.h <<\EOF
#define HAVE_PTC_PTS 1
EOF

else
    echo "$ac_t""no" 1>&6
fi

echo $ac_n "checking for SGI old-style pty allocation""... $ac_c" 1>&6
echo "configure:5116: checking for SGI old-style pty allocation" >&5
if test -r /dev/ptc -a ! -r /dev/pts ; then
    echo "$ac_t""yes" 1>&6
    cat >> confdefs.h <<\EOF
#define HAVE_PTC 1
EOF

else
    echo "$ac_t""no" 1>&6
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.
#
echo $ac_n "checking for SCO style pty allocation""... $ac_c" 1>&6
echo "configure:5133: checking for SCO style pty allocation" >&5
sco_ptys=""
case "${host}" in
  *-sco3.2v[45]*)	sco_clist_ptys=1 svr4_ptys_broken=1;;
esac

if test x"${sco_clist_ptys}" != x"" ; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define HAVE_SCO_CLIST_PTYS 1
EOF

else
  echo "$ac_t""no" 1>&6
fi

echo $ac_n "checking for SVR4 style pty allocation""... $ac_c" 1>&6
echo "configure:5150: checking for SVR4 style pty allocation" >&5
if test -r /dev/ptmx -a "x$svr4_ptys_broken" = x ; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define HAVE_PTMX 1
EOF

  # aargg. Some systems need libpt.a to use /dev/ptmx
  echo $ac_n "checking for ptsname""... $ac_c" 1>&6



































































































echo "configure:5159: checking for ptsname" >&5
if eval "test \"`echo '$''{'ac_cv_func_ptsname'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5164 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char ptsname(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */







|











|
















|
















|








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|




|







5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
  echo "$ac_t""no" 1>&6

fi
rm -f conftest*


echo $ac_n "checking for AIX new-style pty allocation""... $ac_c" 1>&6
echo "configure:5155: checking for AIX new-style pty allocation" >&5
if test -r /dev/ptc -a -r /dev/pts ; then
    echo "$ac_t""yes" 1>&6
    cat >> confdefs.h <<\EOF
#define HAVE_PTC_PTS 1
EOF

else
    echo "$ac_t""no" 1>&6
fi

echo $ac_n "checking for SGI old-style pty allocation""... $ac_c" 1>&6
echo "configure:5167: checking for SGI old-style pty allocation" >&5
if test -r /dev/ptc -a ! -r /dev/pts ; then
    echo "$ac_t""yes" 1>&6
    cat >> confdefs.h <<\EOF
#define HAVE_PTC 1
EOF

else
    echo "$ac_t""no" 1>&6
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.
#
echo $ac_n "checking for SCO style pty allocation""... $ac_c" 1>&6
echo "configure:5184: checking for SCO style pty allocation" >&5
sco_ptys=""
case "${host}" in
  *-sco3.2v[45]*)	sco_clist_ptys=1 svr4_ptys_broken=1;;
esac

if test x"${sco_clist_ptys}" != x"" ; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define HAVE_SCO_CLIST_PTYS 1
EOF

else
  echo "$ac_t""no" 1>&6
fi

echo $ac_n "checking for SVR4 style pty allocation""... $ac_c" 1>&6
echo "configure:5201: checking for SVR4 style pty allocation" >&5
if test -r /dev/ptmx -a "x$svr4_ptys_broken" = x ; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define HAVE_PTMX 1
EOF

  # aargg. Some systems need libpt.a to use /dev/ptmx
  echo $ac_n "checking for ptsname""... $ac_c" 1>&6
echo "configure:5210: checking for ptsname" >&5
if eval "test \"`echo '$''{'ac_cv_func_ptsname'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5215 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char ptsname(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char ptsname();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_ptsname) || defined (__stub___ptsname)
choke me
#else
ptsname();
#endif

; return 0; }
EOF
if { (eval echo configure:5238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_ptsname=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_ptsname=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'ptsname`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
LIBS="${LIBS} -lpt"
fi

  # I've never seen Tcl or Tk include -lpt so don't bother with explicit test
  echo $ac_n "checking for ptsname""... $ac_c" 1>&6
echo "configure:5260: checking for ptsname" >&5
if eval "test \"`echo '$''{'ac_cv_func_ptsname'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5265 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char ptsname(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char ptsname();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_ptsname) || defined (__stub___ptsname)
choke me
#else
ptsname();
#endif

; return 0; }
EOF
if { (eval echo configure:5288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_ptsname=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_ptsname=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'ptsname`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
EXP_AND_TCL_LIBS="${EXP_AND_TCL_LIBS} -lpt"
fi

  echo $ac_n "checking for ptsname""... $ac_c" 1>&6
echo "configure:5309: checking for ptsname" >&5
if eval "test \"`echo '$''{'ac_cv_func_ptsname'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5314 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char ptsname(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
choke me
#else
ptsname();
#endif

; return 0; }
EOF
if { (eval echo configure:5187: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_ptsname=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_ptsname=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'ptsname`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
LIBS="${LIBS} -lpt"
fi

  # I've never seen Tcl or Tk include -lpt so don't bother with explicit test
  echo $ac_n "checking for ptsname""... $ac_c" 1>&6
echo "configure:5209: checking for ptsname" >&5
if eval "test \"`echo '$''{'ac_cv_func_ptsname'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5214 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char ptsname(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char ptsname();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_ptsname) || defined (__stub___ptsname)
choke me
#else
ptsname();
#endif

; return 0; }
EOF
if { (eval echo configure:5237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_ptsname=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_ptsname=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'ptsname`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
EXP_AND_TCL_LIBS="${EXP_AND_TCL_LIBS} -lpt"
fi

  echo $ac_n "checking for ptsname""... $ac_c" 1>&6
echo "configure:5258: checking for ptsname" >&5
if eval "test \"`echo '$''{'ac_cv_func_ptsname'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5263 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char ptsname(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char ptsname();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_ptsname) || defined (__stub___ptsname)
choke me
#else
ptsname();
#endif

; return 0; }
EOF
if { (eval echo configure:5286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_ptsname=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_ptsname=no"







|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







5329
5330
5331
5332
5333
5334
5335
5336



































































































5337
5338
5339
5340
5341
5342
5343
choke me
#else
ptsname();
#endif

; return 0; }
EOF
if { (eval echo configure:5337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then



































































































  rm -rf conftest*
  eval "ac_cv_func_ptsname=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_ptsname=no"
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
else
  echo "$ac_t""no" 1>&6
fi

# In OSF/1 case, SVR4 are somewhat different.
# Gregory Depp <[email protected]> 17Aug93
echo $ac_n "checking for OSF/1 style pty allocation""... $ac_c" 1>&6
echo "configure:5313: checking for OSF/1 style pty allocation" >&5
if test -r /dev/ptmx_bsd ; then
    cat >> confdefs.h <<\EOF
#define HAVE_PTMX_BSD 1
EOF

    echo "$ac_t""yes" 1>&6
else
    echo "$ac_t""no" 1>&6
fi

tcgetattr=0
tcsetattr=0
echo $ac_n "checking for tcgetattr""... $ac_c" 1>&6
echo "configure:5327: checking for tcgetattr" >&5
if eval "test \"`echo '$''{'ac_cv_func_tcgetattr'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5332 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char tcgetattr(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */







|













|




|







5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
else
  echo "$ac_t""no" 1>&6
fi

# In OSF/1 case, SVR4 are somewhat different.
# Gregory Depp <[email protected]> 17Aug93
echo $ac_n "checking for OSF/1 style pty allocation""... $ac_c" 1>&6
echo "configure:5364: checking for OSF/1 style pty allocation" >&5
if test -r /dev/ptmx_bsd ; then
    cat >> confdefs.h <<\EOF
#define HAVE_PTMX_BSD 1
EOF

    echo "$ac_t""yes" 1>&6
else
    echo "$ac_t""no" 1>&6
fi

tcgetattr=0
tcsetattr=0
echo $ac_n "checking for tcgetattr""... $ac_c" 1>&6
echo "configure:5378: checking for tcgetattr" >&5
if eval "test \"`echo '$''{'ac_cv_func_tcgetattr'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5383 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char tcgetattr(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
choke me
#else
tcgetattr();
#endif

; return 0; }
EOF
if { (eval echo configure:5355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_tcgetattr=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_tcgetattr=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'tcgetattr`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  tcgetattr=1
else
  echo "$ac_t""no" 1>&6
fi

echo $ac_n "checking for tcsetattr""... $ac_c" 1>&6
echo "configure:5375: checking for tcsetattr" >&5
if eval "test \"`echo '$''{'ac_cv_func_tcsetattr'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5380 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char tcsetattr(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */







|



















|




|







5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
choke me
#else
tcgetattr();
#endif

; return 0; }
EOF
if { (eval echo configure:5406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_tcgetattr=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_tcgetattr=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'tcgetattr`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  tcgetattr=1
else
  echo "$ac_t""no" 1>&6
fi

echo $ac_n "checking for tcsetattr""... $ac_c" 1>&6
echo "configure:5426: checking for tcsetattr" >&5
if eval "test \"`echo '$''{'ac_cv_func_tcsetattr'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5431 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char tcsetattr(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
choke me
#else
tcsetattr();
#endif

; return 0; }
EOF
if { (eval echo configure:5403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_tcsetattr=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_tcsetattr=no"







|







5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
choke me
#else
tcsetattr();
#endif

; return 0; }
EOF
if { (eval echo configure:5454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_tcsetattr=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_tcsetattr=no"
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
#define POSIX 1
EOF

fi

# first check for the pure bsd
echo $ac_n "checking for struct sgttyb""... $ac_c" 1>&6
echo "configure:5435: checking for struct sgttyb" >&5
if test "$cross_compiling" = yes; then
  { echo "configure: error: Expect can't be cross compiled" 1>&2; exit 1; }

else
  cat > conftest.$ac_ext <<EOF
#line 5441 "configure"
#include "confdefs.h"

#include <sgtty.h>
main()
{
  struct sgttyb tmp;
  exit(0);
}
EOF
if { (eval echo configure:5451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  echo "$ac_t""yes" 1>&6
        cat >> confdefs.h <<\EOF
#define HAVE_SGTTYB 1
EOF

        PTY_TYPE=sgttyb







|





|









|







5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
#define POSIX 1
EOF

fi

# first check for the pure bsd
echo $ac_n "checking for struct sgttyb""... $ac_c" 1>&6
echo "configure:5486: checking for struct sgttyb" >&5
if test "$cross_compiling" = yes; then
  { echo "configure: error: Expect can't be cross compiled" 1>&2; exit 1; }

else
  cat > conftest.$ac_ext <<EOF
#line 5492 "configure"
#include "confdefs.h"

#include <sgtty.h>
main()
{
  struct sgttyb tmp;
  exit(0);
}
EOF
if { (eval echo configure:5502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  echo "$ac_t""yes" 1>&6
        cat >> confdefs.h <<\EOF
#define HAVE_SGTTYB 1
EOF

        PTY_TYPE=sgttyb
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
if 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.
  echo $ac_n "checking for struct termio""... $ac_c" 1>&6
echo "configure:5480: checking for struct termio" >&5
  if test "$cross_compiling" = yes; then
  { echo "configure: error: Expect can't be cross compiled" 1>&2; exit 1; }

else
  cat > conftest.$ac_ext <<EOF
#line 5486 "configure"
#include "confdefs.h"
#include <termio.h>
  main()
  {
    struct termio tmp;
    exit(0);
  }
EOF
if { (eval echo configure:5495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cat >> confdefs.h <<\EOF
#define HAVE_TERMIO 1
EOF

        PTY_TYPE=termios
        echo "$ac_t""yes" 1>&6







|





|








|







5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
if 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.
  echo $ac_n "checking for struct termio""... $ac_c" 1>&6
echo "configure:5531: checking for struct termio" >&5
  if test "$cross_compiling" = yes; then
  { echo "configure: error: Expect can't be cross compiled" 1>&2; exit 1; }

else
  cat > conftest.$ac_ext <<EOF
#line 5537 "configure"
#include "confdefs.h"
#include <termio.h>
  main()
  {
    struct termio tmp;
    exit(0);
  }
EOF
if { (eval echo configure:5546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cat >> confdefs.h <<\EOF
#define HAVE_TERMIO 1
EOF

        PTY_TYPE=termios
        echo "$ac_t""yes" 1>&6
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
fi
rm -fr conftest*
fi


  # now check for the new style ttys (not yet posix)
  echo $ac_n "checking for struct termios""... $ac_c" 1>&6
echo "configure:5517: checking for struct termios" >&5
  if test "$cross_compiling" = yes; then
  { echo "configure: error: Expect can't be cross compiled" 1>&2; exit 1; }
  
else
  cat > conftest.$ac_ext <<EOF
#line 5523 "configure"
#include "confdefs.h"

  /* including termios.h on Solaris 5.6 fails unless inttypes.h included */
#  ifdef HAVE_INTTYPES_H
#  include <inttypes.h>
#  endif
#  include <termios.h>
  main()
  {
    struct termios tmp;
    exit(0);
  }
EOF
if { (eval echo configure:5537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cat >> confdefs.h <<\EOF
#define HAVE_TERMIOS 1
EOF

        PTY_TYPE=termios
        echo "$ac_t""yes" 1>&6







|





|













|







5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
fi
rm -fr conftest*
fi


  # now check for the new style ttys (not yet posix)
  echo $ac_n "checking for struct termios""... $ac_c" 1>&6
echo "configure:5568: checking for struct termios" >&5
  if test "$cross_compiling" = yes; then
  { echo "configure: error: Expect can't be cross compiled" 1>&2; exit 1; }
  
else
  cat > conftest.$ac_ext <<EOF
#line 5574 "configure"
#include "confdefs.h"

  /* including termios.h on Solaris 5.6 fails unless inttypes.h included */
#  ifdef HAVE_INTTYPES_H
#  include <inttypes.h>
#  endif
#  include <termios.h>
  main()
  {
    struct termios tmp;
    exit(0);
  }
EOF
if { (eval echo configure:5588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cat >> confdefs.h <<\EOF
#define HAVE_TERMIOS 1
EOF

        PTY_TYPE=termios
        echo "$ac_t""yes" 1>&6
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
fi
rm -fr conftest*
fi

fi

echo $ac_n "checking if TCGETS or TCGETA in termios.h""... $ac_c" 1>&6
echo "configure:5559: checking if TCGETS or TCGETA in termios.h" >&5
if test "$cross_compiling" = yes; then
  { echo "configure: error: Expect can't be cross compiled" 1>&2; exit 1; }

else
  cat > conftest.$ac_ext <<EOF
#line 5565 "configure"
#include "confdefs.h"

/* 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;
#else
	return 1;
#endif
}
EOF
if { (eval echo configure:5581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cat >> confdefs.h <<\EOF
#define HAVE_TCGETS_OR_TCGETA_IN_TERMIOS_H 1
EOF

	echo "$ac_t""yes" 1>&6

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  echo "$ac_t""no" 1>&6

fi
rm -fr conftest*
fi


echo $ac_n "checking if TIOCGWINSZ in termios.h""... $ac_c" 1>&6
echo "configure:5601: checking if TIOCGWINSZ in termios.h" >&5
if test "$cross_compiling" = yes; then
  { echo "configure: error: Expect can't be cross compiled" 1>&2; exit 1; }

else
  cat > conftest.$ac_ext <<EOF
#line 5607 "configure"
#include "confdefs.h"

/* 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 TIOCGWINSZ
	return 0;
#else
	return 1;
#endif
}
EOF
if { (eval echo configure:5623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cat >> confdefs.h <<\EOF
#define HAVE_TIOCGWINSZ_IN_TERMIOS_H 1
EOF

	echo "$ac_t""yes" 1>&6

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  echo "$ac_t""no" 1>&6

fi
rm -fr conftest*
fi


# finally check for Cray style ttys
echo $ac_n "checking for Cray-style ptys""... $ac_c" 1>&6
echo "configure:5644: checking for Cray-style ptys" >&5
SETUID=":"
if test "$cross_compiling" = yes; then
  { echo "configure: error: Expect can't be cross compiled" 1>&2; exit 1; }

else
  cat > conftest.$ac_ext <<EOF
#line 5651 "configure"
#include "confdefs.h"

main(){
#ifdef CRAY
	return 0;
#else
	return 1;
#endif
}

EOF
if { (eval echo configure:5663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  PTY_TYPE=unicos
	SETUID="chmod u+s"
	echo "$ac_t""yes" 1>&6

else
  echo "configure: failed program was:" >&5







|





|















|



















|





|















|




















|






|











|







5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
fi
rm -fr conftest*
fi

fi

echo $ac_n "checking if TCGETS or TCGETA in termios.h""... $ac_c" 1>&6
echo "configure:5610: checking if TCGETS or TCGETA in termios.h" >&5
if test "$cross_compiling" = yes; then
  { echo "configure: error: Expect can't be cross compiled" 1>&2; exit 1; }

else
  cat > conftest.$ac_ext <<EOF
#line 5616 "configure"
#include "confdefs.h"

/* 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;
#else
	return 1;
#endif
}
EOF
if { (eval echo configure:5632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cat >> confdefs.h <<\EOF
#define HAVE_TCGETS_OR_TCGETA_IN_TERMIOS_H 1
EOF

	echo "$ac_t""yes" 1>&6

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  echo "$ac_t""no" 1>&6

fi
rm -fr conftest*
fi


echo $ac_n "checking if TIOCGWINSZ in termios.h""... $ac_c" 1>&6
echo "configure:5652: checking if TIOCGWINSZ in termios.h" >&5
if test "$cross_compiling" = yes; then
  { echo "configure: error: Expect can't be cross compiled" 1>&2; exit 1; }

else
  cat > conftest.$ac_ext <<EOF
#line 5658 "configure"
#include "confdefs.h"

/* 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 TIOCGWINSZ
	return 0;
#else
	return 1;
#endif
}
EOF
if { (eval echo configure:5674: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cat >> confdefs.h <<\EOF
#define HAVE_TIOCGWINSZ_IN_TERMIOS_H 1
EOF

	echo "$ac_t""yes" 1>&6

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  echo "$ac_t""no" 1>&6

fi
rm -fr conftest*
fi


# finally check for Cray style ttys
echo $ac_n "checking for Cray-style ptys""... $ac_c" 1>&6
echo "configure:5695: checking for Cray-style ptys" >&5
SETUID=":"
if test "$cross_compiling" = yes; then
  { echo "configure: error: Expect can't be cross compiled" 1>&2; exit 1; }

else
  cat > conftest.$ac_ext <<EOF
#line 5702 "configure"
#include "confdefs.h"

main(){
#ifdef CRAY
	return 0;
#else
	return 1;
#endif
}

EOF
if { (eval echo configure:5714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  PTY_TYPE=unicos
	SETUID="chmod u+s"
	echo "$ac_t""yes" 1>&6

else
  echo "configure: failed program was:" >&5
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
# Check for select and/or poll. If both exist, we prefer select.
# if neither exists, define SIMPLE_EVENT.
#
select=0
poll=0
unset ac_cv_func_select
echo $ac_n "checking for select""... $ac_c" 1>&6
echo "configure:5688: checking for select" >&5
if eval "test \"`echo '$''{'ac_cv_func_select'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5693 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char select(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */







|




|







5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
# Check for select and/or poll. If both exist, we prefer select.
# if neither exists, define SIMPLE_EVENT.
#
select=0
poll=0
unset ac_cv_func_select
echo $ac_n "checking for select""... $ac_c" 1>&6
echo "configure:5739: checking for select" >&5
if eval "test \"`echo '$''{'ac_cv_func_select'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5744 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char select(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
choke me
#else
select();
#endif

; return 0; }
EOF
if { (eval echo configure:5716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_select=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_select=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  select=1
else
  echo "$ac_t""no" 1>&6
fi

echo $ac_n "checking for poll""... $ac_c" 1>&6
echo "configure:5736: checking for poll" >&5
if eval "test \"`echo '$''{'ac_cv_func_poll'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5741 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char poll(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */







|



















|




|







5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
choke me
#else
select();
#endif

; return 0; }
EOF
if { (eval echo configure:5767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_select=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_select=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  select=1
else
  echo "$ac_t""no" 1>&6
fi

echo $ac_n "checking for poll""... $ac_c" 1>&6
echo "configure:5787: checking for poll" >&5
if eval "test \"`echo '$''{'ac_cv_func_poll'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5792 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char poll(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
choke me
#else
poll();
#endif

; return 0; }
EOF
if { (eval echo configure:5764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_poll=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_poll=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'poll`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  poll=1
else
  echo "$ac_t""no" 1>&6
fi

echo $ac_n "checking event handling""... $ac_c" 1>&6
echo "configure:5784: checking event handling" >&5
if test $select -eq 1 ; then
  EVENT_TYPE=select
  EVENT_ABLE=event
  echo "$ac_t""via select" 1>&6
elif test $poll -eq 1 ; then
  EVENT_TYPE=poll
  EVENT_ABLE=event







|



















|







5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
choke me
#else
poll();
#endif

; return 0; }
EOF
if { (eval echo configure:5815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_poll=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_poll=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'poll`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  poll=1
else
  echo "$ac_t""no" 1>&6
fi

echo $ac_n "checking event handling""... $ac_c" 1>&6
echo "configure:5835: checking event handling" >&5
if test $select -eq 1 ; then
  EVENT_TYPE=select
  EVENT_ABLE=event
  echo "$ac_t""via select" 1>&6
elif test $poll -eq 1 ; then
  EVENT_TYPE=poll
  EVENT_ABLE=event
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
EOF

fi

for ac_func in _getpty
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:5806: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5811 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */







|




|







5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
EOF

fi

for ac_func in _getpty
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:5857: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5862 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:5834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"







|







5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:5885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
  echo "$ac_t""no" 1>&6
fi
done

for ac_func in getpty
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:5861: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5866 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */







|




|







5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
  echo "$ac_t""no" 1>&6
fi
done

for ac_func in getpty
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:5912: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5917 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:5889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"







|







5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:5940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
  echo "$ac_t""no" 1>&6
fi
done


# following test sets SETPGRP_VOID if setpgrp takes 0 args, else takes 2
echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
echo "configure:5916: checking whether setpgrp takes no argument" >&5
if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; }
else
  cat > conftest.$ac_ext <<EOF
#line 5924 "configure"
#include "confdefs.h"

#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

/*
 * If this system has a BSD-style setpgrp, which takes arguments, exit
 * successfully.
 */
main()
{
    if (setpgrp(1,1) == -1)
	exit(0);
    else
	exit(1);
}

EOF
if { (eval echo configure:5944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_func_setpgrp_void=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_func_setpgrp_void=yes







|







|



















|







5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
  echo "$ac_t""no" 1>&6
fi
done


# following test sets SETPGRP_VOID if setpgrp takes 0 args, else takes 2
echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
echo "configure:5967: checking whether setpgrp takes no argument" >&5
if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; }
else
  cat > conftest.$ac_ext <<EOF
#line 5975 "configure"
#include "confdefs.h"

#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

/*
 * If this system has a BSD-style setpgrp, which takes arguments, exit
 * successfully.
 */
main()
{
    if (setpgrp(1,1) == -1)
	exit(0);
    else
	exit(1);
}

EOF
if { (eval echo configure:5995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_func_setpgrp_void=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_func_setpgrp_void=yes
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
fi


#
# check for timezones
#
echo $ac_n "checking for SV-style timezone""... $ac_c" 1>&6
echo "configure:5972: checking for SV-style timezone" >&5
if test "$cross_compiling" = yes; then
  { echo "configure: error: Expect can't be cross compiled" 1>&2; exit 1; }

else
  cat > conftest.$ac_ext <<EOF
#line 5978 "configure"
#include "confdefs.h"

extern char *tzname[2];
extern int daylight;
main()
{
  int *x = &daylight;
  char **y = tzname;

  exit(0);
}
EOF
if { (eval echo configure:5991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cat >> confdefs.h <<\EOF
#define HAVE_SV_TIMEZONE 1
EOF

	echo "$ac_t""yes" 1>&6
else







|





|












|







6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
fi


#
# check for timezones
#
echo $ac_n "checking for SV-style timezone""... $ac_c" 1>&6
echo "configure:6023: checking for SV-style timezone" >&5
if test "$cross_compiling" = yes; then
  { echo "configure: error: Expect can't be cross compiled" 1>&2; exit 1; }

else
  cat > conftest.$ac_ext <<EOF
#line 6029 "configure"
#include "confdefs.h"

extern char *tzname[2];
extern int daylight;
main()
{
  int *x = &daylight;
  char **y = tzname;

  exit(0);
}
EOF
if { (eval echo configure:6042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cat >> confdefs.h <<\EOF
#define HAVE_SV_TIMEZONE 1
EOF

	echo "$ac_t""yes" 1>&6
else
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
# recursive cache variables for the path will work right. We check all
# the possible paths in one loop rather than many seperate loops to speed
# things up.
# the alternative search directory is involked by --with-tkinclude
#
#no_tk=true
echo $ac_n "checking for Tk private headers""... $ac_c" 1>&6
echo "configure:6037: checking for Tk private headers" >&5
# Check whether --with-tkinclude or --without-tkinclude was given.
if test "${with_tkinclude+set}" = set; then
  withval="$with_tkinclude"
  with_tkinclude=${withval}
fi

if eval "test \"`echo '$''{'ac_cv_c_tkh'+set}'`\" = set"; then







|







6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
# recursive cache variables for the path will work right. We check all
# the possible paths in one loop rather than many seperate loops to speed
# things up.
# the alternative search directory is involked by --with-tkinclude
#
#no_tk=true
echo $ac_n "checking for Tk private headers""... $ac_c" 1>&6
echo "configure:6088: checking for Tk private headers" >&5
# Check whether --with-tkinclude or --without-tkinclude was given.
if test "${with_tkinclude+set}" = set; then
  withval="$with_tkinclude"
  with_tkinclude=${withval}
fi

if eval "test \"`echo '$''{'ac_cv_c_tkh'+set}'`\" = set"; then
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
    fi
  done
fi
# see if one is installed
if test x"${ac_cv_c_tkh}" = x ; then
   ac_safe=`echo "tk.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for tk.h""... $ac_c" 1>&6
echo "configure:6108: checking for tk.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6113 "configure"
#include "confdefs.h"
#include <tk.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:6118: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5







|




|




|







6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
    fi
  done
fi
# see if one is installed
if test x"${ac_cv_c_tkh}" = x ; then
   ac_safe=`echo "tk.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for tk.h""... $ac_c" 1>&6
echo "configure:6159: checking for tk.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6164 "configure"
#include "confdefs.h"
#include <tk.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:6169: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
if test $iunix -eq 1 ; then
    EXP_LIB_VERSION=$EXP_VERSION_NODOTS
fi

# also remove dots on systems that don't support filenames > 14
# (are there systems which support shared libs and restrict filename lengths!?)
echo $ac_n "checking for long file names""... $ac_c" 1>&6
echo "configure:6217: checking for long file names" >&5
if eval "test \"`echo '$''{'ac_cv_sys_long_file_names'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_cv_sys_long_file_names=yes
# Test for long file names in all the places we know might matter:
#      .		the current directory, where building will happen
#      $prefix/lib	where we will be installing things







|







6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
if test $iunix -eq 1 ; then
    EXP_LIB_VERSION=$EXP_VERSION_NODOTS
fi

# also remove dots on systems that don't support filenames > 14
# (are there systems which support shared libs and restrict filename lengths!?)
echo $ac_n "checking for long file names""... $ac_c" 1>&6
echo "configure:6268: checking for long file names" >&5
if eval "test \"`echo '$''{'ac_cv_sys_long_file_names'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_cv_sys_long_file_names=yes
# Test for long file names in all the places we know might matter:
#      .		the current directory, where building will happen
#      $prefix/lib	where we will be installing things
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280

# The TCL_SHARED_LIB_SUFFIX macro below relies on the DBGX macro,
# which is set way far above here.  Don't set it to the value of
# TCL_DBGX, or you'll run into problems if you build Tcl with symbols
# and expect without (and vice versa?)

echo $ac_n "checking for type of library to build""... $ac_c" 1>&6
echo "configure:6274: checking for type of library to build" >&5
if test "$enable_shared" = "yes" && test "x${TCL_SHLIB_SUFFIX}" != "x" ; then
  EXP_SHLIB_CFLAGS=$TCL_SHLIB_CFLAGS
  eval "EXP_SHARED_LIB_FILE=libexpect${TCL_SHARED_LIB_SUFFIX}"
  EXP_LIB_FILE=$EXP_SHARED_LIB_FILE
  EXP_LIB_FILES="$EXP_SHARED_LIB_FILE $EXP_UNSHARED_LIB_FILE"
  echo "$ac_t""both shared and unshared" 1>&6
else







|







6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331

# The TCL_SHARED_LIB_SUFFIX macro below relies on the DBGX macro,
# which is set way far above here.  Don't set it to the value of
# TCL_DBGX, or you'll run into problems if you build Tcl with symbols
# and expect without (and vice versa?)

echo $ac_n "checking for type of library to build""... $ac_c" 1>&6
echo "configure:6325: checking for type of library to build" >&5
if test "$enable_shared" = "yes" && test "x${TCL_SHLIB_SUFFIX}" != "x" ; then
  EXP_SHLIB_CFLAGS=$TCL_SHLIB_CFLAGS
  eval "EXP_SHARED_LIB_FILE=libexpect${TCL_SHARED_LIB_SUFFIX}"
  EXP_LIB_FILE=$EXP_SHARED_LIB_FILE
  EXP_LIB_FILES="$EXP_SHARED_LIB_FILE $EXP_UNSHARED_LIB_FILE"
  echo "$ac_t""both shared and unshared" 1>&6
else
6863
6864
6865
6866
6867
6868
6869
6870
6871
        { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; }
      fi
    fi

    cd $ac_popdir
  done
fi










<
6914
6915
6916
6917
6918
6919
6920
6921

        { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; }
      fi
    fi

    cd $ac_popdir
  done
fi


Changes to configure.in.

30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# right now and giving some advice.  Alas, we cannot summarily fix the
# problem because it might conceivably be someone doing real
# development.
# Test if configure is older than configure.in and explain if no autoconf
AC_CHECK_PROG(found,autoconf,yes,no,)
found=no
AC_MSG_CHECKING([configure up to date])
for i in `cd ${srcdir} ; ls -tr configure configure.in Makefile.in` ; do
  newest=$i
done
if test "configure" = "$newest" ; then
  AC_MSG_RESULT(yes)
else
  AC_MSG_RESULT(no)
fi
if test $found = "no" -a "$newest" != "configure" ; then
  AC_MSG_WARN([configure appears to be old (configure.in and/or Makefile.in are newer) and the autoconf program to fix this situation was not found.  If you've no idea what this means, enter the command \"touch configure\" and restart configure.])
  exit
fi

dnl AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
AC_CANONICAL_SYSTEM

AC_CONFIG_HEADER(expect_cf.h)







|


|




|
|







30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# right now and giving some advice.  Alas, we cannot summarily fix the
# problem because it might conceivably be someone doing real
# development.
# Test if configure is older than configure.in and explain if no autoconf
AC_CHECK_PROG(found,autoconf,yes,no,)
found=no
AC_MSG_CHECKING([configure up to date])
for i in `ls -tr ${srcdir}/configure ${srcdir}/configure.in ${srcdir}/Makefile.in` ; do
  newest=$i
done
if test "$srcdir/configure" = "$newest" ; then
  AC_MSG_RESULT(yes)
else
  AC_MSG_RESULT(no)
fi
if test $found = "no" -a "$newest" != "$srcdir/configure" ; then
  AC_MSG_WARN([$srcdir/configure appears to be old ($srcdir/configure.in and/or $srcdir/Makefile.in are newer) and the autoconf program to fix this situation was not found.  If you've no idea what this means, enter the command \"touch $srcdir/configure\" and restart $srcdir/configure.])
  exit
fi

dnl AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
AC_CANONICAL_SYSTEM

AC_CONFIG_HEADER(expect_cf.h)
590
591
592
593
594
595
596

597
598
599
600
601
602
603
#
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 arguments
AC_MSG_CHECKING([for memcpy])
AC_TRY_LINK(,[
char *s1, *s2;







>







590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
#
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))
AC_CHECK_FUNC(siglongjmp, AC_DEFINE(HAVE_SIGLONGJMP))

# 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 arguments
AC_MSG_CHECKING([for memcpy])
AC_TRY_LINK(,[
char *s1, *s2;

Changes to example/tkterm.

161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
	kf7=\EOV,
	kf8=\EOW,
	kf9=\EOX,
    }
    close $file

    set oldpath $env(PATH)
    set env(PATH) "/usr/5bin:/usr/lib/terminfo"
    if 1==[catch {exec tic $ttsrc} msg] {
	puts "WARNING: tic failed - if you don't have terminfo support on"
	puts "your system, change \"set terminfo 1\" to \"set terminfo 0\"."
	puts "Here is the original error from running tic:"
	puts $msg
    }
    set env(PATH) $oldpath







|







161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
	kf7=\EOV,
	kf8=\EOW,
	kf9=\EOX,
    }
    close $file

    set oldpath $env(PATH)
    set env(PATH) "$env(PATH):/usr/5bin:/usr/lib/terminfo"
    if 1==[catch {exec tic $ttsrc} msg] {
	puts "WARNING: tic failed - if you don't have terminfo support on"
	puts "your system, change \"set terminfo 1\" to \"set terminfo 0\"."
	puts "Here is the original error from running tic:"
	puts $msg
    }
    set env(PATH) $oldpath

Changes to exp_chan.c.

492
493
494
495
496
497
498



499
500

501
502
503
504
505
506
507
    mask = TCL_READABLE | TCL_WRITABLE;

    /* not sure about this - what about adopted channels */
    esPtr->validMask = mask | TCL_EXCEPTION;
    esPtr->fdin = fdin;
    esPtr->fdout = fdout;




    expCloseOnExec(fdin);
    if (fdin != fdout) expCloseOnExec(fdout);


    esPtr->fdBusy = FALSE;
    esPtr->channel = Tcl_CreateChannel(channelTypePtr, esPtr->name,
	    (ClientData) esPtr, mask);
    Tcl_RegisterChannel(interp,esPtr->channel);
    esPtr->registered = TRUE;
    Tcl_SetChannelOption(interp,esPtr->channel,"-buffering","none");







>
>
>
|
|
>







492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
    mask = TCL_READABLE | TCL_WRITABLE;

    /* not sure about this - what about adopted channels */
    esPtr->validMask = mask | TCL_EXCEPTION;
    esPtr->fdin = fdin;
    esPtr->fdout = fdout;

    /* set close-on-exec for everything but std channels */
    /* (system and stty commands need access to std channels) */
    if (fdin != 0 && fdin != 2) {
      expCloseOnExec(fdin);
      if (fdin != fdout) expCloseOnExec(fdout);
    }

    esPtr->fdBusy = FALSE;
    esPtr->channel = Tcl_CreateChannel(channelTypePtr, esPtr->name,
	    (ClientData) esPtr, mask);
    Tcl_RegisterChannel(interp,esPtr->channel);
    esPtr->registered = TRUE;
    Tcl_SetChannelOption(interp,esPtr->channel,"-buffering","none");

Changes to exp_clib.c.

74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
 *
 * Copyright (c) 1991 The Regents of the University of California.
 * Copyright (c) 1994 Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: exp_clib.c,v 5.28.1.1.2.10 1999/07/07 20:15:03 libes Exp $
 */

#ifndef _STDLIB
#define _STDLIB

#include <tcl.h>








|







74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
 *
 * Copyright (c) 1991 The Regents of the University of California.
 * Copyright (c) 1994 Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: exp_clib.c,v 5.28.1.1.2.12 1999/12/04 06:18:23 libes Exp $
 */

#ifndef _STDLIB
#define _STDLIB

#include <tcl.h>

162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
 *
 * *** NOTE: This code has been altered for use in MT-Sturdy Tcl ***
 * *** 1. All use of static variables has been changed to access ***
 * ***    fields of a structure.                                 ***
 * *** 2. This in addition to changes to TclRegError makes the   ***
 * ***    code multi-thread safe.                                ***
 *
 * RCS: @(#) $Id: exp_clib.c,v 5.28.1.1.2.10 1999/07/07 20:15:03 libes Exp $
 */

#if 0
#include "tclInt.h"
#include "tclPort.h"
#endif








|







162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
 *
 * *** NOTE: This code has been altered for use in MT-Sturdy Tcl ***
 * *** 1. All use of static variables has been changed to access ***
 * ***    fields of a structure.                                 ***
 * *** 2. This in addition to changes to TclRegError makes the   ***
 * ***    code multi-thread safe.                                ***
 *
 * RCS: @(#) $Id: exp_clib.c,v 5.28.1.1.2.12 1999/12/04 06:18:23 libes Exp $
 */

#if 0
#include "tclInt.h"
#include "tclPort.h"
#endif

2167
2168
2169
2170
2171
2172
2173



2174


2175
2176
2177
2178
2179
2180
2181
char *exp_stty_init = 0;		/* initial stty args */
int exp_ttycopy = TRUE;			/* copy tty parms from /dev/tty */
int exp_ttyinit = TRUE;			/* set tty parms to sane state */
int exp_console = FALSE;		/* redirect console */
void (*exp_child_exec_prelude)() = 0;
void (*exp_close_in_child)() = 0;




jmp_buf exp_readenv;		/* for interruptable read() */


int exp_reading = FALSE;	/* whether we can longjmp or not */

int exp_is_debugging = FALSE;
FILE *exp_debugfile = 0;

FILE *exp_logfile = 0;
int exp_logfile_all = FALSE;	/* if TRUE, write log of all interactions */







>
>
>

>
>







2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
char *exp_stty_init = 0;		/* initial stty args */
int exp_ttycopy = TRUE;			/* copy tty parms from /dev/tty */
int exp_ttyinit = TRUE;			/* set tty parms to sane state */
int exp_console = FALSE;		/* redirect console */
void (*exp_child_exec_prelude)() = 0;
void (*exp_close_in_child)() = 0;

#ifdef HAVE_SIGLONGJMP
sigjmp_buf exp_readenv;		/* for interruptable read() */
#else
jmp_buf exp_readenv;		/* for interruptable read() */
#endif /* HAVE_SIGLONGJMP */

int exp_reading = FALSE;	/* whether we can longjmp or not */

int exp_is_debugging = FALSE;
FILE *exp_debugfile = 0;

FILE *exp_logfile = 0;
int exp_logfile_all = FALSE;	/* if TRUE, write log of all interactions */
2445
2446
2447
2448
2449
2450
2451


2452
2453
2454
2455
2456
2457
2458

	/*
	 * child process - do not return from here!  all errors must exit()
	 */

	close(sync_fds[0]);
	close(sync2_fds[1]);



#ifdef CRAY
	(void) close(exp_pty[0]);
#endif

/* ultrix (at least 4.1-2) fails to obtain controlling tty if setsid */
/* is called.  setpgrp works though.  */







>
>







2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465

	/*
	 * child process - do not return from here!  all errors must exit()
	 */

	close(sync_fds[0]);
	close(sync2_fds[1]);
	close(status_pipe[0]);
	fcntl(status_pipe[1],F_SETFD,1);	/* close on exec */

#ifdef CRAY
	(void) close(exp_pty[0]);
#endif

/* ultrix (at least 4.1-2) fails to obtain controlling tty if setsid */
/* is called.  setpgrp works though.  */
2748
2749
2750
2751
2752
2753
2754



2755

2756
2757
2758
2759
2760
2761
2762
sigalarm_handler(n)
int n;			/* signal number, unused by us */
{
#ifdef REARM_SIG
	signal(SIGALRM,sigalarm_handler);
#endif




	longjmp(exp_readenv,1);

}

/* interruptable read */
static int
i_read(fd,fp,buffer,length,timeout)
int fd;
FILE *fp;







>
>
>

>







2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
sigalarm_handler(n)
int n;			/* signal number, unused by us */
{
#ifdef REARM_SIG
	signal(SIGALRM,sigalarm_handler);
#endif

#ifdef HAVE_SIGLONGJMP
	siglongjmp(exp_readenv,1);
#else
	longjmp(exp_readenv,1);
#endif /* HAVE_SIGLONGJMP */
}

/* interruptable read */
static int
i_read(fd,fp,buffer,length,timeout)
int fd;
FILE *fp;
2772
2773
2774
2775
2776
2777
2778



2779

2780
2781
2782
2783
2784
2785
2786
	/* no need to set alarm if -1 (infinite) or 0 (poll with */
	/* guaranteed data) */

	if (timeout > 0) alarm(timeout);

	/* restart read if setjmp returns 0 (first time) or 2 (EXP_RESTART). */
	/* abort if setjmp returns 1 (EXP_ABORT). */



	if (EXP_ABORT != setjmp(exp_readenv)) {

		exp_reading = TRUE;
		if (fd == -1) {
			int c;
			c = getc(fp);
			if (c == EOF) {
/*fprintf(stderr,"<<EOF>>",c);fflush(stderr);*/
				if (feof(fp)) cc = 0;







>
>
>

>







2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
	/* no need to set alarm if -1 (infinite) or 0 (poll with */
	/* guaranteed data) */

	if (timeout > 0) alarm(timeout);

	/* restart read if setjmp returns 0 (first time) or 2 (EXP_RESTART). */
	/* abort if setjmp returns 1 (EXP_ABORT). */
#ifdef HAVE_SIGLONGJMP
        if (EXP_ABORT != sigsetjmp(exp_readenv,1)) {
#else
	if (EXP_ABORT != setjmp(exp_readenv)) {
#endif /* HAVE_SIGLONGJMP */
		exp_reading = TRUE;
		if (fd == -1) {
			int c;
			c = getc(fp);
			if (c == EOF) {
/*fprintf(stderr,"<<EOF>>",c);fflush(stderr);*/
				if (feof(fp)) cc = 0;

Changes to exp_inter.c.

493
494
495
496
497
498
499



500


501
502
503
504
505
506
507
508
509
510






511
512
513
514
515
516
517
518

#ifndef WEXITSTATUS
#define WEXITSTATUS(stat) (((*((int *) &(stat))) >> 8) & 0xff)
#endif

#include <setjmp.h>




static jmp_buf env;		/* for interruptable read() */


static int reading;		/* while we are reading */
				/* really, while "env" is valid */
static int deferred_interrupt = FALSE;	/* if signal is received, but not */
				/* in expIRead record this here, so it will */
				/* be handled next time through expIRead */

static void
sigchld_handler()
{
    if (reading) longjmp(env,1);






    deferred_interrupt = TRUE;
}

#define EXP_CHILD_EOF -100

/*
 * Name: expIRead, do an interruptable read
 *







>
>
>

>
>









|
>
>
>
>
>
>
|







493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529

#ifndef WEXITSTATUS
#define WEXITSTATUS(stat) (((*((int *) &(stat))) >> 8) & 0xff)
#endif

#include <setjmp.h>

#ifdef HAVE_SIGLONGJMP
static sigjmp_buf env;                /* for interruptable read() */
#else
static jmp_buf env;		/* for interruptable read() */
#endif  /* HAVE_SIGLONGJMP */

static int reading;		/* while we are reading */
				/* really, while "env" is valid */
static int deferred_interrupt = FALSE;	/* if signal is received, but not */
				/* in expIRead record this here, so it will */
				/* be handled next time through expIRead */

static void
sigchld_handler()
{
  if (reading) {
#ifdef HAVE_SIGLONGJMP
     siglongjmp(env,1);
#else
    longjmp(env,1);
#endif  /* HAVE_SIGLONGJMP */
  }
  deferred_interrupt = TRUE;
}

#define EXP_CHILD_EOF -100

/*
 * Name: expIRead, do an interruptable read
 *
528
529
530
531
532
533
534



535

536
537
538
539
540
541
542
int size;
int flags;
{
    int cc = EXP_CHILD_EOF;

    if (deferred_interrupt) return(cc);




    if (0 == setjmp(env)) {

	reading = TRUE;
	cc = Tcl_ReadChars(channel,obj,size,flags);
    }
    reading = FALSE;
    return(cc);
}








>
>
>

>







539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
int size;
int flags;
{
    int cc = EXP_CHILD_EOF;

    if (deferred_interrupt) return(cc);

#ifdef HAVE_SIGLONGJMP
    if (0 == sigsetjmp(env,1)) {
#else
    if (0 == setjmp(env)) {
#endif  /* HAVE_SIGLONGJMP */
	reading = TRUE;
	cc = Tcl_ReadChars(channel,obj,size,flags);
    }
    reading = FALSE;
    return(cc);
}

Changes to exp_log.c.

164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
    fmt = va_arg(args,char *);

    if ((!tsdPtr->logUser) && (!force_stdout) && (!tsdPtr->logAll)) return;

    (void) vsprintf(bigbuf,fmt,args);
    expDiagWriteBytes(bigbuf,-1);
    if (tsdPtr->logAll || (LOGUSER && tsdPtr->logChannel)) Tcl_WriteChars(tsdPtr->logChannel,bigbuf,-1);
    if (LOGUSER) fprintf(stdout,bigbuf);
    va_end(args);
}

/* just like log but does no formatting */
/* send to log if open */
/* use this function for logging the parent/child conversation */
void







|







164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
    fmt = va_arg(args,char *);

    if ((!tsdPtr->logUser) && (!force_stdout) && (!tsdPtr->logAll)) return;

    (void) vsprintf(bigbuf,fmt,args);
    expDiagWriteBytes(bigbuf,-1);
    if (tsdPtr->logAll || (LOGUSER && tsdPtr->logChannel)) Tcl_WriteChars(tsdPtr->logChannel,bigbuf,-1);
    if (LOGUSER) fprintf(stdout,"%s",bigbuf);
    va_end(args);
}

/* just like log but does no formatting */
/* send to log if open */
/* use this function for logging the parent/child conversation */
void
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
    char *fmt;
    va_list args;

    fmt = TCL_VARARGS_START(char *,arg1,args);
    (void) vsprintf(bigbuf,fmt,args);

    expDiagWriteChars(bigbuf,-1);
    fprintf(stderr,bigbuf);
    if (tsdPtr->logChannel) Tcl_WriteChars(tsdPtr->logChannel,bigbuf,-1);
    
    va_end(args);
}

/* just like errorlog but does no formatting */
/* send to log if open */







|







203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
    char *fmt;
    va_list args;

    fmt = TCL_VARARGS_START(char *,arg1,args);
    (void) vsprintf(bigbuf,fmt,args);

    expDiagWriteChars(bigbuf,-1);
    fprintf(stderr,"%s",bigbuf);
    if (tsdPtr->logChannel) Tcl_WriteChars(tsdPtr->logChannel,bigbuf,-1);
    
    va_end(args);
}

/* just like errorlog but does no formatting */
/* send to log if open */
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281

    fmt = TCL_VARARGS_START(char *,arg1,args);

    (void) vsprintf(bigbuf,fmt,args);

    expDiagWriteBytes(bigbuf,-1);
    if (tsdPtr->diagToStderr) {
	fprintf(stderr,bigbuf);
	if (tsdPtr->logChannel) Tcl_WriteChars(tsdPtr->logChannel,bigbuf,-1);
    }

    va_end(args);
}


/* expDiagLog for unformatted strings
   this also takes care of arbitrary large strings */
void
expDiagLogU(str)
    char *str;
{
    ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);

    if ((tsdPtr->diagToStderr == 0) && (tsdPtr->diagChannel == 0)) return;

    expDiagWriteBytes(str,-1);

    if (tsdPtr->diagToStderr) {
	fprintf(stderr,str);
	if (tsdPtr->logChannel) Tcl_WriteChars(tsdPtr->logChannel,str,-1);
    }
}

void
expDiagToStderrSet(val)
    int val;







|




















|







246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281

    fmt = TCL_VARARGS_START(char *,arg1,args);

    (void) vsprintf(bigbuf,fmt,args);

    expDiagWriteBytes(bigbuf,-1);
    if (tsdPtr->diagToStderr) {
	fprintf(stderr,"%s",bigbuf);
	if (tsdPtr->logChannel) Tcl_WriteChars(tsdPtr->logChannel,bigbuf,-1);
    }

    va_end(args);
}


/* expDiagLog for unformatted strings
   this also takes care of arbitrary large strings */
void
expDiagLogU(str)
    char *str;
{
    ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);

    if ((tsdPtr->diagToStderr == 0) && (tsdPtr->diagChannel == 0)) return;

    expDiagWriteBytes(str,-1);

    if (tsdPtr->diagToStderr) {
	fprintf(stderr,"%s",str);
	if (tsdPtr->logChannel) Tcl_WriteChars(tsdPtr->logChannel,str,-1);
    }
}

void
expDiagToStderrSet(val)
    int val;

Changes to exp_pty.c.

62
63
64
65
66
67
68



69


70
71
72
73
74
75
76
static int locked = FALSE;
static char lock[] = "/tmp/ptylock.XXXX";	/* XX is replaced by pty id */
static char locksrc[50] = "/tmp/expect.pid"; /* pid is replaced by real pid */
	/* locksrc is used as the link source, i.e., something to link from */

static int i_read_errno;/* place to save errno, if i_read() == -1, so it
			   doesn't get overwritten before we get to read it */



static jmp_buf env;		/* for interruptable read() */


static int env_valid = FALSE;	/* whether we can longjmp or not */

/* sigalarm_handler and i_read are here just for supporting the sanity */
/* checking of pty slave devices.  I have only seen this happen on BSD */
/* systems, but it may need to be done to the other pty implementations */
/* as well. */








>
>
>

>
>







62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
static int locked = FALSE;
static char lock[] = "/tmp/ptylock.XXXX";	/* XX is replaced by pty id */
static char locksrc[50] = "/tmp/expect.pid"; /* pid is replaced by real pid */
	/* locksrc is used as the link source, i.e., something to link from */

static int i_read_errno;/* place to save errno, if i_read() == -1, so it
			   doesn't get overwritten before we get to read it */
#ifdef HAVE_SIGLONGJMP
static sigjmp_buf env;                /* for interruptable read() */
#else
static jmp_buf env;		/* for interruptable read() */
#endif  /* HAVE_SIGLONGJMP */

static int env_valid = FALSE;	/* whether we can longjmp or not */

/* sigalarm_handler and i_read are here just for supporting the sanity */
/* checking of pty slave devices.  I have only seen this happen on BSD */
/* systems, but it may need to be done to the other pty implementations */
/* as well. */

85
86
87
88
89
90
91



92

93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112



113

114
115
116
117
118
119
120
{
#ifdef REARM_SIG
	signal(SIGALRM,sigalarm_handler);
#endif

	/* check env_valid first to protect us from the alarm occurring */
	/* in the window between i_read and alarm(0) */



	if (env_valid) longjmp(env,1);

}

/* interruptable read */
static int
i_read(fd,buffer,length,timeout)
int fd;
char *buffer;
int length;
int timeout;
{
	int cc = -2;

	/* since setjmp insists on returning 1 upon longjmp(,0), */
	/* longjmp(,2) instead. */

	/* restart read if setjmp returns 0 (first time) or 2. */
	/* abort if setjmp returns 1. */

	alarm(timeout);




	if (1 != setjmp(env)) {

		env_valid = TRUE;
		cc = read(fd,buffer,length);
	}
	env_valid = FALSE;
	i_read_errno = errno;	/* errno can be overwritten by the */
				/* time we return */
	alarm(0);







>
>
>

>




















>
>
>

>







90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
{
#ifdef REARM_SIG
	signal(SIGALRM,sigalarm_handler);
#endif

	/* check env_valid first to protect us from the alarm occurring */
	/* in the window between i_read and alarm(0) */
#ifdef HAVE_SIGLONGJMP
	if (env_valid) siglongjmp(env,1);
#else
	if (env_valid) longjmp(env,1);
#endif  /* HAVE_SIGLONGJMP */
}

/* interruptable read */
static int
i_read(fd,buffer,length,timeout)
int fd;
char *buffer;
int length;
int timeout;
{
	int cc = -2;

	/* since setjmp insists on returning 1 upon longjmp(,0), */
	/* longjmp(,2) instead. */

	/* restart read if setjmp returns 0 (first time) or 2. */
	/* abort if setjmp returns 1. */

	alarm(timeout);

#ifdef HAVE_SIGLONGJMP
	if (1 != sigsetjmp(env,1)) {
#else
	if (1 != setjmp(env)) {
#endif  /* HAVE_SIGLONGJMP */
		env_valid = TRUE;
		cc = read(fd,buffer,length);
	}
	env_valid = FALSE;
	i_read_errno = errno;	/* errno can be overwritten by the */
				/* time we return */
	alarm(0);

Changes to exp_strf.c.

94
95
96
97
98
99
100

101


102

103
104
105
106
107
108
109
#define const

extern char *getenv();
static int weeknumber();
adddecl(static int iso8601wknum();)
#else


extern char *strchr(const char *str, int ch);


extern char *getenv(const char *v);

static int weeknumber(const struct tm *timeptr, int firstweekday);
adddecl(static int iso8601wknum(const struct tm *timeptr);)
#endif

/* attempt to use strftime to compute timezone, else fallback to */
/* less portable ways */
#if !defined(HAVE_STRFTIME)







>

>
>

>







94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#define const

extern char *getenv();
static int weeknumber();
adddecl(static int iso8601wknum();)
#else

#ifndef strchr
extern char *strchr(const char *str, int ch);
#endif

extern char *getenv(const char *v);

static int weeknumber(const struct tm *timeptr, int firstweekday);
adddecl(static int iso8601wknum(const struct tm *timeptr);)
#endif

/* attempt to use strftime to compute timezone, else fallback to */
/* less portable ways */
#if !defined(HAVE_STRFTIME)

Changes to exp_trap.c.

196
197
198
199
200
201
202



203

204
205
206
207
208
209
210
211
	 * we have received it.
	 */
	if (sig == SIGCHLD) {
		sigchld_count++;
	}
#if 0
	/* if we are doing an i_read, restart it */



	if (env_valid && (sig != 0)) longjmp(env,2);

#endif
}

/*ARGSUSED*/
void
exp_rearm_sigchld(interp)
Tcl_Interp *interp;
{







>
>
>
|
>
|







196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
	 * we have received it.
	 */
	if (sig == SIGCHLD) {
		sigchld_count++;
	}
#if 0
	/* if we are doing an i_read, restart it */
#ifdef HAVE_SIGLONGJMP
      if (env_valid && (sig != 0)) siglongjmp(env,2);
#else
      if (env_valid && (sig != 0)) longjmp(env,2);
#endif  /* HAVE_SIGLONGJMP */
#endif /* 0 */
}

/*ARGSUSED*/
void
exp_rearm_sigchld(interp)
Tcl_Interp *interp;
{

Changes to exp_tty.c.

630
631
632
633
634
635
636

637
638
639
640
641
642
643
		bufp += arg_len;
		/* no need to check bounds, we accted for it earlier */
		memcpy(bufp," ",1);
		bufp += 1;
	}

	*(bufp-1) = '\0';

	old = signal(SIGCHLD, SIG_DFL);
	systemStatus = system(buf);
	signal(SIGCHLD, old);	/* restore signal handler */
	expDiagLogU("system(");
	expDiagLogU(buf);
	expDiagLog(") = %d\r\n",i);








>







630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
		bufp += arg_len;
		/* no need to check bounds, we accted for it earlier */
		memcpy(bufp," ",1);
		bufp += 1;
	}

	*(bufp-1) = '\0';

	old = signal(SIGCHLD, SIG_DFL);
	systemStatus = system(buf);
	signal(SIGCHLD, old);	/* restore signal handler */
	expDiagLogU("system(");
	expDiagLogU(buf);
	expDiagLog(") = %d\r\n",i);

Changes to expect.c.

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

#include <sys/types.h>
#include <stdio.h>
#include <signal.h>
#include <errno.h>
#include <ctype.h>	/* for isspace */
#include <time.h>	/* for time(3) */
#if 0
#include <setjmp.h>
#endif

#include "expect_cf.h"

#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif








<
<
<







10
11
12
13
14
15
16



17
18
19
20
21
22
23

#include <sys/types.h>
#include <stdio.h>
#include <signal.h>
#include <errno.h>
#include <ctype.h>	/* for isspace */
#include <time.h>	/* for time(3) */




#include "expect_cf.h"

#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif

132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
	cmd->ecd.cases = 0;
	cmd->ecd.count = 0;
	cmd->i_list = 0;
}

static int i_read_errno;/* place to save errno, if i_read() == -1, so it
			   doesn't get overwritten before we get to read it */
#if 0
static jmp_buf env;	/* for interruptable read() */
			/* longjmp(env,1) times out the read */
			/* longjmp(env,2) restarts the read */
static int env_valid = FALSE;	/* whether we can longjmp or not */
#endif

#ifdef SIMPLE_EVENT
static int alarm_fired;	/* if alarm occurs */
#endif

void exp_background_channelhandlers_run_all();








<
<
<
<
<
<







129
130
131
132
133
134
135






136
137
138
139
140
141
142
	cmd->ecd.cases = 0;
	cmd->ecd.count = 0;
	cmd->i_list = 0;
}

static int i_read_errno;/* place to save errno, if i_read() == -1, so it
			   doesn't get overwritten before we get to read it */







#ifdef SIMPLE_EVENT
static int alarm_fired;	/* if alarm occurs */
#endif

void exp_background_channelhandlers_run_all();

624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
	    ec.i_list->ecount++;

	    /* save original pattern spec */
	    /* keywords such as "-timeout" are saved as patterns here */
	    /* useful for debugging but not otherwise used */

	    ec.pat = objv[i];
	    Tcl_IncrRefCount(ec.pat);

	    i++;
	    if (i < objc) {
		ec.body = objv[i];
		Tcl_IncrRefCount(ec.body);
	    } else {
		ec.body = NULL;
	    }

	    *(eg->ecd.cases[eg->ecd.count] = ecase_new()) = ec;

		/* clear out for next set */







|




|







615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
	    ec.i_list->ecount++;

	    /* save original pattern spec */
	    /* keywords such as "-timeout" are saved as patterns here */
	    /* useful for debugging but not otherwise used */

	    ec.pat = objv[i];
	    if (eg->duration == EXP_PERMANENT) Tcl_IncrRefCount(ec.pat);

	    i++;
	    if (i < objc) {
		ec.body = objv[i];
		if (eg->duration == EXP_PERMANENT) Tcl_IncrRefCount(ec.body);
	    } else {
		ec.body = NULL;
	    }

	    *(eg->ecd.cases[eg->ecd.count] = ecase_new()) = ec;

		/* clear out for next set */

Changes to expect.h.

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
 * Copyright (c) 1994-1997 Sun Microsystems, Inc.
 * Copyright (c) 1993-1996 Lucent Technologies.
 * Copyright (c) 1998-1999 Scriptics Corporation.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: expect.h,v 5.28.1.1.2.2 1999/07/03 03:44:15 libes Exp $
 */

#ifndef _TCL
#define _TCL

#ifndef __WIN32__
#   if defined(_WIN32) || defined(WIN32)







|







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
 * Copyright (c) 1994-1997 Sun Microsystems, Inc.
 * Copyright (c) 1993-1996 Lucent Technologies.
 * Copyright (c) 1998-1999 Scriptics Corporation.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: expect.h,v 5.28.1.1.2.3 1999/07/07 20:15:03 libes Exp $
 */

#ifndef _TCL
#define _TCL

#ifndef __WIN32__
#   if defined(_WIN32) || defined(WIN32)
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348

/*
 * Definitions etc. for regexp(3) routines.
 *
 * Caveat:  this is V8 regexp(3) [actually, a reimplementation thereof],
 * not the System V one.
 *
 * RCS: @(#) $Id: expect.h,v 5.28.1.1.2.2 1999/07/03 03:44:15 libes Exp $
 */

#ifndef _REGEXP
#define _REGEXP 1

#ifdef BUILD_tcl
# undef TCL_STORAGE_CLASS







|







334
335
336
337
338
339
340
341
342
343
344
345
346
347
348

/*
 * Definitions etc. for regexp(3) routines.
 *
 * Caveat:  this is V8 regexp(3) [actually, a reimplementation thereof],
 * not the System V one.
 *
 * RCS: @(#) $Id: expect.h,v 5.28.1.1.2.3 1999/07/07 20:15:03 libes Exp $
 */

#ifndef _REGEXP
#define _REGEXP 1

#ifdef BUILD_tcl
# undef TCL_STORAGE_CLASS
422
423
424
425
426
427
428



429


430
431
432
433
434
435
436
EXTERN char *exp_pty_slave_name;	/* name of pty slave device if we */
					/* do allocation */
EXTERN char *exp_stty_init;		/* initial stty args */
EXTERN int exp_ttycopy;			/* copy tty parms from /dev/tty */
EXTERN int exp_ttyinit;			/* set tty parms to sane state */
EXTERN int exp_console;			/* redirect console */




EXTERN jmp_buf exp_readenv;		/* for interruptable read() */


EXTERN int exp_reading;			/* whether we can longjmp or not */
#define EXP_ABORT	1		/* abort read */
#define EXP_RESTART	2		/* restart read */

EXTERN int exp_is_debugging;
EXTERN int exp_loguser;








>
>
>
|
>
>







422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
EXTERN char *exp_pty_slave_name;	/* name of pty slave device if we */
					/* do allocation */
EXTERN char *exp_stty_init;		/* initial stty args */
EXTERN int exp_ttycopy;			/* copy tty parms from /dev/tty */
EXTERN int exp_ttyinit;			/* set tty parms to sane state */
EXTERN int exp_console;			/* redirect console */

#ifdef HAVE_SIGLONGJMP
sigjmp_buf exp_readenv;		/* for interruptable read() */
#else
jmp_buf exp_readenv;		/* for interruptable read() */
#endif /* HAVE_SIGLONGJMP */

EXTERN int exp_reading;			/* whether we can longjmp or not */
#define EXP_ABORT	1		/* abort read */
#define EXP_RESTART	2		/* restart read */

EXTERN int exp_is_debugging;
EXTERN int exp_loguser;

Changes to expect_cf.h.in.

39
40
41
42
43
44
45

46
47
48
49
50
51
52
 */
#undef HAVE_MEMCPY
#undef HAVE_SYSCONF
#undef SIMPLE_EVENT
#undef HAVE_STRFTIME
#undef HAVE_MEMMOVE
#undef HAVE_TIMEZONE		/* timezone() a la Pyramid */

#undef HAVE_STRCHR

#ifndef HAVE_STRCHR
#define strchr(s,c) index(s,c)
#endif /* HAVE_STRCHR */

/*







>







39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
 */
#undef HAVE_MEMCPY
#undef HAVE_SYSCONF
#undef SIMPLE_EVENT
#undef HAVE_STRFTIME
#undef HAVE_MEMMOVE
#undef HAVE_TIMEZONE		/* timezone() a la Pyramid */
#undef HAVE_SIGLONGJMP
#undef HAVE_STRCHR

#ifndef HAVE_STRCHR
#define strchr(s,c) index(s,c)
#endif /* HAVE_STRCHR */

/*