Browse Source

Makefile changes to allow building on Linux machines where uname reports four-part version

David Boreham 21 years ago
parent
commit
508e0d08e1
2 changed files with 14 additions and 0 deletions
  1. 9 0
      config/config.mk
  2. 5 0
      nsconfig.mk

+ 9 - 0
config/config.mk

@@ -77,6 +77,14 @@ ifeq ($(OS_ARCH),Linux)
 ifeq (,$(filter-out Linux FreeBSD,$(NSOS_ARCH)))
  OS_RELEASE  := $(shell echo $(OS_RELEASE) | sed 's/-.*//')
 endif
+# If the release returned by uname has _4_ components, the original
+# logic here broke. The following lines detect this and add a second
+# 'basename' to fixup the version such that everything still works.
+OS_RELEASE_TEMP := $(subst ., ,$(OS_RELEASE))
+OS_RELEASE_COUNT := $(words $(OS_RELEASE_TEMP))
+ifeq ($(OS_RELEASE_COUNT), 4)
+    OS_RELEASE := $(basename $(OS_RELEASE))
+endif
 OS_RELEASE := $(basename $(OS_RELEASE))
   ifeq (86,$(findstring 86,$(OS_TEST)))
     CPU_TAG = _x86
@@ -230,6 +238,7 @@ ifdef NSOS_RELEASE_OVERRIDE
 OS_RELEASE := $(NSOS_RELEASE_OVERRIDE)
 endif
 
+
 include $(DEPTH)/config/$(OS_ARCH)$(OS_RELEASE).mk
 
 OS_CONFIG	:= $(OS_ARCH)$(OS_RELEASE)

+ 5 - 0
nsconfig.mk

@@ -179,6 +179,11 @@ ifeq ($(NSOS_ARCH),Linux)
 ifeq (,$(filter-out Linux FreeBSD,$(NSOS_ARCH)))
  NSOS_RELEASE  := $(shell echo $(NSOS_RELEASE) | sed 's/-.*//')
 endif 
+NSOS_RELEASE_TEMP := $(subst ., ,$(NSOS_RELEASE))
+NSOS_RELEASE_COUNT := $(words $(NSOS_RELEASE_TEMP))
+ifeq ($(NSOS_RELEASE_COUNT), 4)
+	NSOS_RELEASE := $(basename $(NSOS_RELEASE))
+endif
 NSOS_RELEASE := $(basename $(NSOS_RELEASE))
 NSOS_ARCH       := Linux
 PRETTY_ARCH     := Linux