Add dumpabi targets to CMake builds
authorBalint Reczey <balint@balintreczey.hu>
Mon, 25 Feb 2013 18:12:20 +0000 (18:12 -0000)
committerBalint Reczey <balint@balintreczey.hu>
Mon, 25 Feb 2013 18:12:20 +0000 (18:12 -0000)
Also update automake generated targets to match CMake generated ones

svn path=/trunk/; revision=47879

CMakeLists.txt
Makefile.am
Makefile.am.inc
abi-descriptor.template
epan/CMakeLists.txt
epan/Makefile.am
wiretap/CMakeLists.txt
wiretap/Makefile.am
wsutil/CMakeLists.txt
wsutil/Makefile.am

index c37a51a7266e1cb038eb2c60fff15180e983c77b..e4055895fd4047a857616ec21e895c735fb47bfd 100644 (file)
@@ -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()
index 6e7767eadfadb5495d8c0379fc635330ca531726..438d348f8f594486a8fecd6480bc342b384880b7 100644 (file)
@@ -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 \
index fd4fb17f1ce9294d2d5070c0934666ed3077dc68..8cad089665994d4fa5b4eb9f39c2a93494a8024c 100644 (file)
@@ -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|" $< > $@
index 1773cd5404e976604ecefbbae3947858462fa9bd..43dd9a6fd6fa25bfead9a9423ee9a00696bfb15a 100644 (file)
@@ -7,7 +7,7 @@
     {RELPATH}/abi-check-headers
 </headers>
 <libs>
-    {RELPATH}/.libs
+    @LIBRARY_OUTPUT_PATH@
 </libs>
 <include_paths>@INCLUDE_DIRS@
 </include_paths>
index c3764f78cf38a9392691355ddc044deedc855d24..b688a8586730ddec04cd2a43f5390a04804a4c54 100644 (file)
@@ -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")
index 35271ba31b87ab5885f0ed40d683ab6b433ca285..dbb70d70ae108761f11baade472d54b0d40e6fdc 100644 (file)
@@ -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/
index be3976e494f99f47ab61de1443b163249ad7091f..4f14e737995b5a61f6b580635b26e0841a4f1b5c 100644 (file)
@@ -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})
index 7ae9b6c5531f00fb1d5cc29e69297266fbe20d36..30a16717056d4f6e2802b804f3df4a440f4406af 100644 (file)
@@ -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/
index 4ff35f07c5ec9092224f8621925de2a1503831ce..a83c77d52ea475fa73ffaa33182c5eb1285d9ba6 100644 (file)
@@ -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})
index e6da9ec369ff58c1d9956a2ffd23d7efd6fb6116..0781f96af1d1500549089b34ad679720c9194953 100644 (file)
@@ -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/