Skip to content

Commit

Permalink
Add Global posix thread aka pthread Support (1/2)
Browse files Browse the repository at this point in the history
this flag enables multithread support much like what I did in kitkat.

SaberMod/android_build-OLD@93d3763

Change-Id: Id5559ec460b2ba84ed9cfe7a47b0ac59544e1d61
Signed-off-by: Paul Beeler <pbeeler80@gmail.com>
  • Loading branch information
pbeeler committed Feb 20, 2015
1 parent bd6a606 commit 2bed7d2
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
17 changes: 9 additions & 8 deletions core/binary.mk
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ else
endif
endif

##########################################################################
# Copyright (C) 2014-2015 The SaberMod Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -110,22 +111,21 @@ endif
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# Include custom gcc flags. Seperate them so they can be easily managed.
##########################################################################

# arm thumb
ifeq ($(strip $(ENABLE_ARM_THUMB_INTERWORK)),true)
ifneq ($(strip $(LOCAL_IS_HOST_MODULE)),true)
include $(BUILD_SYSTEM)/thumb_interwork.mk
endif
# arm thumb, not used on the host compiler.
ifneq ($(strip $(LOCAL_IS_HOST_MODULE)),true)
include $(BUILD_SYSTEM)/thumb_interwork.mk
endif

# O3
ifeq ($(strip $(O3_OPTIMIZATIONS)),true)
include $(BUILD_SYSTEM)/O3.mk
endif

# Add pthread support
include $(BUILD_SYSTEM)/pthread.mk

# Do not use graphite on host modules or the clang compiler.
ifneq ($(strip $(LOCAL_IS_HOST_MODULE)),true)
ifneq ($(strip $(LOCAL_CLANG)),true)
Expand All @@ -135,6 +135,7 @@ ifneq ($(strip $(LOCAL_IS_HOST_MODULE)),true)
endif
endif


#end SaberMod

# The following LOCAL_ variables will be modified in this file.
Expand Down
22 changes: 22 additions & 0 deletions core/pthread.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (C) 2015 The SaberMod Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Add pthread flags globally
ifneq (1,$(words $(filter $(LOCAL_DISABLE_PTHREAD),$(LOCAL_MODULE))))
ifdef LOCAL_CFLAGS
LOCAL_CFLAGS += -pthread
else
LOCAL_CFLAGS := -pthread
endif
endif

0 comments on commit 2bed7d2

Please sign in to comment.