1 diff --git a/meson.build b/meson.build
2 index 4717bb2a..38d8693f 100644
5 @@ -70,6 +70,12 @@ if cc.has_function('clock_gettime', prefix: '#include <time.h>')
6 conf_data.set10('HAVE_CLOCK_GETTIME', true)
9 +if build_machine.system() == 'darwin' or build_machine.system() == 'freebsd' or not cc.links('#include <argp.h>\nstatic error_t parse_opt (int key, char *arg, struct argp_state *state) { argp_usage(state); return 0; }; void main() {}')
10 + argpdep = cc.find_library('argp')
12 + argpdep = dependency('', required : false)
15 if cc.has_function('sched_setaffinity',
16 prefix: '#include <sched.h>',
17 args: '-D_GNU_SOURCE')
18 @@ -186,7 +192,7 @@ endif
20 indexamajig = executable('indexamajig', indexamajig_sources,
21 dependencies: [mdep, libcrystfeldep, gsldep,
22 - pthreaddep, zmqdep, asapodep, asapoproddep],
23 + pthreaddep, zmqdep, asapodep, asapoproddep, argpdep],
25 install_rpath: crystfel_rpath)