Commit 7ddab756 authored by Alexandre Julliard's avatar Alexandre Julliard

Declare debug channels as static variables so that we don't need to

generate an external .dbg.c file to define them.
parent 8165b584
......@@ -107,7 +107,7 @@ prog_manext = 1
api_manext = 3w
conf_manext = 5
CLEAN_FILES = *.o *.a *.so *.ln *.$(LIBEXT) \\\#*\\\# *~ *% .\\\#* *.bak *.orig *.rej \
*.flc *.dbg.c *.tab.c *.tab.h @LEX_OUTPUT_ROOT@.c core
*.flc *.tab.c *.tab.h @LEX_OUTPUT_ROOT@.c core
OBJS = $(C_SRCS:.c=.o) $(EXTRA_OBJS)
......@@ -167,11 +167,6 @@ $(RC_BINARIES): $(BIN2RES) $(RC_BINSRC)
$(RC_SRCS:.rc=.res) $(RC_SRCS16:.rc=.res): $(WRC) $(RC_BINARIES) $(RC_TLB)
# Rule for main module debug channels
$(MODULE).dbg.c: $(C_SRCS) $(C_SRCS16) $(WINEBUILD)
$(WINEBUILD) $(DEFS) -o $@ --debug -C$(SRCDIR) $(C_SRCS) $(C_SRCS16)
# Rules for makefile
Makefile: Makefile.in $(TOPSRCDIR)/configure
......
......@@ -136,10 +136,10 @@ $(TESTSUBDIRS:%=%/__crosstest__): tools include
# Misc rules
TAGS etags:
find $(TOPSRCDIR) -name '*.[ch]' -a -not -name '*.dbg.c' -print | etags -
find $(TOPSRCDIR) -name '*.[ch]' -print | etags -
tags ctags:
find $(TOPSRCDIR) -name '*.[ch]' -a -not -name '*.dbg.c' -print | ctags --c-types=+px -L -
find $(TOPSRCDIR) -name '*.[ch]' -print | ctags --c-types=+px -L -
manpages htmlpages sgmlpages:
cd documentation && $(MAKE) $@
......
......@@ -18,7 +18,7 @@ BASEMODULE = $(MODULE:%.dll=%)
MAINSPEC = $(BASEMODULE).spec
SPEC_DEF = lib$(BASEMODULE).def
WIN16_FILES = $(SPEC_SRCS16:.spec=.spec.o) $(C_SRCS16:.c=.o) $(EXTRA_OBJS16)
ALL_OBJS = @WIN16_FILES@ $(OBJS) $(MODULE).dbg.o $(RC_SRCS:.rc=.res)
ALL_OBJS = @WIN16_FILES@ $(OBJS) $(RC_SRCS:.rc=.res)
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBPORT) $(LDFLAGS) $(LIBS)
ALL_IMPORTS = $(DELAYIMPORTS) $(IMPORTS)
IMPLIB_OBJS = $(IMPLIB_SRCS:.c=.o)
......@@ -36,8 +36,8 @@ $(MODULE).so: $(MAINSPEC) $(ALL_OBJS) Makefile.in
# Rules for .dll files
$(MODULE): $(RCOBJS) $(OBJS) $(MODULE).dbg.o $(SPEC_DEF) Makefile.in
$(DLLWRAP) -k --def $(SPEC_DEF) -o $@ $(RCOBJS) $(OBJS) $(MODULE).dbg.o $(DLL_LDPATH) $(ALL_IMPORTS:%=-l%) $(ALL_LIBS)
$(MODULE): $(RCOBJS) $(OBJS) $(SPEC_DEF) Makefile.in
$(DLLWRAP) -k --def $(SPEC_DEF) -o $@ $(RCOBJS) $(OBJS) $(DLL_LDPATH) $(ALL_IMPORTS:%=-l%) $(ALL_LIBS)
# Rules for import libraries
......@@ -68,8 +68,8 @@ $(SUBDIRS): implib
$(WIN16_FILES:%=__checklink16__%): checklink16
checklink16:: $(MAINSPEC).o $(OBJS) $(MODULE).dbg.o dummy
$(CC) -o checklink -Wl,-rpath,$(TOPOBJDIR)/libs $(TOPSRCDIR)/dlls/checklink.c $(MAINSPEC).o $(OBJS) $(MODULE).dbg.o -L$(DLLDIR) $(ALL_LIBS) -lwinecrt0 -lm && $(RM) checklink $(MAINSPEC).o
checklink16:: $(MAINSPEC).o $(OBJS) dummy
$(CC) -o checklink -Wl,-rpath,$(TOPOBJDIR)/libs $(TOPSRCDIR)/dlls/checklink.c $(MAINSPEC).o $(OBJS) -L$(DLLDIR) $(ALL_LIBS) -lwinecrt0 -lm && $(RM) checklink $(MAINSPEC).o
checklink:: $(WIN16_FILES:%=__checklink16__%)
......
......@@ -7,8 +7,6 @@ MODULE = libdxerr8.a
C_SRCS = \
dxerr8.c
EXTRA_OBJS = $(MODULE).dbg.o
@MAKE_IMPLIB_RULES@
### Dependencies:
......@@ -7,8 +7,6 @@ MODULE = libdxerr9.a
C_SRCS = \
dxerr9.c
EXTRA_OBJS = $(MODULE).dbg.o
@MAKE_IMPLIB_RULES@
### Dependencies:
......@@ -933,12 +933,9 @@ static BOOL process_init(void)
{
static const WCHAR kernel32W[] = {'k','e','r','n','e','l','3','2',0};
PEB *peb = NtCurrentTeb()->Peb;
extern void __wine_dbg_kernel32_init(void);
PTHREAD_Init();
__wine_dbg_kernel32_init(); /* hack: register debug channels early */
setbuf(stdout,NULL);
setbuf(stderr,NULL);
setlocale(LC_CTYPE,"");
......
......@@ -200,8 +200,5 @@ static const struct __wine_debug_functions funcs =
*/
void debug_init(void)
{
extern void __wine_dbg_ntdll_init(void);
__wine_dbg_set_functions( &funcs, &default_funcs, sizeof(funcs) );
__wine_dbg_ntdll_init(); /* hack: register debug channels early */
}
......@@ -234,9 +234,9 @@ static inline const char *wine_dbgstr_longlong( ULONGLONG ll )
#define WINE_ERR_ON(ch) __WINE_IS_DEBUG_ON(_ERR,&__wine_dbch_##ch)
#define WINE_DECLARE_DEBUG_CHANNEL(ch) \
extern struct __wine_debug_channel __wine_dbch_##ch
static struct __wine_debug_channel __wine_dbch_##ch = { ~0, #ch }
#define WINE_DEFAULT_DEBUG_CHANNEL(ch) \
extern struct __wine_debug_channel __wine_dbch_##ch; \
static struct __wine_debug_channel __wine_dbch_##ch = { ~0, #ch }; \
static struct __wine_debug_channel * const __wine_dbch___default = &__wine_dbch_##ch
#define WINE_DPRINTF wine_dbg_printf
......
......@@ -12,7 +12,6 @@
DLLDEFS = @DLLDEFS@
DLLFLAGS = @DLLFLAGS@
DEFS = $(DLLDEFS) $(EXTRADEFS)
ALL_OBJS = $(OBJS) $(MODULE).dbg.o
ALL_IMPORTS = $(DELAYIMPORTS) $(IMPORTS)
ALL_LIBS = $(ALL_IMPORTS:%=-l%) $(LIBWINE) $(EXTRALIBS) $(LIBPORT) $(LDFLAGS) $(LIBS)
DLL_LDPATH = -L$(DLLDIR) $(ALL_IMPORTS:%=-L$(DLLDIR)/%)
......@@ -25,16 +24,16 @@ all: $(MODULE)$(DLLEXT) $(BASEMODULE)$(EXEEXT)
# Rules for .so main module
$(MODULE).so: $(ALL_OBJS) $(RC_SRCS:.rc=.res) Makefile.in
$(WINEGCC) -B$(TOOLSDIR)/tools/winebuild $(APPMODE) $(ALL_OBJS) $(RC_SRCS:.rc=.res) -o $@ $(DLL_LDPATH) $(ALL_LIBS) $(DELAYIMPORTS:%=-Wb,-d%)
$(MODULE).so: $(OBJS) $(RC_SRCS:.rc=.res) Makefile.in
$(WINEGCC) -B$(TOOLSDIR)/tools/winebuild $(APPMODE) $(OBJS) $(RC_SRCS:.rc=.res) -o $@ $(DLL_LDPATH) $(ALL_LIBS) $(DELAYIMPORTS:%=-Wb,-d%)
$(BASEMODULE): $(WINEWRAPPER)
$(RM) $@ && $(LN_S) $(WINEWRAPPER) $@
# Rules for .exe main module
$(MODULE): $(ALL_OBJS) $(RCOBJS) Makefile.in
$(CC) $(APPMODE) $(ALL_OBJS) $(RCOBJS) -o $@ $(ALL_LIBS)
$(MODULE): $(OBJS) $(RCOBJS) Makefile.in
$(CC) $(APPMODE) $(OBJS) $(RCOBJS) -o $@ $(ALL_LIBS)
# Rules for testing
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment