<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.26.0">
</HEAD>
<BODY>
On Sun, 2010-06-20 at 11:30 -0700, Dan Nicholson wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
On Sat, Jun 19, 2010 at 2:13 PM, Gaetan Nadon <<A HREF="mailto:memsize@videotron.ca">memsize@videotron.ca</A>> wrote:
> On Sat, 2010-06-19 at 08:50 -0700, Dan Nicholson wrote:
>
> On Fri, Jun 18, 2010 at 6:57 PM, Gaetan Nadon <<A HREF="mailto:memsize@videotron.ca">memsize@videotron.ca</A>> wrote:
>> Groff uses grohtml to generate html output format. This program, in turn,
>> uses a number of pnm* commands from the netpbm package, psselect
>> from the psutils package and the ghostscript package.
>>
>> These are independently installed, so they could be missing.
>> A check is made to ensure those dependencies are installed.
>> If not, the makefile can use the conditional to supress the target.
>>
>> Signed-off-by: Gaetan Nadon <<A HREF="mailto:memsize@videotron.ca">memsize@videotron.ca</A>>
>> ---
>> xorg-macros.m4.in | 18 ++++++++++++++++++
>> 1 files changed, 18 insertions(+), 0 deletions(-)
>>
>> diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in
>> index a8e12ed..a10f80b 100644
>> --- a/xorg-macros.m4.in
>> +++ b/xorg-macros.m4.in
>> @@ -552,6 +552,12 @@ AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen"
>> = yes])
>> # --with-groff: 'yes' user instructs the module to use groff
>> # 'no' user instructs the module not to use groff
>> #
>> +# Added in version 1.9.0:
>> +# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
>> +# pnmcut pnmcrop pnmtopng pnmtops from the netpbm
>> package.
>> +# psselect from the psutils package.
>> +# the ghostcript package.
>> +#
>> # If the user sets the value of GROFF, AC_PATH_PROG skips testing the
>> path.
>> #
>> # OS and distros often splits groff in a basic and full package, the
>> former
>> @@ -591,6 +597,7 @@ elif test "x$use_groff" = x"no" ; then
>> else
>> AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
>> fi
>> +
>> # We have groff, test for the presence of the macro packages
>> if test "x$have_groff" = x"yes"; then
>> AC_MSG_CHECKING([for ${GROFF} -ms macros])
>> @@ -608,9 +615,20 @@ if test "x$have_groff" = x"yes"; then
>> fi
>> AC_MSG_RESULT([$groff_mm_works])
>> fi
>> +
>> +# We have groff, test for HTML dependencies
>> +if test "x$have_groff" = x"yes"; then
>> + AC_PATH_PROGS(GS_PATH, [gs gswin32c])
>> + AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
>> + AC_PATH_PROG(PSSELECT_PATH, [psselect])
>> +fi
>
> Thanks for looking into this, but I don't think I agree with this
> approach.
>
> That's ok. I vaguely remember drawing a line there when writing the original
> macro.
> I am somewhat spoiled by my distro where all the stuff I need is already
> installed.
> When I dig more I find that groff depends on netbpm, psutils and
> ghostscript.
> These are separately installed packages.
>
> The patch I did amounts to checking the integrity of the platform installed
> software.
> Not something we should be doing, as users of groff. On the other we try to
> be helpful
> to our users when things go wrong.
>
> Had you been the author of the patch, I might have made the same objection.
> Infinite loop :-)
Right. I don't really want to be in the business of checking that the
distro has setup their package correctly. (I just checked fedora that
I'm on and they don't make groff depend on netpbm). Also, it requires
that we track how grohtml works internally.
> I don't think we want to be checking the internal details of
> grohtml. It would probably be preferred to just try to generate html
> from a simple source file and see if it produced useful results.
>
> Are you suggesting using another tool?
No, just testing the tools capabilities like libtool does to $CC. I'm
not checking the details (especially about the troff, which I know
nothing about), but here's what I basically had in mind.
AC_MSG_CHECKING([for working grohtml])
cat > conftest.ms << "EOF"
... some extremely minimal troff stub ...
EOF
if AC_RUN_LOG([$GROFF -T html conftest.ms]); then
have_grohtml=yes
else
have_grohtml=no
fi
# clean up output (not sure about the names)
rm -f conftest.html conftest*.png
AM_CONDITIONAL([HAVE_GROFF_HTML], [test $have_grohtml = yes])
</PRE>
</BLOCKQUOTE>
<BR>
Ah, ok. Totally missed. Same principle used to check for mm and ms macros. Yes, better.
<BLOCKQUOTE TYPE=CITE>
<PRE>
> However, if we do want to just check the program, I'd suggest
> borrowing heavily from groff's internal GROFF_HTML_PROGRAMS macro.
> See:
>
> Exactly what I did. I simplified for our situation. I picked one command
> per package rather than checking all of them.
>
> <A HREF="http://cvs.savannah.gnu.org/viewvc/groff/m4/groff.m4?root=groff&view=markup">http://cvs.savannah.gnu.org/viewvc/groff/m4/groff.m4?root=groff&view=markup</A>
Awesome.
--
Dan
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>