+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.
@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
@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
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
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
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
# 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"
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
# --------------------------------
# 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)