From 12f8f043b75a66d5e6ed13fc7819559f938dad2d Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 10 Jun 1997 21:44:33 +0000 Subject: [PATCH] cygwin fix --- ChangeLog | 4 ++++ m4/cygwin.m4 | 24 +++++++++++++++++------- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index d42aca99..a3edfb3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Jun 10 11:04:16 1997 Tom Tromey + + * m4/cygwin.m4: Examine output of compiler to see if .exe needed. + Sun Jun 1 13:16:05 1997 Tom Tromey * automake.in (handle_built_sources): Handle PRE_BUILT_SOURCES. diff --git a/m4/cygwin.m4 b/m4/cygwin.m4 index 0c635f36..00e8fb11 100644 --- a/m4/cygwin.m4 +++ b/m4/cygwin.m4 @@ -3,12 +3,22 @@ # Otherwise set it to "". dnl AM_CYGWIN32() +dnl You might think we can do this by checking for a cygwin32-specific +dnl cpp define. We can't, because cross-compilers that target +dnl cygwin32 don't use the .exe suffix. I don't know why. AC_DEFUN(AM_CYGWIN32, -[AC_MSG_CHECKING(for Cygwin32 environment) -AC_EGREP_CPP(lose, [ -#ifdef __CYGWIN32__ -lose -#endif], [EXEEXT=.exe -AC_MSG_RESULT(yes)], [EXEEXT= -AC_MSG_RESULT(no)]) +[AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32, +[cat > conftest.$ac_ext << 'EOF' +int main () { +/* Nothing. */ +return 0; } +EOF +if AC_TRY_EVAL(ac_link) && test -s conftest.exe; then + am_cv_cygwin32=yes +else + am_cv_cygwin32=no +fi +rm -f conftest*]) +EXEEXT= +test "$am_cv_cygwin32" = yes && EXEEXT=.exe AC_SUBST(EXEEXT)]) -- 2.43.5