Re:Re: how to install library in a specific directory?

2009-07-24 Thread A117
lib_LTLIBRARIES = libezcommon.la
myincludedir = $(includedir)/ezproject
myinclude_HEADERS= ezcommon.h tinystr.h tinyxml.h
libezcommon_la_SOURCES = ezcommon.cpp \
tinystr.cpp tinyxml.cpp tinyxmlerror.cpp tinyxmlparser.cpp
#libezcommon_la_LIBADD = tinystr.o tinyxml.o tinyxmlerror.o tinyxmlparser.o
libezcommon_la_LDFLAGS = -version-info 2:0:0
#EXTRA_DIST = tinystr.cpp tinyxml.cpp tinyxmlerror.cpp tinyxmlparser.cpp \
EXTRA_DIST = ezcommon.rc dllmain.cpp ezcommon.aps ezcommon.vcproj icon.ico \
tinyxml.txt resource.h stdafx.h targetver.h

- -

On 7/23/2009 7:45 PM, A117 wrote:
 Sorry I forgot to mention the files in EXTRA_DIST are to be packed into 
 release package. All the cpp files mentioned here already exists and are to 
 be compiled and released.
 If I put all cpp files in _SOURCES, the EXTRA_DIST files are not released. 
 The only way I've found is to put only one cpp file in _SOURCES, while others 
 to EXTRA_DIST and add .o to _LIBADD. My goal is to build all the .cpp and put 
 all .cpp, .txt, .rc into release package.


Okay, I understand the problem now. But there's not enough information 
in the snippet you posted to determine the cause. Can you post the 
entire Makefile.am file? Or at least a smaller example that reproduces 
the problem. There's nothing that I can see in the portion of your file 
that you posted that would be the cause of such a problem.

John

 -
 And can I ask another question? I want to build some source code files into 
 this library and need to distribute some other files, too. But EXTRA_DIST in 
 Makefile.am does not work as below,
 lib_LTLIBRARIES = libezcommon.la
 ...
 libezcommon_la_SOURCES = ezcommon.cpp tinystr.cpp ...
 EXTRA_DIST = tinyxml.txt ezcommon.rc ...

 If I write only one file in libezcommon_la_SOURCES, while adding others to 
 EXTRA_DIST and others' .o to libezcommon_la_LIBADD, it works. I don't know 
 why.








Re: how to install library in a specific directory?

2009-07-24 Thread John Calcote

On 7/24/2009 12:21 AM, A117 wrote:

lib_LTLIBRARIES = libezcommon.la
myincludedir = $(includedir)/ezproject
myinclude_HEADERS= ezcommon.h tinystr.h tinyxml.h
libezcommon_la_SOURCES = ezcommon.cpp \
tinystr.cpp tinyxml.cpp tinyxmlerror.cpp tinyxmlparser.cpp
#libezcommon_la_LIBADD = tinystr.o tinyxml.o tinyxmlerror.o tinyxmlparser.o
libezcommon_la_LDFLAGS = -version-info 2:0:0
#EXTRA_DIST = tinystr.cpp tinyxml.cpp tinyxmlerror.cpp tinyxmlparser.cpp \
EXTRA_DIST = ezcommon.rc dllmain.cpp ezcommon.aps ezcommon.vcproj icon.ico \
tinyxml.txt resource.h stdafx.h targetver.h
   


Try replacing the TAB characters at the beginning of your wrapped lines 
with spaces. And also make sure you don't have any white-space following 
any of the back-slashes at the end of wrapped lines.


John


- -

On 7/23/2009 7:45 PM, A117 wrote:
   

Sorry I forgot to mention the files in EXTRA_DIST are to be packed into release 
package. All the cpp files mentioned here already exists and are to be compiled 
and released.
If I put all cpp files in _SOURCES, the EXTRA_DIST files are not released. The 
only way I've found is to put only one cpp file in _SOURCES, while others to 
EXTRA_DIST and add .o to _LIBADD. My goal is to build all the .cpp and put all 
.cpp, .txt, .rc into release package.

 


Okay, I understand the problem now. But there's not enough information
in the snippet you posted to determine the cause. Can you post the
entire Makefile.am file? Or at least a smaller example that reproduces
the problem. There's nothing that I can see in the portion of your file
that you posted that would be the cause of such a problem.

John

   

-
And can I ask another question? I want to build some source code files into 
this library and need to distribute some other files, too. But EXTRA_DIST in 
Makefile.am does not work as below,
lib_LTLIBRARIES = libezcommon.la
...
libezcommon_la_SOURCES = ezcommon.cpp tinystr.cpp ...
EXTRA_DIST = tinyxml.txt ezcommon.rc ...

