Automake: creating a common module that should not be installed

How do I tell Automake to create a dynamic module that will not be installed?

pkglib_LTLIBRARIES = mywrapper.la mywrapper_la_LDFLAGS = -no-undefined -module -avoid-version 

causes mywrapper.so to be installed on pkglibdir .

 noinst_LTLIBRARIES = mywrapper.la mywrapper_la_LDFLAGS = -no-undefined -module -avoid-version 

creates a static convenience library instead.

The dynamic module under consideration is used only to run a set of tests and, therefore, it cannot be distributed.

+4
source share
2 answers

I had the same problem. This is what I did, including a piercing comment on myself for future reference:

 # The rpath is necessary because stoopid libtool won't build a shared library # if it noinst_, because what POSSIBLE reason could you have to do that? TEST_PLUGIN_LIBTOOL_FLAGS = \ -module \ -shared \ -avoid-version \ -export-symbols-regex "<whatever symbols you need to export>" \ -rpath $(abs_builddir) noinst_LTLIBRARIES = mywrapper.la mywrapper_la_LDFLAGS = $(TEST_PLUGIN_LIBTOOL_FLAGS) 
+3
source

You can use check_LTLIBRARIES , which is intended for testing purposes. According to Automake Unified Naming Scheme :

The special prefix "check_" indicates that the objects in question should not be created until the make make command is executed. Those objects are also not installed.

It also generates a default static library. I managed to get it like this:

 check_LTLIBRARIES = mywrapper.la mywrapper_la_LDFLAGS = -no-undefined -module -shared -avoid-version -rpath /tmp 

You can also compile and run the test suite executable.

 check_PROGRAMS = suite suite_SOURCES = ... suite_LDFLAGS = ... suite_LDADD = ... check-local: ./suite 
+1
source

Source: https://habr.com/ru/post/1383170/


All Articles