2011-09-10 11:13:51 +02:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# encoding: utf-8
|
2018-01-01 20:53:49 +01:00
|
|
|
# Thomas Nagy, 2006-2018 (ita)
|
2011-09-10 11:13:51 +02:00
|
|
|
# Ralf Habacker, 2006 (rh)
|
|
|
|
# Yinon Ehrlich, 2009
|
|
|
|
# Michael Kuhn, 2009
|
|
|
|
|
|
|
|
from waflib.Tools import ccroot, ar
|
|
|
|
from waflib.Configure import conf
|
|
|
|
|
|
|
|
@conf
|
|
|
|
def find_xlc(conf):
|
|
|
|
"""
|
2016-06-25 23:54:12 +02:00
|
|
|
Detects the Aix C compiler
|
2011-09-10 11:13:51 +02:00
|
|
|
"""
|
|
|
|
cc = conf.find_program(['xlc_r', 'xlc'], var='CC')
|
|
|
|
conf.get_xlc_version(cc)
|
|
|
|
conf.env.CC_NAME = 'xlc'
|
|
|
|
|
|
|
|
@conf
|
|
|
|
def xlc_common_flags(conf):
|
|
|
|
"""
|
|
|
|
Flags required for executing the Aix C compiler
|
|
|
|
"""
|
|
|
|
v = conf.env
|
|
|
|
|
2016-06-25 23:54:12 +02:00
|
|
|
v.CC_SRC_F = []
|
|
|
|
v.CC_TGT_F = ['-c', '-o']
|
2011-09-10 11:13:51 +02:00
|
|
|
|
2016-06-25 23:54:12 +02:00
|
|
|
if not v.LINK_CC:
|
|
|
|
v.LINK_CC = v.CC
|
2011-09-10 11:13:51 +02:00
|
|
|
|
2016-06-25 23:54:12 +02:00
|
|
|
v.CCLNK_SRC_F = []
|
|
|
|
v.CCLNK_TGT_F = ['-o']
|
|
|
|
v.CPPPATH_ST = '-I%s'
|
|
|
|
v.DEFINES_ST = '-D%s'
|
2011-09-10 11:13:51 +02:00
|
|
|
|
2016-06-25 23:54:12 +02:00
|
|
|
v.LIB_ST = '-l%s' # template for adding libs
|
|
|
|
v.LIBPATH_ST = '-L%s' # template for adding libpaths
|
|
|
|
v.STLIB_ST = '-l%s'
|
|
|
|
v.STLIBPATH_ST = '-L%s'
|
|
|
|
v.RPATH_ST = '-Wl,-rpath,%s'
|
2011-09-10 11:13:51 +02:00
|
|
|
|
2016-06-25 23:54:12 +02:00
|
|
|
v.SONAME_ST = []
|
|
|
|
v.SHLIB_MARKER = []
|
|
|
|
v.STLIB_MARKER = []
|
2011-09-10 11:13:51 +02:00
|
|
|
|
2016-06-25 23:54:12 +02:00
|
|
|
v.LINKFLAGS_cprogram = ['-Wl,-brtl']
|
|
|
|
v.cprogram_PATTERN = '%s'
|
2011-09-10 11:13:51 +02:00
|
|
|
|
2016-06-25 23:54:12 +02:00
|
|
|
v.CFLAGS_cshlib = ['-fPIC']
|
|
|
|
v.LINKFLAGS_cshlib = ['-G', '-Wl,-brtl,-bexpfull']
|
|
|
|
v.cshlib_PATTERN = 'lib%s.so'
|
|
|
|
|
|
|
|
v.LINKFLAGS_cstlib = []
|
|
|
|
v.cstlib_PATTERN = 'lib%s.a'
|
2011-09-10 11:13:51 +02:00
|
|
|
|
|
|
|
def configure(conf):
|
|
|
|
conf.find_xlc()
|
|
|
|
conf.find_ar()
|
|
|
|
conf.xlc_common_flags()
|
|
|
|
conf.cc_load_tools()
|
|
|
|
conf.cc_add_flags()
|
|
|
|
conf.link_add_flags()
|
|
|
|
|