Bacula-users

Re: [Bacula-users] How to change the position of the LDFLAGS content in the make commands executed

2008-07-09 05:43:36
Subject: Re: [Bacula-users] How to change the position of the LDFLAGS content in the make commands executed
From: "Mark V" <mvyver AT gmail DOT com>
To: "Arno Lehmann" <al AT its-lehmann DOT de>
Date: Wed, 9 Jul 2008 19:43:25 +1000
On Wed, Jul 9, 2008 at 5:21 PM, Arno Lehmann <al AT its-lehmann DOT de> wrote:
> Hi,
>
> 09.07.2008 06:33, Mark V wrote:
>> Hi Group,
>>
>> I'm trying to build anb install Bacula, and the static dir and static
>> sd builds are giving some trouble.
>> I've worked out that when I configure using:
>>
>>  LDFLAGS="-lssl -lcrypto -lcrypt -lnsl -ldl" \
>>     ./configure <my-opts>
>
> I'm wondering why you have to supply the libraries to ./configure... I
> would expect ./configure to find the needed libraries itself and apply
> them in the right positions.
>

Okay, I dug into the makefiles and it seems these libraries are needed
when mysqlclient is included/used.
The correct way to include them seems to be:

LDFLAGS="" \
export LIBS="-lssl -lcrypto -lcrypt -lnsl -ldl" # -lpthread is
prepended by the configure script.
./configure <my-opts>

I don't use --enable-openssl, so it seems that having --with-mysql is
enough to require the LIBS mentioned above
If these libraries are not included they don't get picked up.

> What happens if you let ./configure handle those?
>

it just seems to use -lpthread -lmysqlclient_r -lz

I'm no programmer so have just trialled and errored my way to this
point.... I've nothing intelligent to add on why the configure script
doesn't pick them up :)

HTH?

Mark

> Arno
>
>> Then "make" will run the following command:
>>
>> /usr/bin/g++ -static -lssl -lcrypto -lcrypt -lnsl -ldl -L../lib
>> -L../cats -L../findlib -o bscan bscan.o block.o device.o dev.o label.o
>> ansi_label.o dvd.o ebcdic.o lock.o autochanger.o acquire.o mount.o
>> record.o match_bsr.o parse_bsr.o butil.o read_record.o scan.o
>> reserve.o stored_conf.o spool.o wait.o \
>>  -lsql -L/usr/lib/mysql -lmysqlclient_r -lz -lz -lfind -lbac -lm -lpthread
>>
>> This results in many errors (excerpt):
>>
>> /usr/lib/mysql/libmysqlclient_r.a(client.o): In function
>> `mysql_close_free_options':
>> (.text+0xeae): undefined reference to `SSL_CTX_free'
>> /usr/lib/mysql/libmysqlclient_r.a(client.o): In function 
>> `mysql_get_ssl_cipher':
>> (.text+0x1206): undefined reference to `SSL_get_current_cipher'
>> <snip>
>>
>> However, if instead I move the LDFAGS content from the start, to the
>> end of the command given above, I can run this altered command  and
>> only warnings are generated:
>>
>> /usr/bin/g++ -static -L../lib -L../cats -L../findlib -o bscan bscan.o
>> block.o device.o dev.o label.o ansi_label.o dvd.o ebcdic.o lock.o
>> autochanger.o acquire.o mount.o record.o match_bsr.o parse_bsr.o
>> butil.o read_record.o scan.o reserve.o stored_conf.o spool.o wait.o
>> -lsql -L/usr/lib/mysql -lmysqlclient_r -lz -lz -lfind -lbac -lm
>> -lpthread -lssl -lcrypto -lcrypt -lnsl -ldl
>>
>> Is this a configure/make bug or have I configured things incorrectly?
>>
>> Apologies if this is obvious I'm not a programmer and it has taken a
>> couple of days to figure this out.
>>
>> Regards
>> Mark
>>
>> -------------------------------------------------------------------------
>> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
>> Studies have shown that voting for your favorite open source project,
>> along with a healthy diet, reduces your potential for chronic lameness
>> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
>> _______________________________________________
>> Bacula-users mailing list
>> Bacula-users AT lists.sourceforge DOT net
>> https://lists.sourceforge.net/lists/listinfo/bacula-users
>>
>
> --
> Arno Lehmann
> IT-Service Lehmann
> www.its-lehmann.de
>
> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> _______________________________________________
> Bacula-users mailing list
> Bacula-users AT lists.sourceforge DOT net
> https://lists.sourceforge.net/lists/listinfo/bacula-users
>

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users

<Prev in Thread] Current Thread [Next in Thread>