OLD | NEW |
| (Empty) |
1 # Copyright 2008, Google Inc. | |
2 # All rights reserved. | |
3 # | |
4 # Redistribution and use in source and binary forms, with or without | |
5 # modification, are permitted provided that the following conditions are | |
6 # met: | |
7 # | |
8 # * Redistributions of source code must retain the above copyright | |
9 # notice, this list of conditions and the following disclaimer. | |
10 # * Redistributions in binary form must reproduce the above | |
11 # copyright notice, this list of conditions and the following disclaimer | |
12 # in the documentation and/or other materials provided with the | |
13 # distribution. | |
14 # * Neither the name of Google Inc. nor the names of its | |
15 # contributors may be used to endorse or promote products derived from | |
16 # this software without specific prior written permission. | |
17 # | |
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | |
30 Import('env') | |
31 | |
32 env = env.Clone() | |
33 | |
34 env.Prepend( | |
35 CPPPATH = [ | |
36 '$LIBXML_DIR/DerivedSources/include', | |
37 '$LIBXML_DIR/include', | |
38 '$ICU38_DIR/public/common', | |
39 '$ICU38_DIR/public/18n', | |
40 '$ZLIB_DIR', | |
41 'scons', | |
42 '.', | |
43 '../', | |
44 ], | |
45 ) | |
46 | |
47 env.Append( | |
48 CPPDEFINES = [ | |
49 'U_STATIC_IMPLEMENTATION', | |
50 'LIBXML_STATIC', | |
51 'LIBXSLT_STATIC', | |
52 ], | |
53 ) | |
54 | |
55 if env['PLATFORM'] == 'win32': | |
56 env.Append( | |
57 CCFLAGS = [ | |
58 '/TC', | |
59 '/wd4800', | |
60 ], | |
61 ) | |
62 | |
63 | |
64 input_files = [ | |
65 'libxslt/attributes.c', | |
66 'libxslt/attrvt.c', | |
67 'libxslt/documents.c', | |
68 'libxslt/extensions.c', | |
69 'libxslt/extra.c', | |
70 'libxslt/functions.c', | |
71 'libxslt/imports.c', | |
72 'libxslt/keys.c', | |
73 'libxslt/namespaces.c', | |
74 'libxslt/numbers.c', | |
75 'libxslt/pattern.c', | |
76 'libxslt/preproc.c', | |
77 'libxslt/security.c', | |
78 'libxslt/templates.c', | |
79 'libxslt/transform.c', | |
80 'libxslt/variables.c', | |
81 'libxslt/xslt.c', | |
82 'libxslt/xsltutils.c', | |
83 ] | |
84 | |
85 env.ChromeStaticLibrary('libxslt', input_files) | |
86 | |
87 | |
88 if env['PLATFORM'] == 'win32': | |
89 config_files = [ | |
90 # The configure.js script must be first in this list; the | |
91 # env.Command() call below executes the first list element. | |
92 | |
93 'win32/configure.js', | |
94 'win32/Makefile.msvc', | |
95 | |
96 'config.h.in', | |
97 'configure.in', | |
98 'libexslt.pc.in', | |
99 'libxslt.pc.in', | |
100 'libxslt.spec.in', | |
101 'xslt-config.in', | |
102 'xsltConf.sh.in', | |
103 | |
104 'libexslt/exsltconfig.h.in', | |
105 | |
106 'libxslt/xsltconfig.h.in', | |
107 'libxslt/xsltwin32config.h.in', | |
108 'libxslt/win32config.h', | |
109 ] | |
110 | |
111 copied_sources = [] | |
112 for cf in config_files: | |
113 result = env.Command('scons/' + cf, cf, Copy('$TARGET', '$SOURCE')) | |
114 copied_sources.extend(result) | |
115 | |
116 env.Command(['scons/config.h'], | |
117 copied_sources, | |
118 'cd ${SOURCE.dir} && $CSCRIPT ${SOURCE.file} $CONFIG_OPTIONS', | |
119 CONFIG_OPTIONS='compiler=msvc') | |
120 elif env['PLATFORM'] == 'posix': | |
121 config_files = [ | |
122 'config.h', | |
123 'xslt-config', | |
124 'libexslt/exsltconfig.h', | |
125 'libxslt/xsltconfig.h', | |
126 'libxslt/xsltwin32config.h', | |
127 ] | |
128 for cf in config_files: | |
129 result = env.Command('scons/' + cf, 'linux/' + cf, | |
130 Copy('$TARGET', '$SOURCE')) | |
131 | |
OLD | NEW |