• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# This is included from the main Android emulator build script
2# to declare the SDL-related sources, compiler flags and libraries
3#
4
5SDL_CFLAGS :=
6SDL_LDLIBS :=
7SDL_STATIC_LIBRARIES :=
8
9SDL_SOURCES :=
10
11ifeq ($(HOST_OS),linux)
12    SDL_CONFIG_LOADSO_DLOPEN := yes
13    SDL_CONFIG_THREAD_PTHREAD := yes
14    SDL_CONFIG_THREAD_PTHREAD_RECURSIVE_MUTEX_NP := yes
15    SDL_CONFIG_TIMER_UNIX := yes
16    SDL_CONFIG_VIDEO_X11 := yes
17    SDL_CONFIG_VIDEO_X11_DPMS := yes
18    SDL_CONFIG_VIDEO_X11_XINERAMA := yes
19    SDL_CONFIG_VIDEO_X11_XME := yes
20    SDL_CONFIG_MAIN_DUMMY := yes
21
22    SDL_CFLAGS += -D_GNU_SOURCE=1 -D_REENTRANT
23    SDL_LDLIBS += -lm -ldl -lpthread -lrt
24endif
25
26ifeq ($(HOST_OS),freebsd)
27    SDL_CONFIG_LOADSO_DLOPEN := yes
28    SDL_CONFIG_THREAD_PTHREAD := yes
29    SDL_CONFIG_THREAD_PTHREAD_RECURSIVE_MUTEX := yes
30    SDL_CONFIG_TIMER_UNIX := yes
31    SDL_CONFIG_VIDEO_X11 := yes
32    SDL_CONFIG_VIDEO_X11_DPMS := yes
33    SDL_CONFIG_VIDEO_X11_XINERAMA := yes
34    SDL_CONFIG_VIDEO_X11_XME := yes
35    SDL_CONFIG_MAIN_DUMMY := yes
36
37    SDL_CFLAGS += -D_GNU_SOURCE=1 -D_REENTRANT
38    SDL_LDLIBS += -lm -ldl -lpthread
39endif
40
41ifeq ($(HOST_OS),darwin)
42    SDL_CONFIG_LOADSO_DLCOMPAT := yes
43    SDL_CONFIG_THREAD_PTHREAD := yes
44    SDL_CONFIG_THREAD_PTHREAD_RECURSIVE_MUTEX := yes
45    SDL_CONFIG_TIMER_UNIX := yes
46    SDL_CONFIG_VIDEO_QUARTZ := yes
47    SDL_CONFIG_MAIN_MACOSX := yes
48
49    SDL_CFLAGS += -D_GNU_SOURCE=1 -DTHREAD_SAFE
50    FRAMEWORKS := OpenGL Cocoa QuickTime ApplicationServices Carbon IOKit
51    SDL_LDLIBS += $(FRAMEWORKS:%=-Wl,-framework,%)
52endif
53
54ifeq ($(HOST_OS),windows)
55    SDL_CONFIG_LOADSO_WIN32 := yes
56    SDL_CONFIG_THREAD_WIN32 := yes
57    SDL_CONFIG_TIMER_WIN32 := yes
58    SDL_CONFIG_VIDEO_WINDIB := yes
59    SDL_CONFIG_MAIN_WIN32 := yes
60
61    SDL_CFLAGS += -D_GNU_SOURCE=1 -Dmain=SDL_main -DNO_STDIO_REDIRECT=1
62    SDL_LDLIBS += -luser32 -lgdi32 -lwinmm
63endif
64
65
66# the main src/ sources
67#
68SRCS := SDL.c \
69        SDL_error.c \
70        SDL_fatal.c \
71
72SRCS += events/SDL_active.c \
73	events/SDL_events.c \
74	events/SDL_expose.c \
75	events/SDL_keyboard.c \
76	events/SDL_mouse.c \
77	events/SDL_quit.c \
78	events/SDL_resize.c \
79
80SRCS += file/SDL_rwops.c
81
82SRCS += stdlib/SDL_getenv.c \
83        stdlib/SDL_iconv.c \
84        stdlib/SDL_malloc.c \
85        stdlib/SDL_qsort.c \
86        stdlib/SDL_stdlib.c \
87        stdlib/SDL_string.c
88
89SRCS += cpuinfo/SDL_cpuinfo.c
90
91SDL_SOURCES += $(SRCS:%=$(SDL_DIR)/src/%)
92
93# the LoadSO sources
94#
95
96SRCS :=
97
98ifeq ($(SDL_CONFIG_LOADSO_DLOPEN),yes)
99  SRCS += dlopen/SDL_sysloadso.c
100  SDL_LDLIBS += -ldl
101endif
102
103ifeq ($(SDL_CONFIG_LOADSO_DLCOMPAT),yes)
104  SRCS += macosx/SDL_dlcompat.c
105endif
106
107ifeq ($(SDL_CONFIG_LOADSO_WIN32),yes)
108  SRCS += win32/SDL_sysloadso.c
109endif
110
111SDL_SOURCES += $(SRCS:%=$(SDL_DIR)/src/loadso/%)
112
113# the Thread sources
114#
115
116SRCS := SDL_thread.c
117
118ifeq ($(SDL_CONFIG_THREAD_PTHREAD),yes)
119  SRCS += pthread/SDL_syscond.c \
120          pthread/SDL_sysmutex.c \
121          pthread/SDL_syssem.c \
122          pthread/SDL_systhread.c
123endif
124
125ifeq ($(SDL_CONFIG_THREAD_WIN32),yes)
126  SRCS += win32/SDL_sysmutex.c \
127          win32/SDL_syssem.c \
128          win32/SDL_systhread.c
129endif
130
131SDL_SOURCES += $(SRCS:%=$(SDL_DIR)/src/thread/%)
132
133# the Timer sources
134#
135
136SRCS := SDL_timer.c
137
138ifeq ($(SDL_CONFIG_TIMER_UNIX),yes)
139  SRCS += unix/SDL_systimer.c
140endif
141
142ifeq ($(SDL_CONFIG_TIMER_WIN32),yes)
143  SRCS += win32/SDL_systimer.c
144endif
145
146SDL_SOURCES += $(SRCS:%=$(SDL_DIR)/src/timer/%)
147
148# the Video sources
149#
150
151SRCS := SDL_RLEaccel.c \
152	SDL_blit.c \
153	SDL_blit_0.c \
154	SDL_blit_1.c \
155	SDL_blit_A.c \
156	SDL_blit_N.c \
157	SDL_bmp.c \
158	SDL_cursor.c \
159	SDL_gamma.c \
160	SDL_pixels.c \
161	SDL_stretch.c \
162	SDL_surface.c \
163	SDL_video.c \
164	SDL_yuv.c \
165	SDL_yuv_mmx.c \
166	SDL_yuv_sw.c \
167
168SRCS += dummy/SDL_nullevents.c \
169        dummy/SDL_nullmouse.c \
170        dummy/SDL_nullvideo.c
171
172ifeq ($(SDL_CONFIG_VIDEO_WINDIB),yes)
173  SRCS += windib/SDL_dibevents.c \
174          windib/SDL_dibvideo.c \
175          wincommon/SDL_sysevents.c \
176          wincommon/SDL_sysmouse.c \
177          wincommon/SDL_syswm.c \
178          wincommon/SDL_wingl.c
179endif
180
181ifeq ($(SDL_CONFIG_VIDEO_QUARTZ),yes)
182  SRCS += quartz/SDL_QuartzGL.m \
183          quartz/SDL_QuartzVideo.m \
184          quartz/SDL_QuartzWM.m \
185          quartz/SDL_QuartzWindow.m \
186          quartz/SDL_QuartzYUV.m \
187          quartz/SDL_QuartzEvents.m \
188          maccommon/SDL_macevents.c \
189          maccommon/SDL_macgl.c \
190          maccommon/SDL_macmouse.c \
191          maccommon/SDL_macwm.c
192
193endif
194
195ifeq ($(SDL_CONFIG_VIDEO_X11),yes)
196  SRCS += x11/SDL_x11dyn.c \
197          x11/SDL_x11dga.c \
198          x11/SDL_x11events.c \
199          x11/SDL_x11gamma.c \
200          x11/SDL_x11gl.c \
201          x11/SDL_x11image.c \
202          x11/SDL_x11modes.c \
203          x11/SDL_x11mouse.c \
204          x11/SDL_x11video.c \
205          x11/SDL_x11wm.c \
206          x11/SDL_x11yuv.c
207endif
208
209ifeq ($(SDL_CONFIG_VIDEO_X11_DGAMOUSE),yes)
210  SRCS += x11/SDL_x11dga.c
211endif
212
213ifeq ($(SDL_CONFIG_VIDEO_X11_XME),yes)
214  SRCS += Xext/XME/xme.c
215endif
216
217ifeq ($(SDL_CONFIG_VIDEO_X11_XINERAMA),yes)
218  SRCS += Xext/Xinerama/Xinerama.c
219endif
220
221ifeq ($(SDL_CONFIG_VIDEO_X11_XV),yes)
222  SRCS += Xext/Xv/Xv.c
223endif
224
225SDL_SOURCES += $(SRCS:%=$(SDL_DIR)/src/video/%)
226
227## Build libSDLmain
228##
229
230SRCS :=
231
232ifeq ($(SDL_CONFIG_MAIN_DUMMY),yes)
233  SRCS += dummy/SDL_dummy_main.c
234endif
235
236ifeq ($(SDL_CONFIG_MAIN_MACOSX),yes)
237  SRCS += macosx/SDLMain.m
238endif
239
240ifeq ($(SDL_CONFIG_MAIN_WIN32),yes)
241  SRCS += win32/SDL_win32_main.c
242endif
243
244SDLMAIN_SOURCES := $(SRCS:%=$(SDL_DIR)/src/main/%)
245