Changeset 775 for python


Ignore:
Timestamp:
Jun 6, 2016, 4:48:20 PM (9 years ago)
Author:
Yuri Dario
Message:

python: generate both 8.3 and long names for pyd dynamic libraries. fixes ticket#185.

Location:
python/trunk/Lib/distutils
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • python/trunk/Lib/distutils/command/build_ext.py

    r391 r775  
    669669        ext_path = string.split(ext_name, '.')
    670670        # OS/2 has an 8 character module (extension) limit :-(
    671         if os.name == "os2":
    672             ext_path[len(ext_path) - 1] = ext_path[len(ext_path) - 1][:8]
     671        # YD build 8.3 moved to emxcompiler.py
     672        #if os.name == "os2":
     673        #    ext_path[len(ext_path) - 1] = ext_path[len(ext_path) - 1][:8]
    673674        # extensions in debug_mode are named 'module_d.pyd' under windows
    674675        so_ext = get_config_var('SO')
  • python/trunk/Lib/distutils/command/install_lib.py

    r391 r775  
    113113    def install(self):
    114114        if os.path.isdir(self.build_dir):
    115             outfiles = self.copy_tree(self.build_dir, self.install_dir)
     115            outfiles = self.copy_tree(self.build_dir, self.install_dir, preserve_symlinks=1)
    116116        else:
    117117            self.warn("'%s' does not exist -- no Python modules to install" %
  • python/trunk/Lib/distutils/emxccompiler.py

    r395 r775  
    107107        libraries.extend(self.dll_libraries)
    108108
     109        # get pyd name and extension
     110        pyd_name8, pyd_ext = os.path.splitext( os.path.basename(output_filename))
     111        # if name is longer than 8.3, generate a hashed 8.3 name
     112        if len(os.path.basename(output_filename)) > 8+1+3:
     113            pyd_name8 = os.path.basename(output_filename)[:3] + str(reduce(lambda x,y:x+y, map(ord, output_filename)) % 65536)
     114
     115        # full relative path of pyd
     116        pyd_name = os.path.join(os.path.dirname(output_filename),
     117            pyd_name8 + ".pyd")
     118
    109119        # handle export symbols by creating a def-file
    110120        # with executables this only works with gcc/ld as linker
     
    130140            contents = [
    131141                "LIBRARY %s INITINSTANCE TERMINSTANCE" % \
    132                 os.path.splitext(os.path.basename(output_filename))[0],
     142                pyd_name8,
    133143                "DATA MULTIPLE NONSHARED",
    134144                "EXPORTS"]
     
    157167                           target_desc,
    158168                           objects,
    159                            output_filename,
     169                           pyd_name,
    160170                           output_dir,
    161171                           libraries,
     
    168178                           build_temp,
    169179                           target_lang)
     180        # if filename exceed 8.3, create a symlink to 8.3 pyd
     181        if len(os.path.basename(output_filename)) > 8+1+3:
     182            os.remove( output_filename)
     183            os.symlink( pyd_name8 + ".pyd", output_filename)
    170184
    171185    # link ()
Note: See TracChangeset for help on using the changeset viewer.