merge mozilla-central to fx-team

This commit is contained in:
Carsten "Tomcat" Book 2013-12-17 13:17:04 +01:00
commit 22ee602f06
84 changed files with 758 additions and 6709 deletions

View File

@ -744,6 +744,9 @@ pref("font.size.inflation.disabledInMasterProcess", true);
// consumption when applications are sent to the background.
pref("memory.free_dirty_pages", true);
// Enable the Linux-specific, system-wide memory reporter.
pref("memory.system_memory_reporter", true);
pref("layout.imagevisibility.enabled", true);
pref("layout.imagevisibility.numscrollportwidths", 1);
pref("layout.imagevisibility.numscrollportheights", 1);

View File

@ -1,4 +1,4 @@
{
"revision": "fc5f583668adbaecbe060819db0c4ba96ec238d9",
"revision": "79e25f81e1e868ea9903eca5dd7452f2c778c7ce",
"repo_path": "/integration/gaia-central"
}

View File

@ -308,8 +308,8 @@ if test "$GNU_CC" -a "$GCC_USE_GNU_LD" -a -z "$DEVELOPER_OPTIONS"; then
if AC_TRY_COMMAND([${CC-cc} -o conftest.${ac_objext} $CFLAGS $MOZ_DEBUG_FLAGS -c conftest.${ac_ext} 1>&2]) &&
AC_TRY_COMMAND([${CC-cc} -o conftest${ac_exeext} $LDFLAGS $MOZ_DEBUG_FLAGS -Wl,--gc-sections conftest.${ac_objext} $LIBS 1>&2]) &&
test -s conftest${ac_exeext} -a -s conftest.${ac_objext}; then
if test "`$PYTHON "$_topsrcdir"/build/autoconf/check_debug_ranges.py conftest.${ac_objext} conftest.${ac_ext}`" = \
"`$PYTHON "$_topsrcdir"/build/autoconf/check_debug_ranges.py conftest${ac_exeext} conftest.${ac_ext}`"; then
if test "`$PYTHON -m mozbuild.configure.check_debug_ranges conftest.${ac_objext} conftest.${ac_ext}`" = \
"`$PYTHON -m mozbuild.configure.check_debug_ranges conftest${ac_exeext} conftest.${ac_ext}`"; then
GC_SECTIONS_BREAKS_DEBUG_RANGES=no
else
GC_SECTIONS_BREAKS_DEBUG_RANGES=yes

View File

@ -1,69 +0,0 @@
#!/bin/sh
#
# 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/.
#
# This script will match a dir with a set of dirs.
#
# Usage: match-dir.sh match [dir1 dir2 ... dirn]
#
# Send comments, improvements, bugs to ramiro@netscape.com
#
if [ -f Makefile ]; then
MAKEFILE="Makefile"
else
if [ -f Makefile.in ]; then
MAKEFILE="Makefile.in"
else
echo
echo "There ain't no 'Makefile' or 'Makefile.in' over here: $pwd, dude."
echo
exit 1
fi
fi
# Use DEPTH in the Makefile.in to determine the depth
depth=`grep -w DEPTH ${MAKEFILE} | grep "\.\." | awk -F"=" '{ print $2; }'`
cwd=`pwd`
# Determine the depth count
n=`echo $depth | tr '/' ' ' | wc -w`
cd $depth
objdir=`pwd`
path=`echo $cwd | sed "s|^${objdir}/||"`
match=$path
for i in $*
do
# echo "Looking for $match in $i"
echo $i | grep -q -x $match
if [ $? -eq 0 ]
then
echo "1"
exit 0
fi
# echo "Looking for $i in $match"
echo $match | grep -q $i
if [ $? -eq 0 ]
then
echo "1"
exit 0
fi
done
echo "0"
exit 0

View File

