Skip to content
Snippets Groups Projects
Commit f55a78b2 authored by Michael Wu's avatar Michael Wu
Browse files

Bug 738561 - Cleanup mozglue for gonk, r=glandium

parent 93b9694f
No related branches found
No related tags found
No related merge requests found
......@@ -52,10 +52,6 @@ ifeq (android,$(MOZ_WIDGET_TOOLKIT))
DIRS += android
endif
ifeq (gonk,$(MOZ_WIDGET_TOOLKIT))
DIRS += gonk
endif
DIRS += build
TEST_DIRS = tests
......
......@@ -49,7 +49,6 @@
#include <sys/mman.h>
#include <sys/limits.h>
#include <errno.h>
#include <pthread.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
......@@ -1040,53 +1039,3 @@ ChildProcessInit(int argc, char* argv[])
return fXRE_InitChildProcess(argc, argv, proctype);
}
/* Android doesn't have pthread_atfork(), so we need to use our own. */
struct AtForkFuncs {
void (*prepare)(void);
void (*parent)(void);
void (*child)(void);
};
static std::vector<AtForkFuncs> atfork;
extern "C" NS_EXPORT int
__wrap_pthread_atfork(void (*prepare)(void), void (*parent)(void), void (*child)(void))
{
AtForkFuncs funcs;
funcs.prepare = prepare;
funcs.parent = parent;
funcs.child = child;
atfork.push_back(funcs);
return 0;
}
extern "C" NS_EXPORT pid_t
__wrap_fork(void)
{
pid_t pid;
for (std::vector<AtForkFuncs>::reverse_iterator it = atfork.rbegin();
it < atfork.rend(); ++it)
if (it->prepare)
it->prepare();
switch ((pid = fork())) {
case 0:
for (std::vector<AtForkFuncs>::iterator it = atfork.begin();
it < atfork.end(); ++it)
if (it->child)
it->child();
break;
default:
for (std::vector<AtForkFuncs>::iterator it = atfork.begin();
it < atfork.end(); ++it)
if (it->parent)
it->parent();
}
return pid;
}
extern "C" NS_EXPORT int
__wrap_raise(int sig)
{
return pthread_kill(pthread_self(), sig);
}
/* -*- Mode: C++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
......
......@@ -82,22 +82,19 @@ NO_INSTALL_IMPORT_LIBRARY = 1
endif
endif
ifeq (android, $(MOZ_WIDGET_TOOLKIT))
# Add Android specific code
EXTRA_DSO_LDOPTS += $(ZLIB_LIBS)
ifeq (Android,$(OS_TARGET))
ifdef MOZ_MEMORY
# To properly wrap jemalloc's pthread_atfork call.
EXTRA_DSO_LDOPTS += -Wl,--wrap=pthread_atfork
CPPSRCS += BionicGlue.cpp
endif
SHARED_LIBRARY_LIBS += $(call EXPAND_LIBNAME_PATH,android,$(DEPTH)/other-licenses/android)
SHARED_LIBRARY_LIBS += $(call EXPAND_LIBNAME_PATH,android,../android)
endif
ifeq (gonk, $(MOZ_WIDGET_TOOLKIT))
# To properly wrap jemalloc's pthread_atfork call.
EXTRA_DSO_LDOPTS += -Wl,--wrap=pthread_atfork
SHARED_LIBRARY_LIBS += $(call EXPAND_LIBNAME_PATH,android,$(DEPTH)/other-licenses/android)
SHARED_LIBRARY_LIBS += $(call EXPAND_LIBNAME_PATH,gonk,../gonk)
ifeq (android, $(MOZ_WIDGET_TOOLKIT))
# Add Android specific code
EXTRA_DSO_LDOPTS += $(ZLIB_LIBS)
SHARED_LIBRARY_LIBS += $(call EXPAND_LIBNAME_PATH,android,../android)
endif
ifdef MOZ_LINKER
......
# 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/.
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = gonk
LIBRARY_NAME = gonk
FORCE_STATIC_LIB = 1
STL_FLAGS=
DEFINES += \
-DANDROID_PACKAGE_NAME='"$(ANDROID_PACKAGE_NAME)"' \
$(NULL)
CPPSRCS = \
GonkGlue.cpp \
$(NULL)
LOCAL_INCLUDES += -I$(DEPTH)/build
LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/build
include $(topsrcdir)/config/rules.mk
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment