diff options
author | Jörg Mayer <jmayer@loplof.de> | 2009-11-17 11:58:36 +0000 |
---|---|---|
committer | Jörg Mayer <jmayer@loplof.de> | 2009-11-17 11:58:36 +0000 |
commit | d2cc318f4fc184a3de6038d1492896ec6bfb5f79 (patch) | |
tree | c635034c45104971ecf947a800fa3815dc2671a2 | |
parent | 9c06ca976e94c1a89fbc28fa3930966b395ff07c (diff) |
Beginnings of enabling static builds. Still to do:
* Add -static
* Registration may need different handling
* Add plugins
* Build error in wslua
svn path=/trunk/; revision=30987
-rw-r--r-- | CMakeLists.txt | 12 | ||||
-rw-r--r-- | epan/CMakeLists.txt | 14 | ||||
-rw-r--r-- | plugins/asn1/CMakeLists.txt | 2 | ||||
-rw-r--r-- | plugins/docsis/CMakeLists.txt | 2 | ||||
-rw-r--r-- | plugins/ethercat/CMakeLists.txt | 2 | ||||
-rw-r--r-- | plugins/giop/CMakeLists.txt | 8 | ||||
-rw-r--r-- | plugins/gryphon/CMakeLists.txt | 2 | ||||
-rw-r--r-- | plugins/irda/CMakeLists.txt | 2 | ||||
-rw-r--r-- | plugins/m2m/CMakeLists.txt | 2 | ||||
-rw-r--r-- | plugins/mate/CMakeLists.txt | 2 | ||||
-rw-r--r-- | plugins/opcua/CMakeLists.txt | 2 | ||||
-rw-r--r-- | plugins/profinet/CMakeLists.txt | 2 | ||||
-rw-r--r-- | plugins/sercosiii/CMakeLists.txt | 2 | ||||
-rw-r--r-- | plugins/stats_tree/CMakeLists.txt | 2 | ||||
-rw-r--r-- | plugins/tpg/CMakeLists.txt | 2 | ||||
-rw-r--r-- | plugins/unistim/CMakeLists.txt | 2 | ||||
-rw-r--r-- | plugins/wimax/CMakeLists.txt | 2 | ||||
-rw-r--r-- | plugins/wimaxasncp/CMakeLists.txt | 2 | ||||
-rw-r--r-- | wiretap/CMakeLists.txt | 14 | ||||
-rw-r--r-- | wsutil/CMakeLists.txt | 14 |
20 files changed, 52 insertions, 40 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e32035f9f..8e5848f59e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,8 +36,6 @@ INCLUDE(UseMakeTapReg) # Disable this later. Alternative: "make VERBOSE=1" set(CMAKE_VERBOSE_MAKEFILE ON) -set(BUILD_SHARED_LIBS ON) - #Defines CMAKE_INSTALL_BINDIR, CMAKE_INSTALL_DATADIR, etc ... include(CMakeInstallDirs) @@ -71,8 +69,7 @@ option(AUTOGEN_pidl "Autogenerate pidl dissectors" OFF) option(DISABLE_WERROR "Do not treat Warnings as errors" OFF) option(ENABLE_EXTRA_GCC_CHECKS "Do additional -W checks in GCC (disables -Werror)" OFF) option(ENABLE_AIRPCAP "Enable Airpcap support" ON) -# todo -option(ENABLE_STATIC "Build a static version of Wireshark (not implemented)" OFF) +option(ENABLE_STATIC "Build a static version of Wireshark (not yet working)" OFF) option(ENABLE_PLUGINS "Build with plugins" ON) # todo option(ENABLE_GUIDES "Build Guides (not yet implemented)" OFF) @@ -183,6 +180,13 @@ endif() # AC_WIRESHARK_GCC_LDFLAGS_CHECK([-fwhopr]) # AC_WIRESHARK_GCC_LDFLAGS_CHECK([-fwhole-program]) +if(ENABLE_STATIC) + set(LINK_MODE_LIB STATIC) + set(LINK_MODE_MODULE STATIC) +else() + set(LINK_MODE_LIB SHARED) + set(LINK_MODE_MODULE MODULE) +endif() #The minimum package list set(PACKAGELIST GLIB2 PCAP M LEX YACC Perl SH PythonInterp HtmlViewer ${PACKAGELIST}) diff --git a/epan/CMakeLists.txt b/epan/CMakeLists.txt index d452f423c8..42692d6f68 100644 --- a/epan/CMakeLists.txt +++ b/epan/CMakeLists.txt @@ -1253,7 +1253,7 @@ if (WERROR) ) endif() -add_library(epan SHARED +add_library(epan ${LINK_MODE_LIB} # Needed to trigger build of the include files for x11 #x11-declarations.h #x11-register-info.h @@ -1279,9 +1279,11 @@ target_link_libraries(epan ${epan_LIBS}) add_dependencies(epan lemon) -install(TARGETS epan - LIBRARY DESTINATION lib - RUNTIME DESTINATION lib - ARCHIVE DESTINATION lib -) +if(NOT ${ENABLE_STATIC}) + install(TARGETS epan + LIBRARY DESTINATION lib + RUNTIME DESTINATION lib + ARCHIVE DESTINATION lib + ) +endif() diff --git a/plugins/asn1/CMakeLists.txt b/plugins/asn1/CMakeLists.txt index 7f3e526a06..42b7a6c811 100644 --- a/plugins/asn1/CMakeLists.txt +++ b/plugins/asn1/CMakeLists.txt @@ -58,7 +58,7 @@ register_dissector_files(plugin.c # Do I need any of this or is this handled by type MODULE? # asn1_la_LDFLAGS = -module -avoid-version -add_library(asn1 MODULE +add_library(asn1 ${LINK_MODE_MODULE} ${PLUGIN_FILES} ) diff --git a/plugins/docsis/CMakeLists.txt b/plugins/docsis/CMakeLists.txt index 1f7667b64a..6894c05cf7 100644 --- a/plugins/docsis/CMakeLists.txt +++ b/plugins/docsis/CMakeLists.txt @@ -87,7 +87,7 @@ register_dissector_files(plugin.c # Do I need any of this or is this handled by type MODULE? # asn1_la_LDFLAGS = -module -avoid-version -add_library(docsis MODULE +add_library(docsis ${LINK_MODE_MODULE} ${PLUGIN_FILES} ) diff --git a/plugins/ethercat/CMakeLists.txt b/plugins/ethercat/CMakeLists.txt index 5c635b07d6..8bbcddb6bc 100644 --- a/plugins/ethercat/CMakeLists.txt +++ b/plugins/ethercat/CMakeLists.txt @@ -59,7 +59,7 @@ register_dissector_files(plugin.c # Do I need any of this or is this handled by type MODULE? # asn1_la_LDFLAGS = -module -avoid-version -add_library(ethercat MODULE +add_library(ethercat ${LINK_MODE_MODULE} ${PLUGIN_FILES} ) diff --git a/plugins/giop/CMakeLists.txt b/plugins/giop/CMakeLists.txt index aa2776ebd4..93c3fcfaa6 100644 --- a/plugins/giop/CMakeLists.txt +++ b/plugins/giop/CMakeLists.txt @@ -57,7 +57,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}) # Do I need any of this or is this handled by type MODULE? # asn1_la_LDFLAGS = -module -avoid-version -add_library(cosnaming MODULE +add_library(cosnaming ${LINK_MODE_MODULE} ${COSNAMING_SRC} ) @@ -69,7 +69,7 @@ install(TARGETS cosnaming ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ) -add_library(coseventcomm MODULE +add_library(coseventcomm ${LINK_MODE_MODULE} ${COSEVENTCOMM_SRC} ) @@ -81,7 +81,7 @@ install(TARGETS coseventcomm ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ) -add_library(tango MODULE +add_library(tango ${LINK_MODE_MODULE} ${TANGO_SRC} ) @@ -93,7 +93,7 @@ install(TARGETS tango ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} ) -add_library(parlay MODULE +add_library(parlay ${LINK_MODE_MODULE} ${PARLAY_SRC} ) diff --git a/plugins/gryphon/CMakeLists.txt b/plugins/gryphon/CMakeLists.txt index f138e124aa..1c215fe1e3 100644 --- a/plugins/gryphon/CMakeLists.txt +++ b/plugins/gryphon/CMakeLists.txt @@ -53,7 +53,7 @@ register_dissector_files(plugin.c # Do I need any of this or is this handled by type MODULE? # asn1_la_LDFLAGS = -module -avoid-version -add_library(gryphon MODULE +add_library(gryphon ${LINK_MODE_MODULE} ${PLUGIN_FILES} ) diff --git a/plugins/irda/CMakeLists.txt b/plugins/irda/CMakeLists.txt index 3efd5f84b7..89d94c4e41 100644 --- a/plugins/irda/CMakeLists.txt +++ b/plugins/irda/CMakeLists.txt @@ -55,7 +55,7 @@ register_dissector_files(plugin.c # Do I need any of this or is this handled by type MODULE? # asn1_la_LDFLAGS = -module -avoid-version -add_library(irda MODULE +add_library(irda ${LINK_MODE_MODULE} ${PLUGIN_FILES} ) diff --git a/plugins/m2m/CMakeLists.txt b/plugins/m2m/CMakeLists.txt index 7739a79075..28b85b82d5 100644 --- a/plugins/m2m/CMakeLists.txt +++ b/plugins/m2m/CMakeLists.txt @@ -58,7 +58,7 @@ register_dissector_files(plugin.c # Do I need any of this or is this handled by type MODULE? # asn1_la_LDFLAGS = -module -avoid-version -add_library(m2m MODULE +add_library(m2m ${LINK_MODE_MODULE} ${PLUGIN_FILES} ) diff --git a/plugins/mate/CMakeLists.txt b/plugins/mate/CMakeLists.txt index e15fed641b..2ec9f22901 100644 --- a/plugins/mate/CMakeLists.txt +++ b/plugins/mate/CMakeLists.txt @@ -74,7 +74,7 @@ register_dissector_files(plugin.c # Do I need any of this or is this handled by type MODULE? # asn1_la_LDFLAGS = -module -avoid-version -add_library(mate MODULE +add_library(mate ${LINK_MODE_MODULE} ${PLUGIN_FILES} ) diff --git a/plugins/opcua/CMakeLists.txt b/plugins/opcua/CMakeLists.txt index ce2acdc81e..1da79d3415 100644 --- a/plugins/opcua/CMakeLists.txt +++ b/plugins/opcua/CMakeLists.txt @@ -66,7 +66,7 @@ register_dissector_files(plugin.c # Do I need any of this or is this handled by type MODULE? # asn1_la_LDFLAGS = -module -avoid-version -add_library(opcua MODULE +add_library(opcua ${LINK_MODE_MODULE} ${PLUGIN_FILES} ) diff --git a/plugins/profinet/CMakeLists.txt b/plugins/profinet/CMakeLists.txt index e149c4c397..6288f717a1 100644 --- a/plugins/profinet/CMakeLists.txt +++ b/plugins/profinet/CMakeLists.txt @@ -65,7 +65,7 @@ register_dissector_files(plugin.c # Do I need any of this or is this handled by type MODULE? # asn1_la_LDFLAGS = -module -avoid-version -add_library(profinet MODULE +add_library(profinet ${LINK_MODE_MODULE} ${PLUGIN_FILES} ) diff --git a/plugins/sercosiii/CMakeLists.txt b/plugins/sercosiii/CMakeLists.txt index 897b0c19d2..0d2c2e11ab 100644 --- a/plugins/sercosiii/CMakeLists.txt +++ b/plugins/sercosiii/CMakeLists.txt @@ -64,7 +64,7 @@ register_dissector_files(plugin.c # Do I need any of this or is this handled by type MODULE? # asn1_la_LDFLAGS = -module -avoid-version -add_library(sercosiii MODULE +add_library(sercosiii ${LINK_MODE_MODULE} ${PLUGIN_FILES} ) diff --git a/plugins/stats_tree/CMakeLists.txt b/plugins/stats_tree/CMakeLists.txt index a0b0c6366a..6011f20d13 100644 --- a/plugins/stats_tree/CMakeLists.txt +++ b/plugins/stats_tree/CMakeLists.txt @@ -42,7 +42,7 @@ endif() # Do I need any of this or is this handled by type MODULE? # asn1_la_LDFLAGS = -module -avoid-version -add_library(stats_tree MODULE +add_library(stats_tree ${LINK_MODE_MODULE} ${TAP_SRC} ) diff --git a/plugins/tpg/CMakeLists.txt b/plugins/tpg/CMakeLists.txt index 94728784c7..e51ff4cc69 100644 --- a/plugins/tpg/CMakeLists.txt +++ b/plugins/tpg/CMakeLists.txt @@ -74,7 +74,7 @@ ADD_CUSTOM_COMMAND( # Do I need any of this or is this handled by type MODULE? # asn1_la_LDFLAGS = -module -avoid-version -add_library(tpg MODULE +add_library(tpg ${LINK_MODE_MODULE} ${PLUGIN_FILES} ) diff --git a/plugins/unistim/CMakeLists.txt b/plugins/unistim/CMakeLists.txt index 3869ff7949..2d865a0829 100644 --- a/plugins/unistim/CMakeLists.txt +++ b/plugins/unistim/CMakeLists.txt @@ -53,7 +53,7 @@ register_dissector_files(plugin.c # Do I need any of this or is this handled by type MODULE? # unistim_la_LDFLAGS = -module -avoid-version -add_library(unistim MODULE +add_library(unistim ${LINK_MODE_MODULE} ${PLUGIN_FILES} ) diff --git a/plugins/wimax/CMakeLists.txt b/plugins/wimax/CMakeLists.txt index c1fb170e32..73a201a831 100644 --- a/plugins/wimax/CMakeLists.txt +++ b/plugins/wimax/CMakeLists.txt @@ -98,7 +98,7 @@ register_dissector_files(plugin.c # Do I need any of this or is this handled by type MODULE? # wimax_la_LDFLAGS = -module -avoid-version -add_library(wimax MODULE +add_library(wimax ${LINK_MODE_MODULE} ${PLUGIN_FILES} ) diff --git a/plugins/wimaxasncp/CMakeLists.txt b/plugins/wimaxasncp/CMakeLists.txt index b04db01549..33592870df 100644 --- a/plugins/wimaxasncp/CMakeLists.txt +++ b/plugins/wimaxasncp/CMakeLists.txt @@ -57,7 +57,7 @@ register_dissector_files(plugin.c # Do I need any of this or is this handled by type MODULE? # wimaxasncp_la_LDFLAGS = -module -avoid-version -add_library(wimaxasncp MODULE +add_library(wimaxasncp ${LINK_MODE_MODULE} ${PLUGIN_FILES} ) diff --git a/wiretap/CMakeLists.txt b/wiretap/CMakeLists.txt index 37e740d8cf..b2fbbbdeeb 100644 --- a/wiretap/CMakeLists.txt +++ b/wiretap/CMakeLists.txt @@ -98,15 +98,17 @@ set(wiretap_LIBS wsutil ) -add_library(wiretap SHARED +add_library(wiretap ${LINK_MODE_LIB} ${WIRETAP_FILES} ) target_link_libraries(wiretap ${wiretap_LIBS}) -install(TARGETS wiretap - LIBRARY DESTINATION lib - RUNTIME DESTINATION lib - ARCHIVE DESTINATION lib -) +if(NOT ${ENABLE_STATIC}) + install(TARGETS wiretap + LIBRARY DESTINATION lib + RUNTIME DESTINATION lib + ARCHIVE DESTINATION lib + ) +endif() diff --git a/wsutil/CMakeLists.txt b/wsutil/CMakeLists.txt index a662ef277b..81b9eceace 100644 --- a/wsutil/CMakeLists.txt +++ b/wsutil/CMakeLists.txt @@ -40,13 +40,17 @@ set(wsutil_LIBS ${GLIB2_LIBRARIES} ) -add_library(wsutil SHARED +add_library(wsutil ${LINK_MODE_LIB} ${WSUTIL_FILES} ) target_link_libraries(wsutil ${wsutil_LIBS}) -install(TARGETS wsutil - LIBRARY DESTINATION lib - RUNTIME DESTINATION lib - ARCHIVE DESTINATION lib) +if(NOT ${ENABLE_STATIC}) + install(TARGETS wsutil + LIBRARY DESTINATION lib + RUNTIME DESTINATION lib + ARCHIVE DESTINATION lib + ) +endif() + |