aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-11-14 15:45:46 +0000
committerDavid Oberhollenzer <goliath@infraroot.at>2019-11-15 01:15:39 +0100
commitd8535473c787386e5a341632ea758013a61b247c (patch)
tree4ffb943b51f62836a8332156284d2cec40345c78 /lib
parente21b55590c2b89989da3d6f272f518a69d109115 (diff)
Fix build on BSD systems
I tested FreeBSD, DragonflyBSD, NetBSD and OpenBSD and the endian macros weren't necessary (and in fact caused errors) on all of them. Because OpenBSD ships with an ancient GCC that doesn't support the checked addition/multiplication builtins, the build there would fail unless built with CC=cc or CC=clang. I changed configure.ac to prefer cc over gcc, so that the distribution's compiler preference is respected. (The default is [gcc cc]). I had to move AC_PROG_CC above LT_INIT because otherwise LT_INIT would run AC_PROG_CC first, and we wouldn't have a chance to use non-default parameters.
Diffstat (limited to 'lib')
-rw-r--r--lib/common/dirstack.c1
-rw-r--r--lib/common/mkdir_p.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/common/dirstack.c b/lib/common/dirstack.c
index 8f73898..f8d1278 100644
--- a/lib/common/dirstack.c
+++ b/lib/common/dirstack.c
@@ -5,6 +5,7 @@
* Copyright (C) 2019 David Oberhollenzer <goliath@infraroot.at>
*/
#include "common.h"
+#include "util/compat.h"
#include <string.h>
#include <stdlib.h>
diff --git a/lib/common/mkdir_p.c b/lib/common/mkdir_p.c
index cb433b3..95187ba 100644
--- a/lib/common/mkdir_p.c
+++ b/lib/common/mkdir_p.c
@@ -7,7 +7,7 @@
#include "common.h"
#include <string.h>
-#include <alloca.h>
+#include <stdlib.h>
#include <stdio.h>
#include <errno.h>