NGHTTP2_VERSION_NUM: have configure generate the define

This commit is contained in:
Daniel Stenberg 2013-09-03 19:41:22 +02:00 committed by Tatsuhiro Tsujikawa
parent 66b89006d5
commit 2f992a68f8
2 changed files with 18 additions and 2 deletions

View File

@ -1,6 +1,6 @@
dnl nghttp2 - HTTP/2.0 C Library 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 Permission is hereby granted, free of charge, to any person obtaining
dnl a copy of this software and associated documentation files (the 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_REVISION, 0)
AC_SUBST(LT_AGE, 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_BUILD
AC_CANONICAL_HOST AC_CANONICAL_HOST
AC_CANONICAL_TARGET AC_CANONICAL_TARGET

View File

@ -1,7 +1,7 @@
/* /*
* nghttp2 - HTTP/2.0 C Library * 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 * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the * a copy of this software and associated documentation files (the
@ -31,4 +31,12 @@
*/ */
#define NGHTTP2_VERSION "@PACKAGE_VERSION@" #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 */ #endif /* NGHTTP2VER_H */