From c6283af353c97fcc750db03c7c784434a17374f9 Mon Sep 17 00:00:00 2001 From: "V. Armando Sole" Date: Sat, 5 Mar 2016 08:08:37 +0100 Subject: [PATCH 1/2] Allow build under windows. --- silx/io/setup.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/silx/io/setup.py b/silx/io/setup.py index ec088da091..5cbafacfd6 100644 --- a/silx/io/setup.py +++ b/silx/io/setup.py @@ -23,9 +23,9 @@ # # ###########################################################################*/ -__authors__ = ["P. Knobel"] +__authors__ = ["P. Knobel", "V.A. Solé"] __license__ = "MIT" -__date__ = "26/02/2016" +__date__ = "05/03/2016" import os import sys @@ -50,9 +50,6 @@ define_macros = [('WIN32',None)] elif os.name.lower().startswith('posix'): define_macros = [('SPECFILE_POSIX', None)] - #this one is more efficient but keeps the locale - #changed for longer time - #define_macros = [('PYMCA_POSIX', None)] #the best choice is to have _GNU_SOURCE defined #as a compilation flag because that allows the #use of strtod_l @@ -61,21 +58,22 @@ else: define_macros = [] - +current_dir = os.path.dirname(__file__) def configuration(parent_package='', top_path=None): config = Configuration('io', parent_package, top_path) config.add_subpackage('test') srcfiles = ['sfheader','sfinit','sflists','sfdata','sfindex', 'sflabel' ,'sfmca', 'sftools','locale_management'] - sources = ['specfile/src/'+ffile+'.c' for ffile in srcfiles] - sources.append('specfile/specfile.pyx') + sources = [os.path.join(current_dir, 'specfile', 'src', ffile+'.c') for ffile in srcfiles] + sources.append(os.path.join(current_dir, 'specfile', 'specfile.pyx')) config.add_extension('specfile', sources=sources, define_macros = define_macros, - include_dirs = ['specfile/include', numpy.get_include()], + include_dirs = [os.path.join(current_dir, 'specfile', 'include'), + numpy.get_include()], language='c') return config From 436cbb94f8ed90edc9875adef32ea37d273917a5 Mon Sep 17 00:00:00 2001 From: "V. Armando Sole" Date: Sat, 5 Mar 2016 08:27:37 +0100 Subject: [PATCH 2/2] No reason to have current_dir outside. --- silx/io/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/silx/io/setup.py b/silx/io/setup.py index 5cbafacfd6..a296276fbc 100644 --- a/silx/io/setup.py +++ b/silx/io/setup.py @@ -58,8 +58,8 @@ else: define_macros = [] -current_dir = os.path.dirname(__file__) def configuration(parent_package='', top_path=None): + current_dir = os.path.dirname(__file__) config = Configuration('io', parent_package, top_path) config.add_subpackage('test')