~ubuntu-branches/ubuntu/maverick/poedit/maverick

« back to all changes in this revision

Viewing changes to build/SConstruct

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2008-09-16 19:47:00 UTC
  • mfrom: (0.2.9 upstream) (1.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20080916194700-ueyef0pgklk3u50k
Tags: 1.4.2-2
Adding debug package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
DB_CONFIGURE = '--disable-cryptography --disable-replication ' + \
9
9
               '--disable-statistics --disable-shared --enable-static'
10
10
 
11
 
LIBICONV_VERSION = '1.11'
 
11
LIBICONV_VERSION = '1.12'
12
12
LIBICONV_URL = 'ftp://ftp.gnu.org/pub/gnu/libiconv/libiconv-%s.tar.gz' % LIBICONV_VERSION
13
 
LIBICONV_CONFIGURE = '--disable-shared'
14
 
 
15
 
GETTEXT_VERSION = '0.16.1'
 
13
LIBICONV_CONFIGURE = '--disable-static'
 
14
 
 
15
LIBGOMP_URL = 'http://www.opensource.apple.com/darwinsource/tarballs/other/gcc_42-5531.tar.gz'
 
16
LIBGOMP_CONFIGURE = '--disable-multilib --disable-shared --with-pic'
 
17
LIBGOMP_PATCHES = ['libgomp-sysconf-failure-fix.patch',
 
18
                   'libgomp-osx-10.4-fix.patch']
 
19
 
 
20
GETTEXT_VERSION = '0.17'
16
21
GETTEXT_URL = 'ftp://ftp.gnu.org/pub/gnu/gettext/gettext-%s.tar.gz' % GETTEXT_VERSION
17
 
GETTEXT_PATCHES = ['gettext-0.16.1-mingw-localenames.patch']
18
 
GETTEXT_CONFIGURE = '--disable-java ' + \
19
 
                    '--disable-rpath --disable-openmp ' + \
20
 
                    '--disable-shared '
 
22
GETTEXT_CONFIGURE = '--disable-java --disable-rpath ' + \
 
23
                    '--disable-static '
21
24
GETTEXT_BINARIES = ['msgfmt', 'msgmerge', 'msgunfmt', 'xgettext', 'msgcat']
22
25
 
23
 
WX_VERSION = '2.8.6'
 
26
WX_VERSION = '2.8.7'
24
27
WX_URL = 'ftp://ftp.wxwidgets.org/pub/%s/wxWidgets-%s.tar.bz2' % (WX_VERSION, WX_VERSION)
25
 
WX_PATCHES = ['wx-2.8.6-mac-dialog-fix.patch']
 
28
WX_PATCHES = ['wx-2.8.7-mac-listctrl-refreshitem.patch',
 
29
              'wx-2.8.7-mac-listctrl-attributes.patch',
 
30
              'wx-2.8.7-msw-clipboard-events.patch',
 
31
              'wx-2.8.7-msw-richedit-border.patch']
 
32
 
26
33
# NB: don't use --enable-debug_info, it forces -O0!
27
34
WX_CONFIGURE = '--disable-shared --enable-unicode --disable-tga'
28
35
WX_WINFLAGS = 'SHARED=0 BUILD=release DEBUG_INFO=1 UNICODE=1 USE_MEDIA=0 USE_AUI=0 USE_RICHTEXT=0 USE_STC=0 USE_QA=1'
57
64
env['OSX_HOST_X86'] = 'i686-apple-darwin8'
58
65
 
59
66
# FIXME: this should be per-agent configuration
60
 
env['MINGW_HOST'] = 'i686-pc-mingw32'
61
 
 
62
 
# FIXME: this should be per-agent configuration
63
67
# FIXME: have some directives on specifying what is required from the agent
64
68
# native type of the agent we're executing on
65
69
env['OSX_NATIVE'] = 'ppc' # 'ppc' or 'x86'
85
89
OSX_ENVIRONMENT_X86.update(OSX_ENVIRONMENT_COMMON)
86
90
 
87
91
 
88
 
# FIXME: these two should be in agent-specific (SCons) environment rather
89
 
#        that agent/target execution (OS) environment
90
 
MINGW_ENVIRONMENT = {
91
 
        'CC'        : '$MINGW_HOST-gcc',
92
 
        'CXX'       : '$MINGW_HOST-g++',
93
 
    }
94
 
 
95
92
VS2005_ENVIRONMENT = {
96
93
        'MSVS_PATH' : 'C:\\Program Files\\Microsoft Visual Studio 8',
97
94
        'PSDK_PATH' : 'C:\\Program Files\\Microsoft Platform SDK',
171
168
        sources=src_libiconv,
172
169
        deps=None,
173
170
        commands=[
174
 
            './configure --host=$MINGW_HOST %s' % LIBICONV_CONFIGURE,
 
171
            './configure --host=$$MINGW_HOST %s' % LIBICONV_CONFIGURE,
175
172
            'make',
176
173
            'make install DESTDIR=`pwd`/D',
177
 
            ],
178
 
        environment=MINGW_ENVIRONMENT,
179
 
        outputs=['D/usr/local/*'])
 
174
            '$$MINGW_HOST-strip -x D/usr/local/bin/*.dll', # FIXME
 
175
            ],
 
