Fix (and chop) static build option

This sets the scope of the static build option to Wireshark support
libraries only.

Before the patch:

Static plugins don't work with CMake and autotools.

autotools static build is broken, and most likely will always be, as
building Wireshark all-static is difficult and time-consuming.

After the patch:

For CMake Wireshark will be built with static or shared libraries and
dynamic plugins. Everything just works. CMake apparently doesn't want
you building static and shared libraries at the same time.

For autotools Wireshark will be built with shared libraries by default.
--disable-shared and --enable-static options work as usual. Dlopened
plugins are not built if --disable-shared is given to configure (to
disable shared libraries). This is a limitations imposed by libtool.

Tested on Linux. This removes broken support for building plugins
statically.

Change-Id: Ib8e8176976f136eea93a2ce8f9857b6cf9bec64c
Reviewed-on: https://code.wireshark.org/review/24241
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
This commit is contained in:
João Valverde 2017-11-01 20:22:32 +00:00 committed by João Valverde
parent 61bd626d5d
commit 262a84c384
22 changed files with 52 additions and 278 deletions

View File

@ -638,12 +638,8 @@ include(CheckCXXCompilerFlag)
if(ENABLE_STATIC) if(ENABLE_STATIC)
set(BUILD_SHARED_LIBS 0) set(BUILD_SHARED_LIBS 0)
set(LINK_MODE_LIB STATIC)
set(LINK_MODE_MODULE STATIC)
else() else()
set(BUILD_SHARED_LIBS 1) set(BUILD_SHARED_LIBS 1)
set(LINK_MODE_LIB SHARED)
set(LINK_MODE_MODULE MODULE)
endif() endif()
# Sigh: Have to use THIS_FLAG instead of ${F} for some reason # Sigh: Have to use THIS_FLAG instead of ${F} for some reason
@ -1670,7 +1666,6 @@ endif()
set(LIBEPAN_LIBS set(LIBEPAN_LIBS
epan epan
# $(plugin_ldadd) # in case of static
${AIRPCAP_LIBRARIES} ${AIRPCAP_LIBRARIES}
${PCAP_LIBRARIES} ${PCAP_LIBRARIES}
${CARES_LIBRARIES} ${CARES_LIBRARIES}

View File

@ -53,8 +53,7 @@ option(WANT_PACKET_EDITOR "Enable packet editor (experimental)" ON)
if(WIN32) if(WIN32)
option(ENABLE_AIRPCAP "Enable AirPcap support" ON) option(ENABLE_AIRPCAP "Enable AirPcap support" ON)
endif() endif()
# XXX Static build not working option(ENABLE_STATIC "Build Wireshark libraries statically" OFF)
option(ENABLE_STATIC "Build a static version of Wireshark (not yet working)" OFF)
option(ENABLE_PLUGINS "Build with plugins" ON) option(ENABLE_PLUGINS "Build with plugins" ON)
option(ENABLE_PLUGIN_IFDEMO "Build with plugin interface demo" OFF) option(ENABLE_PLUGIN_IFDEMO "Build with plugin interface demo" OFF)
option(ENABLE_EXTCAP "Build with extcap hooks" ON) option(ENABLE_EXTCAP "Build with extcap hooks" ON)

View File

@ -351,22 +351,6 @@ dist_wimaxasncp_DATA = \
wimaxasncp/dictionary.xml \ wimaxasncp/dictionary.xml \
wimaxasncp/dictionary.dtd wimaxasncp/dictionary.dtd
if HAVE_PLUGINS
-include plugins/Custom.make
plugin_ldadd = $(_CUSTOM_plugin_ldadd_) \
-dlopen plugins/docsis/docsis.la \
-dlopen plugins/ethercat/ethercat.la \
-dlopen plugins/gryphon/gryphon.la \
-dlopen plugins/irda/irda.la \
-dlopen plugins/mate/mate.la \
-dlopen plugins/opcua/opcua.la \
-dlopen plugins/profinet/profinet.la \
-dlopen plugins/stats_tree/stats_tree.la \
-dlopen plugins/unistim/unistim.la \
-dlopen plugins/wimax/wimax.la \
-dlopen plugins/wimaxmacphy/wimaxmacphy.la
endif
# "BUILT_SOURCES" are built before any "make all" or "make check" targets. # "BUILT_SOURCES" are built before any "make all" or "make check" targets.
BUILT_HEADER_FILES = \ BUILT_HEADER_FILES = \
version.h version.h
@ -412,12 +396,6 @@ if HAVE_EXTCAP
SHARK_COMMON_SRC += $(EXTCAP_COMMON_SRC) SHARK_COMMON_SRC += $(EXTCAP_COMMON_SRC)
endif endif
if ENABLE_STATIC
EXTRALINKFLAGS = -Wl,-static -all-static
else
EXTRALINKFLAGS = -export-dynamic
endif
EPAN_EXTRA_LIBS = \ EPAN_EXTRA_LIBS = \
@C_ARES_LIBS@ \ @C_ARES_LIBS@ \
@KRB5_LIBS@ \ @KRB5_LIBS@ \
@ -449,7 +427,7 @@ wireshark_SOURCES = $(WIRESHARK_COMMON_SRC) wireshark-qt.cpp
wireshark_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) $(Qt_CFLAGS) wireshark_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) $(Qt_CFLAGS)
wireshark_LDFLAGS = $(AM_LDFLAGS) $(EXTRALINKFLAGS) $(Qt_LDFLAGS) wireshark_LDFLAGS = $(AM_LDFLAGS) $(Qt_LDFLAGS)
wireshark_LDADD = \ wireshark_LDADD = \
ui/qt/libqtui.a \ ui/qt/libqtui.a \
@ -467,7 +445,7 @@ wireshark_gtk_SOURCES = $(WIRESHARK_COMMON_SRC)
wireshark_gtk_CPPFLAGS = $(AM_CPPFLAGS) $(GTK_CFLAGS) wireshark_gtk_CPPFLAGS = $(AM_CPPFLAGS) $(GTK_CFLAGS)
wireshark_gtk_LDFLAGS = $(AM_LDFLAGS) $(EXTRALINKFLAGS) wireshark_gtk_LDFLAGS = $(AM_LDFLAGS)
wireshark_gtk_LDADD = \ wireshark_gtk_LDADD = \
ui/gtk/libgtkui.a \ ui/gtk/libgtkui.a \
@ -484,7 +462,7 @@ tshark_SOURCES = \
tshark_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) tshark_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
tshark_LDFLAGS = $(AM_LDFLAGS) $(EXTRALINKFLAGS) tshark_LDFLAGS = $(AM_LDFLAGS)
# Libraries and plugin flags with which to link tshark. # Libraries and plugin flags with which to link tshark.
tshark_LDADD = \ tshark_LDADD = \
@ -507,7 +485,7 @@ tfshark_SOURCES = \
tfshark_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) tfshark_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
tfshark_LDFLAGS = $(AM_LDFLAGS) $(EXTRALINKFLAGS) tfshark_LDFLAGS = $(AM_LDFLAGS)
# Libraries and plugin flags with which to link tfshark. # Libraries and plugin flags with which to link tfshark.
tfshark_LDADD = \ tfshark_LDADD = \
@ -528,7 +506,7 @@ rawshark_SOURCES = \
rawshark_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) rawshark_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
rawshark_LDFLAGS = $(AM_LDFLAGS) $(EXTRALINKFLAGS) rawshark_LDFLAGS = $(AM_LDFLAGS)
# Libraries and plugin flags with which to link rawshark. # Libraries and plugin flags with which to link rawshark.
rawshark_LDADD = \ rawshark_LDADD = \
@ -556,7 +534,7 @@ if HAVE_SPEEXDSP
sharkd_CPPFLAGS += $(SPEEXDSP_CFLAGS) sharkd_CPPFLAGS += $(SPEEXDSP_CFLAGS)
endif endif
sharkd_LDFLAGS = $(AM_LDFLAGS) $(EXTRALINKFLAGS) sharkd_LDFLAGS = $(AM_LDFLAGS)
# Libraries and plugin flags with which to link sharkd. # Libraries and plugin flags with which to link sharkd.
sharkd_LDADD = \ sharkd_LDADD = \
@ -845,8 +823,10 @@ endif
if HAVE_PLUGINS if HAVE_PLUGINS
if !ENABLE_STATIC
plugins_subdir = plugins plugins_subdir = plugins
endif endif
endif
if HAVE_EXTCAP if HAVE_EXTCAP
extcap_subdir = extcap extcap_subdir = extcap

