diff --git a/Makefile b/Makefile index 61da81f0..f9f3605c 100644 --- a/Makefile +++ b/Makefile @@ -274,35 +274,35 @@ everything: most-things .PHONY: sysroot-base-headers-all-archs sysroot-base-headers-all-archs: $(MAKE) clean clean-sysroot - $(MAKE) sysroot-base-headers HOST=i486-sortix + $(MAKE) sysroot-base-headers HOST=i686-sortix $(MAKE) clean clean-sysroot $(MAKE) sysroot-base-headers HOST=x86_64-sortix .PHONY: all-archs all-archs: $(MAKE) clean clean-sysroot - $(MAKE) all HOST=i486-sortix + $(MAKE) all HOST=i686-sortix $(MAKE) clean clean-sysroot $(MAKE) all HOST=x86_64-sortix .PHONY: most-things-all-archs most-things-all-archs: $(MAKE) clean clean-sysroot - $(MAKE) most-things HOST=i486-sortix + $(MAKE) most-things HOST=i686-sortix $(MAKE) clean clean-sysroot $(MAKE) most-things HOST=x86_64-sortix .PHONY: everything-all-archs everything-all-archs: $(MAKE) clean clean-sysroot - $(MAKE) everything HOST=i486-sortix + $(MAKE) everything HOST=i686-sortix $(MAKE) clean clean-sysroot $(MAKE) everything HOST=x86_64-sortix .PHONY: release-all-archs release-all-archs: $(MAKE) clean clean-sysroot - $(MAKE) release HOST=i486-sortix + $(MAKE) release HOST=i686-sortix $(MAKE) clean clean-sysroot $(MAKE) release HOST=x86_64-sortix diff --git a/build-aux/compiler.mak b/build-aux/compiler.mak index b6e9e575..6447d0fb 100644 --- a/build-aux/compiler.mak +++ b/build-aux/compiler.mak @@ -31,7 +31,7 @@ ifeq ($(HOST_IS_SORTIX),0) software_meant_for_sortix: @echo This software is meant to work under Sortix, not $(HOST) @echo Attempt was $(MAKE) $(MAKEFLAGS) - @echo Try: $(MAKE) $(MAKEFLAGS) HOST=$(UNAME_PLATFORM)-sortix + @echo Try: $(MAKE) $(MAKEFLAGS) HOST=$(UNAME_MACHINE)-sortix @exit 1 endif endif @@ -40,10 +40,22 @@ endif is_unset_or_default = $(filter undefined default,$(origin $(1))) # Provide deprecated CPU variable so makefiles can select CPU-specific dirs. +ifeq ($(HOST),i386-sortix) + MACHINE:=i386 + CPU:=x86 +endif ifeq ($(HOST),i486-sortix) MACHINE:=i486 CPU:=x86 endif +ifeq ($(HOST),i586-sortix) + MACHINE:=i586 + CPU:=x86 +endif +ifeq ($(HOST),i686-sortix) + MACHINE:=i686 + CPU:=x86 +endif ifeq ($(HOST),x86_64-sortix) MACHINE:=x86_64 CPU:=x64 diff --git a/build-aux/platform.mak b/build-aux/platform.mak index a7677643..5307c6a1 100644 --- a/build-aux/platform.mak +++ b/build-aux/platform.mak @@ -1,42 +1,8 @@ -UNAME_OS:=$(shell uname -o) -UNAME_PLATFORM:=$(shell uname -i) +UNAME_OS:=$(shell uname -s | tr '[:upper:]' '[:lower:]' | sed 's,^linux$$,linux-gnu,g') +UNAME_MACHINE:=$(shell uname -m) # Detect the platform that the software is being built on. -ifndef BUILD - - # If the software is being built on Sortix. - ifeq ($(UNAME_OS),Sortix) - ifeq ($(MAKEFILE_NOT_MEANT_FOR_SORTIX), 1) -makefile_not_meant_for_sortix: - @echo This makefile isn\'t meant to work under Sortix - @exit 1 - endif - ifeq ($(UNAME_PLATFORM),i386) - BUILD:=i486-sortix - endif - ifeq ($(UNAME_PLATFORM),x86_64) - BUILD:=x86_64-sortix - endif - - # If the software is not built on Sortix. - else - ifeq ($(MEANT_FOR_SORTIX), 1) -makefile_meant_for_sortix: - @echo This makefile isn\'t meant to work under $(UNAME_OS) - @exit 1 - endif - endif - - ifeq ($(UNAME_OS),GNU/Linux) - ifeq ($(UNAME_PLATFORM),i386) - BUILD:=i386-linux-gnu - endif - ifeq ($(UNAME_PLATFORM),x86_64) - BUILD:=x86_64-linux-gnu - endif - endif - -endif +BUILD?=$(UNAME_MACHINE)-$(UNAME_OS) # Determine the platform the software will run on. HOST?=$(BUILD) @@ -45,6 +11,21 @@ HOST_MACHINE:=$(shell expr x$(HOST) : 'x\([^-]*\).*') # Determine the platform the software will target. TARGET?=$(HOST) -BUILD_IS_SORTIX:=$(if $(shell echo $(BUILD) | grep sortix$),1,0) -HOST_IS_SORTIX:=$(if $(shell echo $(HOST) | grep sortix$),1,0) -TARGET_IS_SORTIX:=$(if $(shell echo $(TARGET) | grep sortix$),1,0) +BUILD_IS_SORTIX:=$(if $(shell echo $(BUILD) | grep -- -sortix),1,0) +HOST_IS_SORTIX:=$(if $(shell echo $(HOST) | grep -- -sortix),1,0) +TARGET_IS_SORTIX:=$(if $(shell echo $(TARGET) | grep -- -sortix),1,0) + +# If the software is being built on Sortix. +ifeq ($(UNAME_OS),sortix) + ifeq ($(MAKEFILE_NOT_MEANT_FOR_SORTIX), 1) +makefile_not_meant_for_sortix: + @echo This makefile isn\'t meant to work under Sortix + @exit 1 + endif + +# If the software is not built on Sortix. +else ifeq ($(MEANT_FOR_SORTIX), 1) +makefile_meant_for_sortix: + @echo This makefile isn\'t meant to work under $(uname -s) + @exit 1 +endif diff --git a/share/man/man7/cross-development.7 b/share/man/man7/cross-development.7 index d17fe4da..c26f827d 100644 --- a/share/man/man7/cross-development.7 +++ b/share/man/man7/cross-development.7 @@ -71,7 +71,7 @@ The following sections describe these variables in detail. .Ss Target Platform You need to decide what the platform your final Sortix system will run on. You can currently decide between -.Sy i486-sortix +.Sy i686-sortix and .Sy x86_64-sortix . In this guide we will refer to that platform triplet as diff --git a/share/man/man7/development.7 b/share/man/man7/development.7 index 1d74d1e5..1a8a803b 100644 --- a/share/man/man7/development.7 +++ b/share/man/man7/development.7 @@ -133,7 +133,7 @@ Specifies platform on which the compiled code will run. This defaults to the current machine and operating system. This is used when cross-compiling the operating system. When cross-compiling the operating system, it must be set to one of -.Sy i486-sortix +.Sy i686-sortix and .Sy x86_64-sortix . This must be unset when building the build tools as they run on the current diff --git a/share/man/man7/installation.7 b/share/man/man7/installation.7 index 8434e87b..8a350b4a 100644 --- a/share/man/man7/installation.7 +++ b/share/man/man7/installation.7 @@ -25,7 +25,7 @@ A computer meeting the system requirements. .Ss System Requirements .Bl -bullet -compact .It -32-bit x86 CPU with SSE (i486 release), or 64-bit x86 CPU (x86_64 release). +32-bit x86 CPU with SSE (i686 release), or 64-bit x86 CPU (x86_64 release). .It 1 GiB RAM (recommended) to run iso live environment (including installer) with all ports loaded, or significantly less if unimportant ports are not loaded. An diff --git a/sysinstall/sysupgrade.c b/sysinstall/sysupgrade.c index 44f3b71c..17746c8d 100644 --- a/sysinstall/sysupgrade.c +++ b/sysinstall/sysupgrade.c @@ -732,6 +732,16 @@ int main(void) if ( upgrade_pid == 0 ) { umask(0022); + // TODO: Remove after releasing Sortix 1.0. + if ( target_release->version_major == 1 && + target_release->version_minor == 0 && + target_release->version_dev && + strcmp(uts.machine, "i686") == 0 ) + { + system("sed -i 's/i486-sortix/i686-sortix/g' tix/collection.conf"); + if ( access_or_die("tix/tixinfo", F_OK) == 0 ) + system("sed -i 's/i486-sortix/i686-sortix/g' tix/tixinfo/*"); + } // TODO: Use an upgrade manifest system that notices files that are now // untracked or moved from one manifest to another. if ( conf.system ) diff --git a/tix/util.h b/tix/util.h index 30e6a718..1ecc0afe 100644 --- a/tix/util.h +++ b/tix/util.h @@ -456,7 +456,15 @@ static void compact_arguments(int* argc, char*** argv) char* GetBuildTriplet(void) { #if defined(__sortix__) && defined(__i386__) - return strdup("i486-sortix"); +#if defined(__i686__) + return "i686-sortix"; +#elif defined(__i586__) + return "i586-sortix"; +#elif defined(__i486__) + return "i486-sortix"; +#else + return "i386-sortix"; +#endif #elif defined(__sortix__) && defined(__x86_64__) return strdup("x86_64-sortix"); #elif defined(__sortix__)