[PATCH:xman 2/2] configure: check for groff and enable groff extensions if found

Alan Coopersmith alan.coopersmith at oracle.com
Sun Apr 21 10:19:08 PDT 2013


On 04/20/13 11:28 AM, Gaetan Nadon wrote:
> On 13-04-20 01:08 PM, Alan Coopersmith wrote:
>> Check for groff never got translated from imake to autoconf
>>
>> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
>> ---
>>   configure.ac |    5 +++++
>>   defs.h       |    4 ++++
>>   2 files changed, 9 insertions(+)
>>
>> diff --git a/configure.ac b/configure.ac
>> index 74a6fc8..b9920bd 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -37,6 +37,11 @@ AC_CONFIG_HEADERS([config.h])
>>
>>   AC_CANONICAL_HOST
>>
>> +AC_CHECK_PROG([GROFF], [groff], [found], [missing])
>> +if test "x$GROFF" = "xfound" ; then
>> +   AC_DEFINE([HAS_GROFF], 1, [Define to 1 if you have the groff package.])
>> +fi
>> +
>>   AC_CHECK_FUNCS([mkstemp])
>>
>>   AC_ARG_WITH(helpdir,
>> diff --git a/defs.h b/defs.h
>> index b4cd434..fe09b6b 100644
>> --- a/defs.h
>> +++ b/defs.h
>> @@ -34,6 +34,10 @@ from the X Consortium.
>>    * Created:   October 22, 1987
>>    */
>>
>> +#ifdef HAVE_CONFIG_H
>> +# include "config.h"
>> +#endif
>> +
>>   #ifndef HELPFILE
>>   #define HELPFILE "/usr/lib/X11/xman.help"  /* name of the default helpfile. */
>>   #endif
> Alternatively, you can use XORG_WITH_GROFF macro and benefit from all
> the features. This was used in many docs before the move to DocBook. In
> any case you probably want to use HAVE_xx to follow the convention used
> by Automake elsewhere.

Thanks - I'd forgotten about that macro.   It's tempting to use it for the
--with-groff flag as Dan mentioned, though I wonder if people are expecting
that to only control generating documentation at build time, not making the
resulting code call groff.

For cross-compilers especially, this would be the difference between groff
in the build host vs. the target environment, so if we did have a flag, it
should probably distinguish between the two cases somehow.

-- 
	-Alan Coopersmith-              alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc


More information about the xorg-devel mailing list