1998-03-28 05:44:41 +03:00
|
|
|
#
|
|
|
|
# The contents of this file are subject to the Netscape Public License
|
1999-04-22 01:40:44 +04:00
|
|
|
# Version 1.1 (the "NPL"); you may not use this file except in
|
1998-03-28 05:44:41 +03:00
|
|
|
# compliance with the NPL. You may obtain a copy of the NPL at
|
|
|
|
# http://www.mozilla.org/NPL/
|
|
|
|
#
|
|
|
|
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
|
|
|
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
|
|
|
# for the specific language governing rights and limitations under the
|
|
|
|
# NPL.
|
|
|
|
#
|
|
|
|
# The Initial Developer of this code under the NPL is Netscape
|
|
|
|
# Communications Corporation. Portions created by Netscape are
|
|
|
|
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
|
|
|
# Reserved.
|
|
|
|
#
|
|
|
|
|
|
|
|
#######################################################################
|
|
|
|
# Master "Core Components" macros for getting the OS architecture #
|
|
|
|
#######################################################################
|
|
|
|
|
|
|
|
#
|
1998-04-21 21:21:53 +04:00
|
|
|
# Important internal static macros
|
1998-03-28 05:44:41 +03:00
|
|
|
#
|
|
|
|
|
1998-04-21 21:21:53 +04:00
|
|
|
OS_ARCH := $(subst /,_,$(shell uname -s))
|
|
|
|
OS_RELEASE := $(shell uname -r)
|
|
|
|
OS_TEST := $(shell uname -m)
|
1998-03-28 05:44:41 +03:00
|
|
|
|
|
|
|
#
|
1998-04-21 21:21:53 +04:00
|
|
|
# Tweak the default OS_ARCH and OS_RELEASE macros as needed.
|
1998-03-28 05:44:41 +03:00
|
|
|
#
|
1998-04-21 21:21:53 +04:00
|
|
|
ifeq ($(OS_ARCH),AIX)
|
|
|
|
OS_RELEASE := $(shell uname -v).$(shell uname -r)
|
|
|
|
endif
|
|
|
|
ifeq ($(OS_ARCH),BSD_386)
|
|
|
|
OS_ARCH := BSD_OS
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
1998-09-13 08:18:06 +04:00
|
|
|
ifeq ($(OS_ARCH),dgux)
|
|
|
|
OS_ARCH := DGUX
|
|
|
|
endif
|
1998-03-28 05:44:41 +03:00
|
|
|
ifeq ($(OS_ARCH),IRIX64)
|
1998-04-21 21:21:53 +04:00
|
|
|
OS_ARCH := IRIX
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
1998-04-21 21:21:53 +04:00
|
|
|
ifeq ($(OS_ARCH),UNIX_SV)
|
|
|
|
ifneq ($(findstring NCR,$(shell grep NCR /etc/bcheckrc | head -1 )),)
|
|
|
|
OS_ARCH := NCR
|
|
|
|
else
|
|
|
|
OS_ARCH := UNIXWARE
|
|
|
|
OS_RELEASE := $(shell uname -v)
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
endif
|
1998-04-21 21:21:53 +04:00
|
|
|
ifeq ($(OS_ARCH),ncr)
|
|
|
|
OS_ARCH := NCR
|
|
|
|
endif
|
|
|
|
# This is the only way to correctly determine the actual OS version on NCR boxes.
|
|
|
|
ifeq ($(OS_ARCH),NCR)
|
|
|
|
OS_RELEASE := $(shell awk '{print $$3}' /etc/.relid | sed 's/^\([0-9]\)\(.\)\(..\)\(.*\)$$/\2.\3/')
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
ifeq ($(OS_ARCH),UNIX_System_V)
|
1998-04-21 21:21:53 +04:00
|
|
|
OS_ARCH := NEC
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
1999-05-12 04:47:36 +04:00
|
|
|
ifneq (,$(findstring POSIX_for_OpenVMS,$(OS_ARCH)))
|
|
|
|
OS_ARCH := OpenVMS
|
|
|
|
CPU_ARCH := $(shell uname -Wh)
|
|
|
|
OS_RELEASE := $(shell uname -v)
|
|
|
|
endif
|
A jumbo checkin, consisting of:
1. Ports to older revisions of some Unix variants, e.g., BSD/OS 1.1,
OSF1 V2.0, etc., contributed by Brian Ostrom <briano@netscape.com>.
2. QNX port, also contributed by Brian Ostrom.
3. New macro USE_MACH_DYLD to represent the dynamic library loading
API of NEXTSTEP and Rhapsody.
4. On platforms whose socket address has the sa_len field, make a
copy of the PRNetAddr argument for PR_Bind, PR_Connect, and PR_SendTo
and set its sa_len before passing it to the system calls. This
fix is suggested by Bert Driehuis <driehuis@playbeing.org>.
5. Removed the unused field _lockf64 of struct _MD_IOVector. Not
every Unix platform has lockf, and the POSIX file locking API
uses fcntl.
1998-11-23 09:33:00 +03:00
|
|
|
ifeq ($(OS_ARCH),QNX)
|
|
|
|
OS_RELEASE := $(shell uname -v | sed 's/^\([0-9]\)\([0-9]*\)$$/\1.\2/')
|
|
|
|
endif
|
1998-04-21 21:21:53 +04:00
|
|
|
ifeq ($(OS_ARCH),SCO_SV)
|
|
|
|
OS_ARCH := SCOOS
|
|
|
|
OS_RELEASE := 5.0
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
1998-04-21 21:21:53 +04:00
|
|
|
ifeq ($(OS_ARCH),SINIX-N)
|
|
|
|
OS_ARCH := SINIX
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
1998-05-01 00:07:51 +04:00
|
|
|
ifeq ($(OS_ARCH),SINIX-Y)
|
|
|
|
OS_ARCH := SINIX
|
|
|
|
endif
|
A jumbo checkin, consisting of:
1. Ports to older revisions of some Unix variants, e.g., BSD/OS 1.1,
OSF1 V2.0, etc., contributed by Brian Ostrom <briano@netscape.com>.
2. QNX port, also contributed by Brian Ostrom.
3. New macro USE_MACH_DYLD to represent the dynamic library loading
API of NEXTSTEP and Rhapsody.
4. On platforms whose socket address has the sa_len field, make a
copy of the PRNetAddr argument for PR_Bind, PR_Connect, and PR_SendTo
and set its sa_len before passing it to the system calls. This
fix is suggested by Bert Driehuis <driehuis@playbeing.org>.
5. Removed the unused field _lockf64 of struct _MD_IOVector. Not
every Unix platform has lockf, and the POSIX file locking API
uses fcntl.
1998-11-23 09:33:00 +03:00
|
|
|
ifeq ($(OS_ARCH),SINIX-Z)
|
|
|
|
OS_ARCH := SINIX
|
|
|
|
endif
|
1998-03-28 05:44:41 +03:00
|
|
|
# SINIX changes name to ReliantUNIX with 5.43
|
|
|
|
ifeq ($(OS_ARCH),ReliantUNIX-N)
|
1998-04-21 21:21:53 +04:00
|
|
|
OS_ARCH := SINIX
|
|
|
|
endif
|
|
|
|
ifeq ($(OS_ARCH),UnixWare)
|
|
|
|
OS_ARCH := UNIXWARE
|
|
|
|
OS_RELEASE := $(shell uname -v)
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
|
1998-04-21 21:21:53 +04:00
|
|
|
#
|
|
|
|
# Handle FreeBSD 2.2-STABLE and Linux 2.0.30-osfmach3
|
|
|
|
#
|
|
|
|
|
|
|
|
ifeq (,$(filter-out Linux FreeBSD,$(OS_ARCH)))
|
|
|
|
OS_RELEASE := $(shell echo $(OS_RELEASE) | sed 's/-.*//')
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
1998-04-21 21:21:53 +04:00
|
|
|
# Distinguish between OSF1 V4.0B and V4.0D
|
1998-03-28 05:44:41 +03:00
|
|
|
#
|
|
|
|
|
1998-04-21 21:21:53 +04:00
|
|
|
ifeq ($(OS_ARCH)$(OS_RELEASE),OSF1V4.0)
|
|
|
|
OS_VERSION := $(shell uname -v)
|
|
|
|
ifeq ($(OS_VERSION),564)
|
|
|
|
OS_RELEASE := V4.0B
|
|
|
|
endif
|
|
|
|
ifeq ($(OS_VERSION),878)
|
|
|
|
OS_RELEASE := V4.0D
|
|
|
|
endif
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
|
1998-11-20 01:20:31 +03:00
|
|
|
#
|
|
|
|
# Handle uname variants for OS/2.
|
|
|
|
#
|
|
|
|
|
|
|
|
ifeq ($(OS_ARCH),OS_2)
|
|
|
|
OS_ARCH := OS2
|
|
|
|
OS_RELEASE := 4.0
|
|
|
|
endif
|
|
|
|
|
1998-03-28 05:44:41 +03:00
|
|
|
#######################################################################
|
|
|
|
# Master "Core Components" macros for getting the OS target #
|
|
|
|
#######################################################################
|
|
|
|
|
|
|
|
#
|
|
|
|
# Note: OS_TARGET should be specified on the command line for gmake.
|
|
|
|
# When OS_TARGET=WIN95 is specified, then a Windows 95 target is built.
|
|
|
|
# The difference between the Win95 target and the WinNT target is that
|
|
|
|
# the WinNT target uses Windows NT specific features not available
|
|
|
|
# in Windows 95. The Win95 target will run on Windows NT, but (supposedly)
|
|
|
|
# at lesser performance (the Win95 target uses threads; the WinNT target
|
|
|
|
# uses fibers).
|
|
|
|
#
|
|
|
|
# When OS_TARGET=WIN16 is specified, then a Windows 3.11 (16bit) target
|
|
|
|
# is built. See: win16_3.11.mk for lots more about the Win16 target.
|
|
|
|
#
|
|
|
|
# If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
|
|
|
|
# cross-compilation.
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# The following hack allows one to build on a WIN95 machine (as if
|
|
|
|
# s/he were cross-compiling on a WINNT host for a WIN95 target).
|
|
|
|
# It also accomodates for MKS's uname.exe. If you never intend
|
|
|
|
# to do development on a WIN95 machine, you don't need this hack.
|
|
|
|
#
|
|
|
|
ifeq ($(OS_ARCH),WIN95)
|
|
|
|
OS_ARCH := WINNT
|
|
|
|
OS_TARGET := WIN95
|
|
|
|
endif
|
|
|
|
ifeq ($(OS_ARCH),Windows_95)
|
|
|
|
OS_ARCH := Windows_NT
|
|
|
|
OS_TARGET := WIN95
|
|
|
|
endif
|
1999-05-18 02:05:08 +04:00
|
|
|
ifeq ($(OS_ARCH),CYGWIN_95-4.0)
|
|
|
|
OS_ARCH := CYGWIN_NT-4.0
|
|
|
|
OS_TARGET := WIN95
|
|
|
|
endif
|
1998-11-20 01:20:31 +03:00
|
|
|
ifeq ($(OS_ARCH),OS2)
|
1998-03-28 05:44:41 +03:00
|
|
|
OS_ARCH := WINNT
|
|
|
|
OS_TARGET := OS2
|
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# On WIN32, we also define the variable CPU_ARCH.
|
|
|
|
#
|
|
|
|
|
|
|
|
ifeq ($(OS_ARCH), WINNT)
|
1998-11-20 01:20:31 +03:00
|
|
|
ifneq ($(subst /,_,$(shell uname -s)),OS_2)
|
|
|
|
CPU_ARCH := $(shell uname -p)
|
|
|
|
else
|
|
|
|
CPU_ARCH := $(shell uname -m)
|
|
|
|
endif
|
1998-03-28 05:44:41 +03:00
|
|
|
ifeq ($(CPU_ARCH),I386)
|
1998-05-14 22:09:56 +04:00
|
|
|
CPU_ARCH = x86
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
else
|
|
|
|
#
|
|
|
|
# If uname -s returns "Windows_NT", we assume that we are using
|
|
|
|
# the uname.exe in MKS toolkit.
|
|
|
|
#
|
|
|
|
# The -r option of MKS uname only returns the major version number.
|
|
|
|
# So we need to use its -v option to get the minor version number.
|
|
|
|
# Moreover, it doesn't have the -p option, so we need to use uname -m.
|
|
|
|
#
|
|
|
|
ifeq ($(OS_ARCH), Windows_NT)
|
|
|
|
OS_ARCH = WINNT
|
|
|
|
OS_MINOR_RELEASE := $(shell uname -v)
|
|
|
|
ifeq ($(OS_MINOR_RELEASE),00)
|
|
|
|
OS_MINOR_RELEASE = 0
|
|
|
|
endif
|
|
|
|
OS_RELEASE := $(OS_RELEASE).$(OS_MINOR_RELEASE)
|
|
|
|
CPU_ARCH := $(shell uname -m)
|
|
|
|
#
|
|
|
|
# MKS's uname -m returns "586" on a Pentium machine.
|
|
|
|
#
|
|
|
|
ifneq (,$(findstring 86,$(CPU_ARCH)))
|
1998-05-14 22:09:56 +04:00
|
|
|
CPU_ARCH = x86
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
else
|
|
|
|
#
|
1999-05-18 01:31:16 +04:00
|
|
|
# If uname -s returns "CYGWIN_NT-4.0", we assume that we are using
|
|
|
|
# the uname.exe in the Cygwin tools.
|
|
|
|
#
|
|
|
|
ifeq (CYGWIN_NT,$(findstring CYGWIN_NT,$(OS_ARCH)))
|
|
|
|
OS_RELEASE := $(patsubst CYGWIN_NT-%,%,$(OS_ARCH))
|
|
|
|
OS_ARCH = WINNT
|
|
|
|
CPU_ARCH := $(shell uname -m)
|
|
|
|
#
|
|
|
|
# Cygwin's uname -m returns "i686" on a Pentium Pro machine.
|
|
|
|
#
|
|
|
|
ifneq (,$(findstring 86,$(CPU_ARCH)))
|
|
|
|
CPU_ARCH = x86
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
#
|
|
|
|
# Prior to the Beta 20 release, Cygwin was called GNU-Win32.
|
1998-03-28 05:44:41 +03:00
|
|
|
# If uname -s returns "CYGWIN32/NT", we assume that we are using
|
|
|
|
# the uname.exe in the GNU-Win32 tools.
|
|
|
|
#
|
|
|
|
ifeq ($(OS_ARCH), CYGWIN32_NT)
|
|
|
|
OS_ARCH = WINNT
|
|
|
|
CPU_ARCH := $(shell uname -m)
|
|
|
|
#
|
|
|
|
# GNU-Win32's uname -m returns "i686" on a Pentium Pro machine.
|
|
|
|
#
|
|
|
|
ifneq (,$(findstring 86,$(CPU_ARCH)))
|
1998-05-14 22:09:56 +04:00
|
|
|
CPU_ARCH = x86
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
1999-05-18 01:31:16 +04:00
|
|
|
endif
|
1998-03-28 05:44:41 +03:00
|
|
|
|
|
|
|
ifndef OS_TARGET
|
|
|
|
OS_TARGET := $(OS_ARCH)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OS_TARGET), WIN95)
|
|
|
|
OS_RELEASE := 4.0
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OS_TARGET), WIN16)
|
|
|
|
OS_RELEASE :=
|
|
|
|
# OS_RELEASE := _3.11
|
|
|
|
endif
|
|
|
|
|
1998-04-21 21:21:53 +04:00
|
|
|
OS_CONFIG := $(OS_TARGET)$(OS_RELEASE)
|