autoconf
[Top][All Lists]
Advanced

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

Re: generating pc files


From: Vincent Torri
Subject: Re: generating pc files
Date: Wed, 19 Sep 2012 09:53:38 +0200

On Wed, Sep 19, 2012 at 9:46 AM, Russ Allbery <address@hidden> wrote:
> Vincent Torri <address@hidden> writes:
>
>> But it seems that several projects use sed in their Makefile.am to use
>> the value of $libdir, $includedir, etc.. to generate their pc files. So
>> they have in foo.pc
>
>> libdir=${libdir}
>
>> So I would like to know the opinion of the autoconf dev about what the
>> correct way to generate pc file is.
>
> Well, I'm not an Autoconf developer, so feel free to ignore this, but I've
> been very happy with the following recipe.  A *.pc.in file that looks
> like:
>
>     address@hidden@
>     address@hidden@
>     address@hidden@
>     address@hidden@
>
>     Name: <name>
>     Description: <description>
>     URL: <url>
>     Version: @PACKAGE_VERSION@
>     Cflags: -I${includedir}
>     Libs: -L${libdir} -l<library>
>     Libs.private: <other-libs>
>
> with the <...> bits replaced with whatever is appropriate for your
> library, and then the following in Makefile.am (adjusting file paths
> accordingly, of course:
>
> client/libremctl.pc: $(srcdir)/client/libremctl.pc.in
>         sed -e 'address@hidden@]!$(prefix)!g'                     \
>             -e 'address@hidden@]!$(exec_prefix)!g'           \
>             -e 'address@hidden@]!$(includedir)!g'             \
>             -e 'address@hidden@]!$(libdir)!g'                     \
>             -e 'address@hidden@]!$(PACKAGE_VERSION)!g'   \
>             -e 'address@hidden@]!$(GSSAPI_LDFLAGS)!g'     \
>             -e 'address@hidden@]!$(GSSAPI_LIBS)!g'           \
>             $(srcdir)/client/libremctl.pc.in > $@

I know that way. I mentioned it (" But it seems that several projects
use sed in their Makefile.am etc..." See above)

My question is : which solution is the correct one, as they obviously
don't give the same result ?

Vincent Torri



reply via email to

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