~ubuntu-branches/ubuntu/quantal/sunpinyin/quantal

« back to all changes in this revision

Viewing changes to SConstruct

  • Committer: Bazaar Package Importer
  • Author(s): Liang Guo
  • Date: 2011-03-15 00:20:57 UTC
  • mfrom: (1.1.2 upstream) (1.2.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110315002057-k8qf3ybnqtuaf0u1
Tags: 2.0.3-2
* Build with prefix=$(DEB_DESTDIR)/usr (Close: #617752)
* Fix FTBFS on SH (Close: #617753)
* Fix FTBFS on MIPSEL.

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
           'src/pinyin/pinyin_seg.cpp',
46
46
           'src/pinyin/shuangpin_data.cpp',
47
47
           'src/pinyin/shuangpin_seg.cpp',
 
48
           'src/pinyin/hunpin_seg.cpp',
48
49
           'src/ime-core/imi_context.cpp',
49
50
           'src/ime-core/imi_data.cpp',
50
51
           'src/ime-core/lattice_states.cpp',
100
101
         'src/pinyin/pinyin_data.h',
101
102
         'src/pinyin/syllable.h',
102
103
         'src/pinyin/shuangpin_data.h',
 
104
         'src/pinyin/hunpin_seg.h',
103
105
         'src/pinyin/datrie_impl.h',
104
106
         'src/sunpinyin.h']
105
107
 
152
154
                       TAR=tar, MAKE=make, WGET=wget,
153
155
                       CPPPATH=['.'] + allinc())
154
156
 
 
157
def PassVariables(envvar, env):
 
158
    for (x, y) in envvar:
 
159
        if x in os.environ:
 
160
            print 'Warning: you\'ve set %s in the environmental variable!' % x
 
161
            env[y] = os.environ[x]
 
162
    
155
163
env = CreateEnvironment()
156
164
opts.Update(env)
157
165
 
172
180
libdatadir = env['LIBDATADIR'] + '/sunpinyin/data'
173
181
headersdir = env['PREFIX'] + '/include/sunpinyin-2.0'
174
182
 
175
 
if GetOS() != 'Darwin':
176
 
    env.Append(LINKFLAGS=['-Wl,-soname=libsunpinyin.so.%d' % abi_major])
177
 
 
178
 
if GetOption('rpath') is not None and GetOS() != 'Darwin':
179
 
    env.Append(LINKFLAGS='-Wl,-R -Wl,%s' % GetOption('rpath'))
180
 
 
181
 
if 'CC' in os.environ:
182
 
    print 'Warning: you\'ve set %s as C compiler' % os.environ['CC']
183
 
    env['CC']=os.environ['CC']
184
 
    
185
 
if 'CXX' in os.environ:
186
 
    print 'Warning: you\'ve set %s as C++ compiler' % os.environ['CXX']
187
 
    env['CXX']=os.environ['CXX']
188
 
 
189
 
if 'TAR' in os.environ:
190
 
    print 'Warning: you\'ve set %s as tar' % os.environ['TAR']
191
 
    env['TAR'] = os.environ['TAR']
192
 
 
193
 
if 'MAKE' in os.environ:
194
 
    print 'Warning: you\'ve set %s as make' % os.environ['MAKE']
195
 
    env['MAKE'] = os.environ['MAKE']
196
 
 
197
 
if 'WGET' in os.environ:
198
 
    print 'Warning: you\'ve set %s as wget' % os.environ['WGET']
199
 
    env['WGET'] = os.environ['WGET']
200
 
 
 
183
# pass through environmental variables
 
184
envvar = [('CC', 'CC'),
 
185
          ('CXX', 'CXX'),
 
186
          ('CFLAGS', 'CFLAGS'),
 
187
          ('CXXFLAGS', 'CXXFLAGS'),
 
188
          ('LDFLAGS', 'LINKFLAGS'),
 
189
          ('TAR', 'TAR'),
 
190
          ('MAKE', 'MAKE'),
 
191
          ('WGET', 'WGET')]
 
192
PassVariables(envvar, env)
201
193
 
202
194
# append critical cflags
203
195
extra_cflags=' -DHAVE_CONFIG_H -DSUNPINYIN_DATA_DIR=\'"%s"\'' % libdatadir
204
196
env.Append(CFLAGS=extra_cflags)
205
197
env.Append(CXXFLAGS=extra_cflags)
206
198
 
 
199
if GetOS() != 'Darwin':
 
200
    env.Append(LINKFLAGS=['-Wl,-soname=libsunpinyin.so.%d' % abi_major])
 
201
 
 
202
if GetOption('rpath') is not None and GetOS() != 'Darwin':
 
203
    env.Append(LINKFLAGS=['-Wl,-R', '-Wl,%s' % GetOption('rpath')])
 
204
 
207
205
#
208
206
#==============================configure================================
209
207
#
232
230
  || defined(_POWER)   || defined(__powerpc__) \
233
231
  || defined(__ppc__)  || defined(__hpux) || defined(__hppa) \
234
232
  || defined(_MIPSEB)  || defined(_POWER) \
235
 
  || defined(__s390__)
 
233
  || defined(__s390__) || (defined(__sh__) && defined(__BIG_ENDIAN__)) 
236
234
# define WORDS_BIGENDIAN 1
237
235
 
238
236
#elif defined(__i386__) || defined(__i386) \
242
240
  || defined(__amd64__) || defined(_M_AMD64) \
243
241
  || defined(__x86_64)  || defined(__x86_64__) \
244
242
  || defined(_M_X64)    || defined(__bfin__) \
245
 
  || defined(__alpha__) || defined(__ARMEL__)
 
243
  || defined(__alpha__) || defined(__ARMEL__) \
 
244
  || defined(_MIPSEL)   || (defined(__sh__) && defined(__LITTLE_ENDIAN__)) 
246
245
# undef WORDS_BIGENDIAN
247
246
 
248
247
#else