- Timestamp:
- Mar 21, 2014, 7:20:05 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk/Lib/distutils/emxccompiler.py
r391 r395 30 30 31 31 class EMXCCompiler (UnixCCompiler): 32 33 _rc_extensions = ['.rc', '.RC'] 32 34 33 35 compiler_type = 'emx' … … 171 173 # -- Miscellaneous methods ----------------------------------------- 172 174 173 # override the object_filenames method from CCompiler to174 # support rc and res-files175 175 def object_filenames (self, 176 176 source_filenames, 177 177 strip_dir=0, 178 178 output_dir=''): 179 # Copied from ccompiler.py, extended to return .res as 'object'-file 180 # for .rc input file 179 181 if output_dir is None: output_dir = '' 180 182 obj_names = [] 181 183 for src_name in source_filenames: 182 # use normcase to make sure '.rc' is really '.rc' and not '.RC' 183 (base, ext) = os.path.splitext (os.path.normcase(src_name)) 184 if ext not in (self.src_extensions + ['.rc']): 184 (base, ext) = os.path.splitext (src_name) 185 base = os.path.splitdrive(base)[1] # Chop off the drive 186 base = base[os.path.isabs(base):] # If abs, chop off leading / 187 if ext not in (self.src_extensions + self._rc_extensions): 185 188 raise UnknownFileError, \ 186 189 "unknown file type '%s' (from '%s')" % \ … … 188 191 if strip_dir: 189 192 base = os.path.basename (base) 190 if ext == '.rc': 191 # these need to be compiled to object files 193 if ext in self._rc_extensions: 192 194 obj_names.append (os.path.join (output_dir, 193 base + self.res_extension))195 base + self.res_extension)) 194 196 else: 195 197 obj_names.append (os.path.join (output_dir, 196 base + self.obj_extension))198 base + self.obj_extension)) 197 199 return obj_names 198 200
Note:
See TracChangeset
for help on using the changeset viewer.