File: wscript

package info (click to toggle)
minidjvu 0.8.svn.2010.05.06+dfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 2,372 kB
  • ctags: 1,082
  • sloc: sh: 9,230; ansic: 5,788; cpp: 2,400; makefile: 259; python: 42
file content (58 lines) | stat: -rw-r--r-- 1,662 bytes parent folder | download | duplicates (2)
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)