Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Building a sample application with libraries located in nonstandard directory

Reply
Thread Tools

Building a sample application with libraries located in nonstandard directory

 
 
ArifulHossain tuhin
Guest
Posts: n/a
 
      01-07-2012
I have built a library. Say its libexample.la. Now i want a build a sample application. The sample application comes with a configure script. When i run the configure script it fails reporting that it could not find the library it needs. So i need to supply the libexample.la's directory information in the configure script somehow so that it can find the library and build the application. I need a general way of doing this, because i stumble upon this problem several times in past.

I always solved it through googling, and some tweaking with no clear understanding. I have idea that may be it can be done through defining Environment variables. But any general way of doing it? i mean to supply this information to the configure script in a way which will be applicable to all otherscenario ?
Thanks in advance.
 
Reply With Quote
 
 
 
 
ec429
Guest
Posts: n/a
 
      01-07-2012
On 07/01/12 11:26, ArifulHossain tuhin wrote:
> I have built a library. Say its libexample.la. Now i want a build a sample application. The sample application comes with a configure script. When i run the configure script it fails reporting that it could not find the library it needs. So i need to supply the libexample.la's directory information in the configure script somehow so that it can find the library and build the application. I need a general way of doing this, because i stumble upon this problem several times in past.
>
> I always solved it through googling, and some tweaking with no clear understanding. I have idea that may be it can be done through defining Environment variables. But any general way of doing it? i mean to supply this information to the configure script in a way which will be applicable to all other scenario ?
> Thanks in advance.

This is not a C question. You might have better luck asking in a
newsgroup devoted to your platform; may I suggest comp.unix.programmer?
-e
--
'sane', adj.: see 'unimaginative'
on the web - http://jttlov.no-ip.org
 
Reply With Quote
 
 
 
 
Kenny McCormack
Guest
Posts: n/a
 
      01-07-2012
In article <je9k2a$ste$(E-Mail Removed)>, ec429 <(E-Mail Removed)> wrote:
>On 07/01/12 11:26, ArifulHossain tuhin wrote:
>> I have built a library. Say its libexample.la. Now i want a build a

>sample application. The sample application comes with a configure
>script. When i run the configure script it fails reporting that it could
>not find the library it needs. So i need to supply the libexample.la's
>directory information in the configure script somehow so that it can
>find the library and build the application. I need a general way of
>doing this, because i stumble upon this problem several times in past.
>>
>> I always solved it through googling, and some tweaking with no clear

>understanding. I have idea that may be it can be done through defining
>Environment variables. But any general way of doing it? i mean to supply
>this information to the configure script in a way which will be
>applicable to all other scenario ?
>> Thanks in advance.

>This is not a C question. You might have better luck asking in a
>newsgroup devoted to your platform; may I suggest comp.unix.programmer?
>-e
>--
>'sane', adj.: see 'unimaginative'
> on the web - http://jttlov.no-ip.org


IOW:

Off topic. Not portable. Cant discuss it here. Blah, blah, blah.

--
Useful clc-related links:

http://en.wikipedia.org/wiki/Aspergers
http://en.wikipedia.org/wiki/Clique
http://en.wikipedia.org/wiki/C_programming_language

 
Reply With Quote
 
Jens Thoms Toerring
Guest
Posts: n/a
 
      01-07-2012
ec429 <(E-Mail Removed)> wrote:
> On 07/01/12 11:26, ArifulHossain tuhin wrote:
> > I have built a library. Say its libexample.la. Now i want a build a sample
> >application. The sample application comes with a configure script. When i
> >run the configure script it fails reporting that it could not find the
> >library it needs. So i need to supply the libexample.la's directory
> >information in the configure script somehow so that it can find the library
> >and build the application. I need a general way of doing this, because i
> >stumble upon this problem several times in past.


> > I always solved it through googling, and some tweaking with no clear
> >understanding. I have idea that may be it can be done through defining
> >Environment variables. But any general way of doing it? i mean to supply
> >this information to the configure script in a way which will be applicable
> >to all other scenario ?


