1- # Last Change: Fri Apr 24 08 :00 PM 2009 J
1+ # Last Change: Sun Apr 26 05 :00 PM 2009 J
22# vim:syntax=python
33import os
44import sys
@@ -13,10 +13,10 @@ from numscons import write_info
1313from scons_support import CheckBrokenMathlib , define_no_smp , \
1414 check_mlib , check_mlibs , is_npy_no_signal , CheckInline
1515from scons_support import array_api_gen_bld , ufunc_api_gen_bld , template_bld , \
16- umath_bld
16+ umath_bld , CheckGCC4
1717from setup_common import *
1818
19- ENABLE_SEPARATE_COMPILATION = False
19+ ENABLE_SEPARATE_COMPILATION = True
2020
2121env = GetNumpyEnvironment (ARGUMENTS )
2222env .Append (CPPPATH = env ["PYEXTCPPPATH" ])
@@ -30,7 +30,8 @@ if os.name == 'nt':
3030# Starting Configuration
3131#=======================
3232config = env .NumpyConfigure (custom_tests = {'CheckBrokenMathlib' : CheckBrokenMathlib ,
33- 'CheckCBLAS' : CheckCBLAS , 'CheckInline' : CheckInline }, config_h = pjoin ('config.h' ))
33+ 'CheckCBLAS' : CheckCBLAS , 'CheckInline' : CheckInline , 'CheckGCC4' : CheckGCC4 },
34+ config_h = pjoin ('config.h' ))
3435
3536# numpyconfig_sym will keep the values of some configuration variables, the one
3637# needed for the public numpy API.
@@ -189,6 +190,16 @@ numpyconfig_sym.append(('NPY_INLINE', inline))
189190if ENABLE_SEPARATE_COMPILATION :
190191 config .Define ("ENABLE_SEPARATE_COMPILATION" , 1 )
191192 numpyconfig_sym .append (('NPY_ENABLE_SEPARATE_COMPILATION' , 1 ))
193+
194+ # Checking for visibility macro
195+ def visibility_define ():
196+ if config .CheckGCC4 ():
197+ return '__attribute__((visibility("hidden")))'
198+ else :
199+ return ''
200+
201+ numpyconfig_sym .append (('VISIBILITY_HIDDEN' , visibility_define ()))
202+
192203#-------------------------------------------------------
193204# Define the function PyOS_ascii_strod if not available
194205#-------------------------------------------------------
0 commit comments