Android.mk
author Ozkan Sezer <sezeroz@gmail.com>
Thu, 18 Oct 2018 11:57:19 +0300
changeset 612 ca95d0e31aec
parent 588 960662a9dbdc
child 627 34a3f499aff4
permissions -rw-r--r--
use less ancient versions of autofoo scripts
     1 SDL_IMAGE_LOCAL_PATH := $(call my-dir)
     2 
     3 
     4 # Enable this if you want to support loading JPEG images
     5 # The library path should be a relative path to this directory.
     6 SUPPORT_JPG ?= true
     7 JPG_LIBRARY_PATH := external/jpeg-9b
     8 
     9 # Enable this if you want to support loading PNG images
    10 # The library path should be a relative path to this directory.
    11 SUPPORT_PNG ?= true
    12 PNG_LIBRARY_PATH := external/libpng-1.6.32
    13 
    14 # Enable this if you want to support loading WebP images
    15 # The library path should be a relative path to this directory.
    16 SUPPORT_WEBP ?= true
    17 WEBP_LIBRARY_PATH := external/libwebp-0.6.0
    18 
    19 
    20 # Build the library
    21 ifeq ($(SUPPORT_JPG),true)
    22     include $(SDL_IMAGE_LOCAL_PATH)/$(JPG_LIBRARY_PATH)/Android.mk
    23 endif
    24 
    25 # Build the library
    26 ifeq ($(SUPPORT_PNG),true)
    27     include $(SDL_IMAGE_LOCAL_PATH)/$(PNG_LIBRARY_PATH)/Android.mk
    28 endif
    29 
    30 # Build the library
    31 ifeq ($(SUPPORT_WEBP),true)
    32     include $(SDL_IMAGE_LOCAL_PATH)/$(WEBP_LIBRARY_PATH)/Android.mk
    33 endif
    34 
    35 
    36 # Restore local path
    37 LOCAL_PATH := $(SDL_IMAGE_LOCAL_PATH)
    38 
    39 include $(CLEAR_VARS)
    40 
    41 LOCAL_MODULE := SDL2_image
    42 
    43 LOCAL_SRC_FILES :=  \
    44     IMG.c           \
    45     IMG_bmp.c       \
    46     IMG_gif.c       \
    47     IMG_jpg.c       \
    48     IMG_lbm.c       \
    49     IMG_pcx.c       \
    50     IMG_png.c       \
    51     IMG_pnm.c       \
    52     IMG_svg.c       \
    53     IMG_tga.c       \
    54     IMG_tif.c       \
    55     IMG_webp.c      \
    56     IMG_WIC.c       \
    57     IMG_xcf.c       \
    58     IMG_xpm.c.arm   \
    59     IMG_xv.c        \
    60     IMG_xxx.c
    61 
    62 LOCAL_CFLAGS := -DLOAD_BMP -DLOAD_GIF -DLOAD_LBM -DLOAD_PCX -DLOAD_PNM \
    63                 -DLOAD_SVG -DLOAD_TGA -DLOAD_XCF -DLOAD_XPM -DLOAD_XV
    64 LOCAL_LDLIBS :=
    65 LOCAL_STATIC_LIBRARIES :=
    66 LOCAL_SHARED_LIBRARIES := SDL2
    67 
    68 ifeq ($(SUPPORT_JPG),true)
    69     LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(JPG_LIBRARY_PATH)
    70     LOCAL_CFLAGS += -DLOAD_JPG
    71     LOCAL_STATIC_LIBRARIES += jpeg
    72 endif
    73 
    74 ifeq ($(SUPPORT_PNG),true)
    75     LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(PNG_LIBRARY_PATH)
    76     LOCAL_CFLAGS += -DLOAD_PNG
    77     LOCAL_STATIC_LIBRARIES += png
    78     LOCAL_LDLIBS += -lz
    79 endif
    80 
    81 ifeq ($(SUPPORT_WEBP),true)
    82     LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(WEBP_LIBRARY_PATH)/src
    83     LOCAL_CFLAGS += -DLOAD_WEBP
    84     LOCAL_STATIC_LIBRARIES += webp
    85 endif
    86 
    87 LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)
    88 
    89 include $(BUILD_SHARED_LIBRARY)