1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
#! /usr/bin/env python
VERSION = '0.9'
APPNAME = 'minidjvu'
srcdir = '.'
blddir = 'build'
def configure(conf):
conf.check_tool('gcc g++')
conf.check(header_name='math.h')
conf.check(lib='m')
conf.check(header_name='tiffio.h', define_name='HAVE_LIBTIFF')
conf.check(lib='tiff')
conf.check(header_name='libintl.h', define_name='HAVE_I18N')
conf.check(header_name='stdint.h', define_name='HAVE_STDINT_H')
conf.write_config_header('config.h') # included from mdjvucfg.h
# Compilation flags
common_cflags = '-pipe -O3 -Wall -DHAVE_CONFIG_H -DNDEBUG'.split()
conf.env.append_value('CCFLAGS', common_cflags + '''
-D__STRICT_ANSI__ -Wshadow -pedantic-errors
-Wpointer-arith -Waggregate-return -Wlong-long
-Wredundant-decls -Wcast-qual -Wcast-align
'''.split())
conf.env.append_value('CXXFLAGS', common_cflags)
def build(bld):
bld.new_task_gen(
features = 'cc cxx cstaticlib', # cshlib
source = bld.glob('src/*/*.c') + bld.glob('src/*/*.cpp'),
target = 'minidjvu',
includes = '# include', # '#' is where config.h is generated
install_path = '${PREFIX}/lib',
uselib = 'M TIFF'
)
bld.new_task_gen(
features = 'cc cxx cprogram',
source = 'tools/minidjvu.c',
target = 'minidjvu',
includes = '# include',
install_path = '${PREFIX}/bin',
uselib = 'M TIFF',
uselib_local = 'minidjvu'
)
headers = bld.glob('include/minidjvu/*.h') + \
bld.glob('include/minidjvu/*/*.h')
for i in headers:
bld.install_files('${PREFIX}/' + i, i)
|