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
93a5b868
Commit
93a5b868
authored
Feb 04, 2002
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Feb 04, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for generation of .def files from .spec files.
parent
d15ed230
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
142 additions
and
5 deletions
+142
-5
Make.rules.in
Make.rules.in
+7
-2
configure
configure
+0
-0
configure.in
configure.in
+28
-0
config.h.in
include/config.h.in
+3
-0
build.h
tools/winebuild/build.h
+1
-0
main.c
tools/winebuild/main.c
+30
-1
parser.c
tools/winebuild/parser.c
+6
-2
spec32.c
tools/winebuild/spec32.c
+67
-0
No files found.
Make.rules.in
View file @
93a5b868
...
...
@@ -92,7 +92,7 @@ prog_manext = 1
conf_manext = 5
includedir = @includedir@/wine
CLEAN_FILES = *.o *.a *.so *.ln \\\#*\\\# *~ *% .\\\#* *.bak *.orig *.rej \
*.flc *.spec.c *.glue.c y.tab.c y.tab.h lex.yy.c core
*.flc *.spec.c *.
spec.def *.
glue.c y.tab.c y.tab.h lex.yy.c core
OBJS = $(SPEC_SRCS:.spec=.spec.o) $(C_SRCS:.c=.o) $(GEN_C_SRCS:.c=.o) $(GEN_ASM_SRCS:.s=.o) \
$(ASM_SRCS:.S=.o) $(GLUE:.c=.glue.o) $(EXTRA_OBJS)
...
...
@@ -101,7 +101,7 @@ LINTS = $(C_SRCS:.c=.ln)
# Implicit rules
.SUFFIXES: .mc .rc .mc.rc .res .spec .spec.c .glue.c .pl .ok
.SUFFIXES: .mc .rc .mc.rc .res .spec .spec.c .
spec.def .
glue.c .pl .ok
.c.o:
$(CC) -c $(ALLCFLAGS) -o $@ $<
...
...
@@ -121,6 +121,9 @@ LINTS = $(C_SRCS:.c=.ln)
.spec.spec.c:
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L$(DLLDIR) -o $@ -spec $<
.spec.spec.def:
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L$(DLLDIR) -o $@ -def $<
.c.glue.c:
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -o $@ -glue $<
...
...
@@ -254,6 +257,8 @@ $(WINETEST):
$(SPEC_SRCS:.spec=.spec.c): $(WINEBUILD)
$(SPEC_SRCS:.spec=.spec.def): $(WINEBUILD)
$(GLUE:.c=.glue.c): $(WINEBUILD)
$(RC_SRCS:.rc=.res): $(WRC)
...
...
configure
View file @
93a5b868
This diff is collapsed.
Click to expand it.
configure.in
View file @
93a5b868
...
...
@@ -652,6 +652,34 @@ then
[Define if symbols declared in assembly code need an underscore prefix])
fi
dnl **** Check whether stdcall symbols need to be decorated ****
AC_CACHE_CHECK([whether stdcall symbols need to be decorated],
ac_cv_c_stdcall_decoration,
[saved_libs=$LIBS
LIBS="conftest_asm.s $LIBS"
if test "$ac_cv_c_extern_prefix" = "yes"
then
cat > conftest_asm.s <<EOF
.globl _ac_test@0
_ac_test@0:
EOF
else
cat > conftest_asm.s <<EOF
.globl ac_test@0
ac_test@0:
EOF
fi
AC_TRY_LINK([extern void __attribute__((__stdcall__)) ac_test(void);],
[ac_test(); return 0],
ac_cv_c_stdcall_decoration="yes",ac_cv_c_stdcall_decoration="no")
LIBS=$saved_libs])
if test "$ac_cv_c_stdcall_decoration" = "yes"
then
AC_DEFINE(NEED_STDCALL_DECORATION, 1,
[Define if stdcall symbols need to be decorated])
fi
dnl **** Check for .string in assembler ****
AC_CACHE_CHECK([whether assembler accepts .string],
...
...
include/config.h.in
View file @
93a5b868
...
...
@@ -502,6 +502,9 @@
/* Define if symbols declared in assembly code need an underscore prefix */
#undef NEED_UNDERSCORE_PREFIX
/* Define if stdcall symbols need to be decorated */
#undef NEED_STDCALL_DECORATION
/* Define to use .string instead of .ascii */
#undef HAVE_ASM_STRING
...
...
tools/winebuild/build.h
View file @
93a5b868
...
...
@@ -153,6 +153,7 @@ extern void BuildRelays16( FILE *outfile );
extern
void
BuildRelays32
(
FILE
*
outfile
);
extern
void
BuildSpec16File
(
FILE
*
outfile
);
extern
void
BuildSpec32File
(
FILE
*
outfile
);
extern
void
BuildDef32File
(
FILE
*
outfile
);
extern
SPEC_TYPE
ParseTopLevel
(
FILE
*
file
);
/* global variables */
...
...
tools/winebuild/main.c
View file @
93a5b868
...
...
@@ -55,7 +55,15 @@ static FILE *input_file;
static
FILE
*
output_file
;
/* execution mode */
static
enum
{
MODE_NONE
,
MODE_SPEC
,
MODE_GLUE
,
MODE_RELAY16
,
MODE_RELAY32
}
exec_mode
=
MODE_NONE
;
static
enum
{
MODE_NONE
,
MODE_SPEC
,
MODE_GLUE
,
MODE_DEF
,
MODE_RELAY16
,
MODE_RELAY32
}
exec_mode
=
MODE_NONE
;
/* open the input file */
static
void
open_input
(
const
char
*
name
)
...
...
@@ -91,6 +99,7 @@ static void do_pic(void);
static
void
do_output
(
const
char
*
arg
);
static
void
do_usage
(
void
);
static
void
do_spec
(
const
char
*
arg
);
static
void
do_def
(
const
char
*
arg
);
static
void
do_glue
(
const
char
*
arg
);
static
void
do_relay16
(
void
);
static
void
do_relay32
(
void
);
...
...
@@ -105,6 +114,7 @@ static const struct option_descr option_table[] =
{
"-o"
,
1
,
do_output
,
"-o name Set the output file name (default: stdout)"
},
{
"-sym"
,
1
,
do_sym
,
"-sym file.o Read the list of undefined symbols from 'file.o'"
},
{
"-spec"
,
1
,
do_spec
,
"-spec file.spec Build a .c file from a spec file"
},
{
"-def"
,
1
,
do_def
,
"-def file.spec Build a .def file from a spec file"
},
{
"-glue"
,
1
,
do_glue
,
"-glue file.c Build the 16-bit glue for a .c file"
},
{
"-relay16"
,
0
,
do_relay16
,
"-relay16 Build the 16-bit relay assembly routines"
},
{
"-relay32"
,
0
,
do_relay32
,
"-relay32 Build the 32-bit relay assembly routines"
},
...
...
@@ -149,6 +159,13 @@ static void do_spec( const char *arg )
open_input
(
arg
);
}
static
void
do_def
(
const
char
*
arg
)
{
if
(
exec_mode
!=
MODE_NONE
||
!
arg
[
0
])
do_usage
();
exec_mode
=
MODE_DEF
;
open_input
(
arg
);
}
static
void
do_glue
(
const
char
*
arg
)
{
if
(
exec_mode
!=
MODE_NONE
||
!
arg
[
0
])
do_usage
();
...
...
@@ -244,6 +261,18 @@ int main(int argc, char **argv)
default:
assert
(
0
);
}
break
;
case
MODE_DEF
:
switch
(
ParseTopLevel
(
input_file
))
{
case
SPEC_WIN16
:
fatal_error
(
"Cannot yet build .def file for 16-bit dlls
\n
"
);
break
;
case
SPEC_WIN32
:
BuildDef32File
(
output_file
);
break
;
default:
assert
(
0
);
}
break
;
case
MODE_GLUE
:
BuildGlue
(
output_file
,
input_file
);
break
;
...
...
tools/winebuild/parser.c
View file @
93a5b868
...
...
@@ -510,7 +510,6 @@ SPEC_TYPE ParseTopLevel( FILE *file )
else
if
(
strcmp
(
token
,
"file"
)
==
0
)
{
strcpy
(
DLLFileName
,
GetToken
(
0
));
strupper
(
DLLFileName
);
}
else
if
(
strcmp
(
token
,
"type"
)
==
0
)
{
...
...
@@ -612,7 +611,12 @@ SPEC_TYPE ParseTopLevel( FILE *file )
if
(
!
DLLFileName
[
0
])
{
if
(
SpecMode
==
SPEC_MODE_DLL
)
sprintf
(
DLLFileName
,
"%s.dll"
,
DLLName
);
{
strcpy
(
DLLFileName
,
DLLName
);
/* Append .dll to name if no extension present */
if
(
!
strrchr
(
DLLFileName
,
'.'
))
strcat
(
DLLFileName
,
".dll"
);
}
else
sprintf
(
DLLFileName
,
"%s.exe"
,
DLLName
);
}
...
...
tools/winebuild/spec32.c
View file @
93a5b868
...
...
@@ -759,3 +759,70 @@ void BuildSpec32File( FILE *outfile )
"}
\n
"
,
DLLName
);
}
}
/*******************************************************************
* BuildDef32File
*
* Build a Win32 def file from a spec file.
*/
void
BuildDef32File
(
FILE
*
outfile
)
{
int
i
;
AssignOrdinals
();
fprintf
(
outfile
,
"; File generated automatically from %s; do not edit!
\n\n
"
,
input_file_name
);
fprintf
(
outfile
,
"LIBRARY lib%s
\n\n
"
,
DLLFileName
);
fprintf
(
outfile
,
"EXPORTS
\n
"
);
/* Output the exports and relay entry points */
for
(
i
=
0
;
i
<
nb_entry_points
;
i
++
)
{
ORDDEF
*
odp
=
EntryPoints
[
i
];
if
(
!
odp
||
!*
odp
->
name
||
(
odp
->
flags
&
FLAG_NOIMPORT
))
continue
;
fprintf
(
outfile
,
" %s"
,
odp
->
name
);
switch
(
odp
->
type
)
{
case
TYPE_EXTERN
:
case
TYPE_VARARGS
:
case
TYPE_CDECL
:
case
TYPE_VARIABLE
:
/* try to reduce output */
if
(
strcmp
(
odp
->
name
,
odp
->
link_name
))
fprintf
(
outfile
,
"=%s"
,
odp
->
link_name
);
break
;
case
TYPE_STDCALL
:
{
#ifdef NEED_STDCALL_DECORATION
int
at_param
=
strlen
(
odp
->
u
.
func
.
arg_types
)
*
sizeof
(
int
);
fprintf
(
outfile
,
"@%d"
,
at_param
);
#endif
/* NEED_STDCALL_DECORATION */
/* try to reduce output */
if
(
strcmp
(
odp
->
name
,
odp
->
link_name
))
{
fprintf
(
outfile
,
"=%s"
,
odp
->
link_name
);
#ifdef NEED_STDCALL_DECORATION
fprintf
(
outfile
,
"@%d"
,
at_param
);
#endif
/* NEED_STDCALL_DECORATION */
}
break
;
}
case
TYPE_STUB
:
fprintf
(
outfile
,
"=%s"
,
make_internal_name
(
odp
,
"stub"
));
break
;
case
TYPE_FORWARD
:
fprintf
(
outfile
,
"=lib%s"
,
odp
->
link_name
);
break
;
default:
assert
(
0
);
}
fprintf
(
outfile
,
" @%d
\n
"
,
odp
->
ordinal
);
}
}
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