scripts/addToolsVersion: properly handle .in vs. .in.2
While most components have their version in the .in file, some
have it in the .in.2 (eg. elf2flt).
Currently, to handle this case, we indiscriminately munge both files,
but this is wrong: in the elf2flt case, if we add a binutils version,
we do not want it to be added to elf2flt, and conversely.
So, for each tool, we need to explicitly know what file to munge.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
1 diff -durN gcc-4.4.0.orig/gcc/config/freebsd-spec.h gcc-4.4.0/gcc/config/freebsd-spec.h
2 --- gcc-4.4.0.orig/gcc/config/freebsd-spec.h 2009-05-27 21:38:47.000000000 +0200
3 +++ gcc-4.4.0/gcc/config/freebsd-spec.h 2009-05-27 21:38:47.000000000 +0200
5 #define FBSD_STARTFILE_SPEC \
7 %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
8 - %{!p:%{profile:gcrt1.o%s} \
9 - %{!profile:crt1.o%s}}}} \
10 - crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
11 + %{!p:%{profile:gcrt1.o%s} \
12 + %{!profile:crt1.o%s}}}} \
14 + %{static:crtbeginT.o%s;shared:crtbeginS.o%s;:crtbegin.o%s}"
16 /* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
17 the magical crtend.o file (see crtstuff.c) which provides part of
23 +#include <sys/param.h>
24 +#if __FreeBSD_version < 500016
25 #define FBSD_LIB_SPEC " \
33 +#elif __FreeBSD_version < 700022
34 #define FBSD_LIB_SPEC " \
36 %{!pg: %{pthread:-lpthread} -lc} \
37 %{pg: %{pthread:-lpthread_p} -lc_p} \
40 +#define FBSD_LIB_SPEC " \
42 + %{!pg: %{pthread:-lpthread} -lc} \
43 + %{pg: %{pthread:-lpthread_p} -lc_p}} \
45 + %{pthread:-lpthread} -lc} \
52 #define FBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.1"
54 #define FBSD_DYNAMIC_LINKER "/libexec/ld-elf.so.1"
57 +#if defined(HAVE_LD_EH_FRAME_HDR)
58 +#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
61 +/* Use --as-needed -lgcc_s for eh support. */
62 +#ifdef HAVE_LD_AS_NEEDED
63 +#define USE_LD_AS_NEEDED 1