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
310de886
Commit
310de886
authored
Dec 06, 2002
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check file header to differentiate between object files and resources
so that the -r option is not necessary.
parent
9afea97a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
51 additions
and
29 deletions
+51
-29
Makedll.rules.in
dlls/Makedll.rules.in
+1
-1
Maketest.rules.in
dlls/Maketest.rules.in
+1
-1
Makeprog.rules.in
programs/Makeprog.rules.in
+1
-1
build.h
tools/winebuild/build.h
+1
-1
main.c
tools/winebuild/main.c
+20
-7
res32.c
tools/winebuild/res32.c
+19
-17
winebuild.man.in
tools/winebuild/winebuild.man.in
+8
-1
No files found.
dlls/Makedll.rules.in
View file @
310de886
...
...
@@ -25,7 +25,7 @@ all: $(MODULE)$(DLLEXT) $(SUBDIRS)
# Rules for .so files
$(MAINSPEC).c: $(MAINSPEC) $(RC_SRCS:.rc=.res) $(SYMBOLFILE) $(WINEBUILD)
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ --spec $(SRCDIR)/$(MAINSPEC) $(RC_SRCS:
%.rc=-r %
.res) $(SYMBOLFILE) $(DLLMAIN:%=-e %) -L$(DLLDIR) $(DELAYIMPORTS:%=-d%) $(IMPORTS:%=-l%)
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ --spec $(SRCDIR)/$(MAINSPEC) $(RC_SRCS:
.rc=
.res) $(SYMBOLFILE) $(DLLMAIN:%=-e %) -L$(DLLDIR) $(DELAYIMPORTS:%=-d%) $(IMPORTS:%=-l%)
$(MODULE).so: $(MAINSPEC).o $(ALL_OBJS) Makefile.in
$(LDSHARED) $(LDDLLFLAGS) $(MAINSPEC).o $(ALL_OBJS) -o $@ -L$(DLLDIR) $(LDIMPORTS:%=-l%) $(ALL_LIBS) -lc
...
...
dlls/Maketest.rules.in
View file @
310de886
...
...
@@ -32,7 +32,7 @@ all: $(TESTPROGRAM)
# Rule for main module spec file
$(MODULE).spec.c: $(RC_SRCS:.rc=.res) $(OBJS) $(WINEBUILD)
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -exe $(MODULE) -mcui $(RC_SRCS:
%.rc=-r %
.res) $(OBJS) -L$(DLLDIR) -L.. $(DELAYIMPORTS:%=-d%) $(IMPORTS:%=-l%)
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -exe $(MODULE) -mcui $(RC_SRCS:
.rc=
.res) $(OBJS) -L$(DLLDIR) -L.. $(DELAYIMPORTS:%=-d%) $(IMPORTS:%=-l%)
# Rules for .so main module
...
...
programs/Makeprog.rules.in
View file @
310de886
...
...
@@ -24,7 +24,7 @@ all: $(MODULE)$(DLLEXT) $(BASEMODULE)$(EXEEXT)
# Rule for main module spec file
$(MODULE).spec.c: $(RC_SRCS:.rc=.res) $(ALL_OBJS) $(WINEBUILD)
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ --exe $(MODULE) $(APPMODE:%=-m%) $(RC_SRCS:
%.rc=-r %
.res) $(ALL_OBJS) -L$(DLLDIR) $(DELAYIMPORTS:%=-d%) $(IMPORTS:%=-l%)
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ --exe $(MODULE) $(APPMODE:%=-m%) $(RC_SRCS:
.rc=
.res) $(ALL_OBJS) -L$(DLLDIR) $(DELAYIMPORTS:%=-d%) $(IMPORTS:%=-l%)
# Rules for .so main module
...
...
tools/winebuild/build.h
View file @
310de886
...
...
@@ -151,7 +151,7 @@ extern void add_ignore_symbol( const char *name );
extern
void
read_undef_symbols
(
char
**
argv
);
extern
int
resolve_imports
(
void
);
extern
int
output_imports
(
FILE
*
outfile
);
extern
void
load_res32_file
(
const
char
*
name
);
extern
int
load_res32_file
(
const
char
*
name
);
extern
int
output_resources
(
FILE
*
outfile
);
extern
void
load_res16_file
(
const
char
*
name
);
extern
int
output_res16_data
(
FILE
*
outfile
);
...
...
tools/winebuild/main.c
View file @
310de886
...
...
@@ -350,7 +350,7 @@ static void parse_options( char *argv[] )
char
**
ptr
,
**
last
;
const
char
*
arg
=
NULL
;
for
(
ptr
=
last
=
argv
+
1
;
*
ptr
;
ptr
++
)
for
(
ptr
=
last
=
argv
;
*
ptr
;
ptr
++
)
{
/* first check the exact option name */
for
(
opt
=
option_table
;
opt
->
name
;
opt
++
)
...
...
@@ -394,17 +394,31 @@ static void parse_options( char *argv[] )
/* load all specified resource files */
static
void
load_resources
(
void
)
static
void
load_resources
(
char
*
argv
[]
)
{
int
i
;
char
**
ptr
,
**
last
;
switch
(
SpecType
)
{
case
SPEC_WIN16
:
for
(
i
=
0
;
i
<
nb_res_files
;
i
++
)
load_res16_file
(
res_files
[
i
]
);
break
;
case
SPEC_WIN32
:
for
(
i
=
0
;
i
<
nb_res_files
;
i
++
)
load_res32_file
(
res_files
[
i
]
);
for
(
i
=
0
;
i
<
nb_res_files
;
i
++
)
{
if
(
!
load_res32_file
(
res_files
[
i
]
))
fatal_error
(
"%s is not a valid Win32 resource file
\n
"
,
res_files
[
i
]
);
}
/* load any resource file found in the remaining arguments */
for
(
ptr
=
last
=
argv
;
*
ptr
;
ptr
++
)
{
if
(
!
load_res32_file
(
*
ptr
))
*
last
++
=
*
ptr
;
/* not a resource file, keep it in the list */
}
*
last
=
NULL
;
break
;
}
}
...
...
@@ -415,12 +429,12 @@ static void load_resources(void)
int
main
(
int
argc
,
char
**
argv
)
{
output_file
=
stdout
;
parse_options
(
argv
);
parse_options
(
argv
+
1
);
switch
(
exec_mode
)
{
case
MODE_SPEC
:
load_resources
();
load_resources
(
argv
+
1
);
ParseTopLevel
(
input_file
);
switch
(
SpecType
)
{
...
...
@@ -438,14 +452,13 @@ int main(int argc, char **argv)
break
;
case
MODE_EXE
:
if
(
SpecType
==
SPEC_WIN16
)
fatal_error
(
"Cannot build 16-bit exe files
\n
"
);
load_resources
();
load_resources
(
argv
+
1
);
read_undef_symbols
(
argv
+
1
);
BuildSpec32File
(
output_file
);
break
;
case
MODE_DEF
:
if
(
argv
[
1
])
fatal_error
(
"file argument '%s' not allowed in this mode
\n
"
,
argv
[
1
]
);
if
(
SpecType
==
SPEC_WIN16
)
fatal_error
(
"Cannot yet build .def file for 16-bit dlls
\n
"
);
load_resources
();
ParseTopLevel
(
input_file
);
BuildDef32File
(
output_file
);
break
;
...
...
tools/winebuild/res32.c
View file @
310de886
...
...
@@ -155,20 +155,18 @@ static void get_string( struct string_id *str )
/* check the file header */
/* all values must be zero except header size */
static
void
check_header
(
void
)
static
int
check_header
(
void
)
{
if
(
get_dword
())
goto
error
;
/* data size */
if
(
get_dword
()
!=
32
)
goto
error
;
/* header size */
if
(
get_word
()
!=
0xffff
||
get_word
())
goto
error
;
/* type, must be id 0 */
if
(
get_word
()
!=
0xffff
||
get_word
())
goto
error
;
/* name, must be id 0 */
if
(
get_dword
())
goto
error
;
/* data version */
if
(
get_word
())
goto
error
;
/* mem options */
if
(
get_word
())
goto
error
;
/* language */
if
(
get_dword
())
goto
error
;
/* version */
if
(
get_dword
())
goto
error
;
/* characteristics */
return
;
error:
fatal_error
(
"%s is not a valid Win32 resource file
\n
"
,
file_name
);
if
(
get_dword
())
return
0
;
/* data size */
if
(
get_dword
()
!=
32
)
return
0
;
/* header size */
if
(
get_word
()
!=
0xffff
||
get_word
())
return
0
;
/* type, must be id 0 */
if
(
get_word
()
!=
0xffff
||
get_word
())
return
0
;
/* name, must be id 0 */
if
(
get_dword
())
return
0
;
/* data version */
if
(
get_word
())
return
0
;
/* mem options */
if
(
get_word
())
return
0
;
/* language */
if
(
get_dword
())
return
0
;
/* version */
if
(
get_dword
())
return
0
;
/* characteristics */
return
1
;
}
/* load the next resource from the current file */
...
...
@@ -196,9 +194,9 @@ static void load_next_resource(void)
}
/* load a Win32 .res file */
void
load_res32_file
(
const
char
*
name
)
int
load_res32_file
(
const
char
*
name
)
{
int
fd
;
int
fd
,
ret
;
void
*
base
;
struct
stat
st
;
...
...
@@ -217,8 +215,12 @@ void load_res32_file( const char *name )
file_name
=
name
;
file_pos
=
base
;
file_end
=
file_pos
+
st
.
st_size
;
check_header
();
while
(
file_pos
<
file_end
)
load_next_resource
();
if
((
ret
=
check_header
()))
{
while
(
file_pos
<
file_end
)
load_next_resource
();
}
close
(
fd
);
return
ret
;
}
/* compare two unicode strings/ids */
...
...
tools/winebuild/winebuild.man.in
View file @
310de886
.\" -*- nroff -*-
.TH WINEBUILD 1 "
July
2002" "@PACKAGE_STRING@" "Wine dll builder"
.TH WINEBUILD 1 "
December
2002" "@PACKAGE_STRING@" "Wine dll builder"
.SH NAME
winebuild \- Wine dll builder
.SH SYNOPSIS
...
...
@@ -159,6 +159,13 @@ Load resources from the specified binary resource file. The
\fIrsrc.res\fR can be produced from a source resource file with
.BR wrc(1)
(or with a Windows resource compiler).
.br
This option is only necessary for Win16 resource files, the Win32 ones
can simply listed as
.I input files
and will automatically be handled correctly (though the
.B \-r
option will also work for Win32 files).
.TP
.B \-w
Turn on warnings.
...
...
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