Back to index

lightning-sunbird  0.9+nobinonly
arm-wince-link.c
Go to the documentation of this file.
00001 #include "toolpaths.h"
00002 
00003 int 
00004 main(int argc, char **argv)
00005 {
00006   int iRetVal;
00007   char* args[1000];
00008   int i = 0;
00009   int j = 0;
00010   int k = 0;
00011 
00012   args[i++] = LINK_PATH;
00013 
00014   args[i++] = "/LIBPATH:\"" WCE_LIB "\"";
00015   args[i++] = "/LIBPATH:\"" SHUNT_LIB "\"";
00016   args[i++] = "/LIBPATH:\"c:/Program Files/Microsoft Visual Studio 8/VC/ce/lib/armv4i/\"";
00017 
00018   args[i++] = "winsock.lib";
00019   args[i++] = "corelibc.lib";
00020   args[i++] = "coredll.lib";
00021   args[i++] = "ceshell.lib";
00022   args[i++] = "ole32.lib";
00023   args[i++] = "aygshell.lib";
00024 
00025   args[i++] = "shunt.lib";
00026   #ifdef WM50
00027   args[i++] = "/subsystem:\"WINDOWSCE,5.01\"";
00028   #else
00029   args[i++] = "/subsystem:\"WINDOWSCE,4.20\"";
00030   args[i++] = "/MACHINE:ARM";
00031   #endif
00032 
00033   //  args[i++] = "-OPT:REF";
00034   //  args[i++] = "-OPT:ICF";
00035 
00036   args[i++] = "/NODEFAULTLIB:LIBC";
00037   args[i++] = "/NODEFAULTLIB:OLDNAMES";
00038   args[i++] = "/NODEFAULTLIB:LIBCMT";
00039   args[i++] = "/NODEFAULTLIB:LIBCMTD";
00040 
00041   // if -DLL is not passed, then change the entry to 'main'
00042   while(argv[j])
00043   {
00044     if (strncmp(argv[j], "-DLL", 4) == 0 || strncmp(argv[j], "/DLL", 4) == 0)
00045     {
00046       k = 1;
00047       break;
00048     }
00049     j++;
00050   }
00051   
00052   if (k==0)
00053     args[i++] = "/ENTRY:mainACRTStartup";
00054 
00055   argpath_conv(&argv[1], &args[i]);
00056 
00057   dumpargs(args);
00058 
00059   run(args);
00060   return 0;
00061 }