+2017-02-16 Ulf Hermann <ulf.hermann@qt.io>
+
+ * Makefile.am (libeu_a_SOURCES): Remove version.c, add printversion.c
+ (noinst_HEADERS): Add printversion.h
+ * version.c: Moved to printversion.c.
+ * printversion.c: New file, moved from version.c,
+ remove stdio.h, argp.h, system.h includes,
+ add printversion.h include.
+ * printversion.h: New file.
+ * system.h: Remove argp.h include,
+ (ARGP_PROGRAM_VERSION_HOOK_DEF, ARGP_PROGRAM_BUG_ADDRESS_DEF): Remove.
+ (print_version): Remove.
+
2017-02-15 Ulf Hermann <ulf.hermann@qt.io>
* system.h: Provide mempcpy if it doesn't exist.
libeu_a_SOURCES = xstrdup.c xstrndup.c xmalloc.c next_prime.c \
crc32.c crc32_file.c md5.c sha1.c \
- color.c version.c
+ color.c printversion.c
noinst_HEADERS = fixedsizehash.h libeu.h system.h dynamicsizehash.h list.h \
- md5.h sha1.h eu-config.h color.h
+ md5.h sha1.h eu-config.h color.h printversion.h
EXTRA_DIST = dynamicsizehash.c
if !GPROF
# include <config.h>
#endif
-#include <argp.h>
#include <libintl.h>
-#include <stdio.h>
-#include "system.h"
+#include "printversion.h"
void
print_version (FILE *stream, struct argp_state *state)
--- /dev/null
+/* Common argp_print_version_hook for all tools.
+ Copyright (C) 2017 The Qt Company Ltd.
+ 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/>. */
+
+#ifndef PRINTVERSION_H
+#define PRINTVERSION_H 1
+
+#include <argp.h>
+#include <stdio.h>
+
+/* Defined in version.c. Common ARGP_PROGRAM_VERSION_HOOK_DEF. */
+void print_version (FILE *stream, struct argp_state *state);
+
+/* We need define two variables, argp_program_version_hook and
+ argp_program_bug_address, in all programs. argp.h declares these
+ variables as non-const (which is correct in general). But we can
+ do better, it is not going to change. So we want to move them into
+ the .rodata section. Define macros to do the trick. */
+#define ARGP_PROGRAM_VERSION_HOOK_DEF \
+ void (*const apvh) (FILE *, struct argp_state *) \
+ __asm ("argp_program_version_hook")
+#define ARGP_PROGRAM_BUG_ADDRESS_DEF \
+ const char *const apba__ __asm ("argp_program_bug_address")
+
+#endif // PRINTVERSION_H
# include <config.h>
#endif
-#include <argp.h>
#include <errno.h>
#include <stddef.h>
#include <stdint.h>
return recvd;
}
-
-/* We need define two variables, argp_program_version_hook and
- argp_program_bug_address, in all programs. argp.h declares these
- variables as non-const (which is correct in general). But we can
- do better, it is not going to change. So we want to move them into
- the .rodata section. Define macros to do the trick. */
-#define ARGP_PROGRAM_VERSION_HOOK_DEF \
- void (*const apvh) (FILE *, struct argp_state *) \
- __asm ("argp_program_version_hook")
-#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,
size_t *length, int *status);
+2017-02-16 Ulf Hermann <ulf.hermann@qt.io>
+
+ * po/POTFILES.in: Removed lib/version.c, added lib/printversion.c.
+
2016-12-27 Mark Wielaard <mark@klomp.org>
* *.po: Update for 0.168.
# Files from the compatibility library
lib/color.c
-lib/version.c
+lib/printversion.c
lib/xmalloc.c
# Library sources
+2017-02-16 Ulf Hermann <ulf.hermann@qt.io>
+
+ * addr2line.c: Include printversion.h
+ * ar.c: Likewise.
+ * elflint.c: Likewise.
+ * nm.c: Likewise.
+ * objdump.c: Likewise.
+ * ranlib.c: Likewise.
+ * readelf.c: Likewise.
+ * size.c: Likewise.
+ * stack.c: Likewise.
+ * strings.c: Likewise.
+ * strip.c: Likewise.
+ * elfcmp.c: Include printversion.h, remove system.h include.
+ * elfcompress.c: Likewise.
+ * findtextrel.c: Likewise.
+ * unstrip.c: Likewise.
+
2017-02-14 Ulf Hermann <ulf.hermann@qt.io>
* nm.c: Include color.h.
#include <unistd.h>
#include <system.h>
+#include <printversion.h>
/* Name and version of program. */
#include <sys/time.h>
#include <system.h>
+#include <printversion.h>
#include "arlib.h"
#include <string.h>
#include <unistd.h>
-#include <system.h>
+#include <printversion.h>
#include "../libelf/elf-knowledge.h"
#include "../libebl/libeblP.h"
#include ELFUTILS_HEADER(dwelf)
#include <gelf.h>
#include "libeu.h"
-#include "system.h"
+#include "printversion.h"
/* Name and version of program. */
ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
#include <elf-knowledge.h>
#include <libeu.h>
#include <system.h>
+#include <printversion.h>
#include "../libelf/libelfP.h"
#include "../libelf/common.h"
#include "../libebl/libeblP.h"
#include <string.h>
#include <unistd.h>
-#include <system.h>
+#include <printversion.h>
struct segments
#include <libeu.h>
#include <system.h>
#include <color.h>
+#include <printversion.h>
#include "../libebl/libeblP.h"
#include "../libdwfl/libdwflP.h"
#include <libeu.h>
#include <system.h>
#include <color.h>
+#include <printversion.h>
#include "../libebl/libeblP.h"
#include <sys/stat.h>
#include <system.h>
+#include <printversion.h>
#include "arlib.h"
#include <libeu.h>
#include <system.h>
+#include <printversion.h>
#include "../libelf/libelfP.h"
#include "../libelf/common.h"
#include "../libebl/libeblP.h"
#include <unistd.h>
#include <system.h>
-
+#include <printversion.h>
/* Name and version of program. */
ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
#include <dwarf.h>
#include <system.h>
+#include <printversion.h>
/* Name and version of program. */
ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
#include <libeu.h>
#include <system.h>
+#include <printversion.h>
#ifndef MAP_POPULATE
# define MAP_POPULATE 0
#include "libdwelf.h"
#include <libeu.h>
#include <system.h>
+#include <printversion.h>
typedef uint8_t GElf_Byte;
#include <libdwfl.h>
#include "libdwelf.h"
#include "libeu.h"
-#include "system.h"
+#include "printversion.h"
#ifndef _
# define _(str) gettext (str)