OLD | NEW |
(Empty) | |
| 1 # Copyright 2012 Free Software Foundation, Inc. |
| 2 |
| 3 # This program is free software; you can redistribute it and/or modify |
| 4 # it under the terms of the GNU General Public License as published by |
| 5 # the Free Software Foundation; either version 3 of the License, or |
| 6 # (at your option) any later version. |
| 7 # |
| 8 # This program is distributed in the hope that it will be useful, |
| 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 # GNU General Public License for more details. |
| 12 # |
| 13 # You should have received a copy of the GNU General Public License |
| 14 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 |
| 16 # Make the boards under testsuite/boards automatically available to |
| 17 # DejaGnu. This is sourced by the `site.exp' file generated in the |
| 18 # root of the testsuite's build directory. |
| 19 |
| 20 # Append GDB's boards dir to DejaGnu's board dir list, making sure |
| 21 # that that is the last boards dir in the list, so that boards found |
| 22 # in directories appended to the list by either the global config |
| 23 # site.exp, or in `$(dirname $DEJAGNU)/boards' override GDB's boards. |
| 24 # Unfortunately, there's no standard way to get that behavior. To |
| 25 # make it happen, we trace all writes to the $boards_dirs global, and |
| 26 # make sure our dir is always the last in the list. This relies on |
| 27 # the fact that DejaGnu always writes to this variable, even if just |
| 28 # to set it to the empty list, which it does. |
| 29 # |
| 30 proc append_gdb_boards_dir { name1 name2 op } { |
| 31 global srcdir |
| 32 global boards_dir |
| 33 |
| 34 # In case someone wants to point at GDB's boards dir in the global |
| 35 # config before some other board dir, in which case we should not |
| 36 # push it to the end of the list, use an unlikely path to GDB's |
| 37 # boards, so it compares different to other simpler but equivalent |
| 38 # paths. |
| 39 set gdb_boards_dir "${srcdir}/boards/../boards" |
| 40 |
| 41 # Keep our board dir last in the list. |
| 42 set idx [lsearch -exact $boards_dir "$gdb_boards_dir"] |
| 43 if { $idx >= 0 } { |
| 44 set boards_dir [lreplace $boards_dir $idx $idx] |
| 45 } |
| 46 lappend boards_dir "${gdb_boards_dir}" |
| 47 } |
| 48 trace variable "boards_dir" w append_gdb_boards_dir |
OLD | NEW |