1# Copyright (C) 2008 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
15LOCAL_PATH := $(call my-dir)
16
17bzip_cflags := \
18    -O3 \
19    -DUSE_MMAP \
20    -Wno-unused-parameter \
21
22bzlib_files := \
23    blocksort.c \
24    bzlib.c \
25    compress.c \
26    crctable.c \
27    decompress.c \
28    huffman.c \
29    randtable.c \
30
31include $(CLEAR_VARS)
32# measurements show that the ARM version of ZLib is about x1.17 faster
33# than the thumb one...
34LOCAL_ARM_MODE := arm
35LOCAL_MODULE := libbz
36LOCAL_CFLAGS += $(bzip_cflags)
37LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
38ifeq ($(TARGET_ARCH),arm)
39  LOCAL_SDK_VERSION := 9
40endif
41LOCAL_SRC_FILES := $(bzlib_files)
42include $(BUILD_STATIC_LIBRARY)
43
44include $(CLEAR_VARS)
45LOCAL_CFLAGS += $(bzip_cflags)
46LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
47LOCAL_MODULE := libbz
48LOCAL_SRC_FILES := $(bzlib_files)
49include $(BUILD_HOST_STATIC_LIBRARY)
50