autoconf-patches
[Top][All Lists]
Advanced

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

Re: FYI: Adjust circular dependencies


From: Akim Demaille
Subject: Re: FYI: Adjust circular dependencies
Date: 12 Oct 2000 17:23:50 +0200
User-agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)

| So, time to re-submit my AC_EXEEXT patch again, I guess. :^}

Yep :)

| BTW, nice piece of work with the circular dependency detection
| feature, Akim.

Thanks!


| Index: acspecific.m4
| ===================================================================
| RCS file: /cvs/autoconf/acspecific.m4,v
| retrieving revision 1.301
| diff -u -r1.301 acspecific.m4
| --- acspecific.m4     2000/10/12 12:39:25     1.301
| +++ acspecific.m4     2000/10/12 13:13:35
| @@ -1554,32 +1554,36 @@
|  
|  # _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 for a valid extension to use for executables.
|  define([_AC_EXEEXT],
|  [AC_CACHE_CHECK([for executable suffix], ac_cv_exeext,
| -[case "$CYGWIN $MINGW32 $EMXOS2" in
| -  *yes*) ac_cv_exeext=.exe ;;
| -  *)
| +[# Try to compile and link an executable with no suffix first.
| +ac_exeext=
| +_AC_LINK_IFELSE([AC_LANG_PROGRAM()],
| + [# Ok, we can use an empty suffix for executables. Now see if the
| +  # executable with the empty suffix is just a filesystem mapping
| +  # from the real file (this happens under Cygwin, for instance).
| +  if (test conftest -ef conftest.exe) >/dev/null 2>&1; then
| +    # Prefer .exe over empty suffix (to avoid depending
| +    # on the Cygwin filesystem voodoo, which is known to fail
| +    # with certain tools/commands).
| +    ac_cv_exeext=.exe
| +  else
| +    ac_cv_exeext=
| +  fi],
| + [# Couldn't use empty suffix, try with suffix commonly used
| +  # on DOS-based platforms.
| +  ac_exeext=.exe
|    _AC_LINK_IFELSE([AC_LANG_PROGRAM()],
| +    [ac_cv_exeext=.exe],
| +    [rm -f conftest.$ac_ext conftest.$ac_objext
| +     AC_MSG_ERROR(cannot compile and link)])

Please quote.  Even if useless here, quote.

| + ])
| +])

Please, here try to align on the arguments of _AC_LINK_IFELSE.  I
understand why you don't for the first _AC_LINK_IFELSE, but here you
can, and it is more consistent with Autoconf's style.  Basically the
Autoconf style is based on the (wrong) assumption that GNU M4
preserves the indentation during the expansion.  Maybe someday it
could happen.  So here it should be

_AC_LINK_IFELSE([AC_LANG_PROGRAM()],
                [ac_cv_exeext=.exe],
                [rm -f conftest.$ac_ext conftest.$ac_objext
AC_MSG_ERROR([cannot compile and link])])



| +rm -f conftest.$ac_ext conftest.$ac_objext conftest.$ac_exeext

This is wrong: either you lack one *inside* AC_CACHE_CHECK, or it is
superfluous (I have not tracked down).  But it makes no sense outside
AC_CACHE_CHECK.

| +ac_exeext=$ac_cv_exeext
| +EXEEXT=$ac_cv_exeext
| +AC_SUBST(EXEEXT)

Don't hesitate to promote this instead:

AC_SUBST(EXEEXT, $ac_cv_exeext)

I tend to agree with Pavel: it's a bit hard to track down the setting
of ac_cv_exeext.  Personally I would favor that you use *only*
ac_exeext in the body of AC_CACHE_CHECK, and right at the end of it,
you

ac_cv_exeext=$ac_exeext

It should be clearer, and shorter.  Well, I think :)


|  ])# _AC_EXEEXT

Other than that, this patch seems fine to me.  I suggest that we apply
your fixed proposal, and then discuss from there.  Ernie's and
Bernard's opinions will be precious then.


| Index: TODO
| ===================================================================
| RCS file: /cvs/autoconf/TODO,v
| retrieving revision 1.93
| diff -u -r1.93 TODO
| --- TODO      2000/10/12 12:45:16     1.93
| +++ TODO      2000/10/12 13:24:02
| @@ -14,8 +14,7 @@
|  egrep, the output files are touch'ed.
|  
|  ** AC_EXEEXT, AC_OBJEXT
| -We need a good implement.  As much as possible, they should not depend
| -upon AC_EMXOS2 etc.
| +These should be AC_REQUIRE'd where $ac_exeext and $ac_objext is used.

Hm, I don't understand this.  Well, I do, but the macros which use
these guys also use AC_PROG_CC (or some other), which are in charge of
calling them.  Are there macros which don't AC_LANG_COMPILER_REQUIRE
but that depend upon $ac_exeext or $ac_objext?



reply via email to

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