Get rid of the debug channels support.
This commit is contained in:
parent
8248d0ae87
commit
e86a6a2454
|
@ -207,24 +207,20 @@ extern void output_resources( FILE *outfile, DLLSPEC *spec );
|
||||||
extern void load_res16_file( const char *name, DLLSPEC *spec );
|
extern void load_res16_file( const char *name, DLLSPEC *spec );
|
||||||
extern void output_res16_data( FILE *outfile, DLLSPEC *spec );
|
extern void output_res16_data( FILE *outfile, DLLSPEC *spec );
|
||||||
extern void output_res16_directory( FILE *outfile, DLLSPEC *spec, const char *header_name );
|
extern void output_res16_directory( FILE *outfile, DLLSPEC *spec, const char *header_name );
|
||||||
extern void output_dll_init( FILE *outfile, const char *constructor, const char *destructor );
|
|
||||||
|
|
||||||
extern void BuildRelays16( FILE *outfile );
|
extern void BuildRelays16( FILE *outfile );
|
||||||
extern void BuildRelays32( FILE *outfile );
|
extern void BuildRelays32( FILE *outfile );
|
||||||
extern void BuildSpec16File( FILE *outfile, DLLSPEC *spec );
|
extern void BuildSpec16File( FILE *outfile, DLLSPEC *spec );
|
||||||
extern void BuildSpec32File( FILE *outfile, DLLSPEC *spec );
|
extern void BuildSpec32File( FILE *outfile, DLLSPEC *spec );
|
||||||
extern void BuildDef32File( FILE *outfile, DLLSPEC *spec );
|
extern void BuildDef32File( FILE *outfile, DLLSPEC *spec );
|
||||||
extern void BuildDebugFile( FILE *outfile, const char *srcdir, char **argv );
|
|
||||||
|
|
||||||
extern int parse_spec_file( FILE *file, DLLSPEC *spec );
|
extern int parse_spec_file( FILE *file, DLLSPEC *spec );
|
||||||
extern int parse_def_file( FILE *file, DLLSPEC *spec );
|
extern int parse_def_file( FILE *file, DLLSPEC *spec );
|
||||||
extern int parse_debug_channels( const char *srcdir, const char *filename );
|
|
||||||
|
|
||||||
/* global variables */
|
/* global variables */
|
||||||
|
|
||||||
extern int current_line;
|
extern int current_line;
|
||||||
extern int UsePIC;
|
extern int UsePIC;
|
||||||
extern int nb_debug_channels;
|
|
||||||
extern int nb_lib_paths;
|
extern int nb_lib_paths;
|
||||||
extern int nb_errors;
|
extern int nb_errors;
|
||||||
extern int display_warnings;
|
extern int display_warnings;
|
||||||
|
@ -235,7 +231,6 @@ extern int save_temps;
|
||||||
extern char *input_file_name;
|
extern char *input_file_name;
|
||||||
extern char *spec_file_name;
|
extern char *spec_file_name;
|
||||||
extern const char *output_file_name;
|
extern const char *output_file_name;
|
||||||
extern char **debug_channels;
|
|
||||||
extern char **lib_path;
|
extern char **lib_path;
|
||||||
|
|
||||||
extern char *as_command;
|
extern char *as_command;
|
||||||
|
|
|
@ -41,7 +41,6 @@
|
||||||
#include "build.h"
|
#include "build.h"
|
||||||
|
|
||||||
int UsePIC = 0;
|
int UsePIC = 0;
|
||||||
int nb_debug_channels = 0;
|
|
||||||
int nb_lib_paths = 0;
|
int nb_lib_paths = 0;
|
||||||
int nb_errors = 0;
|
int nb_errors = 0;
|
||||||
int display_warnings = 0;
|
int display_warnings = 0;
|
||||||
|
@ -73,7 +72,6 @@ enum target_platform target_platform = PLATFORM_WINDOWS;
|
||||||
enum target_platform target_platform = PLATFORM_UNSPECIFIED;
|
enum target_platform target_platform = PLATFORM_UNSPECIFIED;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
char **debug_channels = NULL;
|
|
||||||
char **lib_path = NULL;
|
char **lib_path = NULL;
|
||||||
|
|
||||||
char *input_file_name = NULL;
|
char *input_file_name = NULL;
|
||||||
|
@ -86,7 +84,6 @@ char *ld_command = NULL;
|
||||||
char *nm_command = NULL;
|
char *nm_command = NULL;
|
||||||
|
|
||||||
static FILE *output_file;
|
static FILE *output_file;
|
||||||
static const char *current_src_dir;
|
|
||||||
static int nb_res_files;
|
static int nb_res_files;
|
||||||
static char **res_files;
|
static char **res_files;
|
||||||
|
|
||||||
|
@ -97,7 +94,6 @@ enum exec_mode_values
|
||||||
MODE_DLL,
|
MODE_DLL,
|
||||||
MODE_EXE,
|
MODE_EXE,
|
||||||
MODE_DEF,
|
MODE_DEF,
|
||||||
MODE_DEBUG,
|
|
||||||
MODE_RELAY16,
|
MODE_RELAY16,
|
||||||
MODE_RELAY32
|
MODE_RELAY32
|
||||||
};
|
};
|
||||||
|
@ -248,7 +244,6 @@ static const char usage_str[] =
|
||||||
"Usage: winebuild [OPTIONS] [FILES]\n\n"
|
"Usage: winebuild [OPTIONS] [FILES]\n\n"
|
||||||
"Options:\n"
|
"Options:\n"
|
||||||
" --as-cmd=AS Command to use for assembling (default: as)\n"
|
" --as-cmd=AS Command to use for assembling (default: as)\n"
|
||||||
" -C, --source-dir=DIR Look for source files in DIR\n"
|
|
||||||
" -d, --delay-lib=LIB Import the specified library in delayed mode\n"
|
" -d, --delay-lib=LIB Import the specified library in delayed mode\n"
|
||||||
" -D SYM Ignored for C flags compatibility\n"
|
" -D SYM Ignored for C flags compatibility\n"
|
||||||
" -E, --export=FILE Export the symbols defined in the .spec or .def file\n"
|
" -E, --export=FILE Export the symbols defined in the .spec or .def file\n"
|
||||||
|
@ -280,7 +275,6 @@ static const char usage_str[] =
|
||||||
" --dll Build a .c file from a .spec or .def file\n"
|
" --dll Build a .c file from a .spec or .def file\n"
|
||||||
" --def Build a .def file from a .spec file\n"
|
" --def Build a .def file from a .spec file\n"
|
||||||
" --exe Build a .c file for an executable\n"
|
" --exe Build a .c file for an executable\n"
|
||||||
" --debug [FILES] Build a .c file with the debug channels declarations\n"
|
|
||||||
" --relay16 Build the 16-bit relay assembly routines\n"
|
" --relay16 Build the 16-bit relay assembly routines\n"
|
||||||
" --relay32 Build the 32-bit relay assembly routines\n\n"
|
" --relay32 Build the 32-bit relay assembly routines\n\n"
|
||||||
"The mode options are mutually exclusive; you must specify one and only one.\n\n";
|
"The mode options are mutually exclusive; you must specify one and only one.\n\n";
|
||||||
|
@ -290,7 +284,6 @@ enum long_options_values
|
||||||
LONG_OPT_DLL = 1,
|
LONG_OPT_DLL = 1,
|
||||||
LONG_OPT_DEF,
|
LONG_OPT_DEF,
|
||||||
LONG_OPT_EXE,
|
LONG_OPT_EXE,
|
||||||
LONG_OPT_DEBUG,
|
|
||||||
LONG_OPT_ASCMD,
|
LONG_OPT_ASCMD,
|
||||||
LONG_OPT_LDCMD,
|
LONG_OPT_LDCMD,
|
||||||
LONG_OPT_NMCMD,
|
LONG_OPT_NMCMD,
|
||||||
|
@ -309,7 +302,6 @@ static const struct option long_options[] =
|
||||||
{ "dll", 0, 0, LONG_OPT_DLL },
|
{ "dll", 0, 0, LONG_OPT_DLL },
|
||||||
{ "def", 0, 0, LONG_OPT_DEF },
|
{ "def", 0, 0, LONG_OPT_DEF },
|
||||||
{ "exe", 0, 0, LONG_OPT_EXE },
|
{ "exe", 0, 0, LONG_OPT_EXE },
|
||||||
{ "debug", 0, 0, LONG_OPT_DEBUG },
|
|
||||||
{ "as-cmd", 1, 0, LONG_OPT_ASCMD },
|
{ "as-cmd", 1, 0, LONG_OPT_ASCMD },
|
||||||
{ "ld-cmd", 1, 0, LONG_OPT_LDCMD },
|
{ "ld-cmd", 1, 0, LONG_OPT_LDCMD },
|
||||||
{ "nm-cmd", 1, 0, LONG_OPT_NMCMD },
|
{ "nm-cmd", 1, 0, LONG_OPT_NMCMD },
|
||||||
|
@ -320,7 +312,6 @@ static const struct option long_options[] =
|
||||||
{ "target", 1, 0, LONG_OPT_TARGET },
|
{ "target", 1, 0, LONG_OPT_TARGET },
|
||||||
{ "version", 0, 0, LONG_OPT_VERSION },
|
{ "version", 0, 0, LONG_OPT_VERSION },
|
||||||
/* aliases for short options */
|
/* aliases for short options */
|
||||||
{ "source-dir", 1, 0, 'C' },
|
|
||||||
{ "delay-lib", 1, 0, 'd' },
|
{ "delay-lib", 1, 0, 'd' },
|
||||||
{ "export", 1, 0, 'E' },
|
{ "export", 1, 0, 'E' },
|
||||||
{ "entry", 1, 0, 'e' },
|
{ "entry", 1, 0, 'e' },
|
||||||
|
@ -363,9 +354,6 @@ static char **parse_options( int argc, char **argv, DLLSPEC *spec )
|
||||||
{
|
{
|
||||||
switch(optc)
|
switch(optc)
|
||||||
{
|
{
|
||||||
case 'C':
|
|
||||||
current_src_dir = optarg;
|
|
||||||
break;
|
|
||||||
case 'D':
|
case 'D':
|
||||||
/* ignored */
|
/* ignored */
|
||||||
break;
|
break;
|
||||||
|
@ -475,9 +463,6 @@ static char **parse_options( int argc, char **argv, DLLSPEC *spec )
|
||||||
set_exec_mode( MODE_EXE );
|
set_exec_mode( MODE_EXE );
|
||||||
if (!spec->subsystem) spec->subsystem = IMAGE_SUBSYSTEM_WINDOWS_GUI;
|
if (!spec->subsystem) spec->subsystem = IMAGE_SUBSYSTEM_WINDOWS_GUI;
|
||||||
break;
|
break;
|
||||||
case LONG_OPT_DEBUG:
|
|
||||||
set_exec_mode( MODE_DEBUG );
|
|
||||||
break;
|
|
||||||
case LONG_OPT_ASCMD:
|
case LONG_OPT_ASCMD:
|
||||||
as_command = xstrdup( optarg );
|
as_command = xstrdup( optarg );
|
||||||
break;
|
break;
|
||||||
|
@ -632,9 +617,6 @@ int main(int argc, char **argv)
|
||||||
if (!parse_input_file( spec )) break;
|
if (!parse_input_file( spec )) break;
|
||||||
BuildDef32File( output_file, spec );
|
BuildDef32File( output_file, spec );
|
||||||
break;
|
break;
|
||||||
case MODE_DEBUG:
|
|
||||||
BuildDebugFile( output_file, current_src_dir, argv );
|
|
||||||
break;
|
|
||||||
case MODE_RELAY16:
|
case MODE_RELAY16:
|
||||||
if (argv[0]) fatal_error( "file argument '%s' not allowed in this mode\n", argv[0] );
|
if (argv[0]) fatal_error( "file argument '%s' not allowed in this mode\n", argv[0] );
|
||||||
BuildRelays16( output_file );
|
BuildRelays16( output_file );
|
||||||
|
|
|
@ -967,80 +967,3 @@ int parse_def_file( FILE *file, DLLSPEC *spec )
|
||||||
assign_ordinals( spec );
|
assign_ordinals( spec );
|
||||||
return !nb_errors;
|
return !nb_errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************
|
|
||||||
* add_debug_channel
|
|
||||||
*/
|
|
||||||
static void add_debug_channel( const char *name )
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < nb_debug_channels; i++)
|
|
||||||
if (!strcmp( debug_channels[i], name )) return;
|
|
||||||
|
|
||||||
debug_channels = xrealloc( debug_channels, (nb_debug_channels + 1) * sizeof(*debug_channels));
|
|
||||||
debug_channels[nb_debug_channels++] = xstrdup(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************
|
|
||||||
* parse_debug_channels
|
|
||||||
*
|
|
||||||
* Parse a source file and extract the debug channel definitions.
|
|
||||||
*/
|
|
||||||
int parse_debug_channels( const char *srcdir, const char *filename )
|
|
||||||
{
|
|
||||||
FILE *file;
|
|
||||||
int eol_seen = 1;
|
|
||||||
|
|
||||||
file = open_input_file( srcdir, filename );
|
|
||||||
while (fgets( ParseBuffer, sizeof(ParseBuffer), file ))
|
|
||||||
{
|
|
||||||
char *channel, *end, *p = ParseBuffer;
|
|
||||||
|
|
||||||
p = ParseBuffer + strlen(ParseBuffer) - 1;
|
|
||||||
if (!eol_seen) /* continuation line */
|
|
||||||
{
|
|
||||||
eol_seen = (*p == '\n');
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if ((eol_seen = (*p == '\n'))) *p = 0;
|
|
||||||
|
|
||||||
p = ParseBuffer;
|
|
||||||
while (isspace(*p)) p++;
|
|
||||||
if (!memcmp( p, "WINE_DECLARE_DEBUG_CHANNEL", 26 ) ||
|
|
||||||
!memcmp( p, "WINE_DEFAULT_DEBUG_CHANNEL", 26 ))
|
|
||||||
{
|
|
||||||
p += 26;
|
|
||||||
while (isspace(*p)) p++;
|
|
||||||
if (*p != '(')
|
|
||||||
{
|
|
||||||
error( "invalid debug channel specification '%s'\n", ParseBuffer );
|
|
||||||
goto next;
|
|
||||||
}
|
|
||||||
p++;
|
|
||||||
while (isspace(*p)) p++;
|
|
||||||
if (!isalpha(*p))
|
|
||||||
{
|
|
||||||
error( "invalid debug channel specification '%s'\n", ParseBuffer );
|
|
||||||
goto next;
|
|
||||||
}
|
|
||||||
channel = p;
|
|
||||||
while (isalnum(*p) || *p == '_') p++;
|
|
||||||
end = p;
|
|
||||||
while (isspace(*p)) p++;
|
|
||||||
if (*p != ')')
|
|
||||||
{
|
|
||||||
error( "invalid debug channel specification '%s'\n", ParseBuffer );
|
|
||||||
goto next;
|
|
||||||
}
|
|
||||||
*end = 0;
|
|
||||||
add_debug_channel( channel );
|
|
||||||
}
|
|
||||||
next:
|
|
||||||
current_line++;
|
|
||||||
}
|
|
||||||
close_input_file( file );
|
|
||||||
return !nb_errors;
|
|
||||||
}
|
|
||||||
|
|
|
@ -36,46 +36,6 @@
|
||||||
#include "build.h"
|
#include "build.h"
|
||||||
|
|
||||||
|
|
||||||
static int string_compare( const void *ptr1, const void *ptr2 )
|
|
||||||
{
|
|
||||||
const char * const *str1 = ptr1;
|
|
||||||
const char * const *str2 = ptr2;
|
|
||||||
return strcmp( *str1, *str2 );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************
|
|
||||||
* output_debug
|
|
||||||
*
|
|
||||||
* Output the debug channels.
|
|
||||||
*/
|
|
||||||
static int output_debug( FILE *outfile )
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
if (!nb_debug_channels) return 0;
|
|
||||||
qsort( debug_channels, nb_debug_channels, sizeof(debug_channels[0]), string_compare );
|
|
||||||
|
|
||||||
fprintf( outfile, "#include \"wine/debug.h\"\n\n" );
|
|
||||||
|
|
||||||
for (i = 0; i < nb_debug_channels; i++)
|
|
||||||
fprintf( outfile, "struct __wine_debug_channel __wine_dbch_%s = { 3, \"%s\" };\n",
|
|
||||||
debug_channels[i], debug_channels[i] );
|
|
||||||
|
|
||||||
fprintf( outfile, "\nstatic struct __wine_debug_channel * const debug_channels[%d] =\n{\n",
|
|
||||||
nb_debug_channels );
|
|
||||||
for (i = 0; i < nb_debug_channels; i++)
|
|
||||||
{
|
|
||||||
fprintf( outfile, " &__wine_dbch_%s", debug_channels[i] );
|
|
||||||
if (i < nb_debug_channels - 1) fprintf( outfile, ",\n" );
|
|
||||||
}
|
|
||||||
fprintf( outfile, "\n};\n\n" );
|
|
||||||
fprintf( outfile, "static void *debug_registration;\n\n" );
|
|
||||||
|
|
||||||
return nb_debug_channels;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************
|
/*******************************************************************
|
||||||
* output_exports
|
* output_exports
|
||||||
*
|
*
|
||||||
|
@ -253,96 +213,6 @@ static void output_exports( FILE *outfile, DLLSPEC *spec )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************
|
|
||||||
* output_dll_init
|
|
||||||
*
|
|
||||||
* Output code for calling a dll constructor and destructor.
|
|
||||||
*/
|
|
||||||
void output_dll_init( FILE *outfile, const char *constructor, const char *destructor )
|
|
||||||
{
|
|
||||||
if (target_platform == PLATFORM_APPLE)
|
|
||||||
{
|
|
||||||
/* Mach-O doesn't have an init section */
|
|
||||||
if (constructor)
|
|
||||||
{
|
|
||||||
fprintf( outfile, "asm(\"\\t.mod_init_func\\n\"\n" );
|
|
||||||
fprintf( outfile, " \"\\t.align 2\\n\"\n" );
|
|
||||||
fprintf( outfile, " \"\\t.long %s\\n\"\n", asm_name(constructor) );
|
|
||||||
fprintf( outfile, " \"\\t.text\\n\");\n" );
|
|
||||||
}
|
|
||||||
if (destructor)
|
|
||||||
{
|
|
||||||
fprintf( outfile, "asm(\"\\t.mod_term_func\\n\"\n" );
|
|
||||||
fprintf( outfile, " \"\\t.align 2\\n\"\n" );
|
|
||||||
fprintf( outfile, " \"\\t.long %s\\n\"\n", asm_name(destructor) );
|
|
||||||
fprintf( outfile, " \"\\t.text\\n\");\n" );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else switch(target_cpu)
|
|
||||||
{
|
|
||||||
case CPU_x86:
|
|
||||||
case CPU_x86_64:
|
|
||||||
if (constructor)
|
|
||||||
{
|
|
||||||
fprintf( outfile, "asm(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" );
|
|
||||||
fprintf( outfile, " \"\\tcall %s\\n\"\n", asm_name(constructor) );
|
|
||||||
fprintf( outfile, " \"\\t.section\\t\\\".text\\\"\\n\");\n" );
|
|
||||||
}
|
|
||||||
if (destructor)
|
|
||||||
{
|
|
||||||
fprintf( outfile, "asm(\"\\t.section\\t\\\".fini\\\" ,\\\"ax\\\"\\n\"\n" );
|
|
||||||
fprintf( outfile, " \"\\tcall %s\\n\"\n", asm_name(destructor) );
|
|
||||||
fprintf( outfile, " \"\\t.section\\t\\\".text\\\"\\n\");\n" );
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case CPU_SPARC:
|
|
||||||
if (constructor)
|
|
||||||
{
|
|
||||||
fprintf( outfile, "asm(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" );
|
|
||||||
fprintf( outfile, " \"\\tcall %s\\n\"\n", asm_name(constructor) );
|
|
||||||
fprintf( outfile, " \"\\tnop\\n\"\n" );
|
|
||||||
fprintf( outfile, " \"\\t.section\\t\\\".text\\\"\\n\");\n" );
|
|
||||||
}
|
|
||||||
if (destructor)
|
|
||||||
{
|
|
||||||
fprintf( outfile, "asm(\"\\t.section\\t\\\".fini\\\" ,\\\"ax\\\"\\n\"\n" );
|
|
||||||
fprintf( outfile, " \"\\tcall %s\\n\"\n", asm_name(destructor) );
|
|
||||||
fprintf( outfile, " \"\\tnop\\n\"\n" );
|
|
||||||
fprintf( outfile, " \"\\t.section\\t\\\".text\\\"\\n\");\n" );
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case CPU_ALPHA:
|
|
||||||
if (constructor)
|
|
||||||
{
|
|
||||||
fprintf( outfile, "asm(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" );
|
|
||||||
fprintf( outfile, " \"\\tjsr $26,%s\\n\"\n", asm_name(constructor) );
|
|
||||||
fprintf( outfile, " \"\\t.section\\t\\\".text\\\"\\n\");\n" );
|
|
||||||
}
|
|
||||||
if (destructor)
|
|
||||||
{
|
|
||||||
fprintf( outfile, "asm(\"\\t.section\\t\\\".fini\\\" ,\\\"ax\\\"\\n\"\n" );
|
|
||||||
fprintf( outfile, " \"\\tjsr $26,%s\\n\"\n", asm_name(destructor) );
|
|
||||||
fprintf( outfile, " \"\\t.section\\t\\\".text\\\"\\n\");\n" );
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case CPU_POWERPC:
|
|
||||||
if (constructor)
|
|
||||||
{
|
|
||||||
fprintf( outfile, "asm(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" );
|
|
||||||
fprintf( outfile, " \"\\tbl %s\\n\"\n", asm_name(constructor) );
|
|
||||||
fprintf( outfile, " \"\\t.section\\t\\\".text\\\"\\n\");\n" );
|
|
||||||
}
|
|
||||||
if (destructor)
|
|
||||||
{
|
|
||||||
fprintf( outfile, "asm(\"\\t.section\\t\\\".fini\\\" ,\\\"ax\\\"\\n\"\n" );
|
|
||||||
fprintf( outfile, " \"\\tbl %s\\n\"\n", asm_name(destructor) );
|
|
||||||
fprintf( outfile, " \"\\t.section\\t\\\".text\\\"\\n\");\n" );
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************
|
/*******************************************************************
|
||||||
* output_asm_constructor
|
* output_asm_constructor
|
||||||
*
|
*
|
||||||
|
@ -597,70 +467,3 @@ void BuildDef32File( FILE *outfile, DLLSPEC *spec )
|
||||||
}
|
}
|
||||||
if (!total) warning( "%s: Import library doesn't export anything\n", spec->file_name );
|
if (!total) warning( "%s: Import library doesn't export anything\n", spec->file_name );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************
|
|
||||||
* BuildDebugFile
|
|
||||||
*
|
|
||||||
* Build the debugging channels source file.
|
|
||||||
*/
|
|
||||||
void BuildDebugFile( FILE *outfile, const char *srcdir, char **argv )
|
|
||||||
{
|
|
||||||
int nr_debug;
|
|
||||||
char *prefix, *p, *constructor, *destructor;
|
|
||||||
|
|
||||||
while (*argv)
|
|
||||||
{
|
|
||||||
if (!parse_debug_channels( srcdir, *argv++ )) exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
output_standard_file_header( outfile );
|
|
||||||
nr_debug = output_debug( outfile );
|
|
||||||
if (!nr_debug)
|
|
||||||
{
|
|
||||||
fprintf( outfile, "/* no debug channels found for this module */\n" );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (output_file_name)
|
|
||||||
{
|
|
||||||
if ((p = strrchr( output_file_name, '/' ))) p++;
|
|
||||||
prefix = xstrdup( p ? p : output_file_name );
|
|
||||||
if ((p = strchr( prefix, '.' ))) *p = 0;
|
|
||||||
strcpy( p, make_c_identifier(p) );
|
|
||||||
}
|
|
||||||
else prefix = xstrdup( "_" );
|
|
||||||
|
|
||||||
/* Output the DLL constructor */
|
|
||||||
|
|
||||||
constructor = xmalloc( strlen(prefix) + 17 );
|
|
||||||
destructor = xmalloc( strlen(prefix) + 17 );
|
|
||||||
sprintf( constructor, "__wine_dbg_%s_init", prefix );
|
|
||||||
sprintf( destructor, "__wine_dbg_%s_fini", prefix );
|
|
||||||
fprintf( outfile,
|
|
||||||
"#ifdef __GNUC__\n"
|
|
||||||
"void %s(void) __attribute__((constructor));\n"
|
|
||||||
"void %s(void) __attribute__((destructor));\n"
|
|
||||||
"#else\n"
|
|
||||||
"static void __asm__dummy_dll_init(void) {\n",
|
|
||||||
constructor, destructor );
|
|
||||||
output_dll_init( outfile, constructor, destructor );
|
|
||||||
fprintf( outfile, "}\n#endif /* defined(__GNUC__) */\n\n" );
|
|
||||||
|
|
||||||
fprintf( outfile,
|
|
||||||
"void %s(void)\n"
|
|
||||||
"{\n"
|
|
||||||
" extern void *__wine_dbg_register( struct __wine_debug_channel * const *, int );\n"
|
|
||||||
" if (!debug_registration) debug_registration = __wine_dbg_register( debug_channels, %d );\n"
|
|
||||||
"}\n\n", constructor, nr_debug );
|
|
||||||
fprintf( outfile,
|
|
||||||
"void %s(void)\n"
|
|
||||||
"{\n"
|
|
||||||
" extern void __wine_dbg_unregister( void* );\n"
|
|
||||||
" __wine_dbg_unregister( debug_registration );\n"
|
|
||||||
"}\n", destructor );
|
|
||||||
|
|
||||||
free( constructor );
|
|
||||||
free( destructor );
|
|
||||||
free( prefix );
|
|
||||||
}
|
|
||||||
|
|
|
@ -6,9 +6,8 @@ winebuild \- Wine dll builder
|
||||||
.BI winebuild\ [options]\ [input\ files]
|
.BI winebuild\ [options]\ [input\ files]
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.B winebuild
|
.B winebuild
|
||||||
generates the C and assembly files that are necessary to build a Wine
|
generates the assembly files that are necessary to build a Wine dll,
|
||||||
dll, which is basically a Win32 dll encapsulated inside a Unix
|
which is basically a Win32 dll encapsulated inside a Unix library.
|
||||||
library.
|
|
||||||
.PP
|
.PP
|
||||||
.B winebuild
|
.B winebuild
|
||||||
has different modes, depending on what kind of file it is asked to
|
has different modes, depending on what kind of file it is asked to
|
||||||
|
@ -47,14 +46,6 @@ executable, and all the other object files must be listed as
|
||||||
Build a .def file from a spec file. The .spec file is specified via the
|
Build a .def file from a spec file. The .spec file is specified via the
|
||||||
-E option. This is used when building dlls with a PE (Win32) compiler.
|
-E option. This is used when building dlls with a PE (Win32) compiler.
|
||||||
.TP
|
.TP
|
||||||
.B \--debug
|
|
||||||
Build a C file containing the definitions for debugging channels. In
|
|
||||||
that mode the
|
|
||||||
.I input files
|
|
||||||
should be a list of C files to search for debug channel
|
|
||||||
definitions. The resulting C file must be compiled and linked with the
|
|
||||||
dll.
|
|
||||||
.TP
|
|
||||||
.B \--relay16
|
.B \--relay16
|
||||||
Generate the assembly code for the 16-bit relay routines. This is for
|
Generate the assembly code for the 16-bit relay routines. This is for
|
||||||
Wine internal usage only, you should never need to use this option.
|
Wine internal usage only, you should never need to use this option.
|
||||||
|
@ -68,11 +59,6 @@ Wine internal usage only, you should never need to use this option.
|
||||||
Specify the command to use to compile assembly files; the default is
|
Specify the command to use to compile assembly files; the default is
|
||||||
\fBas\fR.
|
\fBas\fR.
|
||||||
.TP
|
.TP
|
||||||
.BI \-C,\ --source-dir= directory
|
|
||||||
Change to the specified directory before reading source files. Only
|
|
||||||
meaningful in
|
|
||||||
.BR \--debug\ mode.
|
|
||||||
.TP
|
|
||||||
.BI \-d,\ --delay-lib= name
|
.BI \-d,\ --delay-lib= name
|
||||||
Set the delayed import mode for the specified library, which must be
|
Set the delayed import mode for the specified library, which must be
|
||||||
one of the libraries imported with the \fB-l\fR option. Delayed mode
|
one of the libraries imported with the \fB-l\fR option. Delayed mode
|
||||||
|
|
Loading…
Reference in New Issue