]> granicus.if.org Git - ipset/commitdiff
Add script to check libipset.map for missing symbols
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Tue, 28 Oct 2014 16:36:25 +0000 (17:36 +0100)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Tue, 28 Oct 2014 16:36:25 +0000 (17:36 +0100)
Makefile.am
check_libmap.sh [new file with mode: 0755]
include/libipset/types.h
lib/types.c

index f085ca56e1810478eb7ef7429be7bfbee037505f..0032ddc29b346a3b80b20283179f76fb053bfc42 100644 (file)
@@ -17,7 +17,7 @@ endif
 
 SUBDIRS                = include/libipset lib src
 
-sparse-check:
+sparse:
        $(MAKE) -C lib sparse-check
        $(MAKE) -C src sparse-check
 
@@ -88,6 +88,9 @@ update_utils:
        cd utils/ipset_list; tar xz --strip-components=1 -f /tmp/ipset-list.tar.gz
        rm -f /tmp/ipset-list.tar.gz
 
+check_libmap:
+       @./check_libmap.sh
+
 tests:
        cd tests; ./runtest.sh
 
@@ -109,6 +112,22 @@ tarball:
        tar -C /tmp -cjf ipset-${PACKAGE_VERSION}.tar.bz2 --owner=root --group=root ipset-${PACKAGE_VERSION}/;
        rm -Rf /tmp/ipset-${PACKAGE_VERSION};
 
+help:
+       @echo '  <nothing>              - Compile userspace'
+       @echo '  modules                - Compile kernel modules'
+       @echo '  install                - Install userspace'
+       @echo '  modules_install        - Install kernel modules'
+       @echo '  clean                  - Remove generated userspace files'
+       @echo '  modules_clean          - Remove generated kernelspace files'
+       @echo '  tidy                   - Tidy up the whole source tree'
+       @echo '  tests                  - Run testsuite'
+       @echo '  sparse                 - Check userspace with sparse'
+       @echo '  modules_sparse         - Check kernelspace with sparse'
+       @echo '  update_includes        - Update userspace include files'
+       @echo '  update_utils           - Update bash utilities'
+       @echo '  check_libmap           - Check libipset.map for missing symbols'
+       @echo '  tarball                - Create a tarball for a new release'
+
 .PHONY: modules modules_instal modules_clean update_includes tests tarball
 
 DISTCHECK_CONFIGURE_FLAGS = --with-kmod=no
diff --git a/check_libmap.sh b/check_libmap.sh
new file mode 100755 (executable)
index 0000000..be2a3d3
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+for file in include/libipset/*.h; do
+    case $file in
+    */ui.h) continue ;;
+    esac
+    grep ^extern $file | sed -r -e 's/\(.*//' -e 's/.* \*?//' | egrep -v '\[|\;'
+done | while read symbol; do
+    if [ -z "$symbol" ]; then
+       continue
+    fi
+    if [ -z "`grep \" $symbol\;\" lib/libipset.map`" ]; then
+       echo "Symbol $symbol is missing from libipset.map"
+    fi
+done
index 333b43288b53d3f3819a411ab7604a485891e192..aac5465874f25ee08dc6e193026bec72aa1ba9e4 100644 (file)
@@ -108,8 +108,6 @@ extern bool ipset_match_typename(const char *str,
                                 const struct ipset_type *t);
 extern void ipset_load_types(void);
 
-extern void ipset_types_init(void);
-
 #ifdef TYPE_INCLUSIVE
 #      ifdef _INIT
 #              undef _init
index e2a41ad6b056b6f90e6dc0864b44f81234f6ef53..15201037b7eb67c7b5ec07d2568cb0c011742e22 100644 (file)
@@ -573,6 +573,8 @@ ipset_cache_fini(void)
        }
 }
 
+extern void ipset_types_init(void);
+
 /**
  * ipset_load_types - load known set types
  *