Checking in the WindowsCE tool wrappers for mozilla. This isn't part of the regular build.

This commit is contained in:
dougt%meer.net 2005-04-25 15:29:24 +00:00
Родитель 40798c41c1
Коммит 05764499bd
12 изменённых файлов: 597 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,14 @@
#include <stdlib.h>
#include <stdio.h>
#include <process.h>
#include "toolpaths.h"
int
main(int argc, char **argv)
{
char* args[1000];
argpath_conv(argv, args);
return _spawnv( _P_WAIT, ASM_PATH, args );
}

Просмотреть файл

@ -0,0 +1,94 @@
#include <stdlib.h>
#include <stdio.h>
#include <process.h>
#include <errno.h>
#include <windows.h>
#include "toolpaths.h"
int
main(int argc, char **argv)
{
int iRetVal;
int startOfArgvs;
int i = 0;
int j = 0;
int link = 0;
char* args[1000];
char outputFileArg[1000];
args[i++] = "clarm.exe";
args[i++] = "/I\"" WCE_INC "\"";
args[i++] = "/I\"" SHUNT_INC "\"";
args[i++] = "/FI\"mozce_shunt.h\"";
args[i++] = "/DARM";
args[i++] = "/DWINCE";
args[i++] = "/D_WIN32_WCE";
args[i++] = "/D_ARM_";
args[i++] = "/DDEPRECATE_SUPPORTED";
args[i++] = "/DSTDC_HEADERS";
args[i++] = "/F5000000";
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)
{
if ( strstr(args[startOfArgvs+j], ".obj") )
{
// 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, "/Fo");
strcat(outputFileArg, args[startOfArgvs+j]);
args[startOfArgvs+j] = outputFileArg;
} else
{
// Otherwise, we are linking as usual
link = 1;
}
}
// if (strncmp(argv[j], "-o", 2) == 0)
// {
// link = 1;
// }
j++;
}
if (link)
{
args[i++] = "/link";
args[i++] = "-STACK:0x5000000,1000000";
args[i++] = "-ENTRY:mainACRTStartup";
args[i++] = "-SUBSYSTEM:WINDOWSCE";
args[i++] = "-MACHINE:ARM";
args[i++] = "-LIBPATH:\"" WCE_LIB "\"";
args[i++] = "-LIBPATH:\"" SHUNT_LIB "\"";
args[i++] = "shunt.lib";
args[i++] = "winsock.lib";
args[i++] = "corelibc.lib";
args[i++] = "coredll.lib";
}
args[i] = NULL;
//dumpargs(args);
iRetVal = _spawnv( _P_WAIT, CL_PATH, args );
if (iRetVal == -1)
{
printf("-----------------> %d <----------------------\n\n\n\n", errno);
}
return 0;
}

Просмотреть файл

@ -0,0 +1,20 @@
#include <stdlib.h>
#include <stdio.h>
#include <process.h>
#include "toolpaths.h"
int
main(int argc, char **argv)
{
char* args[1000];
int i = 0;
args[i++] = "lib.exe";
args[i++] = "/SUBSYSTEM:WINDOWSCE";
args[i++] = "/MACHINE:ARM";
argpath_conv(&argv[1], &args[i]);
return _spawnv( _P_WAIT, LIB_PATH, args );
}

Просмотреть файл

@ -0,0 +1,59 @@
#include <stdlib.h>
#include <stdio.h>
#include <process.h>
#include "toolpaths.h"
int
main(int argc, char **argv)
{
int iRetVal;
char* args[1000];
int i = 0;
int j = 0;
int k = 0;
args[i++] = "link.exe";
args[i++] = "/SUBSYSTEM:WINDOWSCE";
args[i++] = "/MACHINE:ARM";
args[i++] = "/LIBPATH:\"" WCE_LIB "\"";
args[i++] = "/LIBPATH:\"" SHUNT_LIB "\"";
args[i++] = "winsock.lib";
args[i++] = "corelibc.lib";
args[i++] = "coredll.lib";
args[i++] = "ceshell.lib";
args[i++] = "shunt.lib";
args[i++] = "/NODEFAULTLIB:LIBC";
args[i++] = "/NODEFAULTLIB:OLDNAMES";
args[i++] = "/STACK:0x5000000,1000000";
// if -DLL is not passed, then change the entry to 'main'
while(argv[j])
{
if (strncmp(argv[j], "-DLL", 4) == 0 || strncmp(argv[j], "/DLL", 4) == 0)
{
k = 1;
break;
}
j++;
}
if (k==0)
args[i++] = "/ENTRY:mainACRTStartup";
argpath_conv(&argv[1], &args[i]);
// dumpargs(args);
iRetVal = _spawnv( _P_WAIT, LINK_PATH, args );
if (iRetVal == -1)
{
printf("-----------------> %d <----------------------\n\n\n\n", errno);
}
return 0;
}

Просмотреть файл

@ -0,0 +1,17 @@
rm arm-wince-as.exe
rm arm-wince-gcc.exe
rm arm-wince-lib.exe
rm arm-wince-link.exe
rm *.obj
rm *.ilk
rm *.pdb
cl /O2 arm-wince-as.c
cl /O2 arm-wince-gcc.c
cl /O2 arm-wince-lib.c
cl /O2 arm-wince-link.c
rm *.obj
rm *.ilk
rm *.pdb

Просмотреть файл

@ -0,0 +1,91 @@
#define WCE_BIN "C:/Program Files/Microsoft eMbedded C++ 4.0/EVC/wce420/bin/"
#define WCE_INC "c:/Program Files/Windows CE Tools/wce420/POCKET PC 2003/Include/Armv4/"
#define WCE_LIB "c:/Program Files/Windows CE Tools/wce420/POCKET PC 2003/Lib/Armv4/"
#define SHUNT_LIB "c:/builds/wince/mozilla/build/wince/shunt/build/ARMV4Rel/"
#define SHUNT_INC "c:/builds/wince/mozilla/build/wince/shunt/include/"
#define ASM_PATH WCE_BIN "armasm.exe"
#define CL_PATH WCE_BIN "clarm.exe"
#define LIB_PATH WCE_BIN "lib.exe"
#define LINK_PATH WCE_BIN "link.exe"
#define MAX_NOLEAK_BUFFERS 100
char noleak_buffers[MAX_NOLEAK_BUFFERS][1024];
static int next_buffer = 0;
int argpath_conv(char **args_in, char **args_out)
{
int i = 0;
while (args_in[i])
{
args_out[i] = args_in[i];
if (args_in[i])
{
char *offset = strstr(args_out[i], "/cygdrive/c/");
if (offset) {
strcpy(offset, offset+9);
offset[0] = 'c';
offset[1] = ':';
offset[2] = '/';
}
if ( (args_out[i][0] == '-' || args_out[i][0] == '/') &&
(args_out[i][1] == 'D'))
{
offset = strstr(args_out[i]+2, "=");
if (offset)
{
char* equalsChar = offset;
if (equalsChar[1] == '"')
{
*equalsChar = '\0';
strcpy(noleak_buffers[next_buffer], args_out[i]);
*equalsChar = '=';
strcat(noleak_buffers[next_buffer], "=\\\"");
strcat(noleak_buffers[next_buffer], equalsChar+1);
strcat(noleak_buffers[next_buffer], "\\\"");
args_out[i] = noleak_buffers[next_buffer];
next_buffer++;
if (next_buffer > MAX_NOLEAK_BUFFERS) {
printf("next_buffer>MAX_NOLEAK_BUFFERS\n");
exit(-1);
}
}
}
}
}
i++;
}
args_out[i] = NULL;
return i;
}
void dumpargs(char** args)
{
int i = 0;
if (args[0] == NULL)
printf(":: first element is null!\n");
while(args[i])
printf("%s ", args[i++]);
printf("\n");
fflush(stdout);
fflush(stderr);
}

