mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-06 22:53:08 +00:00
Bug 1259275 - Don't check for yasm when building with --disable-compile-environment. r=ted
This commit is contained in:
parent
a2c55db304
commit
81936f844d
61
build/moz.configure/toolchain.configure
Normal file
61
build/moz.configure/toolchain.configure
Normal file
@ -0,0 +1,61 @@
|
||||
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
# yasm detection
|
||||
# ==============================================================
|
||||
yasm = check_prog('YASM', ['yasm'], allow_missing=True)
|
||||
|
||||
@depends(yasm)
|
||||
@checking('yasm version')
|
||||
@advanced
|
||||
def yasm_version(yasm):
|
||||
if yasm:
|
||||
import subprocess
|
||||
try:
|
||||
version = Version(subprocess.check_output(
|
||||
[yasm, '--version']
|
||||
).splitlines()[0].split()[1])
|
||||
return version
|
||||
except subprocess.CalledProcessError as e:
|
||||
error('Failed to get yasm version: %s' % e.message)
|
||||
|
||||
# Until we move all the yasm consumers out of old-configure.
|
||||
# bug 1257904
|
||||
add_old_configure_assignment('_YASM_MAJOR_VERSION',
|
||||
delayed_getattr(yasm_version, 'major'))
|
||||
add_old_configure_assignment('_YASM_MINOR_VERSION',
|
||||
delayed_getattr(yasm_version, 'minor'))
|
||||
|
||||
@depends(yasm, target)
|
||||
def yasm_asflags(yasm, target):
|
||||
if yasm:
|
||||
asflags = {
|
||||
('OSX', 'x86'): '-f macho32',
|
||||
('OSX', 'x86_64'): '-f macho64',
|
||||
('WINNT', 'x86'): '-f win32',
|
||||
('WINNT', 'x86_64'): '-f x64',
|
||||
}.get((target.os, target.cpu), None)
|
||||
if asflags is None:
|
||||
# We're assuming every x86 platform we support that's
|
||||
# not Windows or Mac is ELF.
|
||||
if target.cpu == 'x86':
|
||||
asflags = '-f elf32'
|
||||
elif target.cpu == 'x86_64':
|
||||
asflags = '-f elf64'
|
||||
if asflags:
|
||||
asflags += ' -rnasm -pnasm'
|
||||
return asflags
|
||||
|
||||
set_config('YASM_ASFLAGS', yasm_asflags)
|
||||
|
||||
@depends(yasm_asflags)
|
||||
def have_yasm(value):
|
||||
if value:
|
||||
return True
|
||||
|
||||
set_config('HAVE_YASM', have_yasm)
|
||||
# Until the YASM variable is not necessary in old-configure.
|
||||
add_old_configure_assignment('YASM', have_yasm)
|
@ -54,6 +54,13 @@ def compile_environment(value):
|
||||
set_config('COMPILE_ENVIRONMENT', compile_environment)
|
||||
add_old_configure_assignment('COMPILE_ENVIRONMENT', compile_environment)
|
||||
|
||||
@depends('--disable-compile-environment', '--help')
|
||||
def toolchain_include(value, help):
|
||||
if value:
|
||||
return 'build/moz.configure/toolchain.configure'
|
||||
|
||||
include(toolchain_include)
|
||||
|
||||
|
||||
@depends('--help')
|
||||
@advanced
|
||||
@ -135,63 +142,6 @@ def perl_version_check(min_version):
|
||||
perl_version_check('5.006')
|
||||
|
||||
|
||||
# yasm detection
|
||||
# ==============================================================
|
||||
yasm = check_prog('YASM', ['yasm'], allow_missing=True)
|
||||
|
||||
@depends(yasm)
|
||||
@checking('yasm version')
|
||||
@advanced
|
||||
def yasm_version(yasm):
|
||||
if yasm:
|
||||
import subprocess
|
||||
try:
|
||||
version = Version(subprocess.check_output(
|
||||
[yasm, '--version']
|
||||
).splitlines()[0].split()[1])
|
||||
return version
|
||||
except subprocess.CalledProcessError as e:
|
||||
error('Failed to get yasm version: %s' % e.message)
|
||||
|
||||
# Until we move all the yasm consumers out of old-configure.
|
||||
# bug 1257904
|
||||
add_old_configure_assignment('_YASM_MAJOR_VERSION',
|
||||
delayed_getattr(yasm_version, 'major'))
|
||||
add_old_configure_assignment('_YASM_MINOR_VERSION',
|
||||
delayed_getattr(yasm_version, 'minor'))
|
||||
|
||||
@depends(yasm, target)
|
||||
def yasm_asflags(yasm, target):
|
||||
if yasm:
|
||||
asflags = {
|
||||
('OSX', 'x86'): '-f macho32',
|
||||
('OSX', 'x86_64'): '-f macho64',
|
||||
('WINNT', 'x86'): '-f win32',
|
||||
('WINNT', 'x86_64'): '-f x64',
|
||||
}.get((target.os, target.cpu), None)
|
||||
if asflags is None:
|
||||
# We're assuming every x86 platform we support that's
|
||||
# not Windows or Mac is ELF.
|
||||
if target.cpu == 'x86':
|
||||
asflags = '-f elf32'
|
||||
elif target.cpu == 'x86_64':
|
||||
asflags = '-f elf64'
|
||||
if asflags:
|
||||
asflags += ' -rnasm -pnasm'
|
||||
return asflags
|
||||
|
||||
set_config('YASM_ASFLAGS', yasm_asflags)
|
||||
|
||||
@depends(yasm_asflags)
|
||||
def have_yasm(value):
|
||||
if value:
|
||||
return True
|
||||
|
||||
set_config('HAVE_YASM', have_yasm)
|
||||
# Until the YASM variable is not necessary in old-configure.
|
||||
add_old_configure_assignment('YASM', have_yasm)
|
||||
|
||||
|
||||
# Miscellaneous programs
|
||||
# ==============================================================
|
||||
check_prog('DOXYGEN', ('doxygen',), allow_missing=True)
|
||||
|
@ -4824,7 +4824,7 @@ fi
|
||||
dnl Detect if we can use yasm to compile libjpeg-turbo's optimized assembly
|
||||
dnl files.
|
||||
|
||||
if test -n "$MOZ_LIBJPEG_TURBO"; then
|
||||
if test -n "$MOZ_LIBJPEG_TURBO" -a -n "$COMPILE_ENVIRONMENT"; then
|
||||
|
||||
dnl Do we support libjpeg-turbo on this platform?
|
||||
case "$OS_ARCH:$CPU_ARCH" in
|
||||
@ -4911,7 +4911,7 @@ esac
|
||||
|
||||
dnl Detect if we can use yasm to compile libav's assembly
|
||||
|
||||
if test -n "$MOZ_LIBAV_FFT"; then
|
||||
if test -n "$MOZ_LIBAV_FFT" -a -n "$COMPILE_ENVIRONMENT"; then
|
||||
AC_DEFINE(MOZ_LIBAV_FFT)
|
||||
dnl Do we support libav-fft on this platform?
|
||||
case "$OS_ARCH:$CPU_ARCH" in
|
||||
|
Loading…
x
Reference in New Issue
Block a user