> This is not a C question. You might have better luck asking in a
> newsgroup devoted to your platform; may I suggest comp.unix.programmer?


Seconded. And while doing that it might be worth to try to
give some further information about what you're doing (e.g.
what does this configure script do, where does it come from
etc. - is this a question about the autoconf/automake tools
in disguise?). And, btw., at least under Unix the extension
for a library is typically '.a' (for static libraries) and
'.so' (for shared libraries) and '.la' is often an interme-
diate file created by the libtool utility. If you use these
tools it would make a lot of sense if you would mention that
in your post.
Regards, Jens
--
\ Jens Thoms Toerring ___ http://www.velocityreviews.com/forums/(E-Mail Removed)
\__________________________ http://toerring.de
 
Reply With Quote
 
Kaz Kylheku
Guest
Posts: n/a
 
      01-07-2012
On 2012-01-07, ArifulHossain tuhin <(E-Mail Removed)> wrote:
> I need a general way of doing this, because i stumble upon this
> problem several times in past.


There is no general way of doing it because every program's configure
script is different.

Autoconf is a braindamaged pile of crap designed by imbeciles, but naive
developers keep trusting that it will take care of their build problems
somehow.

However, I'm surprised you're having that much trouble. This stuff
generally works if you're building packages using a machine's native
toolchain, to be installed in standard locations on that machine.

> I always solved it through googling, and some tweaking with no clear
> understanding. I have idea that may be it can be done through defining
> Environment variables.


Environment variables can indeed influence configure scripts, and this can be a
huge time saver. For instance, most of the cross-compiling idiocies in the bash
configure script can be circumvented by hard-coding the answers to some of
those tests and exporting them as environment variables. In Autoconf-generated
scripts, you usually have to use internal variables for this which are named
something like ac_config_whatever, or something similar.

There is not 100% consistent convention. You have to read the configure
script to see where the decision is being made which is going wrong,
and which environment variable it hinges on, if any, etc.

> But any general way of doing it?


Hahaha.
 
Reply With Quote
 
Seebs
Guest
Posts: n/a
 
      01-07-2012
On 2012-01-07, Kaz Kylheku <(E-Mail Removed)> wrote:
> Autoconf is a braindamaged pile of crap designed by imbeciles, but naive
> developers keep trusting that it will take care of their build problems
> somehow.


This is unduly harsh. Autoconf is not nearly as stupid as it looks; it's just
that 90% of the things it does which look stupid are only sensible if you
assume that it matters whether stuff builds on Ultrix or SVR2. Which most of
the stuff using it wouldn't anyway.

(Not really C-related directly, but many C programmers get stuck trying to
outsmart autoconf.)

-s
--
Copyright 2011, all wrongs reversed. Peter Seebach / (E-Mail Removed)
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
I am not speaking for my employer, although they do rent some of my opinions.
 
Reply With Quote
 
ec429
Guest
Posts: n/a
 
      01-08-2012
On 07/01/12 21:24, Seebs wrote:
> On 2012-01-07, Kaz Kylheku<(E-Mail Removed)> wrote:
>> Autoconf is a braindamaged pile of crap designed by imbeciles, but naive
>> developers keep trusting that it will take care of their build problems
>> somehow.

>
> This is unduly harsh. Autoconf is not nearly as stupid as it looks; it's just
> that 90% of the things it does which look stupid are only sensible if you
> assume that it matters whether stuff builds on Ultrix or SVR2. Which most of
> the stuff using it wouldn't anyway.
>
> (Not really C-related directly, but many C programmers get stuck trying to
> outsmart autoconf.)
>
> -s

Or you can write POSIX-compliant code, refuse to support
non-POSIX-compliant platforms, and chuck Autoconf in /dev/dustbin where
it belongs.
Besides, even if you believe Autoconf's use case is valid, Autoconf is
not a well-designed solution to that problem; simply put, it's hairy.
-e
--
'sane', adj.: see 'unimaginative'
on the web - http://jttlov.no-ip.org
 
Reply With Quote
 
Edward A. Falk
Guest
Posts: n/a
 
      01-08-2012
