Closed Bug 681641 Opened 13 years ago Closed 13 years ago

makefiles: replace $(shell uname) calls with precomputed config platform values

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: joey, Unassigned)

Details

Values can be obtained from autoconf.mk vars: OS_ARCH, OS_TARGET, HOST_OS_ARCH, TARGET_OS

If including autconf.mk/configure.mk will introduce extraneous dependencies a standalone platform makefile can be generated to only define a basic set of platform values.
============================================================================
/client.mk:ifneq (,$(filter MINGW%,$(shell uname -s)))
./toolkit/mozapps/installer/packager.mk:NATIVE_ARCH	= $(shell uname -p | sed -e s/powerpc/ppc/)
./security/coreconf/arch.mk:# OS_ARCH	(from uname -r)
./security/coreconf/arch.mk:# OS_TEST	(from uname -m)
./security/coreconf/arch.mk:# OS_RELEASE	(from uname -v and/or -r)
./security/coreconf/arch.mk:OS_ARCH := $(subst /,_,$(shell uname -s))
./security/coreconf/arch.mk:OS_TEST := $(shell uname -m)
./security/coreconf/arch.mk:    OS_RELEASE := $(shell uname -r)_$(OS_TEST)
./security/coreconf/arch.mk:    OS_RELEASE := $(shell uname -r)
./security/coreconf/arch.mk:    OS_RELEASE := $(shell uname -v)
./security/coreconf/arch.mk:    OS_RELEASE := $(shell uname -v).$(shell uname -r)
./security/coreconf/arch.mk:    OS_VERSION := $(shell uname -v)
./security/coreconf/arch.mk:    OS_RELEASE := $(shell uname -v)
./security/coreconf/arch.mk:# It also accomodates for MKS's and Cygwin's uname.exe.
./security/coreconf/arch.mk:	CPU_ARCH := $(shell uname -p)
./security/coreconf/arch.mk:# If uname -s returns "Windows_NT", we assume that we are using
./security/coreconf/arch.mk:# the uname.exe in MKS toolkit.
./security/coreconf/arch.mk:# The -r option of MKS uname only returns the major version number.
./security/coreconf/arch.mk:# Moreover, it doesn't have the -p option, so we need to use uname -m.
./security/coreconf/arch.mk:    OS_MINOR_RELEASE := $(shell uname -v)
./security/coreconf/arch.mk:	CPU_ARCH := $(shell uname -m)
./security/coreconf/arch.mk:	# MKS's uname -m returns "586" on a Pentium machine.
./security/coreconf/arch.mk:# If uname -s returns "CYGWIN_NT-4.0", we assume that we are using
./security/coreconf/arch.mk:# the uname.exe in the Cygwin tools.
./security/coreconf/arch.mk:	CPU_ARCH := $(shell uname -m)
./security/coreconf/arch.mk:	# Cygwin's uname -m returns "i686" on a Pentium Pro machine.
./security/coreconf/arch.mk:# If uname -s returns "MINGW32_NT-5.1", we assume that we are using
./security/coreconf/arch.mk:# the uname.exe in the MSYS toolkit.
./security/coreconf/arch.mk:	CPU_ARCH := $(shell uname -m)
./security/coreconf/arch.mk:	# MSYS's uname -m returns "i686" on a Pentium Pro machine.
./security/coreconf/Darwin.mk:CPU_ARCH	:= $(shell uname -p)
./security/coreconf/NetBSD.mk:CPU_ARCH		:= $(shell uname -p)
This is NSS, which doesn't use configure.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WONTFIX
Is there technical reason part of the code base should behave differently/use different values or is this another part of the package that is notoriously difficult to distribute changes for ?
This is more or less third-party code.
NSS is a separate project that we take code drops from. Everything under security/coreconf and security/nss is NSS code. For cross-compiles we pass this information down from configure, so we could probably duplicate that for non-cross-compiles, so that NSS didn't have to do a shell invocation to figure this out:
http://mxr.mozilla.org/security/source/security/manager/Makefile.in#242
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.