autotools: Android port
authorSylvain Beucler <beuc@beuc.net>
Sun, 11 Mar 2012 09:34:30 +0000 (09:34 +0000)
committerSylvain Beucler <beuc@beuc.net>
Sun, 11 Mar 2012 09:34:30 +0000 (09:34 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1106 7f0cb862-5218-0410-a997-914c9d46530a

configure.ac
src/Makefile.am

index 16b74a3..8e835d5 100644 (file)
@@ -55,6 +55,12 @@ case "${host}" in
        GL_LIBS="-lEGL -lGLESv2"
        LIBXXF86VM=
        LIBXI=
+       #CFLAGS="$CFLAGS"
+       # '-mandroid' is not mandatory but doesn't hurt
+       # '-O0 -gstabs+' helps the currently buggy GDB port, better
+       #   remove it for releases
+       # '-DANDROID' is the Android build system convention
+       CFLAGS="-mandroid -O0 -gstabs+"
        CPPFLAGS="$CPPFLAGS -DANDROID"
        AM_CONDITIONAL(TARGET_HOST_ANDROID, true)
        ;;
@@ -83,7 +89,7 @@ AC_SUBST(LIBUSBHID)
 AC_HEADER_STDC
 save_CPPFLAGS="$CPPFLAGS"
 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-AC_CHECK_HEADERS([usbhid.h libusbhid.h errno.h GL/gl.h GL/glu.h GL/glx.h fcntl.h limits.h sys/ioctl.h sys/param.h sys/time.h])
+AC_CHECK_HEADERS([usbhid.h libusbhid.h errno.h GL/gl.h GL/glu.h GL/glx.h GLES/gl.h GLES2/gl2.h fcntl.h limits.h sys/ioctl.h sys/param.h sys/time.h])
 AC_HEADER_TIME
 AC_CHECK_HEADERS([X11/extensions/xf86vmode.h], [], [], [#include <X11/Xlib.h>])
 AC_CHECK_HEADERS([X11/extensions/Xrandr.h])
index d1f44ce..115cda1 100644 (file)
@@ -15,29 +15,35 @@ EXTRA_DIST = Common/freeglutdll.def
 #
 # Those source files build the freeglut library
 #
-lib@LIBRARY@_la_SOURCES = Common/freeglut_callbacks.c \
-                        Common/freeglut_cursor.c \
-                        Common/freeglut_display.c \
-                        Common/freeglut_ext.c \
-                        Common/freeglut_font.c \
-                        Common/freeglut_font_data.c \
-                        Common/freeglut_stroke_roman.c \
-                        Common/freeglut_stroke_mono_roman.c \
-                        Common/freeglut_gamemode.c \
-                        Common/freeglut_geometry.c \
-                        Common/freeglut_init.c \
-                        Common/freeglut_input_devices.c \
-                        Common/freeglut_spaceball.c \
-                        Common/freeglut_joystick.c \
-                        Common/freeglut_main.c \
-                        Common/freeglut_menu.c \
-                        Common/freeglut_misc.c \
-                        Common/freeglut_overlay.c \
-                        Common/freeglut_state.c \
-                        Common/freeglut_structure.c \
-                        Common/freeglut_teapot.c \
-                        Common/freeglut_videoresize.c \
-                        Common/freeglut_window.c
+lib@LIBRARY@_la_SOURCES = \
+       Common/freeglut_callbacks.c \
+       Common/freeglut_cursor.c \
+       Common/freeglut_display.c \
+       Common/freeglut_ext.c \
+       Common/freeglut_font_data.c \
+       Common/freeglut_gamemode.c \
+       Common/freeglut_input_devices.c \
+       Common/freeglut_stroke_roman.c \
+       Common/freeglut_stroke_mono_roman.c \
+       Common/freeglut_init.c \
+       Common/freeglut_spaceball.c \
+       Common/freeglut_joystick.c \
+       Common/freeglut_main.c \
+       Common/freeglut_misc.c \
+       Common/freeglut_overlay.c \
+       Common/freeglut_state.c \
+       Common/freeglut_structure.c \
+       Common/freeglut_videoresize.c \
+       Common/freeglut_window.c
+
+# TODO: uses OpenGL non-ES functions:
+if !TARGET_HOST_ANDROID
+lib@LIBRARY@_la_SOURCES += \
+       Common/freeglut_font.c \
+       Common/freeglut_geometry.c \
+       Common/freeglut_menu.c \
+       Common/freeglut_teapot.c
+endif
 
 if TARGET_HOST_MS_WINDOWS
 lib@LIBRARY@_la_SOURCES += \
@@ -79,6 +85,30 @@ lib@LIBRARY@_la_SOURCES += \
        x11/freeglut_xinput_x11.c
 endif
 
+if TARGET_HOST_ANDROID
+lib@LIBRARY@_la_SOURCES += \
+       Common/xparsegeometry_repl.c \
+       Common/xparsegeometry_repl.h \
+       egl/freeglut_internal_egl.h \
+       egl/freeglut_display_egl.c \
+       egl/freeglut_init_egl.c \
+       egl/freeglut_structure_egl.c \
+       egl/freeglut_window_egl.c \
+       android/native_app_glue/android_native_app_glue.c \
+       android/native_app_glue/android_native_app_glue.h \
+       android/freeglut_runtime_android.c \
+       android/freeglut_gamemode_android.c \
+       android/freeglut_input_devices_android.c \
+       android/freeglut_joystick_android.c \
+       android/freeglut_main_android.c \
+       android/freeglut_spaceball_android.c \
+       android/freeglut_state_android.c \
+       android/freeglut_window_android.c \
+       android/opengles_stubs.c \
+       android/freeglut_internal_android.h
+endif
+
+
 #
 # Additional linker flags
 #