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
b29f02a9
Commit
b29f02a9
authored
Nov 28, 2003
by
Richard Cohen
Committed by
Alexandre Julliard
Nov 28, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Add standard dll path last instead of first.
- Add standard lib path as well. - Remove . from default library search path. - Compiling with -lwine needs to use the given -L paths.
parent
81ce443f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
18 deletions
+40
-18
Makefile.in
tools/winegcc/Makefile.in
+1
-1
winewrap.c
tools/winegcc/winewrap.c
+39
-17
No files found.
tools/winegcc/Makefile.in
View file @
b29f02a9
DEFS
=
-DINCLUDEDIR
=
"
\"
$(includedir)
\"
"
-DDLLDIR
=
"
\"
$(dlldir)
\"
"
DEFS
=
-DINCLUDEDIR
=
"
\"
$(includedir)
\"
"
-DDLLDIR
=
"
\"
$(dlldir)
\"
"
-DLIBDIR
=
"
\"
$(libdir)
\"
"
TOPSRCDIR
=
@top_srcdir@
TOPOBJDIR
=
../..
SRCDIR
=
@srcdir@
...
...
tools/winegcc/winewrap.c
View file @
b29f02a9
...
...
@@ -216,7 +216,7 @@ static const char *wrapper_code =
;
static
const
char
*
output_name
=
"a.out"
;
static
strarray
*
arh_files
,
*
dll_files
,
*
lib
_files
,
*
llib_paths
,
*
lib_paths
,
*
obj_files
;
static
strarray
*
other_lib_files
,
*
arh_files
,
*
dll
_files
,
*
llib_paths
,
*
lib_paths
,
*
obj_files
;
static
int
keep_generated
=
0
;
static
void
rm_temp_file
(
const
char
*
file
)
...
...
@@ -285,7 +285,7 @@ static char *try_lib_path( const char *path, const char *name )
return
try_path
(
path
,
name
,
"a"
);
}
/*
open
the .def library for a given dll */
/*
find
the .def library for a given dll */
static
char
*
find_dll
(
const
char
*
name
)
{
char
*
fullname
;
...
...
@@ -295,13 +295,13 @@ static char *find_dll(const char *name)
{
if
((
fullname
=
try_dll_path
(
lib_paths
->
base
[
i
],
name
)))
return
fullname
;
}
return
try_dll_path
(
"."
,
name
)
;
return
NULL
;
}
/* find a static library */
static
char
*
find_lib
(
const
char
*
name
)
{
static
const
char
*
std_paths
[]
=
{
"
."
,
"
/usr/lib"
,
"/usr/local/lib"
};
static
const
char
*
std_paths
[]
=
{
"/usr/lib"
,
"/usr/local/lib"
};
char
*
fullname
;
int
i
;
...
...
@@ -324,24 +324,35 @@ static void add_lib_path(const char* path)
strarray_add
(
llib_paths
,
strmake
(
"-L%s"
,
path
));
}
static
void
add
_lib_file
(
const
char
*
library
)
static
void
identify
_lib_file
(
const
char
*
library
)
{
char
*
lib
;
if
(
find_dll
(
library
))
{
strarray_add
(
dll_files
,
strmake
(
"-l%s"
,
library
));
}
else
if
((
lib
=
find_lib
(
library
)))
{
/* winebuild needs the full path for .a files */
strarray_add
(
arh_files
,
lib
);
}
else
{
strarray_add
(
lib_files
,
strmake
(
"-l%s"
,
library
));
strarray_add
(
other_lib_files
,
strmake
(
"-l%s"
,
library
));
}
}
static
void
identify_lib_files
(
strarray
*
lib_files
)
{
int
i
;
for
(
i
=
0
;
i
<
lib_files
->
size
;
i
++
)
{
identify_lib_file
(
lib_files
->
base
[
i
]);
}
}
static
void
create_the_wrapper
(
char
*
base_file
,
char
*
base_name
,
char
*
app_name
,
int
gui_mode
)
{
char
*
wrp_temp_name
,
*
wspec_name
,
*
wspec_c_name
,
*
wspec_o_name
;
...
...
@@ -385,7 +396,8 @@ static void create_the_wrapper(char* base_file, char* base_name, char* app_name,
strarray_add
(
wspec_args
,
strmake
(
"%s.exe"
,
base_name
));
strarray_add
(
wspec_args
,
gui_mode
?
"-mgui"
:
"-mcui"
);
strarray_add
(
wspec_args
,
wrap_o_name
);
strarray_add
(
wspec_args
,
"-L"
DLLDIR
);
for
(
i
=
0
;
i
<
llib_paths
->
size
;
i
++
)
strarray_add
(
wspec_args
,
llib_paths
->
base
[
i
]);
strarray_add
(
wspec_args
,
"-lkernel32"
);
strarray_add
(
wspec_args
,
NULL
);
...
...
@@ -416,6 +428,8 @@ static void create_the_wrapper(char* base_file, char* base_name, char* app_name,
strarray_add
(
wlink_args
,
strmake
(
"%s.exe.so"
,
base_file
));
strarray_add
(
wlink_args
,
wspec_o_name
);
strarray_add
(
wlink_args
,
wrap_o_name
);
for
(
i
=
0
;
i
<
llib_paths
->
size
;
i
++
)
strarray_add
(
wlink_args
,
llib_paths
->
base
[
i
]);
strarray_add
(
wlink_args
,
NULL
);
spawn
(
wlink_args
);
...
...
@@ -431,7 +445,9 @@ int main(int argc, char **argv)
char
*
base_name
,
*
base_file
,
*
base_path
,
*
app_temp_name
,
*
app_name
=
0
;
char
*
spec_name
,
*
spec_c_name
,
*
spec_o_name
;
strarray
*
spec_args
,
*
comp_args
,
*
link_args
;
strarray
*
lib_files
;
other_lib_files
=
strarray_alloc
();
arh_files
=
strarray_alloc
();
dll_files
=
strarray_alloc
();
lib_files
=
strarray_alloc
();
...
...
@@ -439,9 +455,6 @@ int main(int argc, char **argv)
obj_files
=
strarray_alloc
();
llib_paths
=
strarray_alloc
();
/* include the standard DLL path first */
add_lib_path
(
DLLDIR
);
for
(
i
=
1
;
i
<
argc
;
i
++
)
{
if
(
!
no_opt
&&
argv
[
i
][
0
]
==
'-'
)
...
...
@@ -471,7 +484,7 @@ int main(int argc, char **argv)
if
(
argv
[
i
][
2
])
library
=
argv
[
i
]
+
2
;
else
if
(
i
+
1
<
argc
)
library
=
argv
[
++
i
];
else
error
(
"The -l switch takes an argument
\n
."
);
add_lib_file
(
library
);
strarray_add
(
lib_files
,
library
);
break
;
case
'm'
:
if
(
strcmp
(
"-mgui"
,
argv
[
i
])
==
0
)
gui_mode
=
1
;
...
...
@@ -510,10 +523,19 @@ int main(int argc, char **argv)
/* create wrapper only in C++ by default */
if
(
create_wrapper
==
-
1
)
create_wrapper
=
cpp
;
/* include the standard library (for eg libwine.so) and DLL paths last */
add_lib_path
(
DLLDIR
);
add_lib_path
(
LIBDIR
);
/* link in by default the big three */
if
(
gui_mode
)
add_lib_file
(
"gdi32"
);
add_lib_file
(
"user32"
);
add_lib_file
(
"kernel32"
);
if
(
gui_mode
)
strarray_add
(
lib_files
,
"gdi32"
);
strarray_add
(
lib_files
,
"user32"
);
strarray_add
(
lib_files
,
"kernel32"
);
/* Sort out the libraries into .def's and .a's */
identify_lib_files
(
lib_files
);
strarray_free
(
lib_files
);
app_temp_name
=
tempnam
(
0
,
"wapp"
);
/* get base filename by removing the .exe extension, if present */
...
...
@@ -602,8 +624,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
<
lib_files
->
size
;
i
++
)
strarray_add
(
link_args
,
lib_files
->
base
[
i
]);
for
(
i
=
0
;
i
<
other_
lib_files
->
size
;
i
++
)
strarray_add
(
link_args
,
other_
lib_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