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
34acd88a
Commit
34acd88a
authored
Mar 15, 2011
by
Eric Pouech
Committed by
Alexandre Julliard
Mar 16, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegcc: Correctly manage the -V option (gcc expects to be among the first ones, with -b).
parent
acac3cce
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
10 deletions
+39
-10
winegcc.c
tools/winegcc/winegcc.c
+39
-10
No files found.
tools/winegcc/winegcc.c
View file @
34acd88a
...
@@ -185,6 +185,7 @@ struct options
...
@@ -185,6 +185,7 @@ struct options
enum
target_cpu
target_cpu
;
enum
target_cpu
target_cpu
;
enum
target_platform
target_platform
;
enum
target_platform
target_platform
;
const
char
*
target
;
const
char
*
target
;
const
char
*
version
;
int
shared
;
int
shared
;
int
use_msvcrt
;
int
use_msvcrt
;
int
nostdinc
;
int
nostdinc
;
...
@@ -283,30 +284,49 @@ static char* get_temp_file(const char* prefix, const char* suffix)
...
@@ -283,30 +284,49 @@ static char* get_temp_file(const char* prefix, const char* suffix)
return
tmp
;
return
tmp
;
}
}
static
char
*
build_tool_name
(
struct
options
*
opts
,
const
char
*
base
,
const
char
*
deflt
)
{
char
*
str
;
if
(
opts
->
target
&&
opts
->
version
)
{
str
=
strmake
(
"%s-%s-%s"
,
opts
->
target
,
base
,
opts
->
version
);
}
else
if
(
opts
->
target
)
{
str
=
strmake
(
"%s-%s"
,
opts
->
target
,
base
);
}
else
if
(
opts
->
version
)
{
str
=
strmake
(
"%s-%s"
,
base
,
opts
->
version
);
}
else
str
=
xstrdup
(
deflt
);
return
str
;
}
static
const
strarray
*
get_translator
(
struct
options
*
opts
)
static
const
strarray
*
get_translator
(
struct
options
*
opts
)
{
{
c
onst
c
har
*
str
=
NULL
;
char
*
str
=
NULL
;
strarray
*
ret
;
strarray
*
ret
;
switch
(
opts
->
processor
)
switch
(
opts
->
processor
)
{
{
case
proc_cpp
:
case
proc_cpp
:
if
(
opts
->
target
)
str
=
strmake
(
"%s-cpp"
,
opts
->
target
);
str
=
build_tool_name
(
opts
,
"cpp"
,
CPP
);
else
str
=
CPP
;
break
;
break
;
case
proc_cc
:
case
proc_cc
:
case
proc_as
:
case
proc_as
:
if
(
opts
->
target
)
str
=
strmake
(
"%s-gcc"
,
opts
->
target
);
str
=
build_tool_name
(
opts
,
"gcc"
,
CC
);
else
str
=
CC
;
break
;
break
;
case
proc_cxx
:
case
proc_cxx
:
if
(
opts
->
target
)
str
=
strmake
(
"%s-g++"
,
opts
->
target
);
str
=
build_tool_name
(
opts
,
"g++"
,
CXX
);
else
str
=
CXX
;
break
;
break
;
default:
default:
assert
(
0
);
assert
(
0
);
}
}
ret
=
strarray_fromstring
(
str
,
" "
);
ret
=
strarray_fromstring
(
str
,
" "
);
free
(
str
);
if
(
opts
->
force_pointer_size
)
if
(
opts
->
force_pointer_size
)
strarray_add
(
ret
,
strmake
(
"-m%u"
,
8
*
opts
->
force_pointer_size
));
strarray_add
(
ret
,
strmake
(
"-m%u"
,
8
*
opts
->
force_pointer_size
));
return
ret
;
return
ret
;
...
@@ -379,6 +399,8 @@ static void compile(struct options* opts, const char* lang)
...
@@ -379,6 +399,8 @@ static void compile(struct options* opts, const char* lang)
strarray
*
comp_args
=
strarray_alloc
();
strarray
*
comp_args
=
strarray_alloc
();
unsigned
int
j
;
unsigned
int
j
;
int
gcc_defs
=
0
;
int
gcc_defs
=
0
;
char
*
gcc
;
char
*
gpp
;
strarray_addall
(
comp_args
,
get_translator
(
opts
));
strarray_addall
(
comp_args
,
get_translator
(
opts
));
switch
(
opts
->
processor
)
switch
(
opts
->
processor
)
...
@@ -389,12 +411,16 @@ static void compile(struct options* opts, const char* lang)
...
@@ -389,12 +411,16 @@ static void compile(struct options* opts, const char* lang)
/* mixing different C and C++ compilers isn't supported in configure anyway */
/* mixing different C and C++ compilers isn't supported in configure anyway */
case
proc_cc
:
case
proc_cc
:
case
proc_cxx
:
case
proc_cxx
:
gcc
=
build_tool_name
(
opts
,
"gcc"
,
CC
);
gpp
=
build_tool_name
(
opts
,
"g++"
,
CXX
);
for
(
j
=
0
;
!
gcc_defs
&&
j
<
comp_args
->
size
;
j
++
)
for
(
j
=
0
;
!
gcc_defs
&&
j
<
comp_args
->
size
;
j
++
)
{
{
const
char
*
cc
=
comp_args
->
base
[
j
];
const
char
*
cc
=
comp_args
->
base
[
j
];
gcc_defs
=
strendswith
(
cc
,
"gcc"
)
||
strendswith
(
cc
,
"g++"
);
gcc_defs
=
strendswith
(
cc
,
gcc
)
||
strendswith
(
cc
,
gpp
);
}
}
free
(
gcc
);
free
(
gpp
);
break
;
break
;
}
}
...
@@ -1114,7 +1140,7 @@ static int is_linker_arg(const char* arg)
...
@@ -1114,7 +1140,7 @@ static int is_linker_arg(const char* arg)
*/
*/
static
int
is_target_arg
(
const
char
*
arg
)
static
int
is_target_arg
(
const
char
*
arg
)
{
{
return
arg
[
1
]
==
'b'
||
arg
[
2
]
==
'V'
;
return
arg
[
1
]
==
'b'
||
arg
[
1
]
==
'V'
;
}
}
...
@@ -1291,7 +1317,7 @@ int main(int argc, char **argv)
...
@@ -1291,7 +1317,7 @@ int main(int argc, char **argv)
raw_linker_arg
=
0
;
raw_linker_arg
=
0
;
if
(
argv
[
i
][
1
]
==
'c'
||
argv
[
i
][
1
]
==
'L'
)
if
(
argv
[
i
][
1
]
==
'c'
||
argv
[
i
][
1
]
==
'L'
)
raw_compiler_arg
=
0
;
raw_compiler_arg
=
0
;
if
(
argv
[
i
][
1
]
==
'o'
||
argv
[
i
][
1
]
==
'b'
)
if
(
argv
[
i
][
1
]
==
'o'
||
argv
[
i
][
1
]
==
'b'
||
argv
[
i
][
1
]
==
'V'
)
raw_compiler_arg
=
raw_linker_arg
=
0
;
raw_compiler_arg
=
raw_linker_arg
=
0
;
/* do a bit of semantic analysis */
/* do a bit of semantic analysis */
...
@@ -1314,6 +1340,9 @@ int main(int argc, char **argv)
...
@@ -1314,6 +1340,9 @@ int main(int argc, char **argv)
case
'b'
:
case
'b'
:
parse_target_option
(
&
opts
,
option_arg
);
parse_target_option
(
&
opts
,
option_arg
);
break
;
break
;
case
'V'
:
opts
.
version
=
xstrdup
(
option_arg
);
break
;
case
'c'
:
/* compile or assemble */
case
'c'
:
/* compile or assemble */
if
(
argv
[
i
][
2
]
==
0
)
opts
.
compile_only
=
1
;
if
(
argv
[
i
][
2
]
==
0
)
opts
.
compile_only
=
1
;
/* fall through */
/* fall through */
...
...
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