[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: generating pc files
From: |
Bastien ROUCARIES |
Subject: |
Re: generating pc files |
Date: |
Wed, 19 Sep 2012 11:23:18 +0200 |
On Wed, Sep 19, 2012 at 10:01 AM, Peter Johansson <address@hidden> wrote:
> On 09/19/2012 05:53 PM, Vincent Torri wrote:
>>
>> 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 ?
>>
>>
> The major difference compared with using AC_CONFIG_FILES is that the sed
> version allows user to set e.g. prefix at make time.
>
> ./configure
> make prefix=/opt
>
> will work for Russ's method while it won't work using a simpler
> AC_CONFIG_FILES approach. Not sure how important that behavior is for you.
> But I if you care about GCS, I think the behavior is mandated there.
>
> Cheers,
> Peter
See autoconf-archive mavcros
http://www.gnu.org/software/autoconf-archive/ax_create_pkgconfig_info.html#ax_create_pkgconfig_info
>
> _______________________________________________
> Autoconf mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/autoconf