Changeset 9581:e0167f99e748 in orange


Ignore:
Timestamp:
01/26/12 17:30:56 (2 years ago)
Author:
ales_erjavec
Branch:
default
rebase_source:
73fcdca70236ebe759874c33e08e794f6169a792
Message:

Don't build liborange_include.a in the build_lib directory so it does not get included in the final installation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • setup.py

    r9576 r9581  
    1010from distutils.unixccompiler import UnixCCompiler 
    1111 
    12 have_setuptools = getattr(distutils.core, "have_setuptools", False) # This is set in setupegg.py 
     12# This is set in setupegg.py 
     13have_setuptools = getattr(distutils.core, "have_setuptools", False)  
    1314 
    1415import re 
     
    2425 
    2526from distutils.sysconfig import get_python_inc, get_config_var 
     27 
    2628import numpy 
    2729numpy_include_dir = numpy.get_include() 
     
    8082    def finalize_options(self): 
    8183        build_ext.finalize_options(self) 
    82         # add the build_lib dir (for liborange_include) 
     84        # add the build_lib dir and build_temp (for  
     85        # liborange_include and liborange)             
    8386        if not self.inplace: 
    84             self.library_dirs.append(self.build_lib)  
     87            self.library_dirs.append(self.build_lib) # for linking with liborange.so 
     88            self.library_dirs.append(self.build_temp) # for linking with liborange_include.a 
    8589        else: 
    86             self.library_dirs.append("./orange") 
     90            self.library_dirs.append("./orange") # for linking with liborange.so 
     91            self.library_dirs.append(self.build_temp) # for linking with liborange_include.a 
    8792         
    8893    def build_extension(self, ext): 
     
    100105                lib = glob.glob(os.path.join(self.build_temp, "*", "*", ext.name + ".lib"))[0] 
    101106                copy_file(lib, os.path.splitext(ext_fullpath)[0] + ".lib") 
    102                            
    103                 #self.get 
    104107            else: 
    105108                # Make lib{name}.so link to {name}.so 
     
    129132         
    130133        ext_path = self.get_ext_fullpath(ext.name) 
    131 #        output_dir, _ = os.path.split(ext_path) 
    132 #        lib_filename = self.compiler.library_filename(ext.name, lib_type='static', output_dir=output_dir) 
    133134         
    134135        depends = sources + ext.depends 
     
    219220        sources = list(sources) 
    220221         
    221         ext_path = self.get_ext_fullpath(ext.name) 
    222         output_dir, _ = os.path.split(ext_path) 
     222        # Static libs get build in the build_temp directory 
     223        output_dir = self.build_temp 
    223224        if not os.path.exists(output_dir): #VSC fails if the dir does not exist 
    224225            os.makedirs(output_dir) 
     226             
    225227        lib_filename = self.compiler.library_filename(ext.name, lib_type='static', output_dir=output_dir) 
    226228         
     
    286288        language = ext.language or self.compiler.detect_language(sources) 
    287289         
    288         #first remove old library (ar only appends the contents if archive already exists 
     290        #first remove old library (ar only appends the contents if archive already exists) 
    289291        try: 
    290292            os.remove(lib_filename) 
     
    292294            log.debug("failed to remove obsolete static library %s: %s" %(ext.name, str(ex))) 
    293295 
     296        # The static library is created in the temp dir, it is used during the compile step only 
     297        # it should not be included in the final install 
    294298        self.compiler.create_static_lib( 
    295299            objects, ext.name, output_dir, 
Note: See TracChangeset for help on using the changeset viewer.