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