Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > autoconf and shared library

Reply
Thread Tools

autoconf and shared library

 
 
Matt Kowalczyk
Guest
Posts: n/a
 
      03-26-2006
I hope I am posting this to the right newsgroup. I tried submitting this to the
mailing list, but I see no activity. If this is the wrong
newsgroup, I would appriciate a reference to a different source.

My question was:

One of my source files uses the library:

#include <openssl/md5.h>

This forces me to add /usr/lib/libcrypto.so to the gcc command when I link the
object to produce an executable for instance. My gcc command looks something
like below:

gcc --pedantic -Wall -std=c99 -O2 -g -O2 /usr/lib/libcrypto.so -o main Main.o
my_md5.o

I was studying autoconf today and was wondering how I can assert that the user
compiling does in fact have the libcrypto.so shared object.

e.g. ./configure would check to make sure libcrypto.so is available... at least
it's functionality--the function MD5_Init is defined for example.

Is this possible?

Second Question:

As programs grow in complexity and require many of these shared objects, what is
the best way to assure portability? Do I include the code for libcrypto.c for
the user to compile if they don't have libcrypto.so? Or do I provide the user
with an unfriendly error message from the compiler.

Also, the location of my libcrypto.so object may differ from other peoples. How
do I deal with that?

Thanks,
Matt
 
Reply With Quote
 
 
 
 
liljencrantz@gmail.com
Guest
Posts: n/a
 
      03-26-2006

Matt Kowalczyk wrote:
> I hope I am posting this to the right newsgroup. I tried submitting this to the
> mailing list, but I see no activity. If this is the wrong
> newsgroup, I would appriciate a reference to a different source.


This is indeed the wrong newsgroup, but it seems you originally posted
this in the correct one with no reply, which is a good enough excuse
for me.

>
> My question was:
>
> One of my source files uses the library:
>
> #include <openssl/md5.h>
>
> This forces me to add /usr/lib/libcrypto.so to the gcc command when I link the
> object to produce an executable for instance. My gcc command looks something
> like below:
>
> gcc --pedantic -Wall -std=c99 -O2 -g -O2 /usr/lib/libcrypto.so -o main Main.o
> my_md5.o
>
> I was studying autoconf today and was wondering how I can assert that the user
> compiling does in fact have the libcrypto.so shared object.
>
> e.g. ./configure would check to make sure libcrypto.so is available... at least
> it's functionality--the function MD5_Init is defined for example.
>
> Is this possible?
>
> Second Question:
>
> As programs grow in complexity and require many of these shared objects, what is
> the best way to assure portability? Do I include the code for libcrypto.c for
> the user to compile if they don't have libcrypto.so? Or do I provide the user
> with an unfriendly error message from the compiler.
>
> Also, the location of my libcrypto.so object may differ from other peoples. How
> do I deal with that?


See for example:

http://roo.no-ip.org/howtos/autoconf.php#head

You could bail out if the required functionality is missing using
something like:

# Search for specified function in specified libraries
AC_SEARCH_LIBS( [BK_set_key],
[crypto],
[],
[AC_MSG_ERROR( [Cannot find the libcrypto library, needed to build
this package.] )] )

You also need to remove the direct reference to libcrypto from your
Makefile.in and instead use @LDFLAGS@ for the above to work.

The above would work even if the libcrypto was missing but the
functionality lives in libc. It also works if the library lives in e.g.
/usr/local.

>
> Thanks,
> Matt


Hope this helps.

--
Axel

 
Reply With Quote
 
 
 
 
Robert Gamble
Guest
Posts: n/a
 
      03-26-2006
wrote:
> Matt Kowalczyk wrote:
> > I hope I am posting this to the right newsgroup. I tried submitting this to the
> > mailing list, but I see no activity. If this is the wrong
> > newsgroup, I would appriciate a reference to a different source.

>
> This is indeed the wrong newsgroup, but it seems you originally posted
> this in the correct one with no reply, which is a good enough excuse
> for me.


