Re: AC_OPENMP / AC_LANG_FUNC_LINK_TRY: unknown language: Fortran

View: New views
5 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: AC_OPENMP / AC_LANG_FUNC_LINK_TRY: unknown language: Fortran

by Ralf Wildenhues :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> * Bart Oldeman wrote on Wed, Oct 28, 2009 at 02:06:26PM CET:
> > autoconf refuses this reduced script:
> >
> > AC_INIT
> > AC_LANG(Fortran)
> > AC_OPENMP
> >
> > using
> > configure.ac:3: error: AC_LANG_FUNC_LINK_TRY: unknown language: Fortran
> > ../../lib/autoconf/lang.m4:228: AC_LANG_FUNC_LINK_TRY is expanded from...
> > ../../lib/autoconf/c.m4:1879: _AC_LANG_OPENMP is expanded from...

OK to push these two patches, and add Bart to THANKS?

The OpenMP tests can probably be made stricter for non-C; maybe adding a
mixed language test later would be good, too (putting on my todo list).

I'm not all that fond of _AC_CC in the second patch, as it is in a
central location rather than grouped with each language (makes
third-party additions harder), so maybe it should derive from
per-language defines instead?  Anyway, that patch is not so critical.

Thanks,
Ralf

    Fix AC_OPENMP for Fortran (F77 and FC).
   
    * lib/autoconf/fortran.m4 (AC_LANG_FUNC_LINK_TRY(Fortran): New.
    * tests/c.at (AC_C_RESTRICT and C++, AC_OPENMP and C)
    (AC_OPENMP and C++): New tests.
    * tests/fortran.at (AC_OPENMP and Fortran 77)
    (AC_OPENMP and Fortran): New tests.
    * THANKS: Update.
    Report by Bart Oldeman.

diff --git a/lib/autoconf/fortran.m4 b/lib/autoconf/fortran.m4
index 2548716..a7e5089 100644
--- a/lib/autoconf/fortran.m4
+++ b/lib/autoconf/fortran.m4
@@ -207,6 +207,11 @@ m4_define([AC_LANG_CALL(Fortran 77)],
 [      call $2])])
 
 
+# AC_LANG_FUNC_LINK_TRY(Fortran 77)(FUNCTION)
+# -------------------------------------------
+m4_define([AC_LANG_FUNC_LINK_TRY(Fortran 77)],
+[AC_LANG_PROGRAM([],
+[      call $1])])
 
 ## ------------------------ ##
 ## 1b. Language selection.  ##
diff --git a/tests/c.at b/tests/c.at
index 8235be2..78edf45 100644
--- a/tests/c.at
+++ b/tests/c.at
@@ -320,3 +320,100 @@ AT_CHECK([${MAKE-make} cpp-works || exit 77], [], [ignore], [ignore])
 AT_CHECK([${MAKE-make}], [], [ignore], [ignore])
 
 AT_CLEANUP
