groff
[Top][All Lists]
Advanced

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

Re: [Groff] CVS Broken [by Autoconf] for Win32


From: Keith Marshall
Subject: Re: [Groff] CVS Broken [by Autoconf] for Win32
Date: Mon, 2 May 2005 18:35:09 +0100

On Sunday 01 May 2005 10:55 pm, Jeff Conrad wrote:
> > You could possibly extend this, to override the default initialisation
> > for `ac_ext', and to supply your preferred `CC', `CFLAGS' and `CXXFLAGS'
> > initialisations.
>
> This indeed is a useful suggestion; alas, it seems to work for everything
> but ac_ext ...
>
> I'll check the manual for more information, but ac_ext looks as if it's
> hard coded by autoconf.

Unfortunately, it is.  On reflection, that makes sense, since the value of 
`ac_ext' needs to change when the working language changes.  Thus, looking in 
the autoconf CVS, in lib/autoconf/c.m4, I see `ac_ext=c' in the `AC_LANG(C)' 
macro, and `ac_ext=cc' in `AC_LANG(C++)'.

> Some time ago, we changed the C++ source files from *.cc to *.cpp with the
> understanding that any C++ compiler would accept them.  If so, would it not
> make sense to have autoconf do the same?

IIRC, this was in groff-1.19.  Obviously, it would be good if autoconf did 
likewise, but that is an issue for the autoconf project, rather than groff.  
It would be trivial for them to change that `ac_ext=cc' to `ac_ext=cpp', for 
example:

Index: lib/autoconf/c.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/c.m4,v
retrieving revision 1.198
diff -u -r1.198 c.m4
--- lib/autoconf/c.m4   25 Feb 2005 08:52:48 -0000      1.198
+++ lib/autoconf/c.m4   2 May 2005 17:17:19 -0000
@@ -90,7 +90,7 @@
 # ------------
 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 m4_define([AC_LANG(C++)],
-[ac_ext=cc
+[ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS 
conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD'

or possibly even better:

Index: lib/autoconf/c.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/c.m4,v
retrieving revision 1.198
diff -u -r1.198 c.m4
--- lib/autoconf/c.m4   25 Feb 2005 08:52:48 -0000      1.198
+++ lib/autoconf/c.m4   2 May 2005 17:23:53 -0000
@@ -90,7 +90,7 @@
 # ------------
 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 m4_define([AC_LANG(C++)],
-[ac_ext=cc
+[ac_ext=$[]{ac_ext_cc=cpp}
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS 
conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD'

which would then allow an entry such as `ac_ext_cc=cc' in `config.site' to 
override the default used by `AC_LANG(C++)'.

Clearly, this is an issue for discussion on the autoconf list (to which I 
have copied this).  Similar issues could arise for other languages, e.g. 
should the default source file extension for FORTRAN be `f', as used by GCC, 
or `FOR', as used by Microsoft, (and many other compiler vendors).

Werner has said that he will post an autoconf bug report.  Hopefully, between 
us we will elicit some positive response.

Best regards,
Keith.




reply via email to

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