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
69872947
Commit
69872947
authored
Dec 03, 2003
by
Richard Cohen
Committed by
Alexandre Julliard
Dec 03, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Search for libraries in the order - .so - .def - .a
parent
260b6149
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
37 deletions
+36
-37
winewrap.c
tools/winegcc/winewrap.c
+36
-37
No files found.
tools/winegcc/winewrap.c
View file @
69872947
...
...
@@ -216,7 +216,7 @@ static const char *wrapper_code =
;
static
const
char
*
output_name
=
"a.out"
;
static
strarray
*
other_lib
_files
,
*
arh_files
,
*
dll_files
,
*
llib_paths
,
*
lib_paths
,
*
obj_files
;
static
strarray
*
so
_files
,
*
arh_files
,
*
dll_files
,
*
llib_paths
,
*
lib_paths
,
*
obj_files
;
static
int
keep_generated
=
0
;
static
void
rm_temp_file
(
const
char
*
file
)
...
...
@@ -273,49 +273,41 @@ static char *try_path( const char *path, const char *name, const char *ext )
return
NULL
;
}
/* open the .def library for a given dll in a specified path */
static
char
*
try_dll_path
(
const
char
*
path
,
const
char
*
name
)
{
return
try_path
(
path
,
name
,
"def"
);
}
/* open the .a library for a given lib in a specified path */
static
char
*
try_lib_path
(
const
char
*
path
,
const
char
*
name
)
static
char
*
find_in_path
(
const
strarray
*
path
,
const
char
*
name
,
const
char
*
ext
)
{
return
try_path
(
path
,
name
,
"a"
);
}
/* find the .def library for a given dll */
static
char
*
find_dll
(
const
char
*
name
)
{
char
*
fullname
;
int
i
;
for
(
i
=
0
;
i
<
lib_paths
->
size
;
i
++
)
for
(
i
=
0
;
i
<
path
->
size
;
i
++
)
{
if
((
fullname
=
try_dll_path
(
lib_paths
->
base
[
i
],
name
)))
return
fullname
;
char
*
fullname
;
if
((
fullname
=
try_path
(
path
->
base
[
i
],
name
,
ext
)))
return
fullname
;
}
return
NULL
;
}
/* find the .def library for a given dll */
static
char
*
find_dll
(
const
char
*
name
)
{
return
find_in_path
(
lib_paths
,
name
,
"def"
);
}
/* find a
static
library */
static
char
*
find_
lib
(
const
char
*
name
)
/* find a
unix
library */
static
char
*
find_
unix_lib
(
const
char
*
name
,
const
char
*
ext
)
{
static
const
char
*
std_paths
[]
=
{
"/usr/lib"
,
"/usr/local/lib"
};
char
*
fullname
;
int
i
;
for
(
i
=
0
;
i
<
lib_paths
->
size
;
i
++
)
char
*
fullname
;
static
strarray
*
std_paths
;
if
(
!
std_paths
)
{
if
((
fullname
=
try_lib_path
(
lib_paths
->
base
[
i
],
name
)))
return
fullname
;
std_paths
=
strarray_alloc
();
strarray_add
(
std_paths
,
"/usr/lib"
);
strarray_add
(
std_paths
,
"/usr/local/lib"
);
}
for
(
i
=
0
;
i
<
sizeof
(
std_paths
)
/
sizeof
(
std_paths
[
0
]);
i
++
)
{
if
((
fullname
=
try_lib_path
(
std_paths
[
i
],
name
)))
return
fullname
;
}
if
((
fullname
=
find_in_path
(
lib_paths
,
name
,
ext
)))
return
fullname
;
return
0
;
return
find_in_path
(
std_paths
,
name
,
ext
)
;
}
static
void
add_lib_path
(
const
char
*
path
)
...
...
@@ -328,18 +320,25 @@ static void identify_lib_file(const char* library)
{
char
*
lib
;
if
(
find_dll
(
library
))
if
(
find_unix_lib
(
library
,
"so"
))
{
/* Unix shared object */
strarray_add
(
so_files
,
strmake
(
"-l%s"
,
library
));
}
else
if
(
find_dll
(
library
))
{
/* Windows DLL */
strarray_add
(
dll_files
,
strmake
(
"-l%s"
,
library
));
}
else
if
((
lib
=
find_
lib
(
library
)))
else
if
((
lib
=
find_
unix_lib
(
library
,
"a"
)))
{
/* winebuild needs the full path for .a files */
strarray_add
(
arh_files
,
lib
);
}
else
{
strarray_add
(
other_lib_files
,
strmake
(
"-l%s"
,
library
));
fprintf
(
stderr
,
"cannot find %s.{so,def,a} in library search path
\n
"
,
library
);
}
}
...
...
@@ -447,7 +446,7 @@ int main(int argc, char **argv)
strarray
*
spec_args
,
*
comp_args
,
*
link_args
;
strarray
*
lib_files
;
other_lib
_files
=
strarray_alloc
();
so
_files
=
strarray_alloc
();
arh_files
=
strarray_alloc
();
dll_files
=
strarray_alloc
();
lib_files
=
strarray_alloc
();
...
...
@@ -624,8 +623,8 @@ int main(int argc, char **argv)
strarray_add
(
link_args
,
llib_paths
->
base
[
i
]);
strarray_add
(
link_args
,
"-lwine"
);
strarray_add
(
link_args
,
"-lm"
);
for
(
i
=
0
;
i
<
other_lib
_files
->
size
;
i
++
)
strarray_add
(
link_args
,
other_lib
_files
->
base
[
i
]);
for
(
i
=
0
;
i
<
so
_files
->
size
;
i
++
)
strarray_add
(
link_args
,
so
_files
->
base
[
i
]);
strarray_add
(
link_args
,
"-o"
);
if
(
create_wrapper
)
...
...
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