+
+
+## ---------------- ##
+## AC_OPENMP and C. ##
+## ---------------- ##
+
+AT_SETUP([AC_OPENMP and C])
+
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_PROG_CC
+AC_OPENMP
+if test "X$ac_cv_prog_c_openmp" = Xunsupported; then
+  AS_EXIT([77])
+fi
+CFLAGS="$CFLAGS $OPENMP_CFLAGS"
+CPPFLAGS="$CPPFLAGS $OPENMP_CFLAGS"
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+]])
+
+AT_DATA([Makefile.in],
+[[foo@EXEEXT@: foo.@OBJEXT@
+ @CC@ @CFLAGS@ @LDFLAGS@ -o $@ foo.@OBJEXT@
+
+foo.@OBJEXT@: foo.c
+ @CC@ @CPPFLAGS@ @CFLAGS@ -c foo.c
+]])
+
+AT_DATA([foo.c],
+[[#ifdef _OPENMP
+#include <omp.h>
+#endif
+#include <stdio.h>
+
+int main ()
+{
+#ifdef _OPENMP
+#pragma omp parallel
+  {
+    int id = omp_get_thread_num ();
+    printf ("hello omp world from %d\n", id);
+  }
+#endif
+  return 0;
+}
+]])
+
+: ${MAKE=make}
+AT_CHECK([autoreconf -vi], [], [ignore], [ignore])
+AT_CHECK([./configure $configure_options], [], [ignore], [ignore])
+AT_CHECK([$MAKE], [], [ignore], [ignore])
+
+AT_CLEANUP
+
+
+## ------------------ ##
+## AC_OPENMP anc C++. ##
+## ------------------ ##
+
+AT_SETUP([AC_OPENMP and C++])
+
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_PROG_CXX
+AC_LANG([C++])
+AC_OPENMP
+if test "X$ac_cv_prog_cxx_openmp" = Xunsupported; then
+  AS_EXIT([77])
+fi
+CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS"
+CPPFLAGS="$CPPFLAGS $OPENMP_CXXFLAGS"
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+]])
+
+AT_DATA([Makefile.in],
+[[foo@EXEEXT@: foo.@OBJEXT@
+ @CXX@ @CXXFLAGS@ @LDFLAGS@ -o $@ foo.@OBJEXT@
+
+foo.@OBJEXT@: foo.cpp
+ @CXX@ @CPPFLAGS@ @CXXFLAGS@ -c foo.cpp
+]])
+
+AT_DATA([foo.cpp],
+[[int main ()
+{
+  return 0;
+}
+]])
+
+: ${MAKE=make}
+AT_CHECK([autoreconf -vi], [], [ignore], [ignore])
+AT_CHECK([./configure $configure_options], [], [ignore], [ignore])
+AT_CHECK([$MAKE], [], [ignore], [ignore])
+
+AT_CLEANUP
diff --git a/tests/fortran.at b/tests/fortran.at
index ed58ee7..151b13f 100644
--- a/tests/fortran.at
+++ b/tests/fortran.at
@@ -73,3 +73,83 @@ if test "$ac_compiler_gnu" = yes; then
   esac
 fi
 ]])
+
+
+## ------------------------- ##
+## AC_OPENMP and Fortran 77. ##
+## ------------------------- ##
+
+AT_SETUP([AC_OPENMP and Fortran 77])
+
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_PROG_F77
+AC_LANG([Fortran 77])
+AC_OPENMP
+if test "X$ac_cv_prog_f77_openmp" = Xunsupported; then
+  AS_EXIT([77])
+fi
+FFLAGS="$FFLAGS $OPENMP_FFLAGS"
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+]])
+
+AT_DATA([Makefile.in],
+[[foo@EXEEXT@: foo.@OBJEXT@
+ @F77@ @FFLAGS@ @LDFLAGS@ -o $@ foo.@OBJEXT@
+
+foo.@OBJEXT@: foo.f
+ @F77@ @FFLAGS@ -c foo.f
+]])
+
+AT_DATA([foo.f],
+[[       program main
+      end
+]])
+
+: ${MAKE=make}
+AT_CHECK([autoreconf -vi], [], [ignore], [ignore])
+AT_CHECK([./configure $configure_options], [], [ignore], [ignore])
+AT_CHECK([$MAKE], [], [ignore], [ignore])
+
+AT_CLEANUP
+
+
+## ---------------------- ##
+## AC_OPENMP and Fortran. ##
+## ---------------------- ##
+
+AT_SETUP([AC_OPENMP and Fortran])
+
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_PROG_FC
+AC_LANG([Fortran])
+AC_OPENMP
+if test "X$ac_cv_prog_fc_openmp" = Xunsupported; then
+  AS_EXIT([77])
+fi
+FCFLAGS="$FCFLAGS $OPENMP_FCFLAGS"
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+]])
+
+AT_DATA([Makefile.in],
+[[foo@EXEEXT@: foo.@OBJEXT@
+ @FC@ @FCFLAGS@ @LDFLAGS@ -o $@ foo.@OBJEXT@
+
+foo.@OBJEXT@: foo.f
+ @FC@ @FCFLAGS@ -c foo.f
+]])
+
+AT_DATA([foo.f],
+[[      program main
+      end
+]])
+
+: ${MAKE=make}
+AT_CHECK([autoreconf -vi], [], [ignore], [ignore])
+AT_CHECK([./configure $configure_options], [], [ignore], [ignore])
+AT_CHECK([$MAKE], [], [ignore], [ignore])
+
+AT_CLEANUP




    Fix AC_OPENMP configure message for non-C compilers.
   
    * lib/autoconf/lang.m4 (_AC_CC): New macro.
    * lib/autoconf/c.m4 (AC_OPENMP): Use it instead of $CC.

diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4
index 8df6bf9..09d5f8e 100644
--- a/lib/autoconf/c.m4
+++ b/lib/autoconf/c.m4
@@ -1971,7 +1971,7 @@ AC_DEFUN([AC_OPENMP],
   AC_ARG_ENABLE([openmp],
     [AS_HELP_STRING([--disable-openmp], [do not use OpenMP])])
   if test "$enable_openmp" != no; then
-    AC_CACHE_CHECK([for $CC option to support OpenMP],
+    AC_CACHE_CHECK([for $]_AC_CC[ option to support OpenMP],
       [ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp],
       [AC_LINK_IFELSE([_AC_LANG_OPENMP],
  [ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp='none needed'],
diff --git a/lib/autoconf/lang.m4 b/lib/autoconf/lang.m4
index c05612b..5c746c5 100644
--- a/lib/autoconf/lang.m4
+++ b/lib/autoconf/lang.m4
@@ -290,6 +290,17 @@ AC_DEFUN([AC_LANG_INT_SAVE],
 ## -------------------------------------------- ##
 
 
+# _AC_CC
+# ------
+# The variable name of the compiler.
+m4_define([_AC_CC],
+[AC_LANG_CASE([C], [CC],
+      [C++], [CXX],
+      [Fortran 77], [F77],
+      [Fortran],    [FC],
+      [Erlang], [ERLC])])
+
+
 # AC_LANG_COMPILER
 # ----------------
 # Find a compiler for the current LANG.  Be sure to be run before



Re: AC_OPENMP / AC_LANG_FUNC_LINK_TRY: unknown language: Fortran

by Eric Blake :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Ralf Wildenhues on 10/30/2009 12:22 PM:
>
> OK to push these two patches, and add Bart to THANKS?

The first one - yes.  The second one - let's work on it a bit more...

> I'm not all that fond of _AC_CC in the second patch, as it is in a
> central location rather than grouped with each language (makes
> third-party additions harder), so maybe it should derive from
> per-language defines instead?  Anyway, that patch is not so critical.

Wouldn't it work to reuse an existing per-language macro, as in:
m4_toupper(_AC_LANG_ABBREV)

well, that gives $ERL instead of $ERLC.  So I guess we don't have anything.

That being the case, I would prefer to add another argument to
AC_LANG_DEFINE to populate _AC_CC(lang) in the same manner as
_AC_LANG_ABBREV(lang) is populated, rather than hardcoding the translation
in lang.m4.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkrrT3IACgkQ84KuGfSFAYAaqACff8O1/fS69nWCeHvNUDYyn0+v
QIcAn2PXf7DipPhIT5Eq9tKitWo6Vd+U
=tx+l
-----END PGP SIGNATURE-----



Re: AC_OPENMP / AC_LANG_FUNC_LINK_TRY: unknown language: Fortran

by Ralf Wildenhues :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

* Ralf Wildenhues wrote on Fri, Oct 30, 2009 at 07:22:48PM CET:
>     Fix AC_OPENMP for Fortran (F77 and FC).
>    
>     * lib/autoconf/fortran.m4 (AC_LANG_FUNC_LINK_TRY(Fortran): New.
>     * tests/c.at (AC_C_RESTRICT and C++, AC_OPENMP and C)
>     (AC_OPENMP and C++): New tests.
>     * tests/fortran.at (AC_OPENMP and Fortran 77)
>     (AC_OPENMP and Fortran): New tests.
>     * THANKS: Update.
>     Report by Bart Oldeman.

Pushing this obvious followup to fix the test on some systems.
Only OpenMP related failures I'm still seeing are with the plain
`AC_OPENMP' test: Solaris 2.6 cc may dump core at some point during
configure, and IRIX cc may create a directory rii_files, both of which
upset the leftover file checks.  I'm not sure when it is suitable to
remove rii_files, though.

Cheers,
Ralf

    Do not fail OpenMP tests on systems without aclocal.
   
    * tests/c.at (AC_OPENMP and C, AC_OPENMP and C++): Override
    `ACLOCAL=true' for autoreconf, the tests don't need aclocal.
    * tests/fortran.at (AC_OPENMP and Fortran 77)
    (AC_OPENMP and Fortran): Likewise.

diff --git a/tests/c.at b/tests/c.at
index 78edf45..34f83ae 100644
--- a/tests/c.at
+++ b/tests/c.at
@@ -369,7 +369,7 @@ int main ()
 ]])
 
 : ${MAKE=make}
-AT_CHECK([autoreconf -vi], [], [ignore], [ignore])
+AT_CHECK([env ACLOCAL=true autoreconf -vi], [], [ignore], [ignore])
 AT_CHECK([./configure $configure_options], [], [ignore], [ignore])
 AT_CHECK([$MAKE], [], [ignore], [ignore])
 
@@ -412,7 +412,7 @@ AT_DATA([foo.cpp],
 ]])
 
 : ${MAKE=make}
-AT_CHECK([autoreconf -vi], [], [ignore], [ignore])
+AT_CHECK([env ACLOCAL=true autoreconf -vi], [], [ignore], [ignore])
 AT_CHECK([./configure $configure_options], [], [ignore], [ignore])
 AT_CHECK([$MAKE], [], [ignore], [ignore])
 
diff --git a/tests/fortran.at b/tests/fortran.at
index 151b13f..d511e3d 100644
--- a/tests/fortran.at
+++ b/tests/fortran.at
@@ -108,7 +108,7 @@ AT_DATA([foo.f],
 ]])
 
 : ${MAKE=make}
