How to generate .pc files with Autotools

Murilo Belluzzo murilo.belluzzo at gmail.com
Tue Aug 28 11:52:22 PDT 2007


Wow ... thank you very much!! Now it's working! My first baby !! hehehe...
thanks again!

On 8/28/07, Daniel Leidert <daniel.leidert.spam at gmx.net> wrote:
>
> Am Dienstag, den 28.08.2007, 14:16 -0300 schrieb Murilo Belluzzo:
>
> > I'm using the AutoTools to build a lib for the first time.  After many
> > days of study and work, I finally made my library compile and install
> > properly with "./configure and make".
> >
> > Now, I want to use pkg-config to make it easy for anyone to use my lib
> > with PKG_CHECK_MODULES(). But, I get stuck on it because I couldn't
> > find any tutorial or howto that teaches what I have to do to create
> > the right .pc files for my lib and install them in the right place
> > (even when ${prefix} is set to a path that is not the default).
>
> Many projects create a .pc.in file with the following content:
>
> /------------------ mylib.pc.in ------------------------
> prefix=@prefix@
> exec_prefix=@exec_prefix@
> libdir=@libdir@
> includedir=@includedir@
>
> Name: <my library>
> Description: <library to do something>
> URL: <homepage>
> Version: @VERSION@
> Requires: <dependencies>
> Libs: <link flags>
> Cflags: <compile flags>
> \-------------------------------------------------------
>
> (replace "<...>" with strings, that fit your library, "@VAR@" is
> replaced by configure)
>
> then add this file to the list of files in AC_CONFIG_FILES
> (configure.ac/configure.in), so its processed by configure. I would use
> configure.ac to make sure, exec and exec-prefix cannot be "NONE".
>
> > Can anyone tell me where I can find such information?
>
> Simply look into packages shipping .pc files.
>
> Regards, Daniel
>
> _______________________________________________
> pkg-config mailing list
> pkg-config at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/pkg-config
>



-- 
Murilo Pinoti Belluzzo
Engenharia de Computação - UNICAMP
Campinas, SP

"Talk is cheap. Show me the code." Linus Torvalds.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/pkg-config/attachments/20070828/e07d2f4f/attachment.html 


More information about the pkg-config mailing list