If I write only one file in libezcommon_la_SOURCES, while adding others to 
EXTRA_DIST and others' .o to libezcommon_la_LIBADD, it works. I don't know why.


 




   




答复: 答复: how to install library in a specific directory?

2009-07-24 Thread A117
yeah. You are totally right. thank you.

 

-邮件原件-
发件人: John Calcote [mailto:john.calc...@gmail.com] 
发送时间: 2009年7月24日 14:45
收件人: A117
抄送: Automake@gnu.org
主题: Re: 答复: how to install library in a specific directory?

 

On 7/24/2009 12:36 AM, A117 wrote:

 I’ve removed the backslashes and made them all one-line statements. No help.



 

What about the backslash at the end of your commented EXTRA_DIST line? 

Try removing that one too. It could be that it's causing the comment to 

include the following line, which is not supposed to be a comment. Just 

shooting in the dark now...

 

 发件人: John Calcote [mailto:john.calc...@gmail.com]

 发送时间: 2009年7月24日 14:28

 收件人: A117

 抄送: Automake@gnu.org

 主题: Re: how to install library in a specific directory?

 

 On 7/24/2009 12:21 AM, A117 wrote:

 lib_LTLIBRARIES = libezcommon.la

 myincludedir = $(includedir)/ezproject

 myinclude_HEADERS= ezcommon.h tinystr.h tinyxml.h

 libezcommon_la_SOURCES = ezcommon.cpp \

  tinystr.cpp tinyxml.cpp tinyxmlerror.cpp tinyxmlparser.cpp

 #libezcommon_la_LIBADD = tinystr.o tinyxml.o tinyxmlerror.o tinyxmlparser.o

 libezcommon_la_LDFLAGS = -version-info 2:0:0

 #EXTRA_DIST = tinystr.cpp tinyxml.cpp tinyxmlerror.cpp tinyxmlparser.cpp \

 EXTRA_DIST = ezcommon.rc dllmain.cpp ezcommon.aps ezcommon.vcproj icon.ico \

  tinyxml.txt resource.h stdafx.h targetver.h

 

 

 Try replacing the TAB characters at the beginning of your wrapped lines with 
 spaces. And also make sure you don't have any white-space following any of 
 the back-slashes at the end of wrapped lines.

 

 John

 

 

 

 - -

 

 On 7/23/2009 7:45 PM, A117 wrote:

 

 Sorry I forgot to mention the files in EXTRA_DIST are to be packed into 
 release package. All the cpp files mentioned here already exists and are to 
 be compiled and released.

 If I put all cpp files in _SOURCES, the EXTRA_DIST files are not released. 
 The only way I've found is to put only one cpp file in _SOURCES, while others 
 to EXTRA_DIST and add .o to _LIBADD. My goal is to build all the .cpp and put 
 all .cpp, .txt, .rc into release package.

 

 

 

 Okay, I understand the problem now. But there's not enough information

 in the snippet you posted to determine the cause. Can you post the

 entire Makefile.am file? Or at least a smaller example that reproduces

 the problem. There's nothing that I can see in the portion of your file

 that you posted that would be the cause of such a problem.

 

 John

 

 

 -

 And can I ask another question? I want to build some source code files into 
 this library and need to distribute some other files, too. But EXTRA_DIST in 
 Makefile.am does not work as below,

 lib_LTLIBRARIES = libezcommon.la

 ...

 libezcommon_la_SOURCES = ezcommon.cpp tinystr.cpp ...

 EXTRA_DIST = tinyxml.txt ezcommon.rc ...

 

 If I write only one file in libezcommon_la_SOURCES, while adding others to 
 EXTRA_DIST and others' .o to libezcommon_la_LIBADD, it works. I don't know 
 why.

 

 

 

 

 

 

 

 

 

 

 





Re: how to install library in a specific directory?

2009-07-24 Thread Ralf Wildenhues
Hello,

* John Calcote wrote on Thu, Jul 23, 2009 at 08:02:37AM CEST:
 On 7/22/2009 9:15 PM, A117 wrote:
 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.
 
 ldconfig updates the library cache. the /etc/ld.so.conf file is the
 file used by ldconfig to determine which directories to scan for
 libraries. When you add a new library to one of the directories in
 /etc/ld.so.conf, then you need to run ldconfig to ensure that the
 cache is aware of that new library.

