Changeset 10 for python/trunk/Lib/distutils
- Timestamp:
- Sep 3, 2010, 5:33:06 PM (15 years ago)
- Location:
- python/trunk/Lib/distutils
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk/Lib/distutils/ccompiler.py
r2 r10 983 983 # compiler 984 984 ('cygwin.*', 'unix'), 985 ('os2knix', 'emx'), 985 986 ('os2emx', 'emx'), 986 987 -
python/trunk/Lib/distutils/command/bdist_rpm.py
r2 r10 200 200 "--python and --fix-python are mutually exclusive options" 201 201 202 if os.name != 'posix' :202 if os.name != 'posix' and os.name != 'os2': 203 203 raise DistutilsPlatformError, \ 204 204 ("don't know how to create RPM " … … 323 323 rpm_cmd = ['rpm'] 324 324 if os.path.exists('/usr/bin/rpmbuild') or \ 325 os.path.exists('/usr/bin/rpmbuild.exe') or \ 325 326 os.path.exists('/bin/rpmbuild'): 326 327 rpm_cmd = ['rpmbuild'] … … 346 347 q_cmd = r"rpm -q --qf '%s %s\n' --specfile '%s'" % ( 347 348 src_rpm, non_src_rpm, spec_path) 349 if os.name == 'os2': 350 q_cmd = q_cmd.replace( '%{', '%%{') 348 351 349 352 out = os.popen(q_cmd) -
python/trunk/Lib/distutils/command/install.py
r2 r10 284 284 285 285 # Next, stuff that's wrong (or dubious) only on certain platforms. 286 if os.name != "posix" :286 if os.name != "posix" and os.name != "os2": 287 287 if self.exec_prefix: 288 288 self.warn("exec-prefix option ignored on this platform") … … 299 299 self.dump_dirs("pre-finalize_{unix,other}") 300 300 301 if os.name == 'posix' :301 if os.name == 'posix' or os.name == "os2": 302 302 self.finalize_unix() 303 303 else: -
python/trunk/Lib/distutils/emxccompiler.py
r2 r10 64 64 # Hard-code GCC because that's what this is all about. 65 65 # XXX optimization, warnings etc. should be customizable. 66 self.set_executables(compiler='gcc - Zomf -Zmt -O3 -fomit-frame-pointer -mprobe-Wall',67 compiler_so='gcc - Zomf -Zmt -O3 -fomit-frame-pointer -mprobe-Wall',68 linker_exe='gcc -Zomf -Z mt -Zcrtdll',69 linker_so='gcc -Zomf -Z mt -Zcrtdll -Zdll')66 self.set_executables(compiler='gcc -g -O2 -march=i386 -mtune=i686 -fomit-frame-pointer -Wall', 67 compiler_so='gcc -g -O2 -march=i386 -mtune=i686 -fomit-frame-pointer -Wall', 68 linker_exe='gcc -Zomf -Zexe', 69 linker_so='gcc -Zomf -Zdll') 70 70 71 71 # want the gcc library statically linked (so that we don't have … … 139 139 "EXPORTS"] 140 140 for sym in export_symbols: 141 contents.append(' " %s"' % sym)141 contents.append(' "_%s"' % sym) 142 142 self.execute(write_file, (def_file, contents), 143 143 "writing %s" % def_file) … … 209 209 # to deal with file naming/searching differences 210 210 def find_library_file(self, dirs, lib, debug=0): 211 shortlib = '%s.lib' % lib 212 longlib = 'lib%s.lib' % lib # this form very rare 211 try_names = [lib + ".lib", lib + ".a", "lib" + lib + ".lib", "lib" + lib + ".a"] 213 212 214 213 # get EMX's default library directory search path … … 218 217 emx_dirs = [] 219 218 219 #print "dirs:",dirs 220 220 for dir in dirs + emx_dirs: 221 shortlibp = os.path.join(dir, shortlib) 222 longlibp = os.path.join(dir, longlib) 223 if os.path.exists(shortlibp): 224 return shortlibp 225 elif os.path.exists(longlibp): 226 return longlibp 221 for name in try_names: 222 libfile = os.path.join(dir, name) 223 #print "libfile:",libfile 224 if os.path.exists(libfile): 225 return libfile 227 226 228 227 # Oops, didn't find it in *any* of 'dirs' -
python/trunk/Lib/distutils/sysconfig.py
r2 r10 91 91 return os.path.join(prefix, "Include") 92 92 elif os.name == "os2": 93 return os.path.join(prefix, "Include") 93 if python_build: 94 base = os.path.dirname(os.path.abspath(sys.executable)) 95 if plat_specific: 96 inc_dir = base 97 else: 98 inc_dir = os.path.join(base, "Include") 99 if not os.path.exists(inc_dir): 100 inc_dir = os.path.join(os.path.dirname(base), "Include") 101 return inc_dir 102 return os.path.join(prefix, "include", "python" + get_python_version()) 94 103 else: 95 104 raise DistutilsPlatformError( … … 145 154 146 155 elif os.name == "os2": 156 libpython = os.path.join(prefix, 157 "lib", "python" + get_python_version()) 147 158 if standard_lib: 148 return os.path.join(prefix, "Lib")149 else: 150 return os.path.join( prefix, "Lib", "site-packages")159 return libpython 160 else: 161 return os.path.join(libpython, "site-packages") 151 162 152 163 else: … … 491 502 """Initialize the module as appropriate for OS/2""" 492 503 g = {} 504 # load the installed Makefile: 505 try: 506 filename = get_makefile_filename() 507 parse_makefile(filename, g) 508 except IOError, msg: 509 my_msg = "invalid Python installation: unable to open %s" % filename 510 if hasattr(msg, "strerror"): 511 my_msg = my_msg + " (%s)" % msg.strerror 512 513 raise DistutilsPlatformError(my_msg) 514 515 # load the installed pyconfig.h: 516 try: 517 filename = get_config_h_filename() 518 parse_config_h(file(filename), g) 519 except IOError, msg: 520 my_msg = "invalid Python installation: unable to open %s" % filename 521 if hasattr(msg, "strerror"): 522 my_msg = my_msg + " (%s)" % msg.strerror 523 524 raise DistutilsPlatformError(my_msg) 525 526 # On AIX, there are wrong paths to the linker scripts in the Makefile 527 # -- these paths are relative to the Python source, but when installed 528 # the scripts are in another directory. 529 if python_build: 530 g['LDSHARED'] = g['BLDSHARED'] 531 532 # OS/2 module 533 493 534 # set basic install directories 494 535 g['LIBDEST'] = get_python_lib(plat_specific=0, standard_lib=1) -
python/trunk/Lib/distutils/unixccompiler.py
r2 r10 140 140 dylib_lib_extension = ".dylib" 141 141 static_lib_format = shared_lib_format = dylib_lib_format = "lib%s%s" 142 if sys.platform == "cygwin" :142 if sys.platform == "cygwin" or sys.platform == "os2emx" or sys.platform == "os2knix": 143 143 exe_extension = ".exe" 144 144 … … 284 284 # we use this hack. 285 285 compiler = os.path.basename(sysconfig.get_config_var("CC")) 286 if sys.platform[:6] == "darwin" :286 if sys.platform[:6] == "darwin" or sys.platform[:7] == "os2knix": 287 287 # MacOSX's linker doesn't understand the -R flag at all 288 288 return "-L" + dir
Note:
See TracChangeset
for help on using the changeset viewer.