• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# This build script corresponds to a small library containing
2# OS-specific support functions for:
3#   - thread-local storage
4#   - dynamic library loading
5#   - child process creation and wait  (probably not needed in guest)
6#
7LOCAL_PATH := $(call my-dir)
8
9### Guest library ##############################################
10$(call emugl-begin-static-library,libOpenglOsUtils)
11
12    $(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
13    $(call emugl-export,LDLIBS,-ldl)
14
15    LOCAL_SRC_FILES := \
16        osProcessUnix.cpp \
17        osThreadUnix.cpp \
18        osDynLibrary.cpp
19
20$(call emugl-end-module)
21
22
23### Host library ##############################################
24
25host_common_SRC_FILES := osDynLibrary.cpp
26host_common_LDLIBS :=
27
28ifeq ($(HOST_OS),windows)
29    host_common_SRC_FILES += \
30        osProcessWin.cpp \
31        osThreadWin.cpp
32    host_common_LDLIBS += -lws2_32 -lpsapi
33else
34    host_common_SRC_FILES += \
35        osProcessUnix.cpp \
36        osThreadUnix.cpp
37    host_common_LDLIBS += -ldl
38endif
39
40ifeq ($(HOST_OS),linux)
41    host_common_LDLIBS += -lpthread -lrt
42endif
43
44### 32-bit host library ####
45$(call emugl-begin-host-static-library,libOpenglOsUtils)
46    $(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
47    LOCAL_SRC_FILES = $(host_common_SRC_FILES)
48    $(call emugl-export,LDLIBS,$(host_common_LDLIBS))
49$(call emugl-end-module)
50
51### 64-bit host library ####
52$(call emugl-begin-host-static-library,lib64OpenglOsUtils)
53    $(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
54    LOCAL_SRC_FILES = $(host_common_SRC_FILES)
55    $(call emugl-export,LDLIBS,$(host_common_LDLIBS))
56    $(call emugl-export,CFLAGS,-m64)
57$(call emugl-end-module)
58