Skip to content

Commit da93ccc

Browse files
committed
Let setup.cfg customize the base directory for libs and includes
svn path=/trunk/matplotlib/; revision=8113
1 parent 5f64b1a commit da93ccc

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

setup.cfg.template

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
[egg_info]
55
tag_svn_revision = 1
66

7+
[directories]
8+
# Uncomment to override the default basedir in setupext.py.
9+
# This can be a single directory or a space-delimited list of directories.
10+
#basedirlist = /usr
11+
712
[status]
813
# To suppress display of the dependencies and their versions
914
# at the top of the build log, uncomment the following line:

setupext.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@
119119
'build_macosx': 'auto',
120120
'build_image': True,
121121
'build_windowing': True,
122-
'backend': None}
122+
'backend': None,
123+
'basedirlist': None}
123124

124125
defines = [
125126
('PY_ARRAY_UNIQUE_SYMBOL', 'MPL_ARRAY_API'),
@@ -161,6 +162,15 @@
161162
try: options['backend'] = config.get("rc_options", "backend")
162163
except: pass
163164

165+
try: options['basedirlist'] = config.get("directories", "basedirlist")
166+
except: pass
167+
168+
# For get_base_flags:
169+
if options['basedirlist']:
170+
basedirlist = options['basedirlist'].split()
171+
else:
172+
basedirlist = basedir[sys.platform]
173+
print "basedirlist is:", basedirlist
164174

165175
if options['display_status']:
166176
def print_line(char='='):
@@ -331,10 +341,10 @@ def check_for_libpng():
331341

332342
def add_base_flags(module):
333343
incdirs = filter(os.path.exists,
334-
[os.path.join(p, 'include') for p in basedir[sys.platform] ])
344+
[os.path.join(p, 'include') for p in basedirlist ])
335345
libdirs = filter(os.path.exists,
336-
[os.path.join(p, 'lib') for p in basedir[sys.platform] ]+
337-
[os.path.join(p, 'lib64') for p in basedir[sys.platform] ] )
346+
[os.path.join(p, 'lib') for p in basedirlist ]+
347+
[os.path.join(p, 'lib64') for p in basedirlist ] )
338348

339349
module.include_dirs.extend(incdirs)
340350
module.include_dirs.append('.')

0 commit comments

Comments
 (0)