aboutsummaryrefslogtreecommitdiffstats
path: root/emulator/opengl/shared/OpenglOsUtils/Android.mk
blob: 2e5a8a117ff5c898cb307e0d5beca974ef3f81da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# This build script corresponds to a small library containing
# OS-specific support functions for:
#   - thread-local storage
#   - dynamic library loading
#   - child process creation and wait  (probably not needed in guest)
#
LOCAL_PATH := $(call my-dir)

### Guest library ##############################################
$(call emugl-begin-static-library,libOpenglOsUtils)

    $(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
    $(call emugl-export,LDLIBS,-ldl)

    LOCAL_SRC_FILES := \
        osProcessUnix.cpp \
        osThreadUnix.cpp \
        osDynLibrary.cpp

$(call emugl-end-module)


### Host library ##############################################

host_common_SRC_FILES := osDynLibrary.cpp
host_common_LDLIBS :=

ifeq ($(HOST_OS),windows)
    host_common_SRC_FILES += \
        osProcessWin.cpp \
        osThreadWin.cpp
    host_common_LDLIBS += -lws2_32 -lpsapi
else
    host_common_SRC_FILES += \
        osProcessUnix.cpp \
        osThreadUnix.cpp
    host_common_LDLIBS += -ldl
endif

ifeq ($(HOST_OS),linux)
    host_common_LDLIBS += -lpthread -lrt -lX11
endif

### 32-bit host library ####
$(call emugl-begin-host-static-library,libOpenglOsUtils)
    $(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
    LOCAL_SRC_FILES = $(host_common_SRC_FILES)
    $(call emugl-export,LDLIBS,$(host_common_LDLIBS))
$(call emugl-end-module)

### 64-bit host library ####
$(call emugl-begin-host-static-library,lib64OpenglOsUtils)
    $(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
    LOCAL_SRC_FILES = $(host_common_SRC_FILES)
    $(call emugl-export,LDLIBS,$(host_common_LDLIBS))
    $(call emugl-export,CFLAGS,-m64)
$(call emugl-end-module)