Просмотреть файл

@ -0,0 +1,14 @@
#include <stdlib.h>
#include <stdio.h>
#include <process.h>
#include "toolpaths.h"
int
main(int argc, char **argv)
{
char* args[1000];
argpath_conv(argv, args);
return _spawnv( _P_WAIT, ASM_PATH, args );
}

Просмотреть файл

@ -0,0 +1,98 @@
#include <stdlib.h>
#include <stdio.h>
#include <process.h>
#include <errno.h>
#include <windows.h>
#include "toolpaths.h"
int
main(int argc, char **argv)
{
int iRetVal;
int startOfArgvs;
int i = 0;
int j = 0;
int link = 0;
char* args[1000];
char outputFileArg[1000];
args[i++] = "cl.exe";
args[i++] = "/I\"" WCE_INC "\"";
args[i++] = "/I\"" SHUNT_INC "\"";
args[i++] = "/FI\"mozce_shunt.h\"";
args[i++] = "/D_i386_";
args[i++] = "/D_X86_";
args[i++] = "/Dx86";
args[i++] = "/D_WIN32_WCE=310";
args[i++] = "/DWIN32_PLATFORM_PSPC=310";
args[i++] = "/DUNDER_CE=310";
args[i++] = "/DWINCE";
args[i++] = "/DDEPRECATE_SUPPORTED";
args[i++] = "/F5000000";
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)
{
if ( strstr(args[startOfArgvs+j], ".obj") )
{
// 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, "/Fo");
strcat(outputFileArg, args[startOfArgvs+j]);
args[startOfArgvs+j] = outputFileArg;
} else
{
// Otherwise, we are linking as usual
link = 1;
}
}
// if (strncmp(argv[j], "-o", 2) == 0)
// {
// link = 1;
// }
j++;
}
if (link)
{
args[i++] = "/link";
args[i++] = "-STACK:0x5000000,1000000";
args[i++] = "-ENTRY:mainACRTStartup";
args[i++] = "-SUBSYSTEM:WINDOWSCE";
args[i++] = "-MACHINE:X86";
args[i++] = "\\\"-LIBPATH:\""WCE_LIB"\"\\\"";
args[i++] = "\\\"-LIBPATH:\""SHUNT_LIB"\\\"";
args[i++] = "shunt.lib";
args[i++] = "winsock.lib";
args[i++] = "corelibc.lib";
args[i++] = "coredll.lib";
}
args[i] = NULL;
dumpargs(args);
iRetVal = _spawnv( _P_WAIT, CL_PATH, args);
if (iRetVal == -1)
{
printf("-----------------> %d <----------------------\n\n\n\n", errno);
}
return iRetVal;
}

Просмотреть файл

@ -0,0 +1,22 @@
#include <stdlib.h>
#include <stdio.h>
#include <process.h>
#include "toolpaths.h"
int
main(int argc, char **argv)
{
char* args[1000];
int i = 0;
args[i++] = "lib.exe";
args[i++] = "/SUBSYSTEM:WINDOWSCE";
args[i++] = "/MACHINE:X86";
argpath_conv(&argv[1], &args[i]);
//dumpargs(args);
return _spawnv( _P_WAIT, LIB_PATH, args );
}

Просмотреть файл

