Skip to content

Commit

Permalink
minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
p01arst0rm committed Oct 24, 2019
1 parent 086a81b commit f6f7046
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 29 deletions.
67 changes: 39 additions & 28 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -132,27 +132,6 @@ config_h.set(
description : 'platform identifier (`cpu-os`)')


# Check whether the store optimiser can optimise symlinks.
#-------------------------------------------------
gen_header = '''
ln -s bla tmp_link
if ln tmp_link tmp_link2 2> /dev/null; then
echo 1
else
echo 0
fi
'''


run_command('sh', '-c', 'rm tmp_link*')
can_link_symlink = run_command('sh', '-c', gen_header).stdout().strip()
if can_link_symlink.to_int() == 1
run_command('sh', '-c', 'rm tmp_link*')
endif

config_h.set('CAN_LINK_SYMLINK', can_link_symlink,
description : 'Whether link() works on symlinks')



# checking headers
Expand Down Expand Up @@ -335,6 +314,9 @@ endif
# look for required programs
#--------------------------------------------------
cat = find_program('cat', required : true)
ln = find_program('ln', required : true)
cp = find_program('cp', required : true)
rm = find_program('rm', required : true)
bash = find_program('bash', required : true)
echo = find_program('echo', required : true)
patch = find_program('patch', required : true)
Expand All @@ -352,6 +334,27 @@ tr = find_program('tr', required : true)
coreutils = run_command('dirname', cat.path()).stdout().strip()


# Check whether the store optimiser can optimise symlinks.
#-------------------------------------------------
gen_header = '''
ln -s bla tmp_link
if ln tmp_link tmp_link2 2> /dev/null; then
echo 1
else
echo 0
fi
'''

run_command('sh', '-c', 'rm tmp_link*')
can_link_symlink = run_command('sh', '-c', gen_header).stdout().strip()
if can_link_symlink.to_int() == 1
run_command('sh', '-c', 'rm tmp_link*')
endif

config_h.set('CAN_LINK_SYMLINK', can_link_symlink,
description : 'Whether link() works on symlinks')


# Look for boost, a required dependency.
#--------------------------------------------------
boost_dep = declare_dependency(
Expand Down Expand Up @@ -468,14 +471,15 @@ endif
if (get_option('with_gc'))
gc_dep = declare_dependency(
dependencies : dependency('bdw-gc'),
link_args : get_option('sodium_link_args'))
link_args : get_option('gc_link_args'))
config_h.set(
'HAVE_BOEHMGC', 1,
description : 'Whether to use the Boehm garbage collector.')
else
gc_dep = declare_dependency()
endif


# Look for aws-cpp-sdk-s3.
#--------------------------------------------------
if (get_option('with_s3'))
Expand Down Expand Up @@ -533,9 +537,16 @@ install_headers(

src_inc = [include_directories('.', 'src')]

subdir('src')
subdir('scripts')
subdir('corepkgs')
subdir('misc')
subdir('doc')
subdir('tests')
project_dirs = [
'src',
'scripts',
'corepkgs',
'misc',
'doc',
'tests'
]


foreach dir : project_dirs
subdir(dir)
endforeach
11 changes: 10 additions & 1 deletion meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
# dirs
#============================================================================


option(
'nixstoredir',
type : 'string',
value : '/nix/store',
description : 'path of the Nix store (defaults to /nix/store)')




# compiler args
#============================================================================

Expand Down Expand Up @@ -134,6 +136,13 @@ option(
'-lsqlite3'],
description : 'link args for sqlite3')

option(
'gc_link_args',
type : 'array',
value : [
'-L/usr/local/lib',
'-lgc'],
description : 'link args for boehm garbage collector')



Expand Down

0 comments on commit f6f7046

Please sign in to comment.