Permalink
Browse files

ENH: set fortran mangling cpp macros.

  • Loading branch information...
1 parent 79f6688 commit 59cc35005175b24479c5a0047bd74d55485316a5 @cournape cournape committed Aug 26, 2011
Showing with 32 additions and 0 deletions.
  1. +32 −0 bscript
View
32 bscript
@@ -118,6 +118,38 @@ def pre_configure(context):
conf.check_fortran_verbose_flag()
conf.check_fortran_clib()
+ 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 = []
+
+ if du == '_':
+ env['F77_UNDERSCORE_G77'] = 1
+ macros.append('F77_UNDERSCORE_G77')
+ if f2pycompat:
+ macros.append('UNDERSCORE_G77')
+ else:
+ env['F77_UNDERSCORE_G77'] = 0
+
+ if u == '_':
+ env['F77_NO_APPEND_FORTRAN'] = 0
+ else:
+ env['F77_NO_APPEND_FORTRAN'] = 1
+ macros.append('F77_NO_APPEND_FORTRAN')
+ if f2pycompat:
+ macros.append('NO_APPEND_FORTRAN')
+
+ if case == 'upper':
+ env['F77_UPPERCASE_FORTRAN'] = 1
+ macros.append('F77_UPPERCASE_FORTRAN')
+ if f2pycompat:
+ macros.append('UPPERCASE_FORTRAN')
+ else:
+ env['F77_UPPERCASE_FORTRAN'] = 0
+
+ env.DEFINES.extend(macros)
def remove_flag(name, flag):
while True:

0 comments on commit 59cc350

Please sign in to comment.