>>>>> Ruslan Shevchenko writes:
> # RSSH_CHECK_SUNPROC_C([ACTION-IF-YES], [ACTION-IF-NOT])
I have added the macro to the autoconf archive a few moments ago;
thanks for the submission. I reformatted it quite a bit to make it
comply with the archive requirements, so you might want to get the
source from
http://research.cys.de/autoconf-archive/Installed_Packages/rssh_check_sunpro_c.html
and take a look at my changes. They're trivial, really.
As for the "dnl" versus "#" comment delimiter question: I stuck to
"dnl" for the moment, for the very simple reason that this is what my
converter expects and I didn't want to modify the program, before
discussing the issue on the mailing list.
I generally favour "dnl" over "#", because "#" is not a comment
delimiter in m4. It is in shell scripts, which are ultimately
generated by autoconf, but a significant part of the m4 macros is
_not_ converted into a shell script and using "#" for introducing
comments there may yield unexpected behavior. Just look at the macro
submitted by Ruslan, formatted with "#" comments:
1 # @synopsis RSSH_CHECK_SUNPRO_C([ACTION-IF-YES],[ACTION-IF-NOT])
2 #
3 # Check whether we are using SUN workshop C compiler.
4 # The corresponding cache values is rssh_cv_check_sunpro_c, which is
5 # set to "yes" or "no" respectively.
6 #
7 # @author Ruslan Shevchenko <[EMAIL PROTECTED]>
8 # @version $Id$
9 #
10 AC_DEFUN([RSSH_CHECK_SUNPRO_C],
11 [AC_CACHE_CHECK([whether using Sun Worckshop C compiler],
12 [rssh_cv_check_sunpro_c],
13 [AC_LANG_SAVE
14 AC_LANG_C
15 AC_TRY_COMPILE([],
16 [#ifndef __SUNPRO_C
17 # include "error: this is not Sun Workshop."
18 #endif
19 ],
20 rssh_cv_check_sunpro_c=yes,
21 rssh_cv_check_sunpro_c=no)
22 AC_LANG_RESTORE])
23 if test ${rssh_cv_check_sunpro_c} = yes
24 then
25 $2
26 else
27 $3
28 fi
29 ])# RSSH_CHECK_SUNPRO_C
Lines 1 to 9 are fine. But then we have lines 16, 17 and 18, where the
"#" is used in the context of a C program and does _not_ introduce
comments. In line 29 it is a comment again, but who knows how the
shell will treat the line that is generated by this construct -- some
shells may require a blank before the "#", some will not.
Hence I vote against endorsing "#" delimiters; I think that so far
autoconf users had no problems grasping the concept of "dnl". Every
programmer who knows more than one language is used to every language
using something different anyway. :-)
What do you guys think? I would be willing to support both ways in the
archive, but my preferred choice is "dnl".
-peter