FWIW, 'libtool --mode=install' should be running 'ldconfig -n' if you
don't happen to use DESTDIR; otherwise, there is --finish.

Cheers,
Ralf




Re: how to install library in a specific directory?

2009-07-23 Thread John Calcote

On 7/22/2009 9:15 PM, A117 wrote:

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.
   


ldconfig updates the library cache. the /etc/ld.so.conf file is the file 
used by ldconfig to determine which directories to scan for libraries. 
When you add a new library to one of the directories in /etc/ld.so.conf, 
then you need to run ldconfig to ensure that the cache is aware of that 
new library.


John





Re: how to install library in a specific directory?

2009-07-23 Thread A117
Why don't I need to run ldconfig manually after installing other official 
softwares, like osip2? I tried ldconfig -p and saw the library was aware of, 
i.e., listed, before running ldconfig. But linkage could not find the library 
then.

And can I ask another question? I want to build some source code files into 
this library and need to distribute some other files, too. But EXTRA_DIST in 
Makefile.am does not work as below,
lib_LTLIBRARIES = libezcommon.la
...
libezcommon_la_SOURCES = ezcommon.cpp tinystr.cpp ...
EXTRA_DIST = tinyxml.txt ezcommon.rc ...

If I write only one file in libezcommon_la_SOURCES, while adding others to 
EXTRA_DIST and others' .o to libezcommon_la_LIBADD, it works. I don't know why.

Thanks for your patience.

- -
On 7/22/2009 9:15 PM, A117 wrote:
 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.


ldconfig updates the library cache. the /etc/ld.so.conf file is the file 
used by ldconfig to determine which directories to scan for libraries. 
When you add a new library to one of the directories in /etc/ld.so.conf, 
then you need to run ldconfig to ensure that the cache is aware of that 
new library.

John






Re: how to install library in a specific directory?

2009-07-23 Thread William Pursell
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,
snip
 …
   ezcommon's Makefile.am,
 lib_LTLIBRARIES = libezcommon.la
 libdir = $(exec_prefix)/lib/ezproject

This is a bad idea.  The project maintainer should not be
deciding where the user must install the library.  If
the user wants to install ezproject in /opt/ezproject, he
should to be able to do 'configure --libdir=/opt/ezproject/lib',
but your setup will not allow that.

-- 
William Pursell




Re: how to install library in a specific directory?

2009-07-23 Thread John Calcote

On 7/23/2009 4:28 AM, A117 wrote:

Why don't I need to run ldconfig manually after installing other official softwares, like osip2? I 
tried ldconfig -p and saw the library was aware of, i.e., listed, before running 
ldconfig. But linkage could not find the library then.
   


Linux distro installers execute ldconfig for you. If you look carefully, 
you'll see that the last stage of installing software (either new or 
updated) is to run ldconfig. On my Opensuse 11.1 Linux installation, 
when I install new software packages from within YaST, I can see 
ldconfig's output just before the installation process completes. If you 
use RPM manually, you may have to run ldconfig yourself after installing 
packages in order to pick up the changes immediately.



And can I ask another question? I want to build some source code files into 
this library and need to distribute some other files, too. But EXTRA_DIST in 
Makefile.am does not work as below,
lib_LTLIBRARIES = libezcommon.la
...
libezcommon_la_SOURCES = ezcommon.cpp tinystr.cpp ...
EXTRA_DIST = tinyxml.txt ezcommon.rc ...

If I write only one file in libezcommon_la_SOURCES, while adding others to 
EXTRA_DIST and others' .o to libezcommon_la_LIBADD, it works. I don't know why.
   


I'm  sorry, I don't understand the question. Are you trying to generate 
sources, or optional build some sources? Perhaps a bit more context on 
the problem...



Thanks for your patience.

- -
   

On 7/22/2009 9:15 PM, A117 wrote:
 

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.

   

ldconfig updates the library cache. the /etc/ld.so.conf file is the file
used by ldconfig to determine which directories to scan for libraries.
When you add a new library to one of the directories in /etc/ld.so.conf,
then you need to run ldconfig to ensure that the cache is aware of that
new library.

John
 




   




how to install library in a specific directory?

2009-07-22 Thread bonami

  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_.)
  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?

  Thank you very much.
-- 
View this message in context: 
http://www.nabble.com/how-to-install-library-in-a-specific-directory--tp24601847p24601847.html
Sent from the Gnu - Automake - General mailing list archive at Nabble.com.





Re: how to install library in a specific directory?

2009-07-22 Thread John Calcote

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




Re: how to install library in a specific directory?

2009-07-22 Thread A117
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