Install elfutils/version.h header for library compatibility checking.
authorRoland McGrath <roland@redhat.com>
Wed, 17 Dec 2008 01:03:03 +0000 (17:03 -0800)
committerRoland McGrath <roland@redhat.com>
Wed, 17 Dec 2008 01:03:03 +0000 (17:03 -0800)
ChangeLog
Makefile.am
config/ChangeLog
config/version.h.in [new file with mode: 0644]
configure.ac

index 01f61eb..65e84b1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-12-16  Roland McGrath  <roland@redhat.com>
+
+       * 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  <roland@redhat.com>
 
        * configure.ac (--enable-tls): Set AM_CONDITIONAL USE_TLS too.
index 9306fe6..44d67d5 100644 (file)
@@ -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
index e580747..3ebb9c0 100644 (file)
@@ -1,3 +1,7 @@
+2008-12-16  Roland McGrath  <roland@redhat.com>
+
+       * version.h.in: New file.
+
 2008-01-12  Ulrich Drepper  <drepper@redhat.com>
 
        * elfutils.spec.in: Add m4 to build requirements.
diff --git a/config/version.h.in b/config/version.h.in
new file mode 100644 (file)
index 0000000..82c846e
--- /dev/null
@@ -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 */
index 2723046..f2ddbaf 100644 (file)
@@ -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