On Wednesday 27 August 2003 16:48, Tom Howard wrote: > On Wednesday 27 August 2003 16:21, Stephen Torri wrote: > > I am trying to build libraries that will act as modules in a program. At > > present when I do a compile its building .la, .so, .so.0.0 and .so.0.0.0 > > files. I am looking for advice on how to setup my Makefile.am file so > > that all I get installed is a .so file. Ideas? > > > > My intention is to search a subdirectory and load modules as required > > into memory. I would like to not have to put into the source code things > > for sorting out which files to load and which to ignore. I would like to > > utilize as much as I can from the development sources like automake > > before requiring source code to handle this problem. > > I'm not an expert so make sure you have a look at the other responses. > They way I handles this in my project was to install the modules into the > pkglibdir and then had a post installation hook that would create a > symbolic link within the module directory to the .la file.
Here are the rules I use to achive this: MODULES: xyz.la abc.la MODULEDIR: modules install-exec-hook: @if ! test -d $(datadir); then rm -f $(datadir); mkdir $(datadir); fi @if ! test -d $(pkgdatadir); then rm -f $(pkgdatadir); mkdir $(pkgdatadir); fi @if ! test -d $(MODULEDIR); then rm -f $(MODULEDIR); mkdir $(MODULEDIR); fi @list='$(MODULES)'; for p in $$list; do \ if test -f $(pkglibdir)/$$p; then \ ln -sf $(pkglibdir)/$$p $(MODULEDIR)/$$p; \ fi; \ done uninstall-local: @list='$(MODULES)'; for p in $$list; do \ rm -f $(MODULEDIR)/$$p; \ done pkglib_LTLIBRARIES = \ ANY_OTHER_LIBS_PKGLIBS \ $(MODULES) This will cause xyz.la and abc.la to be installed/uninstalled into/from $(pkgdatadir)/modules. HTH -- Tom Howard