# $Id: architecture,v 1.2 1996/07/22 20:23:45 marc Exp $

# sample `uname -a` output:
# SunOS dun-dun-n 4.1.3 3 sun4c
# SunOS samosa 5.3 Generic_101318-31 sun4m sparc
# HP-UX strange- A.09.01 A 9000/710 2005970723 two-user license
# AIX krusty 2 3 000131533500

# each section here should set ARCH_OS to a symbol specifically describing
# the OS, and also set "relevant" capability symbols

ifndef ARCH_OS
__UNAME_A := $(shell uname -a)
ifeq "$(strip $(filter SunOS 4.1.3, $(__UNAME_A)))" "SunOS 4.1.3"
	export ARCH_OS := sunos4.1
endif
ifeq "$(strip $(filter SunOS 4.1.3C, $(__UNAME_A)))" "SunOS 4.1.3C"
	export ARCH_OS := sunos4.1
endif
ifeq "$(strip $(filter SunOS 4.1.3_U1, $(__UNAME_A)))" "SunOS 4.1.3_U1"
	export ARCH_OS := sunos4.1
endif
ifeq "$(strip $(filter SunOS 4.1.4, $(__UNAME_A)))" "SunOS 4.1.4"
	export ARCH_OS := sunos4.1
endif
ifeq "$(strip $(filter SunOS 5.3, $(__UNAME_A)))" "SunOS 5.3"
	export ARCH_OS := solaris2.3
endif
# For now, assume that Solaris 2.4 is the same as Solaris 2.3.
ifeq "$(strip $(filter SunOS 5.4, $(__UNAME_A)))" "SunOS 5.4"
	export ARCH_OS := solaris2.3
endif
ifeq "$(strip $(filter HP-UX A.09.01, $(__UNAME_A)))" "HP-UX A.09.01"
	export ARCH_OS := hpux9.01
endif
ifeq "$(strip $(filter AIX 2, $(__UNAME_A)))" "AIX 2"
	export ARCH_OS := aix3.2
endif
ifeq "$(strip $(filter sweet-and-sour-sauce, $(__UNAME_A)))" "sweet-and-sour-sauce"
	export ARCH_OS := aix3.2
	d:=$(shell echo "*** WARNING! Used hostname for architecture." 1>&2) 
endif
ifeq "$(strip $(filter Linux, $(__UNAME_A)))" "Linux"
	export ARCH_OS := linux
endif
ifeq "$(strip $(filter IRIX, $(__UNAME_A)))" "IRIX"
	export ARCH_OS := irix5.2
endif
ifeq "$(strip $(filter NetBSD, $(__UNAME_A)))" "NetBSD NetBSD"
	export ARCH_OS := netbsd1
endif

ifndef ARCH_OS
	d:=$(shell echo "*** WARNING! Unknown architecture: $(__UNAME_A)" 1>&2)
	export ARCH_OS := dummy
	export ARCH_OS_UNKNOWN := dummy
endif
endif

ifndef ARCH_OS_UNKNOWN
	define IncludeArchFile
	include $(CONFDIR)/$(ARCH_OS).def
	endef
else
	define IncludeArchFile
	endef
endif