176
        outputs=['D/usr/local/*'])
 
177
 
 
178
# -----------------------------------------------------------------
 
179
# libgomp (needed by gettext's msgmerge on OS X)
 
180
# -----------------------------------------------------------------
 
181
 
 
182
# Apple's GCC 4.2 Preview 1 has broken OpenMP installation:
 
183
#   1) omp.h header is not installed in SDKs
 
184
#   2) libgomp.a included in 10.4u SDK is built for 10.5 and depends on
 
185
#      newly added symbols
 
186
# Because of this, we have to build our own copy if GOMP if we want to
 
187
# take advantage of OpenMP on OSX 10.4.
 
188
 
 
189
src_libgomp = env.ComponentSources(
 
190
        name='libgomp',
 
191
        source=LIBGOMP_URL,
 
192
        patches=LIBGOMP_PATCHES,
 
193
        post_commands=[
 
194
            'mkdir .junk',
 
195
            'mv * .junk',
 
196
            'mkdir -p gcc/doc',
 
197
            'mv .junk/gcc/doc/include gcc/doc',
 
198
            'mv .junk/libgomp .',
 
199
            'mv `find .junk -maxdepth 1 -type f` .',
 
200
            'rm -rf .junk',
 
201
        ])
 
202
 
 
203
libgomp_osx_ppc = env.BuildComponent(
 
204
        name='libgomp-osx-ppc',
 
205
        agent='osx10.5',
 
206
        sources=src_libgomp,
 
207
        deps=None,
 
208
        commands=[
 
209
            'mkdir libgomp/build',
 
210
            'cd libgomp/build',
 
211
            '../configure --host=$OSX_HOST_PPC CC=$$OSX_CC_42 --prefix=/usr/local %s' % LIBGOMP_CONFIGURE,
 
212
            'make',
 
213
            'make install DESTDIR=`pwd`/../../D',
 
214
            'mkdir ../../D/usr/local/include',
 
215
            'cp omp.h ../../D/usr/local/include',
 
216
            ],
 
217
        environment=OSX_ENVIRONMENT_PPC,
 
218
        outputs=['D/usr/local/*'])
 
219
 
 
220
libgomp_osx_x86 = env.BuildComponent(
 
221
        name='libgomp-osx-x86',
 
222
        agent='osx10.5',
 
223
        sources=src_libgomp,
 
224
        deps=None,
 
225
        commands=[
 
226
            'mkdir libgomp/build',
 
227
            'cd libgomp/build',
 
228
            '../configure --host=$OSX_HOST_X86 CC=$$OSX_CC_42 --prefix=/usr/local %s' % LIBGOMP_CONFIGURE,
 
229
            'make',
 
230
            'make install DESTDIR=`pwd`/../../D',
 
231
            'mkdir ../../D/usr/local/include',
 
232
            'cp omp.h ../../D/usr/local/include',
 
233
            ],
 
234
        environment=OSX_ENVIRONMENT_X86,
 
235
        outputs=['D/usr/local/*'])
 
236
 
 
237
libgomp_osx = env.Alias('build-libgomp-osx', [libgomp_osx_ppc, libgomp_osx_x86])
 
238
 
180
239
 
181
240
# -----------------------------------------------------------------
182
241
# GNU gettext
184
243
 
185
244
src_gettext = env.ComponentSources(
186
245
        name='gettext',
187
 
        source=GETTEXT_URL,
188
 
        patches=GETTEXT_PATCHES)
 
246
        source=GETTEXT_URL)
189
247
 
190
248
gettext_osx_ppc = env.BuildComponent(
191
249
        name='gettext-osx-ppc',
192
 
        agent='osx',
 
250
        agent='osx10.5',
193
251
        sources=src_gettext,
194
 
        deps=None,
 
252
        deps=[(libgomp_osx_ppc, 'libgomp')],
195
253
        commands=[
196
 
            './configure --host=$OSX_HOST_PPC --with-libiconv-prefix=$OSX_SDKROOT/usr %s' % GETTEXT_CONFIGURE,
 
254
            './configure --host=$OSX_HOST_PPC'
 
255
            '       --with-libiconv-prefix=$OSX_SDKROOT/usr %s'
 
256
            '       CC=$$OSX_CC_42 CXX=$$OSX_CXX_42'
 
257
            '       CPPFLAGS="-I`pwd`/libgomp/include $$CPPFLAGS"'
 
258
            '       LDFLAGS="-L`pwd`/libgomp/lib $$LDFLAGS"' % GETTEXT_CONFIGURE,
197
259
            'make',
198
 
            'make install DESTDIR=`pwd`/D',
 
260
            'make install DESTDIR=`pwd`/D -j1',
199
261
            ],
200
262
        environment=OSX_ENVIRONMENT_PPC,
201
 
        outputs=['D/usr/local/bin/*'])
 
