diff options
author | Mark Wielaard <mark@klomp.org> | 2016-12-24 22:31:41 +0100 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2016-12-24 22:51:32 +0100 |
commit | 1700fd25e6caf26663af2bd994d1d99fab9df59f (patch) | |
tree | 9a0bb382900e622e39e876b85c07e485d2b5c86b /lib | |
parent | 0d0f8450ffc6135c0938308254f378ac79612e75 (diff) | |
download | elfutils-1700fd25e6caf26663af2bd994d1d99fab9df59f.tar.gz |
http://elfutils.org/ is now hosted at http://sourceware.org/elfutils/
fedorahosted used to be our home, but we are now hosted at sourceware.
Change the elfutils project home to http://elfutils.org/
Point hosted services (email, release, git, bug tracker and web pages)
to https://sourceware.org/elfutils/
Move design notes from README to NOTES.
Add URLs for home, releases, bugs, git and mailinglist to README.
Make the --version output of all tools the same by using a common
print_version function and update the publicly shown copyright holder
to the elfutils developers.
Signed-off-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ChangeLog | 8 | ||||
-rw-r--r-- | lib/Makefile.am | 2 | ||||
-rw-r--r-- | lib/system.h | 2 | ||||
-rw-r--r-- | lib/version.c | 47 |
4 files changed, 57 insertions, 2 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog index afb18b11..1fe59067 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,4 +1,10 @@ -2015-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp> +2016-12-24 Mark Wielaard <mark@klomp.org> + + * version.c: New source file. + * Makefile.am (libeu_a_SOURCES): Add version.c + * system.h (print_version): New function definition. + +2016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp> * fixedsizehash.h (CONCAT): Use __CONCAT when available. * system.h: Include config.h and errno.h. diff --git a/lib/Makefile.am b/lib/Makefile.am index 7ca2bd41..1ad9ce8f 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -35,7 +35,7 @@ noinst_LIBRARIES = libeu.a libeu_a_SOURCES = xstrdup.c xstrndup.c xmalloc.c next_prime.c \ crc32.c crc32_file.c md5.c sha1.c \ - color.c + color.c version.c noinst_HEADERS = fixedsizehash.h libeu.h system.h dynamicsizehash.h list.h \ md5.h sha1.h eu-config.h diff --git a/lib/system.h b/lib/system.h index e1c1c698..ccd99d63 100644 --- a/lib/system.h +++ b/lib/system.h @@ -152,6 +152,8 @@ pread_retry (int fd, void *buf, size_t len, off_t off) #define ARGP_PROGRAM_BUG_ADDRESS_DEF \ const char *const apba__ __asm ("argp_program_bug_address") +/* Defined in version.c. Common ARGP_PROGRAM_VERSION_HOOK_DEF. */ +void print_version (FILE *stream, struct argp_state *state); /* The demangler from libstdc++. */ extern char *__cxa_demangle (const char *mangled_name, char *output_buffer, diff --git a/lib/version.c b/lib/version.c new file mode 100644 index 00000000..b8d70cbf --- /dev/null +++ b/lib/version.c @@ -0,0 +1,47 @@ +/* Common argp_print_version_hook for all tools. + Copyright (C) 2016 Red Hat, Inc. + This file is part of elfutils. + + This file 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. + + 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 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/>. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <argp.h> +#include <libintl.h> +#include <stdio.h> +#include "system.h" + +void +print_version (FILE *stream, struct argp_state *state) +{ + fprintf (stream, "%s (%s) %s\n", state->name, PACKAGE_NAME, PACKAGE_VERSION); + fprintf (stream, gettext ("\ +Copyright (C) %s The elfutils developers <%s>.\n\ +This is free software; see the source for copying conditions. There is NO\n\ +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ +"), "2016", PACKAGE_URL); +} |