From 2f992a68f8dd44685fdbdb9f309b7f3f6ee71d94 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 3 Sep 2013 19:41:22 +0200 Subject: [PATCH] NGHTTP2_VERSION_NUM: have configure generate the define --- configure.ac | 10 +++++++++- lib/includes/nghttp2/nghttp2ver.h.in | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 42393c94..404c5591 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl nghttp2 - HTTP/2.0 C Library -dnl Copyright (c) 2012 Tatsuhiro Tsujikawa +dnl Copyright (c) 2012, 2013 Tatsuhiro Tsujikawa dnl Permission is hereby granted, free of charge, to any person obtaining dnl a copy of this software and associated documentation files (the @@ -30,6 +30,14 @@ AC_SUBST(LT_CURRENT, 0) AC_SUBST(LT_REVISION, 0) AC_SUBST(LT_AGE, 0) +major=`echo $PACKAGE_VERSION |cut -d. -f1 | sed -e "s/[^0-9]//g"` +minor=`echo $PACKAGE_VERSION |cut -d. -f2 | sed -e "s/[^0-9]//g"` +patch=`echo $PACKAGE_VERSION |cut -d. -f3 | cut -d- -f1 | sed -e "s/[^0-9]//g"` + +PACKAGE_VERSION_NUM=`printf "0x%02x%02x%02x" "$major" "$minor" "$patch"` + +AC_SUBST(PACKAGE_VERSION_NUM) + AC_CANONICAL_BUILD AC_CANONICAL_HOST AC_CANONICAL_TARGET diff --git a/lib/includes/nghttp2/nghttp2ver.h.in b/lib/includes/nghttp2/nghttp2ver.h.in index 2903fe19..142dede8 100644 --- a/lib/includes/nghttp2/nghttp2ver.h.in +++ b/lib/includes/nghttp2/nghttp2ver.h.in @@ -1,7 +1,7 @@ /* * nghttp2 - HTTP/2.0 C Library * - * Copyright (c) 2012 Tatsuhiro Tsujikawa + * Copyright (c) 2012, 2013 Tatsuhiro Tsujikawa * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -31,4 +31,12 @@ */ #define NGHTTP2_VERSION "@PACKAGE_VERSION@" +/** + * @macro + * Numerical representation of the version number of the nghttp2 library + * release. This is a 24 bit number with 8 bits for major number, 8 bits + * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203. + */ +#define NGHTTP2_VERSION_NUM @PACKAGE_VERSION_NUM@ + #endif /* NGHTTP2VER_H */