418 lines
		
	
	
		
			9.3 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
		
		
			
		
	
	
			418 lines
		
	
	
		
			9.3 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
|   | --- expect-5.45.orig/configure.in	2010-08-27 23:51:53.000000000 +0200
 | ||
|  | +++ expect-5.45.done/configure.in	2011-09-15 16:19:58.000000000 +0200
 | ||
|  | @@ -462,52 +462,52 @@
 | ||
|  |  	AC_MSG_RESULT(no) | ||
|  |  ) | ||
|  |   | ||
|  | -# Some systems only define WNOHANG if _POSIX_SOURCE is defined
 | ||
|  | -# The following merely tests that sys/wait.h can be included
 | ||
|  | -# and if so that WNOHANG is not defined.  The only place I've
 | ||
|  | -# seen this is ISC.
 | ||
|  | -AC_MSG_CHECKING([if WNOHANG requires _POSIX_SOURCE])
 | ||
|  | -AC_TRY_RUN([
 | ||
|  | -#include <sys/wait.h>
 | ||
|  | -main() {
 | ||
|  | -#ifndef WNOHANG
 | ||
|  | -	return 0;
 | ||
|  | -#else
 | ||
|  | -	return 1;
 | ||
|  | -#endif
 | ||
|  | -}],
 | ||
|  | -	AC_MSG_RESULT(yes)
 | ||
|  | -	AC_DEFINE(WNOHANG_REQUIRES_POSIX_SOURCE)
 | ||
|  | -,
 | ||
|  | -	AC_MSG_RESULT(no)
 | ||
|  | -,
 | ||
|  | -	AC_MSG_ERROR([Expect can't be cross compiled])
 | ||
|  | -)
 | ||
|  | -
 | ||
|  | -AC_MSG_CHECKING([if any value exists for WNOHANG])
 | ||
|  | -rm -rf wnohang
 | ||
|  | -AC_TRY_RUN([
 | ||
|  | -#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
 | ||
|  | -}],
 | ||
|  | -	AC_MSG_RESULT(yes)
 | ||
|  | -	AC_DEFINE_UNQUOTED(WNOHANG_BACKUP_VALUE, `cat wnohang`)
 | ||
|  | -	rm -f wnohang
 | ||
|  | -,
 | ||
|  | -	AC_MSG_RESULT(no)
 | ||
|  | -	AC_DEFINE(WNOHANG_BACKUP_VALUE, 1)
 | ||
|  | -,
 | ||
|  | -	AC_MSG_ERROR([Expect can't be cross compiled])
 | ||
|  | -)
 | ||
|  | +dnl # Some systems only define WNOHANG if _POSIX_SOURCE is defined
 | ||
|  | +dnl # The following merely tests that sys/wait.h can be included
 | ||
|  | +dnl # and if so that WNOHANG is not defined.  The only place I've
 | ||
|  | +dnl # seen this is ISC.
 | ||
|  | +dnl AC_MSG_CHECKING([if WNOHANG requires _POSIX_SOURCE])
 | ||
|  | +dnl AC_TRY_RUN([
 | ||
|  | +dnl #include <sys/wait.h>
 | ||
|  | +dnl main() {
 | ||
|  | +dnl #ifndef WNOHANG
 | ||
|  | +dnl 	return 0;
 | ||
|  | +dnl #else
 | ||
|  | +dnl 	return 1;
 | ||
|  | +dnl #endif
 | ||
|  | +dnl }],
 | ||
|  | +dnl 	AC_MSG_RESULT(yes)
 | ||
|  | +dnl 	AC_DEFINE(WNOHANG_REQUIRES_POSIX_SOURCE)
 | ||
|  | +dnl ,
 | ||
|  | +dnl 	AC_MSG_RESULT(no)
 | ||
|  | +dnl ,
 | ||
|  | +dnl 	AC_MSG_ERROR([Expect can't be cross compiled])
 | ||
|  | +dnl )
 | ||
|  | +dnl 
 | ||
|  | +dnl AC_MSG_CHECKING([if any value exists for WNOHANG])
 | ||
|  | +dnl rm -rf wnohang
 | ||
|  | +dnl AC_TRY_RUN([
 | ||
|  | +dnl #include <stdio.h>
 | ||
|  | +dnl #include <sys/wait.h>
 | ||
|  | +dnl main() {
 | ||
|  | +dnl #ifdef WNOHANG
 | ||
|  | +dnl 	FILE *fp = fopen("wnohang","w");
 | ||
|  | +dnl 	fprintf(fp,"%d",WNOHANG);
 | ||
|  | +dnl 	fclose(fp);
 | ||
|  | +dnl 	return 0;
 | ||
|  | +dnl #else
 | ||
|  | +dnl 	return 1;
 | ||
|  | +dnl #endif
 | ||
|  | +dnl }],
 | ||
|  | +dnl 	AC_MSG_RESULT(yes)
 | ||
|  | +dnl 	AC_DEFINE_UNQUOTED(WNOHANG_BACKUP_VALUE, `cat wnohang`)
 | ||
|  | +dnl 	rm -f wnohang
 | ||
|  | +dnl ,
 | ||
|  | +dnl 	AC_MSG_RESULT(no)
 | ||
|  | +dnl 	AC_DEFINE(WNOHANG_BACKUP_VALUE, 1)
 | ||
|  | +dnl ,
 | ||
|  | +dnl 	AC_MSG_ERROR([Expect can't be cross compiled])
 | ||
|  | +dnl )
 | ||
|  |   | ||
|  |  # | ||
|  |  # check how signals work | ||
|  | @@ -710,135 +710,135 @@
 | ||
|  |      AC_DEFINE(POSIX) | ||
|  |  fi | ||
|  |   | ||
|  | -# first check for the pure bsd
 | ||
|  | -AC_MSG_CHECKING([for struct sgttyb])
 | ||
|  | -AC_TRY_RUN([
 | ||
|  | -#include <sgtty.h>
 | ||
|  | -main()
 | ||
|  | -{
 | ||
|  | -  struct sgttyb tmp;
 | ||
|  | -  exit(0);
 | ||
|  | -}],
 | ||
|  | -        AC_MSG_RESULT(yes)
 | ||
|  | -        AC_DEFINE(HAVE_SGTTYB)
 | ||
|  | -        PTY_TYPE=sgttyb
 | ||
|  | -,
 | ||
|  | -        AC_MSG_RESULT(no)
 | ||
|  | -,
 | ||
|  | -	AC_MSG_ERROR([Expect can't be cross compiled])
 | ||
|  | -)
 | ||
|  | -
 | ||
|  | -# mach systems have include files for unimplemented features
 | ||
|  | -# so avoid doing following test on those systems
 | ||
|  | -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.
 | ||
|  | -  AC_MSG_CHECKING([for struct termio])
 | ||
|  | -  AC_TRY_RUN([#include <termio.h>
 | ||
|  | -  main()
 | ||
|  | -  {
 | ||
|  | -    struct termio tmp;
 | ||
|  | -    exit(0);
 | ||
|  | -  }],
 | ||
|  | -        AC_DEFINE(HAVE_TERMIO)
 | ||
|  | -        PTY_TYPE=termios
 | ||
|  | -        AC_MSG_RESULT(yes)
 | ||
|  | -,
 | ||
|  | -        AC_MSG_RESULT(no)
 | ||
|  | -,
 | ||
|  | -	AC_MSG_ERROR([Expect can't be cross compiled])
 | ||
|  | -)
 | ||
|  | -
 | ||
|  | -  # now check for the new style ttys (not yet posix)
 | ||
|  | -  AC_MSG_CHECKING([for struct termios])
 | ||
|  | -  AC_TRY_RUN([
 | ||
|  | -  /* including termios.h on Solaris 5.6 fails unless inttypes.h included */
 | ||
|  | -#  ifdef HAVE_INTTYPES_H
 | ||
|  | -#  include <inttypes.h>
 | ||
|  | -#  endif
 | ||
|  | -#  include <termios.h>
 | ||
|  | -  main()
 | ||
|  | -  {
 | ||
|  | -    struct termios tmp;
 | ||
|  | -    exit(0);
 | ||
|  | -  }],
 | ||
|  | -        AC_DEFINE(HAVE_TERMIOS)
 | ||
|  | -        PTY_TYPE=termios
 | ||
|  | -        AC_MSG_RESULT(yes)
 | ||
|  | -  ,
 | ||
|  | -        AC_MSG_RESULT(no)
 | ||
|  | -  ,
 | ||
|  | -	AC_MSG_ERROR([Expect can't be cross compiled])
 | ||
|  | -  )
 | ||
|  | -fi
 | ||
|  | -
 | ||
|  | -AC_MSG_CHECKING([if TCGETS or TCGETA in termios.h])
 | ||
|  | -AC_TRY_RUN([
 | ||
|  | -/* including termios.h on Solaris 5.6 fails unless inttypes.h included */
 | ||
|  | -#ifdef HAVE_INTTYPES_H
 | ||
|  | -#include <inttypes.h>
 | ||
|  | -#endif
 | ||
|  | -#include <termios.h>
 | ||
|  | -main() {
 | ||
|  | -#if defined(TCGETS) || defined(TCGETA)
 | ||
|  | -	return 0;
 | ||
|  | -#else
 | ||
|  | -	return 1;
 | ||
|  | -#endif
 | ||
|  | -}],
 | ||
|  | -	AC_DEFINE(HAVE_TCGETS_OR_TCGETA_IN_TERMIOS_H)
 | ||
|  | -	AC_MSG_RESULT(yes)
 | ||
|  | -,
 | ||
|  | -	AC_MSG_RESULT(no)
 | ||
|  | -,
 | ||
|  | -	AC_MSG_ERROR([Expect can't be cross compiled])
 | ||
|  | -)
 | ||
|  | -
 | ||
|  | -AC_MSG_CHECKING([if TIOCGWINSZ in termios.h])
 | ||
|  | -AC_TRY_RUN([
 | ||
|  | -/* including termios.h on Solaris 5.6 fails unless inttypes.h included */
 | ||
|  | -#ifdef HAVE_INTTYPES_H
 | ||
|  | -#include <inttypes.h>
 | ||
|  | -#endif
 | ||
|  | -#include <termios.h>
 | ||
|  | -main() {
 | ||
|  | -#ifdef TIOCGWINSZ
 | ||
|  | -	return 0;
 | ||
|  | -#else
 | ||
|  | -	return 1;
 | ||
|  | -#endif
 | ||
|  | -}],
 | ||
|  | -	AC_DEFINE(HAVE_TIOCGWINSZ_IN_TERMIOS_H)
 | ||
|  | -	AC_MSG_RESULT(yes)
 | ||
|  | -,
 | ||
|  | -	AC_MSG_RESULT(no)
 | ||
|  | -,
 | ||
|  | -	AC_MSG_ERROR([Expect can't be cross compiled])
 | ||
|  | -)
 | ||
|  | -
 | ||
|  | -# finally check for Cray style ttys
 | ||
|  | -AC_MSG_CHECKING([for Cray-style ptys])
 | ||
|  | -SETUID=":"
 | ||
|  | -AC_TRY_RUN([
 | ||
|  | -main(){
 | ||
|  | -#ifdef CRAY
 | ||
|  | -	return 0;
 | ||
|  | -#else
 | ||
|  | -	return 1;
 | ||
|  | -#endif
 | ||
|  | -}
 | ||
|  | -],
 | ||
|  | -	PTY_TYPE=unicos
 | ||
|  | -	SETUID="chmod u+s"
 | ||
|  | -	AC_MSG_RESULT(yes)
 | ||
|  | -,
 | ||
|  | -	AC_MSG_RESULT(no)
 | ||
|  | -,
 | ||
|  | -	AC_MSG_ERROR([Expect can't be cross compiled])
 | ||
|  | -)
 | ||
|  | +dnl  # first check for the pure bsd
 | ||
|  | +dnl  AC_MSG_CHECKING([for struct sgttyb])
 | ||
|  | +dnl  AC_TRY_RUN([
 | ||
|  | +dnl  #include <sgtty.h>
 | ||
|  | +dnl  main()
 | ||
|  | +dnl  {
 | ||
|  | +dnl    struct sgttyb tmp;
 | ||
|  | +dnl    exit(0);
 | ||
|  | +dnl  }],
 | ||
|  | +dnl          AC_MSG_RESULT(yes)
 | ||
|  | +dnl          AC_DEFINE(HAVE_SGTTYB)
 | ||
|  | +dnl          PTY_TYPE=sgttyb
 | ||
|  | +dnl  ,
 | ||
|  | +dnl          AC_MSG_RESULT(no)
 | ||
|  | +dnl  ,
 | ||
|  | +dnl	  AC_MSG_ERROR([Expect can't be cross compiled])
 | ||
|  | +dnl  )
 | ||
|  | +dnl 
 | ||
|  | +dnl # mach systems have include files for unimplemented features
 | ||
|  | +dnl # so avoid doing following test on those systems
 | ||
|  | +dnl if test $mach -eq 0 ; then
 | ||
|  | +dnl 
 | ||
|  | +dnl   # next check for the older style ttys
 | ||
|  | +dnl   # note that if we detect termio.h (only), we still set PTY_TYPE=termios
 | ||
|  | +dnl   # since that just controls which of pty_XXXX.c file is use and
 | ||
|  | +dnl   # pty_termios.c is set up to handle pty_termio.
 | ||
|  | +dnl   AC_MSG_CHECKING([for struct termio])
 | ||
|  | +dnl   AC_TRY_RUN([#include <termio.h>
 | ||
|  | +dnl   main()
 | ||
|  | +dnl   {
 | ||
|  | +dnl     struct termio tmp;
 | ||
|  | +dnl     exit(0);
 | ||
|  | +dnl   }],
 | ||
|  | +dnl         AC_DEFINE(HAVE_TERMIO)
 | ||
|  | +dnl         PTY_TYPE=termios
 | ||
|  | +dnl         AC_MSG_RESULT(yes)
 | ||
|  | +dnl ,
 | ||
|  | +dnl         AC_MSG_RESULT(no)
 | ||
|  | +dnl ,
 | ||
|  | +dnl 	AC_MSG_ERROR([Expect can't be cross compiled])
 | ||
|  | +dnl )
 | ||
|  | +dnl 
 | ||
|  | +dnl   # now check for the new style ttys (not yet posix)
 | ||
|  | +dnl   AC_MSG_CHECKING([for struct termios])
 | ||
|  | +dnl   AC_TRY_RUN([
 | ||
|  | +dnl   /* including termios.h on Solaris 5.6 fails unless inttypes.h included */
 | ||
|  | +dnl #  ifdef HAVE_INTTYPES_H
 | ||
|  | +dnl #  include <inttypes.h>
 | ||
|  | +dnl #  endif
 | ||
|  | +dnl #  include <termios.h>
 | ||
|  | +dnl   main()
 | ||
|  | +dnl   {
 | ||
|  | +dnl     struct termios tmp;
 | ||
|  | +dnl     exit(0);
 | ||
|  | +dnl   }],
 | ||
|  | +         AC_DEFINE(HAVE_TERMIOS)
 | ||
|  | +         PTY_TYPE=termios
 | ||
|  | +dnl         AC_MSG_RESULT(yes)
 | ||
|  | +dnl   ,
 | ||
|  | +dnl         AC_MSG_RESULT(no)
 | ||
|  | +dnl   ,
 | ||
|  | +dnl 	AC_MSG_ERROR([Expect can't be cross compiled])
 | ||
|  | +dnl   )
 | ||
|  | +dnl fi
 | ||
|  | +
 | ||
|  | +dnl AC_MSG_CHECKING([if TCGETS or TCGETA in termios.h])
 | ||
|  | +dnl AC_TRY_RUN([
 | ||
|  | +dnl /* including termios.h on Solaris 5.6 fails unless inttypes.h included */
 | ||
|  | +dnl #ifdef HAVE_INTTYPES_H
 | ||
|  | +dnl #include <inttypes.h>
 | ||
|  | +dnl #endif
 | ||
|  | +dnl #include <termios.h>
 | ||
|  | +dnl main() {
 | ||
|  | +dnl #if defined(TCGETS) || defined(TCGETA)
 | ||
|  | +dnl 	return 0;
 | ||
|  | +dnl #else
 | ||
|  | +dnl 	return 1;
 | ||
|  | +dnl #endif
 | ||
|  | +dnl }],
 | ||
|  | +dnl 	AC_DEFINE(HAVE_TCGETS_OR_TCGETA_IN_TERMIOS_H)
 | ||
|  | +dnl 	AC_MSG_RESULT(yes)
 | ||
|  | +dnl ,
 | ||
|  | +dnl 	AC_MSG_RESULT(no)
 | ||
|  | +dnl ,
 | ||
|  | +dnl 	AC_MSG_ERROR([Expect can't be cross compiled])
 | ||
|  | +dnl )
 | ||
|  | +dnl 
 | ||
|  | +dnl AC_MSG_CHECKING([if TIOCGWINSZ in termios.h])
 | ||
|  | +dnl AC_TRY_RUN([
 | ||
|  | +dnl /* including termios.h on Solaris 5.6 fails unless inttypes.h included */
 | ||
|  | +dnl #ifdef HAVE_INTTYPES_H
 | ||
|  | +dnl #include <inttypes.h>
 | ||
|  | +dnl #endif
 | ||
|  | +dnl #include <termios.h>
 | ||
|  | +dnl main() {
 | ||
|  | +dnl #ifdef TIOCGWINSZ
 | ||
|  | +dnl 	return 0;
 | ||
|  | +dnl #else
 | ||
|  | +dnl 	return 1;
 | ||
|  | +dnl #endif
 | ||
|  | +dnl }],
 | ||
|  | +dnl 	AC_DEFINE(HAVE_TIOCGWINSZ_IN_TERMIOS_H)
 | ||
|  | +dnl 	AC_MSG_RESULT(yes)
 | ||
|  | +dnl ,
 | ||
|  | +dnl 	AC_MSG_RESULT(no)
 | ||
|  | +dnl ,
 | ||
|  | +dnl 	AC_MSG_ERROR([Expect can't be cross compiled])
 | ||
|  | +dnl )
 | ||
|  | +
 | ||
|  | +dnl # finally check for Cray style ttys
 | ||
|  | +dnl AC_MSG_CHECKING([for Cray-style ptys])
 | ||
|  | +dnl SETUID=":"
 | ||
|  | +dnl AC_TRY_RUN([
 | ||
|  | +dnl main(){
 | ||
|  | +dnl #ifdef CRAY
 | ||
|  | +dnl 	return 0;
 | ||
|  | +dnl #else
 | ||
|  | +dnl 	return 1;
 | ||
|  | +dnl #endif
 | ||
|  | +dnl }
 | ||
|  | +dnl ],
 | ||
|  | + 	PTY_TYPE=termios
 | ||
|  | + 	SETUID="chmod u+s"
 | ||
|  | +dnl       AC_MSG_RESULT(yes)
 | ||
|  | +dnl ,
 | ||
|  | +dnl 	AC_MSG_RESULT(no)
 | ||
|  | +dnl ,
 | ||
|  | +dnl 	AC_MSG_ERROR([Expect can't be cross compiled])
 | ||
|  | +dnl )
 | ||
|  |   | ||
|  |  # | ||
|  |  # Check for select and/or poll. If both exist, we prefer select. | ||
|  | @@ -869,28 +869,29 @@
 | ||
|  |  AC_HAVE_FUNCS(getpty) | ||
|  |   | ||
|  |  # following test sets SETPGRP_VOID if setpgrp takes 0 args, else takes 2 | ||
|  | -AC_FUNC_SETPGRP
 | ||
|  | +dnl  AC_FUNC_SETPGRP
 | ||
|  | +AC_DEFINE(SETPGRP_VOID, 1)
 | ||
|  |   | ||
|  | -#
 | ||
|  | -# check for timezones
 | ||
|  | -#
 | ||
|  | -AC_MSG_CHECKING([for SV-style timezone])
 | ||
|  | -AC_TRY_RUN([
 | ||
|  | -extern char *tzname[2];
 | ||
|  | -extern int daylight;
 | ||
|  | -main()
 | ||
|  | -{
 | ||
|  | -  int *x = &daylight;
 | ||
|  | -  char **y = tzname;
 | ||
|  | -
 | ||
|  | -  exit(0);
 | ||
|  | -}],
 | ||
|  | -	AC_DEFINE(HAVE_SV_TIMEZONE)
 | ||
|  | -	AC_MSG_RESULT(yes),
 | ||
|  | -	AC_MSG_RESULT(no)
 | ||
|  | -,
 | ||
|  | -	AC_MSG_ERROR([Expect can't be cross compiled])
 | ||
|  | -)
 | ||
|  | +dnl  #
 | ||
|  | +dnl  # check for timezones
 | ||
|  | +dnl  #
 | ||
|  | +dnl  AC_MSG_CHECKING([for SV-style timezone])
 | ||
|  | +dnl  AC_TRY_RUN([
 | ||
|  | +dnl  extern char *tzname[2];
 | ||
|  | +dnl  extern int daylight;
 | ||
|  | +dnl  main()
 | ||
|  | +dnl  {
 | ||
|  | +dnl    int *x = &daylight;
 | ||
|  | +dnl    char **y = tzname;
 | ||
|  | +
 | ||
|  | +dnl    exit(0);
 | ||
|  | +dnl  }],
 | ||
|  | +dnl      AC_DEFINE(HAVE_SV_TIMEZONE)
 | ||
|  | +dnl      AC_MSG_RESULT(yes),
 | ||
|  | +dnl      AC_MSG_RESULT(no)
 | ||
|  | +dnl  ,
 | ||
|  | +dnl      AC_MSG_ERROR([Expect can't be cross compiled])
 | ||
|  | +dnl  )
 | ||
|  |   | ||
|  |   | ||
|  |  # Following comment stolen from Tcl's configure.in: |