autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AC_OBJEXT again


From: Mo DeJong
Subject: Re: AC_OBJEXT again
Date: Thu, 30 Nov 2000 12:55:00 -0800 (PST)

I have to admit that I am a bit confused about
what is going on with the _AC_CYGWIN and
_AC_MINGW32 macros. I was under the
impression that they were required
for _AC_EXEEXT or _AC_OBJEXT, but
it seems like the addition of these
new patches will mean the obj and
exe extension will not need to depend
on _AC_CYGWIN or _AC_MINGW32. I am
wondering if the code that checks for
$CYGWIN in this macro can just be
removed? Like so:

Index: acspecific.m4
===================================================================
RCS file: /cvs/autoconf/acspecific.m4,v
retrieving revision 1.319
diff -u -r1.319 acspecific.m4
--- acspecific.m4       2000/11/30 16:22:30     1.319
+++ acspecific.m4       2000/11/30 20:37:00
@@ -1190,37 +1190,34 @@
 
 # _AC_EXEEXT
 # ----------
-# Check for the extension used for executables.  This knows that we
-# add .exe for Cygwin or mingw32.  Otherwise, it compiles a test
-# executable.  If this is called, the executable extensions will be
-# automatically used by link commands run by the configure script.
+# Check the extension used for executables. This macro
+# compiles a test executable and checks for an extension
+# like .exe. If this macro is called, the executable extensions
+# will be automatically used by link commands run by the
+# configure script.
 #
 # This macro is called by AC_LANG_COMPILER, the latter being required
 # by the AC_COMPILE_IFELSE macros, so use AC_TRY_EVAL.
 m4_define([_AC_EXEEXT],
 [AC_CACHE_CHECK([for executable suffix], ac_cv_exeext,
-[case "$CYGWIN $MINGW32 $EMXOS2" in
-  *yes*) ac_cv_exeext=.exe ;;
-  *)
-    AC_LANG_CONFTEST([AC_LANG_PROGRAM()])
-    if AC_TRY_EVAL(ac_link); then
-      # If both `conftest.exe' and `conftest' are `present' (well, observable)
-      # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
-      # work properly (i.e., refer to `conftest.exe'), while it won't with
-      # `rm'.
-      for ac_file in `ls conftest.exe conftest conftest.* 2>/dev/null`; do
-       case $ac_file in
-         *.$ac_ext | *.o | *.obj | *.xcoff | *.tds) ;;
-         *) ac_cv_exeext=`expr "$ac_file" : 'conftest\(.*\)'`
+[AC_LANG_CONFTEST([AC_LANG_PROGRAM()])
+if AC_TRY_EVAL(ac_link); then
+    # If both `conftest.exe' and `conftest' are `present' (well, 
observable)
+    # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+    # work properly (i.e., refer to `conftest.exe'), while it won't with
+    # `rm'.
+    for ac_file in `ls conftest.exe conftest conftest.* 2>/dev/null`; do
+        case $ac_file in
+            *.$ac_ext | *.o | *.obj | *.xcoff | *.tds) ;;
+            *) ac_cv_exeext=`expr "$ac_file" : 'conftest\(.*\)'`
             break;;
-       esac
-      done
-      rm -f conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-    else
-      AC_MSG_ERROR([cannot compile and link])
-    fi
-    ;;
-esac])
+        esac
+    done
+    rm -f conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+else
+    AC_MSG_ERROR([cannot compile and link])
+fi
+])
 AC_SUBST([EXEEXT], [$ac_cv_exeext])dnl
 ac_exeext=$EXEEXT
 ])# _AC_EXEEXT




At any rate, my real problem is
that I have a configure.in
that needs to check the ac_cv_mingw32
and ac_cv_cygwin variables in order
to work properly. These variables
are never getting set because
the _AC_CYGWIN macro is not
getting run.


I thought I would be able to fix
the problem by just adding the
calls to these macros back
into the code. (this patch
is unrelated to the one above,

it is just to provide context).

Index: acspecific.m4
===================================================================
RCS file: /cvs/autoconf/acspecific.m4,v
retrieving revision 1.319
diff -u -r1.319 acspecific.m4
--- acspecific.m4       2000/11/30 16:22:30     1.319
+++ acspecific.m4       2000/11/30 20:03:42
@@ -1199,7 +1199,11 @@
 # by the AC_COMPILE_IFELSE macros, so use AC_TRY_EVAL.
 m4_define([_AC_EXEEXT],
 [AC_CACHE_CHECK([for executable suffix], ac_cv_exeext,
-[case "$CYGWIN $MINGW32 $EMXOS2" in
+[
+_AC_CYGWIN
+_AC_EMXOS2
+_AC_MINGW32
+case "$CYGWIN $MINGW32 $EMXOS2" in
   *yes*) ac_cv_exeext=.exe ;;
   *)
     AC_LANG_CONFTEST([AC_LANG_PROGRAM()])


Sadly, this does not work. It complains
about a recursive expansion.

configure.in:29: error: m4_require: circular dependency of AC_PROG_CXX
configure.in:29: AC_PROG_CXX is required by...
aclang.m4:908: AC_LANG_COMPILER(C++) is expanded from...
configure.in:29: AC_LANG_COMPILER(C++) is required by...
aclang.m4:513: AC_LANG_COMPILER_REQUIRE is expanded from...
acgeneral.m4:2816: AC_COMPILE_IFELSE is expanded from...
aclang.m4:945: AC_PROG_CXX is expanded from...
configure.in:29: the top level


Is this because _AC_CYGWIN is calling AC_LANG_PROGRAM?

AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
[#ifndef __CYGWIN__
# define __CYGWIN__ __CYGWIN32__
#endif
return __CYGWIN__;])],
                   [ac_cv_cygwin=yes],
                   [ac_cv_cygwin=no])])


I am kind of stuck at this point.
Does anyone know what the deal
with these macros is?

thanks
Mo DeJong
Red Hat Inc




reply via email to

[Prev in Thread] Current Thread [Next in Thread]