summaryrefslogtreecommitdiff
path: root/buildlib
diff options
context:
space:
mode:
Diffstat (limited to 'buildlib')
-rw-r--r--buildlib/defaults.mak16
-rw-r--r--buildlib/environment.mak.in2
-rw-r--r--buildlib/makefile.in9
-rw-r--r--buildlib/statvfs.h.in4
4 files changed, 28 insertions, 3 deletions
diff --git a/buildlib/defaults.mak b/buildlib/defaults.mak
index 3e145f673..17a6b8ac8 100644
--- a/buildlib/defaults.mak
+++ b/buildlib/defaults.mak
@@ -40,13 +40,25 @@ BUILD_POSSIBLE := $(BASE) $(BASE)/build-$(shell uname -m) $(BASE)/build
endif
BUILDX:= $(foreach i,$(BUILD_POSSIBLE),$(wildcard $(i)/environment.mak*))
-BUILDX:= $(patsubst %/,%,$(firstword $(dir $(BUILDX))))
ifeq ($(words $(BUILDX)),0)
-error-all:
+
+# Check for a busted wildcard function. We use this function in several
+# places, it must work.
+ifeq ($(words $(wildcard *)),0)
+error-all/environment.mak:
+ echo You have a broken version of GNU Make - upgrade.
+else
+error-all/environment.mak:
echo Can't find the build directory in $(BUILD_POSSIBLE) -- use BUILD=
endif
+# Force include below to come to the error target
+BUILDX := error-all
+else
+BUILDX:= $(patsubst %/,%,$(firstword $(dir $(BUILDX))))
+endif
+
override BUILD := $(BUILDX)
# Base definitions
diff --git a/buildlib/environment.mak.in b/buildlib/environment.mak.in
index 83c52394e..b0b8f185e 100644
--- a/buildlib/environment.mak.in
+++ b/buildlib/environment.mak.in
@@ -32,4 +32,6 @@ SLANGLIB = @SLANGLIB@
XPMLIB = @XPMLIB@
PTHREADLIB = @PTHREADLIB@
+# Shim Headerfile control
HAVE_C9X = @HAVE_C9X@
+HAVE_STATVFS = @HAVE_STATVFS@
diff --git a/buildlib/makefile.in b/buildlib/makefile.in
index dbcc91cd6..677aee4d3 100644
--- a/buildlib/makefile.in
+++ b/buildlib/makefile.in
@@ -31,13 +31,20 @@ maintainer-clean dist-clean pristine sanity distclean:
.PHONY: dirs
MISSING_DIRS:= $(filter-out $(wildcard $(SUBDIRS)),$(SUBDIRS))
dirs:
+ @rm -f include/sys
ifneq ($(words $(MISSING_DIRS)),0)
@mkdir $(MISSING_DIRS)
else
@echo > /dev/null
endif
ifeq ($(HAVE_C9X),yes)
- -@rm include/inttypes.h > /dev/null 2>&1
+ @rm -f include/inttypes.h > /dev/null 2>&1
else
@cp $(SRCDIR)/buildlib/inttypes.h.in include/inttypes.h
endif
+ifeq ($(HAVE_STATVFS),yes)
+ @rm -f include/statvfs.h > /dev/null 2>&1
+else
+ @cp $(SRCDIR)/buildlib/statvfs.h.in include/statvfs.h
+ ln -sf . include/sys
+endif
diff --git a/buildlib/statvfs.h.in b/buildlib/statvfs.h.in
new file mode 100644
index 000000000..86b8c52cd
--- /dev/null
+++ b/buildlib/statvfs.h.in
@@ -0,0 +1,4 @@
+/* Compatibility for systems with out Single Unix Spec statvfs */
+#include <sys/vfs.h>
+
+#define statvfs statfs