Automake:构建不安装的共享模块 [英] Automake: building shared module which is not to be installed

查看:66
本文介绍了Automake:构建不安装的共享模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何告诉Automake构建不安装的动态模块?

How to tell Automake to build a dynamic module which is not to be installed?

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

导致将mywrapper.so安装到pkglibdir.

causes mywrapper.so to be installed to pkglibdir.

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

导致构建 static 便捷库.

该动态模块仅用于运行测试套件,因此不能分发.

The dynamic module in question is only used to run a test suite, and hence is not to be distributed.

推荐答案

我遇到了同样的问题.这是我所做的,包括对自己的深刻评论,以供将来参考:

I had the same problem. This is what I did, including the peeved comment to myself for future reference:

# The rpath is necessary because stoopid libtool won't build a shared library
# if it's 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)

这篇关于Automake:构建不安装的共享模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