automake
[Top][All Lists]
Advanced

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

Re: Generating 'cat' pages on make install


From: Benoit SIGOURE
Subject: Re: Generating 'cat' pages on make install
Date: Sun, 4 Nov 2007 20:43:06 +0100

On Nov 4, 2007, at 7:59 PM, Jason Curl wrote:

I've implemented the following:

-----8<---- Makefile.am ----
man_MANS =                                                      \
   libmofo.3                                                   \
   convertstring.3                                             \
   mofobuilddate.3 mofobuildhost.3 mofoversion.3 mofoendian.3  \
   smsread.3

html_DATA = $(man_MANS:.3=.html)

CLEANFILES = $(html_DATA)

EXTRA_DIST = $(man_MANS)

all-local: $(html_DATA)

# When we 'make' we create the .html files
SUFFIXES = .html

Automake can infer the suffixes automagically, you don't need to fiddle with SUFFIXES.

.3.html:
   @MAN2HTML@ $^ > $@
-----8<---- configure.ac ----
...
AC_PATH_PROG(MAN2HTML,man2html,man2html)
...
--------------------

I haven't figured out how to define the variable $(MAN2HTML) instead using automake substitution with @address@hidden Did I miss something?

It works for me, that's weird. Do you see the definition of MAN2HTML in `Makefile'?

By the way, I'd do this instead:

AC_PATH_PROG([MAN2HTML], [man2html])
test x"$MAN2HTML" = x && $as_unset MAN2HTML
AM_MISSING_PROG([MAN2HTML], [man2html])

So that if the user hasn't got man2html installed, they will get:

/bin/sh /tmp/ac/missing --run man2html myman.3 myman.html
/tmp/ac/missing: line 54: man2html: command not found
WARNING: `man2html' is needed, and is missing on your system.
         You might have modified some files without having the
proper tools for further handling them. Check the `README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing `man2html' program.
make: *** [myman.html] Error 1

The $as_unset thing is to remove the variable MAN2HTML, in which case AM_MISSING_PROG will enter into action.

How can I prevent the rule from running if the user doesn't have 'man2html' in their path? I don't think I can just use a "dummy" command like echo, as the /usr/bin/install command would return an error:

/usr/bin/install -c -m 644 '../../../../code/libmofo/man/ convertstring.html' '/home/jcurl/mofo/build/windows/release/share/ doc/libm
ofo/convertstring.html'
/usr/bin/install: cannot stat `../../../../code/libmofo/man/ convertstring.html': No such file or directory
make[3]: *** [install-htmlDATA] Error 1
make[3]: Leaving directory `/home/jcurl/mofo/build/windows/libmofo/ man'
make[2]: *** [install-am] Error 2
make[2]: Leaving directory `/home/jcurl/mofo/build/windows/libmofo/ man'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/jcurl/mofo/build/windows/libmofo'
make: *** [install-recursive] Error 1

Definitely not what I want...

Ah, then I see two ways out:
1. Consider that the HTML pages are BUILT_SOURCES. This will entail that they will be distributed (and you shouldn't list them in CLEANFILES) so that people who don't have man2html and who simply want to build your package without changing it can have the pre- generated HTML pages right away. 2. Use an Automake conditional to fill the html_DATA variable only if configure detected that man2html was available.

I prefer 1. better, since people *want* the documentation, without the hassle of installing all the dependencies to build it. If you go for 2., consider providing a separate package that contains the pre- built documentation.

Cheers,

--
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory


Attachment: PGP.sig
Description: This is a digitally signed message part


reply via email to

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