diff options
author | Rob Staudinger <robsta@linux.intel.com> | 2011-09-16 13:52:37 +0200 |
---|---|---|
committer | Rob Staudinger <robsta@linux.intel.com> | 2011-09-16 13:52:37 +0200 |
commit | 52d34c41b93f879ed21fb117c5eb71d5bdc05304 (patch) | |
tree | 59220dfd203e71fcfb4e1fc9cc438f63e6484400 | |
parent | 341759f36a27f6df4f84ac20cf2eba403a44dc8c (diff) |
build: Check that all public symbols from ytstenut.sym actually show up in the shared lib.
-rw-r--r-- | configure.ac | 68 | ||||
-rw-r--r-- | ytstenut/Makefile.am | 17 | ||||
-rw-r--r-- | ytstenut/yts-version.h.in | 4 |
3 files changed, 45 insertions, 44 deletions
diff --git a/configure.ac b/configure.ac index e458532..270554c 100644 --- a/configure.ac +++ b/configure.ac @@ -1,47 +1,43 @@ +AC_PREREQ(2.59) + m4_define([yts_major_version], [0]) m4_define([yts_minor_version], [3]) m4_define([yts_micro_version], [0]) m4_define([yts_version], - [yts_major_version.yts_minor_version.yts_micro_version]) - -m4_define([yts_api_version], [1]) - -# increase the interface age of 2 for each release -# set to 0 if the API changes -m4_define([yts_interface_age], [0]) -m4_define([yts_binary_age], [m4_eval(100 * yts_minor_version + yts_micro_version)]) + [yts_major_version.yts_minor_version.yts_micro_version]) -m4_define([yts_lt_current], [m4_eval(100 * yts_minor_version + yts_micro_version - yts_interface_age)]) -m4_define([yts_lt_revision], [yts_interface_age]) -m4_define([yts_lt_age], [m4_eval(yts_binary_age - yts_interface_age)]) +AC_INIT(ytstenut, [yts_version], + [https://bugs.freedesktop.org/enter_bug.cgi?product=Ytstenut]) +AC_CONFIG_SRCDIR(ytstenut/ytstenut.h) +AC_CONFIG_AUX_DIR([build]) +AC_CONFIG_MACRO_DIR([build]) +AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS -I build") -# defaults -m4_define([default_enable_cache], [no]) +AC_SUBST(YTS_MAJOR_VERSION, yts_major_version) +AC_SUBST(YTS_MINOR_VERSION, yts_minor_version) +AC_SUBST(YTS_MICRO_VERSION, yts_micro_version) -AC_PREREQ([2.59]) +dnl PONDERING maybe rename to YTS_EPOCH +AC_SUBST(YTS_API_VERSION, [1]) -AC_INIT([ytstenut], [yts_version], [https://bugs.freedesktop.org/enter_bug.cgi?product=Ytstenut]) +dnl Version info for libraries = CURRENT:REVISION:AGE +dnl +dnl Within each x.y.*, ABI is maintained backward compatible. +dnl We strive for forward compatibility too, except that we sometimes +dnl add new functions. +dnl +m4_define([version_iface], + m4_eval(100 * yts_major_version + yts_minor_version)) -AC_CONFIG_AUX_DIR([build]) -AC_CONFIG_MACRO_DIR([build]) -AC_CONFIG_SRCDIR(ytstenut/ytstenut.h) +AC_SUBST([VERSION_INFO], [version_iface:yts_micro_version:0]) -AM_INIT_AUTOMAKE([tar-ustar dist-bzip2]) +AM_INIT_AUTOMAKE(dist-bzip2) -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],[]) +AC_CONFIG_HEADERS(config.h) -YTS_MAJOR_VERSION=yts_major_version -YTS_MINOR_VERSION=yts_minor_version -YTS_MICRO_VERSION=yts_micro_version -YTS_VERSION=yts_version -YTS_API_VERSION=yts_api_version -AC_SUBST(YTS_MAJOR_VERSION) -AC_SUBST(YTS_MINOR_VERSION) -AC_SUBST(YTS_MICRO_VERSION) -AC_SUBST(YTS_VERSION) -AC_SUBST(YTS_API_VERSION) +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -AM_CONFIG_HEADER([config.h]) +AC_SUBST(ACLOCAL_AMFLAGS, $ACLOCAL_FLAGS) AC_PROG_CC AM_PROG_CC_C_O @@ -144,16 +140,6 @@ AC_SUBST(GLIB_GENMARSHAL) GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` AC_SUBST(GLIB_MKENUMS) -YTS_LT_CURRENT=yts_lt_current -YTS_LT_REV=yts_lt_revision -YTS_AGE=yts_lt_age -YTS_LT_VERSION="$YTS_LT_CURRENT:$YTS_LT_REV:$YTS_LT_AGE" - -YTS_LT_LDFLAGS="-version-info $YTS_LT_VERSION" - -AC_SUBST(YTS_LT_VERSION) -AC_SUBST(YTS_LT_LDFLAGS) - AC_OUTPUT([ Makefile docs/Makefile diff --git a/ytstenut/Makefile.am b/ytstenut/Makefile.am index c1af6ea..5d3f979 100644 --- a/ytstenut/Makefile.am +++ b/ytstenut/Makefile.am @@ -178,7 +178,7 @@ yts-marshal.c: yts-marshal.h Makefile && rm -f xgen-cmc libytstenut_@YTS_API_VERSION@_la_LDFLAGS = \ - $(YTS_LT_LDFLAGS) \ + -version-info $(VERSION_INFO) \ -export-symbols $(srcdir)/ytstenut.sym \ -no-undefined \ $(NULL) @@ -252,4 +252,19 @@ EXTRA_DIST = marshal.list \ DISTCLEANFILES= yts-version.h \ $(NULL) +# PONDERING should only run on platforms we know it works. +# Use "nm" to get the public symbols from libytstenut, and then +# check that every symbol from ytstenut.sym actually shows up in the library. +all-local: + $(AM_V_GEN) b=`tput bold` && \ + n=`tput sgr0` && \ + NM_CMD="nm --defined-only --extern-only" && \ + exported_syms=`$${NM_CMD} ".libs/libytstenut-$(YTS_API_VERSION).so" | cut -d' ' -f3` && \ + for sym in `cat $(srcdir)/ytstenut.sym`; do \ + if [ "`echo $${exported_syms} | grep $${sym}`" = "" ]; then \ + echo "$${b}Error: $${sym} exported in ytstenut.sym but not found in libytstenut.$${n}" && \ + exit 1; \ + fi \ + done + -include $(top_srcdir)/git.mk diff --git a/ytstenut/yts-version.h.in b/ytstenut/yts-version.h.in index aaa55da..cf04fe2 100644 --- a/ytstenut/yts-version.h.in +++ b/ytstenut/yts-version.h.in @@ -51,7 +51,7 @@ G_BEGIN_DECLS *s * The full version of the Ytstenut library, like 1.2.3 */ -#define YTS_VERSION @YTS_VERSION@ +#define YTS_VERSION @PACKAGE_VERSION@ /** * YTS_VERSION_S: @@ -59,7 +59,7 @@ G_BEGIN_DECLS * The full version of the Ytstenut library, in string form (suited for * string concatenation) */ -#define YTS_VERSION_S "@YTS_VERSION@" +#define YTS_VERSION_S "@PACKAGE_VERSION@" /** * YTS_VERSION_HEX: |