<?xml version="1.0" ?>
<!-- $Id: simple.bkl,v 1.2 2004/04/30 21:55:10 vaclavslavik Exp $ -->

<!--

Adds the "pkgconfig" rule for installing a .pc file which should have been
generated through the configure script from a .pc.in file.
works with autoconf only.

-->

<makefile>

    <define-rule name="pkgconfig" pseudo="1">
        <template>
            <set var="__pc"/>
            <set var="__install_cmd" eval="0">
                <if cond="TOOLSET=='unix'">
                    $(INSTALL_DIR) $(LIBDIR)/pkgconfig
                    $(INSTALL_DATA) $(__pc) $(LIBDIR)/pkgconfig
                </if>
            </set>

            <!-- The overrideable default -->
            <src>$(id).pc</src>
        </template>

        <define-tag name="src">
            <set var="__pc">$(nativePaths(value))</set>
            <if cond="FORMAT=='autoconf'">
                <modify-target target="install">
                    <command>$(ref('__install_cmd',id))</command>
                </modify-target>

                <!-- Remove the .pc file generated by configure -->
                <modify-target target="distclean">
                    <command>$(RM) $(__pc)</command>
                </modify-target>
            </if>
        </define-tag>
    </define-rule>

    <tag-info name="src" exclusive="1"/>

</makefile>