From: damian lee on
Hello everyone,

recently I am trying to compile postfix in static linking so I can move
around the server without any dependency.

I tried to pass the -static to the gcc compiler with

make makefiles CC='gcc -Wmissing-prototypes' OPT='-static -O' DEBUG='-g'

when I do make command, it always jump out the process and give me this
error

gcc -Wmissing-prototypes -DHAS_PCRE -g -static -O -I. -I../../include
-DLINUX2 -o master master.o master_conf.o master_ent.o master_sig.o
master_avail.o master_spawn.o master_service.o master_status.o
master_listen.o master_vars.o master_wakeup.o master_watch.o master_flow.o
.../../lib/libglobal.a ../../lib/libutil.a -lpcre -ldb -lnsl -lresolv
/usr/bin/ld: cannot find -ldb
collect2: ld returned 1 exit status
make: *** [master] Error 1
make: *** [update] Error 1


but if I compile it without changes of the Makefile it's all okay.

I am not an programmer and hardly understand the compiling process.
so can anyone tell me what I have done wrong?

I am new to the list and wasn't sure if it's suitable to post questions
here.
so please advice if I should try another.

Thanks



Damian J. L. Lee
From: Sahil Tandon on
On Wed, 2010-08-11 at 11:10:31 +0800, damian lee wrote:

> recently I am trying to compile postfix in static linking so I can move
> around the server without any dependency.
>
> I tried to pass the -static to the gcc compiler with
>
> make makefiles CC='gcc -Wmissing-prototypes' OPT='-static -O' DEBUG='-g'
>
> when I do make command, it always jump out the process and give me this
> error
>
> gcc -Wmissing-prototypes -DHAS_PCRE -g -static -O -I. -I../../include
> -DLINUX2 -o master master.o master_conf.o master_ent.o master_sig.o
> master_avail.o master_spawn.o master_service.o master_status.o
> master_listen.o master_vars.o master_wakeup.o master_watch.o master_flow.o
> ../../lib/libglobal.a ../../lib/libutil.a -lpcre -ldb -lnsl -lresolv
> /usr/bin/ld: cannot find -ldb

Where is the *static* libdb library installed on your system? Have you
tried explicitly passing its location to the linker?

--
Sahil Tandon <sahil(a)FreeBSD.org>

From: damian lee on
Thank you for your answer Sahil.

In fact I don't fully understand the problem.
Do you mean I have to have a "*static* libdb library" inorder to compile my
Postfix in static linking?


2010/8/11 Sahil Tandon <sahil(a)freebsd.org>

> On Wed, 2010-08-11 at 11:10:31 +0800, damian lee wrote:
>
> > recently I am trying to compile postfix in static linking so I can move
> > around the server without any dependency.
> >
> > I tried to pass the -static to the gcc compiler with
> >
> > make makefiles CC='gcc -Wmissing-prototypes' OPT='-static -O' DEBUG='-g'
> >
> > when I do make command, it always jump out the process and give me this
> > error
> >
> > gcc -Wmissing-prototypes -DHAS_PCRE -g -static -O -I. -I../../include
> > -DLINUX2 -o master master.o master_conf.o master_ent.o master_sig.o
> > master_avail.o master_spawn.o master_service.o master_status.o
> > master_listen.o master_vars.o master_wakeup.o master_watch.o
> master_flow.o
> > ../../lib/libglobal.a ../../lib/libutil.a -lpcre -ldb -lnsl -lresolv
> > /usr/bin/ld: cannot find -ldb
>
> Where is the *static* libdb library installed on your system? Have you
> tried explicitly passing its location to the linker?
>
> --
> Sahil Tandon <sahil(a)FreeBSD.org>
>
From: Ralf Hildebrandt on
* damian lee <damianjllee(a)gmail.com>:
> Thank you for your answer Sahil.
>
> In fact I don't fully understand the problem.
> Do you mean I have to have a "*static* libdb library" inorder to compile my
> Postfix in static linking?

Of course. Otherwise this lib would have non-static dependencies.

--
Ralf Hildebrandt
Geschäftsbereich IT | Abteilung Netzwerk
Charité - Universitätsmedizin Berlin
Campus Benjamin Franklin
Hindenburgdamm 30 | D-12203 Berlin
Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962
ralf.hildebrandt(a)charite.de | http://www.charite.de


From: damian lee on
My compiling platform is an old FC5 with full install
I have found a /usr/lib/libdb-4.3.a file it should be the static linked
version of libdb.
so I made a link "ln -s libdb-4.3.a libdb.a " makes me successful pass my
last problem.
but something new com up.

I got a lot of errors like

/usr/lib/gcc/i386-redhat-linux/4.1.0/../../../libdb.a(mut_pthread.o): In
function `__db_pthread_mutex_destroy': undefined reference to
`pthread_mutex_destroy'

It seems my static linked version of libdb doesn't work.

Any suggestions?

Damian Lee



2010/8/11 Ralf Hildebrandt <Ralf.Hildebrandt(a)charite.de>

> * damian lee <damianjllee(a)gmail.com>:
> > Thank you for your answer Sahil.
> >
> > In fact I don't fully understand the problem.
> > Do you mean I have to have a "*static* libdb library" inorder to compile
> my
> > Postfix in static linking?
>
> Of course. Otherwise this lib would have non-static dependencies.
>
> --
> Ralf Hildebrandt
> Geschäftsbereich IT | Abteilung Netzwerk
> Charité - Universitätsmedizin Berlin
> Campus Benjamin Franklin
> Hindenburgdamm 30 | D-12203 Berlin
> Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962
> ralf.hildebrandt(a)charite.de | http://www.charite.de
>
>