@ -0,0 +1,60 @@
#include <stdlib.h>
#include <stdio.h>
#include <process.h>
#include "toolpaths.h"
int
main(int argc, char **argv)
{
int iRetVal;
char* args[1000];
int i = 0;
int j = 0;
int k = 0;
args[i++] = "link.exe";
args[i++] = "/SUBSYSTEM:WINDOWSCE";
args[i++] = "/MACHINE:X86";
args[i++] = "/LIBPATH:\"" WCE_LIB "\"";
args[i++] = "/LIBPATH:\"" SHUNT_LIB "\"";
args[i++] = "winsock.lib";
args[i++] = "corelibc.lib";
args[i++] = "coredll.lib";
args[i++] = "ceshell.lib";
args[i++] = "shunt.lib";
args[i++] = "/NODEFAULTLIB:LIBC";
args[i++] = "/NODEFAULTLIB:OLDNAMES";
args[i++] = "/NODEFAULTLIB:MSVCRT";
args[i++] = "/STACK:0x5000000,1000000";
// if -DLL is not passed, then change the entry to 'main'
while(argv[j])
{
if (strncmp(argv[j], "-DLL", 4) == 0 || strncmp(argv[j], "/DLL", 4) == 0)
{
k = 1;
break;
}
j++;
}
if (k==0)
args[i++] = "/ENTRY:mainACRTStartup";
argpath_conv(&argv[1], &args[i]);
// dumpargs(args);
iRetVal = _spawnv( _P_WAIT, LINK_PATH, args );
if (iRetVal == -1)
{
printf("-----------------> %d <----------------------\n\n\n\n", errno);
}
return 0;
}

Просмотреть файл

@ -0,0 +1,17 @@
rm arm-wince-as.exe
rm arm-wince-gcc.exe
rm arm-wince-lib.exe
rm arm-wince-link.exe
rm *.obj
rm *.ilk
rm *.pdb
cl /O2 arm-wince-as.c
cl /O2 arm-wince-gcc.c
cl /O2 arm-wince-lib.c
cl /O2 arm-wince-link.c
rm *.obj
rm *.ilk
rm *.pdb

Просмотреть файл

@ -0,0 +1,91 @@
#define WCE_BIN "C:/Program Files/Microsoft eMbedded C++ 4.0/EVC/wce420/bin/"
#define WCE_INC "c:/Program Files/Windows CE Tools/wce420/Pocket PC 2003/Include/Emulator/"
#define WCE_LIB "c:/Program Files/Windows CE Tools/wce420/Pocket PC 2003/Lib/Emulator/"
#define SHUNT_LIB "c:/builds/wince/mozilla/build/wince/shunt/build/emulatorRel/"
#define SHUNT_INC "c:/builds/wince/mozilla/build/wince/shunt/include/"
#define ASM_PATH WCE_BIN "asm.exe"
#define CL_PATH WCE_BIN "cl.exe"
#define LIB_PATH WCE_BIN "lib.exe"
#define LINK_PATH WCE_BIN "link.exe"
#define MAX_NOLEAK_BUFFERS 100
char noleak_buffers[MAX_NOLEAK_BUFFERS][1024];
static int next_buffer = 0;
int argpath_conv(char **args_in, char **args_out)
{
int i = 0;
while (args_in[i])
{
args_out[i] = args_in[i];
if (args_in[i])
{
char *offset = strstr(args_out[i], "/cygdrive/c/");
if (offset) {
strcpy(offset, offset+9);
offset[0] = 'c';
offset[1] = ':';
offset[2] = '/';
}
if ( (args_out[i][0] == '-' || args_out[i][0] == '/') &&
(args_out[i][1] == 'D'))
{
offset = strstr(args_out[i]+2, "=");
if (offset)
{
char* equalsChar = offset;
if (equalsChar[1] == '"')
{
*equalsChar = '\0';
strcpy(noleak_buffers[next_buffer], args_out[i]);
*equalsChar = '=';
strcat(noleak_buffers[next_buffer], "=\\\"");
strcat(noleak_buffers[next_buffer], equalsChar+1);
strcat(noleak_buffers[next_buffer], "\\\"");
args_out[i] = noleak_buffers[next_buffer];
next_buffer++;
if (next_buffer > MAX_NOLEAK_BUFFERS) {
printf("next_buffer>MAX_NOLEAK_BUFFERS\n");
exit(-1);
}
}
}
}
}
i++;
}
args_out[i] = NULL;
return i;
}
void dumpargs(char** args)
{
int i = 0;
if (args[0] == NULL)
printf(":: first element is null!\n");
while(args[i])
printf("%s ", args[i++]);
printf("\n");
fflush(stdout);
fflush(stderr);
}