Android.mk
author Ryan C. Gordon <icculus@icculus.org>
Mon, 29 Oct 2018 20:00:03 -0400
changeset 12369 68c87b40b434
parent 12365 09e3ef028bc8
child 12387 2f02c753a5dc
permissions -rw-r--r--
winmain: Don't use SDL_malloc (or SDL_stack_alloc, which might be malloc).

Otherwise, we are using the allocator before the app can set up its own hooks.

Now we use VirtualAlloc, and WideCharToMultiByte (because SDL_iconv uses
SDL_malloc, too!) to get ready to call into SDL_main.

This also makes console_wmain() call into the same routines as everything
else, so we don't have to deal with those allocations, too. Hopefully we
end up with the same results from GetCommandLine() as we do in wargv.

Fixes Bugzilla #4340.
slouken@4964
     1
LOCAL_PATH := $(call my-dir)
slouken@4964
     2
slouken@4964
     3
###########################
slouken@4964
     4
#
slouken@4964
     5
# SDL shared library
slouken@4964
     6
#
slouken@4964
     7
###########################
slouken@4964
     8
slouken@4964
     9
include $(CLEAR_VARS)
slouken@4964
    10
slouken@6270
    11
LOCAL_MODULE := SDL2
slouken@4964
    12
slouken@4964
    13
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
slouken@4964
    14
slouken@7311
    15
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
slouken@7311
    16
slouken@5090
    17
LOCAL_SRC_FILES := \
slouken@4964
    18
	$(subst $(LOCAL_PATH)/,, \
slouken@4964
    19
	$(wildcard $(LOCAL_PATH)/src/*.c) \
slouken@4964
    20
	$(wildcard $(LOCAL_PATH)/src/audio/*.c) \
slouken@5090
    21
	$(wildcard $(LOCAL_PATH)/src/audio/android/*.c) \
slouken@5090
    22
	$(wildcard $(LOCAL_PATH)/src/audio/dummy/*.c) \
slouken@10879
    23
	$(LOCAL_PATH)/src/atomic/SDL_atomic.c.arm \
slouken@5003
    24
	$(LOCAL_PATH)/src/atomic/SDL_spinlock.c.arm \
ewing@7501
    25
	$(wildcard $(LOCAL_PATH)/src/core/android/*.c) \
slouken@4964
    26
	$(wildcard $(LOCAL_PATH)/src/cpuinfo/*.c) \
icculus@8097
    27
	$(wildcard $(LOCAL_PATH)/src/dynapi/*.c) \
slouken@4964
    28
	$(wildcard $(LOCAL_PATH)/src/events/*.c) \
slouken@4964
    29
	$(wildcard $(LOCAL_PATH)/src/file/*.c) \
slouken@5090
    30
	$(wildcard $(LOCAL_PATH)/src/haptic/*.c) \
slouken@11238
    31
	$(wildcard $(LOCAL_PATH)/src/haptic/android/*.c) \
slouken@4964
    32
	$(wildcard $(LOCAL_PATH)/src/joystick/*.c) \
slouken@5090
    33
	$(wildcard $(LOCAL_PATH)/src/joystick/android/*.c) \
slouken@12088
    34
	$(wildcard $(LOCAL_PATH)/src/joystick/hidapi/*.c) \
slouken@5092
    35
	$(wildcard $(LOCAL_PATH)/src/loadso/dlopen/*.c) \
slouken@5090
    36
	$(wildcard $(LOCAL_PATH)/src/power/*.c) \
slouken@6448
    37
	$(wildcard $(LOCAL_PATH)/src/power/android/*.c) \
slouken@9054
    38
	$(wildcard $(LOCAL_PATH)/src/filesystem/android/*.c) \
slouken@12130
    39
	$(wildcard $(LOCAL_PATH)/src/sensor/*.c) \
slouken@12130
    40
	$(wildcard $(LOCAL_PATH)/src/sensor/android/*.c) \
slouken@5161
    41
	$(wildcard $(LOCAL_PATH)/src/render/*.c) \
slouken@5204
    42
	$(wildcard $(LOCAL_PATH)/src/render/*/*.c) \
slouken@4964
    43
	$(wildcard $(LOCAL_PATH)/src/stdlib/*.c) \
slouken@4964
    44
	$(wildcard $(LOCAL_PATH)/src/thread/*.c) \
slouken@5090
    45
	$(wildcard $(LOCAL_PATH)/src/thread/pthread/*.c) \
slouken@4964
    46
	$(wildcard $(LOCAL_PATH)/src/timer/*.c) \
slouken@5090
    47
	$(wildcard $(LOCAL_PATH)/src/timer/unix/*.c) \
slouken@4964
    48
	$(wildcard $(LOCAL_PATH)/src/video/*.c) \
gabomdq@7793
    49
	$(wildcard $(LOCAL_PATH)/src/video/android/*.c) \
slouken@11702
    50
	$(wildcard $(LOCAL_PATH)/src/video/yuv2rgb/*.c) \
slouken@11534
    51
	$(wildcard $(LOCAL_PATH)/src/test/*.c))
slouken@4964
    52
slouken@12088
    53
LOCAL_SHARED_LIBRARIES := hidapi
slouken@12088
    54
slouken@6208
    55
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES
gabomdq@7659
    56
LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -llog -landroid
slouken@4964
    57
icculus@12032
    58
ifeq ($(NDK_DEBUG),1)
icculus@12032
    59
    cmd-strip :=
icculus@12032
    60
endif
slouken@11777
    61
slouken@4964
    62
include $(BUILD_SHARED_LIBRARY)
slouken@7804
    63
slouken@7804
    64
###########################
slouken@7804
    65
#
slouken@7804
    66
# SDL static library
slouken@7804
    67
#
slouken@7804
    68
###########################
slouken@7804
    69
slouken@7804
    70
LOCAL_MODULE := SDL2_static
slouken@7804
    71
slouken@7804
    72
LOCAL_MODULE_FILENAME := libSDL2
slouken@7804
    73
slouken@7804
    74
LOCAL_LDLIBS := 
slouken@11429
    75
LOCAL_EXPORT_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -llog -landroid
slouken@7804
    76
slouken@7804
    77
include $(BUILD_STATIC_LIBRARY)
slouken@11262
    78
slouken@11262
    79
###########################
slouken@11262
    80
#
slouken@11262
    81
# SDL main static library
slouken@11262
    82
#
slouken@11262
    83
###########################
slouken@11262
    84
slouken@11262
    85
include $(CLEAR_VARS)
slouken@11262
    86
slouken@11262
    87
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
slouken@11262
    88
slouken@11262
    89
LOCAL_MODULE := SDL2_main
slouken@11262
    90
slouken@11262
    91
LOCAL_MODULE_FILENAME := libSDL2main
slouken@11262
    92
slouken@11262
    93
include $(BUILD_STATIC_LIBRARY)
slouken@11262
    94
slouken@12088
    95
###########################
slouken@12088
    96
#
slouken@12088
    97
# hidapi library
slouken@12088
    98
#
slouken@12088
    99
###########################
slouken@11262
   100
slouken@12088
   101
include $(CLEAR_VARS)
slouken@12088
   102
slouken@12088
   103
LOCAL_CPPFLAGS += -std=c++11
slouken@12088
   104
slouken@12365
   105
LOCAL_SRC_FILES := src/hidapi/android/hid.cpp
slouken@12088
   106
slouken@12088
   107
LOCAL_MODULE := libhidapi
slouken@12088
   108
LOCAL_LDLIBS := -llog
slouken@12088
   109
slouken@12088
   110
include $(BUILD_SHARED_LIBRARY)