* Akim
| [...] Your patch, as is, does not solve [...]

I know, I know. I don't claim the patch to be perfect, I'm just saying
that it is _better_ than the code it replaces.  :^}

| [...] since AC_PROG_CC launches AC_EXEEXT which uses AC_LINK_IFELSE
| which requires AC_PROG_CC, autoconf should and will fail.  This is
| the circular dependency I'm referring to.
| 
| AC_LINK_IFELSE must keep its AC_REQUIRE on AC_PROG_CC, hence you
| must not use AC_LINK_IFELSE.  That's why I first suggested using
| AC_TRY_EVAL: to avoid the AC_REQUIRE.

Yes, I was aware of that problem -- I just can't think of a good way
to solve it at the moment.

| You may call AC_CANONICAL_TARGET (while AC_CANONICAL_HOST is more
| logical), but you must depend on the *_host variables, *not* the
| target vars.  See the doc for more details.

I think the attached patch will at least improve the situation a
little bit. I couldn't find anything from config.guess matching the
EMX/OS2 stuff, though.

Regards,
Morten

Index: ChangeLog
===================================================================
RCS file: /cvs/autoconf/ChangeLog,v
retrieving revision 1.897
diff -u -r1.897 ChangeLog
--- ChangeLog   2000/10/05 13:52:41     1.897
+++ ChangeLog   2000/10/11 10:42:34
@@ -1,3 +1,9 @@
+2000-10-11  Morten Eriksen <[EMAIL PROTECTED]>
+
+       * acspesific.m4 (_AC_CYGWIN, _AC_MINGW32): Avoid false negatives
+       when using compilers which do not set up special defines on these
+       platforms.
+
 2000-10-05  Akim Demaille  <[EMAIL PROTECTED]>
 
        Check that updated scripts are valid scripts.
Index: acspecific.m4
===================================================================
RCS file: /cvs/autoconf/acspecific.m4,v
retrieving revision 1.300
diff -u -r1.300 acspecific.m4
--- acspecific.m4       2000/10/02 12:47:13     1.300
+++ acspecific.m4       2000/10/11 10:42:35
@@ -1496,25 +1496,21 @@
 
 # _AC_CYGWIN
 # ----------
-# Check for Cygwin.  This is a way to set the right value for
-# EXEEXT.
+# Check for Cygwin.
 define([_AC_CYGWIN],
-[AC_CACHE_CHECK(for Cygwin environment, ac_cv_cygwin,
-[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
-[#ifndef __CYGWIN__
-# define __CYGWIN__ __CYGWIN32__
-#endif
-return __CYGWIN__;])],
-                   [ac_cv_cygwin=yes],
-                   [ac_cv_cygwin=no])])
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_CACHE_CHECK(for Cygwin environment, ac_cv_cygwin,
+[case "$host_os" in
+  cygwin*) ac_cv_cygwin=yes ;;
+  *) ac_cv_cygwin=no ;;
+esac])
 test "$ac_cv_cygwin" = yes && CYGWIN=yes[]dnl
 ])# _AC_CYGWIN
 
 
 # _AC_EMXOS2
 # ----------
-# Check for EMX on OS/2.  This is another way to set the right value
-# for EXEEXT.
+# Check for EMX on OS/2.
 define([_AC_EMXOS2],
 [AC_CACHE_CHECK(for EMX OS/2 environment, ac_cv_emxos2,
 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [return __EMX__;])],
@@ -1526,13 +1522,14 @@
 
 # _AC_MINGW32
 # -----------
-# Check for mingw32.  This is another way to set the right value for
-# EXEEXT.
+# Check for mingw32.
 define([_AC_MINGW32],
-[AC_CACHE_CHECK(for mingw32 environment, ac_cv_mingw32,
-[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [return __MINGW32__;])],
-                   [ac_cv_mingw32=yes],
-                   [ac_cv_mingw32=no])])
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_CACHE_CHECK(for mingw32 environment, ac_cv_mingw32,
+[case "$host_os" in
+  mingw32*) ac_cv_mingw32=yes ;;
+  *) ac_cv_mingw32=no ;;
+esac])
 test "$ac_cv_mingw32" = yes && MINGW32=yes[]dnl
 ])# _AC_MINGW32
 

Reply via email to