263
        outputs=['D/usr/local/*'])
202
264
 
203
265
gettext_osx_x86 = env.BuildComponent(
204
266
        name='gettext-osx-x86',
205
 
        agent='osx',
 
267
        agent='osx10.5',
206
268
        sources=src_gettext,
207
 
        deps=None,
 
269
        deps=[(libgomp_osx_x86, 'libgomp')],
208
270
        commands=[
209
 
            './configure --host=$OSX_HOST_X86 --with-libiconv-prefix=$OSX_SDKROOT/usr %s' % GETTEXT_CONFIGURE,
 
271
            './configure --host=$OSX_HOST_X86'
 
272
            '       --with-libiconv-prefix=$OSX_SDKROOT/usr %s'
 
273
            '       CC=$$OSX_CC_42 CXX=$$OSX_CXX_42'
 
274
            '       CPPFLAGS="-I`pwd`/libgomp/include $$CPPFLAGS"'
 
275
            '       LDFLAGS="-L`pwd`/libgomp/lib $$LDFLAGS"' % GETTEXT_CONFIGURE,
210
276
            'make',
211
 
            'make install DESTDIR=`pwd`/D',
 
277
            'make install DESTDIR=`pwd`/D -j1',
212
278
            ],
213
279
        environment=OSX_ENVIRONMENT_X86,
214
 
        outputs=['D/usr/local/bin/*'])
 
280
        outputs=['D/usr/local/*'])
215
281
 
216
282
gettext_osx = env.BuildComponent(
217
283
        name='gettext-osx',
219
285
        sources=[],
220
286
        deps=[(gettext_osx_ppc, 'ppc'), (gettext_osx_x86, 'x86')],
221
287
        commands=[
222
 
            'mkdir univ',
223
 
            'for i in %s ; do lipo -arch ppc ppc/$$i -arch i386 x86/$$i -create -output univ/$$i; done' % ' '.join(GETTEXT_BINARIES)
 
288
            'mkdir -p univ/bin univ/lib',
 
289
            'for i in %s ; do lipo -arch ppc ppc/bin/$$i -arch i386 x86/bin/$$i -create -output univ/bin/$$i; done' % ' '.join(GETTEXT_BINARIES),
 
290
            'for i in ppc/lib/*.dylib ; do lipo -arch ppc ppc/lib/`basename $$i` -arch i386 x86/lib/`basename $$i` -create -output univ/lib/`basename $$i`; done',
 
291
            # FIXME: save dSYM info?
 
292
            'strip -u -r univ/bin/*',
 
293
            'strip -x univ/lib/*.dylib',
224
294
            ],
225
295
        environment=OSX_ENVIRONMENT_COMMON,
226
296
        outputs=['univ/*'])
231
301
        sources=src_gettext,
232
302
        deps=[(libiconv_win32, 'libiconv')],
233
303
        commands=[
234
 
            './configure --host=$MINGW_HOST --with-libiconv-prefix=`pwd`/libiconv %s' % GETTEXT_CONFIGURE,
 
304
            './configure --host=$$MINGW_HOST --with-libiconv-prefix=`pwd`/libiconv --enable-threads=win32 %s CC=$$MINGW_CC_42 CXX=$$MINGW_CXX_42' % GETTEXT_CONFIGURE,
235
305
            'make',
236
306
            'make install-strip DESTDIR=`pwd`/D',
237
 
            'cp COPYING `pwd`/D/usr/local/bin',
 
307
            'cp libiconv/bin/*.dll D/usr/local/bin',
 
308
            '$$MINGW_HOST-strip -x D/usr/local/bin/*.dll', # FIXME
 
309
            'cp COPYING D/usr/local/bin',
 
310
            'cp $$MINGW_DIR/bin/mingwm10.dll D/usr/local/bin',
 
311
            'cp $$MINGW_DIR/bin/pthreadGC2.dll D/usr/local/bin',
238
312
            ],
239
 
        environment=MINGW_ENVIRONMENT,
240
313
        outputs=['D/usr/local/bin/*'])
241
314
 
242
315
 
403
476
            'mv src/poedit src/poedit-x86',
404
477
            'lipo -arch ppc ../ppc/src/poedit -arch i386 src/poedit-x86 -create -output src/poedit',
405
478
            # finally, create the bundle:
406
 
            'GETTEXT_BINARIES="`pwd`/../deps/gettext" WX_ROOT="`pwd`/deps" make dist-osx',
 
479
            'GETTEXT_PREFIX="`pwd`/../deps/gettext" WX_ROOT="`pwd`/deps" make dist-osx',
407
480
            ],
408
481
        environment=OSX_ENVIRONMENT_COMMON,
409
482
        outputs=['x86/poedit-*.dmg', 'x86/src/*dSYM*'])