From: Đoàn Trần Công Danh --- configure.in | 79 +++++++++++++++++++++------------------------------- 1 file changed, 32 insertions(+), 47 deletions(-) diff --git configure.in configure.in index 0e4c9d1..d41a7a4 100755 --- a/configure.in +++ b/configure.in @@ -732,20 +732,17 @@ fi # first check for the pure bsd AC_MSG_CHECKING([for struct sgttyb]) -AC_TRY_RUN([ +AC_COMPILE_IFELSE([ +AC_LANG_PROGRAM([[ #include -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 @@ -757,107 +754,99 @@ if test $mach -eq 0 ; then # 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 - main() - { + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ + #include + ]],[[ 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([ + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ /* including termios.h on Solaris 5.6 fails unless inttypes.h included */ # ifdef HAVE_INTTYPES_H # include # endif # include - 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([ +AC_COMPILE_IFELSE([ +AC_LANG_PROGRAM([[ /* including termios.h on Solaris 5.6 fails unless inttypes.h included */ #ifdef HAVE_INTTYPES_H #include #endif #include -main() { +]],[[ #if defined(TCGETS) || defined(TCGETA) return 0; #else - return 1; + #error no TCGETS or TCGETA #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([ +AC_COMPILE_IFELSE([ +AC_LANG_PROGRAM([[ /* including termios.h on Solaris 5.6 fails unless inttypes.h included */ #ifdef HAVE_INTTYPES_H #include #endif #include -main() { +]],[[ #ifdef TIOCGWINSZ return 0; #else - return 1; + #error no TIOCGWINSZ #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(){ +AC_COMPILE_IFELSE([ +AC_LANG_PROGRAM([[ +]],[[ #ifdef CRAY return 0; #else - return 1; + #error no CRAY #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]) ) # @@ -895,21 +884,17 @@ AC_FUNC_SETPGRP # check for timezones # AC_MSG_CHECKING([for SV-style timezone]) -AC_TRY_RUN([ +AC_LINK_IFELSE([ +AC_LANG_PROGRAM([[ 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]) ) -- 2.26.0.292.g33ef6b2f38