Skip to content

Commit

Permalink
HACK: temporary deal with bugs in waf python tool.
Browse files Browse the repository at this point in the history
  • Loading branch information
cournape committed Aug 28, 2011
1 parent 07cf7f4 commit de71afe
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions bscript
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,32 @@ def check_blas_lapack(conf):
#conf.env.HAS_LAPACK = True
#conf.env.LIB_LAPACK = ["lapack", "f77blas", "cblas", "atlas"]

def remove_flag(name, flag):
while True:
if name in flag:
i = flag.index(name)
flag.pop(i)
else:
break

def remove_flag_postvalue(name, flag):
while True:
if name in flag:
i = flag.index(name)
flag.pop(i)
flag.pop(i)
else:
break

def remove_flag_prevalue(name, flag):
while True:
if name in flag:
i = flag.index(name)
flag.pop(i-1)
flag.pop(i-1)
else:
break

@hooks.pre_configure()
def pre_configure(context):
conf = context.waf_context
Expand All @@ -56,6 +82,16 @@ def pre_configure(context):
# FIXME: fix upstream waf tool to work on mac os X
conf.env.CC = ["/usr/bin/gcc-4.0"]
conf.env.LINK_CC = ["/usr/bin/gcc-4.0"]
# FIXME: fix upstream waf tool to avoid linking against libpython2.6.so
# (cause crashes when importing the extension)
name = "python%s" % ".".join([str(i) for i in sys.version_info[:2]])
remove_flag(name, conf.env.LIB_PYEXT)
remove_flag("-dynamiclib", conf.env.LINKFLAGS_cshlib)
remove_flag_postvalue("-compatibility_version", conf.env.CFLAGS_cshlib)
remove_flag_postvalue("-current_version", conf.env.CFLAGS_cshlib)
remove_flag_prevalue("ppc", conf.env.CFLAGS_PYEXT)
remove_flag_prevalue("ppc", conf.env.LINKFLAGS_PYEXT)
conf.env.LINKFLAGS_cshlib.extend(["-undefined", "dynamic_lookup", "-bundle"])

conf.env.CFLAGS_PYEXT.append("-Wfatal-errors")
check_blas_lapack(conf)
Expand Down

0 comments on commit de71afe

Please sign in to comment.