View File

@ -26,7 +26,7 @@ macro(SET_MODULE_INFO _plugin _ver_major _ver_minor _ver_micro _ver_extra)
endmacro() endmacro()
macro(ADD_PLUGIN_LIBRARY _plugin) macro(ADD_PLUGIN_LIBRARY _plugin)
add_library(${_plugin} ${LINK_MODE_MODULE} add_library(${_plugin} MODULE
${PLUGIN_FILES} ${PLUGIN_FILES}
${CMAKE_CURRENT_BINARY_DIR}/plugin.rc ${CMAKE_CURRENT_BINARY_DIR}/plugin.rc
) )

View File

@ -35,7 +35,7 @@
/* Define to 1 if we check hf conflict */ /* Define to 1 if we check hf conflict */
#cmakedefine ENABLE_CHECK_FILTER 1 #cmakedefine ENABLE_CHECK_FILTER 1
/* Link plugins statically into Wireshark */ /* Link Wireshark libraries statically */
#cmakedefine ENABLE_STATIC 1 #cmakedefine ENABLE_STATIC 1
/* Enable AirPcap */ /* Enable AirPcap */

View File

@ -61,7 +61,7 @@ if(HAVE_BCG729)
list(APPEND wscodecs_LIBS ${BCG729_LIBRARIES}) list(APPEND wscodecs_LIBS ${BCG729_LIBRARIES})
endif() endif()
add_library(wscodecs ${LINK_MODE_LIB} add_library(wscodecs
${WSCODECS_FILES} ${WSCODECS_FILES}
${CMAKE_BINARY_DIR}/image/libwscodecs.rc ${CMAKE_BINARY_DIR}/image/libwscodecs.rc
) )
@ -84,18 +84,16 @@ endif()
target_link_libraries(wscodecs ${wscodecs_LIBS}) target_link_libraries(wscodecs ${wscodecs_LIBS})
if(NOT ${ENABLE_STATIC}) install(TARGETS wscodecs
install(TARGETS wscodecs
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
) )
if(NOT WIN32) if(NOT WIN32)
install(FILES ${WSCODECS_PUBLIC_HEADERS} install(FILES ${WSCODECS_PUBLIC_HEADERS}
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${CPACK_PACKAGE_NAME}/codecs" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${CPACK_PACKAGE_NAME}/codecs"
) )
endif()
endif() endif()
CHECKAPI( CHECKAPI(

View File

@ -65,7 +65,7 @@ AC_DEFINE_UNQUOTED(VERSION_FLAVOR,
["${WIRESHARK_VERSION_FLAVOR:-"Development Build"}"], [Wireshark's package flavor]) ["${WIRESHARK_VERSION_FLAVOR:-"Development Build"}"], [Wireshark's package flavor])
LT_PREREQ([2.2.2]) LT_PREREQ([2.2.2])
LT_INIT([disable-static dlopen]) LT_INIT([disable-static])
AC_SUBST([LIBTOOL_DEPS]) AC_SUBST([LIBTOOL_DEPS])
AC_CONFIG_LIBOBJ_DIR([wsutil]) AC_CONFIG_LIBOBJ_DIR([wsutil])
@ -2649,11 +2649,10 @@ AC_SUBST(udpdump_bin)
AC_SUBST(udpdump_man) AC_SUBST(udpdump_man)
AM_CONDITIONAL(ENABLE_STATIC, test x$enable_static = xyes) AM_CONDITIONAL(ENABLE_STATIC, test x$enable_static = xyes)
if test x$enable_static = xyes -a x$have_plugins = xyes if test x$enable_static = xyes
then then
AC_DEFINE(ENABLE_STATIC, 1, [Link plugins statically into Wireshark]) AC_DEFINE(ENABLE_STATIC, 1, [Link Wireshark libraries statically])
fi fi
AC_SUBST(ENABLE_STATIC)
# Gather which GUI we're building for rpmbuild # Gather which GUI we're building for rpmbuild
if test "x$have_gtk" = "xyes"; then if test "x$have_gtk" = "xyes"; then

View File

@ -52,11 +52,7 @@ A small example of a very basic stats_tree plugin follows.
#include "config.h" #include "config.h"
#ifndef ENABLE_STATIC
#include <gmodule.h> #include <gmodule.h>
#else
#include <glib.h>
#endif
#include <epan/stats_tree.h> #include <epan/stats_tree.h>
#include <epan/dissectors/udp.h> #include <epan/dissectors/udp.h>
@ -94,7 +90,6 @@ extern int udp_term_stats_tree_packet(stats_tree *st, /* st as it was passed to
return 1; return 1;
} }
#ifndef ENABLE_STATIC
WS_DLL_PUBLIC_DEF const gchar version[] = "0.0"; WS_DLL_PUBLIC_DEF const gchar version[] = "0.0";
WS_DLL_PUBLIC_DEF void plugin_register_tap_listener(void) { WS_DLL_PUBLIC_DEF void plugin_register_tap_listener(void) {
@ -108,7 +103,6 @@ WS_DLL_PUBLIC_DEF void plugin_register_tap_listener(void) {
NULL ); /* the cleanup callback (in this case there isn't) */ NULL ); /* the cleanup callback (in this case there isn't) */
} }
#endif
----- END ------ ----- END ------

