]> git.saurik.com Git - wxWidgets.git/blame - src/tiff/SConstruct
Remove all lines containing cvs/svn "$Id$" keyword.
[wxWidgets.git] / src / tiff / SConstruct
CommitLineData
8414a40c
VZ
1
2# Tag Image File Format (TIFF) Software
3#
4# Copyright (C) 2005, Andrey Kiselev <dron@ak4719.spb.edu>
5#
6# Permission to use, copy, modify, distribute, and sell this software and
7# its documentation for any purpose is hereby granted without fee, provided
8# that (i) the above copyright notices and this permission notice appear in
9# all copies of the software and related documentation, and (ii) the names of
10# Sam Leffler and Silicon Graphics may not be used in any advertising or
11# publicity relating to the software without the specific, prior written
12# permission of Sam Leffler and Silicon Graphics.
13#
14# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
15# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
16# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
17#
18# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
19# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
20# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
21# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
22# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
23# OF THIS SOFTWARE.
24
25# This file contains rules to build software with the SCons tool
26# (see the http://www.scons.org/ for details on SCons).
27
28import os
29
30env = Environment()
31
32# Read the user supplied options
33opts = Options('libtiff.conf')
34opts.Add(PathOption('PREFIX', \
35 'install architecture-independent files in this directory', \
36 '/usr/local', PathOption.PathIsDirCreate))
37opts.Add(BoolOption('ccitt', \
38 'enable support for CCITT Group 3 & 4 algorithms', \
39 'yes'))
40opts.Add(BoolOption('packbits', \
41 'enable support for Macintosh PackBits algorithm', \
42 'yes'))
43opts.Add(BoolOption('lzw', \
44 'enable support for LZW algorithm', \
45 'yes'))
46opts.Add(BoolOption('thunder', \
47 'enable support for ThunderScan 4-bit RLE algorithm', \
48 'yes'))
49opts.Add(BoolOption('next', \
50 'enable support for NeXT 2-bit RLE algorithm', \
51 'yes'))
52opts.Add(BoolOption('logluv', \
53 'enable support for LogLuv high dynamic range encoding', \
54 'yes'))
55opts.Add(BoolOption('strip_chopping', \
56 'support for strip chopping (whether or not to convert single-strip uncompressed images to mutiple strips of ~8Kb to reduce memory usage)', \
57 'yes'))
58opts.Add(BoolOption('extrasample_as_alpha', \
59 'the RGBA interface will treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many packages produce RGBA files but don\'t mark the alpha properly', \
60 'yes'))
61opts.Add(BoolOption('check_ycbcr_subsampling', \
62 'disable picking up YCbCr subsampling info from the JPEG data stream to support files lacking the tag', \
63 'yes'))
64opts.Update(env)
65opts.Save('libtiff.conf', env)
66Help(opts.GenerateHelpText(env))
67
68# Here are our installation paths:
69idir_prefix = '$PREFIX'
70idir_lib = '$PREFIX/lib'
71idir_bin = '$PREFIX/bin'
72idir_inc = '$PREFIX/include'
73idir_doc = '$PREFIX/doc'
74Export([ 'env', 'idir_prefix', 'idir_lib', 'idir_bin', 'idir_inc', 'idir_doc' ])
75
76# Now proceed to system feature checks
77target_cpu, target_vendor, target_kernel, target_os = \
80ed523f 78 os.popen("./config/config.guess").readlines()[0].split("-")
8414a40c
VZ
79
80def Define(context, key, have):
81 import SCons.Conftest
82 SCons.Conftest._Have(context, key, have)
83
84def CheckCustomOption(context, name):
85 context.Message('Checking is the ' + name + ' option set... ')
86 ret = env[name]
87 Define(context, name + '_SUPPORT', ret)
88 context.Result(ret)
89 return ret
90
91def CheckFillorderOption(context):
92 context.Message('Checking for the native cpu bit order... ')
93 if target_cpu[0] == 'i' and target_cpu[2:] == '86':
94 Define(context, 'HOST_FILLORDER', 'FILLORDER_LSB2MSB')
95 context.Result('lsb2msb')
96 else:
97 Define(context, 'HOST_FILLORDER', 'FILLORDER_MSB2LSB')
98 context.Result('msb2lsb')
99 return 1
100
101def CheckIEEEFPOption(context):
102 context.Message('Checking for the IEEE floating point format... ')
103 Define(context, 'HAVE_IEEEFP', 1)
104 context.Result(1)
105 return 1
106
107def CheckOtherOption(context, name):
108 context.Message('Checking is the ' + name + ' option set... ')
109 ret = env[name]
110 Define(context, 'HAVE_' + name, ret)
111 context.Result(ret)
112 return ret
113
114custom_tests = { \
115 'CheckCustomOption' : CheckCustomOption, \
116 'CheckFillorderOption' : CheckFillorderOption, \
117 'CheckIEEEFPOption' : CheckIEEEFPOption, \
118 'CheckOtherOption' : CheckOtherOption \
119 }
120conf = Configure(env, custom_tests = custom_tests, \
121 config_h = 'libtiff/tif_config.h')
122
123# Check for standard library
124conf.CheckLib('c')
125if target_os != 'cygwin' \
126 and target_os != 'mingw32' \
127 and target_os != 'beos' \
128 and target_os != 'darwin':
129 conf.CheckLib('m')
130
131# Check for system headers
132conf.CheckCHeader('assert.h')
133conf.CheckCHeader('fcntl.h')
80ed523f 134conf.CheckCHeader('io.h')
8414a40c
VZ
135conf.CheckCHeader('limits.h')
136conf.CheckCHeader('malloc.h')
137conf.CheckCHeader('search.h')
138conf.CheckCHeader('sys/time.h')
139conf.CheckCHeader('unistd.h')
140
141# Check for standard library functions
142conf.CheckFunc('floor')
143conf.CheckFunc('isascii')
144conf.CheckFunc('memmove')
145conf.CheckFunc('memset')
146conf.CheckFunc('mmap')
147conf.CheckFunc('pow')
80ed523f 148conf.CheckFunc('setmode')
8414a40c
VZ
149conf.CheckFunc('sqrt')
150conf.CheckFunc('strchr')
151conf.CheckFunc('strrchr')
152conf.CheckFunc('strstr')
153conf.CheckFunc('strtol')
154
155conf.CheckFillorderOption()
156conf.CheckIEEEFPOption()
157conf.CheckCustomOption('ccitt')
158conf.CheckCustomOption('packbits')
159conf.CheckCustomOption('lzw')
160conf.CheckCustomOption('thunder')
161conf.CheckCustomOption('next')
162conf.CheckCustomOption('logluv')
163conf.CheckOtherOption('strip_chopping')
164conf.CheckOtherOption('extrasample_as_alpha')
165conf.CheckOtherOption('check_ycbcr_subsampling')
166
167env = conf.Finish()
168
169# Ok, now go to build files in the subdirectories
170SConscript(dirs = [ 'libtiff' ], name = 'SConstruct')