In article <(E-Mail Removed)>,
Kaz Kylheku <(E-Mail Removed)> wrote:
>
>Autoconf is a braindamaged pile of crap designed by imbeciles, but naive
>developers keep trusting that it will take care of their build problems
>somehow.


Amen. I've used autoconf on occasion, and my experience has been that
it's more work to get the autoconf scripts working than it would have
been to write portable code in the first place.

The thing about autoconf is that after you've put all this effort into
getting it to work right, the sense of satisfaction you get causes you
to overlook the fact that you haven't actually tested it under other
Unix variants. And in fact, your program still isn't portable.

It's probably a product of the Sirius Cybernetics Corporation.

--
-Ed Falk, (E-Mail Removed)
http://thespamdiaries.blogspot.com/
 
Reply With Quote
 
Dr Nick
Guest
Posts: n/a
 
      01-08-2012
ec429 <(E-Mail Removed)> writes:

> On 07/01/12 21:24, Seebs wrote:
>> On 2012-01-07, Kaz Kylheku<(E-Mail Removed)> wrote:
>>> Autoconf is a braindamaged pile of crap designed by imbeciles, but naive
>>> developers keep trusting that it will take care of their build problems
>>> somehow.

>>
>> This is unduly harsh. Autoconf is not nearly as stupid as it looks; it's just
>> that 90% of the things it does which look stupid are only sensible if you
>> assume that it matters whether stuff builds on Ultrix or SVR2. Which most of
>> the stuff using it wouldn't anyway.
>>
>> (Not really C-related directly, but many C programmers get stuck trying to
>> outsmart autoconf.)
>>
>> -s

> Or you can write POSIX-compliant code, refuse to support
> non-POSIX-compliant platforms, and chuck Autoconf in /dev/dustbin
> where it belongs.


Even then you need to do some of the things that Autoconf does - for
example when different versions of libraries have a different interface.

> Besides, even if you believe Autoconf's use case is valid, Autoconf is
> not a well-designed solution to that problem; simply put, it's hairy.


Agreed. But it's something that is likely to be there and that can do
what you need doing (along with a lot of stuff you don't and never
will).
--
Online waterways route planner | http://canalplan.eu
Plan trips, see photos, check facilities | http://canalplan.org.uk
 
Reply With Quote
 
Markus Wichmann
Guest
Posts: n/a
 
      01-08-2012
On 08.01.2012 10:15, Dr Nick wrote:
> ec429 <(E-Mail Removed)> writes:
>> Or you can write POSIX-compliant code, refuse to support
>> non-POSIX-compliant platforms, and chuck Autoconf in /dev/dustbin
>> where it belongs.

>
> Even then you need to do some of the things that Autoconf does - for
> example when different versions of libraries have a different interface.
>


How about you build anyway and don't try to outsmart the administrator?
If the library really has the wrong version, the build will fail. (If
you just implement for one interface. If you implement for both you are
doing double shift for nothing!)

Just be nice and write it in your documentation somewhere!

>> Besides, even if you believe Autoconf's use case is valid, Autoconf is
>> not a well-designed solution to that problem; simply put, it's hairy.

>
> Agreed. But it's something that is likely to be there and that can do
> what you need doing (along with a lot of stuff you don't and never
> will).


Yeah, that's the problem with FSF software: Featuritis. The program does
what you want, and a ton of extra stuff.

What's wrong with small posix compliant scripts in the build system,
called by Makefiles?

Ciao,
Markus
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing OE address book from nonstandard location Z Firefox 3 09-03-2005 04:22 PM
compiling/installing ruby in a nonstandard directory Mark Hubbart Ruby 5 10-08-2004 02:44 PM
How can I access a UserControl that is located outside my application directory of my dll...????? Kristoffer Arfvidson ASP .Net 7 01-21-2004 06:59 AM
[ANN] NTL "Nonstandard Template Library" Mirek Fidler C++ 8 07-03-2003 09:08 PM
Testing nonstandard assumption Hallvard B Furuseth C Programming 1 06-29-2003 11:11 AM



Advertisments