Commit ad53383f authored by Alexandre Julliard's avatar Alexandre Julliard

Added winebuild support for generating a .dbg.c file containing the

debug channels definitions. Made win32 the default type for spec files. Ignore C compiler in winebuild so we can simply pass it $(DEFS). Removed type win32 and debug_channels from spec files. Fixed winebuild to always generate correct C identifiers (reported by Vincent Béron).
parent ec329ab3
......@@ -107,7 +107,7 @@ dlldir = @libdir@/wine
prog_manext = 1
conf_manext = 5
CLEAN_FILES = *.o *.a *.so *.ln *.$(LIBEXT) \\\#*\\\# *~ *% .\\\#* *.bak *.orig *.rej \
*.flc *.spec.c *.spec.def *.glue.c y.tab.c y.tab.h @LEX_OUTPUT_ROOT@.c core
*.flc *.spec.c *.spec.def *.glue.c *.dbg.c y.tab.c y.tab.h @LEX_OUTPUT_ROOT@.c core
OBJS = $(C_SRCS:.c=.o) $(GEN_C_SRCS:.c=.o) $(GEN_ASM_SRCS:.s=.o) \
$(ASM_SRCS:.S=.o) $(GLUE:.c=.glue.o) $(EXTRA_OBJS)
......@@ -137,13 +137,13 @@ LINTS = $(C_SRCS:.c=.ln)
$(WINDRES) -i $< -o $@
.spec.spec.c:
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -o $@ -spec $<
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -spec $<
.spec.spec.def:
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -o $@ -def $<
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -def $<
.c.glue.c:
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -o $@ -glue $<
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -glue $<
.c.ln:
$(LINT) -c $(ALLLINTFLAGS) $< || ( $(RM) $@ && exit 1 )
......@@ -169,6 +169,11 @@ $(MODULE).tmp.o: $(SPEC_SRCS:.spec=.spec.o) $(OBJS) Makefile.in
$(LDCOMBINE) $(SPEC_SRCS:.spec=.spec.o) $(OBJS) -o $@
-$(STRIP) --strip-unneeded $@
# Rule for main module debug channels
$(MODULE).dbg.c: $(C_SRCS) $(WINEBUILD)
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -debug -C$(SRCDIR) $(C_SRCS)
# Rule to rebuild the resource compiler
$(WRC):
......@@ -232,8 +237,8 @@ winapi_check::
$(SUBDIRS:%=%/__depend__): $(MAKEDEP) dummy
cd `dirname $@` && $(MAKE) depend
depend: $(MAKEDEP) $(GEN_C_SRCS) $(SUBDIRS:%=%/__depend__)
$(MAKEDEP) $(DIVINCL) -C$(SRCDIR) $(C_SRCS) $(RC_SRCS) $(RC_SRCS16) $(MC_SRCS) $(EXTRA_SRCS) $(CTESTS) -C. $(GEN_C_SRCS)
depend: $(MAKEDEP) $(SUBDIRS:%=%/__depend__)
$(MAKEDEP) $(DIVINCL) -C$(SRCDIR) $(C_SRCS) $(RC_SRCS) $(RC_SRCS16) $(MC_SRCS) $(EXTRA_SRCS) $(CTESTS)
# Rules for cleaning
......@@ -290,7 +295,7 @@ $(TESTPROGRAM).tmp.o: $(TESTOBJS)
-$(STRIP) --strip-unneeded $@
$(TESTPROGRAM).spec.c: $(TESTPROGRAM).tmp.o $(WINEBUILD)
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -sym $(TESTPROGRAM).tmp.o -o $@ -exe $(TESTPROGRAM) -mcui -L$(DLLDIR) $(TESTIMPORTS:%=-l%)
$(LDPATH) $(WINEBUILD) $(DEFS) -sym $(TESTPROGRAM).tmp.o -o $@ -exe $(TESTPROGRAM) -mcui -L$(DLLDIR) $(TESTIMPORTS:%=-l%)
$(TESTPROGRAM).exe: $(TESTOBJS)
$(CC) $(TESTOBJS) -o $@ $(TESTIMPORTS:%=-l%) $(LIBWINE) $(LIBS)
......
Makefile
lex.yy.c
winedbg
winedbg.dbg.c
winedbg.spec.c
y.tab.c
y.tab.h
......@@ -14,7 +14,7 @@ ALTSPECS = $(ALTNAMES:%.dll=%)
SPEC_SRCS = $(ALTSPECS:%=%.spec)
MAINSPEC = $(MODULE:%.dll=%).spec
SPEC_DEF = $(MAINSPEC).def
ALL_OBJS = $(MAINSPEC).o $(SPEC_SRCS:.spec=.spec.o) $(OBJS)
ALL_OBJS = $(MAINSPEC).o $(SPEC_SRCS:.spec=.spec.o) $(OBJS) $(MODULE).dbg.o
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBS)
TESTIMPORTS = $(MODULE) $(DELAYIMPORTS) $(IMPORTS)
......@@ -25,7 +25,7 @@ all: $(MODULE)$(DLLEXT)
# Rule for main module spec file
$(MAINSPEC).c: $(MAINSPEC) $(RC_SRCS:.rc=.res) $(SYMBOLFILE) $(WINEBUILD)
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ $(SYMBOLFILE:%=-sym %) -o $@ -spec $(SRCDIR)/$(MAINSPEC) $(RC_SRCS:%.rc=-res %.res) -L$(DLLDIR) $(DELAYIMPORTS:%=-dl%) $(IMPORTS:%=-l%)
$(LDPATH) $(WINEBUILD) $(DEFS) $(SYMBOLFILE:%=-sym %) -o $@ -spec $(SRCDIR)/$(MAINSPEC) $(RC_SRCS:%.rc=-res %.res) -L$(DLLDIR) $(DELAYIMPORTS:%=-dl%) $(IMPORTS:%=-l%)
# Rules for .so files
......@@ -34,8 +34,8 @@ $(MODULE).so: $(ALL_OBJS) Makefile.in
# Rules for .dll files
$(MODULE): $(OBJS) $(SPEC_DEF) Makefile.in
$(DLLWRAP) $(DLLWRAPFLAGS) --def $(SPEC_DEF) --implib $(MODULE:.dll=.a) -o $(MODULE) $(OBJS) -L$(DLLDIR) $(IMPORTS:%=-l%) $(ALL_LIBS)
$(MODULE): $(OBJS) $(MODULE).dbg.o $(SPEC_DEF) Makefile.in
$(DLLWRAP) $(DLLWRAPFLAGS) --def $(SPEC_DEF) --implib $(MODULE:.dll=.a) -o $(MODULE) $(OBJS) $(MODULE).dbg.o -L$(DLLDIR) $(IMPORTS:%=-l%) $(ALL_LIBS)
$(SPEC_DEF): $(WINEBUILD)
......@@ -48,11 +48,6 @@ checklink:: $(MODULE)$(DLLEXT)
$(TESTRESULTS): $(MODULE)$(DLLEXT)
# Rules for debug channels
debug_channels: dummy
$(TOPSRCDIR)/tools/make_debug $(MAINSPEC) $(C_SRCS) $(SUBDIRS:%=%/*.c)
# Sanity check
Makedll.rules: $(TOPSRCDIR)/Makedll.rules.in $(TOPSRCDIR)/configure
......
Makefile
advapi32.dll.dbg.c
advapi32.spec.c
name advapi32
type win32
debug_channels (advapi crypt reg)
@ stdcall AbortSystemShutdownA(ptr) AbortSystemShutdownA
@ stdcall AbortSystemShutdownW(ptr) AbortSystemShutdownW
......
Makefile
avicap32.dll.dbg.c
avicap32.spec.c
name avicap32
type win32
debug_channels ()
Makefile
avifil32.dll.dbg.c
avifil32.spec.c
avifile.spec.c
name avifil32
type win32
debug_channels (avifile)
@ stub AVIBuildFilter
@ stub AVIBuildFilterA
......
Makefile
comctl32.dll.dbg.c
comctl32.spec.c
rsrc.res
name comctl32
type win32
init COMCTL32_LibMain
debug_channels (animate comboex commctrl datetime header hotkey imagelist ipaddress
listview message monthcal nativefont pager progress propsheet
rebar statusbar tab toolbar tooltips trackbar treeview updown)
# Functions exported by the Win95 comctl32.dll
# (these need to have these exact ordinals, because some win95 dlls
# import comctl32.dll by ordinal)
......
Makefile
comdlg32.dll.dbg.c
comdlg32.spec.c
commdlg.spec.c
rsrc.res
name comdlg32
type win32
init COMDLG32_DllEntryPoint
debug_channels (commdlg)
@ stdcall ChooseColorA(ptr) ChooseColorA
@ stdcall ChooseColorW(ptr) ChooseColorW
@ stdcall ChooseFontA(ptr) ChooseFontA
......
Makefile
crtdll.dll.dbg.c
crtdll.spec.c
# Old C runtime library. All functions provided by msvcrt
name crtdll
type win32
init CRTDLL_Init
debug_channels (crtdll)
@ forward ??2@YAPAXI@Z msvcrt.??2@YAPAXI@Z
@ forward ??3@YAXPAX@Z msvcrt.??3@YAXPAX@Z
@ forward ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z msvcrt.?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z
......
Makefile
crypt32.dll.dbg.c
crypt32.spec.c
name crypt32
type win32
debug_channels ()
@ stub CertAddCRLContextToStore
@ stub CertAddCTLContextToStore
......
Makefile
dciman32.dll.dbg.c
dciman32.spec.c
name dciman32
type win32
@ stub DCIBeginAccess
@ stdcall DCICloseProvider(long) DCICloseProvider
......
Makefile
ddraw.dll.dbg.c
ddraw.spec.c
version.res
name ddraw
type win32
init DDRAW_DllMain
debug_channels (ddraw)
@ stub DDHAL32_VidMemAlloc
@ stub DDHAL32_VidMemFree
@ stub DDInternalLock
......
Makefile
devenum.dll.dbg.c
devenum.spec.c
name devenum
type win32
debug_channels()
@ stub DllCanUnloadNow
@ stub DllGetClassObject
......
Makefile
dinput.dll.dbg.c
dinput.spec.c
name dinput
type win32
debug_channels (dinput)
@ stdcall DirectInputCreateA(long long ptr ptr) DirectInputCreateA
@ stub DirectInputCreateW
......
Makefile
dplay.dll.dbg.c
dplay.spec.c
# First DirectPlay dll. Replaced by dplayx.dll.
name dplay
type win32
@ forward DirectPlayCreate dplayx.DirectPlayCreate
@ forward DirectPlayEnumerate dplayx.DirectPlayEnumerate
Makefile
dplayx.dll.dbg.c
dplayx.spec.c
version.res
name dplayx
type win32
init DPLAYX_LibMain
debug_channels (dplay)
1 stdcall DirectPlayCreate(ptr ptr ptr) DirectPlayCreate
2 stdcall DirectPlayEnumerateA(ptr ptr) DirectPlayEnumerateA
3 stdcall DirectPlayEnumerateW(ptr ptr) DirectPlayEnumerateW
......
Makefile
dsound.dll.dbg.c
dsound.spec.c
name dsound
type win32
debug_channels (dsound)
0 stub DirectSoundUnknown
1 stdcall DirectSoundCreate(ptr ptr ptr) DirectSoundCreate
......
Makefile
dispdib.spec.c
gdi.exe.spec.c
gdi32.dll.dbg.c
gdi32.spec.c
printdrv.glue.c
version.res
......
name gdi32
type win32
init MAIN_GdiInit
debug_channels (bitblt bitmap clipping dc ddraw driver enhmetafile font gdi
metafile palette print region text win16drv wing)
# ordinal exports
100 stdcall @(long long str str str) GDI_CallDevInstall16
101 stdcall @(long str str ptr) GDI_CallExtDeviceModePropSheet16
......
Makefile
glu32.dll.dbg.c
glu32.spec.c
name glu32
type win32
@ stdcall gluLookAt(double double double double double double double double double) wine_gluLookAt
@ stdcall gluOrtho2D(double double double double) wine_gluOrtho2D
......
Makefile
icmp.dll.dbg.c
icmp.spec.c
name icmp
type win32
debug_channels (icmp)
@ stdcall IcmpCloseHandle(ptr) IcmpCloseHandle
@ stdcall IcmpCreateFile() IcmpCreateFile
......
Makefile
imagehlp.dll.dbg.c
imagehlp.spec.c
name imagehlp
type win32
init IMAGEHLP_LibMain
debug_channels (imagehlp)
@ stdcall BindImage(str str str) BindImage
@ stdcall BindImageEx(long str str str ptr) BindImageEx
@ stdcall CheckSumMappedFile(ptr long ptr ptr) CheckSumMappedFile
......
Makefile
imm.spec.c
imm32.dll.dbg.c
imm32.spec.c
name imm32
type win32
debug_channels (imm)
@ stdcall ImmAssociateContext(long long) ImmAssociateContext
@ stdcall ImmConfigureIMEA(long long long ptr) ImmConfigureIMEA
......
Makefile
comm.spec.c
kernel.res
kernel32.dll.dbg.c
kernel32.spec.c
krnl386.exe.spec.c
stress.spec.c
......
name kernel32
type win32
init MAIN_KernelInit
debug_channels (comm console debugstr dll int resource stress thunk toolhelp
win32)
# Functions exported by the Win95 kernel32.dll
# (these need to have these exact ordinals, for some win95 dlls
# import kernel32.dll by ordinal)
......
Makefile
lz32.dll.dbg.c
lz32.spec.c
lzexpand.spec.c
name lz32
type win32
debug_channels (file)
@ stdcall CopyLZFile(long long) CopyLZFile
@ stdcall GetExpandedNameA(str ptr) GetExpandedNameA
......
Makefile
mapi32.dll.dbg.c
mapi32.spec.c
name mapi32
type win32
debug_channels (mapi)
@ stub BMAPIAddress
@ stub BMAPIDetails
......
Makefile
mpr.dll.dbg.c
mpr.spec.c
name mpr
type win32
debug_channels (mpr)
# ordinal exports
1 stub @
......
Makefile
msacm.res
msacm.spec.c
msacm32.dll.dbg.c
msacm32.spec.c
Makefile
imaadp32.acm.dbg.c
imaadp32.acm.spec.c
name imaadp32
file imaadp32.acm
type win32
debug_channels (adpcm)
@ stdcall DriverProc (long long long long long) ADPCM_DriverProc
name msacm32
type win32
init MSACM32_LibMain
debug_channels (msacm)
@ stdcall acmDriverAddA(ptr long long long long) acmDriverAddA
@ stdcall acmDriverAddW(ptr long long long long) acmDriverAddW
@ stdcall acmDriverClose(long long) acmDriverClose
......
Makefile
msg711.drv.dbg.c
msg711.drv.spec.c
name msg711
file msg711.drv
type win32
debug_channels ()
@ stub DriverProc #(long long long long long)
Makefile
msdmo.dll.dbg.c
msdmo.spec.c
name msdmo
type win32
debug_channels ()
@ stub DMOEnum
@ stub DMOGetName
......
Makefile
msimg32.dll.dbg.c
msimg32.spec.c
name msimg32
type win32
debug_channels (msimg32)
@ stdcall AlphaBlend(long long long long long long long long long long long) AlphaBlend
@ stub DllInitialize
......
Makefile
msisys.ocx.dbg.c
msisys.ocx.spec.c
name msisys
file msisys.ocx
type win32
init MSISYS_DllMain
debug_channels (msisys)
@ stdcall DllCanUnloadNow() MSISYS_DllCanUnloadNow
@ stdcall DllGetClassObject(ptr ptr ptr) MSISYS_DllGetClassObject
@ stdcall DllRegisterServer() MSISYS_DllRegisterServer
......
Makefile
msnet32.dll.dbg.c
msnet32.spec.c
name msnet32
type win32
1 stub @
2 stub @
......
Makefile
msrle32.dll.dbg.c
msrle32.spec.c
name msrle32
type win32
debug_channels()
@ stub DriverProc #(long long long long long)
Makefile
msvcrt.dll.dbg.c
msvcrt.spec.c
# msvcrt.dll - MS VC++ Run Time Library
name msvcrt
type win32
init MSVCRT_Init
debug_channels (msvcrt)
@ cdecl $I10_OUTPUT() MSVCRT_I10_OUTPUT
@ cdecl ??0__non_rtti_object@@QAE@ABV0@@Z(ptr ptr) MSVCRT___non_rtti_object_copy_ctor
@ cdecl ??0__non_rtti_object@@QAE@PBD@Z(ptr ptr) MSVCRT___non_rtti_object_ctor
......
Makefile
msvcrt20.dll.dbg.c
msvcrt20.spec.c
# msvcrt20.dll - MS VC++ Run Time Library
name msvcrt20
type win32
debug_channels (msvcrt)
@ stub ??0Iostream_init@@QAE@AAVios@@H@Z #
@ stub ??0Iostream_init@@QAE@XZ #
......
Makefile
msvfw32.dll.dbg.c
msvfw32.spec.c
msvideo.spec.c
msvideo_main.glue.c
name msvfw32
type win32
debug_channels (mci msvideo)
# Yes, ICCompress,ICDecompress,MCIWnd* and ICDraw* are cdecl (VFWAPIV).
# The rest is stdcall (VFWAPI) however. -Marcus Meissner, 990124
......
Makefile
netapi32.dll.dbg.c
netapi32.spec.c
name netapi32
type win32
init NETAPI32_LibMain
debug_channels (netbios)
1 stdcall Netbios(ptr) Netbios
Makefile
ntdll.dll.dbg.c
ntdll.spec.c
relay16.s
relay32.s
......@@ -142,10 +142,10 @@ EXTRASUBDIRS = \
@MAKE_DLL_RULES@
relay16.s: $(WINEBUILD)
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -o $@ -relay16
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -relay16
relay32.s: $(WINEBUILD)
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -o $@ -relay32
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -relay32
install:: install_libdir
uninstall:: uninstall_libdir
......
name ntdll
type win32
debug_channels (atom cdrom console debug delayhlp dll dosfs dosmem file fixup
global heap int int21 int31 io loaddll local module ntdll process
profile reg relay resource segment seh selector server snoop
string system tape task thread tid timer toolhelp ver virtual
vxd win32)
#note that the Zw... functions are alternate names for the
#Nt... functions. (see www.sysinternals.com for details)
......
Makefile
odbc32.dll.dbg.c
odbc32.spec.c
name odbc32
type win32
init MAIN_OdbcInit
debug_channels (odbc)
001 stdcall SQLAllocConnect(long ptr) SQLAllocConnect
002 stdcall SQLAllocEnv(ptr) SQLAllocEnv
003 stdcall SQLAllocStmt(long ptr) SQLAllocStmt
......
......@@ -5,6 +5,7 @@ ole2conv.spec.c
ole2nls.spec.c
ole2prox.spec.c
ole2thk.spec.c
ole32.dll.dbg.c
ole32.spec.c
ole32res.res
storage.spec.c
name ole32
type win32
init OLE32_DllEntryPoint
debug_channels (accel ole relay storage)
1 stub BindMoniker # stdcall (ptr long ptr ptr) return 0,ERR_NOTIMPLEMENTED
2 stdcall CLSIDFromProgID(wstr ptr) CLSIDFromProgID
3 stdcall CLSIDFromString(wstr ptr) CLSIDFromString
......
Makefile
ole2disp.spec.c
oleaut32.dll.dbg.c
oleaut32.spec.c
typelib.spec.c
version.res
name oleaut32
type win32
debug_channels (ole olerelay typelib)
1 stdcall DllGetClassObject(ptr ptr ptr) OLEAUT32_DllGetClassObject
2 stdcall SysAllocString(wstr) SysAllocString
......
Makefile
olecli.spec.c
olecli32.dll.dbg.c
olecli32.spec.c
name olecli32
type win32
debug_channels (ole)
1 stub WEP
2 stub OleDelete
......
Makefile
oledlg.dll.dbg.c
oledlg.spec.c
name oledlg
type win32
debug_channels (ole)
1 stdcall OleUIAddVerbMenuA(ptr str long long long long long long ptr) OleUIAddVerbMenuA
2 stdcall OleUICanConvertOrActivateAs(ptr long long) OleUICanConvertOrActivateAs
......
Makefile
olepro32.dll.dbg.c
olepro32.spec.c
name olepro32
type win32
debug_channels (ole)
248 forward OleIconToCursor OLEAUT32.OleIconToCursor
249 forward OleCreatePropertyFrameIndirect OLEAUT32.OleCreatePropertyFrameIndirect
......
Makefile
olesvr.spec.c
olesvr32.dll.dbg.c
olesvr32.spec.c
name olesvr32
type win32
debug_channels (ole)
1 stub WEP
2 stdcall OleRegisterServer(str ptr ptr long long) OleRegisterServer
......
Makefile
opengl32.dll.dbg.c
opengl32.spec.c
name opengl32
type win32
init OpenGL32_Init
debug_channels (opengl)
@ stdcall wglCreateContext(long) wglCreateContext
@ stdcall wglCreateLayerContext(long long) wglCreateLayerContext
@ stdcall wglCopyContext(long long long) wglCopyContext
......
Makefile
psapi.dll.dbg.c
psapi.spec.c
name psapi
type win32
debug_channels (psapi)
@ stdcall EmptyWorkingSet(long) EmptyWorkingSet
@ stdcall EnumDeviceDrivers(ptr long ptr) EnumDeviceDrivers
......
Makefile
qcap.dll.dbg.c
qcap.spec.c
name qcap
type win32
debug_channels()
@ stub DllCanUnloadNow
@ stub DllGetClassObject
......
Makefile
quartz.dll.dbg.c
quartz.spec.c
name quartz
type win32
debug_channels (quartz)
@ stub AMGetErrorTextA
@ stub AMGetErrorTextW
......
Makefile
rasapi16.spec.c
rasapi32.dll.dbg.c
rasapi32.spec.c
name rasapi32
type win32
debug_channels (ras)
1 stub RasAutodialAddressToNetwork
2 stub RasAutodialEntryToNetwork
......
Makefile
riched32.dll.dbg.c
riched32.spec.c
name riched32
type win32
init RICHED32_LibMain
debug_channels (richedit)
2 stdcall DllGetVersion (ptr) RICHED32_DllGetVersion
Makefile
rpcrt4.dll.dbg.c
rpcrt4.spec.c
name rpcrt4
type win32
init RPCRT4_LibMain
debug_channels (ole)
@ stub DceErrorInqTextA
@ stub DceErrorInqTextW
......
Makefile
serialui.dll.dbg.c
serialui.spec.c
serialui_rc.res
name serialui
type win32
init SERIALUI_LibMain
debug_channels (comm)
2 stdcall EnumPropPages(ptr ptr ptr) SERIALUI_EnumPropPages
3 stdcall drvCommConfigDialog(ptr long ptr) SERIALUI_CommConfigDialog
4 stdcall drvSetDefaultCommConfig(str ptr long) SERIALUI_SetDefaultCommConfig
......
Makefile
setupapi.dll.dbg.c
setupapi.res
setupapi.spec.c
setupx.spec.c
......
name setupapi
type win32
debug_channels (setupapi)
@ stub AddMiniIconToList
@ stub AddTagToGroupOrderListEntry
......
Makefile
shdocvw.dll.dbg.c
shdocvw.spec.c
name shdocvw
type win32
debug_channels (comimpl shdocvw)
# ordinal exports
101 stub @
......
Makefile
shell.spec.c
shell32.dll.dbg.c
shell32.spec.c
shres.res
name shell32
type win32
init Shell32LibMain
debug_channels (exec pidl shell shlctrl)
# Functions exported by the Win95 shell32.dll
# (these need to have these exact ordinals, for some
# win95 and winNT dlls import shell32.dll by ordinal)
......
Makefile
shfolder.dll.dbg.c
shfolder.spec.c
name shfolder
type win32
@ forward SHGetFolderPathA shell32.SHGetFolderPathA
@ forward SHGetFolderPathW shell32.SHGetFolderPathW
Makefile
shlwapi.dll.dbg.c
shlwapi.spec.c
name shlwapi
type win32
init SHLWAPI_LibMain
debug_channels (shell)
1 stdcall @(str ptr) SHLWAPI_1
2 stdcall @(wstr ptr) SHLWAPI_2
3 stdcall @(str long) SHLWAPI_3
......
Makefile
snmpapi.dll.dbg.c
snmpapi.spec.c
name snmpapi
type win32
init SNMPAPI_DllMain
debug_channels (snmpapi)
@ stub SnmpSvcAddrIsIpx
@ stub SnmpSvcAddrToSocket
@ stub SnmpSvcBufRevAndCpy
......
Makefile
sti.dll.dbg.c
sti.spec.c
name sti
type win32
debug_channels()
@ stub DllCanUnloadNow
@ stub DllGetClassObject
......
Makefile
tapi32.dll.dbg.c
tapi32.spec.c
name tapi32
type win32
debug_channels (tapi)
@ stdcall lineAccept(long str long) lineAccept
@ stdcall lineAddProvider(str long ptr) lineAddProvider
......
Makefile
ttydrv.dll.dbg.c
ttydrv.spec.c
name ttydrv
type win32
init TTYDRV_Init
debug_channels (ttydrv)
# GDI driver
@ cdecl Arc(ptr long long long long long long long long) TTYDRV_DC_Arc
......
Makefile
twain_32.dll.dbg.c
twain_32.spec.c
name twain_32
type win32
init TWAIN_LibMain
debug_channels (twain)
@ stdcall DSM_Entry(ptr ptr long long long ptr) DSM_Entry
Makefile
url.dll.dbg.c
url.spec.c
name url
type win32
debug_channels()
@ stub AddMIMEFileTypesPS
@ stub AutodialHookCallback
......
Makefile
urlmon.dll.dbg.c
urlmon.spec.c
name urlmon
type win32
debug_channels (urlmon win32)
1 stub CDLGetLongPathNameA
2 stub CDLGetLongPathNameW
......
......@@ -6,5 +6,6 @@ mouse.spec.c
property.glue.c
text.glue.c
user.exe.spec.c
user32.dll.dbg.c
user32.spec.c
wnd16.glue.c
name user32
type win32
init UserClientDllInitialize
debug_channels (accel caret class clipboard combo comm cursor dc ddeml dialog
driver edit event graphics hook icon key keyboard listbox local
mdi menu message msg nonclient relay resource scroll shell static
string syscolor system text timer win win32 wnet)
@ stdcall ActivateKeyboardLayout(long long) ActivateKeyboardLayout
@ stdcall AdjustWindowRect(ptr long long) AdjustWindowRect
@ stdcall AdjustWindowRectEx(ptr long long long) AdjustWindowRectEx
......
Makefile
ver.spec.c
version.dll.dbg.c
version.spec.c
name version
type win32
debug_channels (ver)
@ stdcall GetFileVersionInfoA(str long long ptr) GetFileVersionInfoA
@ stdcall GetFileVersionInfoSizeA(str ptr) GetFileVersionInfoSizeA
......
Makefile
w32skrnl.dll.dbg.c
w32skrnl.spec.c
w32sys.spec.c
win32s16.spec.c
name w32skrnl
type win32
debug_channels (dll)
1 stub _kSetEnvironmentVariable@8
2 stub _SzFromImte@4
......
Makefile
winaspi.spec.c
winaspi16.glue.c
wnaspi32.dll.dbg.c
wnaspi32.spec.c
name wnaspi32
type win32
init WNASPI32_LibMain
debug_channels (aspi)
# we have several ordinal clashes here, it seems...
1 cdecl GetASPI32SupportInfo() GetASPI32SupportInfo
......
Makefile
winedos.dll.dbg.c
winedos.spec.c
name winedos
type win32
init DOSVM_Init
debug_channels (aspi console ddraw int int21 int31 module relay)
@ stdcall LoadDosExe(str long) MZ_LoadImage
# DPMI functions
......
Makefile
rsrc.res
wineps.dll.dbg.c
wineps.spec.c
wineps16.spec.c
name wineps
type win32
init PSDRV_Init
debug_channels (psdrv)
# GDI driver
@ cdecl Arc(ptr long long long long long long long long) PSDRV_Arc
......
Makefile
wininet.dll.dbg.c
wininet.spec.c
name wininet
type win32
init WININET_LibMain
debug_channels (wininet)
@ stub InternetInitializeAutoProxyDll
@ stub ShowCertificate
@ stdcall CommitUrlCacheEntryA(str str long long long str long str str) CommitUrlCacheEntryA
......
......@@ -4,5 +4,6 @@ mmsystem.glue.c
mmsystem.spec.c
sound.spec.c
time.glue.c
winmm.dll.dbg.c
winmm.spec.c
winmm_res.res
Makefile
joystick.drv.dbg.c
joystick.drv.spec.c
name joystick
file joystick.drv
type win32
debug_channels (joystick)
@ stdcall DriverProc(long long long long long) JSTCK_DriverProc
Makefile
mcianim.drv.dbg.c
mcianim.drv.spec.c
name mcianim
file mcianim.drv
type win32
debug_channels (mcianim)
@ stdcall DriverProc(long long long long long) MCIANIM_DriverProc
Makefile
mciavi.drv.dbg.c
mciavi.drv.spec.c
mciavi_res.res
name mciavi
file mciavi.drv
type win32
init MCIAVI_LibMain
debug_channels (mciavi)
@ stdcall DriverProc(long long long long long) MCIAVI_DriverProc
Makefile
mcicda.drv.dbg.c
mcicda.drv.spec.c
name mcicda
file mcicda.drv
type win32
debug_channels (mcicda)
@ stdcall DriverProc(long long long long long) MCICDA_DriverProc
Makefile
mciseq.drv.dbg.c
mciseq.drv.spec.c
name mciseq
file mciseq.drv
type win32
debug_channels (mcimidi)
@ stdcall DriverProc(long long long long long) MCIMIDI_DriverProc
Makefile
mciwave.drv.dbg.c
mciwave.drv.spec.c
name mciwave
file mciwave.drv
type win32
debug_channels (mciwave)
@ stdcall DriverProc(long long long long long) MCIWAVE_DriverProc
Makefile
midimap.drv.dbg.c
midimap.drv.spec.c
name midimap
file midimap.drv
type win32
debug_channels (msacm)
@ stdcall DriverProc(long long long long long) MIDIMAP_DriverProc
@ stdcall modMessage(long long long long long) MIDIMAP_modMessage
Makefile
msacm.drv.dbg.c
msacm.drv.spec.c
name msacmmap
file msacm.drv
type win32
debug_channels (msacm)
@ stdcall DriverProc(long long long long long) WAVEMAP_DriverProc
@ stdcall widMessage(long long long long long) WAVEMAP_widMessage
......
Makefile
winearts.drv.dbg.c
winearts.drv.spec.c
......@@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = winearts.drv
IMPORTS = winmm user32 kernel32 ntdll
EXTRADEFS = @ARTSINCL@
EXTRAINCL = @ARTSINCL@
EXTRALIBS = @ARTSLIBS@
LDDLLFLAGS = @LDDLLFLAGS@
......
name winearts
file winearts.drv
type win32
debug_channels (wave)
@ stdcall DriverProc(long long long long long) ARTS_DriverProc
@ stdcall wodMessage(long long long long long) ARTS_wodMessage
Makefile
wineoss.drv.dbg.c
wineoss.drv.spec.c
name wineoss
file wineoss.drv
type win32
debug_channels (midi mmaux wave)
1 stdcall DriverProc(long long long long long) OSS_DriverProc
2 stdcall auxMessage(long long long long long) OSS_auxMessage
......
name winmm
type win32
init WINMM_LibMain
debug_channels (driver mci mmio mmsys mmtime sound)
# ordinal exports
1 stdcall @(ptr long long) PlaySoundA
3 stub @
......
Makefile
winnls.spec.c
winnls32.dll.dbg.c
winnls32.spec.c
name winnls32
type win32
1 stub WINNLS32EnableIME
2 stub WINNLS32GetEnableStatus
......
Makefile
winsock.spec.c
ws2_32.dll.dbg.c
ws2_32.spec.c
......@@ -3,11 +3,8 @@
# Export table information obtained from Windows 2000 ws2_32.dll
name ws2_32
type win32
init WS_LibMain
debug_channels (winsock)
# EXPORTS ***********
1 stdcall accept(long ptr ptr) WS_accept
2 stdcall bind(long ptr long) WS_bind
......
Makefile
winspool.drv.dbg.c
winspool.drv.spec.c
name winspool
type win32
file winspool.drv
init WINSPOOL_EntryPoint
debug_channels (winspool)
100 stub @
@ stub ADVANCEDSETUPDIALOG
@ stub AbortPrinter
......
Makefile
wintrust.dll.dbg.c
wintrust.spec.c
name wintrust
type win32
debug_channels (win32)
@ stdcall WinVerifyTrust(long ptr ptr) WinVerifyTrust
Makefile
wow32.dll.dbg.c
wow32.spec.c
name wow32
type win32
# ordinal exports
1 forward WOWGetDescriptor kernel32.K32WOWGetDescriptor
......
Makefile
wsock32.dll.dbg.c
wsock32.spec.c
name wsock32
type win32
debug_channels (winsock)
1 forward accept ws2_32.accept
2 forward bind ws2_32.bind
......
Makefile
wineclipsrv
x11drv.dll.dbg.c
x11drv.spec.c
name x11drv
type win32
init X11DRV_Init
debug_channels (bitblt bitmap clipboard cursor dinput event font gdi graphics
key keyboard opengl palette text win x11drv xrender)
# GDI driver
@ cdecl Arc(ptr long long long long long long long long) X11DRV_Arc
......
DEFS = @DLLFLAGS@ -DSTRICT -DNONAMELESSUNION -DNONAMELESSSTRUCT
DEFS = @DLLFLAGS@ -DSTRICT -DNONAMELESSUNION -DNONAMELESSSTRUCT $(EXTRADEFS)
LDDLLFLAGS = @LDDLLFLAGS@
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ..
......@@ -38,47 +38,47 @@ all: $(PROGRAMS) $(PROGRAMS:%=%.so)
@MAKE_RULES@
expand.spec.c: expand.o $(WINEBUILD)
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -sym expand.o -o expand.spec.c -exe expand -mgui -L$(DLLDIR) -llz32 -lkernel32 -lntdll
$(LDPATH) $(WINEBUILD) $(DEFS) -sym expand.o -o expand.spec.c -exe expand -mgui -L$(DLLDIR) -llz32 -lkernel32 -lntdll
expand.so: expand.o expand.spec.o
$(LDSHARED) $(LDDLLFLAGS) -o expand.so $+ $(ALL_LIBS)
hello.spec.c: hello.o $(WINEBUILD)
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -sym hello.o -o hello.spec.c -exe hello -mgui -L$(DLLDIR) -luser32 -lgdi32 -lkernel32 -lntdll
$(LDPATH) $(WINEBUILD) $(DEFS) -sym hello.o -o hello.spec.c -exe hello -mgui -L$(DLLDIR) -luser32 -lgdi32 -lkernel32 -lntdll
hello.so: hello.o hello.spec.o
$(LDSHARED) $(LDDLLFLAGS) -o hello.so $+ $(ALL_LIBS)
hello2.spec.c: hello2.o $(WINEBUILD)
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -sym hello2.o -o hello2.spec.c -exe hello2 -mgui -L$(DLLDIR) -luser32 -lkernel32 -lntdll
$(LDPATH) $(WINEBUILD) $(DEFS) -sym hello2.o -o hello2.spec.c -exe hello2 -mgui -L$(DLLDIR) -luser32 -lkernel32 -lntdll
hello2.so: hello2.o hello2.spec.o
$(LDSHARED) $(LDDLLFLAGS) -o hello2.so $+ $(ALL_LIBS)
hello3.spec.c: hello3.o hello3res.res $(WINEBUILD)
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -sym hello3.o -res hello3res.res -o hello3.spec.c -exe hello3 -mgui -L$(DLLDIR) -lcomdlg32 -luser32 -lgdi32 -lkernel32 -lntdll
$(LDPATH) $(WINEBUILD) $(DEFS) -sym hello3.o -res hello3res.res -o hello3.spec.c -exe hello3 -mgui -L$(DLLDIR) -lcomdlg32 -luser32 -lgdi32 -lkernel32 -lntdll
hello3.so: hello3.o hello3.spec.o
$(LDSHARED) $(LDDLLFLAGS) -o hello3.so $+ $(ALL_LIBS)
hello4.spec.c: hello4.o $(WINEBUILD)
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -sym hello4.o -o hello4.spec.c -exe hello4 -mgui -L$(DLLDIR) -luser32 -lgdi32 -lkernel32 -lntdll
$(LDPATH) $(WINEBUILD) $(DEFS) -sym hello4.o -o hello4.spec.c -exe hello4 -mgui -L$(DLLDIR) -luser32 -lgdi32 -lkernel32 -lntdll
hello4.so: hello4.o hello4.spec.o
$(LDSHARED) $(LDDLLFLAGS) -o hello4.so $+ $(ALL_LIBS)
hello5.spec.c: hello5.o $(WINEBUILD)
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -sym hello5.o -o hello5.spec.c -exe hello5 -mgui -L$(DLLDIR) -lkernel32 -lntdll
$(LDPATH) $(WINEBUILD) $(DEFS) -sym hello5.o -o hello5.spec.c -exe hello5 -mgui -L$(DLLDIR) -lkernel32 -lntdll
hello5.so: hello5.o hello5.spec.o
$(LDSHARED) $(LDDLLFLAGS) -o hello5.so $+ $(ALL_LIBS)
new.spec.c: new.o $(WINEBUILD)
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -sym new.o -o new.spec.c -exe new -mgui -L$(DLLDIR) -luser32 -lgdi32 -lkernel32 -lntdll
$(LDPATH) $(WINEBUILD) $(DEFS) -sym new.o -o new.spec.c -exe new -mgui -L$(DLLDIR) -luser32 -lgdi32 -lkernel32 -lntdll
new.so: new.o new.spec.o
$(LDSHARED) $(LDDLLFLAGS) -o new.so $+ $(ALL_LIBS)
rolex.spec.c: rolex.o $(WINEBUILD)
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -sym rolex.o -o rolex.spec.c -exe rolex -mgui -L$(DLLDIR) -luser32 -lgdi32 -lkernel32 -lntdll
$(LDPATH) $(WINEBUILD) $(DEFS) -sym rolex.o -o rolex.spec.c -exe rolex -mgui -L$(DLLDIR) -luser32 -lgdi32 -lkernel32 -lntdll
rolex.so: rolex.o rolex.spec.o
$(LDSHARED) $(LDDLLFLAGS) -o rolex.so $+ $(ALL_LIBS)
volinfo.spec.c: volinfo.o $(WINEBUILD)
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -sym volinfo.o -o volinfo.spec.c -exe volinfo -mgui -L$(DLLDIR) -lkernel32 -lntdll
$(LDPATH) $(WINEBUILD) $(DEFS) -sym volinfo.o -o volinfo.spec.c -exe volinfo -mgui -L$(DLLDIR) -lkernel32 -lntdll
volinfo.so: volinfo.o volinfo.spec.o
$(LDSHARED) $(LDDLLFLAGS) -o volinfo.so $+ $(ALL_LIBS)
......
name wine
mode guiexe
type win32
init wine_initial_task
......@@ -11,6 +11,7 @@
DEFS = @DLLFLAGS@ -DSTRICT -DNONAMELESSUNION -DNONAMELESSSTRUCT $(EXTRADEFS)
LDDLLFLAGS = @LDDLLFLAGS@
ALL_OBJS = $(OBJS) $(MODULE).dbg.o
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBS)
SYMBOLFILE = $(MODULE).tmp.o
TESTIMPORTS = $(DELAYIMPORTS) $(IMPORTS)
......@@ -23,20 +24,20 @@ all: $(MODULE)$(EXEEXT)
# Rule for main module spec file
$(MODULE).spec.c: $(RC_SRCS:.rc=.res) $(SYMBOLFILE) $(WINEBUILD)
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ $(SYMBOLFILE:%=-sym %) -o $@ -exe $(MODULE) $(APPMODE:%=-m%) $(RC_SRCS:%.rc=-res %.res) -L$(DLLDIR) $(DELAYIMPORTS:%=-dl%) $(IMPORTS:%=-l%)
$(LDPATH) $(WINEBUILD) $(DEFS) $(SYMBOLFILE:%=-sym %) -o $@ -exe $(MODULE) $(APPMODE:%=-m%) $(RC_SRCS:%.rc=-res %.res) -L$(DLLDIR) $(DELAYIMPORTS:%=-dl%) $(IMPORTS:%=-l%)
# Rules for .so main module
$(MODULE).so: $(MODULE).spec.o $(OBJS) Makefile.in
$(LDSHARED) $(LDDLLFLAGS) $(MODULE).spec.o $(OBJS) -o $@ $(ALL_LIBS)
$(MODULE).so: $(MODULE).spec.o $(ALL_OBJS) Makefile.in
$(LDSHARED) $(LDDLLFLAGS) $(MODULE).spec.o $(ALL_OBJS) -o $@ $(ALL_LIBS)
$(MODULE): $(MODULE).so
$(RM) $(MODULE) && $(LN_S) $(TOPOBJDIR)/wine $(MODULE)
# Rules for .exe main module
$(MODULE).exe: $(OBJS) $(RCOBJS) Makefile.in
$(CC) $(OBJS) $(RCOBJS) -o $@ $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(ALL_LIBS)
$(MODULE).exe: $(ALL_OBJS) $(RCOBJS) Makefile.in
$(CC) $(ALL_OBJS) $(RCOBJS) -o $@ $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(ALL_LIBS)
# Rules for checking that no imports are missing
......@@ -47,11 +48,6 @@ checklink:: $(MODULE).so
$(TESTRESULTS): $(MODULE).so
# Rules for debug channels
debug_channels: dummy
$(TOPSRCDIR)/tools/make_debug $(MODULE).spec $(C_SRCS)
# Rules for installation
.PHONY: install_prog$(EXEEXT)
......
DEFS = @DLLFLAGS@ -DSTRICT -DNONAMELESSUNION -DNONAMELESSSTRUCT
DEFS = @DLLFLAGS@ -DSTRICT -DNONAMELESSUNION -DNONAMELESSSTRUCT $(EXTRADEFS)
LDDLLFLAGS = @LDDLLFLAGS@
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
......@@ -13,13 +13,13 @@ all: $(PROGRAMS)
@MAKE_RULES@
aviinfo.spec.c: aviinfo.o $(WINEBUILD)
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -sym aviinfo.o -o aviinfo.spec.c -exe aviinfo -mgui -L$(DLLDIR) -lkernel32 -lntdll
$(LDPATH) $(WINEBUILD) $(DEFS) -sym aviinfo.o -o aviinfo.spec.c -exe aviinfo -mgui -L$(DLLDIR) -lkernel32 -lntdll
aviplay.spec.c: aviplay.o $(WINEBUILD)
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -sym aviplay.o -o aviplay.spec.c -exe aviplay -mgui -L$(DLLDIR) -lddraw -lkernel32 -lntdll
$(LDPATH) $(WINEBUILD) $(DEFS) -sym aviplay.o -o aviplay.spec.c -exe aviplay -mgui -L$(DLLDIR) -lddraw -lkernel32 -lntdll
icinfo.spec.c: icinfo.o $(WINEBUILD)
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ -sym icinfo.o -o icinfo.spec.c -exe icinfo -mgui -L$(DLLDIR) -lmsvfw32 -lkernel32 -lntdll
$(LDPATH) $(WINEBUILD) $(DEFS) -sym icinfo.o -o icinfo.spec.c -exe icinfo -mgui -L$(DLLDIR) -lmsvfw32 -lkernel32 -lntdll
aviinfo.so: aviinfo.o aviinfo.spec.o
$(LDSHARED) $(LDDLLFLAGS) -o aviinfo.so aviinfo.o aviinfo.spec.o $(ALL_LIBS)
......
Makefile
clock
clock.dbg.c
clock.spec.c
rsrc.res
Makefile
cmdlgr.res
cmdlgtst
cmdlgtst.dbg.c
cmdlgtst.spec.c
Makefile
control
control.dbg.c
control.spec.c
Makefile
notepad
notepad.dbg.c
notepad.spec.c
rsrc.res
Makefile
osversioncheck
osversioncheck.dbg.c
osversioncheck.spec.c
Makefile
progman
progman.dbg.c
progman.spec.c
rsrc.res
Makefile
regapi
regapi.dbg.c
regapi.spec.c
Makefile
regedit.dbg.c
regedit.spec.c
Makefile
regsvr32.dbg.c
regsvr32.spec.c
Makefile
regtest
regtest.dbg.c
regtest.spec.c
Makefile
rsrc.res
uninstaller
uninstaller.dbg.c
uninstaller.spec.c
Makefile
view
view.dbg.c
view.spec.c
viewrc.res
Makefile
wcmd
wcmd.dbg.c
wcmd.spec.c
wcmdrc.res
Makefile
wineconsole
wineconsole.dbg.c
wineconsole.spec.c
wineconsole_res.res
Makefile
rsrc.res
winemine
winemine.dbg.c
winemine.spec.c
Makefile
winepath
winepath.dbg.c
winepath.spec.c
Makefile
wine.c
winetest.dbg.c
winetest.spec.c
......@@ -3,6 +3,7 @@ hlp2sgml
lex.yy.c
rsrc.res
winhelp
winhelp.dbg.c
winhelp.spec.c
y.tab.c
y.tab.h
Makefile
winver
winver.dbg.c
winver.spec.c
......@@ -8,9 +8,7 @@ type win16|win32
[heap SIZE]
[stack SIZE]
[init FUNCTION]
[import [IMP_FLAGS] DLL]
[rsrc RESFILE]
[debug_channels ([CHANNEL [CHANNEL...]])]
[ignore ([SYMBOL [SYMBOL...]])]
ORDINAL FUNCTYPE [FLAGS] EXPORTNAME([ARGTYPE [ARGTYPE [...]]]) HANDLERNAME
......@@ -51,20 +49,8 @@ for kernel, which lives in the Windows file KRNL386.EXE).
"init" specifies a function which will be called when this dll
is loaded. This is only valid for Win32 modules.
"import" names a module that this one depends on (only for Win32
modules at the present). The import declaration can be present several
times.
"IMP_FLAGS" is a series of optional flags, preceded by a '-'
character. The supported flags are:
"-delay": the module this module depends upon will be loaded
when the first API will be called (and not while this
module is loaded)
"rsrc" specifies the path of the compiled resource file.
"debug_channels" specifies the list of debug channels used by the dll.
"ignore" specifies a list of symbols that should be ignored when
resolving undefined symbols against the imported libraries.
......
......@@ -60,7 +60,6 @@ typedef enum
typedef enum
{
SPEC_INVALID,
SPEC_WIN16,
SPEC_WIN32
} SPEC_TYPE;
......@@ -146,6 +145,7 @@ extern void warning( const char *msg, ... );
extern void output_standard_file_header( FILE *outfile );
extern void dump_bytes( FILE *outfile, const unsigned char *data, int len,
const char *label, int constant );
extern const char *make_c_identifier( const char *str );
extern int get_alignment(int alignBoundary);
extern void add_import_dll( const char *name, int delay );
......@@ -157,6 +157,7 @@ extern int output_resources( FILE *outfile );
extern void load_res16_file( const char *name );
extern int output_res16_data( FILE *outfile );
extern int output_res16_directory( unsigned char *buffer );
extern void parse_debug_channels( const char *srcdir, const char *filename );
extern void BuildGlue( FILE *outfile, FILE *infile );
extern void BuildRelays16( FILE *outfile );
......@@ -164,6 +165,7 @@ extern void BuildRelays32( FILE *outfile );
extern void BuildSpec16File( FILE *outfile );
extern void BuildSpec32File( FILE *outfile );
extern void BuildDef32File( FILE *outfile );
extern void BuildDebugFile( FILE *outfile );
extern SPEC_TYPE ParseTopLevel( FILE *file, int def_only );
/* global variables */
......
......@@ -67,6 +67,7 @@ const char *output_file_name;
static FILE *input_file;
static FILE *output_file;
static const char *current_src_dir;
/* execution mode */
static enum
......@@ -76,6 +77,7 @@ static enum
MODE_EXE,
MODE_GLUE,
MODE_DEF,
MODE_DEBUG,
MODE_RELAY16,
MODE_RELAY32
} exec_mode = MODE_NONE;
......@@ -110,10 +112,12 @@ struct option_descr
const char *usage;
};
static void do_pic(void);
static void do_output( const char *arg );
static void do_usage(void);
static void do_warnings(void);
static void do_f_flags( const char *arg );
static void do_define( const char *arg );
static void do_include( const char *arg );
static void do_exe_mode( const char *arg );
static void do_spec( const char *arg );
static void do_def( const char *arg );
......@@ -121,7 +125,9 @@ static void do_exe( const char *arg );
static void do_glue( const char *arg );
static void do_relay16(void);
static void do_relay32(void);
static void do_debug(void);
static void do_sym( const char *arg );
static void do_chdir( const char *arg );
static void do_lib( const char *arg );
static void do_import( const char *arg );
static void do_dimport( const char *arg );
......@@ -129,30 +135,29 @@ static void do_rsrc( const char *arg );
static const struct option_descr option_table[] =
{
{ "-fPIC", 0, do_pic, "-fPIC Generate PIC code" },
{ "-h", 0, do_usage, "-h Display this help message" },
{ "-w", 0, do_warnings,"-w Turn on warnings" },
{ "-C", 1, do_chdir, "-C dir Change directory to <dir> before opening source files" },
{ "-f", 1, do_f_flags, "-f flags Compiler flags (only -fPIC is supported)" },
{ "-D", 1, do_define, "-D sym Ignored for C flags compatibility" },
{ "-I", 1, do_include, "-I dir Ignored for C flags compatibility" },
{ "-m", 1, do_exe_mode,"-m mode Set the executable mode (cui|gui|cuiw|guiw)" },
{ "-L", 1, do_lib, "-L directory Look for imports libraries in 'directory'" },
{ "-l", 1, do_import, "-l lib.dll Import the specified library" },
{ "-dl", 1, do_dimport, "-dl lib.dll Delay-import the specified library" },
{ "-res", 1, do_rsrc, "-res rsrc.res Load resources from rsrc.res" },
{ "-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'" },
{ "-sym", 1, do_sym, "-sym file.o Read the list of undefined symbols from 'file.o'\n" },
{ "-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" },
{ "-exe", 1, do_exe, "-exe name Build a .c file from the named executable" },
{ "-debug", 0, do_debug, "-debug [files] Build a .c file containing debug channels declarations" },
{ "-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" },
{ NULL, 0, NULL, NULL }
};
static void do_pic(void)
{
UsePIC = 1;
}
static void do_output( const char *arg )
{
if ( ( unlink ( arg ) ) == -1 && ( errno != ENOENT ) )
......@@ -175,7 +180,7 @@ static void do_usage(void)
fprintf( stderr, "Usage: winebuild [options]\n\n" );
fprintf( stderr, "Options:\n" );
for (opt = option_table; opt->name; opt++) fprintf( stderr, " %s\n", opt->usage );
fprintf( stderr, "\nExactly one of -spec, -glue or -relay must be specified.\n\n" );
fprintf( stderr, "\nExactly one of -spec, -def, -exe, -debug, -glue, -relay16 or -relay32 must be specified.\n\n" );
exit(1);
}
......@@ -184,6 +189,22 @@ static void do_warnings(void)
display_warnings = 1;
}
static void do_f_flags( const char *arg )
{
if (!strcmp( arg, "PIC" )) UsePIC = 1;
/* ignore all other flags */
}
static void do_define( const char *arg )
{
/* nothing */
}
static void do_include( const char *arg )
{
/* nothing */
}
static void do_spec( const char *arg )
{
if (exec_mode != MODE_NONE || !arg[0]) do_usage();
......@@ -228,6 +249,17 @@ static void do_glue( const char *arg )
open_input( arg );
}
static void do_debug(void)
{
if (exec_mode != MODE_NONE) do_usage();
exec_mode = MODE_DEBUG;
}
static void do_chdir( const char *arg )
{
current_src_dir = arg;
}
static void do_relay16(void)
{
if (exec_mode != MODE_NONE) do_usage();
......@@ -274,8 +306,7 @@ static void parse_options( char *argv[] )
char * const * ptr;
const char* arg=NULL;
ptr=argv+1;
while (*ptr != NULL)
for (ptr = argv + 1; *ptr; ptr++)
{
for (opt = option_table; opt->name; opt++)
{
......@@ -298,13 +329,18 @@ static void parse_options( char *argv[] )
if (!opt->name)
{
if (exec_mode == MODE_DEBUG && **ptr != '-')
{
/* this a file name to parse for debug channels */
parse_debug_channels( current_src_dir, *ptr );
continue;
}
fprintf( stderr, "Unrecognized option '%s'\n", *ptr );
do_usage();
}
if (opt->has_arg && arg!=NULL) opt->func( arg );
else opt->func( "" );
ptr++;
}
}
......@@ -346,6 +382,9 @@ int main(int argc, char **argv)
default: assert(0);
}
break;
case MODE_DEBUG:
BuildDebugFile( output_file );
break;
case MODE_GLUE:
BuildGlue( output_file, input_file );
break;
......
......@@ -36,7 +36,7 @@
int current_line = 0;
static SPEC_TYPE SpecType = SPEC_INVALID;
static SPEC_TYPE SpecType = SPEC_WIN32;
static char ParseBuffer[512];
static char TokenBuffer[512];
......@@ -128,26 +128,6 @@ static const char * GetToken( int allow_eof )
/*******************************************************************
* ParseDebug
*
* Parse a debug channel definition.
*/
static void ParseDebug(void)
{
const char *token = GetToken(0);
if (*token != '(') fatal_error( "Expected '(' got '%s'\n", token );
for (;;)
{
token = GetToken(0);
if (*token == ')') break;
debug_channels = xrealloc( debug_channels,
(nb_debug_channels + 1) * sizeof(*debug_channels));
debug_channels[nb_debug_channels++] = xstrdup(token);
}
}
/*******************************************************************
* ParseIgnore
*
* Parse an 'ignore' definition.
......@@ -575,12 +555,6 @@ SPEC_TYPE ParseTopLevel( FILE *file, int def_only )
fatal_error( "Owner only supported for Win16 spec files\n" );
strcpy( owner_name, GetToken(0) );
}
else if (strcmp(token, "debug_channels") == 0)
{
if (SpecType != SPEC_WIN32)
fatal_error( "debug channels only supported for Win32 spec files\n" );
ParseDebug();
}
else if (strcmp(token, "ignore") == 0)
{
if (SpecType != SPEC_WIN32)
......@@ -614,7 +588,6 @@ SPEC_TYPE ParseTopLevel( FILE *file, int def_only )
sprintf( DLLFileName, "%s.exe", DLLName );
}
if (SpecType == SPEC_INVALID) fatal_error( "Missing 'type' declaration\n" );
if (SpecType == SPEC_WIN16 && !owner_name[0])
fatal_error( "'owner' not specified for Win16 dll\n" );
......@@ -622,3 +595,84 @@ SPEC_TYPE ParseTopLevel( FILE *file, int def_only )
sort_names();
return SpecType;
}
/*******************************************************************
* 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.
*/
void parse_debug_channels( const char *srcdir, const char *filename )
{
FILE *file;
int eol_seen = 1;
char *fullname = NULL;
if (srcdir)
{
fullname = xmalloc( strlen(srcdir) + strlen(filename) + 2 );
strcpy( fullname, srcdir );
strcat( fullname, "/" );
strcat( fullname, filename );
}
else fullname = xstrdup( filename );
if (!(file = fopen( fullname, "r" ))) fatal_error( "Cannot open file '%s'\n", fullname );
input_file_name = fullname;
current_line = 1;
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 != '(')
fatal_error( "invalid debug channel specification '%s'\n", ParseBuffer );
p++;
while (isspace(*p)) p++;
if (!isalpha(*p))
fatal_error( "invalid debug channel specification '%s'\n", ParseBuffer );
channel = p;
while (isalnum(*p) || *p == '_') p++;
end = p;
while (isspace(*p)) p++;
if (*p != ')')
fatal_error( "invalid debug channel specification '%s'\n", ParseBuffer );
*end = 0;
add_debug_channel( channel );
}
current_line++;
}
fclose( file );
input_file_name = NULL;
current_line = 0;
free( fullname );
}
......@@ -786,7 +786,7 @@ void BuildSpec16File( FILE *outfile )
#ifdef __i386__
fprintf( outfile, " { 0x68, %s_CallFrom16_%s, 0x9a, __wine_call_from_16_%s,\n",
DLLName, profile,
make_c_identifier(DLLName), profile,
(typelist[i]->flags & (FLAG_REGISTER|FLAG_INTERRUPT)) ? "regs":
typelist[i]->type == TYPE_PASCAL_16? "word" : "long" );
if (argsize)
......@@ -890,16 +890,19 @@ void BuildSpec16File( FILE *outfile )
#if defined(__i386__)
fprintf( outfile, "asm(\"\\t.section\t.init ,\\\"ax\\\"\\n\"\n" );
fprintf( outfile, " \"\\tcall " PREFIX "__wine_spec_%s_init\\n\"\n", DLLName );
fprintf( outfile, " \"\\tcall " PREFIX "__wine_spec_%s_init\\n\"\n",
make_c_identifier(DLLName) );
fprintf( outfile, " \"\\t.previous\\n\");\n" );
#elif defined(__sparc__)
fprintf( outfile, "asm(\"\\t.section\t.init ,\\\"ax\\\"\\n\"\n" );
fprintf( outfile, " \"\\tcall " PREFIX "__wine_spec_%s_init\\n\"\n", DLLName );
fprintf( outfile, " \"\\tcall " PREFIX "__wine_spec_%s_init\\n\"\n",
make_c_identifier(DLLName) );
fprintf( outfile, " \"\\tnop\\n\"\n" );
fprintf( outfile, " \"\\t.previous\\n\");\n" );
#elif defined(__PPC__)
fprintf( outfile, "asm(\"\\t.section\t.init ,\\\"ax\\\"\\n\"\n" );
fprintf( outfile, " \"\\tbl " PREFIX "__wine_spec_%s_init\\n\"\n", DLLName );
fprintf( outfile, " \"\\tbl " PREFIX "__wine_spec_%s_init\\n\"\n",
make_c_identifier(DLLName) );
fprintf( outfile, " \"\\t.previous\\n\");\n" );
#else
#error You need to define the DLL constructor for your architecture
......@@ -914,7 +917,7 @@ void BuildSpec16File( FILE *outfile )
"{\n"
" extern void __wine_register_dll_16( const struct dll_descriptor *descr );\n"
" __wine_register_dll_16( &descriptor );\n"
"}\n", DLLName );
"}\n", make_c_identifier(DLLName) );
}
......
......@@ -58,7 +58,7 @@ static const char *make_internal_name( const ORDDEF *odp, const char *prefix )
for (p = buffer; *p; p++) if (!isalnum(*p) && *p != '_') break;
if (!*p) return buffer;
}
sprintf( buffer, "__wine_%s_%s_%d", prefix, DLLName, odp->ordinal );
sprintf( buffer, "__wine_%s_%s_%d", prefix, make_c_identifier(DLLName), odp->ordinal );
return buffer;
}
......@@ -310,9 +310,9 @@ static int output_exports( FILE *outfile, int nr_exports )
if (!isalnum(*p) && *p != '_' && *p != '.') break;
if (*p) continue;
fprintf( outfile, " \"\\t.globl " PREFIX "__wine_dllexport_%s_%s\\n\"\n",
DLLName, Names[i]->name );
make_c_identifier(DLLName), Names[i]->name );
fprintf( outfile, " \"" PREFIX "__wine_dllexport_%s_%s:\\n\"\n",
DLLName, Names[i]->name );
make_c_identifier(DLLName), Names[i]->name );
}
fprintf( outfile, " \"\\t.long 0xffffffff\\n\"\n" );
......@@ -433,7 +433,7 @@ static void output_register_funcs( FILE *outfile )
void BuildSpec32File( FILE *outfile )
{
int exports_size = 0;
int nr_exports, nr_imports, nr_resources, nr_debug;
int nr_exports, nr_imports, nr_resources;
int characteristics, subsystem;
DWORD page_size;
......@@ -504,10 +504,6 @@ void BuildSpec32File( FILE *outfile )
nr_resources = output_resources( outfile );
/* Output the debug channels */
nr_debug = output_debug( outfile );
/* Output LibMain function */
characteristics = subsystem = 0;
......@@ -714,38 +710,20 @@ void BuildSpec32File( FILE *outfile )
#if defined(__i386__)
fprintf( outfile, "asm(\"\\t.section\t.init ,\\\"ax\\\"\\n\"\n" );
fprintf( outfile, " \"\\tcall " PREFIX "__wine_spec_%s_init\\n\"\n", DLLName );
fprintf( outfile, " \"\\tcall " PREFIX "__wine_spec_%s_init\\n\"\n",
make_c_identifier(DLLName) );
fprintf( outfile, " \"\\t.previous\\n\");\n" );
if (nr_debug)
{
fprintf( outfile, "asm(\"\\t.section\t.fini ,\\\"ax\\\"\\n\"\n" );
fprintf( outfile, " \"\\tcall " PREFIX "__wine_spec_%s_fini\\n\"\n", DLLName );
fprintf( outfile, " \"\\t.previous\\n\");\n" );
}
#elif defined(__sparc__)
fprintf( outfile, "asm(\"\\t.section\t.init ,\\\"ax\\\"\\n\"\n" );
fprintf( outfile, " \"\\tcall " PREFIX "__wine_spec_%s_init\\n\"\n", DLLName );
fprintf( outfile, " \"\\tcall " PREFIX "__wine_spec_%s_init\\n\"\n",
make_c_identifier(DLLName) );
fprintf( outfile, " \"\\tnop\\n\"\n" );
fprintf( outfile, " \"\\t.previous\\n\");\n" );
if (nr_debug)
{
fprintf( outfile, "asm(\"\\t.section\t.fini ,\\\"ax\\\"\\n\"\n" );
fprintf( outfile, " \"\\tcall " PREFIX "__wine_spec_%s_fini\\n\"\n", DLLName );
fprintf( outfile, " \"\\tnop\\n\"\n" );
fprintf( outfile, " \"\\t.previous\\n\");\n" );
}
#elif defined(__PPC__)
fprintf( outfile, "asm(\"\\t.section\t.init ,\\\"ax\\\"\\n\"\n" );
fprintf( outfile, " \"\\tbl " PREFIX "__wine_spec_%s_init\\n\"\n",
DLLName );
make_c_identifier(DLLName) );
fprintf( outfile, " \"\\t.previous\\n\");\n" );
if (nr_debug)
{
fprintf( outfile, "asm(\"\\t.section\t.fini ,\\\"ax\\\"\\n\"\n" );
fprintf( outfile, " \"\\tbl " PREFIX "__wine_spec_%s_fini\\n\"\n",
DLLName );
fprintf( outfile, " \"\\t.previous\\n\");\n" );
}
#else
#error You need to define the DLL constructor for your architecture
#endif
......@@ -760,20 +738,8 @@ void BuildSpec32File( FILE *outfile )
" extern void __wine_dll_register( const struct image_nt_headers *, const char * );\n"
" extern void *__wine_dbg_register( char * const *, int );\n"
" __wine_dll_register( &nt_header, \"%s\" );\n",
DLLName, DLLFileName );
if (nr_debug)
fprintf( outfile, " debug_registration = __wine_dbg_register( debug_channels, %d );\n",
nr_debug );
make_c_identifier(DLLName), DLLFileName );
fprintf( outfile, "}\n" );
if (nr_debug)
{
fprintf( outfile,
"\nvoid __wine_spec_%s_fini(void)\n"
"{\n"
" extern void __wine_dbg_unregister( void* );\n"
" __wine_dbg_unregister( debug_registration );\n"
"}\n", DLLName );
}
}
......@@ -842,3 +808,91 @@ void BuildDef32File(FILE *outfile)
fprintf(outfile, " @%d\n", odp->ordinal);
}
}
/*******************************************************************
* BuildDebugFile
*
* Build the debugging channels source file.
*/
void BuildDebugFile( FILE *outfile )
{
int nr_debug;
char *prefix, *p;
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 */
fprintf( outfile,
"#ifdef __GNUC__\n"
"static void __wine_dbg_%s_init(void) __attribute__((constructor));\n"
"static void __wine_dbg_%s_fini(void) __attribute__((destructor));\n"
"#else\n"
"static void __asm__dummy_dll_init(void) {\n",
prefix, prefix );
#if defined(__i386__)
fprintf( outfile, "asm(\"\\t.section\t.init ,\\\"ax\\\"\\n\"\n" );
fprintf( outfile, " \"\\tcall " PREFIX "__wine_dbg_%s_init\\n\"\n", prefix );
fprintf( outfile, " \"\\t.previous\\n\");\n" );
fprintf( outfile, "asm(\"\\t.section\t.fini ,\\\"ax\\\"\\n\"\n" );
fprintf( outfile, " \"\\tcall " PREFIX "__wine_dbg_%s_fini\\n\"\n", prefix );
fprintf( outfile, " \"\\t.previous\\n\");\n" );
#elif defined(__sparc__)
fprintf( outfile, "asm(\"\\t.section\t.init ,\\\"ax\\\"\\n\"\n" );
fprintf( outfile, " \"\\tcall " PREFIX "__wine_dbg_%s_init\\n\"\n", prefix );
fprintf( outfile, " \"\\tnop\\n\"\n" );
fprintf( outfile, " \"\\t.previous\\n\");\n" );
fprintf( outfile, "asm(\"\\t.section\t.fini ,\\\"ax\\\"\\n\"\n" );
fprintf( outfile, " \"\\tcall " PREFIX "__wine_dbg_%s_fini\\n\"\n", prefix );
fprintf( outfile, " \"\\tnop\\n\"\n" );
fprintf( outfile, " \"\\t.previous\\n\");\n" );
#elif defined(__PPC__)
fprintf( outfile, "asm(\"\\t.section\t.init ,\\\"ax\\\"\\n\"\n" );
fprintf( outfile, " \"\\tbl " PREFIX "__wine_dbg_%s_init\\n\"\n", prefix );
fprintf( outfile, " \"\\t.previous\\n\");\n" );
fprintf( outfile, "asm(\"\\t.section\t.fini ,\\\"ax\\\"\\n\"\n" );
fprintf( outfile, " \"\\tbl " PREFIX "__wine_dbg_%s_fini\\n\"\n", prefix );
fprintf( outfile, " \"\\t.previous\\n\");\n" );
#else
#error You need to define the DLL constructor for your architecture
#endif
fprintf( outfile, "}\n#endif /* defined(__GNUC__) */\n" );
fprintf( outfile,
"\n#ifdef __GNUC__\n"
"static\n"
"#endif\n"
"void __wine_dbg_%s_init(void)\n"
"{\n"
" extern void *__wine_dbg_register( char * const *, int );\n"
" debug_registration = __wine_dbg_register( debug_channels, %d );\n"
"}\n", prefix, nr_debug );
fprintf( outfile,
"\n#ifdef __GNUC__\n"
"static\n"
"#endif\n"
"void __wine_dbg_%s_fini(void)\n"
"{\n"
" extern void __wine_dbg_unregister( void* );\n"
" __wine_dbg_unregister( debug_registration );\n"
"}\n", prefix );
free( prefix );
}
......@@ -151,6 +151,27 @@ void dump_bytes( FILE *outfile, const unsigned char *data, int len,
fprintf( outfile, "\n};\n" );
}
/*******************************************************************
* make_c_identifier
*
* Map a string to a valid C identifier.
*/
const char *make_c_identifier( const char *str )
{
static char buffer[256];
char *p;
for (p = buffer; *str && p < buffer+sizeof(buffer)-1; p++, str++)
{
if (isalnum(*str)) *p = *str;
else *p = '_';
}
*p = 0;
return buffer;
}
/*****************************************************************
* Function: get_alignment
*
......
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