If this is the case, why wouldn't you post your response in the correct
forum where it would be on topic?

Robert Gamble

 
Reply With Quote
 
Richard G. Riley
Guest
Posts: n/a
 
      03-26-2006
On 2006-03-26, Robert Gamble <> wrote:
> wrote:
>> Matt Kowalczyk wrote:
>> > I hope I am posting this to the right newsgroup. I tried submitting this to the
>> > mailing list, but I see no activity. If this is the wrong
>> > newsgroup, I would appriciate a reference to a different source.

>>
>> This is indeed the wrong newsgroup, but it seems you originally posted
>> this in the correct one with no reply, which is a good enough excuse
>> for me.

>
> If this is the case, why wouldn't you post your response in the correct
> forum where it would be on topic?
>
> Robert Gamble
>


Out of curiosity where is the correct newsgroup for C programmers to
discuss (multi-platform) tools and libraries?
 
Reply With Quote
 
Ben Pfaff
Guest
Posts: n/a
 
      03-26-2006
Matt Kowalczyk <> writes:

> I hope I am posting this to the right newsgroup. I tried
> submitting this to the mailing list, but I see
> no activity.


There's plenty of activity on that mailing list, so you must be
doing something wrong.
--
"I've been on the wagon now for more than a decade. Not a single goto
in all that time. I just don't need them any more. I don't even use
break or continue now, except on social occasions of course. And I
don't get carried away." --Richard Heathfield
 
Reply With Quote
 
Robert Gamble
Guest
Posts: n/a
 
      03-26-2006

Richard G. Riley wrote:
> On 2006-03-26, Robert Gamble <> wrote:
> > wrote:
> >> Matt Kowalczyk wrote:
> >> > I hope I am posting this to the right newsgroup. I tried submitting this to the
> >> > mailing list, but I see no activity. If this is the wrong
> >> > newsgroup, I would appriciate a reference to a different source.
> >>
> >> This is indeed the wrong newsgroup, but it seems you originally posted
> >> this in the correct one with no reply, which is a good enough excuse
> >> for me.

> >
> > If this is the case, why wouldn't you post your response in the correct
> > forum where it would be on topic?
> >
> > Robert Gamble
> >

>
> Out of curiosity where is the correct newsgroup for C programmers to
> discuss (multi-platform) tools and libraries?


I am not aware of any such all encompassing newsgroup nor am I
convinced there should be one. What is your point?

Robert Gamble

 
Reply With Quote
 
Richard G. Riley
Guest
Posts: n/a
 
      03-26-2006
On 2006-03-26, Robert Gamble <> wrote:
>
> Richard G. Riley wrote:
>> On 2006-03-26, Robert Gamble <> wrote:
>> > wrote:
>> >> Matt Kowalczyk wrote:
>> >> > I hope I am posting this to the right newsgroup. I tried submitting this to the
>> >> > mailing list, but I see no activity. If this is the wrong
>> >> > newsgroup, I would appriciate a reference to a different source.
>> >>
>> >> This is indeed the wrong newsgroup, but it seems you originally posted
>> >> this in the correct one with no reply, which is a good enough excuse
>> >> for me.
>> >
>> > If this is the case, why wouldn't you post your response in the correct
>> > forum where it would be on topic?
>> >
>> > Robert Gamble
>> >

>>
>> Out of curiosity where is the correct newsgroup for C programmers to
>> discuss (multi-platform) tools and libraries?

>
> I am not aware of any such all encompassing newsgroup nor am I
> convinced there should be one. What is your point?
>
> Robert Gamble
>


Point? I did not make a point. I asked if their was a general meeting
place for C programmers to discuss tools used to facilitate C
development. Looking back at the text above, I'm surprised it wasn't
relatively clear.

You can be sure I wasnt trying to convince you of anything.
 
Reply With Quote
 
liljencrantz@gmail.com
Guest
Posts: n/a
 
      03-26-2006

Robert Gamble wrote:
> wrote:
> > Matt Kowalczyk wrote:
> > > I hope I am posting this to the right newsgroup. I tried submitting this to the
> > > mailing list, but I see no activity. If this is the wrong
> > > newsgroup, I would appriciate a reference to a different source.

> >
> > This is indeed the wrong newsgroup, but it seems you originally posted
> > this in the correct one with no reply, which is a good enough excuse
> > for me.

>
> If this is the case, why wouldn't you post your response in the correct
> forum where it would be on topic?


My bad. I am not subscribed to that mailing list, nor did I have the
subject of the original message, so doing the extra digging required
would have taken some additional effort, which is probably why the
thought never occured to me.

>
> Robert Gamble


--
Axel

 
Reply With Quote
 
Mark McIntyre
Guest
Posts: n/a
 
      03-26-2006
On Sun, 26 Mar 2006 18:17:09 +0200, in comp.lang.c , "Richard G.
Riley" <> wrote:

>On 2006-03-26, Robert Gamble <> wrote:
>> wrote:
>>> Matt Kowalczyk wrote:
>>> > I hope I am posting this to the right newsgroup. I tried submitting this to the
>>> > mailing list, but I see no activity. If this is the wrong
>>> > newsgroup, I would appriciate a reference to a different source.
>>>
>>> This is indeed the wrong newsgroup, but it seems you originally posted
>>> this in the correct one with no reply, which is a good enough excuse
>>> for me.

>>
>> If this is the case, why wouldn't you post your response in the correct
>> forum where it would be on topic?
>>
>> Robert Gamble
>>

>
>Out of curiosity where is the correct newsgroup for C programmers to
>discuss (multi-platform) tools and libraries?


I doubt there is one - the details of tools tend to be discussed
either in groups specific to the tool (if they're in general enough
use) or in groups specific to the OS or compiler environment.
Mark McIntyre
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 
Reply With Quote
 
CBFalconer
Guest
Posts: n/a
 
      03-26-2006
Mark McIntyre wrote:
> "Richard G. Riley" <> wrote:
>> On 2006-03-26, Robert Gamble <> wrote:
>>> wrote:
>>>> Matt Kowalczyk wrote:

>
>>>>> I hope I am posting this to the right newsgroup. I tried
>>>>> submitting this to the mailing list, but I
>>>>> see no activity. If this is the wrong newsgroup, I would
>>>>> appriciate a reference to a different source.
>>>>
>>>> This is indeed the wrong newsgroup, but it seems you originally
>>>> posted this in the correct one with no reply, which is a good
>>>> enough excuse for me.
>>>
>>> If this is the case, why wouldn't you post your response in the
>>> correct forum where it would be on topic?

>>
>> Out of curiosity where is the correct newsgroup for C programmers
>> to discuss (multi-platform) tools and libraries?

>
> I doubt there is one - the details of tools tend to be discussed
> either in groups specific to the tool (if they're in general enough
> use) or in groups specific to the OS or compiler environment.


At a guess, comp.programming and comp.os.linux.misc would seem to
be suitable.

--
Some informative links:
news:news.announce.newusers
http://www.geocities.com/nnqweb/
http://www.catb.org/~esr/faqs/smart-questions.html
http://www.caliburn.nl/topposting.html
http://www.netmeister.org/news/learn2quote.html


 
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
Anyway using gtest (google) and autoconf Andrea Crotti C++ 0 10-28-2010 09:28 AM
(OT) autoconf and CFLAGS kid joe C Programming 1 06-04-2009 06:52 AM
global variable is shared in shared library ankugoe7@gmail.com C Programming 1 07-15-2008 04:26 PM
Using mkmf.rb / extconf.rb and autoconf/automake together Rudi Cilibrasi Ruby 3 05-19-2004 08:29 PM
autoconf macros and distutils Mark Asbach Python 0 03-01-2004 08:03 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57