diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0257dd08..47f1478f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,6 +18,7 @@ build: - ./bootstrap - ./configure --with-linux-dir=/usr/src/linux-obj/$(uname -i)/default --enable-tty --with-devices=2 --enable-ccat - make -j8 all modules + - make -C lib symbol-version-check - make DISTCHECK_CONFIGURE_FLAGS="--with-linux-dir=/usr/src/linux-obj/$(uname -i)/default" distcheck - make dist - mkdir test_dist && cd test_dist && tar xzf ../ethercat-*.tar.gz && cd ethercat-*/ diff --git a/lib/Makefile.am b/lib/Makefile.am index d0eaf6b0..6780a453 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -114,3 +114,17 @@ endif ethercat-config.cmake: $(srcdir)/ethercat-config.cmake.in Makefile $(SED) -e 's,%libdir%,$(libdir),' -e 's,%includedir%,$(includedir),' $< > $@ + + +#----------------------------------------------------------------------------- + +.PHONY: symbol-version-check + +# check whether all symbols marked with EC_PUBLIC_API are listed in +# libethercat.map + +symbol-version-check: libethercat.la + readelf --dyn-syms --wide $(builddir)/.libs/libethercat.so | \ + awk '$$4 == "FUNC" && $$7 != "UND" && $$8 !~ /@LIBETHERCAT/ { print "Unversioned symbol: " $$8; err = 1; } END { exit err; }' + +#-----------------------------------------------------------------------------