[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to install library in a specific directory?
From: |
A117 |
Subject: |
Re: how to install library in a specific directory? |
Date: |
Thu, 23 Jul 2009 11:15:12 +0800 |
Thank you. I've decided to put the library in /usr/local/lib, while its header
files in /usr/local/include/ezproject.
It's strange though /usr/local/lib is in /etc/ld.so.conf (actually in another
file it includes), and I can build other programs acting much as mine, I have
difficulty with mine only. I run ldconfig manually and then it works. Now I'm
releasing my software.
yours sincerely
----- -----
On 7/22/2009 2:12 AM, bonami wrote:
> I have two projects. One generates a shared library and the other uses it.
> The library is to be installed in /usr/local/lib/ezproject, while the
> project's name is ezcommon. I have problems in both the projects.
> ezcommon's configure.ac,
> …
> AC_INIT(ezcommon, 3.0)
> AC_DISABLE_STATIC
> …
> ezcommon's Makefile.am,
> lib_LTLIBRARIES = libezcommon.la
> libdir = $(exec_prefix)/lib/ezproject
> includedir = $(prefix)/include/ezproject
> Problem is, if user configure --libdir=..., the user's definition will be
> ignored. How can I set libdir only when user does not assign it? (Since this
> dir name is not same as project name, I cannot use pkglib_.)
>
mylibdir = $(libdir)/ezproject
mylib_LTLIBRARIES=libezcommon.la
myincludedir = $(includedir)/ezproject
myinclude_HEADERS = ...
> The other question is how to check for this library in the other project,
> named ezcmd.
> ezcmd's configure.ac,
> ...
> AC_CHECK_LIB([ezcommon], main,,AC_MSG_ERROR(...))
> ...
> This check will fail, since ezcommon is installed in /usr/local/lib/
> ezproject by default. Should I add LDFLAGS=-Lezproject or sth.? And how? Or
> should I add this directory to system's link-search directory?
>
If you put your libraries in a non-standard location, then you'll have
to add that location to the library search path in one way or another.
Either of the options you mention will work. One other option is to
generate and install a pkgconfig description file, then use pkgconfig to
locate the library.
Regards,
John
- how to install library in a specific directory?, bonami, 2009/07/22
- Re: how to install library in a specific directory?, John Calcote, 2009/07/22
- Re: how to install library in a specific directory?,
A117 <=
- Re: how to install library in a specific directory?, John Calcote, 2009/07/23
- Re: how to install library in a specific directory?, A117, 2009/07/23
- Re: how to install library in a specific directory?, John Calcote, 2009/07/23
- 答复: how to install library in a spec ific directory?, A117, 2009/07/23
- Re: 答复: how to install library in a s pecific directory?, John Calcote, 2009/07/24
- Re:Re: how to install library in a specific directory?, A117, 2009/07/24
- Re: how to install library in a specific directory?, John Calcote, 2009/07/24
- 答复: how to install library in a spec ific directory?, A117, 2009/07/24
- Re: 答复: how to install library in a s pecific directory?, John Calcote, 2009/07/24
- 答复: 答复: how to install library in a specific directory?, A117, 2009/07/24