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>
2 # Check ncurses compatibility
7 for ext in so a dylib ; do
8 for lib in ncursesw ncurses curses ; do
9 $cc -print-file-name=lib${lib}.${ext} | grep -q /
22 if [ -f /usr/include/ncurses/ncurses.h ]; then
23 echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"'
24 elif [ -f /usr/include/ncurses/curses.h ]; then
25 echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"'
26 elif [ -f /usr/include/ncursesw/curses.h ]; then
27 echo '-I/usr/include/ncursesw -DCURSES_LOC="<ncursesw/curses.h>"'
28 elif [ -f /usr/include/ncurses.h ]; then
29 echo '-DCURSES_LOC="<ncurses.h>"'
31 echo '-DCURSES_LOC="<curses.h>"'
35 # Temp file, try to clean up after us
37 trap "rm -f $tmp" 0 1 2 3 15
39 # Check if we can link to ncurses
41 $cc -xc - -o $tmp 2>/dev/null <<'EOF'
46 echo " *** Unable to find the ncurses libraries or the" 1>&2
47 echo " *** required header files." 1>&2
48 echo " *** 'make menuconfig' requires the ncurses libraries." 1>&2
50 echo " *** Install ncurses (ncurses-devel) and try again." 1>&2
57 printf "Usage: $0 [-check compiler options|-ccflags|-ldflags compiler options]\n"