Bug 1067893 - Detect OTOOL in configure. r=glandium

This commit is contained in:
Georg Koppen 2014-11-25 05:12:00 -05:00
parent dbff5227db
commit da4453f15f
5 changed files with 10 additions and 5 deletions

View File

@ -161,6 +161,7 @@ MOZ_PATH_PROGS(AS, "${target_alias}-as" "${target}-as", :)
AC_CHECK_PROGS(LD, "${target_alias}-ld" "${target}-ld", :)
AC_CHECK_PROGS(STRIP, "${target_alias}-strip" "${target}-strip", :)
AC_CHECK_PROGS(WINDRES, "${target_alias}-windres" "${target}-windres", :)
AC_CHECK_PROGS(OTOOL, "${target_alias}-otool" "${target}-otool", :)
AC_DEFINE(CROSS_COMPILE)
CROSS_COMPILE=1

View File

@ -42,12 +42,13 @@ if test "$MOZ_BUILD_APP" = "i386" -o "$MOZ_BUILD_APP" = "x86_64"; then
AS=$CC
LD=ld
STRIP="strip"
OTOOL="otool"
# Each per-CPU build should be entirely oblivious to the fact that a
# universal binary will be produced. The exception is packager.mk, which
# needs to know to look for universal bits when building the .dmg.
UNIVERSAL_BINARY=1
export CC CXX HOST_CC HOST_CXX RANLIB AR AS LD STRIP
export CC CXX HOST_CC HOST_CXX RANLIB AR AS LD STRIP OTOOL
fi
fi

View File

@ -6,6 +6,7 @@ import sys
import os
import subprocess
import shutil
from buildconfig import substs
'''
Scans the given directories for binaries referencing the AddressSanitizer
@ -28,7 +29,7 @@ def scan_directory(path):
continue
try:
otoolOut = subprocess.check_output(['otool', '-L', filename])
otoolOut = subprocess.check_output([substs['OTOOL'], '-L', filename])
except:
# Errors are expected on non-mach executables, ignore them and continue
continue

View File

@ -370,6 +370,7 @@ else
AC_CHECK_PROGS(LD, ld, :)
AC_CHECK_PROGS(STRIP, strip, :)
AC_CHECK_PROGS(WINDRES, windres, :)
AC_CHECK_PROGS(OTOOL, otool, :)
if test -z "$HOST_CC"; then
HOST_CC="$CC"
fi
@ -7173,12 +7174,12 @@ elif test -n "$MOZ_REPLACE_MALLOC"; then
dnl - classic info only (for OSX < 10.6)
dnl - dyld info only
dnl - both
if otool -l conftest${DLL_SUFFIX} 2> /dev/null | grep "LC_DYLD_INFO_ONLY" > /dev/null; then
if "$OTOOL" -l conftest${DLL_SUFFIX} 2> /dev/null | grep "LC_DYLD_INFO_ONLY" > /dev/null; then
_CLASSIC_INFO=
else
_CLASSIC_INFO=1
fi
if otool -l conftest${DLL_SUFFIX} 2> /dev/null | grep "LC_DYLD_INFO" > /dev/null; then
if "$OTOOL" -l conftest${DLL_SUFFIX} 2> /dev/null | grep "LC_DYLD_INFO" > /dev/null; then
_DYLD_INFO=1
else
_DYLD_INFO=

View File

@ -17,6 +17,7 @@ from mozpack.executables import (
ELF,
MACHO,
)
from buildconfig import substs
TOOLCHAIN_PREFIX = ''
@ -71,7 +72,7 @@ def dependentlibs_readelf(lib):
def dependentlibs_otool(lib):
'''Returns the list of dependencies declared in the given MACH-O dylib'''
proc = subprocess.Popen(['otool', '-l', lib], stdout = subprocess.PIPE)
proc = subprocess.Popen([substs['OTOOL'], '-l', lib], stdout = subprocess.PIPE)
deps= []
cmd = None
for line in proc.stdout: