]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* doc/autoconf.texi: More AC_MSG_FAILURE promotion.
authorAkim Demaille <akim@epita.fr>
Sun, 27 Oct 2002 18:24:51 +0000 (18:24 +0000)
committerAkim Demaille <akim@epita.fr>
Sun, 27 Oct 2002 18:24:51 +0000 (18:24 +0000)
* lib/autoconf/fortran.m4 (_AC_F77_NAME_MANGLING):
Die when a simple Fortran program cannot be compiled.
* lib/autoconf/lang.m4 (AC_LANG_CALL, AC_LANG_FUNC_LINK_TRY):
Issue a warning if no function is given.

ChangeLog
NEWS
doc/autoconf.texi
lib/autoconf/fortran.m4
lib/autoconf/lang.m4

index b903d801a915214e6460e1b715ee5c18043ab869..1633a735cea6223b2e3929d4ea2f33ee03d4f2bc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2002-10-27  Akim Demaille  <akim@epita.fr>
+
+       * doc/autoconf.texi: More AC_MSG_FAILURE promotion.
+       * lib/autoconf/fortran.m4 (_AC_F77_NAME_MANGLING):
+       Die when a simple Fortran program cannot be compiled.
+       * lib/autoconf/lang.m4 (AC_LANG_CALL, AC_LANG_FUNC_LINK_TRY):
+       Issue a warning if no function is given.
+
 2002-10-27  Akim Demaille  <akim@epita.fr>
 
        * doc/autoconf.texi (Run Time): Document AC_RUN_IFELSE.
diff --git a/NEWS b/NEWS
index 35b05eef8cc5b9adbd2ecad578a4364a9656c532..bccb4862f32d065d1f86f65d79e5ab15f1dcd52f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,11 @@ Release tips:
   This sections explains how to write good test sources to use with
   AC_COMPILE_IFELSE etc.  It documents AC_LANG_PROGRAMS and so forth.
 
+- AC_FOO_IFELSE vs. AC_TRY_FOO
+
+  Explains why Autoconf moves from AC_TRY_COMPILE etc. to
+  AC_COMPILE_IFELSE and AC_LANG_PROGRAM etc.
+
 ** autoreconf
 
 - Is more robust to different Gettext installations.
index ade58ecbca4b32fd7e87306d59fcaa881b7cfc75..b108addde118ca4931f156281c8c802cbfe02dc4 100644 (file)
@@ -3314,8 +3314,8 @@ in the presence of another that is not already in @code{LIBS}.
 @acindex SEARCH_LIBS
 Search for a library defining @var{function} if it's not already
 available.  This equates to calling
-@samp{AC_LINK_IFELSE([AC_LANG_CALL([@var{function}])])} first with no
-libraries, then for each library listed in @var{search-libs}.
+@samp{AC_LINK_IFELSE([AC_LANG_CALL([], [@var{function}])])} first with
+no libraries, then for each library listed in @var{search-libs}.
 
 Add @option{-l@var{library}} to @code{LIBS} for the first library found
 to contain @var{function}, and run @var{action-if-found}.  If the
@@ -5850,13 +5850,12 @@ not encouraged, as it violates strongly the typing system.
 @end defmac
 
 
-@defmac AC_LANG_FUNC_LINK_TRY (@var{prologue}, @var{function})
+@defmac AC_LANG_FUNC_LINK_TRY (@var{function})
 @acindex LANG_FUNC_LINK_TRY
-Expands into a source file which consists of the @var{prologue}, and
-then a pseudo use of the @var{function} as body of the main function
-(e.g., @code{main} in C): a simple (function pointer) assignment.  Since
-it uses @code{AC_LANG_PROGRAMS}, the feature of the latter are
-available.
+Expands into a source file which consists of a pseudo use of the
+@var{function} as body of the main function (e.g., @code{main} in C): a
+simple (function pointer) assignment.  Since it uses
+@code{AC_LANG_PROGRAMS}, the feature of the latter are available.
 
 As @code{AC_LANG_CALL}, this macro is documented only for completeness.
 It is considered to be severely broken, and in the future will be
