+2007-05-02 Stepan Kasal <kasal@ucw.cz>
+
+ * lib/autoconf/lang.m4, lib/autoconf/c.m4,
+ lib/autoconf/fortran.m4, lib/autoconf/erlang.m4: Cleanup of
+ section titles and other comments; no code change.
+
2007-05-01 Kevin Ryde <user42@zip.com.au>
* doc/autoconf.texi (Particular Programs): Typo
# Roland McGrath, Noah Friedman, david d zuhn, and many others.
+# Table of Contents:
+#
+# 1. Language selection
+# and routines to produce programs in a given language.
+# 1a. C 1b. C++ 1c. Objective C
+#
+# 2. Producing programs in a given language.
+# 2a. C 2b. C++ 2c. Objective C
+#
+# 3. Looking for a compiler
+# And possibly the associated preprocessor.
+# 3a. C 3b. C++ 3c. Objective C
+#
+# 4. Compilers' characteristics.
+# 4a. C
+
+
+
+## ----------------------- ##
+## 1. Language selection. ##
+## ----------------------- ##
+
# -------------------- #
-# 1b. The C language. #
+# 1a. The C language. #
# -------------------- #
m4_define([_AC_LANG_PREFIX(C)], [C])
+
# ---------------------- #
-# 1c. The C++ language. #
+# 1b. The C++ language. #
# ---------------------- #
# ------------------------------ #
-# 1d. The Objective C language. #
+# 1c. The Objective C language. #
# ------------------------------ #
-## ---------------------- ##
-## 2.Producing programs. ##
-## ---------------------- ##
-
+## ----------------------- ##
+## 2. Producing programs. ##
+## ----------------------- ##
# --------------- #
-# 2b. C sources. #
+# 2a. C sources. #
# --------------- #
+
# AC_LANG_SOURCE(C)(BODY)
# -----------------------
# We can't use '#line $LINENO "configure"' here, since
])])
+
# ----------------- #
-# 2c. C++ sources. #
+# 2b. C++ sources. #
# ----------------- #
+
# AC_LANG_SOURCE(C++)(BODY)
# -------------------------
m4_copy([AC_LANG_SOURCE(C)], [AC_LANG_SOURCE(C++)])
# ------------------------- #
-# 2d. Objective C sources. #
+# 2c. Objective C sources. #
# ------------------------- #
+
# AC_LANG_SOURCE(Objective C)(BODY)
# ---------------------------------
m4_copy([AC_LANG_SOURCE(C)], [AC_LANG_SOURCE(Objective C)])
## -------------------------------------------- ##
# -------------------- #
-# 3b. The C compiler. #
+# 3a. The C compiler. #
# -------------------- #
])# AC_PROG_CC_C_O
+
# ---------------------- #
-# 3c. The C++ compiler. #
+# 3b. The C++ compiler. #
# ---------------------- #
])# AC_PROG_CXX_C_O
+
# ------------------------------ #
-# 3d. The Objective C compiler. #
+# 3c. The Objective C compiler. #
# ------------------------------ #
-
-
-
## ------------------------------- ##
## 4. Compilers' characteristics. ##
## ------------------------------- ##
-
# -------------------------------- #
-# 4b. C compiler characteristics. #
+# 4a. C compiler characteristics. #
# -------------------------------- #
+
# _AC_PROG_CC_C89 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE])
# ----------------------------------------------------------------
# If the C compiler is not in ANSI C89 (ISO C90) mode by default, try
# Written by Romain Lenglet.
+# Table of Contents:
+#
+# 0. Utility macros
+#
+# 1. Language selection
+# and routines to produce programs in a given language.
+#
+# 2. Producing programs in a given language.
+#
+# 3. Looking for a compiler
+# And possibly the associated preprocessor.
+
+
+
+## ------------------- ##
+## 0. Utility macros. ##
+## ------------------- ##
+
+
# AC_ERLANG_PATH_ERLC([VALUE-IF-NOT-FOUND], [PATH])
-# ----------------------------------------------
+# -------------------------------------------------
AC_DEFUN([AC_ERLANG_PATH_ERLC],
[AC_ARG_VAR([ERLC], [Erlang/OTP compiler command [autodetected]])dnl
if test -n "$ERLC"; then
AC_PATH_TOOL(ERLC, erlc, [$1], [$2])
fi
AC_ARG_VAR([ERLCFLAGS], [Erlang/OTP compiler flags [none]])dnl
-])# AC_ERLANG_PATH_ERLC
+])
+
# AC_ERLANG_NEED_ERLC([PATH])
-# ------------------------
+# ---------------------------
AC_DEFUN([AC_ERLANG_NEED_ERLC],
[AC_ERLANG_PATH_ERLC([not found], [$1])
if test "$ERLC" = "not found"; then
AC_MSG_ERROR([Erlang/OTP compiler (erlc) not found but required])
fi
-])# AC_ERLANG_NEED_ERLC
+])
+
# AC_ERLANG_PATH_ERL([VALUE-IF-NOT-FOUND], [PATH])
-# ---------------------------------------------
+# ------------------------------------------------
AC_DEFUN([AC_ERLANG_PATH_ERL],
[AC_ARG_VAR([ERL], [Erlang/OTP interpreter command [autodetected]])dnl
if test -n "$ERL"; then
else
AC_PATH_TOOL(ERL, erl, [$1], [$2])[]dnl
fi
-])# AC_ERLANG_PATH_ERL
+])
+
# AC_ERLANG_NEED_ERL([PATH])
-# -----------------------
+# --------------------------
AC_DEFUN([AC_ERLANG_NEED_ERL],
[AC_ERLANG_PATH_ERL([not found], [$1])
if test "$ERL" = "not found"; then
AC_MSG_ERROR([Erlang/OTP interpreter (erl) not found but required])
fi
-])# AC_ERLANG_NEED_ERL
-
-
-
-
-
+])
-dnl Extend Autoconf's AC_LANG macro to accept Erlang as a language for tests
## ----------------------- ##
## 1. Language selection. ##
## ----------------------- ##
-# ------------------------- #
-# 1x. The Erlang language. #
-# ------------------------- #
-
# AC_LANG(Erlang)
# ---------------
m4_define([AC_LANG(Erlang)],
ac_link='$ERLC $ERLCFLAGS -b beam conftest.$ac_ext >&AS_MESSAGE_LOG_FD ; echo "#!/bin/sh" > conftest$ac_exeext ; AS_ECHO(["\"$ERL\" -run conftest start -run init stop -noshell"]) >> conftest$ac_exeext ; chmod +x conftest$ac_exeext'
])
+
# AC_LANG_ERLANG
# --------------
m4_define([AC_LANG_ERLANG], [AC_LANG(Erlang)])
m4_define([_AC_LANG_PREFIX(Erlang)], [ERL])
+
## ---------------------- ##
## 2.Producing programs. ##
## ---------------------- ##
-# ---------------------- #
-# 2x. Generic routines. #
-# ---------------------- #
-
# AC_LANG_SOURCE(Erlang)(BODY)
# ----------------------------
m4_define([AC_LANG_SOURCE(Erlang)],
])
+
## -------------------------------------------- ##
## 3. Looking for Compilers and Preprocessors. ##
## -------------------------------------------- ##
-# ------------------------- #
-# 3x. The Erlang compiler. #
-# ------------------------- #
# AC_LANG_PREPROC(Erlang)
# -----------------------
[$0: No preprocessor defined for ]_AC_LANG)])
# AC_LANG_COMPILER(Erlang)
-# ----------------------------
+# ------------------------
# Find the Erlang compiler. Must be AC_DEFUN'd to be AC_REQUIRE'able.
AC_DEFUN([AC_LANG_COMPILER(Erlang)],
[AC_REQUIRE([AC_ERLANG_PATH_ERLC])])
-
-
-
-dnl Macro for checking if an Erlang library is installed, and to
-dnl determine its version
-
# AC_ERLANG_CHECK_LIB(LIBRARY, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-# -------------------------------------------------------------------
+# ----------------------------------------------------------------------
+# Macro for checking if an Erlang library is installed, and to
+# determine its version
+#
AC_DEFUN([AC_ERLANG_CHECK_LIB],
[AC_REQUIRE([AC_ERLANG_PATH_ERLC])[]dnl
AC_REQUIRE([AC_ERLANG_PATH_ERL])[]dnl
])# AC_ERLANG_CHECK_LIB
-
-dnl Determines the Erlang/OTP root directory
-
# AC_ERLANG_SUBST_ROOT_DIR
-# ---------------
+# ------------------------
+# Determines the Erlang/OTP root directory
+#
AC_DEFUN([AC_ERLANG_SUBST_ROOT_DIR],
[AC_REQUIRE([AC_ERLANG_NEED_ERLC])[]dnl
AC_REQUIRE([AC_ERLANG_NEED_ERL])[]dnl
AC_SUBST([ERLANG_ROOT_DIR], [$erlang_cv_root_dir])
])# AC_ERLANG_SUBST_ROOT_DIR
+
# AC_ERLANG_SUBST_LIB_DIR
-# ---------------
+# -----------------------
AC_DEFUN([AC_ERLANG_SUBST_LIB_DIR],
[AC_REQUIRE([AC_ERLANG_NEED_ERLC])[]dnl
AC_REQUIRE([AC_ERLANG_NEED_ERL])[]dnl
])# AC_ERLANG_SUBST_LIB_DIR
-dnl Directories for installing Erlang/OTP packages are separated from the
-dnl directories determined by running the Erlang/OTP installation that is used
-dnl for building.
-
-
# AC_ERLANG_SUBST_INSTALL_LIB_DIR
-# ---------------
+# -------------------------------
+#
+# Directories for installing Erlang/OTP packages are separated from the
+# directories determined by running the Erlang/OTP installation that is used
+# for building.
+#
AC_DEFUN([AC_ERLANG_SUBST_INSTALL_LIB_DIR],
[AC_MSG_CHECKING([for Erlang/OTP library installation base directory])
AC_ARG_VAR([ERLANG_INSTALL_LIB_DIR],
# AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR(PACKAGE_TARNAME, PACKAGE_VERSION)
-# ---------------
+# --------------------------------------------------------------------
AC_DEFUN([AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR],
[AC_REQUIRE([AC_ERLANG_SUBST_INSTALL_LIB_DIR])[]dnl
AC_MSG_CHECKING([for Erlang/OTP '$1' library installation subdirectory])
# Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
# Roland McGrath, Noah Friedman, david d zuhn, and many others.
+
+# Table of Contents:
+#
+# Preamble
+#
+# 0. Utility macros
+#
+# 1. Language selection
+# and routines to produce programs in a given language.
+#
+# 2. Producing programs in a given language.
+#
+# 3. Looking for a compiler
+# And possibly the associated preprocessor.
+#
+# 4. Compilers' characteristics.
+
+
+
+## ---------- ##
+## Preamble. ##
+## ---------- ##
+
# Fortran vs. Fortran 77:
# This file contains macros for both "Fortran 77" and "Fortran", where
# the former is the "classic" autoconf Fortran interface and is intended
# _AC_LANG_PREFIX in order to name cache and environment variables, etc.
+
+## ------------------- ##
+## 0. Utility macros. ##
+## ------------------- ##
+
+
# _AC_LIST_MEMBER_IF(ELEMENT, LIST, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
# ---------------------------------------------------------------------------
#
## ----------------------- ##
-# -------------------------- #
-# 1d. The Fortran language. #
-# -------------------------- #
-
-
# AC_LANG(Fortran 77)
# -------------------
m4_define([AC_LANG(Fortran 77)],
[Fortran], [FC])])
-## ---------------------- ##
-## 2.Producing programs. ##
-## ---------------------- ##
+## ----------------------- ##
+## 2. Producing programs. ##
+## ----------------------- ##
-# --------------------- #
-# 2d. Fortran sources. #
-# --------------------- #
# AC_LANG_SOURCE(Fortran 77)(BODY)
# AC_LANG_SOURCE(Fortran)(BODY)
## -------------------------------------------- ##
-# -------------------------- #
-# 3d. The Fortran compiler. #
-# -------------------------- #
-
-
# AC_LANG_PREPROC(Fortran 77)
# ---------------------------
# Find the Fortran 77 preprocessor. Must be AC_DEFUN'd to be AC_REQUIRE'able.
])# AC_PROG_FC_C_O
+
## ------------------------------- ##
## 4. Compilers' characteristics. ##
## ------------------------------- ##
-# ---------------------------------------- #
-# 4d. Fortran 77 compiler characteristics. #
-# ---------------------------------------- #
-
-
# _AC_PROG_FC_V_OUTPUT([FLAG = $ac_cv_prog_{f77/fc}_v])
# -------------------------------------------------
# Link a trivial Fortran program, compiling with a verbose output FLAG
#
# 1. Language selection
# and routines to produce programs in a given language.
-# a. generic routines
-# b. C
-# c. C++
-# d. Fortran 77
#
# 2. Producing programs in a given language.
-# a. generic routines
-# b. C
-# c. C++
-# d. Fortran 77
#
# 3. Looking for a compiler
# And possibly the associated preprocessor.
-# a. Generic routines.
-# b. C
-# c. C++
-# d. Fortran 77
+#
+# 3a. Computing EXEEXT and OBJEXT.
#
# 4. Compilers' characteristics.
-# a. Generic routines.
-# b. C
-# c. C++
-# d. Fortran 77
## ----------------------- ##
-
-# -------------------------------- #
-# 1a. Generic language selection. #
-# -------------------------------- #
-
# AC_LANG_CASE(LANG1, IF-LANG1, LANG2, IF-LANG2, ..., DEFAULT)
# ------------------------------------------------------------
# Expand into IF-LANG1 if the current language is LANG1 etc. else
-## ---------------------- ##
-## 2.Producing programs. ##
-## ---------------------- ##
-
-
-# ---------------------- #
-# 2a. Generic routines. #
-# ---------------------- #
+## ----------------------- ##
+## 2. Producing programs. ##
+## ----------------------- ##
# AC_LANG_CONFTEST(BODY)
[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
+
## -------------------------------------------- ##
## 3. Looking for Compilers and Preprocessors. ##
## -------------------------------------------- ##
-# ----------------------------------------------------- #
-# 3a. Generic routines in compilers and preprocessors. #
-# ----------------------------------------------------- #
# AC_LANG_COMPILER
# ----------------
-# ----------------------------- #
-# Computing EXEEXT and OBJEXT. #
-# ----------------------------- #
+# --------------------------------- #
+# 3a. Computing EXEEXT and OBJEXT. #
+# --------------------------------- #
# Files to ignore
-
## ------------------------------- ##
## 4. Compilers' characteristics. ##
## ------------------------------- ##