Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
69ef7374
Commit
69ef7374
authored
May 28, 2021
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegcc: Link unix libs directly to native libraries.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
388c9104
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
11 deletions
+24
-11
utils.c
tools/winegcc/utils.c
+7
-7
utils.h
tools/winegcc/utils.h
+1
-1
winegcc.c
tools/winegcc/winegcc.c
+16
-3
No files found.
tools/winegcc/utils.c
View file @
69ef7374
...
...
@@ -271,39 +271,39 @@ static char* try_lib_path(const char* dir, const char* pre,
}
static
file_type
guess_lib_type
(
enum
target_platform
platform
,
const
char
*
dir
,
const
char
*
library
,
const
char
*
suffix
,
char
**
file
)
const
char
*
library
,
const
char
*
prefix
,
const
char
*
suffix
,
char
**
file
)
{
if
(
platform
!=
PLATFORM_WINDOWS
&&
platform
!=
PLATFORM_MINGW
&&
platform
!=
PLATFORM_CYGWIN
)
{
/* Unix shared object */
if
((
*
file
=
try_lib_path
(
dir
,
"lib"
,
library
,
".so"
,
file_so
)))
if
((
*
file
=
try_lib_path
(
dir
,
prefix
,
library
,
".so"
,
file_so
)))
return
file_so
;
/* Mach-O (Darwin/Mac OS X) Dynamic Library behaves mostly like .so */
if
((
*
file
=
try_lib_path
(
dir
,
"lib"
,
library
,
".dylib"
,
file_so
)))
if
((
*
file
=
try_lib_path
(
dir
,
prefix
,
library
,
".dylib"
,
file_so
)))
return
file_so
;
/* Windows DLL */
if
((
*
file
=
try_lib_path
(
dir
,
"lib"
,
library
,
".def"
,
file_def
)))
if
((
*
file
=
try_lib_path
(
dir
,
prefix
,
library
,
".def"
,
file_def
)))
return
file_dll
;
}
/* static archives */
if
((
*
file
=
try_lib_path
(
dir
,
"lib"
,
library
,
suffix
,
file_arh
)))
if
((
*
file
=
try_lib_path
(
dir
,
prefix
,
library
,
suffix
,
file_arh
)))
return
file_arh
;
return
file_na
;
}
file_type
get_lib_type
(
enum
target_platform
platform
,
strarray
*
path
,
const
char
*
library
,
const
char
*
suffix
,
char
**
file
)
const
char
*
prefix
,
const
char
*
suffix
,
char
**
file
)
{
unsigned
int
i
;
if
(
!
suffix
)
suffix
=
".a"
;
for
(
i
=
0
;
i
<
path
->
size
;
i
++
)
{
file_type
type
=
guess_lib_type
(
platform
,
path
->
base
[
i
],
library
,
suffix
,
file
);
file_type
type
=
guess_lib_type
(
platform
,
path
->
base
[
i
],
library
,
prefix
,
suffix
,
file
);
if
(
type
!=
file_na
)
return
type
;
}
return
file_na
;
...
...
tools/winegcc/utils.h
View file @
69ef7374
...
...
@@ -85,7 +85,7 @@ char* get_basename(const char* file);
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
*
prefix
,
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
);
...
...
tools/winegcc/winegcc.c
View file @
69ef7374
...
...
@@ -1083,14 +1083,27 @@ static const char *find_libgcc(const strarray *prefix, const strarray *link_tool
/* add specified library to the list of files */
static
void
add_library
(
struct
options
*
opts
,
strarray
*
lib_dirs
,
strarray
*
files
,
const
char
*
library
)
{
char
*
static_lib
,
*
fullname
=
0
;
char
*
static_lib
,
*
fullname
=
0
,
*
unixlib
;
switch
(
get_lib_type
(
opts
->
target_platform
,
lib_dirs
,
library
,
opts
->
lib_suffix
,
&
fullname
))
switch
(
get_lib_type
(
opts
->
target_platform
,
lib_dirs
,
library
,
"lib"
,
opts
->
lib_suffix
,
&
fullname
))
{
case
file_arh
:
strarray_add
(
files
,
strmake
(
"-a%s"
,
fullname
));
break
;
case
file_dll
:
if
(
opts
->
unix_lib
&&
opts
->
subsystem
&&
!
strcmp
(
opts
->
subsystem
,
"native"
))
{
if
(
get_lib_type
(
opts
->
target_platform
,
lib_dirs
,
library
,
""
,
".so"
,
&
unixlib
)
==
file_so
)
{
strarray_add
(
files
,
strmake
(
"-s%s"
,
unixlib
));
free
(
unixlib
);
}
else
{
strarray_add
(
files
,
strmake
(
"-l%s"
,
library
));
}
break
;
}
strarray_add
(
files
,
strmake
(
"-d%s"
,
fullname
));
if
((
static_lib
=
find_static_lib
(
fullname
)))
{
...
...
@@ -1266,7 +1279,7 @@ static void build(struct options* opts)
/* set default entry point, if needed */
if
(
!
opts
->
entry_point
)
{
if
(
opts
->
subsystem
&&
!
strcmp
(
opts
->
subsystem
,
"native"
))
if
(
opts
->
subsystem
&&
!
opts
->
unix_lib
&&
!
strcmp
(
opts
->
subsystem
,
"native"
))
entry_point
=
(
is_pe
&&
opts
->
target_cpu
==
CPU_x86
)
?
"DriverEntry@8"
:
"DriverEntry"
;
else
if
(
opts
->
use_msvcrt
&&
!
opts
->
shared
&&
!
opts
->
win16_app
)
entry_point
=
opts
->
unicode_app
?
"wmainCRTStartup"
:
"mainCRTStartup"
;
...
...
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