+2017-07-26 Reuben Thomas <rrt@sc3d.org>
+
+ relocatable-lib{,-lgpl}: improve documentation
+ * doc/relocatable-maint.texi: Document use of relocatable-lib{,-lgpl}.
+ Various other updates.
+
2017-07-30 Reuben Thomas <rrt@sc3d.org>
Bruno Haible <bruno@clisp.org>
sets the environment variable that controls shared library searching
(usually @env{LD_LIBRARY_PATH}) and then invokes the real executable.
-This approach does not always work. On OpenBSD and OpenServer,
-prereleases of Libtool 1.5 put absolute file names of libraries in
-executables, which prevents searching any other locations.
-
@item
On Windows, the executable's own directory is searched for libraries,
so installing shared libraries into the executable's directory is
@enumerate
@item
-Import the @code{relocatable-prog} module.
+Import the @code{relocatable-prog} module. For libraries, use the
+@code{relocatable-lib} or @code{relocatable-lib-lgpl} module.
@item
In every program, add to @code{main} as the first statement (even
The prototype for this function is in @file{progname.h}.
+@item
+If you want your code to be portable to platforms that do not support
+automatic initialization, call @code{set_relocation_prefix}.
+
@item
Everywhere where you use a constant pathname from installation-time,
wrap it in @code{relocate} so it gets translated to the run-time situation.
@}
# Get some relocated directory names.
+# (The gnulib module 'configmake' can help with this.)
$sysconfdir = relocate("@@sysconfdir@@");
$some_datadir = relocate(@@datadir@@/something");
@end example
endif
@end example
+Also in @file{Makefile.am}, for each library @code{libfoo}, you add:
+
+@example
+libfoo_la_CPPFLAGS = -DIN_LIBRARY
+@end example
+
+(Adjust the suffix @code{la} as necessary if you are not using libtool.)
+
@item
You may also need to add a couple of variable assignments to your
@file{configure.ac}.