From d2e0724afc9631bcca59ce045debb9bb686dff1f Mon Sep 17 00:00:00 2001 From: Balint Reczey Date: Mon, 25 Feb 2013 18:12:20 +0000 Subject: Add dumpabi targets to CMake builds Also update automake generated targets to match CMake generated ones svn path=/trunk/; revision=47879 --- CMakeLists.txt | 2 ++ Makefile.am | 6 +++--- Makefile.am.inc | 2 +- abi-descriptor.template | 2 +- epan/CMakeLists.txt | 50 ++++++++++++++++++++++++++++++++++++++++++++++++- epan/Makefile.am | 2 +- wiretap/CMakeLists.txt | 23 ++++++++++++++++++++++- wiretap/Makefile.am | 2 +- wsutil/CMakeLists.txt | 23 ++++++++++++++++++++++- wsutil/Makefile.am | 2 +- 10 files changed, 103 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c37a51a726..e4055895fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -482,6 +482,8 @@ add_subdirectory( tools/lemon ) add_subdirectory( wiretap ) add_subdirectory( wsutil ) +add_custom_target(dumpabi DEPENDS dumpabi-libwireshark dumpabi-libwiretap dumpabi-libwsutil color.h) + if((BUILD_wireshark AND GTK_FOUND) OR (BUILD_qtshark AND QT_FOUND)) add_subdirectory( ui ) endif() diff --git a/Makefile.am b/Makefile.am index 6e7767eadf..438d348f8f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1135,9 +1135,9 @@ clean-local: rm -rf $(top_stagedir) dumpabi: - $(MAKE) -C wiretap dumpabi - $(MAKE) -C epan dumpabi - $(MAKE) -C wsutil dumpabi + $(MAKE) -C wiretap dumpabi-libwiretap + $(MAKE) -C epan dumpabi-libwireshark + $(MAKE) -C wsutil dumpabi-libwsutil checkapi_local: $(PERL) tools/checkAPIs.pl -build \ diff --git a/Makefile.am.inc b/Makefile.am.inc index fd4fb17f1c..8cad089665 100644 --- a/Makefile.am.inc +++ b/Makefile.am.inc @@ -48,4 +48,4 @@ am__v_SED_0 = @echo " SED " $@; # abi-compliance-checker descriptor INCLUDE_DIRS = $(subst -I,NEWLINE,$(filter -I%, $(CFLAGS) -I$(abs_top_srcdir) -I$(abs_srcdir))) abi-descriptor.xml: ../abi-descriptor.template - $(AM_V_SED)sed "s|@INCLUDE_DIRS@|$(INCLUDE_DIRS)|g;s/NEWLINE/\n /g" $< > $@ + $(AM_V_SED)sed "s|@INCLUDE_DIRS@|$(INCLUDE_DIRS)|g;s/NEWLINE/\n /g;s|@LIBRARY_OUTPUT_PATH@|{RELPATH}/.libs|" $< > $@ diff --git a/abi-descriptor.template b/abi-descriptor.template index 1773cd5404..43dd9a6fd6 100644 --- a/abi-descriptor.template +++ b/abi-descriptor.template @@ -7,7 +7,7 @@ {RELPATH}/abi-check-headers - {RELPATH}/.libs + @LIBRARY_OUTPUT_PATH@ @INCLUDE_DIRS@ diff --git a/epan/CMakeLists.txt b/epan/CMakeLists.txt index c3764f78cf..b688a85867 100644 --- a/epan/CMakeLists.txt +++ b/epan/CMakeLists.txt @@ -1541,8 +1541,13 @@ add_library(epan ${LINK_MODE_LIB} ${DISSECTOR_SUPPORT_SRC} ${LIBWIRESHARK_ASM_FILES} ) + +add_dependencies(epan svnversion) + +set(FULL_SO_VERSION "0.0.0") + set_target_properties(epan PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}") -set_target_properties(epan PROPERTIES VERSION "0.0.0" SOVERSION 0) +set_target_properties(epan PROPERTIES VERSION ${FULL_SO_VERSION} SOVERSION 0) # discover and substitute list of include directories for ABI compatibility # checks @@ -1551,6 +1556,49 @@ list(REMOVE_DUPLICATES INCLUDE_DIRS) string(REGEX REPLACE ";" "\n" INCLUDE_DIRS "${INCLUDE_DIRS}") configure_file(../abi-descriptor.template abi-descriptor.xml) +# ABI compliance checker can be obtained from +# http://ispras.linux-foundation.org/index.php/ABI_compliance_checker +# Checked using version 1.21.12 +file(GLOB EPAN_HEADERS *.h) +file(GLOB CRYPT_HEADERS crypt/*.h) +file(GLOB DFILTER_HEADERS dfilter/*.h ../tools/lemon/cppmagic.h) +file(GLOB D_HEADERS dissectors/*.h) +file(GLOB FTYPES_HEADERS ftypes/*.h) +file(GLOB WMEM_HEADERS wmem/*.h) +file(MAKE_DIRECTORY abi-check-headers abi-check-headers/epan + abi-check-headers/crypt abi-check-headers/dfilter + abi-check-headers/dissectors abi-check-headers/ftypes + abi-check-headers/wmem) +file(MAKE_DIRECTORY abi-check-headers/epan) + +file(COPY ../color.h ../register.h DESTINATION abi-check-headers) +file(COPY ${EPAN_HEADERS} DESTINATION abi-check-headers/epan) +file(COPY ${CRYPT_HEADERS} DESTINATION abi-check-headers/crypt) +file(COPY ${DFILTER_HEADERS} DESTINATION abi-check-headers/dfilter) +file(COPY ${D_HEADERS} DESTINATION abi-check-headers/dissectors) +file(COPY ${FTYPES_HEADERS} DESTINATION abi-check-headers/ftypes) +file(COPY ${WMEM_HEADERS} DESTINATION abi-check-headers/wmem) + +add_custom_command(OUTPUT libwireshark.abi.tar.gz + COMMAND cp ../config.h abi-check-headers + COMMAND rm abi-check-headers/dissectors/x11-extension-implementation.h + abi-check-headers/dissectors/packet-rtps2.h + abi-check-headers/dissectors/x11-glx-render-enum.h + abi-check-headers/dissectors/x11-register-info.h + abi-check-headers/dissectors/packet-idmp.h + COMMAND abi-compliance-checker -l libwireshark -v1 ${FULL_SO_VERSION} + -relpath ${CMAKE_CURRENT_BINARY_DIR} -dump-abi abi-descriptor.xml + || cat logs/libwireshark/[0-9]*/log.txt + COMMAND cp abi_dumps/libwireshark/libwireshark_* libwireshark.abi.tar.gz + COMMAND rm -rf abi_dumps abi-check-headers/config.h + abi-check-headers/epan/* abi-check-headers/crypt/* + abi-check-headers/dfilter/* abi-check-headers/dissectors/* + abi-check-headers/ftypes/* abi-check-headers/wmem/* + DEPENDS ../config.h ${EPAN_HEADERS} + ${CRYPT_HEADERS} ${DFILTER_HEADERS} ${D_HEADERS} + ${FTYPES_HEADERS} ${WMEM_HEADERS} epan) +add_custom_target(dumpabi-libwireshark DEPENDS libwireshark.abi.tar.gz) + # By default the name for a library with target name epan will be libepan, # but Ethereal is now named Wireshark SET_TARGET_PROPERTIES(epan PROPERTIES OUTPUT_NAME "wireshark") diff --git a/epan/Makefile.am b/epan/Makefile.am index 35271ba31b..dbb70d70ae 100644 --- a/epan/Makefile.am +++ b/epan/Makefile.am @@ -313,7 +313,7 @@ endif # HAVE_DOXYGEN # ABI compliance checker can be obtained from # http://ispras.linux-foundation.org/index.php/ABI_compliance_checker # Checked using version 1.21.12 -dumpabi: all abi-descriptor.xml +dumpabi-libwireshark: all abi-descriptor.xml rm -rf abi-check-headers abi_dumps .libs/*.abi.tar.gz mkdir abi-check-headers cp ../color.h ../config.h ../register.h abi-check-headers/ diff --git a/wiretap/CMakeLists.txt b/wiretap/CMakeLists.txt index be3976e494..4f14e73799 100644 --- a/wiretap/CMakeLists.txt +++ b/wiretap/CMakeLists.txt @@ -106,8 +106,11 @@ set(wiretap_LIBS add_library(wiretap ${LINK_MODE_LIB} ${WIRETAP_FILES} ) + +set(FULL_SO_VERSION "0.0.0") + set_target_properties(wiretap PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}") -set_target_properties(wiretap PROPERTIES VERSION "0.0.0" SOVERSION 0) +set_target_properties(wiretap PROPERTIES VERSION ${FULL_SO_VERSION} SOVERSION 0) # discover and substitute list of include directories for ABI compatibility # checks @@ -116,6 +119,24 @@ list(REMOVE_DUPLICATES INCLUDE_DIRS) string(REGEX REPLACE ";" "\n" INCLUDE_DIRS "${INCLUDE_DIRS}") configure_file(../abi-descriptor.template abi-descriptor.xml) +# ABI compliance checker can be obtained from +# http://ispras.linux-foundation.org/index.php/ABI_compliance_checker +# Checked using version 1.21.12 +file(GLOB HEADERS *.h) +file(MAKE_DIRECTORY abi-check-headers) + +file(COPY ${HEADERS} DESTINATION abi-check-headers) + +add_custom_command(OUTPUT libwiretap.abi.tar.gz + COMMAND cp ../config.h abi-check-headers/ + COMMAND abi-compliance-checker -l libwiretap -v1 ${FULL_SO_VERSION} + -relpath ${CMAKE_CURRENT_BINARY_DIR} -dump-abi abi-descriptor.xml + || cat logs/libwiretap/[0-9]*/log.txt + COMMAND cp abi_dumps/libwiretap/libwiretap_* libwiretap.abi.tar.gz + COMMAND rm -rf abi-check-headers/* abi_dumps + DEPENDS ../config.h ${HEADERS} wiretap) +add_custom_target(dumpabi-libwiretap DEPENDS libwiretap.abi.tar.gz) + target_link_libraries(wiretap ${wiretap_LIBS}) if(NOT ${ENABLE_STATIC}) diff --git a/wiretap/Makefile.am b/wiretap/Makefile.am index 7ae9b6c553..30a1671705 100644 --- a/wiretap/Makefile.am +++ b/wiretap/Makefile.am @@ -93,7 +93,7 @@ ascend.c ascend.h: ascend.y # ABI compliance checker can be obtained from # http://ispras.linux-foundation.org/index.php/ABI_compliance_checker # Checked using version 1.21.12 -dumpabi: all abi-descriptor.xml +dumpabi-libwiretap: all abi-descriptor.xml rm -rf abi-check-headers abi_dumps .libs/*.abi.tar.gz mkdir abi-check-headers cp *.h abi-check-headers/ diff --git a/wsutil/CMakeLists.txt b/wsutil/CMakeLists.txt index 4ff35f07c5..a83c77d52e 100644 --- a/wsutil/CMakeLists.txt +++ b/wsutil/CMakeLists.txt @@ -60,8 +60,11 @@ set(wsutil_LIBS add_library(wsutil ${LINK_MODE_LIB} ${WSUTIL_FILES} ) + +set(FULL_SO_VERSION "0.0.0") + set_target_properties(wsutil PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}") -set_target_properties(wsutil PROPERTIES VERSION "0.0.0" SOVERSION 0) +set_target_properties(wsutil PROPERTIES VERSION ${FULL_SO_VERSION} SOVERSION 0) # discover and substitute list of include directories for ABI compatibility # checks @@ -70,6 +73,24 @@ list(REMOVE_DUPLICATES INCLUDE_DIRS) string(REGEX REPLACE ";" "\n" INCLUDE_DIRS "${INCLUDE_DIRS}") configure_file(../abi-descriptor.template abi-descriptor.xml) +# ABI compliance checker can be obtained from +# http://ispras.linux-foundation.org/index.php/ABI_compliance_checker +# Checked using version 1.21.12 +file(GLOB HEADERS *.h) +file(MAKE_DIRECTORY abi-check-headers) + +file(COPY ${HEADERS} DESTINATION abi-check-headers) + +add_custom_command(OUTPUT libwsutil.abi.tar.gz + COMMAND cp ../config.h abi-check-headers/ + COMMAND abi-compliance-checker -l libwsutil -v1 ${FULL_SO_VERSION} + -relpath ${CMAKE_CURRENT_BINARY_DIR} -dump-abi abi-descriptor.xml + || cat logs/libwsutil/[0-9]*/log.txt + COMMAND cp abi_dumps/libwsutil/libwsutil_* libwsutil.abi.tar.gz + COMMAND rm -rf abi-check-headers/* abi_dumps + DEPENDS ../config.h ${HEADERS} wsutil) +add_custom_target(dumpabi-libwsutil DEPENDS libwsutil.abi.tar.gz) + target_link_libraries(wsutil ${wsutil_LIBS}) if(NOT ${ENABLE_STATIC}) diff --git a/wsutil/Makefile.am b/wsutil/Makefile.am index e6da9ec369..0781f96af1 100644 --- a/wsutil/Makefile.am +++ b/wsutil/Makefile.am @@ -129,7 +129,7 @@ MAINTAINERCLEANFILES = \ # ABI compliance checker can be obtained from # http://ispras.linux-foundation.org/index.php/ABI_compliance_checker # Checked using version 1.21.12 -dumpabi: all abi-descriptor.xml +dumpabi-libwsutil: all abi-descriptor.xml rm -rf abi-check-headers abi_dumps .libs/*.abi.tar.gz mkdir abi-check-headers cp ../config.h *.h abi-check-headers/ -- cgit v1.2.1