autoconf-patches
[Top][All Lists]
Advanced

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

Re: Fix EXEEXT mechanism


From: Tim Van Holder
Subject: Re: Fix EXEEXT mechanism
Date: Mon, 22 Jan 2001 22:48:17 +0100

<New and improved multilingual version - Patches whiter than white>

Changes:
 - moved AC_COMPILER_(OBJ|EXE)EXT before AC_LANG_COMPILER_WORKS,
   as the latter requires a correct ac_exeext to function
 - use AS_IF(AC_TRY_EVAL(ac_link)) instead of AC_LINK_IFELSE
   in AC_EXEEXT_O, as AC_TRY_LINK and friends require a valid
   ac_exeext, voiding the EXEEXT_O test.

Also fixed a small typo in a comment.

No AC_BEFORE's were added, as I'm unsure about their correct
use in this case; I defer this to someone who is more versed in
autoconf-speak.

Index: ChangeLog

2001-01-22  Tim Van Holder  <address@hidden>

        * aclang.m4 (_AC_COMPILER_EXEEXT_O): Use
        AS_IF([AC_TRY_EVAL(ac_link)]) instead of AC_LINK_IFELSE to
        avoid depending on ac_exeext before it's found.
        (AC_PROG_CC, AC_PROG_CXX, AC_PROG_F77): Check for the
        executable extension BEFORE checking whether the compiler
        works, as that test depends on a correct ac_exeext.


Index: aclang.m4
===================================================================
RCS file: /cvs/autoconf/aclang.m4,v
retrieving revision 1.115
diff -u -c -r1.115 aclang.m4
cvs server: conflicting specifications of output style
*** aclang.m4   2001/01/22 14:29:24     1.115
--- aclang.m4   2001/01/22 21:38:45
***************
*** 651,657 ****
  # addition to `conftest.obj'
  
  
! # We must not AU define them, because autoupdate would them remove
  # them, which is right, but Automake 1.4 would remove the support for
  # $(EXEEXT) etc.
  # FIXME: Remove this once Automake fixed.
--- 651,657 ----
  # addition to `conftest.obj'
  
  
! # We must not AU define them, because autoupdate would then remove
  # them, which is right, but Automake 1.4 would remove the support for
  # $(EXEEXT) etc.
  # FIXME: Remove this once Automake fixed.
***************
*** 689,695 ****
  m4_define([_AC_COMPILER_EXEEXT_O],
  [# We have not set ac_exeext yet which is needed by `ac_link'.
  ac_exeext=$ac_cv_exeext
! _AC_LINK_IFELSE([],
  [# 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
--- 689,695 ----
  m4_define([_AC_COMPILER_EXEEXT_O],
  [# We have not set ac_exeext yet which is needed by `ac_link'.
  ac_exeext=$ac_cv_exeext
! AS_IF([AC_TRY_EVAL(ac_link)],
  [# 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
***************
*** 878,888 ****
  
  test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
  
  _AC_LANG_COMPILER_WORKS
  _AC_LANG_COMPILER_GNU
  GCC=`test $ac_compiler_gnu = yes && echo yes`
- AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
- AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
  _AC_PROG_CC_G
  # Some people use a C++ compiler to compile C.  Since we use `exit',
  # in C++ we need to declare it.  In case someone uses the same compiler
--- 878,888 ----
  
  test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
  
+ AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
+ AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
  _AC_LANG_COMPILER_WORKS
  _AC_LANG_COMPILER_GNU
  GCC=`test $ac_compiler_gnu = yes && echo yes`
  _AC_PROG_CC_G
  # Some people use a C++ compiler to compile C.  Since we use `exit',
  # in C++ we need to declare it.  In case someone uses the same compiler
***************
*** 1082,1092 ****
                            [g++ c++ gpp aCC CC cxx cc++ cl KCC RCC xlC_r 
xlC])],
                 g++)
  
  _AC_LANG_COMPILER_WORKS
  _AC_LANG_COMPILER_GNU
  GXX=`test $ac_compiler_gnu = yes && echo yes`
- AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
- AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
  _AC_PROG_CXX_G
  _AC_PROG_CXX_EXIT_DECLARATION
  AC_LANG_POP(C++)dnl
--- 1082,1092 ----
                            [g++ c++ gpp aCC CC cxx cc++ cl KCC RCC xlC_r 
xlC])],
                 g++)
  
+ AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
+ AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
  _AC_LANG_COMPILER_WORKS
  _AC_LANG_COMPILER_GNU
  GXX=`test $ac_compiler_gnu = yes && echo yes`
  _AC_PROG_CXX_G
  _AC_PROG_CXX_EXIT_DECLARATION
  AC_LANG_POP(C++)dnl
***************
*** 1204,1209 ****
--- 1204,1211 ----
        [m4_default([$1],
                    [g77 f77 xlf cf77 pgf77 fl32 fort77 f90 xlf90 f95 lf95 
pgf90 fc])])
  
+ AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
+ AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
  _AC_LANG_COMPILER_WORKS
  # If we don't use `.F' as extension, the preprocessor is not run on the
  # input file.
***************
*** 1212,1219 ****
  _AC_LANG_COMPILER_GNU
  ac_ext=$ac_save_ext
  G77=`test $ac_compiler_gnu = yes && echo yes`
- AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl
- AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl
  _AC_PROG_F77_G
  AC_LANG_POP(Fortran 77)dnl
  ])# AC_PROG_F77
--- 1214,1219 ----




reply via email to

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