Home | History | Annotate | Download | only in jni
      1 # Copyright (C) 2010 The Android Open Source Project
      2 #
      3 # Licensed under the Apache License, Version 2.0 (the "License");
      4 # you may not use this file except in compliance with the License.
      5 # You may obtain a copy of the License at
      6 #
      7 #      http://www.apache.org/licenses/LICENSE-2.0
      8 #
      9 # Unless required by applicable law or agreed to in writing, software
     10 # distributed under the License is distributed on an "AS IS" BASIS,
     11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     12 # See the License for the specific language governing permissions and
     13 # limitations under the License.
     14 
     15 LOCAL_PATH:= $(call my-dir)
     16 
     17 include $(CLEAR_VARS)
     18 
     19 LOCAL_MODULE := libctsos_jni
     20 
     21 # Don't include this package in any configuration by default.
     22 LOCAL_MODULE_TAGS := optional
     23 
     24 LOCAL_SRC_FILES := \
     25 		CtsOsJniOnLoad.cpp \
     26 		android_os_cts_CpuInstructions.cpp.arm \
     27 		android_os_cts_TaggedPointer.cpp \
     28 		android_os_cts_HardwareName.cpp \
     29 		android_os_cts_OSFeatures.cpp \
     30 		android_os_cts_NoExecutePermissionTest.cpp \
     31 		android_os_cts_SeccompTest.cpp \
     32 		android_os_cts_SharedMemory.cpp \
     33 		android_os_cts_SPMITest.cpp
     34 
     35 LOCAL_C_INCLUDES := $(JNI_H_INCLUDE)
     36 
     37 LOCAL_SHARED_LIBRARIES := libnativehelper_compat_libc++ liblog libdl libandroid
     38 LOCAL_CXX_STL := none
     39 
     40 LOCAL_STATIC_LIBRARIES := libc++_static libminijail
     41 
     42 # Select the architectures on which seccomp-bpf are supported. This is used to
     43 # include extra test files that will not compile on architectures where it is
     44 # not supported.
     45 ARCH_SUPPORTS_SECCOMP := 1
     46 ifeq ($(strip $(TARGET_ARCH)),mips)
     47 	ARCH_SUPPORTS_SECCOMP = 0
     48 endif
     49 ifeq ($(strip $(TARGET_ARCH)),mips64)
     50 	ARCH_SUPPORTS_SECCOMP = 0
     51 endif
     52 
     53 ifeq ($(ARCH_SUPPORTS_SECCOMP),1)
     54 	LOCAL_STATIC_LIBRARIES += external_seccomp_tests
     55 
     56 	# This define controls the behavior of OSFeatures.needsSeccompSupport().
     57 	LOCAL_CFLAGS += -DARCH_SUPPORTS_SECCOMP
     58 endif
     59 
     60 LOCAL_CFLAGS := -Wall -Werror -Wno-unused-parameter
     61 LOCAL_CFLAGS += -Wno-inline-asm -Wno-unused-const-variable
     62 
     63 # Let's overwrite -mcpu in case it's set to some ARMv8 core by
     64 # TARGET_2ND_CPU_VARIANT and causes clang to ignore the -march below.
     65 LOCAL_CPPFLAGS_arm := -mcpu=generic
     66 
     67 # The ARM version of this library must be built using ARMv7 ISA (even if it
     68 # can be run on armv8 cores) since one of the tested instruction, swp, is
     69 # only supported in ARMv7 (and older) cores, and obsolete in ARMv8.
     70 LOCAL_CPPFLAGS_arm += -march=armv7-a
     71 
     72 include $(BUILD_SHARED_LIBRARY)
     73