* dlltool.c: Include <assert.h>.
[external/binutils.git] / binutils / testsuite / config / default.exp
1 #   Copyright 1993, 1994, 1995, 1997, 1999, 2001, 2002
2 #   Free Software Foundation, Inc.
3
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
18 # Please email any bugs, comments, and/or additions to this file to:
19 # bug-dejagnu@prep.ai.mit.edu
20
21 # This file was written by Rob Savoye. (rob@cygnus.com)
22
23 load_lib util-defs.exp
24 load_lib utils-lib.exp
25
26 if ![info exists NM] then {
27     set NM [findfile $base_dir/nm-new $base_dir/nm-new [transform nm]]
28 }
29 if ![info exists NMFLAGS] then {
30     set NMFLAGS ""
31 }
32 if ![info exists SIZE] then {
33     set SIZE [findfile $base_dir/size]
34 }
35 if ![info exists SIZEFLAGS] then {
36     set SIZEFLAGS ""
37 }
38 if ![info exists OBJDUMP] then {
39     set OBJDUMP [findfile $base_dir/objdump]
40 }
41 if ![info exists OBJDUMPFLAGS] then {
42     set OBJDUMPFLAGS ""
43 }
44 if ![info exists OBJCOPY] then {
45     set OBJCOPY [findfile $base_dir/objcopy]
46 }
47 if ![info exists OBJCOPYFLAGS] then {
48     set OBJCOPYFLAGS ""
49 }
50 if ![info exists AR] then {
51     set AR [findfile $base_dir/ar]
52 }
53 if ![info exists STRIP] then {
54     set STRIP [findfile $base_dir/strip-new $base_dir/strip-new [transform strip]]
55 }
56 if ![info exists STRIPFLAGS] then {
57     set STRIPFLAGS ""
58 }
59 if ![info exists READELF] then {
60     set READELF [findfile $base_dir/readelf]
61 }
62 if ![info exists READELFFLAGS] then {
63     set READELFFLAGS ""
64 }
65 if ![info exists WINDRES] then {
66     set WINDRES [findfile $base_dir/windres]
67 }
68 if ![info exists DLLTOOL] then {
69     set DLLTOOL [findfile $base_dir/dlltool]
70 }
71
72 if ![file isdirectory tmpdir] {catch "exec mkdir tmpdir" status}
73
74 # Make a copy from tmpdir/gas/as and tmpdir/gas/ld to the assembler
75 # and linker in the build tree, so that we can use a -B option to gcc
76 # to force it to use the newly built assembler/linker.
77 if {![file isdirectory tmpdir/gas]} then {
78     catch "exec mkdir tmpdir/gas" status
79     send_user "file isfile ../gas/as-new[exe_ext]: [file isfile ../gas/as-new[exe_ext]]\n"
80     if {[file isfile ../gas/as-new[exe_ext]]} then {
81         catch "exec cp ../gas/as-new[exe_ext] tmpdir/gas/as[exe_ext]" status
82     } else {
83         # For non-Windows hosts there may be an executable
84         # without a .exe suffix, so try copying that instead.
85         catch "exec cp ../gas/as-new tmpdir/gas/as[exe_ext]" status
86     }
87     # This may not be needed any more...
88     if {[file isfile ../ld/ld-new[exe_ext]]} then {
89         catch "exec cp ../ld/ld-new[exe_ext] tmpdir/gas/ld[exe_ext]" status
90     } else {
91         catch "exec cp ../ld/ld-new tmpdir/gas/ld[exe_ext]" status
92     }
93 }
94 set gcc_gas_flag "-B[pwd]/tmpdir/gas/"
95 set dlltool_gas_flag "-S [pwd]/tmpdir/gas/as[exe_ext]"
96
97 #
98 # binutils_run
99 #       run a program, returning the output
100 #       sets binutils_run_failed if the program does not exist
101 #
102 proc binutils_run { prog progargs } {
103     default_binutils_run $prog $progargs
104 }
105
106 #
107 # binutils_assemble
108 #       assemble a file
109 #
110 proc binutils_assemble { source object } {
111     default_binutils_assemble $source $object
112 }