easyblock = 'ConfigureMake'

name = 'jemalloc'
version = '5.0.1'

homepage = 'http://www.canonware.com/jemalloc'
description = """jemalloc is a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and
 scalable concurrency support."""

toolchain = {'name': 'GCCcore', 'version': '6.4.0'}

source_urls = ['https://github.com/jemalloc/jemalloc/archive']
sources = ['%(version)s.tar.gz']
checksums = ['5de6dcb50de04b14bae9340d23515390925fcaa7637341707239d09a3ea07a23']

builddependencies = [
    ('Autotools', '20170619'),
    ('binutils', '2.28'),
]

preconfigopts = "./autogen.sh && "
prebuildopts = "make dist && "

sanity_check_paths = {
    'files': ['bin/jeprof', 'lib/libjemalloc.a', 'lib/libjemalloc_pic.a', 'lib/libjemalloc.%s' % SHLIB_EXT,
              'include/jemalloc/jemalloc.h'],
    'dirs': ['share'],
}

modextrapaths = {'LD_PRELOAD': ['lib/libjemalloc.%s' % SHLIB_EXT]}

moduleclass = 'lib'
