summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland McGrath <[email protected]>2008-12-16 17:03:03 -0800
committerRoland McGrath <[email protected]>2008-12-16 17:03:03 -0800
commitfbc7245df72ce0142f0a21fa0f4f88c97278bf60 (patch)
treeb2f5149a5704b490d56849799f3eb85de2250057
parent45d7b29b1bf7b53ab1164ea3b58529c39d32b4b2 (diff)
Install elfutils/version.h header for library compatibility checking.
-rw-r--r--ChangeLog6
-rw-r--r--Makefile.am4
-rw-r--r--config/ChangeLog4
-rw-r--r--config/version.h.in58
-rw-r--r--configure.ac11
5 files changed, 82 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 01f61eb3..65e84b19 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-12-16 Roland McGrath <[email protected]>
+
+ * Makefile.am (pkginclude_HEADERS): New variable, install version.h.
+ * configure.ac: Create it, substituting @eu_version@ with
+ PACKAGE_VERSION canonicalized to four digits of decimal.
+
2008-08-25 Roland McGrath <[email protected]>
* configure.ac (--enable-tls): Set AM_CONDITIONAL USE_TLS too.
diff --git a/Makefile.am b/Makefile.am
index 9306fe69..44d67d50 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,7 @@
## Process this file with automake to create Makefile.in
## Configure input file for elfutils.
##
-## Copyright (C) 1996-2002, 2003, 2004, 2005, 2006 Red Hat, Inc.
+## Copyright (C) 1996-2002, 2003, 2004, 2005, 2006, 2008 Red Hat, Inc.
## This file is part of Red Hat elfutils.
##
## Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -27,6 +27,8 @@
##
ACLOCAL_AMFLAGS = -I m4
+pkginclude_HEADERS = version.h
+
# Add doc back when we have some real content.
SUBDIRS = config m4 lib libelf libebl libdwfl libdw libcpu libasm backends \
src po tests
diff --git a/config/ChangeLog b/config/ChangeLog
index e580747a..3ebb9c07 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,7 @@
+2008-12-16 Roland McGrath <[email protected]>
+
+ * version.h.in: New file.
+
2008-01-12 Ulrich Drepper <[email protected]>
* elfutils.spec.in: Add m4 to build requirements.
diff --git a/config/version.h.in b/config/version.h.in
new file mode 100644
index 00000000..82c846e9
--- /dev/null
+++ b/config/version.h.in
@@ -0,0 +1,58 @@
+/* Version information about elfutils development libraries.
+ Copyright (C) 2008 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+
+ Red Hat elfutils is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by the
+ Free Software Foundation; version 2 of the License.
+
+ Red Hat elfutils 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 a copy of the GNU General Public License along
+ with Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ In addition, as a special exception, Red Hat, Inc. gives You the
+ additional right to link the code of Red Hat elfutils with code licensed
+ under any Open Source Initiative certified open source license
+ (http://www.opensource.org/licenses/index.php) which requires the
+ distribution of source code with any binary distribution and to
+ distribute linked combinations of the two. Non-GPL Code permitted under
+ this exception must only link to the code of Red Hat elfutils through
+ those well defined interfaces identified in the file named EXCEPTION
+ found in the source code files (the "Approved Interfaces"). The files
+ of Non-GPL Code may instantiate templates or use macros or inline
+ functions from the Approved Interfaces without causing the resulting
+ work to be covered by the GNU General Public License. Only Red Hat,
+ Inc. may make changes or additions to the list of Approved Interfaces.
+ Red Hat's grant of this exception is conditioned upon your not adding
+ any new exceptions. If you wish to add a new Approved Interface or
+ exception, please contact Red Hat. You must obey the GNU General Public
+ License in all respects for all of the Red Hat elfutils code and other
+ code used in conjunction with Red Hat elfutils except the Non-GPL Code
+ covered by this exception. If you modify this file, you may extend this
+ exception to your version of the file, but you are not obligated to do
+ so. If you do not wish to provide this exception without modification,
+ you must delete this exception statement from your version and license
+ this file solely under the GPL without exception.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+#ifndef _ELFUTILS_VERSION_H
+#define _ELFUTILS_VERSION_H 1
+
+#define _ELFUTILS_VERSION @eu_version@
+
+#define _ELFUTILS_PREREQ(major, minor) \
+ (_ELFUTILS_VERSION >= ((major) * 1000 + (minor)))
+
+#endif /* elfutils/version.h */
diff --git a/configure.ac b/configure.ac
index 2723046e..f2ddbaf6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -229,4 +229,15 @@ dnl Appended to the config.h file.
dnl We hide all kinds of configuration magic in lib/eu-config.h.
AH_BOTTOM([#include <eu-config.h>])
+dnl Version compatibility header.
+AC_CONFIG_FILES([version.h:config/version.h.in])
+AC_SUBST([eu_version])
+case $PACKAGE_VERSION in
+0.???) eu_version=${PACKAGE_VERSION#0.} ;;
+?.???) eu_version=${PACKAGE_VERSION/./} ;;
+?.??) eu_version=${PACKAGE_VERSION/./}0 ;;
+?.?) eu_version=${PACKAGE_VERSION/./}00 ;;
+*) AC_MSG_ERROR([confused by version number '$PACKAGE_VERSION']) ;;
+esac
+
AC_OUTPUT