Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,31 @@ if host_machine.system() == 'darwin'
endif
endif

pari_prefix = get_option('pari-prefix')
if pari_prefix != ''
pari_header_include_dirs += include_directories(pari_prefix + '/include')
pari_libpath = pari_prefix + '/lib'
pari_lib_dirs += [pari_libpath]
endif


# Explicitly check for header to give better error message (using -v to show search paths)
cc.has_header(
'pari/pari.h',
required: true,
args: ['-v'],
include_directories: pari_header_include_dirs,
)
pari = cc.find_library(
lpari = cc.find_library(
'pari',
has_headers: ['pari/pari.h'],
required: true,
dirs: pari_lib_dirs,
header_include_directories: pari_header_include_dirs,
)
pari = declare_dependency(include_directories: pari_header_include_dirs,
dependencies: [pari, gmp])
link_args: '-Wl,-rpath=' + pari_libpath + ' -L' + pari_libpath + ' -lpari',
dependencies: [lpari, gmp])

# Get PARI version (mostly as smoke test)
pari_version_code = '''
Expand All @@ -85,9 +94,11 @@ int main(void) {
return 0;
}
'''

pari_version = cc.run(
pari_version_code,
args: ['-v'],
args: ['-Wl,-rpath=' + pari_libpath + ' -L' + pari_libpath ],
# args: ['-v'],
name: 'pari version',
dependencies: [pari],
required: true,
Expand Down
9 changes: 9 additions & 0 deletions meson.options
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Options for the Meson build system
# https://mesonbuild.com/Build-options.html

option(
'pari-prefix',
type: 'string',
value: '',
description: 'Path to a custom installation of pari-gp'
)
Loading