Thread: Dynamic modules and standard naming practice

Dynamic modules and standard naming practice

From
"Thomas Hallgren"
Date:
On Unix, the general rule for a shared library is to prepend "lib" and
append ".so". On Windows, nothing is prepended and you add ".dll". Thus for
a module named "pljava" you'd get:

libpljava.so on Unix and:
pljava.dll on Windows.

This is in fact so common that the Java Native Interface (JNI) uses it as
the default way of finding things. When loading a library from Java, you
would say System.loadLibrary("pljava") and it would autmatically resolve to
libpljava.so and pljava.dll on the respective systems.

PostgreSQL, while substituting the postfix correctly, never seems to prepend
"lib" on a Unix system. Consequently, I have to use "libpljava" to reference
the module in SQL while I use "pljava" for the same module in Java. It would
be very nice if PostgreSQL could make an attempt to first prepend the "lib"
and if that doesn't work, try without the prefix on a Unix system.

Regards,

Thomas Hallgren