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