gpt4 book ai didi

Automake:构建不安装的共享模块

转载 作者:行者123 更新时间:2023-12-01 01:23:13 29 4
gpt4 key购买 nike

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

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

导致 mywrapper.so 安装到 pkglibdir .
noinst_LTLIBRARIES = mywrapper.la
mywrapper_la_LDFLAGS = -no-undefined -module -avoid-version

导致改为构建静态便利库。

有问题的动态模块仅用于运行测试套件,因此不被分发。

最佳答案

我有同样的问题。这就是我所做的,包括对自己的愤怒评论以供将来引用:

# 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:构建不安装的共享模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8277478/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com