A possible solution is to use GNU autoconf and related to be able to configure, at compile time, how is that library available and deployed.
Another solution is to use preprocessor tricks. When used with -DFOO_ALWAYS_INLINE your foo.h header file is defining static inline functions. Otherwise it is declaring them as extern.
Another possibility is to use some extra preprocessor (GNU m4, or GPP, or your own C code generator) which generates C code.
You could contact me by email.