* autogen.sh: Absorb `version.sed'. * version.sed: Removed.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
diff --git a/ChangeLog b/ChangeLog
index 6a72a89..1e4c9a5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2021-01-22 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ * autogen.sh: Absorb `version.sed'.
+ * version.sed: Removed.
+
2021-01-19 Alexei Podtelezhnikov <apodtele@gmail.com>
* srd/base/ftlcdfil.c (FT_Library_SetLcdGeometry): Fix return value.
diff --git a/autogen.sh b/autogen.sh
index 41aad2d..1c7e815 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -138,18 +138,25 @@ check_tool_version $ACLOCAL aclocal ACLOCAL 1.10.1
check_tool_version $LIBTOOLIZE libtoolize LIBTOOLIZE 2.2.4
check_tool_version $AUTOCONF autoconf AUTOCONF 2.62
-# 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=
+# This sets FREETYPE version.
+eval `sed -n \
+-e 's/^#define *\(FREETYPE_MAJOR\) *\([0-9][0-9]*\).*/\1=\2/p' \
+-e 's/^#define *\(FREETYPE_MINOR\) *\([0-9][0-9]*\).*/\1=\2/p' \
+-e 's/^#define *\(FREETYPE_PATCH\) *\([0-9][0-9]*\).*/\1=\2/p' \
+include/freetype/freetype.h`
+
+if test "$FREETYPE_PATCH" = "0"; then
+ FREETYPE=$FREETYPE_MAJOR.$FREETYPE_MINOR
+else
+ FREETYPE=$FREETYPE_MAJOR.$FREETYPE_MINOR.$FREETYPE_PATCH
fi
+echo "FreeType $FREETYPE:"
+
cd builds/unix
echo "generating \`configure.ac'"
-sed -e "s;@VERSION@;$freetype_major$freetype_minor$freetype_patch;" \
+sed -e "s;@VERSION@;$FREETYPE;" \
< configure.raw > configure.ac
run aclocal -I . --force
diff --git a/version.sed b/version.sed
deleted file mode 100644
index c281ff5..0000000
--- a/version.sed
+++ /dev/null
@@ -1,5 +0,0 @@
-#! /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