Remove duplicate library API version number from Makefile.am
authorDavid Woodhouse <David.Woodhouse@intel.com>
Sun, 13 May 2012 16:54:11 +0000 (09:54 -0700)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Sun, 13 May 2012 16:57:50 +0000 (09:57 -0700)
Pick it up from openconnect.h automatically. This means that the
configure script will run, and the makefiles will be regenerated,
whenever openconnect.h changes — but openconnect.h shouldn't be changing
in non-cosmetic ways without the version being bumped anyway, and if the
version is bumped then the makefile needs to be rebuilt too.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Makefile.am
configure.ac

index 4a23122..a9a1ca6 100644 (file)
@@ -21,7 +21,7 @@ library_srcs = ssl.c http.c auth.c library.c compat.c
 libopenconnect_la_SOURCES = version.c $(library_srcs)
 libopenconnect_la_CFLAGS = $(OPENSSL_CFLAGS) $(LIBXML2_CFLAGS) $(LIBPROXY_CFLAGS)
 libopenconnect_la_LIBADD = $(OPENSSL_LIBS) $(LIBXML2_LIBS) $(LIBPROXY_LIBS) $(LIBINTL)
-libopenconnect_la_LDFLAGS = -version-number 1:4
+libopenconnect_la_LDFLAGS = -version-number @APIMAJOR@:@APIMINOR@
 noinst_HEADERS = openconnect-internal.h openconnect.h
 include_HEADERS = openconnect.h
 if HAVE_SYMBOL_VERSIONING
index 794edd0..3bfbf3f 100644 (file)
@@ -303,12 +303,17 @@ else
 fi
 AM_CONDITIONAL(BUILD_WWW, [test -n "${ac_cv_path_PYTHON}"])
 
-AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/po/LINGUAS'])
+AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/po/LINGUAS $(top_srcdir)/openconnect.h'])
 RAWLINGUAS=`sed -e "/^#/d" -e "s/#.*//" "${srcdir}/po/LINGUAS"`
 # Remove newlines
 LINGUAS=`echo $RAWLINGUAS`
 AC_SUBST(LINGUAS)
 
+APIMAJOR="`sed -n 's/^#define OPENCONNECT_API_VERSION_MAJOR \(.*\)/\1/p' openconnect.h`"
+APIMINOR="`sed -n 's/^#define OPENCONNECT_API_VERSION_MINOR \(.*\)/\1/p' openconnect.h`"
+AC_SUBST(APIMAJOR)
+AC_SUBST(APIMINOR)
+
 # We want version.c to depend on the files that would affect the
 # output of version.sh. But we cannot assume that they'll exist,
 # and we cannot use $(wildcard) in a non-GNU makefile. So we just