Changeset 3026
- Timestamp:
- Apr 7, 2007, 3:05:56 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/libc-0.6/src/emx/src/emxomf/emxomfld.c
r3005 r3026 152 152 the defaults of emxbind. */ 153 153 static long stack_size = 1024; 154 /* Indicates that we've seen -Zstack. */ 155 static int stack_size_flag = 0; 154 156 155 157 /* The name of the linker to use. By default, ilink is used. This … … 1508 1510 " lib<name>.lib, <name>.lib, <name>.dll, lib<name>_s.lib, <name>_s.lib.\n" 1509 1511 " -Zdll-search:\n" 1510 " Enables dlls as valid libraries from shared linking. (default disabled)\n", 1512 " Enables dlls as valid libraries from shared linking. (default disabled)\n", 1511 1513 stderr); 1512 1514 fputs (" -Zsym:" 1513 " Invoke mapsym.cmd on the mapfile to produce a .sym file. Requires -Zmap.\n" 1515 " Invoke mapsym.cmd on the mapfile to produce a .sym file. Requires -Zmap.\n" 1514 1516 "\n", stderr); 1515 1517 fputs ("Environment variables:\n" … … 1738 1740 if (errno != 0 || *t != 0 || t == optarg) 1739 1741 return 1; 1742 stack_size_flag = 1; 1740 1743 break; 1741 1744 … … 2052 2055 else /* wlink */ 2053 2056 { 2057 unsigned uPMType = 0; 2058 2054 2059 open_response_file (); 2055 2060 2061 /* convert common ilink/link386 command line arguments. */ 2062 2063 for (pcur = options; pcur; pcur = pcur->next) 2064 { 2065 size_t cchOpt; 2066 const char *pszVal; 2067 size_t cchVal; 2068 2069 if (pcur->name [0] != '-' && pcur->name [0] != '/') 2070 continue; 2071 if (strchr (&pcur->name[1], '=')) 2072 continue; 2073 pszVal = strchr (&pcur->name[1], ':'); 2074 cchOpt = pszVal ? pszVal - &pcur->name[1] : strlen (&pcur->name[1]); 2075 if (pszVal && pszVal[1]) 2076 cchVal = strlen (++pszVal); 2077 else 2078 pszVal = NULL, cchVal = 0; 2079 #define MAX(a,b) ((a) <= (b) ? (a) : (b)) 2080 if (!strnicmp (&pcur->name[1], "PMtype", cchOpt) 2081 && cchVal) 2082 { 2083 if (!strnicmp (pszVal, "PM", cchVal)) 2084 uPMType = _MD_WINDOWAPI; 2085 else if (!strnicmp (pszVal, "VIO", cchVal)) 2086 uPMType = _MD_WINDOWCOMPAT; 2087 else if (!strnicmp (pszVal, "NOVIO", MAX (cchVal, 3))) 2088 uPMType = _MD_NOTWINDOWCOMPAT; 2089 else 2090 continue; 2091 } 2092 else if (!strnicmp (&pcur->name[1], "PDD", MAX (cchOpt, 3))) 2093 uPMType = _MD_PHYSICAL; 2094 else if (!strnicmp (&pcur->name[1], "VDD", MAX (cchOpt, 3))) 2095 uPMType = _MD_VIRTUAL; 2096 else if (!strnicmp (&pcur->name[1], "STACK", MAX (cchOpt, 2)) 2097 && cchVal && !stack_size_flag) 2098 { 2099 errno = 0; 2100 stack_size = strtol (pszVal, &t, 0); 2101 if (errno || *t) 2102 { 2103 fprintf(stderr, "emxomfld: Number conversion failed: '%s'\n", pcur->name); 2104 return 1; 2105 } 2106 stack_size = (stack_size + 0xfff) / 1024; 2107 } 2108 /* ignore these */ 2109 else if (!strnicmp (&pcur->name[1], "PACKCODE", MAX (cchOpt, 5)) 2110 || !strnicmp (&pcur->name[1], "NOPACKCODE", MAX (cchOpt, 3)) 2111 || !strnicmp (&pcur->name[1], "EXEPACK", MAX (cchOpt, 1)) 2112 || !strnicmp (&pcur->name[1], "NOEXEPACK", MAX (cchOpt, 5)) 2113 || !strnicmp (&pcur->name[1], "DBGPACK", MAX (cchOpt, 2)) 2114 || !strnicmp (&pcur->name[1], "NODBGPACK", MAX (cchOpt, 4)) 2115 ) 2116 fprintf(stderr, "emxomfld: warning: ignoring ilink option '%s'\n", pcur->name); 2117 else 2118 continue; 2119 pcur->name = NULL; 2120 #undef MAX 2121 } 2122 2056 2123 /* figure out what format options we're gonna use */ 2057 2124 2058 2125 if (!def_fname && !dll_flag) 2059 fprintf (response_file, "FORMAT OS2 LX PMCompatible\n"); 2126 { 2127 switch (uPMType) 2128 { 2129 case 0: 2130 case _MD_WINDOWCOMPAT: 2131 default: 2132 fprintf (response_file, "FORMAT OS2 LX PMCompatible\n"); 2133 break; 2134 case _MD_WINDOWAPI: 2135 fprintf (response_file, "FORMAT OS2 LX PM\n"); 2136 break; 2137 case _MD_NOTWINDOWCOMPAT: 2138 fprintf (response_file, "FORMAT OS2 LX FULLscreen\n"); 2139 break; 2140 case _MD_PHYSICAL: 2141 dll_flag = TRUE; 2142 fprintf (response_file, "FORMAT OS2 LX PHYSdevice\n"); 2143 break; 2144 case _MD_VIRTUAL: 2145 dll_flag = TRUE; 2146 fprintf (response_file, "FORMAT OS2 LX VIRTdevice\n"); 2147 break; 2148 } 2149 } 2060 2150 else if (!def_fname && dll_flag) 2061 2151 fprintf (response_file, "FORMAT OS2 LX DLL INITINSTANCE TERMINSTANCE\n"); … … 2106 2196 { 2107 2197 if (token == _MD_NAME) 2198 { 2199 /* (ignores uPMType and uses the .def-file) */ 2108 2200 token = _md_next_token (pMd); 2109 if (token == _MD_quote || token == _MD_word) 2110 token = _md_next_token (pMd); 2201 if (token == _MD_quote || token == _MD_word) 2202 token = _md_next_token (pMd); 2203 } 2204 else 2205 token = uPMType; 2111 2206 switch (token) 2112 2207 { … … 2165 2260 2166 2261 for (pcur = options; pcur; pcur = pcur->next) 2167 fprintf (response_file, "%s\n", pcur->name); 2262 if (pcur->name) 2263 fprintf (response_file, "%s\n", pcur->name); 2168 2264 2169 2265 /* Put the object file names onto the command line. */
Note:
See TracChangeset
for help on using the changeset viewer.