-update_list(cc.include_dirs, [os.path.join(sys.prefix,"include"),
- os.path.join(sys.prefix,'include/freetype2'),
- os.path.join(sys.prefix,'include/fontconfig')])
+if 'SWFTOOLS_SYSTEM_PREFIX' in os.environ:
+ # Allow overriding the prefix location. This is useful if your
+ # python is compiled in a custom location.
+ PREFIX = os.environ.get('SWFTOOLS_SYSTEM_PREFIX').strip()
+ if not os.path.exists(PREFIX):
+ print 'The SWFTOOLS_SYSTEM_PREFIX location does not exist'
+ sys.exit(1)
+ print 'Using %s as prefix for header files' % PREFIX
+else:
+ # Default to the prefix used for the python interpreter
+ PREFIX = sys.prefix
+
+update_list(cc.include_dirs, [os.path.join(PREFIX, 'include'),
+ os.path.join(PREFIX, 'include/freetype2'),
+ os.path.join(PREFIX, 'include/fontconfig')])