Permalink
Browse files

REF: remove obsolete workarounds in bscript.

  • Loading branch information...
1 parent 1600044 commit de4d4b3ec326d90a27ece3f45ff34381ff9d560a @cournape cournape committed Apr 19, 2012
Showing with 30 additions and 72 deletions.
  1. +30 −72 bscript
View
102 bscript
@@ -53,7 +53,8 @@ def c_template(self, node):
if "fc" in self.features:
self.source.append(output)
else:
- raise ValueError("FTemplateTask without feature 'fc': %r" % node)
+ raise ValueError("FTemplateTask without feature 'fc' (node: %r)?" %
+ (node,))
elif ext in ["c"]:
tsk = self.create_task('CTemplateTask', node, output)
if "c" in self.features:
@@ -89,51 +90,6 @@ def process_write_config(self):
tsk.set_outputs(output)
return tsk
-@hooks.pre_configure
-def pre_configure(context):
- opts = context.waf_options_context
- conf = context.waf_context
-
- opts.load("compiler_cxx")
- opts.load("compiler_fc")
- opts.load("f2py")
- Options.options.check_fc = "gfortran"
- Options.options.check_cxx_compiler = "g++"
- if sys.platform == "win32" and conf.env.CC_NAME == "msvc":
- Options.options.check_fc = "ifort"
- Options.options.check_cxx_compiler = "msvc"
-
- conf.load("compiler_cxx")
- conf.load("compiler_fc")
- conf.load("f2py")
-
- if conf.env.CC_NAME == 'gcc':
- conf.env.append_value('CFLAGS_PYEXT', "-Wfatal-errors")
- conf.env.append_value('CXXFLAGS_PYEXT', "-Wfatal-errors")
-
- if sys.platform == "darwin":
- conf.env.stash()
- # FIXME: fix upstream waf tool to work on mac os X
- for flag in [conf.env.CFLAGS_PYEXT, conf.env.LINKFLAGS_PYEXT,
- conf.env.CXXFLAGS_PYEXT, conf.env.FCFLAGS]:
- remove_flag_prevalue("ppc", flag)
- try:
- conf.env.append_value('FCFLAGS', ['-arch', 'i386'])
- conf.env.append_value('CFLAGS', ['-arch', 'i386'])
- conf.check_fortran()
- except waflib.Errors.ConfigurationError:
- # vanilla gcc (like the one provided by macports) does not
- # support the -arch flag.
- conf.env.revert()
-
- conf.env["MACOSX_DEPLOYMENT_TARGET"] = "10.4"
-
- conf.check_fortran_verbose_flag()
- conf.check_fortran_clib()
- conf.check_fortran_dummy_main()
- u, du, c = conf.check_fortran_mangling()
- _set_mangling_var(conf, u, du, c)
-
def _set_mangling_var(conf, u, du, case, f2pycompat=True):
env = conf.env
macros = []
@@ -164,36 +120,38 @@ def _set_mangling_var(conf, u, du, case, f2pycompat=True):
env.DEFINES.extend(macros)
-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.post_configure
def post_configure(context):
+ opts = context.waf_options_context
conf = context.waf_context
+ opts.load("compiler_cxx")
+ opts.load("ordered_c")
+ opts.load("compiler_fc")
+ opts.load("f2py")
+ Options.options.check_fc = "gfortran"
+ Options.options.check_cxx_compiler = "g++"
+ if sys.platform == "win32" and conf.env.CC_NAME == "msvc":
+ Options.options.check_fc = "ifort"
+ Options.options.check_cxx_compiler = "msvc"
+
+ conf.load("compiler_cxx")
+ conf.load("compiler_fc")
+ conf.load("f2py")
+
+ if conf.env.CC_NAME == 'gcc':
+ conf.env.append_value('CFLAGS_PYEXT', "-Wfatal-errors")
+ conf.env.append_value('CXXFLAGS_PYEXT', "-Wfatal-errors")
+
+ if sys.platform == "darwin":
+ conf.env["MACOSX_DEPLOYMENT_TARGET"] = "10.4"
+
+ conf.check_fortran_verbose_flag()
+ conf.check_fortran_clib()
+ conf.check_fortran_dummy_main()
+ u, du, c = conf.check_fortran_mangling()
+ _set_mangling_var(conf, u, du, c)
+
conf.env.INCLUDES = get_numpy_include_dirs()
conf.env.HAS_FBLAS = False

0 comments on commit de4d4b3

Please sign in to comment.