View File

@ -310,7 +310,7 @@ if(HAVE_LIBLUA)
else() else()
set(wslua_sources) set(wslua_sources)
endif() endif()
add_library(epan ${LINK_MODE_LIB} add_library(epan
${LIBWIRESHARK_FILES} ${LIBWIRESHARK_FILES}
${GENERATED_FILES} ${GENERATED_FILES}
$<TARGET_OBJECTS:crypt> $<TARGET_OBJECTS:crypt>
@ -392,13 +392,11 @@ target_link_libraries(epan ${epan_LIBS})
add_dependencies(epan lemon) add_dependencies(epan lemon)
if(NOT ${ENABLE_STATIC}) install(TARGETS epan
install(TARGETS epan
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
) )
endif()
if(NOT WIN32) if(NOT WIN32)
install(FILES ${LIBWIRESHARK_PUBLIC_HEADERS} install(FILES ${LIBWIRESHARK_PUBLIC_HEADERS}

View File

@ -431,131 +431,6 @@ tvbtest.o exntest.o oids_test.o: exceptions.h
ps.c: print.ps $(top_srcdir)/tools/rdps.py ps.c: print.ps $(top_srcdir)/tools/rdps.py
$(AM_V_python)$(PYTHON) $(top_srcdir)/tools/rdps.py $(srcdir)/print.ps ps.c $(AM_V_python)$(PYTHON) $(top_srcdir)/tools/rdps.py $(srcdir)/print.ps ps.c
if HAVE_PLUGINS
if ENABLE_STATIC
-include ../plugins/Custom.make
plugin_src = \
../plugins/docsis/packet-docsis.c \
../plugins/docsis/packet-macmgmt.c \
../plugins/docsis/packet-tlv.c \
../plugins/docsis/packet-vendor.c \
../plugins/docsis/plugin.c \
../plugins/ethercat/packet-ams.c \
../plugins/ethercat/packet-ecatmb.c \
../plugins/ethercat/packet-esl.c \
../plugins/ethercat/packet-ethercat-datagram.c \
../plugins/ethercat/packet-ethercat-frame.c \
../plugins/ethercat/packet-ioraw.c \
../plugins/ethercat/packet-nv.c \
../plugins/ethercat/plugin.c \
../plugins/gryphon/packet-gryphon.c \
../plugins/gryphon/plugin.c \
../plugins/irda/packet-ircomm.c \
../plugins/irda/packet-irda.c \
../plugins/irda/packet-sir.c \
../plugins/irda/plugin.c \
../plugins/Makefile.am.inc \
../plugins/mate/mate_grammar.c \
../plugins/mate/mate_parser.c \
../plugins/mate/mate_runtime.c \
../plugins/mate/mate_setup.c \
../plugins/mate/mate_util.c \
../plugins/mate/packet-mate.c \
../plugins/mate/plugin.c \
../plugins/opcua/opcua_application_layer.c \
../plugins/opcua/opcua.c \
../plugins/opcua/opcua_complextypeparser.c \
../plugins/opcua/opcua_enumparser.c \
../plugins/opcua/opcua_extensionobjecttable.c \
../plugins/opcua/opcua_hfindeces.c \
../plugins/opcua/opcua_security_layer.c \
../plugins/opcua/opcua_serviceparser.c \
../plugins/opcua/opcua_servicetable.c \
../plugins/opcua/opcua_simpletypes.c \
../plugins/opcua/opcua_statuscode.c \
../plugins/opcua/opcua_transport_layer.c \
../plugins/opcua/plugin.c \
../plugins/pluginifdemo/pluginifdemo.c \
../plugins/profinet/packet-dcerpc-pn-io.c \
../plugins/profinet/packet-dcom-cba-acco.c \
../plugins/profinet/packet-dcom-cba.c \
../plugins/profinet/packet-pn.c \
../plugins/profinet/packet-pn-dcp.c \
../plugins/profinet/packet-pn-mrp.c \
../plugins/profinet/packet-pn-mrrt.c \
../plugins/profinet/packet-pn-ptcp.c \
../plugins/profinet/packet-pn-rt.c \
../plugins/profinet/packet-pn-rtc-one.c \
../plugins/profinet/plugin.c \
../plugins/stats_tree/pinfo_stats_tree.c \
../plugins/stats_tree/stats_tree_plugin.c \
../plugins/transum/decoders.c \
../plugins/transum/extractors.c \
../plugins/transum/packet-transum.c \
../plugins/transum/plugin.c \
../plugins/unistim/packet-unistim.c \
../plugins/unistim/plugin.c \
../plugins/wimaxasncp/packet-wimaxasncp.c \
../plugins/wimaxasncp/plugin.c \
../plugins/wimaxasncp/wimaxasncp_dict.c \
../plugins/wimax/crc.c \
../plugins/wimax/crc_data.c \
../plugins/wimax/mac_hd_generic_decoder.c \
../plugins/wimax/mac_hd_type1_decoder.c \
../plugins/wimax/mac_hd_type2_decoder.c \
../plugins/wimax/mac_mgmt_msg_decoder.c \
../plugins/wimaxmacphy/packet-wimaxmacphy.c \
../plugins/wimaxmacphy/plugin.c \
../plugins/wimax/msg_aas_beam.c \
../plugins/wimax/msg_aas_fbck.c \
../plugins/wimax/msg_arq.c \
../plugins/wimax/msg_clk_cmp.c \
../plugins/wimax/msg_dcd.c \
../plugins/wimax/msg_dlmap.c \
../plugins/wimax/msg_dreg.c \
../plugins/wimax/msg_dsa.c \
../plugins/wimax/msg_dsc.c \
../plugins/wimax/msg_dsd.c \
../plugins/wimax/msg_dsx_rvd.c \
../plugins/wimax/msg_fpc.c \
../plugins/wimax/msg_pkm.c \
../plugins/wimax/msg_pmc.c \
../plugins/wimax/msg_prc_lt_ctrl.c \
../plugins/wimax/msg_reg_req.c \
../plugins/wimax/msg_reg_rsp.c \
../plugins/wimax/msg_rep.c \
../plugins/wimax/msg_res_cmd.c \
../plugins/wimax/msg_rng_req.c \
../plugins/wimax/msg_rng_rsp.c \
../plugins/wimax/msg_sbc.c \
../plugins/wimax/msg_ucd.c \
../plugins/wimax/msg_ulmap.c \
../plugins/wimax/packet-wmx.c \
../plugins/wimax/plugin.c \
../plugins/wimax/wimax_cdma_code_decoder.c \
../plugins/wimax/wimax_compact_dlmap_ie_decoder.c \
../plugins/wimax/wimax_compact_ulmap_ie_decoder.c \
../plugins/wimax/wimax_fch_decoder.c \
../plugins/wimax/wimax_ffb_decoder.c \
../plugins/wimax/wimax_hack_decoder.c \
../plugins/wimax/wimax_harq_map_decoder.c \
../plugins/wimax/wimax_pdu_decoder.c \
../plugins/wimax/wimax_phy_attributes_decoder.c \
../plugins/wimax/wimax_tlv.c \
../plugins/wimax/wimax_utils.c
else # ENABLE_STATIC
plugin_src =
endif # ENABLE_STATIC
else # HAVE_PLUGINS
plugin_src =
endif # HAVE_PLUGINS
doxygen: doxygen:
if HAVE_DOXYGEN if HAVE_DOXYGEN
$(AM_V_GEN)$(DOXYGEN) doxygen.cfg $(AM_V_GEN)$(DOXYGEN) doxygen.cfg

View File

@ -1946,7 +1946,7 @@ x11-dissector: $(top_srcdir)/tools/process-x11-fields.pl $(srcdir)/x11-fields $(
# a dissectors.c file for libwireshark. # a dissectors.c file for libwireshark.
# All subsequent arguments are the files to scan. # All subsequent arguments are the files to scan.
# #
dissectors.c: $(plugin_src) $(ALL_DISSECTORS_SRC) Custom.common \ dissectors.c: $(ALL_DISSECTORS_SRC) Custom.common \
$(top_srcdir)/tools/make-dissector-reg.py $(top_srcdir)/tools/make-dissector-reg.py
@echo Making dissectors.c ; \ @echo Making dissectors.c ; \
$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \ $(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \

View File

@ -27,12 +27,6 @@ androiddump_SOURCES = \
androiddump.c \ androiddump.c \
extcap-base.c extcap-base.c
if ENABLE_STATIC
androiddump_LDFLAGS = -Wl,-static -all-static
else
androiddump_LDFLAGS = -export-dynamic
endif
# Libraries and plugin flags with which to link androiddump. # Libraries and plugin flags with which to link androiddump.
androiddump_LDADD = \ androiddump_LDADD = \
../ui/libui.a \ ../ui/libui.a \
@ -44,12 +38,6 @@ randpktdump_SOURCES = \
randpktdump.c \ randpktdump.c \
extcap-base.c extcap-base.c
if ENABLE_STATIC
randpktdump_LDFLAGS = -Wl,-static -all-static
else
randpktdump_LDFLAGS = -export-dynamic
endif
# Libraries and plugin flags with which to link randpktdump. # Libraries and plugin flags with which to link randpktdump.
randpktdump_LDADD = \ randpktdump_LDADD = \
../randpkt_core/librandpkt_core.a \ ../randpkt_core/librandpkt_core.a \
@ -63,12 +51,6 @@ sshdump_SOURCES = \
extcap-base.c \ extcap-base.c \
ssh-base.c ssh-base.c
if ENABLE_STATIC
sshdump_LDFLAGS = -Wl,-static -all-static
else
sshdump_LDFLAGS = -export-dynamic
endif
# Libraries and plugin flags with which to link sshdump. # Libraries and plugin flags with which to link sshdump.
sshdump_LDADD = \ sshdump_LDADD = \
../wiretap/libwiretap.la \ ../wiretap/libwiretap.la \
@ -81,12 +63,6 @@ ciscodump_SOURCES = \
extcap-base.c \ extcap-base.c \
ssh-base.c ssh-base.c
if ENABLE_STATIC
ciscodump_LDFLAGS = -Wl,-static -all-static
else
ciscodump_LDFLAGS = -export-dynamic
endif
# Libraries and plugin flags with which to link ciscodump. # Libraries and plugin flags with which to link ciscodump.
ciscodump_LDADD = \ ciscodump_LDADD = \
../writecap/libwritecap.a \ ../writecap/libwritecap.a \
@ -98,12 +74,6 @@ udpdump_SOURCES = \
udpdump.c \ udpdump.c \
extcap-base.c extcap-base.c
if ENABLE_STATIC
udpdump_LDFLAGS = -Wl,-static -all-static
else
udpdump_LDFLAGS = -export-dynamic
endif
# Libraries and plugin flags with which to link udpdump. # Libraries and plugin flags with which to link udpdump.
udpdump_LDADD = \ udpdump_LDADD = \
../writecap/libwritecap.a \ ../writecap/libwritecap.a \

View File

@ -129,11 +129,6 @@ if(VCREDIST_EXE)
message(STATUS "Using ${VCREDIST_EXE} for the installer") message(STATUS "Using ${VCREDIST_EXE} for the installer")
endif() endif()
if(NOT ENABLE_STATIC)
# XXX Replace ENABLE_LIBWIRESHARK with !ENABLE_STATIC everywhere.
set(ENABLE_LIBWIRESHARK 1)
endif()
# Ideally we would generate this at compile time using a separate cmake # Ideally we would generate this at compile time using a separate cmake
# module, e.g. cmake/modules/configure_nsis_file.cmake. However we would # module, e.g. cmake/modules/configure_nsis_file.cmake. However we would
# have to figure out a clean way to pass in the variables above. # have to figure out a clean way to pass in the variables above.

View File

@ -27,8 +27,6 @@
!define MSVCR_DLL "@MSVCR_DLL@" !define MSVCR_DLL "@MSVCR_DLL@"
!define VCREDIST_EXE "@VCREDIST_EXE@" !define VCREDIST_EXE "@VCREDIST_EXE@"
!define ENABLE_LIBWIRESHARK @ENABLE_LIBWIRESHARK@
!define USER_GUIDE_DIR "@USER_GUIDE_DIR@" !define USER_GUIDE_DIR "@USER_GUIDE_DIR@"
!define SMI_DIR "@SMI_DIR@" !define SMI_DIR "@SMI_DIR@"

View File

@ -422,9 +422,7 @@ SetShellVarContext all
SetOutPath $INSTDIR SetOutPath $INSTDIR
File "${STAGING_DIR}\${UNINSTALLER_NAME}" File "${STAGING_DIR}\${UNINSTALLER_NAME}"
File "${STAGING_DIR}\libwiretap.dll" File "${STAGING_DIR}\libwiretap.dll"
!ifdef ENABLE_LIBWIRESHARK
File "${STAGING_DIR}\libwireshark.dll" File "${STAGING_DIR}\libwireshark.dll"
!endif
File "${STAGING_DIR}\libwscodecs.dll" File "${STAGING_DIR}\libwscodecs.dll"
File "${STAGING_DIR}\libwsutil.dll" File "${STAGING_DIR}\libwsutil.dll"

View File

@ -123,11 +123,6 @@ find_path(MERGE_MODULE_DIR ${MERGE_MODULE}
message(STATUS "Using ${MERGE_MODULE_DIR}/Microsoft_${MSVC_CRT_VERSION}_CRT_${TARGET_MACHINE}.msm for the installer") message(STATUS "Using ${MERGE_MODULE_DIR}/Microsoft_${MSVC_CRT_VERSION}_CRT_${TARGET_MACHINE}.msm for the installer")
if(NOT ENABLE_STATIC)
# XXX Replace ENABLE_LIBWIRESHARK with !ENABLE_STATIC everywhere.
set(ENABLE_LIBWIRESHARK "-dENABLE_LIBWIRESHARK")
endif()
# DependentComponents.wxi. Can be created at configure time. # DependentComponents.wxi. Can be created at configure time.
set(_all_manifest_wix "${CMAKE_CURRENT_BINARY_DIR}/DependentComponents.wxs") set(_all_manifest_wix "${CMAKE_CURRENT_BINARY_DIR}/DependentComponents.wxs")
file(WRITE "${_all_manifest_wix}" "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n") file(WRITE "${_all_manifest_wix}" "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n")
@ -321,7 +316,6 @@ set(WIX_CANDLE_DEFINES
-dVCRedistDir=${MERGE_MODULE_DIR} -dVCRedistDir=${MERGE_MODULE_DIR}
${use_gtk} ${use_gtk}
${use_smi} ${use_smi}
${ENABLE_LIBWIRESHARK}
-arch ${TARGET_MACHINE} -arch ${TARGET_MACHINE}
-ext WixUIExtension -ext WixUIExtension
-I${CMAKE_SOURCE_DIR}/packaging/wix -I${CMAKE_SOURCE_DIR}/packaging/wix

View File

@ -21,11 +21,9 @@
<Component Id="cmpWiretap_dll" Guid="*"> <Component Id="cmpWiretap_dll" Guid="*">
<File Id="filWiretap_dll" KeyPath="yes" Source="$(var.Staging.Dir)\libwiretap.dll" /> <File Id="filWiretap_dll" KeyPath="yes" Source="$(var.Staging.Dir)\libwiretap.dll" />
</Component> </Component>
<?ifdef ENABLE_LIBWIRESHARK?>
<Component Id="cmpLibwireshark_dll" Guid="*"> <Component Id="cmpLibwireshark_dll" Guid="*">
<File Id="filLibwireshark_dll" KeyPath="yes" Source="$(var.Staging.Dir)\libwireshark.dll" /> <File Id="filLibwireshark_dll" KeyPath="yes" Source="$(var.Staging.Dir)\libwireshark.dll" />
</Component> </Component>
<?endif?>
<Component Id="cmpLibwscodecs_dll" Guid="*"> <Component Id="cmpLibwscodecs_dll" Guid="*">
<File Id="filLibwscodecs_dll" KeyPath="yes" Source="$(var.Staging.Dir)\libwscodecs.dll" /> <File Id="filLibwscodecs_dll" KeyPath="yes" Source="$(var.Staging.Dir)\libwscodecs.dll" />
</Component> </Component>
@ -85,9 +83,7 @@
<Fragment> <Fragment>
<ComponentGroup Id="CG.WiresharkRequired"> <ComponentGroup Id="CG.WiresharkRequired">
<ComponentRef Id="cmpWiretap_dll" /> <ComponentRef Id="cmpWiretap_dll" />
<?ifdef ENABLE_LIBWIRESHARK?>
<ComponentRef Id="cmpLibwireshark_dll" /> <ComponentRef Id="cmpLibwireshark_dll" />
<?endif?>
<ComponentRef Id="cmpLibwscodecs_dll" /> <ComponentRef Id="cmpLibwscodecs_dll" />
<ComponentRef Id="cmpLibwsutil_dll" /> <ComponentRef Id="cmpLibwsutil_dll" />
<ComponentRef Id="cmpCOPYING_txt" /> <ComponentRef Id="cmpCOPYING_txt" />

View File

@ -28,12 +28,8 @@
#include "config.h" #include "config.h"
#ifndef ENABLE_STATIC
#include "moduleinfo.h" #include "moduleinfo.h"
#include <gmodule.h> #include <gmodule.h>
#else
#include <glib.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>

View File

@ -21,7 +21,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#ifndef ENABLE_STATIC
#include "config.h" #include "config.h"
#include <gmodule.h> #include <gmodule.h>
@ -42,8 +41,6 @@ WS_DLL_PUBLIC_DEF void plugin_register_tap_listener(void)
register_pinfo_stat_trees(); register_pinfo_stat_trees();
} }
#endif
/* /*
* Editor modelines - http://www.wireshark.org/tools/modelines.html * Editor modelines - http://www.wireshark.org/tools/modelines.html
* *

View File

@ -201,7 +201,6 @@ if registertype == "plugin" or registertype == "plugin_wtap":
#define WS_BUILD_DLL #define WS_BUILD_DLL
#include "ws_symbol_export.h" #include "ws_symbol_export.h"
#ifndef ENABLE_STATIC
WS_DLL_PUBLIC_DEF void plugin_register (void); WS_DLL_PUBLIC_DEF void plugin_register (void);
WS_DLL_PUBLIC_DEF const gchar plugin_version[] = VERSION; WS_DLL_PUBLIC_DEF const gchar plugin_version[] = VERSION;
@ -236,9 +235,7 @@ plugin_reg_handoff(void)
reg_code += " %s();\n" % (symbol) reg_code += " %s();\n" % (symbol)
reg_code += "}\n" reg_code += "}\n"
if registertype == "plugin": if registertype == "plugin_wtap":
reg_code += "#endif\n"
elif registertype == "plugin_wtap":
reg_code += """ reg_code += """
WS_DLL_PUBLIC_DEF void WS_DLL_PUBLIC_DEF void
register_wtap_module(void) register_wtap_module(void)
@ -248,7 +245,6 @@ register_wtap_module(void)
reg_code += " {extern void %s (void); %s ();}\n" % (symbol, symbol) reg_code += " {extern void %s (void); %s ();}\n" % (symbol, symbol)
reg_code += """ reg_code += """
} }
#endif
""" """
else: else:

View File

@ -115,7 +115,7 @@ set(wiretap_LIBS
wsutil wsutil
) )
add_library(wiretap ${LINK_MODE_LIB} add_library(wiretap
${WIRETAP_FILES} ${WIRETAP_FILES}
${GENERATED_FILES} ${GENERATED_FILES}
${CMAKE_BINARY_DIR}/image/wiretap.rc ${CMAKE_BINARY_DIR}/image/wiretap.rc
@ -153,18 +153,16 @@ add_custom_command(OUTPUT libwiretap.abi.tar.gz
target_link_libraries(wiretap ${wiretap_LIBS}) target_link_libraries(wiretap ${wiretap_LIBS})
if(NOT ${ENABLE_STATIC}) install(TARGETS wiretap
install(TARGETS wiretap
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
) )
if(NOT WIN32) if(NOT WIN32)
install(FILES ${WIRETAP_PUBLIC_HEADERS} install(FILES ${WIRETAP_PUBLIC_HEADERS}
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${CPACK_PACKAGE_NAME}/wiretap" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${CPACK_PACKAGE_NAME}/wiretap"
) )
endif()
endif() endif()
CHECKAPI( CHECKAPI(

View File

@ -260,7 +260,7 @@ if (HAVE_SSE4_2)
) )
endif() endif()
add_library(wsutil ${LINK_MODE_LIB} add_library(wsutil
${WSUTIL_FILES} ${WSUTIL_FILES}
${CMAKE_BINARY_DIR}/image/libwsutil.rc ${CMAKE_BINARY_DIR}/image/libwsutil.rc
) )
@ -295,13 +295,11 @@ add_custom_command(OUTPUT libwsutil.abi.tar.gz
target_link_libraries(wsutil ${wsutil_LIBS}) target_link_libraries(wsutil ${wsutil_LIBS})
if(NOT ${ENABLE_STATIC}) install(TARGETS wsutil
install(TARGETS wsutil
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
) )
endif()
if(NOT WIN32) if(NOT WIN32)
install(FILES ${WSUTIL_PUBLIC_HEADERS} install(FILES ${WSUTIL_PUBLIC_HEADERS}