how to static link a lib

hbeaumont hbeaumont ahlist@gmail.com
Wed Jan 3 03:28:00 GMT 2007


Hi,

Please forgive me if this is a question that I should have been able
to find myself. I did search the archives and check the man page
(though it got a bit too confusing and I may have missed what I was
looking for).

I need to know how to static link a particular lib in a file. I
suppose this is more a linker question and not a compiler question -
please let me know if there is a different list I should ask on.

My particular issue is doing a static link of openssl in a php 5.2.0
build - but of course general help is fine.

Also, is there a "standard" arg to pass to autoconf to do this? I have
had many instances with various open source software where a static
link of the whole program or just some libs would have made life
easier. If I could do this using ./configure args it would be great
(would rather not have to modify the makefiles and always have my own
non-pristine sources).

All advice is very appreciated.

Thanks.



More information about the Gcc-help mailing list