automake
[Top][All Lists]
Advanced

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

Re: using automake for perl program


From: Stepan Kasal
Subject: Re: using automake for perl program
Date: Thu, 30 Mar 2006 18:04:53 +0200
User-agent: Mutt/1.4.1i

Hello,

On Thu, Mar 30, 2006 at 12:11:23AM +0200, Guillaume Rousse wrote:
> 1) module destination directory is determined by perl itself. I use
> moduledir=`perl '-V:installsitelib' | cut -d"'" -f2` to compute it, but
> it make perl distcheck fails:
...
> I guess it is because moduledir doesn't relate to $prefix...

GNU Standards require that ``make install'' doesn't write outside of
${prefix}.
I think you should compute moduledir in ./configure and AC_SUBST it.
Then it'll get propagated to Makefile.  And you can replace /usr/...
by $prefix/... in ./configure.  If the perl configuration points
outside of $prefix, you could issue an error, or at least a warning.

Remember to do
        case $prefix in NONE) prefix=$ac_default_prefix;; done

to get the actual value before you compare it with the value from perl
configuration.

> 2) each perl module corresponds to a man page, produced by pod2man.
> However, I can't compute man page list from module list.
> 
> I tried several variations around
> MODULES = foo/bar foo/baz
> nobase_dist_module_DATA =  $(addprefix lib/,$(addsuffix .pm,$(MODULES)))
> man3_MANS = $(subst /,::,$(addsuffix .3pm,$(MODULES)))

Please note that you are using GNU-make extensions here, and Automake
is not able to understand them.

You could try to compute two of the three values in configure, and
substitute them here by:

nobase_dist_module_DATA = $(list_of_pm_files)
man3_MANS = $(list_of_manpages)

but I'm afraid you might get into problems if Automake doesn't see the
real values of these special variables.  You can try it.

> 3) I couldn't neither achieve a suffix-based rule for building a single
> man page. Is this allowed ?
> %.3pm: lib/$(subst /,::,%).pm
>       pod2man $< > $@

Again, you are trying GNU-make specific features.  Moreover, the above rule
is equivalent to:

%.3pm: lib/%.pm
        pod2man $< > $@

because the $(subst ) is performed when the rule is parsed.

Perhaps you could use this portable rule

.pm.3pm:
        pod2man $< > $@

and rename the manpages later.

> Facing to all those problems, I'm more and more considering delegating
> modules management to MakeMaker, invocated from a top-level
> automake-generated makefile. Does it seems raisonable ?

It seems so; I don't have enough experience to judge, others on the list
might know more.

Have a nice day,
        Stepan Kasal




reply via email to

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