[cairo-commit] 2 commits - configure.in Makefile.am src/Makefile.am

Behdad Esfahbod behdad at kemper.freedesktop.org
Wed Aug 27 16:08:11 PDT 2008


 Makefile.am     |   12 +---------
 configure.in    |   66 +++++++++++++++++++++++++++++++-------------------------
 src/Makefile.am |    4 +--
 3 files changed, 41 insertions(+), 41 deletions(-)

New commits:
commit f7a91e5bd7f3b799287f136adfd8a7b04dacce64
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Aug 27 19:06:13 2008 -0400

    [configure.in] Autogenerate libtool version info
    
    For unstable version 1.7.5 we create libcairo.so.2.10705.0
    For   stable version 1.8.5 we create libcairo.so.2.10800.5
    
    No more manual work.

diff --git a/configure.in b/configure.in
index 4144c53..01ccaf3 100644
--- a/configure.in
+++ b/configure.in
@@ -22,6 +22,10 @@ AM_INIT_AUTOMAKE([1.8])
 
 dnl ===========================================================================
 
+dnl
+dnl Version stuff
+dnl
+
 dnl This macro expands to one of 'git', 'snapshot', or 'release'
 m4_define([cairo_release_status],
 	  [m4_if(m4_eval(cairo_version_micro % 2), [1], [git],
@@ -31,18 +35,22 @@ m4_define([cairo_release_status],
 dnl This is the .so/dll number.  2 for cairo-1.x.x
 m4_define(cairo_version_sonum, m4_eval(cairo_version_major + 1))
 
-dnl libtool shared library version
-
-dnl Increment if the interface has additions, changes, removals.
-m4_define(cairo_libtool_current, 22)
-
-dnl Increment any time the source changes;
-dnl set to 0 if you increment cairo_libtool_current
-m4_define(cairo_libtool_revision, 0)
-
-m4_define(cairo_libtool_age, m4_eval(cairo_libtool_current - cairo_version_sonum))
-
-dnl ===========================================================================
+dnl The libtool shared library version stuff
+m4_define(cairo_version,
+	  m4_eval(cairo_version_major*10000 + cairo_version_minor*100 + cairo_version_micro))
+m4_if(m4_eval(cairo_version_minor % 2), [1],
+      [
+	dnl for unstable releases
+	m4_define(cairo_libtool_revision, 0)
+      ],
+      [
+	dnl for stable releases
+	m4_define(cairo_libtool_revision, cairo_version_micro)
+      ])
+m4_define(cairo_libtool_current,
+	  m4_eval(cairo_version_sonum + cairo_version - cairo_libtool_revision))
+m4_define(cairo_libtool_age,
+	  m4_eval(cairo_libtool_current - cairo_version_sonum))
 
 CAIRO_VERSION_MAJOR=cairo_version_major
 CAIRO_VERSION_MINOR=cairo_version_minor
commit df64e0e632bf180f83a64fb51e8e7da5eed503bf
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Aug 27 18:41:22 2008 -0400

    Cleanup libtool version handling
    
    In preparation to remove the manual numbering completely

diff --git a/Makefile.am b/Makefile.am
index 401af2c..56026cc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -135,7 +135,7 @@ developer_zip_file = /tmp/$(PACKAGE)-dev-$(VERSION).zip
 $(runtime_zip_file): install
 	-$(RM) $@
 	cd $(prefix); \
-	zip $@ bin/libcairo-$(LT_CURRENT_MINUS_AGE).dll
+	zip $@ bin/libcairo-$(CAIRO_VERSION_SONUM).dll
 
 $(developer_zip_file): install
 	-$(RM) $@
@@ -156,14 +156,6 @@ release-verify-sane-tests:
 	@echo "Checking that the test suite is sane..."
 	@cd test && $(MAKE) $(AM_MAKEFLAGS) release-verify-sane-tests
 
-release-verify-soname-major:
-	@echo -n "Checking that the cairo soname major number is 2..."
-	@test "$(LT_CURRENT_MINUS_AGE)" = "2" \
-		|| (echo "Ouch." && echo "The soname major number is $(LT_CURRENT_MINUS_AGE) instead of 2." \
-		&& echo "The libtool shared library version numbers in configure.in must be incremented properly." \
-		&& false)
-	@echo "Good."
-
 release-verify-even-micro:
 	@echo -n "Checking that $(VERSION) has an even micro component..."
 	@test "$(CAIRO_VERSION_MICRO)" = "`echo $(CAIRO_VERSION_MICRO)/2*2 | bc`" \
@@ -191,7 +183,7 @@ release-remove-old:
 release-cleanup-group-sticky:
 	find . -type f | xargs chmod g-s
 
-release-check: release-verify-sane-changelogs release-verify-sane-tests release-verify-soname-major release-verify-even-micro release-verify-newer release-remove-old release-cleanup-group-sticky distcheck
+release-check: release-verify-sane-changelogs release-verify-sane-tests release-verify-even-micro release-verify-newer release-remove-old release-cleanup-group-sticky distcheck
 
 release-upload: release-check $(tar_file) $(sha1_file) $(gpg_file)
 	mkdir -p releases
diff --git a/configure.in b/configure.in
index 5b0bde9..4144c53 100644
--- a/configure.in
+++ b/configure.in
@@ -1,16 +1,12 @@
 AC_PREREQ(2.58)
 
+dnl Parse Version.mk and declare m4 variables out of it
 m4_define([cairo_version_macro],
 		m4_bpatsubst(m4_include(Version.mk),
 			     [^\([a-zA-Z0-9_]*\) *= *\(.*\)],
 			     [[m4_define(\1, \[\2\])]]))
 cairo_version_macro
 
-m4_define([cairo_release_status],
-	  [m4_if(m4_eval(cairo_version_micro % 2), [1], [git],
-	         [m4_if(m4_eval(cairo_version_minor % 2), [1], [snapshot],
-		                                               [release])])])
-
 AC_INIT([cairo],
       cairo_version_major.cairo_version_minor.cairo_version_micro,
       [http://bugs.freedesktop.org/enter_bug.cgi?product=cairo])
@@ -26,36 +22,40 @@ AM_INIT_AUTOMAKE([1.8])
 
 dnl ===========================================================================
 
-# libtool shared library version
+dnl This macro expands to one of 'git', 'snapshot', or 'release'
+m4_define([cairo_release_status],
+	  [m4_if(m4_eval(cairo_version_micro % 2), [1], [git],
+	         [m4_if(m4_eval(cairo_version_minor % 2), [1], [snapshot],
+		                                               [release])])])
 
-# Increment if the interface has additions, changes, removals.
-m4_define(LT_CURRENT, 22)
+dnl This is the .so/dll number.  2 for cairo-1.x.x
+m4_define(cairo_version_sonum, m4_eval(cairo_version_major + 1))
 
-# Increment any time the source changes; set to
-# 0 if you increment CURRENT
-m4_define(LT_REVISION, 0)
+dnl libtool shared library version
 
-# Increment if any interfaces have been added; set to 0
-# if any interfaces have been removed. removal has
-# precedence over adding, so set to 0 if both happened.
-m4_define(LT_AGE, 20)
+dnl Increment if the interface has additions, changes, removals.
+m4_define(cairo_libtool_current, 22)
 
-dnl ===========================================================================
+dnl Increment any time the source changes;
+dnl set to 0 if you increment cairo_libtool_current
+m4_define(cairo_libtool_revision, 0)
 
-VERSION_INFO=LT_CURRENT():LT_REVISION():LT_AGE()
-AC_SUBST(VERSION_INFO)
+m4_define(cairo_libtool_age, m4_eval(cairo_libtool_current - cairo_version_sonum))
 
-LT_CURRENT_MINUS_AGE=m4_eval(LT_CURRENT() - LT_AGE())
-AC_SUBST(LT_CURRENT_MINUS_AGE)
+dnl ===========================================================================
 
-CAIRO_VERSION_MAJOR=cairo_version_major()
-CAIRO_VERSION_MINOR=cairo_version_minor()
-CAIRO_VERSION_MICRO=cairo_version_micro()
-CAIRO_RELEASE_STATUS=cairo_release_status()
+CAIRO_VERSION_MAJOR=cairo_version_major
+CAIRO_VERSION_MINOR=cairo_version_minor
+CAIRO_VERSION_MICRO=cairo_version_micro
+CAIRO_VERSION_SONUM=cairo_version_sonum
+CAIRO_RELEASE_STATUS=cairo_release_status
+CAIRO_LIBTOOL_VERSION_INFO=cairo_libtool_current:cairo_libtool_revision:cairo_libtool_age
 AC_SUBST(CAIRO_VERSION_MAJOR)
 AC_SUBST(CAIRO_VERSION_MINOR)
 AC_SUBST(CAIRO_VERSION_MICRO)
+AC_SUBST(CAIRO_VERSION_SONUM)
 AC_SUBST(CAIRO_RELEASE_STATUS)
+AC_SUBST(CAIRO_LIBTOOL_VERSION_INFO)
 
 dnl ===========================================================================
 
diff --git a/src/Makefile.am b/src/Makefile.am
index bbec011..2b9459b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -313,7 +313,7 @@ cairo_all_source_files =			\
 	$(cairo_all_sources)			\
 	$(cairo_special_sources)
 
-libcairo_la_LDFLAGS = -version-info @VERSION_INFO@ -no-undefined $(export_symbols)
+libcairo_la_LDFLAGS = -version-info $(CAIRO_LIBTOOL_VERSION_INFO) -no-undefined $(export_symbols)
 
 libcairo_la_CFLAGS = -I$(srcdir) $(CAIRO_CFLAGS)
 
@@ -345,7 +345,7 @@ cairo.def: $(cairo_headers) cairo-features.h
 	grep -E '^cairo_.* \(' | \
 	sed -e 's/[ 	].*//' | \
 	sort; \
-	echo LIBRARY libcairo-$(LT_CURRENT_MINUS_AGE).dll; \
+	echo LIBRARY libcairo-$(CAIRO_VERSION_SONUM).dll; \
 	) >$@
 	@ ! grep -q cairo_ERROR $@ || ($(RM) $@; false)
 


More information about the cairo-commit mailing list