-AT_CHECK([autoreconf -vi], [], [ignore], [ignore])
+AT_CHECK([env ACLOCAL=true autoreconf -vi], [], [ignore], [ignore])
 AT_CHECK([./configure $configure_options], [], [ignore], [ignore])
 AT_CHECK([$MAKE], [], [ignore], [ignore])
 
@@ -148,7 +148,7 @@ AT_DATA([foo.f],
 ]])
 
 : ${MAKE=make}
-AT_CHECK([autoreconf -vi], [], [ignore], [ignore])
+AT_CHECK([env ACLOCAL=true autoreconf -vi], [], [ignore], [ignore])
 AT_CHECK([./configure $configure_options], [], [ignore], [ignore])
 AT_CHECK([$MAKE], [], [ignore], [ignore])
 



Re: AC_OPENMP / AC_LANG_FUNC_LINK_TRY: unknown language: Fortran

by Ralf Wildenhues :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

* Eric Blake wrote on Fri, Oct 30, 2009 at 09:41:22PM CET:
> Wouldn't it work to reuse an existing per-language macro, as in:
> m4_toupper(_AC_LANG_ABBREV)
>
> well, that gives $ERL instead of $ERLC.  So I guess we don't have anything.
>
> That being the case, I would prefer to add another argument to
> AC_LANG_DEFINE to populate _AC_CC(lang) in the same manner as
> _AC_LANG_ABBREV(lang) is populated, rather than hardcoding the translation
> in lang.m4.

Yes, that sounds better; thanks.  IIUC then AC_LANG_DEFINE is not public
yet and not used outside Autoconf, so we can reorder arguments.  OK to
apply?

Thanks,
Ralf

    Fix AC_OPENMP configure message for non-C compilers.
   
    * lib/autoconf/lang.m4 (AC_LANG_DEFINE): Accept as additional
    fourth arg the compiler variable name, defined in _AC_CC($1).
    (_AC_CC): New language dispatch macro.
    * lib/autoconf/erlang.m4 (AC_LANG(Erlang)): Adjust.
    * lib/autoconf/fortran.m4 (AC_LANG(Fortran 77), AC_LANG(Fortran)):
    Likewise.
    * lib/autoconf/c.m4 (AC_LANG(C), AC_LANG(C++))
    (AC_LANG(Objective C), AC_LANG(Objective C++)): Likewise.
    (AC_OPENMP): Use _AC_CC instead of $CC.

diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4
index 3b7cf36..420c8b6 100644
--- a/lib/autoconf/c.m4
+++ b/lib/autoconf/c.m4
@@ -59,7 +59,7 @@
 # AC_LANG(C)
 # ----------
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-AC_LANG_DEFINE([C], [c], [C], [],
+AC_LANG_DEFINE([C], [c], [C], [CC], [],
 [ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
@@ -238,7 +238,7 @@ static unsigned long int ulongval () { return $2; }
 # AC_LANG(C++)
 # ------------
 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-AC_LANG_DEFINE([C++], [cxx], [CXX], [C],
+AC_LANG_DEFINE([C++], [cxx], [CXX], [CXX], [C],
 [ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
@@ -260,7 +260,7 @@ AU_DEFUN([AC_LANG_CPLUSPLUS], [AC_LANG(C++)])
 
 # AC_LANG(Objective C)
 # --------------------
-AC_LANG_DEFINE([Objective C], [objc], [OBJC], [C],
+AC_LANG_DEFINE([Objective C], [objc], [OBJC], [OBJC], [C],
 [ac_ext=m
 ac_cpp='$OBJCPP $CPPFLAGS'
 ac_compile='$OBJC -c $OBJCFLAGS $CPPFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
@@ -282,7 +282,7 @@ AU_DEFUN([AC_LANG_OBJC], [AC_LANG(Objective C)])
 
 # AC_LANG(Objective C++)
 # ----------------------
-AC_LANG_DEFINE([Objective C++], [objcxx], [OBJCXX], [C++],
+AC_LANG_DEFINE([Objective C++], [objcxx], [OBJCXX], [OBJCXX], [C++],
 [ac_ext=mm
 ac_cpp='$OBJCXXCPP $CPPFLAGS'
 ac_compile='$OBJCXX -c $OBJCXXFLAGS $CPPFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
@@ -1973,7 +1973,7 @@ AC_DEFUN([AC_OPENMP],
   AC_ARG_ENABLE([openmp],
     [AS_HELP_STRING([--disable-openmp], [do not use OpenMP])])
   if test "$enable_openmp" != no; then
-    AC_CACHE_CHECK([for $CC option to support OpenMP],
+    AC_CACHE_CHECK([for $[]_AC_CC[] option to support OpenMP],
       [ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp],
       [AC_LINK_IFELSE([_AC_LANG_OPENMP],
  [ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp='none needed'],
diff --git a/lib/autoconf/erlang.m4 b/lib/autoconf/erlang.m4
index d87510a..748fca8 100644
--- a/lib/autoconf/erlang.m4
+++ b/lib/autoconf/erlang.m4
@@ -99,7 +99,7 @@ fi
 
 # AC_LANG(Erlang)
 # ---------------
-AC_LANG_DEFINE([Erlang], [erl], [ERL], [],
+AC_LANG_DEFINE([Erlang], [erl], [ERL], [ERLC], [],
 [ac_ext=erl
 ac_compile='$ERLC $ERLCFLAGS -b beam conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
 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'
diff --git a/lib/autoconf/fortran.m4 b/lib/autoconf/fortran.m4
index 6cbcfa2..f5918d0 100644
--- a/lib/autoconf/fortran.m4
+++ b/lib/autoconf/fortran.m4
@@ -140,7 +140,7 @@ fi[]dnl
 
 # AC_LANG(Fortran 77)
 # -------------------
-AC_LANG_DEFINE([Fortran 77], [f77], [F], [],
+AC_LANG_DEFINE([Fortran 77], [f77], [F], [F77], [],
 [ac_ext=f
 ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
 ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD'
@@ -220,7 +220,7 @@ m4_define([AC_LANG_FUNC_LINK_TRY(Fortran 77)],
 
 # AC_LANG(Fortran)
 # ----------------
-AC_LANG_DEFINE([Fortran], [fc], [FC], [Fortran 77],
+AC_LANG_DEFINE([Fortran], [fc], [FC], [FC], [Fortran 77],
 [ac_ext=${ac_fc_srcext-f}
 ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
 ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD'
diff --git a/lib/autoconf/lang.m4 b/lib/autoconf/lang.m4
index 5b44c68..1beda24 100644
--- a/lib/autoconf/lang.m4
+++ b/lib/autoconf/lang.m4
@@ -160,27 +160,28 @@ m4_defun([AC_LANG_ASSERT],
 
 
 
-# AC_LANG_DEFINE(NAME, ABBREV, PREFIX, COPY-FROM, SHELL-VARS)
-# -----------------------------------------------------------
+# AC_LANG_DEFINE(NAME, ABBREV, PREFIX, COMPILER-VAR, COPY-FROM, SHELL-VARS)
+# -------------------------------------------------------------------------
 # Define a language referenced by AC_LANG(NAME), with cache variable prefix
-# ABBREV and Makefile variable prefix PREFIX.  AC_LANG(NAME) is defined
-# to SHELL-VARS, other macros are copied from language COPY-FROM.  Even if
-# COPY-FROM is empty, a default definition is provided for language-specific
-# macros AC_LANG_SOURCE(NAME) and AC_LANG_CONFTEST(NAME).
+# ABBREV, Makefile variable prefix PREFIX and compiler variable COMPILER-VAR.
+# AC_LANG(NAME) is defined to SHELL-VARS, other macros are copied from language
+# COPY-FROM.  Even if COPY-FROM is empty, a default definition is provided for
+# language-specific macros AC_LANG_SOURCE(NAME) and AC_LANG_CONFTEST(NAME).
 m4_define([AC_LANG_DEFINE],
-[m4_define([AC_LANG($1)], [$5])]
+[m4_define([AC_LANG($1)], [$6])]
 [m4_define([_AC_LANG_ABBREV($1)], [$2])]
 [m4_define([_AC_LANG_PREFIX($1)], [$3])]
-[m4_copy([AC_LANG_CONFTEST($4)], [AC_LANG_CONFTEST($1)])]
-[m4_copy([AC_LANG_SOURCE($4)], [AC_LANG_SOURCE($1)])]
-[m4_copy([_AC_LANG_NULL_PROGRAM($4)], [_AC_LANG_NULL_PROGRAM($1)])]
-[m4_ifval([$4],
-[m4_copy([AC_LANG_PROGRAM($4)], [AC_LANG_PROGRAM($1)])]
-[m4_copy([AC_LANG_CALL($4)], [AC_LANG_CALL($1)])]
-[m4_copy([AC_LANG_FUNC_LINK_TRY($4)], [AC_LANG_FUNC_LINK_TRY($1)])]
-[m4_copy([AC_LANG_BOOL_COMPILE_TRY($4)], [AC_LANG_BOOL_COMPILE_TRY($1)])]
-[m4_copy([AC_LANG_INT_SAVE($4)], [AC_LANG_INT_SAVE($1)])]
-[m4_copy([_AC_LANG_IO_PROGRAM($4)], [_AC_LANG_IO_PROGRAM($1)])])])
+[m4_define([_AC_CC($1)], [$4])]
+[m4_copy([AC_LANG_CONFTEST($5)], [AC_LANG_CONFTEST($1)])]
+[m4_copy([AC_LANG_SOURCE($5)], [AC_LANG_SOURCE($1)])]
+[m4_copy([_AC_LANG_NULL_PROGRAM($5)], [_AC_LANG_NULL_PROGRAM($1)])]
+[m4_ifval([$5],
+[m4_copy([AC_LANG_PROGRAM($5)], [AC_LANG_PROGRAM($1)])]
+[m4_copy([AC_LANG_CALL($5)], [AC_LANG_CALL($1)])]
+[m4_copy([AC_LANG_FUNC_LINK_TRY($5)], [AC_LANG_FUNC_LINK_TRY($1)])]
+[m4_copy([AC_LANG_BOOL_COMPILE_TRY($5)], [AC_LANG_BOOL_COMPILE_TRY($1)])]
+[m4_copy([AC_LANG_INT_SAVE($5)], [AC_LANG_INT_SAVE($1)])]
+[m4_copy([_AC_LANG_IO_PROGRAM($5)], [_AC_LANG_IO_PROGRAM($1)])])])
 
 ## ----------------------- ##
 ## 2. Producing programs.  ##
@@ -284,6 +285,12 @@ AC_DEFUN([AC_LANG_INT_SAVE],
 [_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
 
 
+# _AC_CC
+# ------
+# The variable name of the compiler.
+m4_define([_AC_CC],
+[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
+
 
 ## -------------------------------------------- ##
 ## 3. Looking for Compilers and Preprocessors.  ##



Re: AC_OPENMP / AC_LANG_FUNC_LINK_TRY: unknown language: Fortran

by Eric Blake :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Ralf Wildenhues on 10/31/2009 2:21 AM:
>> That being the case, I would prefer to add another argument to
>> AC_LANG_DEFINE to populate _AC_CC(lang) in the same manner as
>> _AC_LANG_ABBREV(lang) is populated, rather than hardcoding the translation
>> in lang.m4.
>
> Yes, that sounds better; thanks.  IIUC then AC_LANG_DEFINE is not public
> yet and not used outside Autoconf, so we can reorder arguments.  OK to
> apply?

Yes, that looks better; go ahead and push.  And I agree that
AC_LANG_DEFINE is an internal helper (maybe we should have named it
_AC_LANG_DEFINE, oh well).

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkrsNYYACgkQ84KuGfSFAYAvvwCfd6CM4w4xJrv2CLJUGdoPG4je
A4oAn0uTnTF0ohF9bUnv8GqBBrF5XKaz
=vUKY
-----END PGP SIGNATURE-----