# Path: tt/distutils.py
# def get_extra_fflags():
#     fflags = []
#     fcompiler = customized_fcompiler()
#     if fcompiler.compiler_type in ('g95', 'gnu', 'gnu95'):
#         if fcompiler.get_version() >= '11':
#             fflags.append('-fallow-argument-mismatch')
#     return fflags


from numpy.distutils.misc_util import Configuration
from os.path import join
from tt.distutils import get_extra_fflags

TTEIGB_SRC = [
    'ttals.f90',
    'tt_eigb.f90',
]


def configuration(parent_package='', top_path=None):
    tteigb_src = [join(TTFORT_DIR, x) for x in TTEIGB_SRC]
    tteigb_src.append('tt_eigb.pyf')

    config = Configuration('eigb', parent_package, top_path)
    config.add_library(
        'primme',
        sources=[join(PRIMME_DIR, '*.c')] + [join(PRIMME_DIR, '*.f')],
        include_dirs=['.'],
    )
    config.add_extension(
        'tt_eigb',
        sources=tteigb_src,
        depends=[
            'primme',
            'mytt',
            'print_lib',
        ],
        libraries=[
            'primme',
            'mytt',
            'print_lib',
        ],

# Path: tt/distutils.py
# def get_extra_fflags():
#     fflags = []
#     fcompiler = customized_fcompiler()
#     if fcompiler.compiler_type in ('g95', 'gnu', 'gnu95'):
#         if fcompiler.get_version() >= '11':
#             fflags.append('-fallow-argument-mismatch')
#     return fflags


# Path: tt/eigb/setup.py
from numpy.distutils.misc_util import Configuration
from os.path import join
from tt.distutils import get_extra_fflags


TTEIGB_SRC = [
    'ttals.f90',
    'tt_eigb.f90',
]


def configuration(parent_package='', top_path=None):
    tteigb_src = [join(TTFORT_DIR, x) for x in TTEIGB_SRC]
    tteigb_src.append('tt_eigb.pyf')

    config = Configuration('eigb', parent_package, top_path)
    config.add_library(
        'primme',
        sources=[join(PRIMME_DIR, '*.c')] + [join(PRIMME_DIR, '*.f')],
        include_dirs=['.'],
    )
    config.add_extension(
        'tt_eigb',
        sources=tteigb_src,
        depends=[
            'primme',
            'mytt',
            'print_lib',
        ],
        libraries=[
            'primme',
            'mytt',
            'print_lib',
        ],

        extra_f90_compile_args=get_extra_fflags(),