@ -87,10 +87,7 @@ arches = {
gyp_vars['target_arch'] = arches[CONFIG['CPU_ARCH']]
if CONFIG['ARM_ARCH']:
# We currently don't have a way to convert a string to an int in moz.build.
# As of writing, ARM_ARCH is not going to be over 8, so a string comparison
# works.
if CONFIG['ARM_ARCH'] < '7':
if int(CONFIG['ARM_ARCH']) < 7:
gyp_vars['armv7'] = 0
elif os == 'Android':
gyp_vars['armv7'] = 1

View File

@ -7212,7 +7212,7 @@ MOZ_ARG_ENABLE_BOOL(stdcxx-compat,
STDCXX_COMPAT=1)
if test -n "$STDCXX_COMPAT"; then
eval $(CXX="$CXX" HOST_CXX="$HOST_CXX" $PYTHON $_topsrcdir/build/autoconf/libstdcxx.py)
eval $(CXX="$CXX" HOST_CXX="$HOST_CXX" $PYTHON -m mozbuild.configure.libstdcxx)
AC_SUBST(MOZ_LIBSTDCXX_TARGET_VERSION)
AC_SUBST(MOZ_LIBSTDCXX_HOST_VERSION)
fi

View File

@ -17,8 +17,6 @@
#include "mozilla/layers/CompositableForwarder.h"
#include "mozilla/layers/LayersTypes.h"
#include "mozilla/layers/TextureClient.h" // for TextureClient, etc
#include "mozilla/layers/GrallocTextureClient.h"
#include "mozilla/layers/TextureClientOGL.h"
#include "nsAutoPtr.h" // for nsRefPtr
#include "nsDebug.h" // for printf_stderr, NS_ASSERTION
#include "nsXULAppAPI.h" // for XRE_GetProcessType, etc
@ -29,6 +27,12 @@
using namespace mozilla::gfx;
using namespace mozilla::gl;
namespace mozilla {
namespace gfx {
class SharedSurface;
}
}
namespace mozilla {
namespace layers {
@ -40,7 +44,7 @@ CanvasClient::CreateCanvasClient(CanvasClientType aType,
if (aType == CanvasClientGLContext &&
aForwarder->GetCompositorBackendType() == LAYERS_OPENGL) {
aFlags |= TEXTURE_DEALLOCATE_CLIENT;
return new CanvasClientSurfaceStream(aForwarder, aFlags);
return new DeprecatedCanvasClientSurfaceStream(aForwarder, aFlags);
}
if (gfxPlatform::GetPlatform()->UseDeprecatedTextures()) {
aFlags |= TEXTURE_DEALLOCATE_CLIENT;
@ -102,78 +106,6 @@ CanvasClient2D::CreateBufferTextureClient(gfx::SurfaceFormat aFormat, TextureFla
mTextureInfo.mTextureFlags | aFlags);
}
CanvasClientSurfaceStream::CanvasClientSurfaceStream(CompositableForwarder* aLayerForwarder,
TextureFlags aFlags)
: CanvasClient(aLayerForwarder, aFlags)
{
}
void
CanvasClientSurfaceStream::Update(gfx::IntSize aSize, ClientCanvasLayer* aLayer)
{
GLScreenBuffer* screen = aLayer->mGLContext->Screen();
SurfaceStream* stream = screen->Stream();
bool isCrossProcess = !(XRE_GetProcessType() == GeckoProcessType_Default);
bool bufferCreated = false;
if (isCrossProcess) {
#ifdef MOZ_WIDGET_GONK
SharedSurface* surf = stream->SwapConsumer();
if (!surf) {
printf_stderr("surf is null post-SwapConsumer!\n");
return;
}
if (surf->Type() != SharedSurfaceType::Gralloc) {
printf_stderr("Unexpected non-Gralloc SharedSurface in IPC path!");
MOZ_ASSERT(false);
return;
}
SharedSurface_Gralloc* grallocSurf = SharedSurface_Gralloc::Cast(surf);
if (mBuffers.find(surf) == mBuffers.end()) {
GrallocTextureClientOGL* grallocTC =
new GrallocTextureClientOGL(static_cast<GrallocBufferActor*>(grallocSurf->GetDescriptor().bufferChild()),
grallocSurf->Size(),
mTextureInfo.mTextureFlags);
mBuffers[surf] = grallocTC;
bufferCreated = true;
}
if (bufferCreated && !AddTextureClient(mBuffers[surf])) {
mBuffers.erase(surf);
}
if (mBuffers.find(surf) != mBuffers.end()) {
GetForwarder()->UseTexture(this, mBuffers[surf]);
}
#else
printf_stderr("isCrossProcess, but not MOZ_WIDGET_GONK! Someone needs to write some code!");
MOZ_ASSERT(false);
#endif
} else {
if (!mBuffer) {
StreamTextureClientOGL* textureClient =
new StreamTextureClientOGL(mTextureInfo.mTextureFlags);
textureClient->InitWith(stream);
mBuffer = textureClient;
bufferCreated = true;
}
if (bufferCreated && !AddTextureClient(mBuffer)) {
mBuffer = nullptr;
}
if (mBuffer) {
GetForwarder()->UseTexture(this, mBuffer);
}
}
aLayer->Painted();
}
void
DeprecatedCanvasClient2D::Updated()
{

View File

@ -18,12 +18,6 @@
#include "mozilla/gfx/Point.h" // for IntSize
#include "mozilla/gfx/Types.h" // for SurfaceFormat
namespace mozilla {
namespace gfx {
class SharedSurface;
}
}
namespace mozilla {
namespace layers {
@ -101,31 +95,6 @@ private:
RefPtr<TextureClient> mBuffer;
};
// Used for GL canvases where we don't need to do any readback, i.e., with a
// GL backend.
class CanvasClientSurfaceStream : public CanvasClient
{
public:
CanvasClientSurfaceStream(CompositableForwarder* aLayerForwarder, TextureFlags aFlags);
TextureInfo GetTextureInfo() const
{
return TextureInfo(COMPOSITABLE_IMAGE);
}
virtual void Update(gfx::IntSize aSize, ClientCanvasLayer* aLayer) MOZ_OVERRIDE;
virtual void OnDetach() MOZ_OVERRIDE
{
mBuffers.clear();
mBuffer = nullptr;
}
private:
std::map<gfx::SharedSurface*, RefPtr<TextureClient> > mBuffers;
RefPtr<TextureClient> mBuffer;
};
class DeprecatedCanvasClient2D : public CanvasClient
{
public:

View File

@ -51,11 +51,11 @@ public:
"Can only set properties in construction phase");
CanvasLayer::SetVisibleRegion(aRegion);
}
virtual void Initialize(const Data& aData);
virtual void RenderLayer();
virtual void FillSpecificAttributes(SpecificLayerAttributes& aAttrs)
{
aAttrs = CanvasLayerAttributes(mFilter, mBounds);
@ -63,7 +63,7 @@ public:
virtual Layer* AsLayer() { return this; }
virtual ShadowableLayer* AsShadowableLayer() { return this; }
virtual void Disconnect()
{
mCanvasClient = nullptr;
@ -79,7 +79,7 @@ protected:
{
return static_cast<ClientLayerManager*>(mManager);
}
CanvasClientType GetCanvasClientType()
{
if (mGLContext) {
@ -93,7 +93,6 @@ protected:
friend class DeprecatedCanvasClient2D;
friend class CanvasClient2D;
friend class DeprecatedCanvasClientSurfaceStream;
friend class CanvasClientSurfaceStream;
};
}
}

View File

@ -4,7 +4,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/layers/TextureClientOGL.h"
#include "SurfaceStream.h"
#include "GLContext.h" // for GLContext, etc
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
#include "mozilla/layers/ISurfaceAllocator.h"
@ -67,42 +66,6 @@ SharedTextureClientOGL::IsAllocated() const
return mHandle != 0;
}
StreamTextureClientOGL::StreamTextureClientOGL(TextureFlags aFlags)
: TextureClient(aFlags)
, mStream(0)
{
}
StreamTextureClientOGL::~StreamTextureClientOGL()
{
// the data is owned externally.
}
bool
StreamTextureClientOGL::ToSurfaceDescriptor(SurfaceDescriptor& aOutDescriptor)
{
if (!IsAllocated()) {
return false;
}
gfx::SurfaceStreamHandle handle = mStream->GetShareHandle();
aOutDescriptor = SurfaceStreamDescriptor(handle, false);
return true;
}
void
StreamTextureClientOGL::InitWith(gfx::SurfaceStream* aStream)
{
MOZ_ASSERT(!IsAllocated());
mStream = aStream;
}
bool
StreamTextureClientOGL::IsAllocated() const
{
return mStream != 0;
}
DeprecatedTextureClientSharedOGL::DeprecatedTextureClientSharedOGL(CompositableForwarder* aForwarder,
const TextureInfo& aTextureInfo)
: DeprecatedTextureClient(aForwarder, aTextureInfo)

View File

@ -14,12 +14,6 @@
#include "mozilla/layers/LayersSurfaces.h" // for SurfaceDescriptor
#include "mozilla/layers/TextureClient.h" // for DeprecatedTextureClient, etc
namespace mozilla {
namespace gfx {
class SurfaceStream;
}
}
namespace mozilla {
namespace layers {
@ -63,30 +57,6 @@ protected:
bool mInverted;
};
/**
* A TextureClient implementation to share SurfaceStream.
*/
class StreamTextureClientOGL : public TextureClient
{
public:
StreamTextureClientOGL(TextureFlags aFlags);
~StreamTextureClientOGL();
virtual bool IsAllocated() const MOZ_OVERRIDE;
virtual bool ToSurfaceDescriptor(SurfaceDescriptor& aOutDescriptor) MOZ_OVERRIDE;
virtual TextureClientData* DropTextureData() MOZ_OVERRIDE { return nullptr; }
void InitWith(gfx::SurfaceStream* aStream);
virtual gfx::IntSize GetSize() const { return gfx::IntSize(); }
protected:
gfx::SurfaceStream* mStream;
};
class DeprecatedTextureClientSharedOGL : public DeprecatedTextureClient
{
public:

View File

@ -109,11 +109,6 @@ CreateTextureHostOGL(const SurfaceDescriptor& aDesc,
desc.inverted());
break;
}
case SurfaceDescriptor::TSurfaceStreamDescriptor: {
const SurfaceStreamDescriptor& desc = aDesc.get_SurfaceStreamDescriptor();
result = new StreamTextureHostOGL(aFlags, desc);
break;
}
#ifdef XP_MACOSX
case SurfaceDescriptor::TSurfaceDescriptorMacIOSurface: {
const SurfaceDescriptorMacIOSurface& desc =
@ -460,178 +455,6 @@ SharedTextureHostOGL::GetFormat() const
return mTextureSource->GetFormat();
}
void
StreamTextureSourceOGL::BindTexture(GLenum activetex)
{
MOZ_ASSERT(gl());
gl()->fActiveTexture(activetex);
gl()->fBindTexture(mTextureTarget, mTextureHandle);
}
bool
StreamTextureSourceOGL::RetrieveTextureFromStream()
{
gl()->MakeCurrent();
SharedSurface* sharedSurf = mStream->SwapConsumer();
if (!sharedSurf) {
// We don't have a valid surf to show yet.
return false;
}
gl()->MakeCurrent();
mSize = IntSize(sharedSurf->Size().width, sharedSurf->Size().height);
gfxImageSurface* toUpload = nullptr;
switch (sharedSurf->Type()) {
case SharedSurfaceType::GLTextureShare: {
SharedSurface_GLTexture* glTexSurf = SharedSurface_GLTexture::Cast(sharedSurf);
glTexSurf->SetConsumerGL(gl());
mTextureHandle = glTexSurf->Texture();
mTextureTarget = glTexSurf->TextureTarget();
MOZ_ASSERT(mTextureHandle);
mFormat = sharedSurf->HasAlpha() ? FORMAT_R8G8B8A8
: FORMAT_R8G8B8X8;
break;
}
case SharedSurfaceType::EGLImageShare: {
SharedSurface_EGLImage* eglImageSurf =
SharedSurface_EGLImage::Cast(sharedSurf);
mTextureHandle = eglImageSurf->AcquireConsumerTexture(gl());
mTextureTarget = eglImageSurf->TextureTarget();
if (!mTextureHandle) {
toUpload = eglImageSurf->GetPixels();
MOZ_ASSERT(toUpload);
} else {
mFormat = sharedSurf->HasAlpha() ? FORMAT_R8G8B8A8
: FORMAT_R8G8B8X8;
}
break;
}
#ifdef XP_MACOSX
case SharedSurfaceType::IOSurface: {
SharedSurface_IOSurface* glTexSurf = SharedSurface_IOSurface::Cast(sharedSurf);
mTextureHandle = glTexSurf->Texture();
mTextureTarget = glTexSurf->TextureTarget();
MOZ_ASSERT(mTextureHandle);
mFormat = sharedSurf->HasAlpha() ? FORMAT_R8G8B8A8
: FORMAT_R8G8B8X8;
break;
}
#endif
case SharedSurfaceType::Basic: {
toUpload = SharedSurface_Basic::Cast(sharedSurf)->GetData();
MOZ_ASSERT(toUpload);
break;
}
default:
MOZ_CRASH("Invalid SharedSurface type.");
}
if (toUpload) {
// mBounds seems to end up as (0,0,0,0) a lot, so don't use it?
nsIntSize size(toUpload->GetSize());
nsIntRect rect(nsIntPoint(0,0), size);
nsIntRegion bounds(rect);
mFormat = UploadSurfaceToTexture(gl(),
toUpload,
bounds,
mUploadTexture,
true);
mTextureHandle = mUploadTexture;
mTextureTarget = LOCAL_GL_TEXTURE_2D;
}
MOZ_ASSERT(mTextureHandle);
gl()->fBindTexture(mTextureTarget, mTextureHandle);
gl()->fTexParameteri(mTextureTarget,
LOCAL_GL_TEXTURE_WRAP_S,
LOCAL_GL_CLAMP_TO_EDGE);
gl()->fTexParameteri(mTextureTarget,
LOCAL_GL_TEXTURE_WRAP_T,
LOCAL_GL_CLAMP_TO_EDGE);
return true;
}
void
StreamTextureSourceOGL::DeallocateDeviceData()
{
if (mUploadTexture) {
MOZ_ASSERT(gl());
gl()->MakeCurrent();
gl()->fDeleteTextures(1, &mUploadTexture);
mUploadTexture = 0;
mTextureHandle = 0;
}
}
gl::GLContext*
StreamTextureSourceOGL::gl() const
{
return mCompositor ? mCompositor->gl() : nullptr;
}
StreamTextureHostOGL::StreamTextureHostOGL(TextureFlags aFlags,
const SurfaceStreamDescriptor& aDesc)
: TextureHost(aFlags)
{
mStream = SurfaceStream::FromHandle(aDesc.handle());
MOZ_ASSERT(mStream);
}
StreamTextureHostOGL::~StreamTextureHostOGL()
{
// If need to deallocate textures, call DeallocateSharedData() before
// the destructor
}
bool
StreamTextureHostOGL::Lock()
{
if (!mCompositor) {
return false;
}
if (!mTextureSource) {
mTextureSource = new StreamTextureSourceOGL(mCompositor,
mStream);
}
return mTextureSource->RetrieveTextureFromStream();
}
void
StreamTextureHostOGL::Unlock()
{
}
void
StreamTextureHostOGL::SetCompositor(Compositor* aCompositor)
{
CompositorOGL* glCompositor = static_cast<CompositorOGL*>(aCompositor);
mCompositor = glCompositor;
if (mTextureSource) {
mTextureSource->SetCompositor(glCompositor);
}
}
gfx::SurfaceFormat
StreamTextureHostOGL::GetFormat() const
{
MOZ_ASSERT(mTextureSource);
return mTextureSource->GetFormat();
}
gfx::IntSize
StreamTextureHostOGL::GetSize() const
{
MOZ_ASSERT(mTextureSource);
return mTextureSource->GetSize();
}
TextureImageDeprecatedTextureHostOGL::~TextureImageDeprecatedTextureHostOGL()
{
MOZ_COUNT_DTOR(TextureImageDeprecatedTextureHostOGL);

View File

@ -333,108 +333,6 @@ protected:
RefPtr<SharedTextureSourceOGL> mTextureSource;
};
/**
* A texture source meant for use with StreamTextureHostOGL.
*
* It does not own any texture, we get texture from SurfaceStream.
*/
class StreamTextureSourceOGL : public NewTextureSource
, public TextureSourceOGL
{
public:
StreamTextureSourceOGL(CompositorOGL* aCompositor,
gfx::SurfaceStream* aStream)
: mCompositor(aCompositor)
, mStream(aStream)
, mTextureHandle(0)
, mTextureTarget(LOCAL_GL_TEXTURE_2D)
, mUploadTexture(0)
, mFormat(gfx::FORMAT_UNKNOWN)
{
MOZ_COUNT_CTOR(StreamTextureSourceOGL);
}
~StreamTextureSourceOGL()
{
MOZ_COUNT_DTOR(StreamTextureSourceOGL);
}
virtual TextureSourceOGL* AsSourceOGL() { return this; }
virtual void BindTexture(GLenum activetex) MOZ_OVERRIDE;
virtual bool IsValid() const MOZ_OVERRIDE { return !!gl(); }
virtual gfx::IntSize GetSize() const MOZ_OVERRIDE { return mSize; }
virtual gfx::SurfaceFormat GetFormat() const MOZ_OVERRIDE { return mFormat; }
virtual GLenum GetTextureTarget() const { return mTextureTarget; }
virtual GLenum GetWrapMode() const MOZ_OVERRIDE { return LOCAL_GL_CLAMP_TO_EDGE; }
virtual void DeallocateDeviceData();
bool RetrieveTextureFromStream();
void SetCompositor(CompositorOGL* aCompositor) { mCompositor = aCompositor; }
protected:
gl::GLContext* gl() const;
CompositorOGL* mCompositor;
gfx::SurfaceStream* mStream;
GLuint mTextureHandle;
GLenum mTextureTarget;
GLuint mUploadTexture;
gfx::IntSize mSize;
gfx::SurfaceFormat mFormat;
};
/**
* A TextureHost for shared SurfaceStream
*/
class StreamTextureHostOGL : public TextureHost
{
public:
StreamTextureHostOGL(TextureFlags aFlags,
const SurfaceStreamDescriptor& aDesc);
virtual ~StreamTextureHostOGL();
// SharedTextureHostOGL doesn't own any GL texture
virtual void DeallocateDeviceData() MOZ_OVERRIDE {}
virtual void SetCompositor(Compositor* aCompositor) MOZ_OVERRIDE;
virtual bool Lock() MOZ_OVERRIDE;
virtual void Unlock() MOZ_OVERRIDE;
virtual gfx::SurfaceFormat GetFormat() const MOZ_OVERRIDE;
virtual NewTextureSource* GetTextureSources() MOZ_OVERRIDE
{
return mTextureSource;
}
virtual TemporaryRef<gfx::DataSourceSurface> GetAsSurface() MOZ_OVERRIDE
{
return nullptr; // XXX - implement this (for MOZ_DUMP_PAINTING)
}
virtual gfx::IntSize GetSize() const MOZ_OVERRIDE;
#ifdef MOZ_LAYERS_HAVE_LOG
virtual const char* Name() { return "StreamTextureHostOGL"; }
#endif
protected:
CompositorOGL* mCompositor;
gfx::SurfaceStream* mStream;
RefPtr<StreamTextureSourceOGL> mTextureSource;
};
/**
* DeprecatedTextureHost implementation using a TextureImage as the underlying texture.
*/

54
js/src/aclocal.m4 vendored
View File

@ -3,32 +3,32 @@ dnl Local autoconf macros used with mozilla
dnl The contents of this file are under the Public Domain.
dnl
builtin(include, build/autoconf/acwinpaths.m4)dnl
builtin(include, build/autoconf/hooks.m4)dnl
builtin(include, build/autoconf/config.status.m4)dnl
builtin(include, build/autoconf/toolchain.m4)dnl
builtin(include, build/autoconf/ccache.m4)dnl
builtin(include, build/autoconf/wrapper.m4)dnl
builtin(include, build/autoconf/pkg.m4)dnl
builtin(include, build/autoconf/nspr.m4)dnl
builtin(include, build/autoconf/codeset.m4)dnl
builtin(include, build/autoconf/altoptions.m4)dnl
builtin(include, build/autoconf/mozprog.m4)dnl
builtin(include, build/autoconf/mozheader.m4)dnl
builtin(include, build/autoconf/mozcommonheader.m4)dnl
builtin(include, build/autoconf/lto.m4)dnl
builtin(include, build/autoconf/gcc-pr49911.m4)dnl
builtin(include, build/autoconf/gcc-pr39608.m4)dnl
builtin(include, build/autoconf/llvm-pr8927.m4)dnl
builtin(include, build/autoconf/frameptr.m4)dnl
builtin(include, build/autoconf/compiler-opts.m4)dnl
builtin(include, build/autoconf/expandlibs.m4)dnl
builtin(include, build/autoconf/arch.m4)dnl
builtin(include, build/autoconf/android.m4)dnl
builtin(include, build/autoconf/zlib.m4)dnl
builtin(include, build/autoconf/linux.m4)dnl
builtin(include, build/autoconf/python-virtualenv.m4)dnl
builtin(include, build/autoconf/winsdk.m4)dnl
builtin(include, build/autoconf/icu.m4)dnl
builtin(include, ../../build/autoconf/acwinpaths.m4)dnl
builtin(include, ../../build/autoconf/hooks.m4)dnl
builtin(include, ../../build/autoconf/config.status.m4)dnl
builtin(include, ../../build/autoconf/toolchain.m4)dnl
builtin(include, ../../build/autoconf/ccache.m4)dnl
builtin(include, ../../build/autoconf/wrapper.m4)dnl
builtin(include, ../../build/autoconf/pkg.m4)dnl
builtin(include, ../../build/autoconf/nspr.m4)dnl
builtin(include, ../../build/autoconf/codeset.m4)dnl
builtin(include, ../../build/autoconf/altoptions.m4)dnl
builtin(include, ../../build/autoconf/mozprog.m4)dnl
builtin(include, ../../build/autoconf/mozheader.m4)dnl
builtin(include, ../../build/autoconf/mozcommonheader.m4)dnl
builtin(include, ../../build/autoconf/lto.m4)dnl
builtin(include, ../../build/autoconf/gcc-pr49911.m4)dnl
builtin(include, ../../build/autoconf/gcc-pr39608.m4)dnl
builtin(include, ../../build/autoconf/llvm-pr8927.m4)dnl
builtin(include, ../../build/autoconf/frameptr.m4)dnl
builtin(include, ../../build/autoconf/compiler-opts.m4)dnl
builtin(include, ../../build/autoconf/expandlibs.m4)dnl
builtin(include, ../../build/autoconf/arch.m4)dnl
builtin(include, ../../build/autoconf/android.m4)dnl
builtin(include, ../../build/autoconf/zlib.m4)dnl
builtin(include, ../../build/autoconf/linux.m4)dnl
builtin(include, ../../build/autoconf/python-virtualenv.m4)dnl
builtin(include, ../../build/autoconf/winsdk.m4)dnl
builtin(include, ../../build/autoconf/icu.m4)dnl
MOZ_PROG_CHECKMSYS()

View File

@ -1,31 +0,0 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
define(GENERATE_SUB_ABS, [
define([AC_OUTPUT_FILES_SUB1], [
patsubst($@, [/\*)], [/* | ?:/*)])
])
])
GENERATE_SUB_ABS(defn([AC_OUTPUT_FILES]))
define(GENERATE_SUB_NOSPLIT, [
define([AC_OUTPUT_FILES], [
patsubst($@, [-e "s%:% \$ac_given_srcdir/%g"], [])
])
])
GENERATE_SUB_NOSPLIT(defn([AC_OUTPUT_FILES_SUB1]))
define(GENERATE_HEADER_NOSPLIT, [
define([AC_OUTPUT_HEADER], [
patsubst($@, [-e "s%:% \$ac_given_srcdir/%g"], [])
])
])
GENERATE_HEADER_NOSPLIT(defn([AC_OUTPUT_HEADER]))
define(GENERATE_SUBDIRS_ABS, [
define([AC_OUTPUT_SUBDIRS], [
patsubst($@, [/\*)], [/* | ?:/*)])
])
])
GENERATE_SUBDIRS_ABS(defn([AC_OUTPUT_SUBDIRS]))

View File

@ -1,122 +0,0 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
dnl altoptions.m4 - An alternative way of specifying command-line options.
dnl These macros are needed to support a menu-based configurator.
dnl This file also includes the macro, AM_READ_MYCONFIG, for reading
dnl the 'myconfig.m4' file.
dnl Send comments, improvements, bugs to Steve Lamm (slamm@netscape.com).
dnl MOZ_ARG_ENABLE_BOOL( NAME, HELP, IF-YES [, IF-NO [, ELSE]])
dnl MOZ_ARG_DISABLE_BOOL( NAME, HELP, IF-NO [, IF-YES [, ELSE]])
dnl MOZ_ARG_ENABLE_STRING( NAME, HELP, IF-SET [, ELSE])
dnl MOZ_ARG_ENABLE_BOOL_OR_STRING( NAME, HELP, IF-YES, IF-NO, IF-SET[, ELSE]]])
dnl MOZ_ARG_WITH_BOOL( NAME, HELP, IF-YES [, IF-NO [, ELSE])
dnl MOZ_ARG_WITHOUT_BOOL( NAME, HELP, IF-NO [, IF-YES [, ELSE])
dnl MOZ_ARG_WITH_STRING( NAME, HELP, IF-SET [, ELSE])
dnl MOZ_ARG_HEADER(Comment)
dnl MOZ_CHECK_PTHREADS( NAME, IF-YES [, ELSE ])
dnl MOZ_READ_MYCONFIG() - Read in 'myconfig.sh' file
dnl MOZ_TWO_STRING_TEST(NAME, VAL, STR1, IF-STR1, STR2, IF-STR2 [, ELSE])
AC_DEFUN([MOZ_TWO_STRING_TEST],
[if test "[$2]" = "[$3]"; then
ifelse([$4], , :, [$4])
elif test "[$2]" = "[$5]"; then
ifelse([$6], , :, [$6])
else
ifelse([$7], ,
[AC_MSG_ERROR([Option, [$1], does not take an argument ([$2]).])],
[$7])
fi])
dnl MOZ_ARG_ENABLE_BOOL(NAME, HELP, IF-YES [, IF-NO [, ELSE]])
AC_DEFUN([MOZ_ARG_ENABLE_BOOL],
[AC_ARG_ENABLE([$1], [$2],
[MOZ_TWO_STRING_TEST([$1], [$enableval], yes, [$3], no, [$4])],
[$5])])
dnl MOZ_ARG_DISABLE_BOOL(NAME, HELP, IF-NO [, IF-YES [, ELSE]])
AC_DEFUN([MOZ_ARG_DISABLE_BOOL],
[AC_ARG_ENABLE([$1], [$2],
[MOZ_TWO_STRING_TEST([$1], [$enableval], no, [$3], yes, [$4])],
[$5])])
dnl MOZ_ARG_ENABLE_STRING(NAME, HELP, IF-SET [, ELSE])
AC_DEFUN([MOZ_ARG_ENABLE_STRING],
[AC_ARG_ENABLE([$1], [$2], [$3], [$4])])
dnl MOZ_ARG_ENABLE_BOOL_OR_STRING(NAME, HELP, IF-YES, IF-NO, IF-SET[, ELSE]]])
AC_DEFUN([MOZ_ARG_ENABLE_BOOL_OR_STRING],
[ifelse([$5], ,
[errprint([Option, $1, needs an "IF-SET" argument.
])
m4exit(1)],
[AC_ARG_ENABLE([$1], [$2],
[MOZ_TWO_STRING_TEST([$1], [$enableval], yes, [$3], no, [$4], [$5])],
[$6])])])
dnl MOZ_ARG_WITH_BOOL(NAME, HELP, IF-YES [, IF-NO [, ELSE])
AC_DEFUN([MOZ_ARG_WITH_BOOL],
[AC_ARG_WITH([$1], [$2],
[MOZ_TWO_STRING_TEST([$1], [$withval], yes, [$3], no, [$4])],
[$5])])
dnl MOZ_ARG_WITHOUT_BOOL(NAME, HELP, IF-NO [, IF-YES [, ELSE])
AC_DEFUN([MOZ_ARG_WITHOUT_BOOL],
[AC_ARG_WITH([$1], [$2],
[MOZ_TWO_STRING_TEST([$1], [$withval], no, [$3], yes, [$4])],
[$5])])
dnl MOZ_ARG_WITH_STRING(NAME, HELP, IF-SET [, ELSE])
AC_DEFUN([MOZ_ARG_WITH_STRING],
[AC_ARG_WITH([$1], [$2], [$3], [$4])])
dnl MOZ_ARG_HEADER(Comment)
dnl This is used by webconfig to group options
define(MOZ_ARG_HEADER, [# $1])
dnl
dnl Apparently, some systems cannot properly check for the pthread
dnl library unless <pthread.h> is included so we need to test
dnl using it
dnl
dnl MOZ_CHECK_PTHREADS(lib, success, failure)
AC_DEFUN([MOZ_CHECK_PTHREADS],
[
AC_MSG_CHECKING([for pthread_create in -l$1])
echo "
#include <pthread.h>
#include <stdlib.h>
void *foo(void *v) { int a = 1; }
int main() {
pthread_t t;
if (!pthread_create(&t, 0, &foo, 0)) {
pthread_join(t, 0);
}
exit(0);
}" > dummy.c ;
echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS" 1>&5;
${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS 2>&5;
_res=$? ;
rm -f dummy.c dummy${ac_exeext} ;
if test "$_res" = "0"; then
AC_MSG_RESULT([yes])
[$2]
else
AC_MSG_RESULT([no])
[$3]
fi
])
dnl MOZ_READ_MYCONFIG() - Read in 'myconfig.sh' file
AC_DEFUN([MOZ_READ_MOZCONFIG],
[AC_REQUIRE([AC_INIT_BINSH])dnl
# Read in '.mozconfig' script to set the initial options.
# See the mozconfig2configure script for more details.
_AUTOCONF_TOOLS_DIR=`dirname [$]0`/[$1]/build/autoconf
. $_AUTOCONF_TOOLS_DIR/mozconfig2configure])

View File

@ -1,348 +0,0 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
AC_DEFUN([MOZ_ANDROID_NDK],
[
MOZ_ARG_WITH_STRING(android-ndk,
[ --with-android-ndk=DIR
location where the Android NDK can be found],
android_ndk=$withval)
MOZ_ARG_WITH_STRING(android-toolchain,
[ --with-android-toolchain=DIR
location of the android toolchain],
android_toolchain=$withval)
MOZ_ARG_WITH_STRING(android-gnu-compiler-version,
[ --with-android-gnu-compiler-version=VER
gnu compiler version to use],
android_gnu_compiler_version=$withval)
MOZ_ARG_ENABLE_BOOL(android-libstdcxx,
[ --enable-android-libstdcxx
use GNU libstdc++ instead of STLPort],
MOZ_ANDROID_LIBSTDCXX=1,
MOZ_ANDROID_LIBSTDCXX= )
define([MIN_ANDROID_VERSION], [9])
android_version=MIN_ANDROID_VERSION
MOZ_ARG_WITH_STRING(android-version,
[ --with-android-version=VER
android platform version, default] MIN_ANDROID_VERSION,
android_version=$withval)
if test $android_version -lt MIN_ANDROID_VERSION ; then
AC_MSG_ERROR([--with-android-version must be at least MIN_ANDROID_VERSION.])
fi
case "$target" in
arm-linux*-android*|*-linuxandroid*)
android_tool_prefix="arm-linux-androideabi"
;;
i?86-*android*)
android_tool_prefix="i686-linux-android"
;;
mipsel-*android*)
android_tool_prefix="mipsel-linux-android"
;;
*)
android_tool_prefix="$target_os"
;;
esac
case "$target" in
*-android*|*-linuxandroid*)
if test -z "$android_ndk" ; then
AC_MSG_ERROR([You must specify --with-android-ndk=/path/to/ndk when targeting Android.])
fi
if test -z "$android_toolchain" ; then
AC_MSG_CHECKING([for android toolchain directory])
kernel_name=`uname -s | tr "[[:upper:]]" "[[:lower:]]"`
for version in $android_gnu_compiler_version 4.7 4.6 4.4.3 ; do
case "$target_cpu" in
arm)
target_name=arm-linux-androideabi-$version
;;
i?86)
target_name=x86-$version
;;
mipsel)
target_name=mipsel-linux-android-$version
;;
*)
AC_MSG_ERROR([target cpu is not supported])
;;
esac
case "$host_cpu" in
i*86)
android_toolchain="$android_ndk"/toolchains/$target_name/prebuilt/$kernel_name-x86
;;
x86_64)
android_toolchain="$android_ndk"/toolchains/$target_name/prebuilt/$kernel_name-x86_64
if ! test -d "$android_toolchain" ; then
android_toolchain="$android_ndk"/toolchains/$target_name/prebuilt/$kernel_name-x86
fi
;;
*)
AC_MSG_ERROR([No known toolchain for your host cpu])
;;
esac
if test -d "$android_toolchain" ; then
android_gnu_compiler_version=$version
break
elif test -n "$android_gnu_compiler_version" ; then
AC_MSG_ERROR([not found. Your --with-android-gnu-compiler-version may be wrong.])
fi
done
if test -z "$android_gnu_compiler_version" ; then
AC_MSG_ERROR([not found. You have to specify --with-android-toolchain=/path/to/ndk/toolchain.])
else
AC_MSG_RESULT([$android_toolchain])
fi
NSPR_CONFIGURE_ARGS="$NSPR_CONFIGURE_ARGS --with-android-toolchain=$android_toolchain"
fi
NSPR_CONFIGURE_ARGS="$NSPR_CONFIGURE_ARGS --with-android-version=$android_version"
AC_MSG_CHECKING([for android platform directory])
case "$target_cpu" in
arm)
target_name=arm
;;
i?86)
target_name=x86
;;
mipsel)
target_name=mips
;;
esac
android_platform="$android_ndk"/platforms/android-"$android_version"/arch-"$target_name"
if test -d "$android_platform" ; then
AC_MSG_RESULT([$android_platform])
else
AC_MSG_ERROR([not found. Please check your NDK. With the current configuration, it should be in $android_platform])
fi
dnl Old NDK support. If minimum requirement is changed to NDK r8b,
dnl please remove this.
case "$target_cpu" in
i?86)
if ! test -e "$android_toolchain"/bin/"$android_tool_prefix"-gcc; then
dnl Old NDK toolchain name
android_tool_prefix="i686-android-linux"
fi
;;
esac
dnl set up compilers
TOOLCHAIN_PREFIX="$android_toolchain/bin/$android_tool_prefix-"
AS="$android_toolchain"/bin/"$android_tool_prefix"-as
if test -z "$CC"; then
CC="$android_toolchain"/bin/"$android_tool_prefix"-gcc
fi
if test -z "$CXX"; then
CXX="$android_toolchain"/bin/"$android_tool_prefix"-g++
fi
if test -z "$CPP"; then
CPP="$android_toolchain"/bin/"$android_tool_prefix"-cpp
fi
LD="$android_toolchain"/bin/"$android_tool_prefix"-ld
AR="$android_toolchain"/bin/"$android_tool_prefix"-ar
RANLIB="$android_toolchain"/bin/"$android_tool_prefix"-ranlib
STRIP="$android_toolchain"/bin/"$android_tool_prefix"-strip
OBJCOPY="$android_toolchain"/bin/"$android_tool_prefix"-objcopy
CPPFLAGS="-idirafter $android_platform/usr/include $CPPFLAGS"
CFLAGS="-mandroid -fno-short-enums -fno-exceptions $CFLAGS"
CXXFLAGS="-mandroid -fno-short-enums -fno-exceptions -Wno-psabi $CXXFLAGS"
ASFLAGS="-idirafter $android_platform/usr/include -DANDROID $ASFLAGS"
dnl Add -llog by default, since we use it all over the place.
dnl Add --allow-shlib-undefined, because libGLESv2 links to an
dnl undefined symbol (present on the hardware, just not in the
dnl NDK.)
LDFLAGS="-mandroid -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform -llog -Wl,--allow-shlib-undefined $LDFLAGS"
dnl prevent cross compile section from using these flags as host flags
if test -z "$HOST_CPPFLAGS" ; then
HOST_CPPFLAGS=" "
fi
if test -z "$HOST_CFLAGS" ; then
HOST_CFLAGS=" "
fi
if test -z "$HOST_CXXFLAGS" ; then
HOST_CXXFLAGS=" "
fi
if test -z "$HOST_LDFLAGS" ; then
HOST_LDFLAGS=" "
fi
ANDROID_NDK="${android_ndk}"
ANDROID_TOOLCHAIN="${android_toolchain}"
ANDROID_PLATFORM="${android_platform}"
AC_DEFINE(ANDROID)
CROSS_COMPILE=1
AC_SUBST(ANDROID_NDK)
AC_SUBST(ANDROID_TOOLCHAIN)
AC_SUBST(ANDROID_PLATFORM)
;;
esac
])
AC_DEFUN([MOZ_ANDROID_STLPORT],
[
if test "$OS_TARGET" = "Android" -a -z "$gonkdir"; then
case "${CPU_ARCH}-${MOZ_ARCH}" in
arm-armv7*)
ANDROID_CPU_ARCH=armeabi-v7a
;;
arm-*)
ANDROID_CPU_ARCH=armeabi
;;
x86-*)
ANDROID_CPU_ARCH=x86
;;
mips-*) # When target_cpu is mipsel, CPU_ARCH is mips
ANDROID_CPU_ARCH=mips
;;
esac
AC_SUBST(ANDROID_CPU_ARCH)
if test -z "$STLPORT_CPPFLAGS$STLPORT_LDFLAGS$STLPORT_LIBS"; then
if test -n "$MOZ_ANDROID_LIBSTDCXX" ; then
if test -e "$android_ndk/sources/cxx-stl/gnu-libstdc++/$android_gnu_compiler_version/libs/$ANDROID_CPU_ARCH/libgnustl_static.a"; then
# android-ndk-r8b
STLPORT_LIBS="-L$android_ndk/sources/cxx-stl/gnu-libstdc++/$android_gnu_compiler_version/libs/$ANDROID_CPU_ARCH/ -lgnustl_static"
STLPORT_CPPFLAGS="-I$android_ndk/sources/cxx-stl/gnu-libstdc++/$android_gnu_compiler_version/include -I$android_ndk/sources/cxx-stl/gnu-libstdc++/$android_gnu_compiler_version/libs/$ANDROID_CPU_ARCH/include -I$android_ndk/sources/cxx-stl/gnu-libstdc++/$android_gnu_compiler_version/include/backward"
elif test -e "$android_ndk/sources/cxx-stl/gnu-libstdc++/libs/$ANDROID_CPU_ARCH/libgnustl_static.a"; then
# android-ndk-r7, android-ndk-r7b, android-ndk-r8
STLPORT_LIBS="-L$android_ndk/sources/cxx-stl/gnu-libstdc++/libs/$ANDROID_CPU_ARCH/ -lgnustl_static"
STLPORT_CPPFLAGS="-I$android_ndk/sources/cxx-stl/gnu-libstdc++/include -I$android_ndk/sources/cxx-stl/gnu-libstdc++/libs/$ANDROID_CPU_ARCH/include"
elif test -e "$android_ndk/sources/cxx-stl/gnu-libstdc++/libs/$ANDROID_CPU_ARCH/libstdc++.a"; then
# android-ndk-r5c, android-ndk-r6, android-ndk-r6b
STLPORT_CPPFLAGS="-I$android_ndk/sources/cxx-stl/gnu-libstdc++/include -I$android_ndk/sources/cxx-stl/gnu-libstdc++/libs/$ANDROID_CPU_ARCH/include"
STLPORT_LIBS="-L$android_ndk/sources/cxx-stl/gnu-libstdc++/libs/$ANDROID_CPU_ARCH/ -lstdc++"
else
AC_MSG_ERROR([Couldn't find path to gnu-libstdc++ in the android ndk])
fi
else
STLPORT_CPPFLAGS="-isystem $_topsrcdir/build/stlport/stlport -isystem $android_ndk/sources/cxx-stl/system/include"
STLPORT_LIBS="$_objdir/build/stlport/libstlport_static.a -static-libstdc++"
fi
fi
CXXFLAGS="$CXXFLAGS $STLPORT_CPPFLAGS"
fi
AC_SUBST([MOZ_ANDROID_LIBSTDCXX])
AC_SUBST([STLPORT_LIBS])
])
AC_DEFUN([MOZ_ANDROID_SDK],
[
MOZ_ARG_WITH_STRING(android-sdk,
[ --with-android-sdk=DIR
location where the Android SDK can be found (base directory, e.g. .../android/platforms/android-6)],
android_sdk=$withval)
android_sdk_root=$withval/../../
case "$target" in
*-android*|*-linuxandroid*)
if test -z "$android_sdk" ; then
AC_MSG_ERROR([You must specify --with-android-sdk=/path/to/sdk when targeting Android.])
else
if ! test -e "$android_sdk"/source.properties ; then
AC_MSG_ERROR([The path in --with-android-sdk isn't valid (source.properties hasn't been found).])
fi
# Get the api level from "$android_sdk"/source.properties.
android_api_level=`$AWK -F = changequote(<<, >>)'<<$>>1 == "AndroidVersion.ApiLevel" {print <<$>>2}'changequote([, ]) "$android_sdk"/source.properties`
if test -z "$android_api_level" ; then
AC_MSG_ERROR([Unexpected error: no AndroidVersion.ApiLevel field has been found in source.properties.])
fi
if ! test "$android_api_level" -eq "$android_api_level" ; then
AC_MSG_ERROR([Unexpected error: the found android api value isn't a number! (found $android_api_level)])
fi
if test $android_api_level -lt $1 ; then
AC_MSG_ERROR([The given Android SDK provides API level $android_api_level ($1 or higher required).])
fi
fi
android_tools="$android_sdk_root"/tools
android_platform_tools="$android_sdk_root"/platform-tools
if test ! -d "$android_platform_tools" ; then
android_platform_tools="$android_sdk"/tools # SDK Tools < r8
fi
# The build tools got moved around to different directories in
# SDK Tools r22. Try to locate them.
android_build_tools=""
for suffix in android-4.3 19.0.0 18.1.0 18.0.1 18.0.0 17.0.0 android-4.2.2; do
tools_directory="$android_sdk_root/build-tools/$suffix"
if test -d "$tools_directory" ; then
android_build_tools="$tools_directory"
break
fi
done
if test -z "$android_build_tools" ; then
android_build_tools="$android_platform_tools" # SDK Tools < r22
fi
ANDROID_SDK="${android_sdk}"
ANDROID_SDK_ROOT="${android_sdk_root}"
if test -e "${ANDROID_SDK_ROOT}/extras/android/compatibility/v4/android-support-v4.jar" ; then
ANDROID_COMPAT_LIB="${ANDROID_SDK_ROOT}/extras/android/compatibility/v4/android-support-v4.jar"
else
ANDROID_COMPAT_LIB="${ANDROID_SDK_ROOT}/extras/android/support/v4/android-support-v4.jar";
fi
ANDROID_TOOLS="${android_tools}"
ANDROID_PLATFORM_TOOLS="${android_platform_tools}"
ANDROID_BUILD_TOOLS="${android_build_tools}"
AC_SUBST(ANDROID_SDK_ROOT)
AC_SUBST(ANDROID_SDK)
AC_SUBST(ANDROID_COMPAT_LIB)
if ! test -e $ANDROID_COMPAT_LIB ; then
AC_MSG_ERROR([You must download the Android support library when targeting Android. Run the Android SDK tool and install Android Support Library under Extras. See https://developer.android.com/tools/extras/support-library.html for more info. (looked for $ANDROID_COMPAT_LIB)])
fi
MOZ_PATH_PROG(ZIPALIGN, zipalign, :, [$ANDROID_TOOLS])
MOZ_PATH_PROG(DX, dx, :, [$ANDROID_BUILD_TOOLS])
MOZ_PATH_PROG(AAPT, aapt, :, [$ANDROID_BUILD_TOOLS])
MOZ_PATH_PROG(AIDL, aidl, :, [$ANDROID_BUILD_TOOLS])
MOZ_PATH_PROG(ADB, adb, :, [$ANDROID_PLATFORM_TOOLS])
if test -z "$ZIPALIGN" -o "$ZIPALIGN" = ":"; then
AC_MSG_ERROR([The program zipalign was not found. Use --with-android-sdk={android-sdk-dir}.])
fi
if test -z "$DX" -o "$DX" = ":"; then
AC_MSG_ERROR([The program dx was not found. Use --with-android-sdk={android-sdk-dir}.])
fi
if test -z "$AAPT" -o "$AAPT" = ":"; then
AC_MSG_ERROR([The program aapt was not found. Use --with-android-sdk={android-sdk-dir}.])
fi
if test -z "$AIDL" -o "$AIDL" = ":"; then
AC_MSG_ERROR([The program aidl was not found. Use --with-android-sdk={android-sdk-dir}.])
fi
if test -z "$ADB" -o "$ADB" = ":"; then
AC_MSG_ERROR([The program adb was not found. Use --with-android-sdk={android-sdk-dir}.])
fi
;;
esac
])

View File

@ -1,261 +0,0 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
AC_DEFUN([MOZ_ARCH_OPTS],
[
dnl ========================================================
dnl = ARM toolchain tweaks
dnl ========================================================
MOZ_THUMB=toolchain-default
MOZ_THUMB_INTERWORK=toolchain-default
MOZ_FPU=toolchain-default
MOZ_FLOAT_ABI=toolchain-default
MOZ_SOFT_FLOAT=toolchain-default
MOZ_ALIGN=toolchain-default
MOZ_ARG_WITH_STRING(arch,
[ --with-arch=[[type|toolchain-default]]
Use specific CPU features (-march=type). Resets
thumb, fpu, float-abi, etc. defaults when set],
if test -z "$GNU_CC"; then
AC_MSG_ERROR([--with-arch is not supported on non-GNU toolchains])
fi
MOZ_ARCH=$withval)
if test -z "$MOZ_ARCH"; then
dnl Defaults
case "${CPU_ARCH}-${OS_TARGET}" in
arm-Android)
MOZ_THUMB=yes
MOZ_ARCH=armv7-a
MOZ_FPU=vfp
MOZ_FLOAT_ABI=softfp
MOZ_ALIGN=no
;;
arm-Darwin)
MOZ_ARCH=toolchain-default
MOZ_THUMB=yes
;;
esac
fi
if test "$MOZ_ARCH" = "armv6" -a "$OS_TARGET" = "Android"; then
MOZ_FPU=vfp
fi
MOZ_ARG_WITH_STRING(thumb,
[ --with-thumb[[=yes|no|toolchain-default]]]
[ Use Thumb instruction set (-mthumb)],
if test -z "$GNU_CC"; then
AC_MSG_ERROR([--with-thumb is not supported on non-GNU toolchains])
fi
MOZ_THUMB=$withval)
MOZ_ARG_WITH_STRING(thumb-interwork,
[ --with-thumb-interwork[[=yes|no|toolchain-default]]
Use Thumb/ARM instuctions interwork (-mthumb-interwork)],
if test -z "$GNU_CC"; then
AC_MSG_ERROR([--with-thumb-interwork is not supported on non-GNU toolchains])
fi
MOZ_THUMB_INTERWORK=$withval)
MOZ_ARG_WITH_STRING(fpu,
[ --with-fpu=[[type|toolchain-default]]
Use specific FPU type (-mfpu=type)],
if test -z "$GNU_CC"; then
AC_MSG_ERROR([--with-fpu is not supported on non-GNU toolchains])
fi
MOZ_FPU=$withval)
MOZ_ARG_WITH_STRING(float-abi,
[ --with-float-abi=[[type|toolchain-default]]
Use specific arm float ABI (-mfloat-abi=type)],
if test -z "$GNU_CC"; then
AC_MSG_ERROR([--with-float-abi is not supported on non-GNU toolchains])
fi
MOZ_FLOAT_ABI=$withval)
MOZ_ARG_WITH_STRING(soft-float,
[ --with-soft-float[[=yes|no|toolchain-default]]
Use soft float library (-msoft-float)],
if test -z "$GNU_CC"; then
AC_MSG_ERROR([--with-soft-float is not supported on non-GNU toolchains])
fi
MOZ_SOFT_FLOAT=$withval)
case "$MOZ_ARCH" in
toolchain-default|"")
arch_flag=""
;;
*)
arch_flag="-march=$MOZ_ARCH"
;;
esac
case "$MOZ_THUMB" in
yes)
MOZ_THUMB2=1
thumb_flag="-mthumb"
;;
no)
MOZ_THUMB2=
thumb_flag="-marm"
;;
*)
_SAVE_CFLAGS="$CFLAGS"
CFLAGS="$arch_flag"
AC_TRY_COMPILE([],[return sizeof(__thumb2__);],
MOZ_THUMB2=1,
MOZ_THUMB2=)
CFLAGS="$_SAVE_CFLAGS"
thumb_flag=""
;;
esac
if test "$MOZ_THUMB2" = 1; then
AC_DEFINE(MOZ_THUMB2)
fi
case "$MOZ_THUMB_INTERWORK" in
yes)
thumb_interwork_flag="-mthumb-interwork"
;;
no)
thumb_interwork_flag="-mno-thumb-interwork"
;;
*) # toolchain-default
thumb_interwork_flag=""
;;
esac
case "$MOZ_FPU" in
toolchain-default|"")
fpu_flag=""
;;
*)
fpu_flag="-mfpu=$MOZ_FPU"
;;
esac
case "$MOZ_FLOAT_ABI" in
toolchain-default|"")
float_abi_flag=""
;;
*)
float_abi_flag="-mfloat-abi=$MOZ_FLOAT_ABI"
;;
esac
case "$MOZ_SOFT_FLOAT" in
yes)
soft_float_flag="-msoft-float"
;;
no)
soft_float_flag="-mno-soft-float"
;;
*) # toolchain-default
soft_float_flag=""
;;
esac
case "$MOZ_ALIGN" in
no)
align_flag="-mno-unaligned-access"
;;
yes)
align_flag="-munaligned-access"
;;
*)
align_flag=""
;;
esac
if test -n "$align_flag"; then
_SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $align_flag"
AC_MSG_CHECKING(whether alignment flag ($align_flag) is supported)
AC_TRY_COMPILE([],[],,align_flag="")
CFLAGS="$_SAVE_CFLAGS"
fi
dnl Use echo to avoid accumulating space characters
all_flags=`echo $arch_flag $thumb_flag $thumb_interwork_flag $fpu_flag $float_abi_flag $soft_float_flag $align_flag`
if test -n "$all_flags"; then
_SAVE_CFLAGS="$CFLAGS"
CFLAGS="$all_flags"
AC_MSG_CHECKING(whether the chosen combination of compiler flags ($all_flags) works)
AC_TRY_COMPILE([],[return 0;],
AC_MSG_RESULT([yes]),
AC_MSG_ERROR([no]))
CFLAGS="$_SAVE_CFLAGS $all_flags"
CXXFLAGS="$CXXFLAGS $all_flags"
ASFLAGS="$ASFLAGS $all_flags"
if test -n "$thumb_flag"; then
LDFLAGS="$LDFLAGS $thumb_flag"
fi
fi
AC_SUBST(MOZ_THUMB2)
if test "$CPU_ARCH" = "arm"; then
AC_MSG_CHECKING(for ARM SIMD support in compiler)
# We try to link so that this also fails when
# building with LTO.
AC_TRY_LINK([],
[asm("uqadd8 r1, r1, r2");],
result="yes", result="no")
AC_MSG_RESULT("$result")
if test "$result" = "yes"; then
AC_DEFINE(HAVE_ARM_SIMD)
HAVE_ARM_SIMD=1
fi
AC_MSG_CHECKING(ARM version support in compiler)
dnl Determine the target ARM architecture (5 for ARMv5, v5T, v5E, etc.; 6 for ARMv6, v6K, etc.)
ARM_ARCH=`${CC-cc} ${CFLAGS} -dM -E - < /dev/null | sed -n 's/.*__ARM_ARCH_\([[0-9]]*\).*/\1/p'`
AC_MSG_RESULT("$ARM_ARCH")
AC_MSG_CHECKING(for ARM NEON support in compiler)
# We try to link so that this also fails when
# building with LTO.
AC_TRY_LINK([],
[asm(".fpu neon\n vadd.i8 d0, d0, d0");],
result="yes", result="no")
AC_MSG_RESULT("$result")
if test "$result" = "yes"; then
AC_DEFINE(HAVE_ARM_NEON)
HAVE_ARM_NEON=1
dnl We don't need to build NEON support if we're targetting a non-NEON device.
dnl This matches media/webrtc/trunk/webrtc/build/common.gypi.
if test -n "$ARM_ARCH"; then
if test "$ARM_ARCH" -lt 7; then
BUILD_ARM_NEON=
else
AC_DEFINE(BUILD_ARM_NEON)
BUILD_ARM_NEON=1
fi
fi
fi
fi # CPU_ARCH = arm
AC_SUBST(HAVE_ARM_SIMD)
AC_SUBST(HAVE_ARM_NEON)
AC_SUBST(BUILD_ARM_NEON)
AC_SUBST(ARM_ARCH)
if test -n "$MOZ_ARCH"; then
NSPR_CONFIGURE_ARGS="$NSPR_CONFIGURE_ARGS --with-arch=$MOZ_ARCH"
NSPR_CONFIGURE_ARGS="$NSPR_CONFIGURE_ARGS --with-thumb=$MOZ_THUMB"
NSPR_CONFIGURE_ARGS="$NSPR_CONFIGURE_ARGS --with-thumb-interwork=$MOZ_THUMB_INTERWORK"
NSPR_CONFIGURE_ARGS="$NSPR_CONFIGURE_ARGS --with-fpu=$MOZ_FPU"
NSPR_CONFIGURE_ARGS="$NSPR_CONFIGURE_ARGS --with-float-abi=$MOZ_FLOAT_ABI"
NSPR_CONFIGURE_ARGS="$NSPR_CONFIGURE_ARGS --with-soft-float=$MOZ_SOFT_FLOAT"
fi
])

View File

@ -1,36 +0,0 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
dnl ======================================================
dnl = Enable compiling with ccache
dnl ======================================================
AC_DEFUN([MOZ_CHECK_CCACHE],
[
MOZ_ARG_WITH_STRING(ccache,
[ --with-ccache[=path/to/ccache]
Enable compiling with ccache],
CCACHE=$withval, CCACHE="no")
if test "$CCACHE" != "no"; then
if test -z "$CCACHE" -o "$CCACHE" = "yes"; then
CCACHE=
else
if test ! -e "$CCACHE"; then
AC_MSG_ERROR([$CCACHE not found])
fi
fi
MOZ_PATH_PROGS(CCACHE, $CCACHE ccache)
if test -z "$CCACHE" -o "$CCACHE" = ":"; then
AC_MSG_ERROR([ccache not found])
elif test -x "$CCACHE"; then
CC="$CCACHE $CC"
CXX="$CCACHE $CXX"
MOZ_USING_CCACHE=1
else
AC_MSG_ERROR([$CCACHE is not executable])
fi
fi
AC_SUBST(MOZ_USING_CCACHE)
])

View File

@ -1,60 +0,0 @@
# 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/.
# This script returns the number of items for the DW_AT_ranges corresponding
# to a given compilation unit. This is used as a helper to find a bug in some
# versions of GNU ld.
import subprocess
import sys
import re
def get_range_for(compilation_unit, debug_info):
'''Returns the range offset for a given compilation unit
in a given debug_info.'''
name = ranges = ''
search_cu = False
for nfo in debug_info.splitlines():
if 'DW_TAG_compile_unit' in nfo:
search_cu = True
elif 'DW_TAG_' in nfo or not nfo.strip():
if name == compilation_unit and ranges != '':
return int(ranges, 16)
name = ranges = ''
search_cu = False
if search_cu:
if 'DW_AT_name' in nfo:
name = nfo.rsplit(None, 1)[1]
elif 'DW_AT_ranges' in nfo:
ranges = nfo.rsplit(None, 1)[1]
return None
def get_range_length(range, debug_ranges):
'''Returns the number of items in the range starting at the
given offset.'''
length = 0
for line in debug_ranges.splitlines():
m = re.match('\s*([0-9a-fA-F]+)\s+([0-9a-fA-F]+)\s+([0-9a-fA-F]+)', line)
if m and int(m.group(1), 16) == range:
length += 1
return length
def main(bin, compilation_unit):
p = subprocess.Popen(['objdump', '-W', bin], stdout = subprocess.PIPE, stderr = subprocess.PIPE)
(out, err) = p.communicate()
sections = re.split('\n(Contents of the|The section) ', out)
debug_info = [s for s in sections if s.startswith('.debug_info')]
debug_ranges = [s for s in sections if s.startswith('.debug_ranges')]
if not debug_ranges or not debug_info:
return 0
range = get_range_for(compilation_unit, debug_info[0])
if range is not None:
return get_range_length(range, debug_ranges[0])
return -1
if __name__ == '__main__':
print main(*sys.argv[1:])

View File

@ -1,24 +0,0 @@
# codeset.m4 serial AM1 (gettext-0.10.40)
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
dnl Public License, this file may be distributed as part of a program
dnl that contains a configuration script generated by Autoconf, under
dnl the same distribution terms as the rest of that program.
dnl From Bruno Haible.
AC_DEFUN([AM_LANGINFO_CODESET],
[
AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
[AC_TRY_LINK([#include <langinfo.h>],
[char* cs = nl_langinfo(CODESET);],
am_cv_langinfo_codeset=yes,
am_cv_langinfo_codeset=no)
])
if test $am_cv_langinfo_codeset = yes; then
AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
[Define if you have <langinfo.h> and nl_langinfo(CODESET).])
HAVE_LANGINFO_CODESET=1
fi
])

View File

@ -1,375 +0,0 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
dnl Add compiler specific options
AC_DEFUN([MOZ_DEFAULT_COMPILER],
[
dnl set DEVELOPER_OPTIONS early; MOZ_DEFAULT_COMPILER is usually the first non-setup directive
if test -z "$MOZILLA_OFFICIAL"; then
DEVELOPER_OPTIONS=1
fi
MOZ_ARG_ENABLE_BOOL(release,
[ --enable-release Build with more conservative, release engineering-oriented options.
This may slow down builds.],
DEVELOPER_OPTIONS=,
DEVELOPER_OPTIONS=1)
AC_SUBST(DEVELOPER_OPTIONS)
dnl Default to MSVC for win32 and gcc-4.2 for darwin
dnl ==============================================================
if test -z "$CROSS_COMPILE"; then
case "$target" in
*-mingw*)
if test -z "$CC"; then CC=cl; fi
if test -z "$CXX"; then CXX=cl; fi
if test -z "$CPP"; then CPP="cl -E -nologo"; fi
if test -z "$CXXCPP"; then CXXCPP="cl -TP -E -nologo"; ac_cv_prog_CXXCPP="$CXXCPP"; fi
if test -z "$LD"; then LD=link; fi
if test -z "$AS"; then
case "${target_cpu}" in
i*86)
AS=ml;
;;
x86_64)
AS=ml64;
;;
esac
fi
if test -z "$MIDL"; then MIDL=midl; fi
# need override this flag since we don't use $(LDFLAGS) for this.
if test -z "$HOST_LDFLAGS" ; then
HOST_LDFLAGS=" "
fi
;;
*-darwin*)
# GCC on darwin is based on gcc 4.2 and we don't support it anymore.
if test -z "$CC"; then
MOZ_PATH_PROGS(CC, clang)
fi
if test -z "$CXX"; then
MOZ_PATH_PROGS(CXX, clang++)
fi
IS_GCC=$($CC -v 2>&1 | grep gcc)
if test -n "$IS_GCC"
then
echo gcc is known to be broken on OS X, please use clang.
echo see http://developer.mozilla.org/en-US/docs/Developer_Guide/Build_Instructions/Mac_OS_X_Prerequisites
echo for more information.
exit 1
fi
;;
esac
fi
])
dnl ============================================================================
dnl C++ rtti
dnl We don't use it in the code, but it can be usefull for debugging, so give
dnl the user the option of enabling it.
dnl ============================================================================
AC_DEFUN([MOZ_RTTI],
[
MOZ_ARG_ENABLE_BOOL(cpp-rtti,
[ --enable-cpp-rtti Enable C++ RTTI ],
[ _MOZ_USE_RTTI=1 ],
[ _MOZ_USE_RTTI= ])
if test -z "$_MOZ_USE_RTTI"; then
if test "$GNU_CC"; then
CXXFLAGS="$CXXFLAGS -fno-rtti"
else
case "$target" in
*-mingw*)
CXXFLAGS="$CXXFLAGS -GR-"
esac
fi
fi
])
dnl ========================================================
dnl =
dnl = Debugging Options
dnl =
dnl ========================================================
AC_DEFUN([MOZ_DEBUGGING_OPTS],
[
dnl Debug info is ON by default.
if test -z "$MOZ_DEBUG_FLAGS"; then
MOZ_DEBUG_FLAGS="-g"
fi
MOZ_ARG_ENABLE_STRING(debug,
[ --enable-debug[=DBG] Enable building with developer debug info
(using compiler flags DBG)],
[ if test "$enableval" != "no"; then
MOZ_DEBUG=1
if test -n "$enableval" -a "$enableval" != "yes"; then
MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
_MOZ_DEBUG_FLAGS_SET=1
fi
else
MOZ_DEBUG=
fi ],
MOZ_DEBUG=)
MOZ_DEBUG_ENABLE_DEFS="-DDEBUG -D_DEBUG -DTRACING"
MOZ_ARG_WITH_STRING(debug-label,
[ --with-debug-label=LABELS
Define DEBUG_<value> for each comma-separated
value given.],
[ for option in `echo $withval | sed 's/,/ /g'`; do
MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_${option}"
done])
MOZ_DEBUG_DISABLE_DEFS="-DNDEBUG -DTRIMMED"
if test -n "$MOZ_DEBUG"; then
AC_MSG_CHECKING([for valid debug flags])
_SAVE_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $MOZ_DEBUG_FLAGS"
AC_TRY_COMPILE([#include <stdio.h>],
[printf("Hello World\n");],
_results=yes,
_results=no)
AC_MSG_RESULT([$_results])
if test "$_results" = "no"; then
AC_MSG_ERROR([These compiler flags are invalid: $MOZ_DEBUG_FLAGS])
fi
CFLAGS=$_SAVE_CFLAGS
fi
dnl ========================================================
dnl = Enable generation of debug symbols
dnl ========================================================
MOZ_ARG_ENABLE_STRING(debug-symbols,
[ --enable-debug-symbols[=DBG]
Enable debugging symbols (using compiler flags DBG)],
[ if test "$enableval" != "no"; then
MOZ_DEBUG_SYMBOLS=1
if test -n "$enableval" -a "$enableval" != "yes"; then
if test -z "$_MOZ_DEBUG_FLAGS_SET"; then
MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
else
AC_MSG_ERROR([--enable-debug-symbols flags cannot be used with --enable-debug flags])
fi
fi
else
MOZ_DEBUG_SYMBOLS=
fi ],
MOZ_DEBUG_SYMBOLS=1)
if test -n "$MOZ_DEBUG" -o -n "$MOZ_DEBUG_SYMBOLS"; then
AC_DEFINE(MOZ_DEBUG_SYMBOLS)
export MOZ_DEBUG_SYMBOLS
fi
])
dnl A high level macro for selecting compiler options.
AC_DEFUN([MOZ_COMPILER_OPTS],
[
if test "${MOZ_PSEUDO_DERECURSE-unset}" = unset; then
dnl Don't enable on pymake, because of bug 918652. Bug 912979 is an annoyance
dnl with pymake, too.
MOZ_PSEUDO_DERECURSE=no-pymake
fi
MOZ_DEBUGGING_OPTS
MOZ_RTTI
if test "$CLANG_CXX"; then
## We disable return-type-c-linkage because jsval is defined as a C++ type but is
## returned by C functions. This is possible because we use knowledge about the ABI
## to typedef it to a C type with the same layout when the headers are included
## from C.
##
## mismatched-tags is disabled (bug 780474) mostly because it's useless.
## Worse, it's not supported by gcc, so it will cause tryserver bustage
## without any easy way for non-Clang users to check for it.
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-unknown-warning-option -Wno-return-type-c-linkage -Wno-mismatched-tags"
fi
AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) actually is a C++ compiler])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
_SAVE_LIBS=$LIBS
LIBS=
AC_TRY_LINK([#include <new>], [int *foo = new int;],,
AC_MSG_RESULT([no])
AC_MSG_ERROR([$CXX $CXXFLAGS $LDFLAGS failed to compile and link a simple C++ source.]))
LIBS=$_SAVE_LIBS
AC_LANG_RESTORE
AC_MSG_RESULT([yes])
if test -z "$GNU_CC"; then
case "$target" in
*-mingw*)
## Warning 4099 (equivalent of mismatched-tags) is disabled (bug 780474)
## for the same reasons as above.
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -wd4099"
esac
fi
if test -n "$DEVELOPER_OPTIONS"; then
MOZ_FORCE_GOLD=1
fi
MOZ_ARG_ENABLE_BOOL(gold,
[ --enable-gold Enable GNU Gold Linker when it is not already the default],
MOZ_FORCE_GOLD=1,
MOZ_FORCE_GOLD=
)
if test "$GNU_CC" -a -n "$MOZ_FORCE_GOLD"; then
dnl if the default linker is BFD ld, check if gold is available and try to use it
dnl for local builds only.
if $CC -Wl,--version 2>&1 | grep -q "GNU ld"; then
GOLD=$($CC -print-prog-name=ld.gold)
case "$GOLD" in
/*)
;;
*)
GOLD=$(which $GOLD)
;;
esac
if test -n "$GOLD"; then
mkdir -p $_objdir/build/unix/gold
rm -f $_objdir/build/unix/gold/ld
ln -s "$GOLD" $_objdir/build/unix/gold/ld
if $CC -B $_objdir/build/unix/gold -Wl,--version 2>&1 | grep -q "GNU gold"; then
LDFLAGS="$LDFLAGS -B $_objdir/build/unix/gold"
else
rm -rf $_objdir/build/unix/gold
fi
fi
fi
fi
if test "$GNU_CC"; then
if test -z "$DEVELOPER_OPTIONS"; then
CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
CXXFLAGS="$CXXFLAGS -ffunction-sections -fdata-sections"
fi
CFLAGS="$CFLAGS -fno-math-errno"
CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-math-errno"
fi
dnl ========================================================
dnl = Identical Code Folding
dnl ========================================================
MOZ_ARG_DISABLE_BOOL(icf,
[ --disable-icf Disable Identical Code Folding],
MOZ_DISABLE_ICF=1,
MOZ_DISABLE_ICF= )
if test "$GNU_CC" -a "$GCC_USE_GNU_LD" -a -z "$MOZ_DISABLE_ICF" -a -z "$DEVELOPER_OPTIONS"; then
AC_CACHE_CHECK([whether the linker supports Identical Code Folding],
LD_SUPPORTS_ICF,
[echo 'int foo() {return 42;}' \
'int bar() {return 42;}' \
'int main() {return foo() - bar();}' > conftest.${ac_ext}
# If the linker supports ICF, foo and bar symbols will have
# the same address
if AC_TRY_COMMAND([${CC-cc} -o conftest${ac_exeext} $LDFLAGS -Wl,--icf=safe -ffunction-sections conftest.${ac_ext} $LIBS 1>&2]) &&
test -s conftest${ac_exeext} &&
objdump -t conftest${ac_exeext} | awk changequote(<<, >>)'{a[<<$>>6] = <<$>>1} END {if (a["foo"] && (a["foo"] != a["bar"])) { exit 1 }}'changequote([, ]); then
LD_SUPPORTS_ICF=yes
else
LD_SUPPORTS_ICF=no
fi
rm -rf conftest*])
if test "$LD_SUPPORTS_ICF" = yes; then
_SAVE_LDFLAGS="$LDFLAGS -Wl,--icf=safe"
LDFLAGS="$LDFLAGS -Wl,--icf=safe -Wl,--print-icf-sections"
AC_TRY_LINK([], [],
[LD_PRINT_ICF_SECTIONS=-Wl,--print-icf-sections],
[LD_PRINT_ICF_SECTIONS=])
AC_SUBST([LD_PRINT_ICF_SECTIONS])
LDFLAGS="$_SAVE_LDFLAGS"
fi
fi
dnl ========================================================
dnl = Automatically remove dead symbols
dnl ========================================================
if test "$GNU_CC" -a "$GCC_USE_GNU_LD" -a -z "$DEVELOPER_OPTIONS"; then
if test -n "$MOZ_DEBUG_FLAGS"; then
dnl See bug 670659
AC_CACHE_CHECK([whether removing dead symbols breaks debugging],
GC_SECTIONS_BREAKS_DEBUG_RANGES,
[echo 'int foo() {return 42;}' \
'int bar() {return 1;}' \
'int main() {return foo();}' > conftest.${ac_ext}
if AC_TRY_COMMAND([${CC-cc} -o conftest.${ac_objext} $CFLAGS $MOZ_DEBUG_FLAGS -c conftest.${ac_ext} 1>&2]) &&
AC_TRY_COMMAND([${CC-cc} -o conftest${ac_exeext} $LDFLAGS $MOZ_DEBUG_FLAGS -Wl,--gc-sections conftest.${ac_objext} $LIBS 1>&2]) &&
test -s conftest${ac_exeext} -a -s conftest.${ac_objext}; then
if test "`$PYTHON "$_topsrcdir"/build/autoconf/check_debug_ranges.py conftest.${ac_objext} conftest.${ac_ext}`" = \
"`$PYTHON "$_topsrcdir"/build/autoconf/check_debug_ranges.py conftest${ac_exeext} conftest.${ac_ext}`"; then
GC_SECTIONS_BREAKS_DEBUG_RANGES=no
else
GC_SECTIONS_BREAKS_DEBUG_RANGES=yes
fi
else
dnl We really don't expect to get here, but just in case
GC_SECTIONS_BREAKS_DEBUG_RANGES="no, but it's broken in some other way"
fi
rm -rf conftest*])
if test "$GC_SECTIONS_BREAKS_DEBUG_RANGES" = no; then
DSO_LDOPTS="$DSO_LDOPTS -Wl,--gc-sections"
fi
else
DSO_LDOPTS="$DSO_LDOPTS -Wl,--gc-sections"
fi
fi
])
dnl GCC and clang will fail if given an unknown warning option like -Wfoobar.
dnl But later versions won't fail if given an unknown negated warning option
dnl like -Wno-foobar. So when we are check for support of negated warning
dnl options, we actually test the positive form, but add the negated form to
dnl the flags variable.
AC_DEFUN([MOZ_C_SUPPORTS_WARNING],
[
AC_CACHE_CHECK(whether the C compiler supports $1$2, $3,
[
AC_LANG_SAVE
AC_LANG_C
_SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror -W$2"
AC_TRY_COMPILE([],
[return(0);],
$3="yes",
$3="no")
CFLAGS="$_SAVE_CFLAGS"
AC_LANG_RESTORE
])
if test "${$3}" = "yes"; then
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} $1$2"
fi
])
AC_DEFUN([MOZ_CXX_SUPPORTS_WARNING],
[
AC_CACHE_CHECK(whether the C++ compiler supports $1$2, $3,
[
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
_SAVE_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -Werror -W$2"
AC_TRY_COMPILE([],
[return(0);],
$3="yes",
$3="no")
CXXFLAGS="$_SAVE_CXXFLAGS"
AC_LANG_RESTORE
])
if test "${$3}" = "yes"; then
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} $1$2"
fi
])

File diff suppressed because it is too large Load Diff

View File

@ -1,186 +0,0 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
dnl For use in AC_SUBST replacement
define([MOZ_DIVERSION_SUBST], 11)
dnl Replace AC_SUBST to store values in a format suitable for python.
dnl The necessary comma after the tuple can't be put here because it
dnl can mess around with things like:
dnl AC_SOMETHING(foo,AC_SUBST(),bar)
define([AC_SUBST],
[ifdef([AC_SUBST_SET_$1], [m4_fatal([Cannot use AC_SUBST and AC_SUBST_SET on the same variable ($1)])],
[ifdef([AC_SUBST_$1], ,
[define([AC_SUBST_$1], )dnl
AC_DIVERT_PUSH(MOZ_DIVERSION_SUBST)dnl
(''' $1 ''', r''' [$]$1 ''')
AC_DIVERT_POP()dnl
])])])
dnl Like AC_SUBST, but makes the value available as a set in python,
dnl with values got from the value of the environment variable, split on
dnl whitespaces.
define([AC_SUBST_SET],
[ifdef([AC_SUBST_$1], [m4_fatal([Cannot use AC_SUBST and AC_SUBST_SET on the same variable ($1)])],
[ifdef([AC_SUBST_SET_$1], ,
[define([AC_SUBST_SET_$1], )dnl
AC_DIVERT_PUSH(MOZ_DIVERSION_SUBST)dnl
(''' $1 ''', set(r''' [$]$1 '''.split()))
AC_DIVERT_POP()dnl
])])])
dnl Wrap AC_DEFINE to store values in a format suitable for python.
dnl autoconf's AC_DEFINE still needs to be used to fill confdefs.h,
dnl which is #included during some compile checks.
dnl The necessary comma after the tuple can't be put here because it
dnl can mess around with things like:
dnl AC_SOMETHING(foo,AC_DEFINE(),bar)
define([_MOZ_AC_DEFINE], defn([AC_DEFINE]))
define([AC_DEFINE],
[cat >> confdefs.pytmp <<\EOF
(''' $1 ''', ifelse($#, 2, [r''' $2 '''], $#, 3, [r''' $2 '''], ' 1 '))
EOF
ifelse($#, 2, _MOZ_AC_DEFINE([$1], [$2]), $#, 3, _MOZ_AC_DEFINE([$1], [$2], [$3]),_MOZ_AC_DEFINE([$1]))dnl
])
dnl Wrap AC_DEFINE_UNQUOTED to store values in a format suitable for
dnl python.
define([_MOZ_AC_DEFINE_UNQUOTED], defn([AC_DEFINE_UNQUOTED]))
define([AC_DEFINE_UNQUOTED],
[cat >> confdefs.pytmp <<EOF
(''' $1 ''', ifelse($#, 2, [r''' $2 '''], $#, 3, [r''' $2 '''], ' 1 '))
EOF
ifelse($#, 2, _MOZ_AC_DEFINE_UNQUOTED($1, $2), $#, 3, _MOZ_AC_DEFINE_UNQUOTED($1, $2, $3),_MOZ_AC_DEFINE_UNQUOTED($1))dnl
])
dnl Replace AC_OUTPUT to create and call a python config.status
define([_MOZ_AC_OUTPUT],
[dnl Top source directory in Windows format (as opposed to msys format).
WIN_TOP_SRC=
encoding=utf-8
case "$host_os" in
mingw*)
WIN_TOP_SRC=`cd $srcdir; pwd -W`
encoding=mbcs
;;
esac
AC_SUBST(WIN_TOP_SRC)
dnl Used in all Makefile.in files
top_srcdir=$srcdir
AC_SUBST(top_srcdir)
dnl Picked from autoconf 2.13
trap '' 1 2 15
AC_CACHE_SAVE
test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
: ${CONFIG_STATUS=./config.status}
dnl We're going to need [ ] for python syntax.
changequote(<<<, >>>)dnl
echo creating $CONFIG_STATUS
extra_python_path=${COMM_BUILD:+"'mozilla', "}
cat > $CONFIG_STATUS <<EOF
#!${PYTHON}
# coding=$encoding
import os
import types
dnl topsrcdir is the top source directory in native form, as opposed to a
dnl form suitable for make.
topsrcdir = '''${WIN_TOP_SRC:-$srcdir}'''
if not os.path.isabs(topsrcdir):
rel = os.path.join(os.path.dirname(<<<__file__>>>), topsrcdir)
topsrcdir = os.path.normpath(os.path.abspath(rel))
topobjdir = os.path.abspath(os.path.dirname(<<<__file__>>>))
dnl All defines and substs are stored with an additional space at the beginning
dnl and at the end of the string, to avoid any problem with values starting or
dnl ending with quotes.
defines = [(name[1:-1], value[1:-1]) for name, value in [
EOF
dnl confdefs.pytmp contains AC_DEFINEs, in the expected format, but
dnl lacks the final comma (see above).
sed 's/$/,/' confdefs.pytmp >> $CONFIG_STATUS
rm confdefs.pytmp confdefs.h
cat >> $CONFIG_STATUS <<\EOF
] ]
substs = [(name[1:-1], value[1:-1] if isinstance(value, types.StringTypes) else value) for name, value in [
EOF
dnl The MOZ_DIVERSION_SUBST output diversion contains AC_SUBSTs, in the
dnl expected format, but lacks the final comma (see above).
sed 's/$/,/' >> $CONFIG_STATUS <<EOF
undivert(MOZ_DIVERSION_SUBST)dnl
EOF
dnl Add in the output from the subconfigure script
for ac_subst_arg in $_subconfigure_ac_subst_args; do
variable='$'$ac_subst_arg
echo " (''' $ac_subst_arg ''', r''' `eval echo $variable` ''')," >> $CONFIG_STATUS
done
cat >> $CONFIG_STATUS <<\EOF
] ]
dnl List of AC_DEFINEs that aren't to be exposed in ALLDEFINES
non_global_defines = [
EOF
if test -n "$_NON_GLOBAL_ACDEFINES"; then
for var in $_NON_GLOBAL_ACDEFINES; do
echo " '$var'," >> $CONFIG_STATUS
done
fi
cat >> $CONFIG_STATUS <<EOF
]
__all__ = ['topobjdir', 'topsrcdir', 'defines', 'non_global_defines', 'substs']
dnl Do the actual work
if __name__ == '__main__':
args = dict([(name, globals()[name]) for name in __all__])
import sys
dnl Don't rely on virtualenv here. Standalone js doesn't use it.
sys.path.append(os.path.join(topsrcdir, ${extra_python_path}'build'))
from ConfigStatus import config_status
config_status(**args)
EOF
changequote([, ])
chmod +x $CONFIG_STATUS
rm -fr confdefs* $ac_clean_files
dnl Execute config.status, unless --no-create was passed to configure.
if test "$no_create" != yes && ! ${PYTHON} $CONFIG_STATUS; then
trap '' EXIT
exit 1
fi
])
define([m4_fatal],[
errprint([$1
])
m4exit(1)
])
define([AC_OUTPUT], [ifelse($#_$1, 1_, [_MOZ_AC_OUTPUT()],
[m4_fatal([Use CONFIGURE_SUBST_FILES in moz.build files to create substituted files.])]
)])
define([AC_CONFIG_HEADER],
[m4_fatal([Use CONFIGURE_DEFINE_FILES in moz.build files to produce header files.])
])
AC_SUBST([MOZ_PSEUDO_DERECURSE])

File diff suppressed because it is too large Load Diff

View File

@ -1,66 +0,0 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
AC_DEFUN([MOZ_EXPAND_LIBS],
[
dnl ========================================================
dnl =
dnl = Check what kind of list files are supported by the
dnl = linker
dnl =
dnl ========================================================
AC_CACHE_CHECK(what kind of list files are supported by the linker,
EXPAND_LIBS_LIST_STYLE,
[echo "int main() {return 0;}" > conftest.${ac_ext}
if AC_TRY_COMMAND(${CC-cc} -o conftest.${OBJ_SUFFIX} -c $CFLAGS $CPPFLAGS conftest.${ac_ext} 1>&5) && test -s conftest.${OBJ_SUFFIX}; then
echo "INPUT(conftest.${OBJ_SUFFIX})" > conftest.list
if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $LDFLAGS conftest.list $LIBS 1>&5) && test -s conftest${ac_exeext}; then
EXPAND_LIBS_LIST_STYLE=linkerscript
else
echo "conftest.${OBJ_SUFFIX}" > conftest.list
dnl -filelist is for the OS X linker. We need to try -filelist
dnl first because clang understands @file, but may pass an
dnl oversized argument list to the linker depending on the
dnl contents of @file.
if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $LDFLAGS [-Wl,-filelist,conftest.list] $LIBS 1>&5) && test -s conftest${ac_exeext}; then
EXPAND_LIBS_LIST_STYLE=filelist
elif AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $LDFLAGS @conftest.list $LIBS 1>&5) && test -s conftest${ac_exeext}; then
EXPAND_LIBS_LIST_STYLE=list
else
EXPAND_LIBS_LIST_STYLE=none
fi
fi
else
dnl We really don't expect to get here, but just in case
AC_ERROR([couldn't compile a simple C file])
fi
rm -rf conftest*])
LIBS_DESC_SUFFIX=desc
AC_SUBST(LIBS_DESC_SUFFIX)
AC_SUBST(EXPAND_LIBS_LIST_STYLE)
if test "$GCC_USE_GNU_LD"; then
AC_CACHE_CHECK(what kind of ordering can be done with the linker,
EXPAND_LIBS_ORDER_STYLE,
[> conftest.order
_SAVE_LDFLAGS="$LDFLAGS"
LDFLAGS="${LDFLAGS} -Wl,--section-ordering-file,conftest.order"
AC_TRY_LINK([], [],
EXPAND_LIBS_ORDER_STYLE=section-ordering-file,
EXPAND_LIBS_ORDER_STYLE=)
LDFLAGS="$_SAVE_LDFLAGS"
if test -z "$EXPAND_LIBS_ORDER_STYLE"; then
if AC_TRY_COMMAND(${CC-cc} ${DSO_LDOPTS} ${LDFLAGS} -o ${DLL_PREFIX}conftest${DLL_SUFFIX} -Wl,--verbose 2> /dev/null | sed -n '/^===/,/^===/p' | grep '\.text'); then
EXPAND_LIBS_ORDER_STYLE=linkerscript
else
EXPAND_LIBS_ORDER_STYLE=none
fi
rm -f ${DLL_PREFIX}conftest${DLL_SUFFIX}
fi])
fi
AC_SUBST(EXPAND_LIBS_ORDER_STYLE)
])

View File

@ -1,38 +0,0 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
dnl Set MOZ_FRAMEPTR_FLAGS to the flags that should be used for enabling or
dnl disabling frame pointers in this architecture based on the configure
dnl options
AC_DEFUN([MOZ_SET_FRAMEPTR_FLAGS], [
case "$target" in
*android*)
unwind_tables="-funwind-tables"
;;
esac
if test "$GNU_CC"; then
MOZ_ENABLE_FRAME_PTR="-fno-omit-frame-pointer $unwind_tables"
MOZ_DISABLE_FRAME_PTR="-fomit-frame-pointer"
if test "$CPU_ARCH" = arm; then
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54398
MOZ_ENABLE_FRAME_PTR="$unwind_tables"
fi
else
case "$target" in
*-mingw*)
MOZ_ENABLE_FRAME_PTR="-Oy-"
MOZ_DISABLE_FRAME_PTR="-Oy"
;;
esac
fi
# if we are debugging or profiling, we want a frame pointer.
if test -z "$MOZ_OPTIMIZE" -o \
-n "$MOZ_PROFILING" -o -n "$MOZ_DEBUG"; then
MOZ_FRAMEPTR_FLAGS="$MOZ_ENABLE_FRAME_PTR"
else
MOZ_FRAMEPTR_FLAGS="$MOZ_DISABLE_FRAME_PTR"
fi
])

View File

@ -1,37 +0,0 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
dnl Check if the compiler is gcc and has pr39608. If so
dnl disable vrp.
AC_DEFUN([MOZ_GCC_PR39608],
[
AC_MSG_CHECKING(for gcc pr39608)
ac_have_gcc_pr39608="yes"
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([
typedef void (*FuncType)();
template<FuncType Impl>
void f();
template<typename T> class C {
typedef C<T> ThisC;
template<int g()>
static void h() {
f<ThisC::h<g> >();
}
};
], true,
ac_have_gcc_pr39608="no",
true)
AC_LANG_RESTORE
AC_MSG_RESULT($ac_have_gcc_pr39608)
if test "$ac_have_gcc_pr39608" = "yes"; then
echo This compiler would fail to build firefox, please upgrade.
exit 1
fi
])

View File

@ -1,71 +0,0 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
dnl Check if the compiler is gcc and has PR49911. If so
dnl disable vrp.
AC_DEFUN([MOZ_GCC_PR49911],
[
if test "$GNU_CC"; then
AC_MSG_CHECKING(for gcc PR49911)
ac_have_gcc_pr49911="no"
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
_SAVE_CXXFLAGS=$CXXFLAGS
CXXFLAGS="-O2"
AC_TRY_RUN([
extern "C" void abort(void);
typedef enum {
eax, ecx, edx, ebx, esp, ebp,
esi, edi }
RegisterID;
union StateRemat {
RegisterID reg_;
int offset_;
};
static StateRemat FromRegister(RegisterID reg) {
StateRemat sr;
sr.reg_ = reg;
return sr;
}
static StateRemat FromAddress3(int address) {
StateRemat sr;
sr.offset_ = address;
if (address < 46 && address >= 0) {
abort();
}
return sr;
}
struct FrameState {
StateRemat dataRematInfo2(bool y, int z) {
if (y) return FromRegister(RegisterID(1));
return FromAddress3(z);
}
};
FrameState frame;
StateRemat x;
__attribute__((noinline)) void jsop_setelem(bool y, int z) {
x = frame.dataRematInfo2(y, z);
}
int main(void) {
jsop_setelem(0, 47);
}
], true,
ac_have_gcc_pr49911="yes",
true)
CXXFLAGS="$_SAVE_CXXFLAGS"
AC_LANG_RESTORE
if test "$ac_have_gcc_pr49911" = "yes"; then
AC_MSG_RESULT(yes)
CFLAGS="$CFLAGS -fno-tree-vrp"
CXXFLAGS="$CXXFLAGS -fno-tree-vrp"
else
AC_MSG_RESULT(no)
fi
fi
])

View File

@ -1,53 +0,0 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
dnl Output the contents of config.log when configure exits with an
dnl error code.
define([MOZ_CONFIG_LOG_TRAP],
[changequote(<<<, >>>)dnl
trap '[ "$?" != 0 ] && echo "------ config.log ------" && tail -n 25 config.log' EXIT
changequote([, ])dnl
])
dnl Wrap AC_INIT_PREPARE to add the above trap.
define([_MOZ_AC_INIT_PREPARE], defn([AC_INIT_PREPARE]))
define([AC_INIT_PREPARE],
[_MOZ_AC_INIT_PREPARE($1)
MOZ_CONFIG_LOG_TRAP
])
dnl Disable the trap when running sub-configures.
define([_MOZ_AC_OUTPUT_SUBDIRS], defn([AC_OUTPUT_SUBDIRS]))
define([MOZ_SUBCONFIGURE_WRAP],
[ _CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
case "$host" in
*-mingw*)
_CONFIG_SHELL=$(cd $(dirname $_CONFIG_SHELL); pwd -W)/$(basename $_CONFIG_SHELL)
if test ! -e "$_CONFIG_SHELL" -a -e "${_CONFIG_SHELL}.exe"; then
_CONFIG_SHELL="${_CONFIG_SHELL}.exe"
fi
;;
esac
if test -d "$1"; then
(cd "$1"; $PYTHON $_topsrcdir/build/subconfigure.py dump "$_CONFIG_SHELL")
fi
$2
(cd "$1"; $PYTHON $_topsrcdir/build/subconfigure.py adjust)
])
define([AC_OUTPUT_SUBDIRS],
[trap '' EXIT
for moz_config_dir in $1; do
MOZ_SUBCONFIGURE_WRAP([$moz_config_dir],[
_MOZ_AC_OUTPUT_SUBDIRS($moz_config_dir)
])
done
MOZ_CONFIG_LOG_TRAP
])
dnl Print error messages in config.log as well as stderr
define([AC_MSG_ERROR],
[{ echo "configure: error: $1" 1>&2; echo "configure: error: $1" 1>&5; exit 1; }])

View File

@ -1,31 +0,0 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
dnl Set the MOZ_ICU_VERSION variable to denote the current version of the
dnl ICU library, and also the MOZ_SHARED_ICU which would be true if we are
dnl linking against a shared library of ICU, either one that we build from
dnl our copy of ICU or the system provided library.
AC_DEFUN([MOZ_CONFIG_ICU], [
icudir="$_topsrcdir/intl/icu/source"
if test ! -d "$icudir"; then
icudir="$_topsrcdir/../../intl/icu/source"
if test ! -d "$icudir"; then
AC_MSG_ERROR([Cannot find the ICU directory])
fi
fi
version=`sed -n 's/^[[:space:]]*#[[:space:]]*define[[:space:]][[:space:]]*U_ICU_VERSION_MAJOR_NUM[[:space:]][[:space:]]*\([0-9][0-9]*\)[[:space:]]*$/\1/p' "$icudir/common/unicode/uvernum.h"`
if test x"$version" = x; then
AC_MSG_ERROR([cannot determine icu version number from uvernum.h header file $lineno])
fi
MOZ_ICU_VERSION="$version"
if test -z "${JS_STANDALONE}" -a -n "${JS_SHARED_LIBRARY}${MOZ_NATIVE_ICU}"; then
MOZ_SHARED_ICU=1
fi
AC_SUBST(MOZ_ICU_VERSION)
AC_SUBST(MOZ_SHARED_ICU)
])

View File

@ -1,123 +0,0 @@
#!/bin/sh
# 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/.
#
# install - install a program, script, or datafile
# This comes from X11R5; it is not part of GNU.
#
# $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $
#
# This script is compatible with the BSD install script, but was written
# from scratch.
#
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
instcmd="$mvprog"
chmodcmd=""
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
fi
# Make a temp file name in the proper directory.
dstdir=`dirname $dst`
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp
# and set any options; do chmod last to preserve setuid bits
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi
# Now rename the file to the real destination.
$doit $rmcmd $dst
$doit $mvcmd $dsttmp $dst
exit 0

View File

@ -1,39 +0,0 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
AC_DEFUN([MOZ_LINUX_PERF_EVENT],
[
MOZ_ARG_WITH_STRING(linux-headers,
[ --with-linux-headers=DIR
location where the Linux kernel headers can be found],
linux_headers=$withval)
LINUX_HEADERS_INCLUDES=
if test "$linux_headers"; then
LINUX_HEADERS_INCLUDES="-I$linux_headers"
fi
_SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $LINUX_HEADERS_INCLUDES"
dnl Performance measurement headers.
MOZ_CHECK_HEADER(linux/perf_event.h,
[AC_CACHE_CHECK(for perf_event_open system call,ac_cv_perf_event_open,
[AC_TRY_COMPILE([#include <asm/unistd.h>],[return sizeof(__NR_perf_event_open);],
ac_cv_perf_event_open=yes,
ac_cv_perf_event_open=no)])])
if test "$ac_cv_perf_event_open" = "yes"; then
HAVE_LINUX_PERF_EVENT_H=1
else
HAVE_LINUX_PERF_EVENT_H=
LINUX_HEADERS_INCLUDES=
fi
AC_SUBST(HAVE_LINUX_PERF_EVENT_H)
AC_SUBST(LINUX_HEADERS_INCLUDES)
CFLAGS="$_SAVE_CFLAGS"
])

View File

@ -1,52 +0,0 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
dnl Check if the compiler suffers from http://llvm.org/pr8927. If so, ask the
dnl user to upgrade.
AC_DEFUN([MOZ_LLVM_PR8927],
[
AC_MSG_CHECKING(for llvm pr8927)
ac_have_llvm_pr8927="no"
AC_LANG_SAVE
AC_LANG_C
_SAVE_CFLAGS=$CFLAGS
CFLAGS="-O2"
AC_TRY_RUN([
struct foobar {
int x;
};
static const struct foobar* foo() {
static const struct foobar d = { 0 };
return &d;
}
static const struct foobar* bar() {
static const struct foobar d = { 0 };
return &d;
}
__attribute__((noinline)) int zed(const struct foobar *a,
const struct foobar *b) {
return a == b;
}
int main() {
return zed(foo(), bar());
}
], true,
ac_have_llvm_pr8927="yes",
true)
CFLAGS="$_SAVE_CFLAGS"
AC_LANG_RESTORE
if test "$ac_have_llvm_pr8927" = "yes"; then
AC_MSG_RESULT(yes)
echo This compiler would miscompile firefox, please upgrade.
echo see http://developer.mozilla.org/en-US/docs/Developer_Guide/Build_Instructions/Mac_OS_X_Prerequisites
echo for more information.
exit 1
else
AC_MSG_RESULT(no)
fi
])

View File

@ -1,19 +0,0 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
dnl check if the build is using lto. This is really primitive and only detects llvm based
dnl compilers right now.
AC_DEFUN([MOZ_DOING_LTO],
[
cat > conftest.c <<EOF
int foo = 1;
EOF
$1=no
if ${CC-cc} ${CFLAGS} -S conftest.c -o conftest.s >/dev/null 2>&1; then
if grep '^target triple =' conftest.s; then
$1=yes
fi
fi
rm -f conftest.[cs]
])

View File

@ -1,69 +0,0 @@
#!/bin/sh
#
# 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/.
#
# This script will match a dir with a set of dirs.
#
# Usage: match-dir.sh match [dir1 dir2 ... dirn]
#
# Send comments, improvements, bugs to ramiro@netscape.com
#
if [ -f Makefile ]; then
MAKEFILE="Makefile"
else
if [ -f Makefile.in ]; then
MAKEFILE="Makefile.in"
else
echo
echo "There ain't no 'Makefile' or 'Makefile.in' over here: $pwd, dude."
echo
exit 1
fi
fi
# Use DEPTH in the Makefile.in to determine the depth
depth=`grep -w DEPTH ${MAKEFILE} | grep "\.\." | awk -F"=" '{ print $2; }'`
cwd=`pwd`
# Determine the depth count
n=`echo $depth | tr '/' ' ' | wc -w`
cd $depth
objdir=`pwd`
path=`echo $cwd | sed "s|^${objdir}/||"`
match=$path
for i in $*
do
# echo "Looking for $match in $i"
echo $i | grep -q -x $match
if [ $? -eq 0 ]
then
echo "1"
exit 0
fi
# echo "Looking for $i in $match"
echo $match | grep -q $i
if [ $? -eq 0 ]
then
echo "1"
exit 0
fi
done
echo "0"
exit 0

View File

@ -1,9 +0,0 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
AC_DEFUN(MOZ_CHECK_COMMON_HEADERS,
MOZ_CHECK_HEADERS(sys/byteorder.h compat.h getopt.h sys/bitypes.h \
memory.h unistd.h gnu/libc-version.h nl_types.h malloc.h \
X11/XKBlib.h io.h cpuid.h)
)

View File

@ -1,32 +0,0 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
dnl MOZ_CHECK_HEADER(HEADER-FILE, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, INCLUDES]]])
AC_DEFUN([MOZ_CHECK_HEADER],
[ dnl Do the transliteration at runtime so arg 1 can be a shell variable.
ac_safe=`echo "$1" | sed 'y%./+-%__p_%'`
AC_MSG_CHECKING([for $1])
AC_CACHE_VAL(ac_cv_header_$ac_safe,
[ AC_TRY_COMPILE([$4
#include <$1>], ,
eval "ac_cv_header_$ac_safe=yes",
eval "ac_cv_header_$ac_safe=no") ])
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
ifelse([$3], , , [$3])
fi
])
dnl MOZ_CHECK_HEADERS(HEADER-FILE... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, INCLUDES]]])
AC_DEFUN([MOZ_CHECK_HEADERS],
[ for ac_hdr in $1
do
MOZ_CHECK_HEADER($ac_hdr,
[ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
AC_DEFINE_UNQUOTED($ac_tr_hdr) $2], $3, [$4])
done
])

View File

@ -1,42 +0,0 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
AC_DEFUN([MOZ_PROG_CHECKMSYS],
[AC_REQUIRE([AC_INIT_BINSH])dnl
if test `uname -s | grep -c MINGW 2>/dev/null` != "0"; then
msyshost=1
fi
])
AC_DEFUN([MOZ_PATH_PROG],
[ AC_PATH_PROG($1,$2,$3,$4)
if test "$msyshost"; then
case "[$]$1" in
/*)
tmp_DIRNAME=`dirname "[$]$1"`
tmp_BASENAME=`basename "[$]$1"`
tmp_PWD=`cd "$tmp_DIRNAME" && pwd -W`
$1="$tmp_PWD/$tmp_BASENAME"
if test -e "[$]$1.exe"; then
$1="[$]$1.exe"
fi
esac
fi
])
AC_DEFUN([MOZ_PATH_PROGS],
[ AC_PATH_PROGS($1,$2,$3,$4)
if test "$msyshost"; then
case "[$]$1" in
/*)
tmp_DIRNAME=`dirname "[$]$1"`
tmp_BASENAME=`basename "[$]$1"`
tmp_PWD=`cd "$tmp_DIRNAME" && pwd -W`
$1="$tmp_PWD/$tmp_BASENAME"
if test -e "[$]$1.exe"; then
$1="[$]$1.exe"
fi
esac
fi
])

View File

@ -1,102 +0,0 @@
# -*- tab-width: 4; -*-
# Configure paths for NSPR
# Public domain - Chris Seawood <cls@seawood.org> 2001-04-05
# Based upon gtk.m4 (also PD) by Owen Taylor
dnl AM_PATH_NSPR([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for NSPR, and define NSPR_CFLAGS and NSPR_LIBS
dnl
dnl If the nspr-config script is available, use it to find the
dnl appropriate CFLAGS and LIBS, and to check for the required
dnl version, and run ACTION-IF-FOUND.
dnl
dnl Otherwise, if NO_NSPR_CONFIG_SYSTEM_VERSION is set, we use it,
dnl NO_NSPR_CONFIG_SYSTEM_CFLAGS, and NO_NSPR_CONFIG_SYSTEM_LIBS to
dnl provide default values, and run ACTION-IF-FOUND. (Some systems
dnl ship NSPR without nspr-config, but can glean the appropriate flags
dnl and version.)
dnl
dnl Otherwise, run ACTION-IF-NOT-FOUND.
AC_DEFUN([AM_PATH_NSPR],
[dnl
AC_ARG_WITH(nspr-prefix,
[ --with-nspr-prefix=PFX Prefix where NSPR is installed],
nspr_config_prefix="$withval",
nspr_config_prefix="")
AC_ARG_WITH(nspr-exec-prefix,
[ --with-nspr-exec-prefix=PFX
Exec prefix where NSPR is installed],
nspr_config_exec_prefix="$withval",
nspr_config_exec_prefix="")
if test -n "$nspr_config_exec_prefix"; then
nspr_config_args="$nspr_config_args --exec-prefix=$nspr_config_exec_prefix"
if test -z "$NSPR_CONFIG"; then
NSPR_CONFIG=$nspr_config_exec_prefix/bin/nspr-config
fi
fi
if test -n "$nspr_config_prefix"; then
nspr_config_args="$nspr_config_args --prefix=$nspr_config_prefix"
if test -z "$NSPR_CONFIG"; then
NSPR_CONFIG=$nspr_config_prefix/bin/nspr-config
fi
fi
unset ac_cv_path_NSPR_CONFIG
AC_PATH_PROG(NSPR_CONFIG, nspr-config, no)
min_nspr_version=ifelse([$1], ,4.0.0,$1)
AC_MSG_CHECKING(for NSPR - version >= $min_nspr_version)
no_nspr=""
if test "$NSPR_CONFIG" != "no"; then
NSPR_CFLAGS=`$NSPR_CONFIG $nspr_config_args --cflags`
NSPR_LIBS=`$NSPR_CONFIG $nspr_config_args --libs`
NSPR_VERSION_STRING=`$NSPR_CONFIG $nspr_config_args --version`
elif test -n "${NO_NSPR_CONFIG_SYSTEM_VERSION}"; then
NSPR_CFLAGS="${NO_NSPR_CONFIG_SYSTEM_CFLAGS}"
NSPR_LIBS="${NO_NSPR_CONFIG_SYSTEM_LDFLAGS}"
NSPR_VERSION_STRING="$NO_NSPR_CONFIG_SYSTEM_VERSION"
else
no_nspr="yes"
fi
if test -z "$no_nspr"; then
nspr_config_major_version=`echo $NSPR_VERSION_STRING | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
nspr_config_minor_version=`echo $NSPR_VERSION_STRING | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
nspr_config_micro_version=`echo $NSPR_VERSION_STRING | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
min_nspr_major_version=`echo $min_nspr_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
min_nspr_minor_version=`echo $min_nspr_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
min_nspr_micro_version=`echo $min_nspr_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "$nspr_config_major_version" -ne "$min_nspr_major_version"; then
no_nspr="yes"
elif test "$nspr_config_major_version" -eq "$min_nspr_major_version" &&
test "$nspr_config_minor_version" -lt "$min_nspr_minor_version"; then
no_nspr="yes"
elif test "$nspr_config_major_version" -eq "$min_nspr_major_version" &&
test "$nspr_config_minor_version" -eq "$min_nspr_minor_version" &&
test "$nspr_config_micro_version" -lt "$min_nspr_micro_version"; then
no_nspr="yes"
fi
fi
if test -z "$no_nspr"; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
ifelse([$3], , :, [$3])
fi
AC_SUBST(NSPR_CFLAGS)
AC_SUBST(NSPR_LIBS)
])

View File

@ -1,63 +0,0 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
# PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
# defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
# also defines GSTUFF_PKG_ERRORS on error
AC_DEFUN([PKG_CHECK_MODULES],
[succeeded=no
if test -z "$PKG_CONFIG"; then
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
fi
if test "$PKG_CONFIG" = "no" ; then
echo "*** The pkg-config script could not be found. Make sure it is"
echo "*** in your path, or set the PKG_CONFIG environment variable"
echo "*** to the full path to pkg-config."
echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
else
PKG_CONFIG_MIN_VERSION=0.9.0
if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
AC_MSG_CHECKING(for $2)
if $PKG_CONFIG --exists "$2" ; then
AC_MSG_RESULT(yes)
succeeded=yes
AC_MSG_CHECKING($1_CFLAGS)
$1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
AC_MSG_RESULT($$1_CFLAGS)
AC_MSG_CHECKING($1_LIBS)
## Remove evil flags like -Wl,--export-dynamic
$1_LIBS="`$PKG_CONFIG --libs \"$2\" |sed s/-Wl,--export-dynamic//g`"
AC_MSG_RESULT($$1_LIBS)
else
$1_CFLAGS=""
$1_LIBS=""
## If we have a custom action on failure, don't print errors, but
## do set a variable so people can do so.
$1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
ifelse([$4], ,echo $$1_PKG_ERRORS,)
fi
AC_SUBST($1_CFLAGS)
AC_SUBST($1_LIBS)
else
echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
echo "*** See http://www.freedesktop.org/software/pkgconfig"
fi
fi
if test $succeeded = yes; then
ifelse([$3], , :, [$3])
else
if test "$COMPILE_ENVIRONMENT"; then
ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
fi
fi
])

View File

@ -1,85 +0,0 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
AC_DEFUN([MOZ_PYTHON],
[
dnl We honor the Python path defined in an environment variable. This is used
dnl to pass the virtualenv's Python from the main configure to SpiderMonkey's
dnl configure, for example.
if test -z "$PYTHON"; then
MOZ_PATH_PROGS(PYTHON, $PYTHON python2.7 python)
if test -z "$PYTHON"; then
AC_MSG_ERROR([python was not found in \$PATH])
fi
else
AC_MSG_RESULT([Using Python from environment variable \$PYTHON])
fi
_virtualenv_topsrcdir=
_virtualenv_populate_path=
dnl If this is a mozilla-central, we'll find the virtualenv in the top
dnl source directory. If this is a SpiderMonkey build, we assume we're at
dnl js/src and try to find the virtualenv from the mozilla-central root.
for base in $MOZILLA_CENTRAL_PATH $_topsrcdir $_topsrcdir/../..; do
possible=$base/python/mozbuild/mozbuild/virtualenv.py
if test -e $possible; then
_virtualenv_topsrcdir=$base
_virtualenv_populate_path=$possible
break
fi
done
if test -z $_virtualenv_populate_path; then
AC_MSG_ERROR([Unable to find Virtualenv population script. In order
to build, you will need mozilla-central's virtualenv.
If you are building from a mozilla-central checkout, you should never see this
message. If you are building from a source archive, the source archive was
likely not created properly (it is missing the virtualenv files).
If you have a copy of mozilla-central available, define the
MOZILLA_CENTRAL_PATH environment variable to the top source directory of
mozilla-central and relaunch configure.])
fi
if test -z $DONT_POPULATE_VIRTUALENV; then
AC_MSG_RESULT([Creating Python environment])
dnl This verifies our Python version is sane and ensures the Python
dnl virtualenv is present and up to date. It sanitizes the environment
dnl for us, so we don't need to clean anything out.
$PYTHON $_virtualenv_populate_path \
$_virtualenv_topsrcdir $MOZ_BUILD_ROOT $MOZ_BUILD_ROOT/_virtualenv \
$_virtualenv_topsrcdir/build/virtualenv_packages.txt || exit 1
case "$host_os" in
mingw*)
PYTHON=`cd $MOZ_BUILD_ROOT && pwd -W`/_virtualenv/Scripts/python.exe
;;
*)
PYTHON=$MOZ_BUILD_ROOT/_virtualenv/bin/python
;;
esac
fi
AC_SUBST(PYTHON)
AC_MSG_CHECKING([Python environment is Mozilla virtualenv])
$PYTHON -c "import mozbuild.base"
if test "$?" != 0; then
AC_MSG_ERROR([Python environment does not appear to be sane.])
fi
AC_MSG_RESULT([yes])
PYTHON_SITE_PACKAGES=`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib()"`
if test -z "$PYTHON_SITE_PACKAGES"; then
AC_MSG_ERROR([Could not determine python site packages directory.])
fi
AC_SUBST([PYTHON_SITE_PACKAGES])
])

View File

@ -1,46 +0,0 @@
dnl We are not running in a real autoconf environment. So we're using real m4
dnl here, not the crazier environment that autoconf provides.
dnl Autoconf expects [] for quotes; give it to them
changequote([, ])
dnl AC_DEFUN is provided to use instead of define in autoconf. Provide it too.
define([AC_DEFUN], [define($1, [$2])])
dnl AC_ARG_ENABLE(FEATURE, HELP-STRING, IF-TRUE[, IF-FALSE])
dnl We have to ignore the help string due to how help works in autoconf...
AC_DEFUN([AC_ARG_ENABLE],
[#] Check whether --enable-[$1] or --disable-[$1] was given.
[if test "[${enable_]patsubst([$1], -, _)+set}" = set; then
enableval="[$enable_]patsubst([$1], -, _)"
$3
ifelse([$4], , , [else
$4
])dnl
fi
])
dnl AC_MSG_ERROR(error-description)
AC_DEFUN([AC_MSG_ERROR], [{ echo "configure: error: $1" 1>&2; exit 1; }])
AC_DEFUN([AC_MSG_WARN], [ echo "configure: warning: $1" 1>&2 ])
dnl Add the variable to the list of substitution variables
AC_DEFUN([AC_SUBST],
[
_subconfigure_ac_subst_args="$_subconfigure_ac_subst_args $1"
])
dnl Override for AC_DEFINE.
AC_DEFUN([AC_DEFINE],
[
cat >>confdefs.h <<\EOF
[#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1)
EOF
cat >> confdefs.pytmp <<\EOF
(''' $1 ''', ifelse($#, 2, [r''' $2 '''], $#, 3, [r''' $2 '''], ' 1 '))
EOF
])
dnl AC_OUTPUT_SUBDIRS(subdirectory)
AC_DEFUN([AC_OUTPUT_SUBDIRS], [do_output_subdirs "$1"])

View File

@ -1,226 +0,0 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
AC_DEFUN([MOZ_TOOL_VARIABLES],
[
GNU_AS=
GNU_LD=
GNU_CC=
GNU_CXX=
CC_VERSION='N/A'
CXX_VERSION='N/A'
if test "$GCC" = "yes"; then
GNU_CC=1
CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
fi
if test "$GXX" = "yes"; then
GNU_CXX=1
CXX_VERSION=`$CXX -v 2>&1 | grep 'gcc version'`
changequote(<<,>>)
GCC_VERSION_FULL=`echo "$CXX_VERSION" | $PERL -pe 's/^.*gcc version ([^ ]*).*/<<$>>1/'`
GCC_VERSION=`echo "$GCC_VERSION_FULL" | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/<<$>>1/;'`
GCC_MAJOR_VERSION=`echo ${GCC_VERSION} | $AWK -F\. '{ print <<$>>1 }'`
GCC_MINOR_VERSION=`echo ${GCC_VERSION} | $AWK -F\. '{ print <<$>>2 }'`
changequote([,])
fi
if test "`echo | $AS -o conftest.out -v 2>&1 | grep -c GNU`" != "0"; then
GNU_AS=1
fi
rm -f conftest.out
if test "`echo | $LD -v 2>&1 | grep -c GNU`" != "0"; then
GNU_LD=1
fi
if test "$GNU_CC"; then
if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
GCC_USE_GNU_LD=1
fi
fi
INTEL_CC=
INTEL_CXX=
if test "$GCC" = yes; then
if test "`$CC -help 2>&1 | grep -c 'Intel(R) C++ Compiler'`" != "0"; then
INTEL_CC=1
fi
fi
if test "$GXX" = yes; then
if test "`$CXX -help 2>&1 | grep -c 'Intel(R) C++ Compiler'`" != "0"; then
INTEL_CXX=1
fi
fi
CLANG_CC=
CLANG_CXX=
if test "`$CC -v 2>&1 | egrep -c '(clang version|Apple.*clang)'`" != "0"; then
CLANG_CC=1
fi
if test "`$CXX -v 2>&1 | egrep -c '(clang version|Apple.*clang)'`" != "0"; then
CLANG_CXX=1
fi
AC_SUBST(CLANG_CXX)
])
AC_DEFUN([MOZ_CROSS_COMPILER],
[
echo "cross compiling from $host to $target"
_SAVE_CC="$CC"
_SAVE_CFLAGS="$CFLAGS"
_SAVE_LDFLAGS="$LDFLAGS"
AC_MSG_CHECKING([for host c compiler])
AC_CHECK_PROGS(HOST_CC, cc gcc clang cl, "")
if test -z "$HOST_CC"; then
AC_MSG_ERROR([no acceptable c compiler found in \$PATH])
fi
AC_MSG_RESULT([$HOST_CC])
AC_MSG_CHECKING([for host c++ compiler])
AC_CHECK_PROGS(HOST_CXX, c++ g++ clang++ cl, "")
if test -z "$HOST_CXX"; then
AC_MSG_ERROR([no acceptable c++ compiler found in \$PATH])
fi
AC_MSG_RESULT([$HOST_CXX])
if test -z "$HOST_CFLAGS"; then
HOST_CFLAGS="$CFLAGS"
fi
if test -z "$HOST_CXXFLAGS"; then
HOST_CXXFLAGS="$CXXFLAGS"
fi
if test -z "$HOST_LDFLAGS"; then
HOST_LDFLAGS="$LDFLAGS"
fi
if test -z "$HOST_AR_FLAGS"; then
HOST_AR_FLAGS="$AR_FLAGS"
fi
AC_CHECK_PROGS(HOST_RANLIB, $HOST_RANLIB ranlib, ranlib, :)
AC_CHECK_PROGS(HOST_AR, $HOST_AR ar, ar, :)
CC="$HOST_CC"
CFLAGS="$HOST_CFLAGS"
LDFLAGS="$HOST_LDFLAGS"
AC_MSG_CHECKING([whether the host c compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
AC_TRY_COMPILE([], [return(0);],
[ac_cv_prog_hostcc_works=1 AC_MSG_RESULT([yes])],
AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CC cannot create executables.]) )
CC="$HOST_CXX"
CFLAGS="$HOST_CXXFLAGS"
AC_MSG_CHECKING([whether the host c++ compiler ($HOST_CXX $HOST_CXXFLAGS $HOST_LDFLAGS) works])
AC_TRY_COMPILE([], [return(0);],
[ac_cv_prog_hostcxx_works=1 AC_MSG_RESULT([yes])],
AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CXX cannot create executables.]) )
CC=$_SAVE_CC
CFLAGS=$_SAVE_CFLAGS
LDFLAGS=$_SAVE_LDFLAGS
AC_CHECK_PROGS(CC, "${target_alias}-gcc" "${target}-gcc", :)
unset ac_cv_prog_CC
AC_PROG_CC
AC_CHECK_PROGS(CXX, "${target_alias}-g++" "${target}-g++", :)
unset ac_cv_prog_CXX
AC_PROG_CXX
AC_CHECK_PROGS(RANLIB, "${target_alias}-ranlib" "${target}-ranlib", :)
AC_CHECK_PROGS(AR, "${target_alias}-ar" "${target}-ar", :)
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_DEFINE(CROSS_COMPILE)
dnl If we cross compile for ppc on Mac OS X x86, cross_compiling will
dnl dnl have erroneously been set to "no", because the x86 build host is
dnl dnl able to run ppc code in a translated environment, making a cross
dnl dnl compiler appear native. So we override that here.
cross_compiling=yes
])
AC_DEFUN([MOZ_CXX11],
[
dnl Check whether gcc's c++0x mode works
dnl Updates to the test below should be duplicated further below for the
dnl cross-compiling case.
AC_LANG_CPLUSPLUS
if test "$GNU_CXX"; then
CXXFLAGS="$CXXFLAGS -std=gnu++0x"
_ADDED_CXXFLAGS="-std=gnu++0x"
AC_CACHE_CHECK(for gcc c++0x headers bug without rtti,
ac_cv_cxx0x_headers_bug,
[AC_TRY_COMPILE([#include <memory>], [],
ac_cv_cxx0x_headers_bug="no",
ac_cv_cxx0x_headers_bug="yes")])
if test "$CLANG_CXX" -a "$ac_cv_cxx0x_headers_bug" = "yes"; then
CXXFLAGS="$CXXFLAGS -I$_topsrcdir/build/unix/headers"
_ADDED_CXXFLAGS="$_ADDED_CXXFLAGS -I$_topsrcdir/build/unix/headers"
AC_CACHE_CHECK(whether workaround for gcc c++0x headers conflict with clang works,
ac_cv_cxx0x_clang_workaround,
[AC_TRY_COMPILE([#include <memory>], [],
ac_cv_cxx0x_clang_workaround="yes",
ac_cv_cxx0x_clang_workaround="no")])
if test "ac_cv_cxx0x_clang_workaround" = "no"; then
AC_MSG_ERROR([Your toolchain does not support C++0x/C++11 mode properly. Please upgrade your toolchain])
fi
elif test "$ac_cv_cxx0x_headers_bug" = "yes"; then
AC_MSG_ERROR([Your toolchain does not support C++0x/C++11 mode properly. Please upgrade your toolchain])
fi
fi
if test -n "$CROSS_COMPILE"; then
dnl When cross compile, we have no variable telling us what the host compiler is. Figure it out.
cat > conftest.C <<EOF
#if defined(__clang__)
CLANG
#elif defined(__GNUC__)
GCC
#endif
EOF
host_compiler=`$HOST_CXX -E conftest.C | egrep '(CLANG|GCC)'`
rm conftest.C
if test -n "$host_compiler"; then
HOST_CXXFLAGS="$HOST_CXXFLAGS -std=gnu++0x"
_SAVE_CXXFLAGS="$CXXFLAGS"
_SAVE_CPPFLAGS="$CPPFLAGS"
_SAVE_CXX="$CXX"
CXXFLAGS="$HOST_CXXFLAGS"
CPPFLAGS="$HOST_CPPFLAGS"
CXX="$HOST_CXX"
AC_CACHE_CHECK(for host gcc c++0x headers bug without rtti,
ac_cv_host_cxx0x_headers_bug,
[AC_TRY_COMPILE([#include <memory>], [],
ac_cv_host_cxx0x_headers_bug="no",
ac_cv_host_cxx0x_headers_bug="yes")])
if test "$host_compiler" = CLANG -a "$ac_cv_host_cxx0x_headers_bug" = "yes"; then
CXXFLAGS="$CXXFLAGS -I$_topsrcdir/build/unix/headers"
AC_CACHE_CHECK(whether workaround for host gcc c++0x headers conflict with host clang works,
ac_cv_host_cxx0x_clang_workaround,
[AC_TRY_COMPILE([#include <memory>], [],
ac_cv_host_cxx0x_clang_workaround="yes",
ac_cv_host_cxx0x_clang_workaround="no")])
if test "ac_cv_host_cxx0x_clang_workaround" = "no"; then
AC_MSG_ERROR([Your host toolchain does not support C++0x/C++11 mode properly. Please upgrade your toolchain])
fi
HOST_CXXFLAGS="$CXXFLAGS"
elif test "$ac_cv_host_cxx0x_headers_bug" = "yes"; then
AC_MSG_ERROR([Your host toolchain does not support C++0x/C++11 mode properly. Please upgrade your toolchain])
fi
CXXFLAGS="$_SAVE_CXXFLAGS"
CPPFLAGS="$_SAVE_CPPFLAGS"
CXX="$_SAVE_CXX"
fi
elif test "$GNU_CXX"; then
HOST_CXXFLAGS="$HOST_CXXFLAGS $_ADDED_CXXFLAGS"
fi
AC_LANG_C
])

View File

@ -1,37 +0,0 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
dnl Identify which version of the SDK we're building with
dnl Windows Server 2008 and newer SDKs have WinSDKVer.h, get the version
dnl from there
AC_DEFUN([MOZ_FIND_WINSDK_VERSION], [
MOZ_CHECK_HEADERS([winsdkver.h])
if test "$ac_cv_header_winsdkver_h" = "yes"; then
dnl Get the highest _WIN32_WINNT and NTDDI versions supported
dnl Take the higher of the two
dnl This is done because the Windows 7 beta SDK reports its
dnl NTDDI_MAXVER to be 0x06000100 instead of 0x06010000, as it should
AC_CACHE_CHECK(for highest Windows version supported by this SDK,
ac_cv_winsdk_maxver,
[cat > conftest.h <<EOF
#include <winsdkver.h>
#include <sdkddkver.h>
#if (NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT_MAXVER) > NTDDI_MAXVER)
#define WINSDK_MAXVER NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT_MAXVER)
#else
#define WINSDK_MAXVER NTDDI_MAXVER
#endif
WINSDK_MAXVER
EOF
ac_cv_winsdk_maxver=`$CPP conftest.h 2>/dev/null | tail -n1`
rm -f conftest.h
])
MOZ_WINSDK_MAXVER=${ac_cv_winsdk_maxver}
else
dnl Any SDK which doesn't have WinSDKVer.h is too old.
AC_MSG_ERROR([Your SDK does not have WinSDKVer.h. It is probably too old. Please upgrade to a newer SDK or try running the Windows SDK Configuration Tool and selecting a newer SDK. See https://developer.mozilla.org/En/Windows_SDK_versions for more details on fixing this.])
fi
])

View File

@ -1,22 +0,0 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
dnl =======================================================================
dnl = Enable compiling with various compiler wrappers (distcc, ccache, etc)
dnl =======================================================================
AC_DEFUN([MOZ_CHECK_COMPILER_WRAPPER],
[
MOZ_ARG_WITH_STRING(compiler_wrapper,
[ --with-compiler-wrapper[=path/to/wrapper]
Enable compiling with wrappers such as distcc and ccache],
COMPILER_WRAPPER=$withval, COMPILER_WRAPPER="no")
if test "$COMPILER_WRAPPER" != "no"; then
CC="$COMPILER_WRAPPER $CC"
CXX="$COMPILER_WRAPPER $CXX"
MOZ_USING_COMPILER_WRAPPER=1
fi
AC_SUBST(MOZ_USING_COMPILER_WRAPPER)
])

View File

@ -1,54 +0,0 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
dnl Usage: MOZ_ZLIB_CHECK([version])
AC_DEFUN([MOZ_ZLIB_CHECK],
[
MOZZLIB=$1
MOZ_ARG_WITH_STRING(system-zlib,
[ --with-system-zlib[=PFX]
Use system libz [installed at prefix PFX]],
ZLIB_DIR=$withval)
if test -z "$MOZ_ZLIB_LIBS$MOZ_ZLIB_CFLAGS$SKIP_LIBRARY_CHECKS"; then
_SAVE_CFLAGS=$CFLAGS
_SAVE_LDFLAGS=$LDFLAGS
_SAVE_LIBS=$LIBS
if test -n "${ZLIB_DIR}" -a "${ZLIB_DIR}" != "yes"; then
MOZ_ZLIB_CFLAGS="-I${ZLIB_DIR}/include"
MOZ_ZLIB_LIBS="-L${ZLIB_DIR}/lib"
CFLAGS="$MOZ_ZLIB_CFLAGS $CFLAGS"
LDFLAGS="$MOZ_ZLIB_LIBS $LDFLAGS"
fi
if test -z "$ZLIB_DIR" -o "$ZLIB_DIR" = no; then
MOZ_NATIVE_ZLIB=
else
AC_CHECK_LIB(z, gzread, [MOZ_NATIVE_ZLIB=1 MOZ_ZLIB_LIBS="$MOZ_ZLIB_LIBS -lz"],
[MOZ_NATIVE_ZLIB=])
if test "$MOZ_NATIVE_ZLIB" = 1; then
MOZZLIBNUM=`echo $MOZZLIB | awk -F. changequote(<<, >>)'{printf "0x%x\n", (((<<$>>1 * 16 + <<$>>2) * 16) + <<$>>3) * 16 + <<$>>4}'changequote([, ])`
AC_TRY_COMPILE([ #include <stdio.h>
#include <string.h>
#include <zlib.h> ],
[ #if ZLIB_VERNUM < $MOZZLIBNUM
#error "Insufficient zlib version ($MOZZLIBNUM required)."
#endif ],
MOZ_NATIVE_ZLIB=1,
AC_MSG_ERROR([Insufficient zlib version for --with-system-zlib ($MOZZLIB required)]))
fi
fi
CFLAGS=$_SAVE_CFLAGS
LDFLAGS=$_SAVE_LDFLAGS
LIBS=$_SAVE_LIBS
fi
AC_SUBST(MOZ_ZLIB_CFLAGS)
AC_SUBST(MOZ_ZLIB_LIBS)
AC_SUBST(MOZ_NATIVE_ZLIB)
])

View File

@ -9,7 +9,7 @@ dnl ========================================================
AC_PREREQ(2.13)
AC_INIT(jsapi.h)
AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
AC_CONFIG_AUX_DIR(${srcdir}/../../build/autoconf)
AC_CANONICAL_SYSTEM
TARGET_CPU="${target_cpu}"
TARGET_VENDOR="${target_vendor}"

View File

@ -2537,9 +2537,8 @@ class FunctionCompiler
private:
ParseNode *popLoop()
{
ParseNode *pn = loopStack_.back();
ParseNode *pn = loopStack_.popCopy();
JS_ASSERT(!unlabeledContinues_.has(pn));
loopStack_.popBack();
breakableStack_.popBack();
return pn;
}

View File

@ -465,7 +465,7 @@ SerializedNameSize(PropertyName *name)
static uint8_t *
SerializeName(uint8_t *cursor, PropertyName *name)
{
JS_ASSERT_IF(name, name->length() != 0);
JS_ASSERT_IF(name, !name->empty());
if (name) {
cursor = WriteScalar<uint32_t>(cursor, name->length());
cursor = WriteBytes(cursor, name->chars(), name->length() * sizeof(jschar));

View File

@ -694,7 +694,7 @@ BaselineCompiler::emitDebugTrap()
#ifdef DEBUG
// Patchable call offset has to match the pc mapping offset.
PCMappingEntry &entry = pcMappingEntries_[pcMappingEntries_.length() - 1];
PCMappingEntry &entry = pcMappingEntries_.back();
JS_ASSERT((&offset)->offset() == entry.nativeOffset);
#endif

View File

@ -6041,7 +6041,7 @@ CodeGenerator::link(JSContext *cx, types::CompilerConstraintList *constraints)
// In parallel execution mode, when we first compile a script, we
// don't know that its potential callees are compiled, so set a
// flag warning that the callees may not be fully compiled.
if (callTargets.length() != 0)
if (!callTargets.empty())
ionScript->setHasUncompiledCallTarget();
invalidateEpilogueData_.fixup(&masm);

View File

@ -262,7 +262,7 @@ bool
IonBuilder::getPolyCallTargets(types::TemporaryTypeSet *calleeTypes, bool constructing,
ObjectVector &targets, uint32_t maxTargets, bool *gotLambda)
{
JS_ASSERT(targets.length() == 0);
JS_ASSERT(targets.empty());
JS_ASSERT(gotLambda);
*gotLambda = false;
@ -3934,7 +3934,7 @@ IonBuilder::inlineScriptedCall(CallInfo &callInfo, JSFunction *target)
returnBlock->pop();
// Accumulate return values.
if (returns.length() == 0) {
if (returns.empty()) {
// Inlining of functions that have no exit is not supported.
calleeScript->setUninlineable();
abortReason_ = AbortReason_Inlining;
@ -4205,7 +4205,7 @@ IonBuilder::inlineCallsite(ObjectVector &targets, ObjectVector &originals,
if (!inliningEnabled())
return InliningStatus_NotInlined;
if (targets.length() == 0)
if (targets.empty())
return InliningStatus_NotInlined;
// Is the function provided by an MGetPropertyCache?
@ -4992,7 +4992,7 @@ IonBuilder::jsop_funapplyarguments(uint32_t argc)
// Arguments
MDefinitionVector args(alloc());
if (inliningDepth_) {
if (!args.append(inlineCallInfo_->argv().begin(), inlineCallInfo_->argv().end()))
if (!args.appendAll(inlineCallInfo_->argv()))
return false;
}
callInfo.setArgs(&args);

View File

@ -866,14 +866,14 @@ class CallInfo
fun_ = callInfo.fun();
thisArg_ = callInfo.thisArg();
if (!args_.append(callInfo.argv().begin(), callInfo.argv().end()))
if (!args_.appendAll(callInfo.argv()))
return false;
return true;
}
bool init(MBasicBlock *current, uint32_t argc) {
JS_ASSERT(args_.length() == 0);
JS_ASSERT(args_.empty());
// Get the arguments in the right order
if (!args_.reserve(argc))
@ -909,8 +909,8 @@ class CallInfo
}
void setArgs(MDefinitionVector *args) {
JS_ASSERT(args_.length() == 0);
args_.append(args->begin(), args->end());
JS_ASSERT(args_.empty());
args_.appendAll(*args);
}
MDefinitionVector &argv() {

View File

@ -43,7 +43,7 @@ bool
LIRGraph::noteNeedsSafepoint(LInstruction *ins)
{
// Instructions with safepoints must be in linear order.
JS_ASSERT_IF(safepoints_.length(), safepoints_[safepoints_.length() - 1]->id() < ins->id());
JS_ASSERT_IF(!safepoints_.empty(), safepoints_.back()->id() < ins->id());
if (!ins->isCall() && !nonCallSafepoints_.append(ins))
return false;
return safepoints_.append(ins);

View File

@ -795,7 +795,7 @@ MPhi::removeOperand(size_t index)
MDefinition *
MPhi::foldsTo(TempAllocator &alloc, bool useValueNumbers)
{
JS_ASSERT(inputs_.length() != 0);
JS_ASSERT(!inputs_.empty());
MDefinition *first = getOperand(0);

View File

@ -1114,7 +1114,7 @@ class MTableSwitch MOZ_FINAL
size_t addSuccessor(MBasicBlock *successor) {
JS_ASSERT(successors_.length() < (size_t)(high_ - low_ + 2));
JS_ASSERT(successors_.length() != 0);
JS_ASSERT(!successors_.empty());
successors_.append(successor);
return successors_.length() - 1;
}
@ -1158,7 +1158,7 @@ class MTableSwitch MOZ_FINAL
}
size_t addDefault(MBasicBlock *block) {
JS_ASSERT(successors_.length() == 0);
JS_ASSERT(successors_.empty());
successors_.append(block);
return 0;
}

View File

@ -185,7 +185,7 @@ PerfSpewer::endBasicBlock(MacroAssembler &masm)
if (!PerfBlockEnabled())
return true;
masm.bind(&basicBlocks_[basicBlocks_.length() - 1].end);
masm.bind(&basicBlocks_.back().end);
return true;
}
@ -372,7 +372,7 @@ js::jit::writePerfSpewerAsmJSBlocksMap(uintptr_t baseAddress, size_t funcStartOf
const char *filename, const char *funcName,
const js::jit::BasicBlocksVector &basicBlocks)
{
if (!PerfBlockEnabled() || basicBlocks.length() == 0)
if (!PerfBlockEnabled() || basicBlocks.empty())
return;
if (!lockPerfMap())

View File

@ -413,7 +413,9 @@ Range::intersect(TempAllocator &alloc, const Range *lhs, const Range *rhs, bool
// Instead, we should use it to eliminate the dead block.
// (Bug 765127)
if (newUpper < newLower) {
*emptyRange = true;
// If both ranges can be NaN, the result can still be NaN.
if (!lhs->canBeNaN() || !rhs->canBeNaN())
*emptyRange = true;
return nullptr;
}

View File

@ -54,7 +54,7 @@ TypeRepresentationSetBuilder::insert(TypeRepresentation *typeRepr)
if (invalid_)
return true;
if (entries_.length() == 0)
if (entries_.empty())
return entries_.append(typeRepr);
// Check that this new type repr is of the same basic kind as the

View File

@ -78,7 +78,7 @@ class BaselineCompilerShared
// Create the entry and add it to the vector.
if (!icEntries_.append(ICEntry(script->pcToOffset(pc), isForOp)))
return nullptr;
ICEntry &vecEntry = icEntries_[icEntries_.length() - 1];
ICEntry &vecEntry = icEntries_.back();
// Set the first stub for the IC entry to the fallback stub
vecEntry.setFirstStub(stub);

View File

@ -394,7 +394,7 @@ CodeGeneratorShared::markSafepoint(LInstruction *ins)
bool
CodeGeneratorShared::markSafepointAt(uint32_t offset, LInstruction *ins)
{
JS_ASSERT_IF(safepointIndices_.length(),
JS_ASSERT_IF(!safepointIndices_.empty(),
offset - safepointIndices_.back().displacement() >= sizeof(uint32_t));
return safepointIndices_.append(SafepointIndex(offset, ins->safepoint()));
}
@ -804,8 +804,7 @@ CodeGeneratorShared::emitPreBarrier(Address address, MIRType type)
void
CodeGeneratorShared::dropArguments(unsigned argc)
{
for (unsigned i = 0; i < argc; i++)
pushedArgumentSlots_.popBack();
pushedArgumentSlots_.shrinkBy(argc);
}
bool

View File

@ -33,6 +33,10 @@ case $cmd in
${MKDIR} -p ${tgtpath}/intl
cp -t ${tgtpath}/intl -dRp ${SRCDIR}/../../intl/icu
# copy autoconf config directory.
${MKDIR} -p ${tgtpath}/build
cp -t ${tgtpath}/build -dRp ${SRCDIR}/../../build/autoconf
# put in js itself
cp -t ${tgtpath} -dRp ${SRCDIR}/../../mfbt
cp -t ${tgtpath}/js -dRp ${SRCDIR}/../jsd ${SRCDIR}/../public

View File

@ -99,6 +99,7 @@ default-preferences pref(layout.css.variables.enabled,true)
== variable-reference-36.html variable-reference-36-ref.html
== variable-reference-37.html variable-reference-37-ref.html
== variable-reference-38.html variable-reference-38-ref.html
== variable-reference-39.html support/color-green-ref.html
== variable-supports-01.html support/color-green-ref.html
== variable-supports-02.html support/color-green-ref.html
== variable-supports-03.html support/color-green-ref.html

View File

@ -0,0 +1,17 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable that references itself but uses fallback.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#cycles">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
var-a: var(a, red);
color: var(a, green);
}
</style>
<p>This text must be green.</p>

View File

@ -193,6 +193,12 @@ CSSVariableResolver::Resolve(const CSSVariableValues* aInherited,
mReferences[id].AppendElement(i);
}
}
// If a variable references itself, it is invalid. (RemoveCycles
// does not check for cycles consisting of a single variable, so we
// check here.)
if (data.HasReferenceToVariable(id)) {
mVariables[id].mValue.Truncate();
}
// Also record whether it referenced any variables that don't exist
// in the resolver, so that we can ensure we still resolve its value
// in ResolveVariable, even though its mReferences list is empty.

View File

@ -25,7 +25,7 @@ var values = [
["var-a: var(b)", "var-a", ""],
["var-a: var(b); var-b: 1px", "var-a", " 1px"],
["var-a: var(b, 1px)", "var-a", " 1px"],
["var-a: var(a, 1px)", "var-a", " 1px"],
["var-a: var(a, 1px)", "var-a", ""],
["var-a: something 3px url(whereever) calc(var(a) + 1px)", "var-a", ""],
["var-a: something 3px url(whereever) calc(var(b,1em) + 1px)", "var-a", " something 3px url(whereever) calc(1em + 1px)"],
["var-a: var(b, var(c, var(d, Black)))", "var-a", " Black"],

View File

@ -4296,6 +4296,11 @@ pref("memory.ghost_window_timeout_seconds", 60);
// Disable freeing dirty pages when minimizing memory.
pref("memory.free_dirty_pages", false);
// Disable the Linux-specific, system-wide memory reporter.
#ifdef XP_LINUX
pref("memory.system_memory_reporter", false);
#endif
pref("social.enabled", false);
// comma separated list of domain origins (e.g. https://domain.com) for
// providers that can install from their own website without user warnings.

View File

@ -206,37 +206,36 @@ class TreeMetadataEmitter(LoggingMixin):
# them. We should aim to keep this set small because it violates the
# desired abstraction of the build definition away from makefiles.
passthru = VariablePassthru(sandbox)
varmap = dict(
# Makefile.in : moz.build
ANDROID_GENERATED_RESFILES='ANDROID_GENERATED_RESFILES',
ANDROID_RES_DIRS='ANDROID_RES_DIRS',
CPP_UNIT_TESTS='CPP_UNIT_TESTS',
EXPORT_LIBRARY='EXPORT_LIBRARY',
EXTRA_ASSEMBLER_FLAGS='EXTRA_ASSEMBLER_FLAGS',
EXTRA_COMPILE_FLAGS='EXTRA_COMPILE_FLAGS',
EXTRA_COMPONENTS='EXTRA_COMPONENTS',
EXTRA_JS_MODULES='EXTRA_JS_MODULES',
EXTRA_PP_COMPONENTS='EXTRA_PP_COMPONENTS',
EXTRA_PP_JS_MODULES='EXTRA_PP_JS_MODULES',
FAIL_ON_WARNINGS='FAIL_ON_WARNINGS',
FILES_PER_UNIFIED_FILE='FILES_PER_UNIFIED_FILE',
FORCE_SHARED_LIB='FORCE_SHARED_LIB',
FORCE_STATIC_LIB='FORCE_STATIC_LIB',
GENERATED_FILES='GENERATED_FILES',
HOST_LIBRARY_NAME='HOST_LIBRARY_NAME',
IS_COMPONENT='IS_COMPONENT',
IS_GYP_DIR='IS_GYP_DIR',
JS_MODULES_PATH='JS_MODULES_PATH',
LIBS='LIBS',
LIBXUL_LIBRARY='LIBXUL_LIBRARY',
MSVC_ENABLE_PGO='MSVC_ENABLE_PGO',
NO_DIST_INSTALL='NO_DIST_INSTALL',
OS_LIBS='OS_LIBS',
SDK_LIBRARY='SDK_LIBRARY',
)
for mak, moz in varmap.items():
if moz in sandbox and sandbox[moz]:
passthru.variables[mak] = sandbox[moz]
varlist = [
'ANDROID_GENERATED_RESFILES',
'ANDROID_RES_DIRS',
'CPP_UNIT_TESTS',
'EXPORT_LIBRARY',
'EXTRA_ASSEMBLER_FLAGS',
'EXTRA_COMPILE_FLAGS',
'EXTRA_COMPONENTS',
'EXTRA_JS_MODULES',
'EXTRA_PP_COMPONENTS',
'EXTRA_PP_JS_MODULES',
'FAIL_ON_WARNINGS',
'FILES_PER_UNIFIED_FILE',
'FORCE_SHARED_LIB',
'FORCE_STATIC_LIB',
'GENERATED_FILES',
'HOST_LIBRARY_NAME',
'IS_COMPONENT',
'IS_GYP_DIR',
'JS_MODULES_PATH',
'LIBS',
'LIBXUL_LIBRARY',
'MSVC_ENABLE_PGO',
'NO_DIST_INSTALL',
'OS_LIBS',
'SDK_LIBRARY',
]
for v in varlist:
if v in sandbox and sandbox[v]:
passthru.variables[v] = sandbox[v]
# NO_VISIBILITY_FLAGS is slightly different
if sandbox['NO_VISIBILITY_FLAGS']:

View File

@ -96,6 +96,7 @@ class GlobalNamespace(dict):
'False': False,
'True': True,
'sorted': alphabetical_sorted,
'int': int,
})
def __init__(self, allowed_variables=None, builtins=None):

View File

@ -523,10 +523,9 @@ this.FxAccounts.prototype = Object.freeze({
return null;
}
if (!internal.isUserEmailVerified(data)) {
// If the email is not verified, start polling for verification,
// but return null right away. We don't want to return a promise
// that might not be fulfilled for a long time.
internal.startVerifiedCheck(credentials);
// If the email is not verified, start polling for verification and
// return the unverified account credentials.
internal.startVerifiedCheck(data);
}
return data;
});

View File

@ -36,11 +36,11 @@ def run_marionette(tests, b2g_path=None, emulator=None, testtype=None,
address=None, bin=None, topsrcdir=None):
from marionette.runtests import (
MarionetteTestRunner,
MarionetteTestOptions,
BaseMarionetteOptions,
startTestRunner
)
parser = MarionetteTestOptions()
parser = BaseMarionetteOptions()
options, args = parser.parse_args()
if not tests:

View File

@ -422,8 +422,6 @@ function updateAboutMemoryFromReporters()
// Increment this if the JSON format changes.
//
// If/when this changes to 2, the beLenient() function and its use can be
// removed.
var gCurrentFileFormatVersion = 1;
/**
@ -822,11 +820,6 @@ function appendAboutMemoryMain(aProcessReports, aHasMozMallocUsableSize)
{
let pcollsByProcess = {};
// This regexp matches sentences and sentence fragments, i.e. strings that
// start with a capital letter and ends with a '.'. (The final sentence may
// be in parentheses, so a ')' might appear after the '.'.)
const gSentenceRegExp = /^[A-Z].*\.\)?$/m;
function handleReport(aProcess, aUnsafePath, aKind, aUnits, aAmount,
aDescription, aPresence)
{
@ -834,33 +827,6 @@ function appendAboutMemoryMain(aProcessReports, aHasMozMallocUsableSize)
assertInput(aKind === KIND_HEAP || aKind === KIND_NONHEAP,
"bad explicit kind");
assertInput(aUnits === UNITS_BYTES, "bad explicit units");
assertInput(gSentenceRegExp.test(aDescription),
"non-sentence explicit description");
} else {
const kLenientPrefixes =
['rss/', 'pss/', 'size/', 'swap/', 'compartments/', 'ghost-windows/'];
let beLenient = function(aUnsafePath) {
for (let i = 0; i < kLenientPrefixes.length; i++) {
if (aUnsafePath.startsWith(kLenientPrefixes[i])) {
return true;
}
}
return false;
}
// In general, non-explicit reports should have a description that is a
// complete sentence. However, we want to be able to read old saved
// reports, so we are lenient in a couple of situations where we used to
// allow non-sentence descriptions:
// - smaps reports (which were removed in bug 912165);
// - compartment and ghost-window reports (which had empty descriptions
// prior to bug 911641).
if (!beLenient(aUnsafePath)) {
assertInput(gSentenceRegExp.test(aDescription),
"non-sentence other description: " + aUnsafePath + ", " +
aDescription);
}
}
assert(aPresence === undefined ||
@ -1122,7 +1088,7 @@ function fillInTree(aRoot)
* @param aHeapAllocatedNode
* The "heap-allocated" tree node.
* @param aHeapTotal
* The sum of all explicit HEAP reporters for this process.
* The sum of all explicit HEAP reports for this process.
* @return A boolean indicating if "heap-allocated" is known for the process.
*/
function addHeapUnclassifiedNode(aT, aHeapAllocatedNode, aHeapTotal)
@ -1135,7 +1101,7 @@ function addHeapUnclassifiedNode(aT, aHeapAllocatedNode, aHeapTotal)
let heapUnclassifiedT = new TreeNode("heap-unclassified", UNITS_BYTES);
heapUnclassifiedT._amount = heapAllocatedBytes - aHeapTotal;
heapUnclassifiedT._description =
"Memory not classified by a more specific reporter. This includes " +
"Memory not classified by a more specific report. This includes " +
"slop bytes due to internal fragmentation in the heap allocator " +
"(caused when the allocator rounds up request sizes).";
aT._kids.push(heapUnclassifiedT);
@ -1321,12 +1287,14 @@ function appendProcessAboutMemoryElements(aP, aN, aProcess, aTrees,
let warningsDiv = appendElement(aP, "div", "accuracyWarning");
// The explicit tree.
let hasExplicitTree;
let hasKnownHeapAllocated;
{
let treeName = "explicit";
let pre = appendSectionHeader(aP, "Explicit Allocations");
let t = aTrees[treeName];
if (t) {
let pre = appendSectionHeader(aP, "Explicit Allocations");
hasExplicitTree = true;
fillInTree(t);
// Using the "heap-allocated" reporter here instead of
// nsMemoryReporterManager.heapAllocated goes against the usual pattern.
@ -1384,11 +1352,13 @@ function appendProcessAboutMemoryElements(aP, aN, aProcess, aTrees,
}
appendTextNode(aP, "\n"); // gives nice spacing when we copy and paste
// Add any warnings about inaccuracies due to platform limitations.
// These must be computed after generating all the text. The newlines give
// nice spacing if we copy+paste into a text buffer.
appendWarningElements(warningsDiv, hasKnownHeapAllocated,
aHasMozMallocUsableSize);
// Add any warnings about inaccuracies in the "explicit" tree due to platform
// limitations. These must be computed after generating all the text. The
// newlines give nice spacing if we copy+paste into a text buffer.
if (hasExplicitTree) {
appendWarningElements(warningsDiv, hasKnownHeapAllocated,
aHasMozMallocUsableSize);
}
appendElementWithText(aP, "h3", "", "End of " + aProcess);
appendLink("end", "start", kUpwardsArrow);
@ -1557,7 +1527,7 @@ function appendMrNameSpan(aP, aDescription, aUnsafeName, aIsInvalid, aNMerged,
let noteSpan = appendElementWithText(aP, "span", "mrNote", noteText);
noteSpan.title =
"This value is the sum of " + aNMerged +
" memory reporters that all have the same path.";
" memory reports that all have the same path.";
}
if (aPresence) {

View File

@ -68,10 +68,9 @@
let frame = document.getElementById("amFrame");
frame.focus();
let aIsVerbose = true;
let doc = frame.contentWindow.document;
let verbosity = doc.getElementById("verbose");
verbosity.checked = aIsVerbose;
verbosity.checked = true;
function getFilePath(aFilename) {
let file = Cc["@mozilla.org/file/directory_service;1"]
@ -229,10 +228,6 @@ Other Measurements\n\
\n\
End of Main Process (pid NNN)\n\
Other-only process\n\
\n\
WARNING: the 'heap-allocated' memory reporter does not work for this platform and/or configuration. This means that 'heap-unclassified' is not shown and the 'explicit' tree shows less memory than it should.\n\
Explicit Allocations\n\
\n\
Other Measurements\n\
\n\
200,000 B (100.0%) -- a\n\
@ -290,30 +285,18 @@ Other Measurements\n\
\n\
End of P\n\
P2 (pid NNN)\n\
\n\
WARNING: the 'heap-allocated' memory reporter does not work for this platform and/or configuration. This means that 'heap-unclassified' is not shown and the 'explicit' tree shows less memory than it should.\n\
Explicit Allocations\n\
\n\
Other Measurements\n\
\n\
11 B ── z 0xNNN\n\
\n\
End of P2 (pid NNN)\n\
P3\n\
\n\
WARNING: the 'heap-allocated' memory reporter does not work for this platform and/or configuration. This means that 'heap-unclassified' is not shown and the 'explicit' tree shows less memory than it should.\n\
Explicit Allocations\n\
\n\
Other Measurements\n\
\n\
-55 B ── p3 [-]\n\
\n\
End of P3\n\
P4\n\
\n\
WARNING: the 'heap-allocated' memory reporter does not work for this platform and/or configuration. This means that 'heap-unclassified' is not shown and the 'explicit' tree shows less memory than it should.\n\
Explicit Allocations\n\
\n\
Other Measurements\n\
\n\
66 B ── p4 [+]\n\

View File

@ -135,10 +135,6 @@ Other Measurements\n\
\n\
End of Main Process (pid NNN)\n\
Other-only process\n\
\n\
WARNING: the 'heap-allocated' memory reporter does not work for this platform and/or configuration. This means that 'heap-unclassified' is not shown and the 'explicit' tree shows less memory than it should.\n\
Explicit Allocations\n\
\n\
Other Measurements\n\
\n\
0.19 MB (100.0%) -- a\n\

View File

@ -7,7 +7,10 @@
<script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
<!-- This file tests the saving and loading of memory reports to/from file in
about:memory in the presence of child processes. -->
about:memory in the presence of child processes. It is also notable
for being an about:memory test that uses the real reporters, rather
than fake deterministic ones, and so tends to show up problems in the
real reporters (like bogus negative values). -->
<!-- test results are displayed in the html:body -->
<body xmlns="http://www.w3.org/1999/xhtml"></body>
@ -29,7 +32,13 @@
// Create some remote processes, and set up message-passing so that
// we know when each child is fully initialized.
let remotes = [];
SpecialPowers.pushPrefEnv({"set": [["dom.ipc.processCount", 3]]}, function() {
let prefs = [
["dom.ipc.processCount", 3], // Allow up to 3 child processes
["memory.system_memory_reporter", true] // Test SystemMemoryReporter
];
SpecialPowers.pushPrefEnv({"set": prefs}, function() {
for (let i = 0; i < numRemotes; i++) {
let w = remotes[i] = window.open("remote.xul", "", "chrome");
@ -104,14 +113,24 @@
// If we have more than 1000 chars, we've probably successfully
// copy+pasted.
if (actual.length > 1000) {
let good = true;
if (actual.match("End of System")) {
let m1 = actual.match("anonymous") &&
actual.match("shared-libraries");
ok(m1, "system-wide reporter")
good = good && !!m1;
}
// Note: Match "vsize" but not "vsize-max-contiguous".
let vsizes = actual.match(/vsize[^-]/g);
let endOfBrowsers = actual.match(/End of Browser/g);
let m2 = (vsizes.length == 4 && endOfBrowsers.length == 3);
ok(m2, "three child processes present in loaded data");
good = good && !!m2;
if (vsizes.length == 4 && endOfBrowsers.length == 3) {
ok(true, "three child processes present in loaded data");
} else {
ok(false, "pasted text lacks four 'vsize' and three 'End of Browser' strings");
if (!good) {
dump("*******ACTUAL*******\n");
dump(actual);
dump("********************\n");

View File

@ -0,0 +1,528 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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/. */
#include "mozilla/SystemMemoryReporter.h"
#include "mozilla/Attributes.h"
#include "mozilla/Preferences.h"
#include "mozilla/unused.h"
#include "nsIMemoryReporter.h"
#include "nsPrintfCString.h"
#include "nsString.h"
#include "nsTHashtable.h"
#include "nsHashKeys.h"
#include <dirent.h>
#include <inttypes.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
// This file implements a Linux-specific, system-wide memory reporter. It
// gathers all the useful memory measurements obtainable from the OS in a
// single place, giving a high-level view of memory consumption for the entire
// machine/device.
//
// Other memory reporters measure part of a single process's memory consumption.
// This reporter is different in that it measures memory consumption of many
// processes, and they end up in a single reports tree. This is a slight abuse
// of the memory reporting infrastructure, and therefore the results are given
// their own "process" called "System", which means they show up in about:memory
// in their own section, distinct from the per-process sections.
namespace mozilla {
namespace SystemMemoryReporter {
#if !defined(XP_LINUX)
#error "This won't work if we're not on Linux."
#endif
static bool
EndsWithLiteral(const nsCString& aHaystack, const char* aNeedle)
{
int32_t idx = aHaystack.RFind(aNeedle);
return idx != -1 && idx + strlen(aNeedle) == aHaystack.Length();
}
static void
GetDirname(const nsCString& aPath, nsACString& aOut)
{
int32_t idx = aPath.RFind("/");
if (idx == -1) {
aOut.Truncate();
} else {
aOut.Assign(Substring(aPath, 0, idx));
}
}
static void
GetBasename(const nsCString& aPath, nsACString& aOut)
{
nsCString out;
int32_t idx = aPath.RFind("/");
if (idx == -1) {
out.Assign(aPath);
} else {
out.Assign(Substring(aPath, idx + 1));
}
// On Android, some entries in /dev/ashmem end with "(deleted)" (e.g.
// "/dev/ashmem/libxul.so(deleted)"). We don't care about this modifier, so
// cut it off when getting the entry's basename.
if (EndsWithLiteral(out, "(deleted)")) {
out.Assign(Substring(out, 0, out.RFind("(deleted)")));
}
out.StripChars(" ");
aOut.Assign(out);
}
static bool
IsNumeric(const char* s)
{
MOZ_ASSERT(*s); // shouldn't see empty strings
while (*s) {
if (!isdigit(*s)) {
return false;
}
s++;
}
return true;
}
static bool
IsAnonymous(const nsACString& aName)
{
// Recent kernels (e.g. 3.5) have multiple [stack:nnnn] entries, where |nnnn|
// is a thread ID. However, [stack:nnnn] entries count both stack memory
// *and* anonymous memory because the kernel only knows about the start of
// each thread stack, not its end. So we treat such entries as anonymous
// memory instead of stack. This is consistent with older kernels that don't
// even show [stack:nnnn] entries.
return aName.IsEmpty() ||
StringBeginsWith(aName, NS_LITERAL_CSTRING("[stack:"));
}
class SystemReporter MOZ_FINAL : public nsIMemoryReporter
{
public:
NS_DECL_THREADSAFE_ISUPPORTS
#define REPORT(_path, _amount, _desc) \
do { \
size_t amount = _amount; /* evaluate _amount only once */ \
if (amount > 0) { \
nsresult rv; \
rv = aHandleReport->Callback(NS_LITERAL_CSTRING("System"), _path, \
KIND_NONHEAP, UNITS_BYTES, amount, _desc, \
aData); \
if (NS_WARN_IF(NS_FAILED(rv))) { \
return rv; \
} \
} \
} while (0)
NS_IMETHOD CollectReports(nsIHandleReportCallback* aHandleReport,
nsISupports* aData)
{
if (!Preferences::GetBool("memory.system_memory_reporter")) {
return NS_OK;
}
// Read relevant fields from /proc/meminfo.
int64_t memTotal = 0, memFree = 0;
nsresult rv = ReadMemInfo(&memTotal, &memFree);
// Collect per-process reports from /proc/<pid>/smaps.
int64_t totalPss = 0;
rv = CollectProcessReports(aHandleReport, aData, &totalPss);
NS_ENSURE_SUCCESS(rv, rv);
// Report the non-process numbers.
int64_t other = memTotal - memFree - totalPss;
REPORT(NS_LITERAL_CSTRING("mem/other"), other, NS_LITERAL_CSTRING(
"Memory which is neither owned by any user-space process nor free. Note that "
"this includes memory holding cached files from the disk which can be "
"reclaimed by the OS at any time."));
REPORT(NS_LITERAL_CSTRING("mem/free"), memFree, NS_LITERAL_CSTRING(
"Memory which is free and not being used for any purpose."));
return NS_OK;
}
private:
// Keep this in sync with SystemReporter::kindPathSuffixes!
enum ProcessSizeKind {
AnonymousOutsideBrk = 0,
AnonymousBrkHeap = 1,
SharedLibrariesRX = 2,
SharedLibrariesRW = 3,
SharedLibrariesR = 4,
SharedLibrariesOther = 5,
OtherFiles = 6,
MainThreadStack = 7,
Vdso = 8,
ProcessSizeKindLimit = 9 // must be last
};
static const char* kindPathSuffixes[ProcessSizeKindLimit];
// These are the cross-cutting measurements across all processes.
struct ProcessSizes
{
ProcessSizes() { memset(this, 0, sizeof(*this)); }
size_t mSizes[ProcessSizeKindLimit];
};
nsresult ReadMemInfo(int64_t* aMemTotal, int64_t* aMemFree)
{
FILE* f = fopen("/proc/meminfo", "r");
if (!f) {
return NS_ERROR_FAILURE;
}
int n1 = fscanf(f, "MemTotal: %" SCNd64 " kB\n", aMemTotal);
int n2 = fscanf(f, "MemFree: %" SCNd64 " kB\n", aMemFree);
fclose(f);
if (n1 != 1 || n2 != 1) {
return NS_ERROR_FAILURE;
}
// Convert from KB to B.
*aMemTotal *= 1024;
*aMemFree *= 1024;
return NS_OK;
}
nsresult CollectProcessReports(nsIHandleReportCallback* aHandleReport,
nsISupports* aData,
int64_t* aTotalPss)
{
*aTotalPss = 0;
ProcessSizes processSizes;
DIR* d = opendir("/proc");
if (NS_WARN_IF(!d)) {
return NS_ERROR_FAILURE;
}
struct dirent* ent;
while ((ent = readdir(d))) {
struct stat statbuf;
const char* pidStr = ent->d_name;
// Don't check the return value of stat() -- it can return -1 for these
// directories even when it has succeeded, apparently.
stat(pidStr, &statbuf);
if (S_ISDIR(statbuf.st_mode) && IsNumeric(pidStr)) {
nsCString processName("process(");
// Get the command name from cmdline. If that fails, the pid is still
// shown.
nsPrintfCString cmdlinePath("/proc/%s/cmdline", pidStr);
FILE* f = fopen(cmdlinePath.get(), "r");
if (f) {
static const size_t len = 256;
char buf[len];
if (fgets(buf, len, f)) {
processName.Append(buf);
// A hack: replace forward slashes with '\\' so they aren't treated
// as path separators. Consumers of this reporter (such as
// about:memory) have to undo this change.
processName.ReplaceChar('/', '\\');
processName.Append(", ");
}
fclose(f);
}
processName.Append("pid=");
processName.Append(pidStr);
processName.Append(")");
// Read the PSS values from the smaps file.
nsPrintfCString smapsPath("/proc/%s/smaps", pidStr);
f = fopen(smapsPath.get(), "r");
if (!f) {
// Processes can terminate between the readdir() call above and now,
// so just skip if we can't open the file.
continue;
}
while (true) {
nsresult rv = ParseMapping(f, processName, aHandleReport, aData,
&processSizes, aTotalPss);
if (NS_FAILED(rv))
break;
}
fclose(f);
}
}
closedir(d);
// Report the "processes/" tree.
for (size_t i = 0; i < ProcessSizeKindLimit; i++) {
nsAutoCString path("processes/");
path.Append(kindPathSuffixes[i]);
nsAutoCString desc("This is the sum of all processes' '");
desc.Append(kindPathSuffixes[i]);
desc.Append("' numbers.");
REPORT(path, processSizes.mSizes[i], desc);
}
return NS_OK;
}
nsresult ParseMapping(FILE* aFile,
const nsACString& aProcessName,
nsIHandleReportCallback* aHandleReport,
nsISupports* aData,
ProcessSizes* aProcessSizes,
int64_t* aTotalPss)
{
// The first line of an entry in /proc/<pid>/smaps looks just like an entry
// in /proc/<pid>/maps:
//
// address perms offset dev inode pathname
// 02366000-025d8000 rw-p 00000000 00:00 0 [heap]
const int argCount = 8;
unsigned long long addrStart, addrEnd;
char perms[5];
unsigned long long offset;
// The 2.6 and 3.0 kernels allocate 12 bits for the major device number and
// 20 bits for the minor device number. Future kernels might allocate more.
// 64 bits ought to be enough for anybody.
char devMajor[17];
char devMinor[17];
unsigned int inode;
char path[1025];
// A path might not be present on this line; set it to the empty string.
path[0] = '\0';
// This is a bit tricky. Whitespace in a scanf pattern matches *any*
// whitespace, including newlines. We want this pattern to match a line
// with or without a path, but we don't want to look to a new line for the
// path. Thus we have %u%1024[^\n] at the end of the pattern. This will
// capture into the path some leading whitespace, which we'll later trim
// off.
int n = fscanf(aFile,
"%llx-%llx %4s %llx "
"%16[0-9a-fA-F]:%16[0-9a-fA-F] %u%1024[^\n]",
&addrStart, &addrEnd, perms, &offset, devMajor,
devMinor, &inode, path);
// Eat up any whitespace at the end of this line, including the newline.
unused << fscanf(aFile, " ");
// We might or might not have a path, but the rest of the arguments should
// be there.
if (n != argCount && n != argCount - 1) {
return NS_ERROR_FAILURE;
}
nsAutoCString name, description;
ProcessSizeKind kind;
GetReporterNameAndDescription(path, perms, name, description, &kind);
while (true) {
size_t pss;
nsresult rv = ParseMapBody(aFile, aProcessName, name, description,
aHandleReport, aData, &pss);
if (NS_FAILED(rv))
break;
// Increment the appropriate aProcessSizes values, and the total.
aProcessSizes->mSizes[kind] += pss;
*aTotalPss += pss;
}
return NS_OK;
}
void GetReporterNameAndDescription(const char* aPath,
const char* aPerms,
nsACString& aName,
nsACString& aDesc,
ProcessSizeKind* aProcessSizeKind)
{
aName.Truncate();
aDesc.Truncate();
// If aPath points to a file, we have its absolute path, plus some
// whitespace. Truncate this to its basename, and put the absolute path in
// the description.
nsAutoCString absPath;
absPath.Append(aPath);
absPath.StripChars(" ");
nsAutoCString basename;
GetBasename(absPath, basename);
if (basename.EqualsLiteral("[heap]")) {
aName.Append("anonymous/brk-heap");
aDesc.Append("Memory in anonymous mappings within the boundaries "
"defined by brk() / sbrk(). This is likely to be just "
"a portion of the application's heap; the remainder "
"lives in other anonymous mappings. This corresponds to "
"'[heap]' in /proc/<pid>/smaps.");
*aProcessSizeKind = AnonymousBrkHeap;
} else if (basename.EqualsLiteral("[stack]")) {
aName.Append("main-thread-stack");
aDesc.Append("The stack size of the process's main thread. This "
"corresponds to '[stack]' in /proc/<pid>/smaps.");
*aProcessSizeKind = MainThreadStack;
} else if (basename.EqualsLiteral("[vdso]")) {
aName.Append("vdso");
aDesc.Append("The virtual dynamically-linked shared object, also known "
"as the 'vsyscall page'. This is a memory region mapped by "
"the operating system for the purpose of allowing processes "
"to perform some privileged actions without the overhead of "
"a syscall.");
*aProcessSizeKind = Vdso;
} else if (!IsAnonymous(basename)) {
nsAutoCString dirname;
GetDirname(absPath, dirname);
// Hack: A file is a shared library if the basename contains ".so" and
// its dirname contains "/lib", or if the basename ends with ".so".
if (EndsWithLiteral(basename, ".so") ||
(basename.Find(".so") != -1 && dirname.Find("/lib") != -1)) {
aName.Append("shared-libraries/");
if (strncmp(aPerms, "r-x", 3) == 0) {
*aProcessSizeKind = SharedLibrariesRX;
} else if (strncmp(aPerms, "rw-", 3) == 0) {
*aProcessSizeKind = SharedLibrariesRW;
} else if (strncmp(aPerms, "r--", 3) == 0) {
*aProcessSizeKind = SharedLibrariesR;
} else {
*aProcessSizeKind = SharedLibrariesOther;
}
} else {
aName.Append("other-files/");
if (EndsWithLiteral(basename, ".xpi")) {
aName.Append("extensions/");
} else if (dirname.Find("/fontconfig") != -1) {
aName.Append("fontconfig/");
}
*aProcessSizeKind = OtherFiles;
}
aName.Append(basename);
aDesc.Append(absPath);
} else {
aName.Append("anonymous/outside-brk");
aDesc.Append("Memory in anonymous mappings outside the boundaries "
"defined by brk() / sbrk().");
*aProcessSizeKind = AnonymousOutsideBrk;
}
aName.Append("/[");
aName.Append(aPerms);
aName.Append("]");
// Append the permissions. This is useful for non-verbose mode in
// about:memory when the filename is long and goes of the right side of the
// window.
aDesc.Append(" [");
aDesc.Append(aPerms);
aDesc.Append("]");
}
nsresult ParseMapBody(
FILE* aFile,
const nsACString& aProcessName,
const nsACString& aName,
const nsACString& aDescription,
nsIHandleReportCallback* aHandleReport,
nsISupports* aData,
size_t* aPss)
{
// Most of the lines in the body look like this:
//
// Size: 132 kB
// Rss: 20 kB
// Pss: 20 kB
//
// We're only interested in Pss. In newer kernels, the last line in the
// body has a different form:
//
// VmFlags: rd wr mr mw me dw ac
//
// The strings after "VmFlags: " vary.
char desc[1025];
int64_t sizeKB;
int n = fscanf(aFile, "%1024[a-zA-Z_]: %" SCNd64 " kB\n", desc, &sizeKB);
if (n == EOF || n == 0) {
return NS_ERROR_FAILURE;
} else if (n == 1 && strcmp(desc, "VmFlags") == 0) {
// This is the "VmFlags:" line. Chew up the rest of it.
fscanf(aFile, "%*1024[a-z ]\n");
return NS_ERROR_FAILURE;
}
// Only report "Pss" values.
if (strcmp(desc, "Pss") == 0) {
*aPss = sizeKB * 1024;
// Don't report zero values.
if (*aPss == 0) {
return NS_OK;
}
nsAutoCString path("mem/processes/");
path.Append(aProcessName);
path.Append("/");
path.Append(aName);
REPORT(path, *aPss, aDescription);
} else {
*aPss = 0;
}
return NS_OK;
}
#undef REPORT
};
NS_IMPL_ISUPPORTS1(SystemReporter, nsIMemoryReporter)
// Keep this in sync with SystemReporter::ProcessSizeKind!
const char* SystemReporter::kindPathSuffixes[] = {
"anonymous/outside-brk",
"anonymous/brk-heap",
"shared-libraries/read-executable",
"shared-libraries/read-write",
"shared-libraries/read-only",
"shared-libraries/other",
"other-files",
"main-thread-stack",
"vdso"
};
void Init()
{
RegisterStrongMemoryReporter(new SystemReporter());
}
} // namespace SystemMemoryReporter
} // namespace mozilla

View File

@ -0,0 +1,25 @@
/* -*- Mode: C++; tab-width: 50; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 ci et: */
/* 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/. */
#ifndef mozilla_SystemMemoryReporter_h_
#define mozilla_SystemMemoryReporter_h_
namespace mozilla {
namespace SystemMemoryReporter {
// This only works on Linux, but to make callers' lives easier, we stub out
// empty functions on other platforms.
#if defined(XP_LINUX)
void Init();
#else
void Init() {}
#endif
} // namespace SystemMemoryReporter
} // namespace mozilla
#endif

View File

@ -78,6 +78,7 @@ EXPORTS.mozilla += [
'StackWalk.h',
'StaticMutex.h',
'StaticPtr.h',
'SystemMemoryReporter.h',
'VisualEventTracer.h',
]
@ -117,6 +118,11 @@ UNIFIED_SOURCES += [
'VisualEventTracer.cpp',
]
if CONFIG['OS_ARCH'] == 'Linux':
SOURCES += [
'SystemMemoryReporter.cpp',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
SOURCES += [
'nsMacUtilsImpl.cpp',

View File

@ -136,16 +136,17 @@ interface nsIMemoryReporterCallback : nsISupports
* aboutMemory.js is the most important consumer of memory reports. It
* places the following constraints on reports.
*
* - There must be an "explicit" tree. It represents non-overlapping
* regions of memory that have been explicitly allocated with an
* OS-level allocation (e.g. mmap/VirtualAlloc/vm_allocate) or a
* heap-level allocation (e.g. malloc/calloc/operator new). Reporters
* in this tree must have kind HEAP or NONHEAP, units BYTES, and a
* description that is a sentence (i.e. starts with a capital letter and
* ends with a period, or similar).
* - All reports within a single sub-tree must have the same units.
*
* - All other reports are unconstrained except that they must have a
* description that is a sentence.
* - There may be an "explicit" tree. If present, it represents
* non-overlapping regions of memory that have been explicitly allocated with
* an OS-level allocation (e.g. mmap/VirtualAlloc/vm_allocate) or a
* heap-level allocation (e.g. malloc/calloc/operator new). Reporters in
* this tree must have kind HEAP or NONHEAP, units BYTES.
*
* It is preferred, but not required, that report descriptions use complete
* sentences (i.e. start with a capital letter and end with a period, or
* similar).
*/
[scriptable, uuid(0884cd0f-5829-4381-979b-0f53904030ed)]
interface nsIMemoryReporter : nsISupports

View File

@ -123,6 +123,7 @@ extern nsresult nsStringInputStreamConstructor(nsISupports *, REFNSIID, void **)
#include "mozilla/ipc/BrowserProcessSubThread.h"
#include "mozilla/AvailableMemoryTracker.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/SystemMemoryReporter.h"
#ifdef MOZ_VISUAL_EVENT_TRACER
#include "mozilla/VisualEventTracer.h"
@ -581,6 +582,13 @@ NS_InitXPCOM2(nsIServiceManager* *result,
CreateAnonTempFileRemover();
#endif
// We only want the SystemMemoryReporter running in one process, because it
// profiles the entire system. The main process is the obvious place for
// it.
if (XRE_GetProcessType() == GeckoProcessType_Default) {
mozilla::SystemMemoryReporter::Init();
}
// The memory reporter manager is up and running -- register a reporter for
// ICU's memory usage.
RegisterStrongMemoryReporter(new ICUReporter());