~yolanda.robla/ubuntu/trusty/nodejs/add_distribution

« back to all changes in this revision

Viewing changes to tools/wafadmin/Tools/xlc.py

  • Committer: Package Import Robot
  • Author(s): Jérémy Lal
  • Date: 2013-08-14 00:16:46 UTC
  • mfrom: (7.1.40 sid)
  • Revision ID: package-import@ubuntu.com-20130814001646-bzlysfh8sd6mukbo
Tags: 0.10.15~dfsg1-4
* Update 2005 patch, adding a handful of tests that can fail on
  slow platforms.
* Add 1004 patch to fix test failures when writing NaN to buffer
  on mipsel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python
2
 
# encoding: utf-8
3
 
# Thomas Nagy, 2006-2008 (ita)
4
 
# Ralf Habacker, 2006 (rh)
5
 
# Yinon Ehrlich, 2009
6
 
# Michael Kuhn, 2009
7
 
 
8
 
import os, sys
9
 
import Configure, Options, Utils
10
 
import ccroot, ar
11
 
from Configure import conftest
12
 
 
13
 
@conftest
14
 
def find_xlc(conf):
15
 
        cc = conf.find_program(['xlc_r', 'xlc'], var='CC', mandatory=True)
16
 
        cc = conf.cmd_to_list(cc)
17
 
        conf.env.CC_NAME = 'xlc'
18
 
        conf.env.CC      = cc
19
 
 
20
 
@conftest
21
 
def find_cpp(conf):
22
 
        v = conf.env
23
 
        cpp = None
24
 
        if v['CPP']: cpp = v['CPP']
25
 
        elif 'CPP' in conf.environ: cpp = conf.environ['CPP']
26
 
        if not cpp: cpp = v['CC']
27
 
        v['CPP'] = cpp
28
 
 
29
 
@conftest
30
 
def xlc_common_flags(conf):
31
 
        v = conf.env
32
 
 
33
 
        # CPPFLAGS CCDEFINES _CCINCFLAGS _CCDEFFLAGS
34
 
        v['CCFLAGS_DEBUG'] = ['-g']
35
 
        v['CCFLAGS_RELEASE'] = ['-O2']
36
 
 
37
 
        v['CC_SRC_F']            = ''
38
 
        v['CC_TGT_F']            = ['-c', '-o', ''] # shell hack for -MD
39
 
        v['CPPPATH_ST']          = '-I%s' # template for adding include paths
40
 
 
41
 
        # linker
42
 
        if not v['LINK_CC']: v['LINK_CC'] = v['CC']
43
 
        v['CCLNK_SRC_F']         = ''
44
 
        v['CCLNK_TGT_F']         = ['-o', ''] # shell hack for -MD
45
 
 
46
 
        v['LIB_ST']              = '-l%s' # template for adding libs
47
 
        v['LIBPATH_ST']          = '-L%s' # template for adding libpaths
48
 
        v['STATICLIB_ST']        = '-l%s'
49
 
        v['STATICLIBPATH_ST']    = '-L%s'
50
 
        v['RPATH_ST']            = '-Wl,-rpath,%s'
51
 
        v['CCDEFINES_ST']        = '-D%s'
52
 
 
53
 
        v['SONAME_ST']           = ''
54
 
        v['SHLIB_MARKER']        = ''
55
 
        v['STATICLIB_MARKER']    = ''
56
 
        v['FULLSTATIC_MARKER']   = '-static'
57
 
 
58
 
        # program
59
 
        v['program_LINKFLAGS']   = ['-Wl,-brtl']
60
 
        v['program_PATTERN']     = '%s'
61
 
 
62
 
        # shared library
63
 
        v['shlib_CCFLAGS']       = ['-fPIC', '-DPIC'] # avoid using -DPIC, -fPIC aleady defines the __PIC__ macro
64
 
        v['shlib_LINKFLAGS']     = ['-G', '-Wl,-brtl,-bexpfull']
65
 
        v['shlib_PATTERN']       = 'lib%s.so'
66
 
 
67
 
        # static lib
68
 
        v['staticlib_LINKFLAGS'] = ''
69
 
        v['staticlib_PATTERN']   = 'lib%s.a'
70
 
 
71
 
def detect(conf):
72
 
        conf.find_xlc()
73
 
        conf.find_cpp()
74
 
        conf.find_ar()
75
 
        conf.xlc_common_flags()
76
 
        conf.cc_load_tools()
77
 
        conf.cc_add_flags()