@@ -5969,8 +5968,10 @@ the currently selected language, as well as @code{CPPFLAGS}, when
 compiling.  If Fortran 77 is the currently selected language then
 @code{FFLAGS} will be used when compiling.
 
-This macro does not try to link; use @code{AC_LINK_IFELSE} if you need
-to do that (@pxref{Running the Linker}).
+It is customary to report unexpected failures with
+@code{AC_MSG_FAILURE}.  This macro does not try to link; use
+@code{AC_LINK_IFELSE} if you need to do that (@pxref{Running the
+Linker}).
 @end defmac
 
 @node Running the Linker
@@ -6018,8 +6019,9 @@ the currently selected language, as well as @code{CPPFLAGS}, when
 compiling.  If Fortran 77 is the currently selected language then
 @code{FFLAGS} will be used when compiling.
 
-This macro does not try to execute the program; use @code{AC_RUN_IFELSE}
-if you need to do that (@pxref{Run Time}).
+It is customary to report unexpected failures with
+@code{AC_MSG_FAILURE}.  This macro does not try to execute the program;
+use @code{AC_RUN_IFELSE} if you need to do that (@pxref{Run Time}).
 @end defmac
 
 
@@ -6063,6 +6065,9 @@ no guarantee that this exit status is issued by the @var{program}, or by
 the failure of its compilation.  In other words, use this feature if
 sadist only, it was reestablished because the Autoconf maintainers grew
 tired of receiving ``bug reports''.
+
+It is customary to report unexpected failures with
+@code{AC_MSG_FAILURE}.
 @end defmac
 
 Try to provide a pessimistic default value to use when cross-compiling
index 7efd54bf5de5570335bb5187d87f073b292951ab..0fdb50541a39020ac150a0f234a355308efe7454 100644 (file)
@@ -385,7 +385,7 @@ fi
 # On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
 # /foo, /bar, and /baz are search directories for the Fortran linker.
 # Here, we change these into -L/foo -L/bar -L/baz (and put it first):
-ac_f77_v_output="`echo $ac_f77_v_output | 
+ac_f77_v_output="`echo $ac_f77_v_output |
        grep 'LPATH is:' |
        sed 's,.*LPATH is\(: *[[^ ]]*\).*,\1,;s,: */, -L/,g'` $ac_f77_v_output"
 
@@ -735,7 +735,8 @@ AC_COMPILE_IFELSE(
 
   LIBS=$ac_save_LIBS
   AC_LANG_POP(C)dnl
-  rm -f cf77_test* conftest*])
+  rm -f cf77_test* conftest*],
+  [AC_MSG_FAILURE([cannot compile a simple Fortran program])])
 AC_LANG_POP(Fortran 77)dnl
 ])
 ])# _AC_F77_NAME_MANGLING
index 014324da0c9dce7aceb903a97a37104650dbb24b..ba728a0972a205cc28a65010c6be1022aa765a67 100644 (file)
@@ -231,14 +231,16 @@ AC_DEFUN([AC_LANG_PROGRAM],
 # --------------------------------
 # Call the FUNCTION.
 AC_DEFUN([AC_LANG_CALL],
-[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
+[m4_ifval([$2], [], [m4_warn([syntax], [$0: no function given])])dnl
+_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
 
 
 # AC_LANG_FUNC_LINK_TRY(FUNCTION)
 # -------------------------------
 # Produce a source which links correctly iff the FUNCTION exists.
 AC_DEFUN([AC_LANG_FUNC_LINK_TRY],
-[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
+[m4_ifval([$1], [], [m4_warn([syntax], [$0: no function given])])dnl
+_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
 
 
 # AC_LANG_BOOL_COMPILE_TRY(PROLOGUE, EXPRESSION)