Improve company productivity with a Business Account.Sign Up

x
?
Solved

Two library versions with autoconf

Posted on 2002-04-15
6
Medium Priority
?
261 Views
Last Modified: 2010-04-22
Here's my problem: I have a program (server) that uses library libfoo. I maintain it with CVS and GNU machinery (autoconf, automake, libtool and family). Now, I want to have two versions of server running on my system: old branch using libfoo version 1, and new one using libfoo version 2, so that another programmer can continue his work on client, while I test new features in the server. But autoconfigured makefile creates (with libtool) library with version 0.0.0 and I cannot find where to change that.

So:

How can I make libtool create libraries with another version numbers?

And:

What changes should I make in config.in or Makefile.am to link server with libfoo.so.1, not libfoo.so.0?

Help, please!
0
Comment
Question by:Robson
  • 3
  • 3
6 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6942186
what you want to do is not a task for autocnf, usually.
You do it by moving the library to a new name, like
    mv libfoo.so libfoo.so.1.0

But you may try to set the VERSION variable in configure.in, like:
     VERSION=1.0

Or you simply add a command to target which generates the library in Makefile.in, like:
     libfoo.so: ($LIBOBJS)
          $(LD) .... whatevercomeshere
          mv $@ $@.1.0
0
 
LVL 4

Author Comment

by:Robson
ID: 7001029
I've added this line to Makefile.am in library project:

libfoo_la_LDFLAGS = -version-info 1:0:0

and now makefile creates files with 1.0.0 names (and different version) I haven't figured out how to link program with either 1.0 or 0.0 version when both of them exist in library search path (now I'm keep them in separate directories and switching with gcc -L option).
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 420 total points
ID: 7001198
if you have the libs in separate directories, you can use the LD_LIBRARY_PATH environment variable to switch these directories when running the program
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 4

Author Comment

by:Robson
ID: 7001486
I already know that. What still bothers me is how to specify library version for compilation.
0
 
LVL 4

Author Comment

by:Robson
ID: 7011382
After carefully reading documentation I came to a conclusion that switching LD_LIBRARY_PATH at runtime and -Llibrary_directory at compilation time is the best idea. Thanks for your comments!
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7011924
LD_LIBRARY_PATH is roughly 20 years old, not bad that technic, isn't it ;-)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
When you have multiple client accounts to manage, it often feels like there aren’t enough hours in the day. With too many applications to juggle, you can’t focus on your clients, much less your growing to-do list. But that doesn’t have to be the cas…
From store locators to asset tracking and route optimization, learn how leading companies are using Google Maps APIs throughout the customer journey to increase checkout conversions, boost user engagement, and optimize order fulfillment. Powered …

606 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question