#! /usr/bin/env python
# encoding: utf-8

import sys

VERSION='0.9'
APPNAME='sbig'

top = '.'
out = 'build'

def options(opt):
	opt.load('python') # options for disabling pyc or pyo compilation
	opt.load('compiler_c')

def configure(conf):
	conf.load('compiler_c')
	conf.load('python')
	conf.check_python_version((2,4,2))
	conf.check_python_headers()

	conf.check_python_module('numpy')
	# try:
	# 	conf.check_python_module('pygccxml')
	# except conf.errors.ConfigurationError:
	# 	print('could not find pygccxml (ignored)')

        # conf.LIB_SBIGUDRV = ['sbigudrv']
        # conf.INCLUDES_SBIGUDRV  = ['/tmp/AA/include']
        # conf.LIBPATH_SBIGUDRV   = ['/tmp/AA/lib']


        # config for sbigudrv

        # config for libcfitsio

        
def build(bld):
	# python scripts
	# bld(features='py',
        #     source=bld.path.ant_glob('*.py'),
        #     install_from='.')

	# C python module
	bld(features = 'c cshlib pyext',
            source   = 'sbig.c',
            target   = 'sbig',
            includes = '/usr/local/include',
            # defines  = ["TARGET=ENV_LINUX"],
            lib      = ['m','sbigudrv'],
            libpath  = ['/usr/local/lib'])
            # use      = ['SBIGUDRV'])
  
	# # C programs
	# bld(features = 'c cprogram',
        #     source   = 'testsbig.c',
        #     target   = 'testsbig',
        #     # defines  = ["TARGET=ENV_LINUX"],
        #     includes = '/usr/local/include',
        #     lib      = ['m','sbigudrv', 'cfitsio'],
        #     libpath  = ['/usr/local/lib'])


