OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.18.0/] [newlib/] [testsuite/] [lib/] [newlibprocs.exp] - Blame information for rev 300

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 214 jeremybenn
# Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
2
#
3
# Permission to use, copy, modify, and distribute this software
4
# is freely granted, provided that this notice is preserved.
5
#
6
 
7
send_user "Loaded newlib.exp\n"
8
 
9
# flags.exp overrides the dejagnu versions of libgloss_link_flags,
10
# newlib_link_flags, and newlib_include_flags.
11
load_lib flags.exp
12
 
13
proc newlib_version { } {
14
    global tool_version
15
 
16
    verbose "In newlib version...\n"
17
 
18
    return $tool_version
19
}
20
 
21
set newlib_initialized 0
22
 
23
proc newlib_init { args } {
24
    global gluefile wrap_flags
25
    global newlib_initialized
26
    global target_info
27
    # These values are initialized in the local site.exp file.
28
    global srcdir objdir tmpdir
29
    global host_triplet target_triplet
30
    global old_ld_library_path
31
 
32
    verbose "In newlib_init...\n"
33
 
34
    if { $newlib_initialized == 1 } { return; }
35
 
36
    if {[target_info needs_status_wrapper] != "" && \
37
            [target_info needs_status_wrapper] != "0" && \
38
            ![info exists gluefile]} {
39
        set gluefile ${tmpdir}/testglue.o;
40
        set result [build_wrapper $gluefile];
41
        if { $result != "" } {
42
            set gluefile [lindex $result 0];
43
            set wrap_flags [lindex $result 1];
44
        } else {
45
            unset gluefile
46
        }
47
    }
48
 
49
    if [string match $host_triplet $target_triplet] then {
50
        if [string match "i686-pc-linux-gnu" $host_triplet] then {
51
            set old_ld_library_path [getenv LD_LIBRARY_PATH]
52
            setenv LD_LIBRARY_PATH "$objdir/.libs"
53
        }
54
    }
55
}
56
 
57
proc newlib_target_compile { source dest type options } {
58
    global gluefile wrap_flags
59
    global srcdir objdir
60
    global host_triplet target_triplet
61
 
62
    verbose "In newlib_target_compile...\n"
63
 
64
    lappend options "libs=-I$srcdir/include"
65
    verbose "srcdir is $srcdir"
66
 
67
    if {[target_info needs_status_wrapper] != "" && \
68
            [target_info needs_status_wrapper] != "0" && \
69
            [info exists gluefile] } {
70
        lappend options "libs=$gluefile"
71
        lappend options "ldflags=$wrap_flags"
72
    }
73
 
74
    if [string match $host_triplet $target_triplet] then {
75
        if [string match "i686-pc-linux-gnu" $host_triplet] then {
76
            lappend options "libs=$objdir/crt0.o -lc -lgcc"
77
            lappend options "ldflags=-nostdlib -L$objdir/.libs [newlib_include_flags]"
78
        }
79
    }
80
 
81
    return [target_compile $source $dest $type $options]
82
}
83
 
84
proc newlib_finish { } {
85
    global old_ld_library_path
86
    global host_triplet target_triplet
87
 
88
    verbose "In newlib_finish...\n"
89
 
90
    if [string match $host_triplet $target_triplet] then {
91
        if [string match "i686-pc-linux-gnu" $host_triplet] then {
92
            setenv LD_LIBRARY_PATH "$old_ld_library_path"
93
        }
94
    }
95
}
96
 
97
proc newlib_exit { } {
98
    global gluefile;
99
 
100
    verbose "In newlib_exit...\n"
101
 
102
    if [info exists gluefile] {
103
        file_on_build delete $gluefile;
104
        unset gluefile;
105
    }
106
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.