mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 16:51:39 +00:00
* LinkerFlag tag support
* Build addsys, libwine.a, user32.dll, advapi32.dll, gdi32.dll, msvcrt.dll, and welcome.exe svn path=/branches/xmlbuildsystem/; revision=13055
This commit is contained in:
parent
65f058c4f0
commit
d3a30bf22d
29 changed files with 1008 additions and 51 deletions
|
@ -30,8 +30,11 @@
|
|||
<xi:include href="hal/directory.xml" />
|
||||
</directory>
|
||||
<directory name="iface">
|
||||
<directory name="addsys">
|
||||
<xi:include href="iface/addsys/addsys.xml" />
|
||||
</directory>
|
||||
<directory name="native">
|
||||
<xi:include href="iface/native/module.xml" />
|
||||
<xi:include href="iface/native/genntdll.xml" />
|
||||
</directory>
|
||||
</directory>
|
||||
<directory name="lib">
|
||||
|
@ -40,4 +43,7 @@
|
|||
<directory name="ntoskrnl">
|
||||
<xi:include href="ntoskrnl/ntoskrnl.xml" />
|
||||
</directory>
|
||||
<directory name="subsys">
|
||||
<xi:include href="subsys/directory.xml" />
|
||||
</directory>
|
||||
</project>
|
||||
|
|
14
reactos/iface/addsys/addsys.xml
Normal file
14
reactos/iface/addsys/addsys.xml
Normal file
|
@ -0,0 +1,14 @@
|
|||
<module name="addsys" type="buildtool">
|
||||
<include base="addsys">.</include>
|
||||
<file>genw32k.c</file>
|
||||
<invoke>
|
||||
<input>
|
||||
<inputfile>w32ksvc.db</inputfile>
|
||||
</input>
|
||||
<output>
|
||||
<outputfile>../../subsys/win32k/main/svctab.c</outputfile>
|
||||
<outputfile>../../lib/gdi32/misc/win32k.c</outputfile>
|
||||
<outputfile>../../lib/user32/misc/win32k.c</outputfile>
|
||||
</output>
|
||||
</invoke>
|
||||
</module>
|
|
@ -299,11 +299,11 @@ process(
|
|||
void usage(char * argv0)
|
||||
{
|
||||
printf("Usage: %s w32ksvc.db w32k.lst ssdt.h win32k.c win32k.c\n"
|
||||
" w32ksvc.db input file(system calls database)\n"
|
||||
" w32k.lst system functions database\n"
|
||||
" ssdt.h WIN32K service table\n"
|
||||
" win32k.c GDI32 stubs\n"
|
||||
" win32k.c USER32 stubs\n",
|
||||
" win32k.c USER32 stubs\n"
|
||||
" w32ksvc.db input file(system calls database)\n",
|
||||
argv0
|
||||
);
|
||||
}
|
||||
|
@ -322,34 +322,34 @@ int main(int argc, char* argv[])
|
|||
return(1);
|
||||
}
|
||||
|
||||
in = fopen(argv[1],"rb");
|
||||
if (in == NULL)
|
||||
{
|
||||
perror("Failed to open input file (system calls database)");
|
||||
return(1);
|
||||
}
|
||||
|
||||
out1 = fopen(argv[2],"wb");
|
||||
out1 = fopen(argv[1],"wb");
|
||||
if (out1 == NULL)
|
||||
{
|
||||
perror("Failed to open output file (WIN32K service table)");
|
||||
return(1);
|
||||
}
|
||||
|
||||
out2 = fopen(argv[3],"wb");
|
||||
out2 = fopen(argv[2],"wb");
|
||||
if (out2 == NULL)
|
||||
{
|
||||
perror("Failed to open output file (GDI32 stubs)");
|
||||
return(1);
|
||||
}
|
||||
|
||||
out3 = fopen(argv[4],"wb");
|
||||
out3 = fopen(argv[3],"wb");
|
||||
if (out3 == NULL)
|
||||
{
|
||||
perror("Failed to open output file (USER32 stubs)");
|
||||
return(1);
|
||||
}
|
||||
|
||||
in = fopen(argv[4],"rb");
|
||||
if (in == NULL)
|
||||
{
|
||||
perror("Failed to open input file (system calls database)");
|
||||
return(1);
|
||||
}
|
||||
|
||||
ret = process(in,out2,out3);
|
||||
rewind(in);
|
||||
ret = makeSystemServiceTable(in, out1);
|
||||
|
|
47
reactos/lib/advapi32/advapi32.xml
Normal file
47
reactos/lib/advapi32/advapi32.xml
Normal file
|
@ -0,0 +1,47 @@
|
|||
<module name="advapi32" type="win32dll">
|
||||
<importlibrary definition="advapi32.def" />
|
||||
<include base="advapi32">.</include>
|
||||
<define name="__USE_W32API" />
|
||||
<define name="WINVER">0x600</define>
|
||||
<define name="_WIN32_IE">0x0500</define>
|
||||
<define name="_WIN32_WINNT">0x0501</define>
|
||||
<library>ntdll</library>
|
||||
<library>kernel32</library>
|
||||
<directory name="crypt">
|
||||
<file>crypt.c</file>
|
||||
<file>crypt_des.c</file>
|
||||
<file>crypt_lmhash.c</file>
|
||||
<file>crypt_md4.c</file>
|
||||
<file>crypt_md5.c</file>
|
||||
<file>crypt_sha.c</file>
|
||||
</directory>
|
||||
<directory name="misc">
|
||||
<file>dllmain.c</file>
|
||||
<file>hwprofiles.c</file>
|
||||
<file>logon.c</file>
|
||||
<file>shutdown.c</file>
|
||||
<file>sysfunc.c</file>
|
||||
</directory>
|
||||
<directory name="reg">
|
||||
<file>reg.c</file>
|
||||
</directory>
|
||||
<directory name="sec">
|
||||
<file>ac.c</file>
|
||||
<file>audit.c</file>
|
||||
<file>lsa.c</file>
|
||||
<file>misc.c</file>
|
||||
<file>sec.c</file>
|
||||
<file>sid.c</file>
|
||||
<file>trustee.c</file>
|
||||
</directory>
|
||||
<directory name="service">
|
||||
<file>eventlog.c</file>
|
||||
<file>scm.c</file>
|
||||
<file>sctrl.c</file>
|
||||
<file>undoc.c</file>
|
||||
</directory>
|
||||
<directory name="token">
|
||||
<file>privilege.c</file>
|
||||
<file>token.c</file>
|
||||
</directory>
|
||||
</module>
|
|
@ -1,9 +1,21 @@
|
|||
<directory name="advapi32">
|
||||
<xi:include href="advapi32/advapi32.xml" />
|
||||
</directory>
|
||||
<directory name="gdi32">
|
||||
<xi:include href="gdi32/gdi32.xml" />
|
||||
</directory>
|
||||
<directory name="kernel32">
|
||||
<xi:include href="kernel32/kernel32.xml" />
|
||||
</directory>
|
||||
<directory name="kjs">
|
||||
<xi:include href="kjs/kjs.xml" />
|
||||
</directory>
|
||||
<directory name="libwine">
|
||||
<xi:include href="libwine/libwine.xml" />
|
||||
</directory>
|
||||
<directory name="msvcrt">
|
||||
<xi:include href="msvcrt/msvcrt.xml" />
|
||||
</directory>
|
||||
<directory name="ntdll">
|
||||
<xi:include href="ntdll/ntdll.xml" />
|
||||
</directory>
|
||||
|
@ -19,3 +31,6 @@
|
|||
<directory name="string">
|
||||
<xi:include href="string/string.xml" />
|
||||
</directory>
|
||||
<directory name="user32">
|
||||
<xi:include href="user32/user32.xml" />
|
||||
</directory>
|
||||
|
|
35
reactos/lib/gdi32/gdi32.xml
Normal file
35
reactos/lib/gdi32/gdi32.xml
Normal file
|
@ -0,0 +1,35 @@
|
|||
<module name="gdi32" type="win32dll">
|
||||
<dependency>addsys</dependency>
|
||||
<importlibrary definition="gdi32.def" />
|
||||
<include base="gdi32">include</include>
|
||||
<define name="_DISABLE_TIDENTS" />
|
||||
<define name="UNICODE" />
|
||||
<define name="__USE_W32API" />
|
||||
<define name="WINVER">0x0600</define>
|
||||
<define name="_WIN32_WINNT">0x0501</define>
|
||||
<library>ntdll</library>
|
||||
<library>rosrtl</library>
|
||||
<library>kernel32</library>
|
||||
<library>advapi32</library>
|
||||
<directory name="main">
|
||||
<file>dllmain.c</file>
|
||||
</directory>
|
||||
<directory name="misc">
|
||||
<file>heap.c</file>
|
||||
<file>misc.c</file>
|
||||
<file>stubs.c</file>
|
||||
<file>stubsa.c</file>
|
||||
<file>stubsw.c</file>
|
||||
<file>win32k.c</file>
|
||||
<file>wingl.c</file>
|
||||
</directory>
|
||||
<directory name="objects">
|
||||
<file>bitblt.c</file>
|
||||
<file>dc.c</file>
|
||||
<file>font.c</file>
|
||||
<file>linedda.c</file>
|
||||
<file>metafile.c</file>
|
||||
<file>region.c</file>
|
||||
<file>text.c</file>
|
||||
</directory>
|
||||
</module>
|
5
reactos/lib/libwine/libwine.xml
Normal file
5
reactos/lib/libwine/libwine.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<module name="wine" type="staticlibrary">
|
||||
<define name="_DISABLE_TIDENTS" />
|
||||
<define name="__REACTOS__" />
|
||||
<file>debug.c</file>
|
||||
</module>
|
|
@ -91,8 +91,8 @@ DllMain(PVOID hinstDll, ULONG dwReason, PVOID reserved)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
_acmdln = strdup(GetCommandLineA());
|
||||
_wcmdln = wcsdup(GetCommandLineW());
|
||||
_acmdln = _strdup(GetCommandLineA());
|
||||
_wcmdln = _wcsdup(GetCommandLineW());
|
||||
|
||||
/* FIXME: more initializations... */
|
||||
|
||||
|
|
|
@ -165,9 +165,9 @@ char **DuplicateEnvironment(char **original_environment, int wide)
|
|||
for (envptr = original_environment; count > 1; newenvptr++, count--)
|
||||
{
|
||||
if (wide)
|
||||
*newenvptr = (char*)wcsdup((wchar_t*)*envptr++);
|
||||
*newenvptr = (char*)_wcsdup((wchar_t*)*envptr++);
|
||||
else
|
||||
*newenvptr = strdup(*envptr++);
|
||||
*newenvptr = _strdup(*envptr++);
|
||||
if (*newenvptr == NULL)
|
||||
{
|
||||
for (newenvptr--; newenvptr >= newenv; newenvptr--);
|
||||
|
@ -243,7 +243,7 @@ int SetEnv(const wchar_t *option)
|
|||
/* Find the option we're trying to modify. */
|
||||
for (index = 0, wenvptr = _wenviron; *wenvptr != NULL; wenvptr++, index++)
|
||||
{
|
||||
if (!wcsnicmp(*wenvptr, option, epos - option))
|
||||
if (!_wcsnicmp(*wenvptr, option, epos - option))
|
||||
{
|
||||
found = 1;
|
||||
break;
|
||||
|
@ -277,7 +277,7 @@ int SetEnv(const wchar_t *option)
|
|||
else
|
||||
{
|
||||
/* Make a copy of the option that we will store in the environment block. */
|
||||
woption = wcsdup((wchar_t*)option);
|
||||
woption = _wcsdup((wchar_t*)option);
|
||||
if (woption == NULL)
|
||||
{
|
||||
free(name);
|
||||
|
|
443
reactos/lib/msvcrt/msvcrt.xml
Normal file
443
reactos/lib/msvcrt/msvcrt.xml
Normal file
|
@ -0,0 +1,443 @@
|
|||
<module name="msvcrt" type="win32dll">
|
||||
<linkerflag>-nostartfiles</linkerflag>
|
||||
<linkerflag>--enable-stdcall-fixup</linkerflag>
|
||||
<linkerflag>-lgcc</linkerflag>
|
||||
<importlibrary definition="msvcrt.def" />
|
||||
<include base="msvcrt">.</include>
|
||||
<define name="_DISABLE_TIDENTS" />
|
||||
<define name="__USE_W32API" />
|
||||
<define name="_WIN32_IE">0x600</define>
|
||||
<define name="_WIN32_WINNT">0x501</define>
|
||||
<define name="__REACTOS__" />
|
||||
<define name="USE_MSVCRT_PREFIX" />
|
||||
<define name="_MSVCRT_LIB_" />
|
||||
<define name="_MT" />
|
||||
<library>wine</library>
|
||||
<library>string</library>
|
||||
<library>kernel32</library>
|
||||
<library>ntdll</library>
|
||||
<directory name="conio">
|
||||
<file>cgets.c</file>
|
||||
<file>cprintf.c</file>
|
||||
<file>cputs.c</file>
|
||||
<file>cscanf.c</file>
|
||||
<file>getch.c</file>
|
||||
<file>getche.c</file>
|
||||
<file>kbhit.c</file>
|
||||
<file>putch.c</file>
|
||||
<file>ungetch.c</file>
|
||||
</directory>
|
||||
<directory name="ctype">
|
||||
<file>ctype.c</file>
|
||||
<file>isalnum.c</file>
|
||||
<file>isalpha.c</file>
|
||||
<file>isascii.c</file>
|
||||
<file>iscntrl.c</file>
|
||||
<file>iscsym.c</file>
|
||||
<file>isctype.c</file>
|
||||
<file>isdigit.c</file>
|
||||
<file>isgraph.c</file>
|
||||
<file>islower.c</file>
|
||||
<file>isprint.c</file>
|
||||
<file>ispunct.c</file>
|
||||
<file>isspace.c</file>
|
||||
<file>isupper.c</file>
|
||||
<file>isxdigit.c</file>
|
||||
<file>toascii.c</file>
|
||||
<file>tolower.c</file>
|
||||
<file>toupper.c</file>
|
||||
</directory>
|
||||
<directory name="direct">
|
||||
<file>chdir.c</file>
|
||||
<file>chdrive.c</file>
|
||||
<file>getcwd.c</file>
|
||||
<file>getdcwd.c</file>
|
||||
<file>getdfree.c</file>
|
||||
<file>getdrive.c</file>
|
||||
<file>mkdir.c</file>
|
||||
<file>rmdir.c</file>
|
||||
<file>wchdir.c</file>
|
||||
<file>wgetcwd.c</file>
|
||||
<file>wgetdcwd.c</file>
|
||||
<file>wmkdir.c</file>
|
||||
<file>wrmdir.c</file>
|
||||
</directory>
|
||||
<directory name="except">
|
||||
<file>abnorter.c</file>
|
||||
<file>exhand2.c</file>
|
||||
<file>matherr.c</file>
|
||||
<file>seh.s</file>
|
||||
<file>unwind.c</file>
|
||||
<file>xcptfil.c</file>
|
||||
</directory>
|
||||
<directory name="float">
|
||||
<file>chgsign.c</file>
|
||||
<file>clearfp.c</file>
|
||||
<file>cntrlfp.c</file>
|
||||
<file>copysign.c</file>
|
||||
<file>fpclass.c</file>
|
||||
<file>fpecode.c</file>
|
||||
<file>fpreset.c</file>
|
||||
<file>isnan.c</file>
|
||||
<file>logb.c</file>
|
||||
<file>nafter.c</file>
|
||||
<file>scalb.c</file>
|
||||
<file>statfp.c</file>
|
||||
</directory>
|
||||
<directory name="io">
|
||||
<file>access.c</file>
|
||||
<file>chmod.c</file>
|
||||
<file>chsize.c</file>
|
||||
<file>close.c</file>
|
||||
<file>commit.c</file>
|
||||
<file>create.c</file>
|
||||
<file>dup2.c</file>
|
||||
<file>dup.c</file>
|
||||
<file>eof.c</file>
|
||||
<file>filelen.c</file>
|
||||
<file>fileleni.c</file>
|
||||
<file>find.c</file>
|
||||
<file>fmode.c</file>
|
||||
<file>isatty.c</file>
|
||||
<file>locking.c</file>
|
||||
<file>lseek.c</file>
|
||||
<file>lseeki64.c</file>
|
||||
<file>mktemp.c</file>
|
||||
<file>open.c</file>
|
||||
<file>pipe.c</file>
|
||||
<file>read.c</file>
|
||||
<file>setmode.c</file>
|
||||
<file>sopen.c</file>
|
||||
<file>stubs.c</file>
|
||||
<file>tell.c</file>
|
||||
<file>telli64.c</file>
|
||||
<file>umask.c</file>
|
||||
<file>unlink.c</file>
|
||||
<file>utime.c</file>
|
||||
<file>waccess.c</file>
|
||||
<file>wchmod.c</file>
|
||||
<file>wcreate.c</file>
|
||||
<file>wfind.c</file>
|
||||
<file>wmktemp.c</file>
|
||||
<file>wopen.c</file>
|
||||
<file>write.c</file>
|
||||
<file>wunlink.c</file>
|
||||
<file>wutime.c</file>
|
||||
</directory>
|
||||
<directory name="locale">
|
||||
<file>locale.c</file>
|
||||
</directory>
|
||||
<directory name="math">
|
||||
<file>acos.c</file>
|
||||
<file>adjust.c</file>
|
||||
<file>asin.c</file>
|
||||
<file>atan2.c</file>
|
||||
<file>atan.c</file>
|
||||
<file>cabs.c</file>
|
||||
<file>ceil.c</file>
|
||||
<file>cos.c</file>
|
||||
<file>cosh.c</file>
|
||||
<file>exp.c</file>
|
||||
<file>fabs.c</file>
|
||||
<file>floor.c</file>
|
||||
<file>fmod.c</file>
|
||||
<file>frexp.c</file>
|
||||
<file>huge_val.c</file>
|
||||
<file>hypot.c</file>
|
||||
<file>j0_y0.c</file>
|
||||
<file>j1_y1.c</file>
|
||||
<file>jn_yn.c</file>
|
||||
<file>ldexp.c</file>
|
||||
<file>log10.c</file>
|
||||
<file>log.c</file>
|
||||
<file>math.c</file>
|
||||
<file>modf.c</file>
|
||||
<file>pow.c</file>
|
||||
<file>sin.c</file>
|
||||
<file>sinh.c</file>
|
||||
<file>sqrt.c</file>
|
||||
<file>stubs.c</file>
|
||||
<file>tan.c</file>
|
||||
<file>tanh.c</file>
|
||||
</directory>
|
||||
<directory name="mbstring">
|
||||
<file>hanzen.c</file>
|
||||
<file>ischira.c</file>
|
||||
<file>iskana.c</file>
|
||||
<file>iskmoji.c</file>
|
||||
<file>iskpun.c</file>
|
||||
<file>islead.c</file>
|
||||
<file>islwr.c</file>
|
||||
<file>ismbal.c</file>
|
||||
<file>ismbaln.c</file>
|
||||
<file>ismbc.c</file>
|
||||
<file>ismbgra.c</file>
|
||||
<file>ismbkaln.c</file>
|
||||
<file>ismblead.c</file>
|
||||
<file>ismbpri.c</file>
|
||||
<file>ismbpun.c</file>
|
||||
<file>ismbtrl.c</file>
|
||||
<file>isuppr.c</file>
|
||||
<file>jistojms.c</file>
|
||||
<file>jmstojis.c</file>
|
||||
<file>mbbtype.c</file>
|
||||
<file>mbccpy.c</file>
|
||||
<file>mbclen.c</file>
|
||||
<file>mbscat.c</file>
|
||||
<file>mbschr.c</file>
|
||||
<file>mbscmp.c</file>
|
||||
<file>mbscoll.c</file>
|
||||
<file>mbscpy.c</file>
|
||||
<file>mbscspn.c</file>
|
||||
<file>mbsdec.c</file>
|
||||
<file>mbsdup.c</file>
|
||||
<file>mbsicmp.c</file>
|
||||
<file>mbsicoll.c</file>
|
||||
<file>mbsinc.c</file>
|
||||
<file>mbslen.c</file>
|
||||
<file>mbslwr.c</file>
|
||||
<file>mbsncat.c</file>
|
||||
<file>mbsnccnt.c</file>
|
||||
<file>mbsncmp.c</file>
|
||||
<file>mbsncoll.c</file>
|
||||
<file>mbsncpy.c</file>
|
||||
<file>mbsnextc.c</file>
|
||||
<file>mbsnicmp.c</file>
|
||||
<file>mbsnicoll.c</file>
|
||||
<file>mbsninc.c</file>
|
||||
<file>mbsnset.c</file>
|
||||
<file>mbspbrk.c</file>
|
||||
<file>mbsrchr.c</file>
|
||||
<file>mbsrev.c</file>
|
||||
<file>mbsset.c</file>
|
||||
<file>mbsspn.c</file>
|
||||
<file>mbsspnp.c</file>
|
||||
<file>mbsstr.c</file>
|
||||
<file>mbstok.c</file>
|
||||
<file>mbstrlen.c</file>
|
||||
<file>mbsupr.c</file>
|
||||
</directory>
|
||||
<directory name="misc">
|
||||
<file>amsg.c</file>
|
||||
<file>assert.c</file>
|
||||
<file>crtmain.c</file>
|
||||
<file>dllmain.c</file>
|
||||
<file>environ.c</file>
|
||||
<file>getargs.c</file>
|
||||
<file>initterm.c</file>
|
||||
<file>lock.c</file>
|
||||
<file>purecall.c</file>
|
||||
<file>stubs.c</file>
|
||||
<file>tls.c</file>
|
||||
</directory>
|
||||
<directory name="process">
|
||||
<file>_cwait.c</file>
|
||||
<file>_system.c</file>
|
||||
<file>dll.c</file>
|
||||
<file>process.c</file>
|
||||
<file>procid.c</file>
|
||||
<file>thread.c</file>
|
||||
<file>threadid.c</file>
|
||||
<file>threadx.c</file>
|
||||
</directory>
|
||||
<directory name="search">
|
||||
<file>lfind.c</file>
|
||||
<file>lsearch.c</file>
|
||||
</directory>
|
||||
<directory name="setjmp">
|
||||
<directory name="i386">
|
||||
<file>setjmp.s</file>
|
||||
</directory>
|
||||
</directory>
|
||||
<directory name="signal">
|
||||
<file>signal.c</file>
|
||||
</directory>
|
||||
<directory name="stdio">
|
||||
<file>allocfil.c</file>
|
||||
<file>clearerr.c</file>
|
||||
<file>fclose.c</file>
|
||||
<file>fdopen.c</file>
|
||||
<file>feof.c</file>
|
||||
<file>ferror.c</file>
|
||||
<file>fflush.c</file>
|
||||
<file>fgetc.c</file>
|
||||
<file>fgetchar.c</file>
|
||||
<file>fgetpos.c</file>
|
||||
<file>fgets.c</file>
|
||||
<file>fgetws.c</file>
|
||||
<file>filbuf.c</file>
|
||||
<file>fileno.c</file>
|
||||
<file>flsbuf.c</file>
|
||||
<file>fopen.c</file>
|
||||
<file>fprintf.c</file>
|
||||
<file>fputc.c</file>
|
||||
<file>fputchar.c</file>
|
||||
<file>fputs.c</file>
|
||||
<file>fread.c</file>
|
||||
<file>freopen.c</file>
|
||||
<file>fscanf.c</file>
|
||||
<file>fseek.c</file>
|
||||
<file>fsetpos.c</file>
|
||||
<file>fsopen.c</file>
|
||||
<file>ftell.c</file>
|
||||
<file>fwalk.c</file>
|
||||
<file>fwrite.c</file>
|
||||
<file>getc.c</file>
|
||||
<file>getchar.c</file>
|
||||
<file>gets.c</file>
|
||||
<file>getw.c</file>
|
||||
<file>perror.c</file>
|
||||
<file>popen.c</file>
|
||||
<file>printf.c</file>
|
||||
<file>putc.c</file>
|
||||
<file>putchar.c</file>
|
||||
<file>puts.c</file>
|
||||
<file>putw.c</file>
|
||||
<file>remove.c</file>
|
||||
<file>rename.c</file>
|
||||
<file>rewind.c</file>
|
||||
<file>rmtmp.c</file>
|
||||
<file>scanf.c</file>
|
||||
<file>setbuf.c</file>
|
||||
<file>setvbuf.c</file>
|
||||
<file>sprintf.c</file>
|
||||
<file>sscanf.c</file>
|
||||
<file>stdhnd.c</file>
|
||||
<file>tempnam.c</file>
|
||||
<file>tmpfile.c</file>
|
||||
<file>tmpnam.c</file>
|
||||
<file>ungetc.c</file>
|
||||
<file>vfprintf.c</file>
|
||||
<file>vfscanf.c</file>
|
||||
<file>vfwprint.c</file>
|
||||
<file>vprintf.c</file>
|
||||
<file>vscanf.c</file>
|
||||
<file>vsprintf.c</file>
|
||||
<file>vsscanf.c</file>
|
||||
<file>wfdopen.c</file>
|
||||
<file>wrename.c</file>
|
||||
<file>wtempnam.c</file>
|
||||
<file>wtmpnam.c</file>
|
||||
</directory>
|
||||
<directory name="stdlib">
|
||||
<file>abort.c</file>
|
||||
<file>abs.c</file>
|
||||
<file>atexit.c</file>
|
||||
<file>atof.c</file>
|
||||
<file>atoi.c</file>
|
||||
<file>atoi64.c</file>
|
||||
<file>atol.c</file>
|
||||
<file>atold.c</file>
|
||||
<file>bsearch.c</file>
|
||||
<file>div.c</file>
|
||||
<file>ecvt.c</file>
|
||||
<file>ecvtbuf.c</file>
|
||||
<file>errno.c</file>
|
||||
<file>fcvt.c</file>
|
||||
<file>fcvtbuf.c</file>
|
||||
<file>fullpath.c</file>
|
||||
<file>gcvt.c</file>
|
||||
<file>getenv.c</file>
|
||||
<file>itoa.c</file>
|
||||
<file>itow.c</file>
|
||||
<file>labs.c</file>
|
||||
<file>ldiv.c</file>
|
||||
<file>makepath.c</file>
|
||||
<file>malloc.c</file>
|
||||
<file>mbstowcs.c</file>
|
||||
<file>mbtowc.c</file>
|
||||
<file>obsol.c</file>
|
||||
<file>putenv.c</file>
|
||||
<file>qsort.c</file>
|
||||
<file>rand.c</file>
|
||||
<file>rot.c</file>
|
||||
<file>senv.c</file>
|
||||
<file>splitp.c</file>
|
||||
<file>strtod.c</file>
|
||||
<file>strtol.c</file>
|
||||
<file>strtold.c</file>
|
||||
<file>strtoll.c</file>
|
||||
<file>strtoul.c</file>
|
||||
<file>strtoull.c</file>
|
||||
<file>swab.c</file>
|
||||
<file>wcstod.c</file>
|
||||
<file>wcstol.c</file>
|
||||
<file>wcstom.c</file>
|
||||
<file>wcstomb.c</file>
|
||||
<file>wcstombs.c</file>
|
||||
<file>wcstoul.c</file>
|
||||
<file>wctomb.c</file>
|
||||
<file>wfulpath.c</file>
|
||||
<file>witoa.c</file>
|
||||
<file>witow.c</file>
|
||||
<file>wmakpath.c</file>
|
||||
<file>wputenv.c</file>
|
||||
<file>wsenv.c</file>
|
||||
<file>wsplitp.c</file>
|
||||
<file>wtoi.c</file>
|
||||
<file>wtoi64.c</file>
|
||||
<file>_exit.c</file>
|
||||
</directory>
|
||||
<directory name="string">
|
||||
<file>lasttok.c</file>
|
||||
<file>memicmp.c</file>
|
||||
<file>strcoll.c</file>
|
||||
<file>strdup.c</file>
|
||||
<file>strerror.c</file>
|
||||
<file>stricmp.c</file>
|
||||
<file>strlwr.c</file>
|
||||
<file>strncoll.c</file>
|
||||
<file>strnicmp.c</file>
|
||||
<file>strpbrk.c</file>
|
||||
<file>strrev.c</file>
|
||||
<file>strset.c</file>
|
||||
<file>strstr.c</file>
|
||||
<file>strtok.c</file>
|
||||
<file>strupr.c</file>
|
||||
<file>strxfrm.c</file>
|
||||
</directory>
|
||||
<directory name="sys_stat">
|
||||
<file>fstat.c</file>
|
||||
<file>fstati64.c</file>
|
||||
<file>futime.c</file>
|
||||
<file>stat.c</file>
|
||||
<file>wstat.c</file>
|
||||
</directory>
|
||||
<directory name="time">
|
||||
<file>clock.c</file>
|
||||
<file>ctime.c</file>
|
||||
<file>difftime.c</file>
|
||||
<file>ftime.c</file>
|
||||
<file>strdate.c</file>
|
||||
<file>strftime.c</file>
|
||||
<file>strtime.c</file>
|
||||
<file>time.c</file>
|
||||
<file>tz_vars.c</file>
|
||||
<file>wctime.c</file>
|
||||
<file>wstrdate.c</file>
|
||||
<file>wstrtime.c</file>
|
||||
</directory>
|
||||
<directory name="wine">
|
||||
<file>cpp.c</file>
|
||||
<file>cppexcept.c</file>
|
||||
<file>heap.c</file>
|
||||
<file>thread.c</file>
|
||||
</directory>
|
||||
<directory name="wstring">
|
||||
<file>wcscoll.c</file>
|
||||
<file>wcscspn.c</file>
|
||||
<file>wcsdup.c</file>
|
||||
<file>wcsicmp.c</file>
|
||||
<file>wcslwr.c</file>
|
||||
<file>wcsnicmp.c</file>
|
||||
<file>wcspbrk.c</file>
|
||||
<file>wcsrev.c</file>
|
||||
<file>wcsset.c</file>
|
||||
<file>wcsspn.c</file>
|
||||
<file>wcsstr.c</file>
|
||||
<file>wcstok.c</file>
|
||||
<file>wcsupr.c</file>
|
||||
<file>wcsxfrm.c</file>
|
||||
<file>wlasttok.c</file>
|
||||
</directory>
|
||||
</module>
|
74
reactos/lib/user32/user32.xml
Normal file
74
reactos/lib/user32/user32.xml
Normal file
|
@ -0,0 +1,74 @@
|
|||
<module name="user32" type="win32dll">
|
||||
<dependency>addsys</dependency>
|
||||
<importlibrary definition="user32.def" />
|
||||
<include base="user32">include</include>
|
||||
<define name="_DISABLE_TIDENTS" />
|
||||
<define name="UNICODE" />
|
||||
<define name="__REACTOS__" />
|
||||
<define name="__USE_W32API" />
|
||||
<define name="WINVER">0x0600</define>
|
||||
<define name="_WIN32_WINNT">0x0501</define>
|
||||
<library>wine</library>
|
||||
<library>ntdll</library>
|
||||
<library>gdi32</library>
|
||||
<library>rosrtl</library>
|
||||
<library>kernel32</library>
|
||||
<library>advapi32</library>
|
||||
<directory name="controls">
|
||||
<file>button.c</file>
|
||||
<file>combo.c</file>
|
||||
<file>edit.c</file>
|
||||
<file>icontitle.c</file>
|
||||
<file>listbox.c</file>
|
||||
<file>regcontrol.c</file>
|
||||
<file>scrollbar.c</file>
|
||||
<file>static.c</file>
|
||||
</directory>
|
||||
<directory name="misc">
|
||||
<file>dde.c</file>
|
||||
<file>ddeclient.c</file>
|
||||
<file>ddeserver.c</file>
|
||||
<file>desktop.c</file>
|
||||
<file>display.c</file>
|
||||
<file>dllmain.c</file>
|
||||
<file>exit.c</file>
|
||||
<file>exticon.c</file>
|
||||
<file>misc.c</file>
|
||||
<file>object.c</file>
|
||||
<file>resources.c</file>
|
||||
<file>strpool.c</file>
|
||||
<file>stubs.c</file>
|
||||
<file>timer.c</file>
|
||||
<file>win32k.c</file>
|
||||
<file>winhelp.c</file>
|
||||
<file>winsta.c</file>
|
||||
<file>wsprintf.c</file>
|
||||
</directory>
|
||||
<directory name="windows">
|
||||
<file>accel.c</file>
|
||||
<file>bitmap.c</file>
|
||||
<file>caret.c</file>
|
||||
<file>class.c</file>
|
||||
<file>clipboard.c</file>
|
||||
<file>cursor.c</file>
|
||||
<file>dc.c</file>
|
||||
<file>defwnd.c</file>
|
||||
<file>dialog.c</file>
|
||||
<file>draw.c</file>
|
||||
<file>font.c</file>
|
||||
<file>hook.c</file>
|
||||
<file>icon.c</file>
|
||||
<file>input.c</file>
|
||||
<file>mdi.c</file>
|
||||
<file>menu.c</file>
|
||||
<file>message.c</file>
|
||||
<file>messagebox.c</file>
|
||||
<file>nonclient.c</file>
|
||||
<file>paint.c</file>
|
||||
<file>prop.c</file>
|
||||
<file>rect.c</file>
|
||||
<file>text.c</file>
|
||||
<file>window.c</file>
|
||||
<file>winpos.c</file>
|
||||
</directory>
|
||||
</module>
|
3
reactos/subsys/directory.xml
Normal file
3
reactos/subsys/directory.xml
Normal file
|
@ -0,0 +1,3 @@
|
|||
<directory name="system">
|
||||
<xi:include href="system/directory.xml" />
|
||||
</directory>
|
3
reactos/subsys/system/directory.xml
Normal file
3
reactos/subsys/system/directory.xml
Normal file
|
@ -0,0 +1,3 @@
|
|||
<directory name="welcome">
|
||||
<xi:include href="welcome/welcome.xml" />
|
||||
</directory>
|
9
reactos/subsys/system/welcome/welcome.xml
Normal file
9
reactos/subsys/system/welcome/welcome.xml
Normal file
|
@ -0,0 +1,9 @@
|
|||
<module name="welcome" type="win32gui">
|
||||
<define name="_WIN32_IE">0x0501</define>
|
||||
<define name="_WIN32_WINNT">0x0501</define>
|
||||
<define name="__USE_W32API" />
|
||||
<library>kernel32</library>
|
||||
<library>gdi32</library>
|
||||
<library>user32</library>
|
||||
<file>welcome.c</file>
|
||||
</module>
|
|
@ -129,6 +129,20 @@ MingwBackend::GenerateGlobalCFlagsAndProperties (
|
|||
}
|
||||
}
|
||||
|
||||
string
|
||||
MingwBackend::GenerateProjectLFLAGS ()
|
||||
{
|
||||
string lflags;
|
||||
for ( size_t i = 0; i < ProjectNode.linkerFlags.size (); i++ )
|
||||
{
|
||||
LinkerFlag& linkerFlag = *ProjectNode.linkerFlags[i];
|
||||
if ( lflags.length () > 0 )
|
||||
lflags += " ";
|
||||
lflags += linkerFlag.flag;
|
||||
}
|
||||
return lflags;
|
||||
}
|
||||
|
||||
void
|
||||
MingwBackend::GenerateGlobalVariables ()
|
||||
{
|
||||
|
@ -146,6 +160,7 @@ MingwBackend::GenerateGlobalVariables ()
|
|||
ProjectNode.includes,
|
||||
ProjectNode.defines,
|
||||
ProjectNode.ifs );
|
||||
fprintf ( fMakefile, "PROJECT_LFLAGS = %s\n", GenerateProjectLFLAGS ().c_str () );
|
||||
fprintf ( fMakefile, "\n" );
|
||||
|
||||
fprintf ( fMakefile, ".PHONY: clean\n\n" );
|
||||
|
|
|
@ -21,6 +21,7 @@ private:
|
|||
const std::vector<Include*>& includes,
|
||||
const std::vector<Define*>& defines,
|
||||
const std::vector<If*>& ifs );
|
||||
std::string GenerateProjectLFLAGS ();
|
||||
void GenerateGlobalVariables ();
|
||||
void GenerateAllTarget ();
|
||||
FILE* fMakefile;
|
||||
|
|
|
@ -265,15 +265,38 @@ MingwModuleHandler::GenerateGccIncludeParameters ( const Module& module ) const
|
|||
return parameters;
|
||||
}
|
||||
|
||||
|
||||
string
|
||||
MingwModuleHandler::GenerateLinkerParametersFromVector ( const vector<LinkerFlag*>& linkerFlags ) const
|
||||
{
|
||||
string parameters;
|
||||
for ( size_t i = 0; i < linkerFlags.size (); i++ )
|
||||
{
|
||||
LinkerFlag& linkerFlag = *linkerFlags[i];
|
||||
if ( parameters.length () > 0 )
|
||||
parameters += " ";
|
||||
parameters += linkerFlag.flag;
|
||||
}
|
||||
return parameters;
|
||||
}
|
||||
|
||||
string
|
||||
MingwModuleHandler::GenerateLinkerParameters ( const Module& module ) const
|
||||
{
|
||||
return GenerateLinkerParametersFromVector ( module.linkerFlags );
|
||||
}
|
||||
|
||||
void
|
||||
MingwModuleHandler::GenerateMacros (
|
||||
const char* op,
|
||||
const char* assignmentOperation,
|
||||
const vector<File*>& files,
|
||||
const vector<Include*>& includes,
|
||||
const vector<Define*>& defines,
|
||||
const vector<LinkerFlag*>* linkerFlags,
|
||||
const vector<If*>& ifs,
|
||||
const string& cflags_macro,
|
||||
const string& nasmflags_macro,
|
||||
const string& linkerflags_macro,
|
||||
const string& objs_macro) const
|
||||
{
|
||||
size_t i;
|
||||
|
@ -284,7 +307,7 @@ MingwModuleHandler::GenerateMacros (
|
|||
fMakefile,
|
||||
"%s %s",
|
||||
cflags_macro.c_str(),
|
||||
op );
|
||||
assignmentOperation );
|
||||
for ( i = 0; i < includes.size(); i++ )
|
||||
{
|
||||
fprintf (
|
||||
|
@ -307,14 +330,28 @@ MingwModuleHandler::GenerateMacros (
|
|||
}
|
||||
fprintf ( fMakefile, "\n" );
|
||||
}
|
||||
|
||||
|
||||
if ( linkerFlags != NULL )
|
||||
{
|
||||
string linkerParameters = GenerateLinkerParametersFromVector ( *linkerFlags );
|
||||
if ( linkerParameters.size () > 0 )
|
||||
{
|
||||
fprintf (
|
||||
fMakefile,
|
||||
"%s %s %s\n",
|
||||
linkerflags_macro.c_str (),
|
||||
assignmentOperation,
|
||||
linkerParameters.c_str() );
|
||||
}
|
||||
}
|
||||
|
||||
if ( files.size() )
|
||||
{
|
||||
fprintf (
|
||||
fMakefile,
|
||||
"%s %s",
|
||||
objs_macro.c_str(),
|
||||
op );
|
||||
assignmentOperation );
|
||||
for ( i = 0; i < files.size(); i++ )
|
||||
{
|
||||
fprintf (
|
||||
|
@ -341,9 +378,11 @@ MingwModuleHandler::GenerateMacros (
|
|||
rIf.files,
|
||||
rIf.includes,
|
||||
rIf.defines,
|
||||
NULL,
|
||||
rIf.ifs,
|
||||
cflags_macro,
|
||||
nasmflags_macro,
|
||||
linkerflags_macro,
|
||||
objs_macro );
|
||||
fprintf (
|
||||
fMakefile,
|
||||
|
@ -357,6 +396,7 @@ MingwModuleHandler::GenerateMacros (
|
|||
const Module& module,
|
||||
const string& cflags_macro,
|
||||
const string& nasmflags_macro,
|
||||
const string& linkerflags_macro,
|
||||
const string& objs_macro) const
|
||||
{
|
||||
GenerateMacros (
|
||||
|
@ -364,9 +404,11 @@ MingwModuleHandler::GenerateMacros (
|
|||
module.files,
|
||||
module.includes,
|
||||
module.defines,
|
||||
&module.linkerFlags,
|
||||
module.ifs,
|
||||
cflags_macro,
|
||||
nasmflags_macro,
|
||||
linkerflags_macro,
|
||||
objs_macro );
|
||||
fprintf ( fMakefile, "\n" );
|
||||
|
||||
|
@ -374,6 +416,11 @@ MingwModuleHandler::GenerateMacros (
|
|||
fMakefile,
|
||||
"%s += $(PROJECT_CFLAGS)\n\n",
|
||||
cflags_macro.c_str () );
|
||||
|
||||
fprintf (
|
||||
fMakefile,
|
||||
"%s_LFLAGS += $(PROJECT_LFLAGS)\n\n",
|
||||
module.name.c_str () );
|
||||
}
|
||||
|
||||
string
|
||||
|
@ -447,6 +494,23 @@ MingwModuleHandler::GenerateCommand ( const Module& module,
|
|||
sourceFilename.c_str () );
|
||||
}
|
||||
|
||||
string
|
||||
MingwModuleHandler::GenerateLinkerCommand ( const Module& module,
|
||||
const string& linker,
|
||||
const string& linkerParameters,
|
||||
const string& objectFilenames ) const
|
||||
{
|
||||
string target ( FixupTargetFilename ( module.GetPath () ) );
|
||||
string importLibraryDependencies = GetImportLibraryDependencies ( module );
|
||||
return ssprintf ( "%s %s -o %s %s %s %s\n",
|
||||
linker.c_str (),
|
||||
linkerParameters.c_str (),
|
||||
target.c_str (),
|
||||
objectFilenames.c_str (),
|
||||
importLibraryDependencies.c_str (),
|
||||
GetLinkerMacro ( module ).c_str () );
|
||||
}
|
||||
|
||||
void
|
||||
MingwModuleHandler::GenerateObjectFileTargets ( const Module& module,
|
||||
const vector<File*>& files,
|
||||
|
@ -523,17 +587,25 @@ MingwModuleHandler::GenerateArchiveTarget ( const Module& module,
|
|||
return archiveFilename;
|
||||
}
|
||||
|
||||
string
|
||||
MingwModuleHandler::GetLinkerMacro ( const Module& module ) const
|
||||
{
|
||||
return ssprintf ( "$(%s_LFLAGS)",
|
||||
module.name.c_str () );
|
||||
}
|
||||
|
||||
void
|
||||
MingwModuleHandler::GenerateMacrosAndTargets (
|
||||
const Module& module,
|
||||
const string& cc,
|
||||
const string& ar ) const
|
||||
{
|
||||
string cflagsMacro = ssprintf("%s_CFLAGS",module.name.c_str());
|
||||
string nasmflagsMacro = ssprintf("%s_NASMFLAGS",module.name.c_str());
|
||||
string objectsMacro = ssprintf("%s_OBJS",module.name.c_str());
|
||||
string cflagsMacro = ssprintf ("%s_CFLAGS", module.name.c_str ());
|
||||
string nasmflagsMacro = ssprintf ("%s_NASMFLAGS", module.name.c_str ());
|
||||
string linkerFlagsMacro = ssprintf ("%s_LFLAGS", module.name.c_str ());
|
||||
string objectsMacro = ssprintf ("%s_OBJS", module.name.c_str ());
|
||||
|
||||
GenerateMacros ( module, cflagsMacro, nasmflagsMacro, objectsMacro );
|
||||
GenerateMacros ( module, cflagsMacro, nasmflagsMacro, linkerFlagsMacro, objectsMacro );
|
||||
|
||||
// generate phony target for module name
|
||||
fprintf ( fMakefile, ".PHONY: %s\n",
|
||||
|
@ -543,9 +615,9 @@ MingwModuleHandler::GenerateMacrosAndTargets (
|
|||
module.GetPath().c_str() );
|
||||
|
||||
// future references to the macros will be to get their values
|
||||
cflagsMacro = ssprintf("$(%s)",cflagsMacro.c_str());
|
||||
nasmflagsMacro = ssprintf("$(%s)",nasmflagsMacro.c_str());
|
||||
objectsMacro = ssprintf("$(%s)",objectsMacro.c_str());
|
||||
cflagsMacro = ssprintf ("$(%s)", cflagsMacro.c_str ());
|
||||
nasmflagsMacro = ssprintf ("$(%s)", nasmflagsMacro.c_str ());
|
||||
objectsMacro = ssprintf ("$(%s)", objectsMacro.c_str ());
|
||||
|
||||
string ar_target = GenerateArchiveTarget ( module, ar, objectsMacro );
|
||||
GenerateObjectFileTargets ( module, cc, cflagsMacro, nasmflagsMacro );
|
||||
|
@ -743,7 +815,8 @@ MingwBuildToolModuleHandler::GenerateBuildToolModuleTarget ( const Module& modul
|
|||
target.c_str (),
|
||||
archiveFilename.c_str () );
|
||||
fprintf ( fMakefile,
|
||||
"\t${host_gcc} -o %s %s\n\n",
|
||||
"\t${host_gcc} %s -o %s %s\n\n",
|
||||
GetLinkerMacro ( module ).c_str (),
|
||||
target.c_str (),
|
||||
archiveFilename.c_str () );
|
||||
}
|
||||
|
@ -767,7 +840,6 @@ void
|
|||
MingwKernelModuleHandler::GenerateKernelModuleTarget ( const Module& module )
|
||||
{
|
||||
static string ros_junk ( "$(ROS_TEMPORARY)" );
|
||||
//static string ros_output ( "$(ROS_INTERMEDIATE)" );
|
||||
string target ( FixupTargetFilename(module.GetPath()) );
|
||||
string workingDirectory = GetWorkingDirectory ( );
|
||||
string archiveFilename = GetModuleArchiveFilename ( module );
|
||||
|
@ -785,7 +857,8 @@ MingwKernelModuleHandler::GenerateKernelModuleTarget ( const Module& module )
|
|||
archiveFilename.c_str (),
|
||||
importLibraryDependencies.c_str () );
|
||||
fprintf ( fMakefile,
|
||||
"\t${gcc} %s -Wl,--base-file,%s -o %s %s %s\n",
|
||||
"\t${gcc} %s %s -Wl,--base-file,%s -o %s %s %s\n",
|
||||
GetLinkerMacro ( module ).c_str (),
|
||||
gccOptions.c_str (),
|
||||
base_tmp.c_str (),
|
||||
junk_tmp.c_str (),
|
||||
|
@ -804,7 +877,8 @@ MingwKernelModuleHandler::GenerateKernelModuleTarget ( const Module& module )
|
|||
"\t${rm} %s\n",
|
||||
base_tmp.c_str () );
|
||||
fprintf ( fMakefile,
|
||||
"\t${gcc} %s -Wl,%s -o %s %s %s\n",
|
||||
"\t${gcc} %s %s -Wl,%s -o %s %s %s\n",
|
||||
GetLinkerMacro ( module ).c_str (),
|
||||
gccOptions.c_str (),
|
||||
temp_exp.c_str (),
|
||||
target.c_str (),
|
||||
|
@ -882,12 +956,15 @@ MingwKernelModeDLLModuleHandler::GenerateKernelModeDLLModuleTarget ( const Modul
|
|||
target.c_str (),
|
||||
archiveFilename.c_str (),
|
||||
importLibraryDependencies.c_str () );
|
||||
|
||||
|
||||
string linkerParameters ( "-Wl,--subsystem,native -Wl,--entry,_DriverEntry@8 -Wl,--image-base,0x10000 -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -mdll" );
|
||||
string linkerCommand = GenerateLinkerCommand ( module,
|
||||
"${gcc}",
|
||||
linkerParameters,
|
||||
archiveFilename );
|
||||
fprintf ( fMakefile,
|
||||
"\t${gcc} -Wl,--subsystem,native -Wl,--entry,_DriverEntry@8 -Wl,--image-base,0x10000 -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -mdll -o %s %s %s\n\n",
|
||||
target.c_str (),
|
||||
archiveFilename.c_str (),
|
||||
importLibraryDependencies.c_str () );
|
||||
"\t%s\n\n",
|
||||
linkerCommand.c_str () );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -943,12 +1020,15 @@ MingwNativeDLLModuleHandler::GenerateNativeDLLModuleTarget ( const Module& modul
|
|||
target.c_str (),
|
||||
archiveFilename.c_str (),
|
||||
importLibraryDependencies.c_str () );
|
||||
|
||||
|
||||
string linkerParameters ( "-Wl,--subsystem,native -Wl,--entry,_DllMainCRTStartup@12 -Wl,--image-base,0x10000 -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -nostdlib -mdll" );
|
||||
string linkerCommand = GenerateLinkerCommand ( module,
|
||||
"${gcc}",
|
||||
linkerParameters,
|
||||
archiveFilename );
|
||||
fprintf ( fMakefile,
|
||||
"\t${gcc} -Wl,--subsystem,native -Wl,--entry,_DllMainCRTStartup@12 -Wl,--image-base,0x10000 -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -nostdlib -mdll -o %s %s %s\n\n",
|
||||
target.c_str (),
|
||||
archiveFilename.c_str (),
|
||||
importLibraryDependencies.c_str () );
|
||||
"\t%s\n\n",
|
||||
linkerCommand.c_str () );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1005,11 +1085,66 @@ MingwWin32DLLModuleHandler::GenerateWin32DLLModuleTarget ( const Module& module
|
|||
archiveFilename.c_str (),
|
||||
importLibraryDependencies.c_str () );
|
||||
|
||||
string linkerParameters ( "-Wl,--subsystem,console -Wl,--entry,_DllMain@12 -Wl,--image-base,0x10000 -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -mdll" );
|
||||
string linkerCommand = GenerateLinkerCommand ( module,
|
||||
"${gcc}",
|
||||
linkerParameters,
|
||||
archiveFilename );
|
||||
fprintf ( fMakefile,
|
||||
"\t${gcc} -Wl,--subsystem,console -Wl,--entry,_DllMain@12 -Wl,--image-base,0x10000 -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -nostdlib -mdll -o %s %s %s\n",
|
||||
target.c_str (),
|
||||
archiveFilename.c_str (),
|
||||
importLibraryDependencies.c_str () );
|
||||
"\t%s\n\n",
|
||||
linkerCommand.c_str () );
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf ( fMakefile, "%s:\n\n",
|
||||
target.c_str ());
|
||||
fprintf ( fMakefile, ".PHONY: %s\n\n",
|
||||
target.c_str ());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static MingwWin32GUIModuleHandler win32gui_handler;
|
||||
|
||||
MingwWin32GUIModuleHandler::MingwWin32GUIModuleHandler ()
|
||||
: MingwModuleHandler ( Win32GUI )
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
MingwWin32GUIModuleHandler::Process ( const Module& module )
|
||||
{
|
||||
GeneratePreconditionDependencies ( module );
|
||||
GenerateWin32GUIModuleTarget ( module );
|
||||
GenerateInvocations ( module );
|
||||
}
|
||||
|
||||
void
|
||||
MingwWin32GUIModuleHandler::GenerateWin32GUIModuleTarget ( const Module& module )
|
||||
{
|
||||
static string ros_junk ( "$(ROS_TEMPORARY)" );
|
||||
string target ( FixupTargetFilename ( module.GetPath () ) );
|
||||
string workingDirectory = GetWorkingDirectory ( );
|
||||
string objectFilenames = GetObjectFilenames ( module );
|
||||
string importLibraryDependencies = GetImportLibraryDependencies ( module );
|
||||
|
||||
if (module.files.size () > 0)
|
||||
{
|
||||
GenerateMacrosAndTargetsTarget ( module );
|
||||
|
||||
fprintf ( fMakefile, "%s: %s %s\n",
|
||||
target.c_str (),
|
||||
objectFilenames.c_str (),
|
||||
importLibraryDependencies.c_str () );
|
||||
|
||||
string linkerParameters ( "-Wl,--subsystem,windows -Wl,--entry,_WinMainCRTStartup -Wl,--image-base,0x00400000 -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000" );
|
||||
string linkerCommand = GenerateLinkerCommand ( module,
|
||||
"${gcc}",
|
||||
linkerParameters,
|
||||
objectFilenames );
|
||||
fprintf ( fMakefile,
|
||||
"\t%s\n\n",
|
||||
linkerCommand.c_str () );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -36,9 +36,14 @@ protected:
|
|||
std::string GetInvocationParameters ( const Invoke& invoke ) const;
|
||||
void GenerateInvocations ( const Module& module ) const;
|
||||
void GeneratePreconditionDependencies ( const Module& module ) const;
|
||||
std::string GetLinkerMacro ( const Module& module ) const;
|
||||
std::string GenerateMacros ( const Module& module,
|
||||
const std::string& cflags_macro,
|
||||
const std::string& objs_macro ) const;
|
||||
std::string GenerateLinkerCommand ( const Module& module,
|
||||
const std::string& linker,
|
||||
const std::string& linkerParameters,
|
||||
const std::string& objectFilenames ) const;
|
||||
static FILE* fMakefile;
|
||||
private:
|
||||
std::string ConcatenatePaths ( const std::string& path1,
|
||||
|
@ -46,17 +51,22 @@ private:
|
|||
std::string GenerateGccDefineParametersFromVector ( const std::vector<Define*>& defines ) const;
|
||||
std::string GenerateGccDefineParameters ( const Module& module ) const;
|
||||
std::string GenerateGccIncludeParametersFromVector ( const std::vector<Include*>& includes ) const;
|
||||
std::string GenerateLinkerParametersFromVector ( const std::vector<LinkerFlag*>& linkerFlags ) const;
|
||||
std::string GenerateLinkerParameters ( const Module& module ) const;
|
||||
void GenerateMacros ( const char* op,
|
||||
const std::vector<File*>& files,
|
||||
const std::vector<Include*>& includes,
|
||||
const std::vector<Define*>& defines,
|
||||
const std::vector<LinkerFlag*>* linkerFlags,
|
||||
const std::vector<If*>& ifs,
|
||||
const std::string& cflags_macro,
|
||||
const std::string& nasmflags_macro,
|
||||
const std::string& linkerflags_macro,
|
||||
const std::string& objs_macro) const;
|
||||
void GenerateMacros ( const Module& module,
|
||||
const std::string& cflags_macro,
|
||||
const std::string& nasmflags_macro,
|
||||
const std::string& linkerflags_macro,
|
||||
const std::string& objs_macro) const;
|
||||
void GenerateGccModuleIncludeVariable ( const Module& module ) const;
|
||||
std::string GenerateGccIncludeParameters ( const Module& module ) const;
|
||||
|
@ -160,4 +170,14 @@ private:
|
|||
void GenerateWin32DLLModuleTarget ( const Module& module );
|
||||
};
|
||||
|
||||
|
||||
class MingwWin32GUIModuleHandler : public MingwModuleHandler
|
||||
{
|
||||
public:
|
||||
MingwWin32GUIModuleHandler ();
|
||||
virtual void Process ( const Module& module );
|
||||
private:
|
||||
void GenerateWin32GUIModuleTarget ( const Module& module );
|
||||
};
|
||||
|
||||
#endif /* MINGW_MODULEHANDLER_H */
|
||||
|
|
|
@ -40,7 +40,8 @@ void
|
|||
Include::ProcessXML()
|
||||
{
|
||||
const XMLAttribute* att;
|
||||
att = node.GetAttribute("base",false);
|
||||
att = node.GetAttribute ( "base",
|
||||
false );
|
||||
if ( att )
|
||||
{
|
||||
if ( !module )
|
||||
|
|
47
reactos/tools/rbuild/linkerflag.cpp
Normal file
47
reactos/tools/rbuild/linkerflag.cpp
Normal file
|
@ -0,0 +1,47 @@
|
|||
#include "pch.h"
|
||||
#include <assert.h>
|
||||
|
||||
#include "rbuild.h"
|
||||
|
||||
using std::string;
|
||||
using std::vector;
|
||||
|
||||
LinkerFlag::LinkerFlag ( const Project& project_,
|
||||
const XMLElement& linkerFlagNode )
|
||||
: project(project_),
|
||||
module(NULL),
|
||||
node(linkerFlagNode)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
LinkerFlag::LinkerFlag ( const Project& project_,
|
||||
const Module* module_,
|
||||
const XMLElement& linkerFlagNode )
|
||||
: project(project_),
|
||||
module(module_),
|
||||
node(linkerFlagNode)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
LinkerFlag::~LinkerFlag ()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
LinkerFlag::Initialize()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
LinkerFlag::ProcessXML()
|
||||
{
|
||||
if (node.value.size () == 0)
|
||||
{
|
||||
throw InvalidBuildFileException (
|
||||
node.location,
|
||||
"<linkerflag> is empty." );
|
||||
}
|
||||
flag = node.value;
|
||||
}
|
|
@ -17,6 +17,7 @@ BASE_OBJECTS = \
|
|||
define.o \
|
||||
exception.o \
|
||||
include.o \
|
||||
linkerflag.o \
|
||||
module.o \
|
||||
project.o \
|
||||
ssprintf.o \
|
||||
|
@ -28,6 +29,7 @@ TESTS = \
|
|||
tests/definetest.o \
|
||||
tests/includetest.o \
|
||||
tests/invoketest.o \
|
||||
tests/linkerflagtest.o \
|
||||
tests/moduletest.o \
|
||||
tests/projecttest.o
|
||||
|
||||
|
|
|
@ -65,6 +65,8 @@ Module::~Module ()
|
|||
delete dependencies[i];
|
||||
for ( i = 0; i < ifs.size(); i++ )
|
||||
delete ifs[i];
|
||||
for ( i = 0; i < linkerFlags.size(); i++ )
|
||||
delete linkerFlags[i];
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -87,6 +89,8 @@ Module::ProcessXML()
|
|||
dependencies[i]->ProcessXML ();
|
||||
for ( i = 0; i < ifs.size(); i++ )
|
||||
ifs[i]->ProcessXML();
|
||||
for ( i = 0; i < linkerFlags.size(); i++ )
|
||||
linkerFlags[i]->ProcessXML();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -179,6 +183,11 @@ Module::ProcessXMLSubElement ( const XMLElement& e,
|
|||
ifs.push_back ( pIf );
|
||||
subs_invalid = false;
|
||||
}
|
||||
else if ( e.name == "linkerflag" )
|
||||
{
|
||||
linkerFlags.push_back ( new LinkerFlag ( project, this, e ) );
|
||||
subs_invalid = true;
|
||||
}
|
||||
else if ( e.name == "property" )
|
||||
{
|
||||
throw InvalidBuildFileException (
|
||||
|
@ -209,6 +218,8 @@ Module::GetModuleType ( const string& location, const XMLAttribute& attribute )
|
|||
return NativeDLL;
|
||||
if ( attribute.value == "win32dll" )
|
||||
return Win32DLL;
|
||||
if ( attribute.value == "win32gui" )
|
||||
return Win32GUI;
|
||||
throw InvalidAttributeValueException ( location,
|
||||
attribute.name,
|
||||
attribute.value );
|
||||
|
@ -224,6 +235,7 @@ Module::GetDefaultModuleExtension () const
|
|||
case StaticLibrary:
|
||||
return ".a";
|
||||
case Kernel:
|
||||
case Win32GUI:
|
||||
return ".exe";
|
||||
case KernelModeDLL:
|
||||
case NativeDLL:
|
||||
|
|
|
@ -13,7 +13,9 @@ using std::vector;
|
|||
}*/
|
||||
|
||||
Project::Project ( const string& filename )
|
||||
: xmlfile(filename), node(NULL), head(NULL)
|
||||
: xmlfile(filename),
|
||||
node(NULL),
|
||||
head(NULL)
|
||||
{
|
||||
ReadXml();
|
||||
}
|
||||
|
@ -27,6 +29,8 @@ Project::~Project ()
|
|||
delete includes[i];
|
||||
for ( i = 0; i < defines.size(); i++ )
|
||||
delete defines[i];
|
||||
for ( i = 0; i < linkerFlags.size(); i++ )
|
||||
delete linkerFlags[i];
|
||||
for ( i = 0; i < properties.size(); i++ )
|
||||
delete properties[i];
|
||||
for ( i = 0; i < ifs.size(); i++ )
|
||||
|
@ -81,6 +85,8 @@ Project::ProcessXML ( const string& path )
|
|||
includes[i]->ProcessXML();
|
||||
for ( i = 0; i < defines.size(); i++ )
|
||||
defines[i]->ProcessXML();
|
||||
for ( i = 0; i < linkerFlags.size(); i++ )
|
||||
linkerFlags[i]->ProcessXML();
|
||||
for ( i = 0; i < properties.size(); i++ )
|
||||
properties[i]->ProcessXML();
|
||||
for ( i = 0; i < ifs.size(); i++ )
|
||||
|
@ -134,6 +140,11 @@ Project::ProcessXMLSubElement ( const XMLElement& e,
|
|||
defines.push_back ( define );
|
||||
subs_invalid = true;
|
||||
}
|
||||
else if ( e.name == "linkerflag" )
|
||||
{
|
||||
linkerFlags.push_back ( new LinkerFlag ( *this, e ) );
|
||||
subs_invalid = true;
|
||||
}
|
||||
else if ( e.name == "if" )
|
||||
{
|
||||
If* pOldIf = pIf;
|
||||
|
|
|
@ -32,6 +32,7 @@ class InvokeFile;
|
|||
class Dependency;
|
||||
class ImportLibrary;
|
||||
class If;
|
||||
class LinkerFlag;
|
||||
class Property;
|
||||
|
||||
class Project
|
||||
|
@ -44,6 +45,7 @@ public:
|
|||
std::vector<Module*> modules;
|
||||
std::vector<Include*> includes;
|
||||
std::vector<Define*> defines;
|
||||
std::vector<LinkerFlag*> linkerFlags;
|
||||
std::vector<Property*> properties;
|
||||
std::vector<If*> ifs;
|
||||
|
||||
|
@ -72,7 +74,8 @@ enum ModuleType
|
|||
Kernel,
|
||||
KernelModeDLL,
|
||||
NativeDLL,
|
||||
Win32DLL
|
||||
Win32DLL,
|
||||
Win32GUI
|
||||
};
|
||||
|
||||
|
||||
|
@ -93,6 +96,7 @@ public:
|
|||
std::vector<Invoke*> invocations;
|
||||
std::vector<Dependency*> dependencies;
|
||||
std::vector<If*> ifs;
|
||||
std::vector<LinkerFlag*> linkerFlags;
|
||||
|
||||
Module ( const Project& project,
|
||||
const XMLElement& moduleNode,
|
||||
|
@ -248,6 +252,7 @@ public:
|
|||
void ProcessXML ();
|
||||
};
|
||||
|
||||
|
||||
class If
|
||||
{
|
||||
public:
|
||||
|
@ -269,6 +274,27 @@ public:
|
|||
void ProcessXML();
|
||||
};
|
||||
|
||||
|
||||
class LinkerFlag
|
||||
{
|
||||
public:
|
||||
const Project& project;
|
||||
const Module* module;
|
||||
const XMLElement& node;
|
||||
std::string flag;
|
||||
|
||||
LinkerFlag ( const Project& project,
|
||||
const XMLElement& linkerFlagNode );
|
||||
LinkerFlag ( const Project& project,
|
||||
const Module* module,
|
||||
const XMLElement& linkerFlagNode );
|
||||
~LinkerFlag ();
|
||||
void ProcessXML();
|
||||
private:
|
||||
void Initialize();
|
||||
};
|
||||
|
||||
|
||||
class Property
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -81,4 +81,10 @@ public:
|
|||
void Run();
|
||||
};
|
||||
|
||||
class LinkerFlagTest : public BaseTest
|
||||
{
|
||||
public:
|
||||
void Run();
|
||||
};
|
||||
|
||||
#endif /* __TEST_H */
|
||||
|
|
|
@ -174,6 +174,7 @@ private:
|
|||
tests.push_back(new DefineTest());
|
||||
tests.push_back(new IncludeTest());
|
||||
tests.push_back(new InvokeTest());
|
||||
tests.push_back(new LinkerFlagTest());
|
||||
}
|
||||
};
|
||||
|
||||
|
|
7
reactos/tools/rbuild/tests/data/linkerflag.xml
Normal file
7
reactos/tools/rbuild/tests/data/linkerflag.xml
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" ?>
|
||||
<project name="Project" makefile="Makefile">
|
||||
<linkerflag>-lgcc1</linkerflag>
|
||||
<module name="module1" type="buildtool">
|
||||
<linkerflag>-lgcc2</linkerflag>
|
||||
</module>
|
||||
</project>
|
19
reactos/tools/rbuild/tests/linkerflagtest.cpp
Normal file
19
reactos/tools/rbuild/tests/linkerflagtest.cpp
Normal file
|
@ -0,0 +1,19 @@
|
|||
#include "test.h"
|
||||
|
||||
using std::string;
|
||||
|
||||
void LinkerFlagTest::Run()
|
||||
{
|
||||
string projectFilename ( "tests/data/linkerflag.xml" );
|
||||
Project project ( projectFilename );
|
||||
ARE_EQUAL(1, project.linkerFlags.size());
|
||||
LinkerFlag& linkerFlag1 = *project.linkerFlags[0];
|
||||
ARE_EQUAL("-lgcc1", linkerFlag1.flag);
|
||||
|
||||
ARE_EQUAL(1, project.modules.size());
|
||||
Module& module1 = *project.modules[0];
|
||||
|
||||
ARE_EQUAL(1, module1.linkerFlags.size());
|
||||
LinkerFlag& linkerFlag2 = *module1.linkerFlags[0];
|
||||
ARE_EQUAL("-lgcc2", linkerFlag2.flag);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue