Changeset 725 for trunk/src/gmake
- Timestamp:
- Dec 15, 2006, 6:18:47 AM (19 years ago)
- Location:
- trunk/src/gmake
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gmake/function.c
r720 r725 2119 2119 return o; 2120 2120 } 2121 2122 #ifdef CONFIG_WITH_ABSPATHEX 2123 /* same as abspath except that the current path is given as the 2nd argument. */ 2124 static char * 2125 func_abspathex (char *o, char **argv, const char *funcname UNUSED) 2126 { 2127 /* Expand the argument. */ 2128 char *p = argv[0]; 2129 PATH_VAR (current_directory); 2130 char *cwd = argv[1]; 2131 unsigned int cwd_len = ~0U; 2132 char *path = 0; 2133 int doneany = 0; 2134 unsigned int len = 0; 2135 PATH_VAR (in); 2136 PATH_VAR (out); 2137 2138 while ((path = find_next_token (&p, &len)) != 0) 2139 { 2140 if (len < GET_PATH_MAX) 2141 { 2142 #ifdef HAVE_DOS_PATHS 2143 if (path[0] != '/' && path[0] != '\\' && (len < 2 || path[1] != ':') && cwd) 2144 #else 2145 if (path[0] != '/' && cwd) 2146 #endif 2147 { 2148 /* relative path, prefix with cwd. */ 2149 if (cwd_len == ~0U) 2150 cwd_len = strlen (cwd); 2151 if (cwd_len + len + 1 >= GET_PATH_MAX) 2152 continue; 2153 memcpy (in, cwd, cwd_len) 2154 in[cwd_len] = '/'; 2155 memcpy (in + cwd_len + 1, path, len); 2156 in[cwd_len + len + 1] = '\0'; 2157 } 2158 else 2159 { 2160 /* absolute path pass it as-is. */ 2161 memcpy (in, path, len); 2162 in[len] = '\0'; 2163 } 2164 2165 if (abspath (in, out)) 2166 { 2167 o = variable_buffer_output (o, out, strlen (out)); 2168 o = variable_buffer_output (o, " ", 1); 2169 doneany = 1; 2170 } 2171 } 2172 } 2173 2174 /* Kill last space. */ 2175 if (doneany) 2176 --o; 2177 2178 return o; 2179 } 2180 #endif 2121 2181 2122 2182 #ifdef CONFIG_WITH_TOUPPER_TOLOWER … … 2378 2438 { STRING_SIZE_TUPLE("tolower"), 0, 1, 1, func_toupper_tolower}, 2379 2439 #endif 2440 #ifdef CONFIG_WITH_ABSPATHEX 2441 { STRING_SIZE_TUPLE("abspathex"), 0, 2, 1, func_abspathex}, 2442 #endif 2380 2443 #if defined(CONFIG_WITH_VALUE_LENGTH) && defined(CONFIG_WITH_COMPARE) 2381 2444 { STRING_SIZE_TUPLE("comp-vars"), 3, 3, 1, func_comp_vars}, -
trunk/src/gmake/kbuild.c
r646 r725 788 788 struct variable *pType, struct variable *pBldType, 789 789 struct variable *pBldTrg, struct variable *pBldTrgArch, struct variable *pBldTrgCpu, 790 struct variable *pDefPath, 790 791 const char *pszProp, const char *pszVarName, int iDirection) 791 792 { … … 1002 1003 paVars[iVar].cchExp = strlen(paVars[iVar].pszExp); 1003 1004 } 1005 if (pDefPath) 1006 { 1007 /** @todo */ 1008 } 1004 1009 cchTotal += paVars[iVar].cchExp + 1; 1005 1010 } … … 1030 1035 } 1031 1036 1032 /* get a source property. */1037 /* get a source property. Doesn't respect the default path. */ 1033 1038 char * 1034 1039 func_kbuild_source_prop(char *o, char **argv, const char *pszFuncName) … … 1056 1061 pVar = kbuild_collect_source_prop(pTarget, pSource, pTool, &Sdks, pType, 1057 1062 pBldType, pBldTrg, pBldTrgArch, pBldTrgCpu, 1063 NULL, 1058 1064 argv[0], argv[1], iDirection); 1059 1065 if (pVar) … … 1190 1196 struct variable *pTarget = kbuild_get_variable("target"); 1191 1197 struct variable *pSource = kbuild_get_variable("source"); 1198 struct variable *pDefPath = kbuild_get_variable("defpath"); 1192 1199 struct variable *pType = kbuild_get_variable("type"); 1193 1200 struct variable *pBldType = kbuild_get_variable("bld_type"); … … 1207 1214 kbuild_get_sdks(&Sdks, pTarget, pSource, pBldType, pBldTrg, pBldTrgArch); 1208 1215 1209 pDefs = kbuild_collect_source_prop(pTarget, pSource, pTool, &Sdks, pType, pBldType, pBldTrg, pBldTrgArch, pBldTrgCpu, 1216 if (pDefPath && !pDefPath->value_length) 1217 pDefPath = NULL; 1218 pDefs = kbuild_collect_source_prop(pTarget, pSource, pTool, &Sdks, pType, pBldType, pBldTrg, pBldTrgArch, pBldTrgCpu, NULL, 1210 1219 "DEFS", "defs", 1/* left-to-right */); 1211 pIncs = kbuild_collect_source_prop(pTarget, pSource, pTool, &Sdks, pType, pBldType, pBldTrg, pBldTrgArch, pBldTrgCpu, 1220 pIncs = kbuild_collect_source_prop(pTarget, pSource, pTool, &Sdks, pType, pBldType, pBldTrg, pBldTrgArch, pBldTrgCpu, NULL, 1212 1221 "INCS", "incs", -1/* right-to-left */); 1213 pFlags = kbuild_collect_source_prop(pTarget, pSource, pTool, &Sdks, pType, pBldType, pBldTrg, pBldTrgArch, pBldTrgCpu, 1222 pFlags = kbuild_collect_source_prop(pTarget, pSource, pTool, &Sdks, pType, pBldType, pBldTrg, pBldTrgArch, pBldTrgCpu, pDefPath, 1214 1223 "FLAGS", "flags", 1/* left-to-right */); 1215 pDeps = kbuild_collect_source_prop(pTarget, pSource, pTool, &Sdks, pType, pBldType, pBldTrg, pBldTrgArch, pBldTrgCpu, 1224 pDeps = kbuild_collect_source_prop(pTarget, pSource, pTool, &Sdks, pType, pBldType, pBldTrg, pBldTrgArch, pBldTrgCpu, pDefPath, 1216 1225 "DEPS", "deps", 1/* left-to-right */); 1217 1226
Note:
See TracChangeset
for help on using the changeset viewer.