]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
cygwin fix
authorTom Tromey <tromey@redhat.com>
Tue, 10 Jun 1997 21:44:40 +0000 (21:44 +0000)
committerTom Tromey <tromey@redhat.com>
Tue, 10 Jun 1997 21:44:40 +0000 (21:44 +0000)
ChangeLog
m4/cygwin.m4

index d42aca995253bc3d21ae19d7f2b30c212cfec17a..a3edfb3d1fa777765865da1b69e8f987bdf38d4d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Tue Jun 10 11:04:16 1997  Tom Tromey  <tromey@cygnus.com>
+
+       * m4/cygwin.m4: Examine output of compiler to see if .exe needed.
+
 Sun Jun  1 13:16:05 1997  Tom Tromey  <tromey@cygnus.com>
 
        * automake.in (handle_built_sources): Handle PRE_BUILT_SOURCES.
index 0c635f3652e27a4ad5e0358de3888f4caab9bef1..00e8fb11e756eb870efaa0d3649ce267fdc64a55 100644 (file)
@@ -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)])