Fix mg building on darwin.
I am not happy with this at all. It avoids using libbsd at all on darwin because there are conflicting header files, particularly the header string.h. Ideally that would be the thing to fix. But in the meantime, this patch should do the trick. It declares a header file apple.h, which files include if target is darwin (checks for presence of __APPLE__). This header file also references the three source files futimens.c, reallocarray.c and strtonum.c. The former and latter are from https://github.com/ibara/mg which is another portable fork, but building against more platforms. From the OpenBSD source tree is _null.h and tree.h. There is a check so that if __APPLE__ is present then it will include them from this source tree. Now,the makefile GNUMakefile will not link against libbsd on darwin, by checking the output of uname in much the same way as it did already for FreeBSD.
parent
40e30f96
Please register or sign in to comment