How to modify for add new lib into Makefile variable LIBS?

Xue Wei Wei.Xue at Sun.COM
Sun Sep 2 22:08:43 PDT 2007

hi, Dan,
Thank  you very much.

> On 8/30/07, Xue Wei <Wei.Xue at> wrote:
>>  I am trying to add some file into libX117.2, but when I compiled, I need
>> add some used library into Makefile, for example,  add -llayout to variable
>> LIBS which in Makefile. As you known, libX117.2 use auto configure tool to
>> generic Makefile, so I have to modify file .
>>  But unfortunately I am not a export about auto configure. Could anyone
>> please tell me how to modify to make variable LIBS in Makefile
>> be add new libs such lick -llayout?
> There are a lot of different ways to do this. If the liblayout library
> has an associated pkg-config file (/usr/lib/pkgconfig/layout.pc or
> something), then you'd do something like this
> theprogram_LIBADD = $(LAYOUT_LIBS)
> If you don't have a pkg-config file, then it's a little different.
> AC_CHECK_LIB(layout, some_function_in_liblayout)
> This will add -llayout to the LIBS variable if it's found, and then it
> will be linked into all programs and libraries. The drawback is that
> this doesn't handle the case where liblayout and its headers aren't in
> a standard location. It also doesn't say what to do if liblayout is or
> is not found.
> You should be able to find many examples in the Xorg sources.
> --
> Dan

More information about the xorg mailing list