macOS: Use correct endian.h & use argp-standalone
authorNima Vasseghi <nmv@fb.com>
Tue, 29 Dec 2020 02:01:49 +0000 (18:01 -0800)
committerNima Vasseghi <nmv@fb.com>
Tue, 29 Dec 2020 04:39:10 +0000 (20:39 -0800)
meson.build
src/lib/index/index_read.c

index 0b8a405afa153b543e3416c279a5362a6c4cae50..8abfdf877660550095d9f9ad22e33d2e0923c1dd 100644 (file)
@@ -28,7 +28,7 @@ endif
 
 curl_dep = dependency('libcurl')
 
-if 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); }; void main() {}')
+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); }; void main() {}')
     argplib = cc.find_library('argp')
 else
     argplib = dependency('', required : false)
index c6ee98bdc141fc44f2d990ca849561e2d1b1a943..875b569be109d5d4f581548cb1fa846d116ec2f2 100644 (file)
@@ -30,6 +30,8 @@
 #include <string.h>
 #ifdef FREEBSD
 #include <sys/endian.h>
+#elif __APPLE__
+#include <machine/endian.h>
 #else
 #include <endian.h>
 #endif