[cogl/wip/sdl2-android-example: 1/3] Add Android.mk based build support



commit 746c9ec80630b3de518fa79e379bc3c2e26cb890
Author: Robert Bragg <robert linux intel com>
Date:   Thu Feb 13 20:28:58 2014 +0000

    Add Android.mk based build support
    
    This makes it possible to build Cogl for Android using ndk-build instead
    of autotools. This is the typical way to build software for Android and
    much simpler than using autotools given that there's no need to
    dynamically probe the platform being built for. For ease of maintenance
    this shares the list of cogl dependencies in cogl/Makefile.sources.

 Android.mk                        |   55 +++++++++++++++++++++++++++++++++++++
 cogl/android/cogl/cogl-defines.h  |   53 +++++++++++++++++++++++++++++++++++
 deps/eglib/android/eglib-config.h |   15 ++++++++++
 3 files changed, 123 insertions(+), 0 deletions(-)
---
diff --git a/Android.mk b/Android.mk
new file mode 100644
index 0000000..d086a8e
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,55 @@
+LOCAL_PATH := $(call my-dir)
+
+###########################
+#
+# Cogl shared library
+#
+###########################
+
+include $(CLEAR_VARS)
+
+LOCAL_CFLAGS := -O0
+
+LOCAL_MODULE := Cogl
+
+include $(LOCAL_PATH)/cogl/Makefile.sources
+
+LOCAL_C_INCLUDES := \
+  $(LOCAL_PATH) \
+  $(LOCAL_PATH)/deps/eglib/android \
+  $(LOCAL_PATH)/deps/eglib/src \
+  $(LOCAL_PATH)/cogl \
+  $(LOCAL_PATH)/cogl/android \
+  $(LOCAL_PATH)/cogl/android/cogl \
+  $(LOCAL_PATH)/cogl/winsys \
+  $(LOCAL_PATH)/cogl/driver/gl \
+  $(LOCAL_PATH)/cogl/driver/gl/gles
+
+LOCAL_EXPORT_C_INCLUDES := \
+  $(LOCAL_PATH)/deps/eglib/android \
+  $(LOCAL_PATH)/deps/eglib/src \
+  $(LOCAL_PATH) \
+  $(LOCAL_PATH)/cogl/android
+
+LOCAL_SRC_FILES := \
+  $(subst $(LOCAL_PATH)/,, \
+       $(filter-out %-win32.c, \
+               $(wildcard $(LOCAL_PATH)/deps/eglib/src/*.c) \
+        ) \
+       $(wildcard $(LOCAL_PATH)/test-fixtures/*.c) \
+   ) \
+  $(addprefix cogl/, \
+       $(filter %.c,$(cogl_sources_c)) \
+       $(filter %.c,$(cogl_driver_gles_sources)) \
+       $(filter %.c,$(cogl_sdl2_sources_c)) \
+   )
+
+LOCAL_CFLAGS += -DHAVE_CONFIG_H -DCOGL_COMPILATION -DCOGL_GLES2_LIBNAME=\"libGLESv2.so\" 
-DG_LOG_DOMAIN=\"Cogl\" -DCOGL_ENABLE_DEBUG -DCOGL_OBJECT_DEBUG -DCOGL_GL_DEBUG
+LOCAL_LDLIBS := -llog
+
+LOCAL_STATIC_LIBRARIES := SDL2
+
+LOCAL_EXPORT_LDLIBS := -Wl,--undefined=Java_org_libsdl_app_SDLActivity_nativeInit -ldl -lGLESv1_CM -lGLESv2 
-llog -landroid
+
+include $(BUILD_SHARED_LIBRARY)
+
diff --git a/cogl/android/cogl/cogl-defines.h b/cogl/android/cogl/cogl-defines.h
new file mode 100644
index 0000000..0c18482
--- /dev/null
+++ b/cogl/android/cogl/cogl-defines.h
@@ -0,0 +1,53 @@
+/*
+ * Cogl
+ *
+ * A Low-Level GPU Graphics and Utilities API
+ *
+ * Copyright (C) 2007,2008,2009,2010 Intel Corporation.
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy,
+ * modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ *
+ */
+
+#if !defined(__COGL_H_INSIDE__) && !defined(COGL_COMPILATION)
+#error "Only <cogl/cogl.h> can be included directly."
+#endif
+
+#ifndef __COGL_DEFINES_H__
+#define __COGL_DEFINES_H__
+
+#define COGL_SYSDEF_POLLIN 1
+#define COGL_SYSDEF_POLLPRI 2
+#define COGL_SYSDEF_POLLOUT 4
+#define COGL_SYSDEF_POLLERR 8
+#define COGL_SYSDEF_POLLHUP 16
+#define COGL_SYSDEF_POLLNVAL 32
+
+#define COGL_HAS_GLES2 1
+#define COGL_HAS_SDL_SUPPORT 1
+
+#define COGL_VERSION_MAJOR_INTERNAL 1
+#define COGL_VERSION_MINOR_INTERNAL 99
+#define COGL_VERSION_MICRO_INTERNAL 1
+#define COGL_VERSION_STRING_INTERNAL "1.99.1"
+
+#endif
diff --git a/deps/eglib/android/eglib-config.h b/deps/eglib/android/eglib-config.h
new file mode 100644
index 0000000..a3bf1a5
--- /dev/null
+++ b/deps/eglib/android/eglib-config.h
@@ -0,0 +1,15 @@
+#ifndef __EGLIB_CONFIG_H
+#define __EGLIB_CONFIG_H
+
+#define G_GNUC_PRETTY_FUNCTION
+#define G_SEARCHPATH_SEPARATOR_S ":"
+#define G_SEARCHPATH_SEPARATOR   ':'
+#define G_DIR_SEPARATOR          '/'
+#define G_DIR_SEPARATOR_S        "/"
+#define G_OS_UNIX
+
+#define G_HAVE_ALLOCA_H
+
+typedef int GPid;
+
+#endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]