I can build a executable with gcc with static link:
gcc -static xxx.c -o xxx
So I can run xxx without any external dependent lib
If you have any plans on portability for your shared library, use libtool(1). It will handle most of the details of compiler flags for you and will make your life infinitely easier. If you don't use libtool
, but later decide you want to port your program to OS X or Windows, you're going to end up reinventing it anyway.