Makefile.am 中的 -export-symbols 未生成 .sym
我正在尝试通过编辑 Wireshark 的 Makefile.am 创建一个“libtshark”来构建一个共享库...为此,我正在尝试构建一个 tshark_lib.c ,它与 tshark.c 相同,但删除了 main()它的。
因此,我编辑了 Makefile.am 以包含以下内容,以尝试构建共享 libtshark 库:
lib_LTLIBRARIES = libtshark.la
libtshark_la_LDFLAGS = -version-info 0:1:0 -export-symbols libtshark.sym @LDFLAGS_SHAREDLIB@
libtshark_la_SOURCES = \
$(WIRESHARK_COMMON_SRC) \
$(SHARK_COMMON_CAPTURE_SRC) \
$(TSHARK_TAP_SRC) \
capture_opts.c \
capture_sync.c \
tempfile.c \
tshark-tap-register.c \
tshark_lib.c
# Libraries and plugin flags with which to link tshark.
libtshark_la_LIBADD = \
wiretap/libwiretap.la \
epan/libwireshark.la \
wsutil/libwsutil.la \
@SSL_LIBS@ \
$(plugin_ldadd) \
@PCRE_LIBS@ \
@GLIB_LIBS@ -lm \
@PCAP_LIBS@ \
@SOCKET_LIBS@ \
@NSL_LIBS@ \
@C_ARES_LIBS@ \
@ADNS_LIBS@ \
@KRB5_LIBS@ \
@CORESERVICES_FRAMEWORKS@ \
@LIBGCRYPT_LIBS@ \
@LIBGNUTLS_LIBS@ \
@LIBSMI_LDFLAGS@
#tshark_CFLAGS = $(AM_CLEAN_CFLAGS) $(py_dissectors_dir)
libtshark_la_DEPENDENCIES = \
${top_builddir}/epan/libwireshark.la \
${top_builddir}/wsutil/libwsutil.la \
${top_builddir}/wiretap/libwiretap.la \
libtshark.sym
但是,当我现在尝试构建代码时,我收到以下错误:
make[2]: *** No rule to make target `libtshark.sym', needed by `libtshark.la'. Stop.
出于某种原因,它没有使用我的“libtshark_la_LDFLAGS”,其中包含“-export-symbols libtshark.sym”...有人知道我可能会丢失什么吗?
这是整个 Makefile.am,对于 stackoverflow 来说太长了: Makefile.am
I am trying to build a shared library by editing Wireshark's Makefile.am to create a "libtshark" ... to do this, I am trying to build a tshark_lib.c which is the same as tshark.c with main() stripped out of it.
So I have edited Makefile.am to include include the following in an attempt to build the shared libtshark library:
lib_LTLIBRARIES = libtshark.la
libtshark_la_LDFLAGS = -version-info 0:1:0 -export-symbols libtshark.sym @LDFLAGS_SHAREDLIB@
libtshark_la_SOURCES = \
$(WIRESHARK_COMMON_SRC) \
$(SHARK_COMMON_CAPTURE_SRC) \
$(TSHARK_TAP_SRC) \
capture_opts.c \
capture_sync.c \
tempfile.c \
tshark-tap-register.c \
tshark_lib.c
# Libraries and plugin flags with which to link tshark.
libtshark_la_LIBADD = \
wiretap/libwiretap.la \
epan/libwireshark.la \
wsutil/libwsutil.la \
@SSL_LIBS@ \
$(plugin_ldadd) \
@PCRE_LIBS@ \
@GLIB_LIBS@ -lm \
@PCAP_LIBS@ \
@SOCKET_LIBS@ \
@NSL_LIBS@ \
@C_ARES_LIBS@ \
@ADNS_LIBS@ \
@KRB5_LIBS@ \
@CORESERVICES_FRAMEWORKS@ \
@LIBGCRYPT_LIBS@ \
@LIBGNUTLS_LIBS@ \
@LIBSMI_LDFLAGS@
#tshark_CFLAGS = $(AM_CLEAN_CFLAGS) $(py_dissectors_dir)
libtshark_la_DEPENDENCIES = \
${top_builddir}/epan/libwireshark.la \
${top_builddir}/wsutil/libwsutil.la \
${top_builddir}/wiretap/libwiretap.la \
libtshark.sym
However, when I try to build the code now, I get the following error:
make[2]: *** No rule to make target `libtshark.sym', needed by `libtshark.la'. Stop.
For some reason, it is not using my 'libtshark_la_LDFLAGS' which contains '-export-symbols libtshark.sym' ... does anyone know what I might be missing?
Here is the entire Makefile.am, which is too long for stackoverflow: Makefile.am
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明,.sym 文件是由wireshark 脚本预先生成的,以确定要导出哪些符号。
it turns out that the .sym file is pre-generated by wireshark scripts to determine which symbols to export.