]> git.saurik.com Git - wxWidgets.git/blob - src/tiff/SConstruct
Reflect changes in stc.cpp in stc.cpp.in from which it's generated.
[wxWidgets.git] / src / tiff / SConstruct
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
28 import os
29
30 env = Environment()
31
32 # Read the user supplied options
33 opts = Options('libtiff.conf')
34 opts.Add(PathOption('PREFIX', \
35 'install architecture-independent files in this directory', \
36 '/usr/local', PathOption.PathIsDirCreate))
37 opts.Add(BoolOption('ccitt', \
38 'enable support for CCITT Group 3 & 4 algorithms', \
39 'yes'))
40 opts.Add(BoolOption('packbits', \
41 'enable support for Macintosh PackBits algorithm', \
42 'yes'))
43 opts.Add(BoolOption('lzw', \
44 'enable support for LZW algorithm', \
45 'yes'))
46 opts.Add(BoolOption('thunder', \
47 'enable support for ThunderScan 4-bit RLE algorithm', \
48 'yes'))
49 opts.Add(BoolOption('next', \
50 'enable support for NeXT 2-bit RLE algorithm', \
51 'yes'))
52 opts.Add(BoolOption('logluv', \
53 'enable support for LogLuv high dynamic range encoding', \
54 'yes'))
55 opts.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'))
58 opts.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'))
61 opts.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'))
64 opts.Update(env)
65 opts.Save('libtiff.conf', env)
66 Help(opts.GenerateHelpText(env))
67
68 # Here are our installation paths:
69 idir_prefix = '$PREFIX'
70 idir_lib = '$PREFIX/lib'
71 idir_bin = '$PREFIX/bin'
72 idir_inc = '$PREFIX/include'
73 idir_doc = '$PREFIX/doc'
74 Export([ 'env', 'idir_prefix', 'idir_lib', 'idir_bin', 'idir_inc', 'idir_doc' ])
75
76 # Now proceed to system feature checks
77 target_cpu, target_vendor, target_kernel, target_os = \
78 os.popen("./config/config.guess").readlines()[0].split("-")
79
80 def Define(context, key, have):
81 import SCons.Conftest
82 SCons.Conftest._Have(context, key, have)
83
84 def 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
91 def 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
101 def 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
107 def 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
114 custom_tests = { \
115 'CheckCustomOption' : CheckCustomOption, \
116 'CheckFillorderOption' : CheckFillorderOption, \
117 'CheckIEEEFPOption' : CheckIEEEFPOption, \
118 'CheckOtherOption' : CheckOtherOption \
119 }
120 conf = Configure(env, custom_tests = custom_tests, \
121 config_h = 'libtiff/tif_config.h')
122
123 # Check for standard library
124 conf.CheckLib('c')
125 if 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
132 conf.CheckCHeader('assert.h')
133 conf.CheckCHeader('fcntl.h')
134 conf.CheckCHeader('io.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('setmode')
149 conf.CheckFunc('sqrt')
150 conf.CheckFunc('strchr')
151 conf.CheckFunc('strrchr')
152 conf.CheckFunc('strstr')
153 conf.CheckFunc('strtol')
154
155 conf.CheckFillorderOption()
156 conf.CheckIEEEFPOption()
157 conf.CheckCustomOption('ccitt')
158 conf.CheckCustomOption('packbits')
159 conf.CheckCustomOption('lzw')
160 conf.CheckCustomOption('thunder')
161 conf.CheckCustomOption('next')
162 conf.CheckCustomOption('logluv')
163 conf.CheckOtherOption('strip_chopping')
164 conf.CheckOtherOption('extrasample_as_alpha')
165 conf.CheckOtherOption('check_ycbcr_subsampling')
166
167 env = conf.Finish()
168
169 # Ok, now go to build files in the subdirectories
170 SConscript(dirs = [ 'libtiff' ], name = 'SConstruct')