]>
git.saurik.com Git - wxWidgets.git/blob - src/tiff/SConstruct
2 # Tag Image File Format (TIFF) Software
4 # Copyright (C) 2005, Andrey Kiselev <dron@ak4719.spb.edu>
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.
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.
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
25 # This file contains rules to build software with the SCons tool
26 # (see the http://www.scons.org/ for details on SCons).
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' , \
40 opts
. Add ( BoolOption ( 'packbits' , \
41 'enable support for Macintosh PackBits algorithm' , \
43 opts
. Add ( BoolOption ( 'lzw' , \
44 'enable support for LZW algorithm' , \
46 opts
. Add ( BoolOption ( 'thunder' , \
47 'enable support for ThunderScan 4-bit RLE algorithm' , \
49 opts
. Add ( BoolOption ( 'next' , \
50 'enable support for NeXT 2-bit RLE algorithm' , \
52 opts
. Add ( BoolOption ( 'logluv' , \
53 'enable support for LogLuv high dynamic range encoding' , \
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)' , \
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' , \
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' , \
65 opts
. Save ( 'libtiff.conf' , env
)
66 Help ( opts
. GenerateHelpText ( env
))
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' ])
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 ( "-" )
80 def Define ( context
, key
, have
):
82 SCons
. Conftest
._ Have
( context
, key
, have
)
84 def CheckCustomOption ( context
, name
):
85 context
. Message ( 'Checking is the ' + name
+ ' option set... ' )
87 Define ( context
, name
+ '_SUPPORT' , ret
)
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' )
97 Define ( context
, 'HOST_FILLORDER' , 'FILLORDER_MSB2LSB' )
98 context
. Result ( 'msb2lsb' )
101 def CheckIEEEFPOption ( context
):
102 context
. Message ( 'Checking for the IEEE floating point format... ' )
103 Define ( context
, 'HAVE_IEEEFP' , 1 )
107 def CheckOtherOption ( context
, name
):
108 context
. Message ( 'Checking is the ' + name
+ ' option set... ' )
110 Define ( context
, 'HAVE_' + name
, ret
)
115 'CheckCustomOption' : CheckCustomOption
, \
116 'CheckFillorderOption' : CheckFillorderOption
, \
117 'CheckIEEEFPOption' : CheckIEEEFPOption
, \
118 'CheckOtherOption' : CheckOtherOption \
120 conf
= Configure ( env
, custom_tests
= custom_tests
, \
121 config_h
= 'libtiff/tif_config.h' )
123 # Check for standard library
125 if target_os
!= 'cygwin' \
126 and target_os
!= 'mingw32' \
127 and target_os
!= 'beos' \
128 and target_os
!= 'darwin' :
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' )
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' )
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' )
169 # Ok, now go to build files in the subdirectories
170 SConscript ( dirs
= [ 'libtiff' ], name
= 'SConstruct' )