2009-01-28 10:13:56 -08:00
|
|
|
|
2008-09-22 15:07:21 -07:00
|
|
|
#include "toolspath.h"
|
|
|
|
|
|
|
|
int
|
|
|
|
main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
int startOfArgvs;
|
|
|
|
int i = 0;
|
|
|
|
int j = 0;
|
|
|
|
int link = 0;
|
|
|
|
|
|
|
|
char* args[1000];
|
|
|
|
char outputFileArg[1000];
|
|
|
|
|
|
|
|
args[i++] = CL_PATH;
|
|
|
|
args[i++] = "/I\"" SHUNT_INC "\"";
|
|
|
|
args[i++] = "/FI\"mozce_shunt.h\"";
|
|
|
|
|
|
|
|
args[i++] = "/DMOZCE_STATIC_BUILD";
|
|
|
|
args[i++] = "/DUNICODE";
|
|
|
|
args[i++] = "/D_UNICODE_";
|
|
|
|
args[i++] = "/DARM";
|
|
|
|
args[i++] = "/D_ARM_";
|
|
|
|
args[i++] = "/DWINCE";
|
|
|
|
args[i++] = "/D_WIN32_WCE=0x502";
|
|
|
|
args[i++] = "/DUNDER_CE";
|
2009-01-28 10:13:56 -08:00
|
|
|
// args[i++] = "/DWIN32_PLATFORM_WFSP";
|
|
|
|
args[i++] = "/DWIN32_PLATFORM_PSPC";
|
2008-09-22 15:07:21 -07:00
|
|
|
// args[i++] = "/DPOCKETPC2003_UI_MODEL";
|
|
|
|
args[i++] = "/D_WINDOWS";
|
2008-10-24 10:39:07 -07:00
|
|
|
args[i++] = "/DNO_ERRNO";
|
2008-09-22 15:07:21 -07:00
|
|
|
|
|
|
|
args[i++] = "/Zc:wchar_t-"; //
|
|
|
|
args[i++] = "/GS-"; // disable security checks
|
|
|
|
args[i++] = "/GR-"; // disable C++ RTTI
|
|
|
|
args[i++] = "/fp:fast";
|
|
|
|
|
|
|
|
startOfArgvs = i;
|
|
|
|
|
|
|
|
i += argpath_conv(&argv[1], &args[i]);
|
|
|
|
|
|
|
|
// if /Fe is passed, then link
|
|
|
|
//
|
|
|
|
// if -o is passed, then blank out this argument, and place a "/Fo"
|
|
|
|
// before the next argument
|
|
|
|
while(argv[j])
|
|
|
|
{
|
|
|
|
if (strncmp(argv[j], "-o", 2) == 0)
|
|
|
|
{
|
|
|
|
printf("%s is -o\n",argv[j]);
|
|
|
|
|
|
|
|
|
|
|
|
link = strstr(args[startOfArgvs+j], ".obj") ? 0:1;
|
|
|
|
|
|
|
|
|
|
|
|
// If we are outputting a .OBJ file, then we are
|
|
|
|
// NOT linking, and we need to do some fancy
|
|
|
|
// footwork to output "/FoFILENAME" as an argument
|
|
|
|
args[startOfArgvs+j-1] = "";
|
|
|
|
strcpy(outputFileArg, ( strstr(args[startOfArgvs+j], ".exe") )?"/Fe":"/Fo");
|
|
|
|
strcat(outputFileArg, args[startOfArgvs+j]);
|
|
|
|
args[startOfArgvs+j] = outputFileArg;
|
|
|
|
}
|
|
|
|
j++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (link)
|
|
|
|
{
|
|
|
|
args[i++] = "/link";
|
|
|
|
|
|
|
|
args[i++] = "/ENTRY:main";
|
|
|
|
|
|
|
|
args[i++] = "/SUBSYSTEM:WINDOWSCE,5.02";
|
|
|
|
|
|
|
|
args[i++] = "/LIBPATH:\"" WCE_LIB "\"";
|
|
|
|
args[i++] = "/LIBPATH:\"" WCE_CRT "\"";
|
|
|
|
args[i++] = "/LIBPATH:\"" SHUNT_LIB "\"";
|
|
|
|
args[i++] = "mozce_shunt.lib";
|
|
|
|
args[i++] = "winsock.lib";
|
|
|
|
args[i++] = "corelibc.lib";
|
|
|
|
args[i++] = "coredll.lib";
|
|
|
|
|
|
|
|
|
2009-01-28 10:13:56 -08:00
|
|
|
//args[i++] = "/NODEFAULTLIB:LIBC";
|
2008-09-22 15:07:21 -07:00
|
|
|
args[i++] = "/NODEFAULTLIB:OLDNAMES";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
args[i] = NULL;
|
|
|
|
|
2009-01-28 10:13:56 -08:00
|
|
|
// dumpargs(args);
|
2008-09-22 15:07:21 -07:00
|
|
|
return run(args);
|
|
|
|
}
|