Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
13850a3e
Commit
13850a3e
authored
Sep 10, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegcc: Forward the -B options to winebuild.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ab871dc4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
25 deletions
+31
-25
utils.c
tools/winegcc/utils.c
+17
-20
utils.h
tools/winegcc/utils.h
+1
-0
winegcc.c
tools/winegcc/winegcc.c
+13
-5
No files found.
tools/winegcc/utils.c
View file @
13850a3e
...
...
@@ -297,6 +297,22 @@ file_type get_lib_type(enum target_platform platform, strarray* path, const char
return
file_na
;
}
const
char
*
find_binary
(
const
strarray
*
prefix
,
const
char
*
name
)
{
unsigned
int
i
;
if
(
!
prefix
)
return
name
;
if
(
strchr
(
name
,
'/'
))
return
name
;
for
(
i
=
0
;
i
<
prefix
->
size
;
i
++
)
{
struct
stat
st
;
char
*
prog
=
strmake
(
"%s/%s%s"
,
prefix
->
base
[
i
],
name
,
EXEEXT
);
if
(
stat
(
prog
,
&
st
)
==
0
&&
S_ISREG
(
st
.
st_mode
)
&&
(
st
.
st_mode
&
0111
))
return
prog
;
}
return
name
;
}
int
spawn
(
const
strarray
*
prefix
,
const
strarray
*
args
,
int
ignore_errors
)
{
unsigned
int
i
;
...
...
@@ -307,26 +323,7 @@ int spawn(const strarray* prefix, const strarray* args, int ignore_errors)
strarray_add
(
arr
,
NULL
);
argv
=
arr
->
base
;
if
(
prefix
)
{
const
char
*
p
=
strrchr
(
argv
[
0
],
'/'
);
if
(
!
p
)
p
=
argv
[
0
];
else
p
++
;
for
(
i
=
0
;
i
<
prefix
->
size
;
i
++
)
{
struct
stat
st
;
free
(
prog
);
prog
=
strmake
(
"%s/%s%s"
,
prefix
->
base
[
i
],
p
,
EXEEXT
);
if
(
stat
(
prog
,
&
st
)
==
0
&&
S_ISREG
(
st
.
st_mode
)
&&
(
st
.
st_mode
&
0111
))
{
argv
[
0
]
=
prog
;
break
;
}
}
}
argv
[
0
]
=
find_binary
(
prefix
,
argv
[
0
]
);
if
(
verbose
)
{
...
...
tools/winegcc/utils.h
View file @
13850a3e
...
...
@@ -83,6 +83,7 @@ void create_file(const char* name, int mode, const char* fmt, ...);
file_type
get_file_type
(
const
char
*
filename
);
file_type
get_lib_type
(
enum
target_platform
platform
,
strarray
*
path
,
const
char
*
library
,
const
char
*
suffix
,
char
**
file
);
const
char
*
find_binary
(
const
strarray
*
prefix
,
const
char
*
name
);
int
spawn
(
const
strarray
*
prefix
,
const
strarray
*
arr
,
int
ignore_errors
);
extern
int
verbose
;
tools/winegcc/winegcc.c
View file @
13850a3e
...
...
@@ -300,7 +300,7 @@ static char* get_temp_file(const char* prefix, const char* suffix)
return
tmp
;
}
static
char
*
build_tool_name
(
struct
options
*
opts
,
const
char
*
base
,
const
char
*
deflt
)
static
c
onst
c
har
*
build_tool_name
(
struct
options
*
opts
,
const
char
*
base
,
const
char
*
deflt
)
{
char
*
str
;
...
...
@@ -318,12 +318,12 @@ static char* build_tool_name(struct options *opts, const char* base, const char*
}
else
str
=
xstrdup
(
deflt
);
return
str
;
return
find_binary
(
opts
->
prefix
,
str
)
;
}
static
const
strarray
*
get_translator
(
struct
options
*
opts
)
{
char
*
str
=
NULL
;
c
onst
c
har
*
str
=
NULL
;
strarray
*
ret
;
switch
(
opts
->
processor
)
...
...
@@ -342,7 +342,6 @@ static const strarray* get_translator(struct options *opts)
assert
(
0
);
}
ret
=
strarray_fromstring
(
str
,
" "
);
free
(
str
);
if
(
opts
->
force_pointer_size
)
strarray_add
(
ret
,
strmake
(
"-m%u"
,
8
*
opts
->
force_pointer_size
));
return
ret
;
...
...
@@ -847,9 +846,10 @@ static strarray *get_winebuild_args(struct options *opts)
{
const
char
*
winebuild
=
getenv
(
"WINEBUILD"
);
strarray
*
spec_args
=
strarray_alloc
();
unsigned
int
i
;
if
(
!
winebuild
)
winebuild
=
"winebuild"
;
strarray_add
(
spec_args
,
winebuild
);
strarray_add
(
spec_args
,
find_binary
(
opts
->
prefix
,
winebuild
)
);
if
(
verbose
)
strarray_add
(
spec_args
,
"-v"
);
if
(
keep_generated
)
strarray_add
(
spec_args
,
"--save-temps"
);
if
(
opts
->
target
)
...
...
@@ -857,6 +857,14 @@ static strarray *get_winebuild_args(struct options *opts)
strarray_add
(
spec_args
,
"--target"
);
strarray_add
(
spec_args
,
opts
->
target
);
}
if
(
opts
->
prefix
)
{
for
(
i
=
0
;
i
<
opts
->
prefix
->
size
;
i
++
)
{
if
(
strendswith
(
opts
->
prefix
->
base
[
i
],
"/tools/winebuild"
))
continue
;
strarray_add
(
spec_args
,
strmake
(
"-B%s"
,
opts
->
prefix
->
base
[
i
]
));
}
}
if
(
!
opts
->
use_msvcrt
)
strarray_add
(
spec_args
,
"-munix"
);
if
(
opts
->
unwind_tables
)
strarray_add
(
spec_args
,
"-fasynchronous-unwind-tables"
);
else
strarray_add
(
spec_args
,
"-fno-asynchronous-unwind-tables"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment