From 4df5b26fdfb659985fef6d482c1641b345243cbd Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Mon, 8 May 2006 07:10:29 +0000 Subject: [PATCH] Put version information into the configure script. Reported by Paul Watson . * builds/unix/configure.ac: Renamed to... * builds/unix/configure.raw: This which now serves (with appropriate modifications) as a template for configure.ac. * version.sed: New script. * autogen.sh: Generate configure.ac from configure.raw, using FREETYPE_MAJOR, FREETYPE_MINOR, and FREETYPE_PATCH from freetype.h. --- ChangeLog | 14 ++++++++++++++ autogen.sh | 16 ++++++++++++++-- builds/unix/.cvsignore | 1 + builds/unix/{configure.ac => configure.raw} | 2 +- version.sed | 5 +++++ 5 files changed, 35 insertions(+), 3 deletions(-) rename builds/unix/{configure.ac => configure.raw} (99%) create mode 100644 version.sed diff --git a/ChangeLog b/ChangeLog index 6675199c..2763650f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2006-05-07 Werner Lemberg + + Put version information into the configure script. Reported by Paul + Watson . + + * builds/unix/configure.ac: Renamed to... + * builds/unix/configure.raw: This which now serves (with appropriate + modifications) as a template for configure.ac. + + * version.sed: New script. + + * autogen.sh: Generate configure.ac from configure.raw, using + FREETYPE_MAJOR, FREETYPE_MINOR, and FREETYPE_PATCH from freetype.h. + 2006-05-06 Werner Lemberg * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1. diff --git a/autogen.sh b/autogen.sh index 5339101a..2cc94717 100644 --- a/autogen.sh +++ b/autogen.sh @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright 2005 by +# Copyright 2005, 2006 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, @@ -20,14 +20,26 @@ run () fi } -if test ! -f ./builds/unix/configure.ac; then +if test ! -f ./builds/unix/configure.raw; then echo "You must be in the same directory as \`autogen.sh'." echo "Bootstrapping doesn't work if srcdir != builddir." exit 1 fi +# This sets freetype_major, freetype_minor, and freetype_patch. +eval `sed -nf version.sed include/freetype/freetype.h` + +# We set freetype-patch to an empty value if it is zero. +if test "$freetype_patch" = ".0"; then + freetype_patch= +fi + cd builds/unix +echo "generating \`configure.ac'" +sed -e "s;@VERSION@;$freetype_major$freetype_minor$freetype_patch;" \ + < configure.raw > configure.ac + run aclocal -I . --force run libtoolize --force --copy run autoconf --force diff --git a/builds/unix/.cvsignore b/builds/unix/.cvsignore index 3785a9c1..86b8c409 100644 --- a/builds/unix/.cvsignore +++ b/builds/unix/.cvsignore @@ -6,6 +6,7 @@ config.log config.status config.sub configure +configure.ac freetype2.pc freetype-config ftconfig.h diff --git a/builds/unix/configure.ac b/builds/unix/configure.raw similarity index 99% rename from builds/unix/configure.ac rename to builds/unix/configure.raw index 24c36f35..f1f217cc 100644 --- a/builds/unix/configure.ac +++ b/builds/unix/configure.raw @@ -11,7 +11,7 @@ # indicate that you have read the license and understand and accept it # fully. -AC_INIT +AC_INIT([FreeType], [@VERSION@], [freetype@nongnu.org], [freetype]) AC_CONFIG_SRCDIR([ftconfig.in]) diff --git a/version.sed b/version.sed new file mode 100644 index 00000000..c281ff50 --- /dev/null +++ b/version.sed @@ -0,0 +1,5 @@ +#! /usr/bin/sed -nf + +s/^#define *FREETYPE_MAJOR *\([^ ][^ ]*\).*$/freetype_major="\1" ;/p +s/^#define *FREETYPE_MINOR *\([^ ][^ ]*\).*$/freetype_minor=".\1" ;/p +s/^#define *FREETYPE_PATCH *\([^ ][^ ]*\).*$/freetype_patch=".\1" ;/p