summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2015-03-17 13:12:13 +0100
committerNiels Möller <nisse@lysator.liu.se>2015-03-19 18:59:01 +0100
commit7bd822663cb4bf98c5a91f4e755cf3c0924b0193 (patch)
tree0d94fcade02dc6a61b3c6fbc9e23db53c4449733
parent0d66c601ee79bae8d8b175ad7dd0f0e8d5e56c45 (diff)
downloadnettle-7bd822663cb4bf98c5a91f4e755cf3c0924b0193.tar.gz
Added version.h with library versioning information
-rw-r--r--Makefile.in2
-rw-r--r--configure.ac7
-rw-r--r--version.h.in49
3 files changed, 56 insertions, 2 deletions
diff --git a/Makefile.in b/Makefile.in
index dbe03f4d..9c65a752 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -196,7 +196,7 @@ HEADERS = aes.h arcfour.h arctwo.h asn1.h blowfish.h \
md5.h md5-compat.h \
memxor.h \
nettle-meta.h nettle-types.h \
- pbkdf2.h \
+ pbkdf2.h version.h \
pgp.h pkcs1.h realloc.h ripemd160.h rsa.h \
salsa20.h sexp.h \
serpent.h sha.h sha1.h sha2.h sha3.h twofish.h \
diff --git a/configure.ac b/configure.ac
index 51ab3b34..56f69097 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,6 +16,11 @@ LIBNETTLE_MINOR=0
LIBHOGWEED_MAJOR=4
LIBHOGWEED_MINOR=0
+MAJOR_VERSION=`echo $PACKAGE_VERSION | sed 's/\(.*\)\..*/\1/g'`
+MINOR_VERSION=`echo $PACKAGE_VERSION | sed 's/.*\.\(.*\)/\1/g'`
+AC_SUBST([MAJOR_VERSION])
+AC_SUBST([MINOR_VERSION])
+
AC_CANONICAL_HOST
# Command line options
@@ -895,7 +900,7 @@ if test x$GCC = xyes ; then
# inttypes.h.
fi
-AC_CONFIG_FILES([config.make config.m4 Makefile bignum.h])
+AC_CONFIG_FILES([config.make config.m4 Makefile bignum.h version.h])
AC_CONFIG_FILES([tools/Makefile testsuite/Makefile examples/Makefile])
AC_CONFIG_FILES([nettle.pc hogweed.pc libnettle.map libhogweed.map])
diff --git a/version.h.in b/version.h.in
new file mode 100644
index 00000000..036aaf7a
--- /dev/null
+++ b/version.h.in
@@ -0,0 +1,49 @@
+/* version.h
+
+ Information about library version.
+
+ Copyright (C) 2015 Red Hat, Inc.
+
+ This file is part of GNU Nettle.
+
+ GNU Nettle is free software: you can redistribute it and/or
+ modify it under the terms of either:
+
+ * the GNU Lesser General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at your
+ option) any later version.
+
+ or
+
+ * the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ or both in parallel, as here.
+
+ GNU Nettle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received copies of the GNU General Public License and
+ the GNU Lesser General Public License along with this program. If
+ not, see http://www.gnu.org/licenses/.
+*/
+
+#ifndef NETTLE_VERSION_H_INCLUDED
+#define NETTLE_VERSION_H_INCLUDED
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Individual version numbers in decimal */
+#define NETTLE_VERSION_MAJOR @MAJOR_VERSION@
+#define NETTLE_VERSION_MINOR @MINOR_VERSION@
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* NETTLE_VERSION_H_INCLUDED */