Browse Source

Added raspian target - very flaky, can't actually run an app from Ted2 yet!

Mark Sibly 9 years ago
parent
commit
bcaaf4ff2f

+ 39 - 0
bin/env_raspbian.txt

@@ -0,0 +1,39 @@
+
+'***** RASPBIAN *****
+
+'LD options
+MX2_LD_OPTS_RASPBIAN=-L/opt/vc/lib -lbcm_host -lvcos -lvchiq_arm 
+MX2_LD_OPTS_RASPBIAN_DEBUG=
+MX2_LD_OPTS_RASPBIAN_RELEASE=-O3 -s
+
+'C compiler options
+MX2_CC_OPTS_RASPBIAN=-std=gnu99 -I/opt/vc/include -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/interface/vcos/pthreads
+MX2_CC_OPTS_RASPBIAN_DEBUG=
+MX2_CC_OPTS_RASPBIAN_RELEASE=-O3 -DNDEBUG
+
+'C++ compiler options
+MX2_CPP_OPTS_RASPBIAN=-std=c++11 -I/opt/vc/include  -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/interface/vcos/pthreads
+MX2_CPP_OPTS_RASPBIAN_DEBUG=
+MX2_CPP_OPTS_RASPBIAN_RELEASE=-O3 -DNDEBUG
+
+
+'***** EMSCRIPTEN *****
+
+'For emscripten builds, you need emcc, em++ and emar in your PATH.
+'To run emscripten apps, you'll need MonkeyXFree86c in your devtools dir.
+'MX2_MSERVER="${MX2_HOME}/devtools/MonkeyXFree86c/bin/mserver_linux"
+
+'LD options
+MX2_LD_OPTS_EMSCRIPTEN=-s USE_SDL=2 -s FULL_ES2=1 -s TOTAL_MEMORY=67108864 -s DISABLE_EXCEPTION_CATCHING=1 ' -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=1
+MX2_LD_OPTS_EMSCRIPTEN_DEBUG=
+MX2_LD_OPTS_EMSCRIPTEN_RELEASE=-O3
+
+'C compiler options
+MX2_CC_OPTS_EMSCRIPTEN=-std=gnu99 -I. -s USE_SDL=2 -s FULL_ES2=1 -s TOTAL_MEMORY=67108864 -s DISABLE_EXCEPTION_CATCHING=1 -Wno-warn-absolute-paths ' -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=1 -Wno-undefined-bool-conversion -Wno-inconsistent-missing-override -Wno-logical-op-parentheses -Wno-warn-absolute-paths 
+MX2_CC_OPTS_EMSCRIPTEN_DEBUG=
+MX2_CC_OPTS_EMSCRIPTEN_RELEASE=-O3 -DNDEBUG
+
+'C++ compiler options
+MX2_CPP_OPTS_EMSCRIPTEN=-std=c++11 -I. -s USE_SDL=2 -s FULL_ES2=1 -s TOTAL_MEMORY=67108864 -s DISABLE_EXCEPTION_CATCHING=1 -Wno-warn-absolute-paths ' -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=1 -Wno-undefined-bool-conversion
+MX2_CPP_OPTS_EMSCRIPTEN_DEBUG=
+MX2_CPP_OPTS_EMSCRIPTEN_RELEASE=-O3 -DNDEBUG

BIN
bin/mx2cc_raspbian


+ 10 - 1
modules/gles20/gles20.monkey2

@@ -26,11 +26,20 @@ Using monkey
 	#Import "native/gles20_macos.h"
 		
 #Else If __TARGET__="linux"
-	
+ 	
 	#Import "<libGL.a>"
 
 	#Import "native/gles20_linux.h"
 		
+#Else If __TARGET__="raspbian"
+	
+	#Import "<libEGL.a>"
+
+	#Import "<libGLESv1_CM.a>"
+	#Import "<libGLESv2.a>"
+	
+	#Import "<GLES2/gl2.h>"
+		
 #Else If __TARGET__="emscripten"
 	
 	#Import "<GLES2/gl2.h>"

+ 10 - 20
modules/mojo/app/app.monkey2

@@ -94,26 +94,14 @@ Class AppInstance
 		
 		Audio.Init()
 		
+		SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER,1 )
+		
 #if __MOBILE_TARGET__
 
 		_touchMouse=True
 
-		#rem		
-		SDL_GL_SetAttribute( SDL_GL_RED_SIZE,5 )
-		SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE,6 )
-		SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE,5 )
-		SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE,0 )
-		SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE,0 )
-		SDL_GL_SetAttribute( SDL_GL_RETAINED_BACKING,0 )
-		SDL_GL_SetAttribute( SDL_GL_ACCELERATED_VISUAL,1 )
-		#end
-		
-		SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER,1 )
-		
     	SDL_GL_SetAttribute( SDL_GL_CONTEXT_PROFILE_MASK,SDL_GL_CONTEXT_PROFILE_ES )
 		SDL_GL_SetAttribute( SDL_GL_CONTEXT_MAJOR_VERSION,2 )
-
-'	    SDL_GL_SetAttribute( SDL_GL_CONTEXT_MINOR_VERSION,0 ) 
     	
 #endif
 
@@ -121,6 +109,8 @@ Class AppInstance
 
 		_captureMouse=True
 #Endif
+
+#If __DESKTOP_TARGET__
     
 #if __TARGET__="windows"
 
@@ -145,12 +135,13 @@ Class AppInstance
 		If gl_major<>-1 SDL_GL_SetAttribute( SDL_GL_CONTEXT_MAJOR_VERSION,gl_major )
 		If gl_minor<>-1 SDL_GL_SetAttribute( SDL_GL_CONTEXT_MINOR_VERSION,gl_minor )
 
-#Endif
+#Elseif __TARGET__="raspbian"
 
-#if __DESKTOP_TARGET__
+   		SDL_GL_SetAttribute( SDL_GL_CONTEXT_PROFILE_MASK,SDL_GL_CONTEXT_PROFILE_ES )
+		SDL_GL_SetAttribute( SDL_GL_CONTEXT_MAJOR_VERSION,2 )
 
+#Endif
 		SDL_GL_SetAttribute( SDL_GL_SHARE_WITH_CURRENT_CONTEXT,1 )
-		SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER,1 )
 		
 		SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE,Int( GetConfig( "GL_depth_buffer_enabled",0 ) ) )
 		SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE,Int( GetConfig( "GL_stencil_buffer_enabled",0 ) ) )
@@ -163,7 +154,6 @@ Class AppInstance
 		Assert( _sdlGLContext,"FATAL ERROR: SDL_GL_CreateContext failed" )
 		
 		SDL_GL_MakeCurrent( _sdlWindow,_sdlGLContext )
-		
 #Endif
 		_defaultFont=Font.Open( "asset::fonts/DejaVuSans.ttf",16 )
 		
@@ -922,7 +912,7 @@ Class AppInstance
 			Print "SDL_RENDER_DEVICE_RESET"
 		
 			mojo.graphics.glutil.glGraphicsSeq+=1
-#rem
+'#rem
 
 		'Linux weirdness: These may or may not be necessary when/if I get mouse capture working again.
 			
@@ -935,7 +925,7 @@ Class AppInstance
 			SendWindowEvent( EventType.WindowResized )
 				
 			UpdateWindows()
-#end
+'#end
 
 		Case SDL_DROPFILE
 		

+ 1 - 1
modules/mojo/graphics/glutil.monkey2

@@ -63,7 +63,7 @@ End
 #end
 Function glCompile:Int( type:Int,source:String )
 
-#If __TARGET__="windows" Or Not __DESKTOP_TARGET__
+#If __TARGET__="windows" Or __TARGET__="raspbian" Or Not __DESKTOP_TARGET__
 	source="precision mediump float;~n"+source
 #Endif
 	

+ 1 - 1
modules/openal/openal.monkey2

@@ -17,7 +17,7 @@
 	#import "<OpenAL/al.h>"
 	#import "<OpenAL/alc.h>"
 		
-#else if __TARGET__="linux"
+#else if __TARGET__="linux" or __TARGET__="raspbian"
 	
 	#import "<libopenal.a>"
 	#import "<AL/al.h>"

+ 1 - 0
modules/sdl2/SDL/MARKS_FIXES.TXt

@@ -9,3 +9,4 @@
 
 * SDL_dynapi_procs.h - commented out references to direct3d.
 
+* SDL_rpiopengles.c - Added call to bcm_host_init();

+ 11 - 0
modules/sdl2/SDL/include/SDL_config.h

@@ -31,18 +31,29 @@
 /* Add any platform that doesn't build using the configure system. */
 #ifdef USING_PREMAKE_CONFIG_H
 #include "SDL_config_premake.h"
+
 #elif defined(__WIN32__)
 #include "SDL_config_windows.h"
+
 #elif defined(__MACOSX__)
 #include "SDL_config_macosx.h"
+
 #elif defined(__LINUX__)
+#ifdef __arm__
+#include "SDL_config_raspbian.h"
+#else
 #include "SDL_config_linux.h"
+#endif
+
 #elif defined(EMSCRIPTEN)
 #include "SDL_config_emscripten.h"
+
 #elif defined(__ANDROID__)
 #include "SDL_config_android.h"
+
 #elif defined(__IPHONEOS__)
 #include "SDL_config_iphoneos.h"
+
 /*
 #elif defined(__WINRT__)
 #include "SDL_config_winrt.h"

+ 423 - 0
modules/sdl2/SDL/include/SDL_config_raspbian.h

@@ -0,0 +1,423 @@
+/*
+  Simple DirectMedia Layer
+  Copyright (C) 1997-2016 Sam Lantinga <[email protected]>
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef _SDL_config_raspbian_h
+#define _SDL_config_raspbian_h
+
+/**
+ *  \file SDL_config.h.in
+ *
+ *  This is a set of defines to configure the SDL features
+ */
+
+/* General platform specific identifiers */
+#include "SDL_platform.h"
+
+/* C language features */
+/* #undef const */
+/* #undef inline */
+/* #undef volatile */
+
+/* C datatypes */
+/* Define SIZEOF_VOIDP for 64/32 architectures */
+#ifdef __LP64__
+#define SIZEOF_VOIDP 8
+#else
+#define SIZEOF_VOIDP 4
+#endif
+
+#define HAVE_GCC_ATOMICS 1
+/* #undef HAVE_GCC_SYNC_LOCK_TEST_AND_SET */
+
+/* #undef HAVE_D3D_H */
+/* #undef HAVE_D3D11_H */
+/* #undef HAVE_DDRAW_H */
+/* #undef HAVE_DSOUND_H */
+/* #undef HAVE_DINPUT_H */
+/* #undef HAVE_XAUDIO2_H */
+#define HAVE_XINPUT_H 1
+/* #undef HAVE_DXGI_H */
+
+/* Comment this if you want to build without any C library requirements */
+#define HAVE_LIBC 1
+#if HAVE_LIBC
+
+/* Useful headers */
+#define HAVE_ALLOCA_H 1
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_STDIO_H 1
+#define STDC_HEADERS 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STDARG_H 1
+#define HAVE_MALLOC_H 1
+#define HAVE_MEMORY_H 1
+#define HAVE_STRING_H 1
+#define HAVE_STRINGS_H 1
+#define HAVE_INTTYPES_H 1
+#define HAVE_STDINT_H 1
+#define HAVE_CTYPE_H 1
+#define HAVE_MATH_H 1
+#define HAVE_ICONV_H 1
+#define HAVE_SIGNAL_H 1
+/* #undef HAVE_ALTIVEC_H */
+/* #undef HAVE_PTHREAD_NP_H */
+
+
+#define HAVE_LIBUDEV_H 1
+//#define HAVE_DBUS_DBUS_H 1
+
+/* C library functions */
+#define HAVE_MALLOC 1
+#define HAVE_CALLOC 1
+#define HAVE_REALLOC 1
+#define HAVE_FREE 1
+/* #undef HAVE_ALLOCA */
+#ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */
+#define HAVE_GETENV 1
+#define HAVE_SETENV 1
+#define HAVE_PUTENV 1
+#define HAVE_UNSETENV 1
+#endif
+#define HAVE_QSORT 1
+#define HAVE_ABS 1
+#define HAVE_BCOPY 1
+#define HAVE_MEMSET 1
+#define HAVE_MEMCPY 1
+#define HAVE_MEMMOVE 1
+#define HAVE_MEMCMP 1
+#define HAVE_STRLEN 1
+/* #undef HAVE_STRLCPY */
+/* #undef HAVE_STRLCAT */
+#define HAVE_STRDUP 1
+/* #undef HAVE__STRREV */
+/* #undef HAVE__STRUPR */
+/* #undef HAVE__STRLWR */
+/* #undef HAVE_INDEX */
+/* #undef HAVE_RINDEX */
+#define HAVE_STRCHR 1
+#define HAVE_STRRCHR 1
+#define HAVE_STRSTR 1
+/* #undef HAVE_ITOA */
+/* #undef HAVE__LTOA */
+/* #undef HAVE__UITOA */
+/* #undef HAVE__ULTOA */
+#define HAVE_STRTOL 1
+#define HAVE_STRTOUL 1
+/* #undef HAVE__I64TOA */
+/* #undef HAVE__UI64TOA */
+#define HAVE_STRTOLL 1
+#define HAVE_STRTOULL 1
+#define HAVE_STRTOD 1
+#define HAVE_ATOI 1
+#define HAVE_ATOF 1
+#define HAVE_STRCMP 1
+#define HAVE_STRNCMP 1
+/* #undef HAVE__STRICMP */
+#define HAVE_STRCASECMP 1
+/* #undef HAVE__STRNICMP */
+#define HAVE_STRNCASECMP 1
+#define HAVE_VSSCANF 1
+#define HAVE_VSNPRINTF 1
+#define HAVE_M_PI 1
+#define HAVE_ATAN 1
+#define HAVE_ATAN2 1
+#define HAVE_ACOS 1
+#define HAVE_ASIN 1
+#define HAVE_CEIL 1
+#define HAVE_COPYSIGN 1
+#define HAVE_COS 1
+#define HAVE_COSF 1
+#define HAVE_FABS 1
+#define HAVE_FLOOR 1
+#define HAVE_LOG 1
+#define HAVE_POW 1
+#define HAVE_SCALBN 1
+#define HAVE_SIN 1
+#define HAVE_SINF 1
+#define HAVE_SQRT 1
+#define HAVE_SQRTF 1
+#define HAVE_TAN 1
+#define HAVE_TANF 1
+#define HAVE_FSEEKO 1
+#define HAVE_FSEEKO64 1
+#define HAVE_SIGACTION 1
+#define HAVE_SA_SIGACTION 1
+#define HAVE_SETJMP 1
+#define HAVE_NANOSLEEP 1
+#define HAVE_SYSCONF 1
+/* #undef HAVE_SYSCTLBYNAME */
+/* #undef HAVE_CLOCK_GETTIME */
+/* #undef HAVE_GETPAGESIZE */
+#define HAVE_MPROTECT 1
+/* #undef HAVE_ICONV */
+#define HAVE_PTHREAD_SETNAME_NP 1
+/* #undef HAVE_PTHREAD_SET_NAME_NP */
+#define HAVE_SEM_TIMEDWAIT 1
+#elif __WIN32__
+#define HAVE_STDARG_H 1
+#define HAVE_STDDEF_H 1
+#else
+/* We may need some replacement for stdarg.h here */
+#include <stdarg.h>
+#endif /* HAVE_LIBC */
+
+/* SDL internal assertion support */
+/* #undef SDL_DEFAULT_ASSERT_LEVEL */
+
+/* Allow disabling of core subsystems */
+/* #undef SDL_ATOMIC_DISABLED */
+/* #undef SDL_AUDIO_DISABLED */
+/* #undef SDL_CPUINFO_DISABLED */
+/* #undef SDL_EVENTS_DISABLED */
+/* #undef SDL_FILE_DISABLED */
+/* #undef SDL_JOYSTICK_DISABLED */
+/* #undef SDL_HAPTIC_DISABLED */
+/* #undef SDL_LOADSO_DISABLED */
+/* #undef SDL_RENDER_DISABLED */
+/* #undef SDL_THREADS_DISABLED */
+/* #undef SDL_TIMERS_DISABLED */
+/* #undef SDL_VIDEO_DISABLED */
+/* #undef SDL_POWER_DISABLED */
+/* #undef SDL_FILESYSTEM_DISABLED */
+
+/* Enable various audio drivers */
+/* #undef SDL_AUDIO_DRIVER_ANDROID */
+#define SDL_AUDIO_DRIVER_ALSA 1
+#define SDL_AUDIO_DRIVER_ALSA_DYNAMIC "libasound.so.2"
+/* #undef SDL_AUDIO_DRIVER_ARTS */
+/* #undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC */
+#define SDL_AUDIO_DRIVER_PULSEAUDIO 1
+#define SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC "libpulse-simple.so.0"
+/* #undef SDL_AUDIO_DRIVER_HAIKU */
+/* #undef SDL_AUDIO_DRIVER_BSD */
+/* #undef SDL_AUDIO_DRIVER_COREAUDIO */
+#define SDL_AUDIO_DRIVER_DISK 1
+#define SDL_AUDIO_DRIVER_DUMMY 1
+/* #undef SDL_AUDIO_DRIVER_XAUDIO2 */
+/* #undef SDL_AUDIO_DRIVER_DSOUND */
+/* #undef SDL_AUDIO_DRIVER_ESD */
+/* #undef SDL_AUDIO_DRIVER_ESD_DYNAMIC */
+/* #undef SDL_AUDIO_DRIVER_NAS */
+/* #undef SDL_AUDIO_DRIVER_NAS_DYNAMIC */
+/* #undef SDL_AUDIO_DRIVER_SNDIO */
+/* #undef SDL_AUDIO_DRIVER_SNDIO_DYNAMIC */
+#define SDL_AUDIO_DRIVER_OSS 1
+/* #undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H */
+/* #undef SDL_AUDIO_DRIVER_PAUDIO */
+/* #undef SDL_AUDIO_DRIVER_QSA */
+/* #undef SDL_AUDIO_DRIVER_SUNAUDIO */
+/* #undef SDL_AUDIO_DRIVER_WINMM */
+/* #undef SDL_AUDIO_DRIVER_FUSIONSOUND */
+/* #undef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC */
+/* #undef SDL_AUDIO_DRIVER_EMSCRIPTEN */
+
+/* Enable various input drivers */
+#define SDL_INPUT_LINUXEV 1
+#define SDL_INPUT_LINUXKD 1
+
+/* #undef SDL_INPUT_TSLIB */
+/* #undef SDL_JOYSTICK_ANDROID */
+/* #undef SDL_JOYSTICK_HAIKU */
+/* #undef SDL_JOYSTICK_DINPUT */
+/* #undef SDL_JOYSTICK_XINPUT */
+/* #undef SDL_JOYSTICK_DUMMY */
+/* #undef SDL_JOYSTICK_IOKIT */
+/* #undef SDL_JOYSTICK_MFI */
+#define SDL_JOYSTICK_LINUX 1
+/* #undef SDL_JOYSTICK_WINMM */
+/* #undef SDL_JOYSTICK_USBHID */
+/* #undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H */
+/* #undef SDL_JOYSTICK_EMSCRIPTEN */
+/* #undef SDL_HAPTIC_DUMMY */
+#define SDL_HAPTIC_LINUX 1
+/* #undef SDL_HAPTIC_IOKIT */
+/* #undef SDL_HAPTIC_DINPUT */
+/* #undef SDL_HAPTIC_XINPUT */
+
+/* Enable various shared object loading systems */
+/* #undef SDL_LOADSO_HAIKU */
+#define SDL_LOADSO_DLOPEN 1
+/* #undef SDL_LOADSO_DUMMY */
+/* #undef SDL_LOADSO_LDG */
+/* #undef SDL_LOADSO_WINDOWS */
+
+/* Enable various threading systems */
+#define SDL_THREAD_PTHREAD 1
+#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
+/* #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP */
+/* #undef SDL_THREAD_WINDOWS */
+
+/* Enable various timer systems */
+/* #undef SDL_TIMER_HAIKU */
+/* #undef SDL_TIMER_DUMMY */
+#define SDL_TIMER_UNIX 1
+/* #undef SDL_TIMER_WINDOWS */
+/* #undef SDL_TIMER_WINCE */
+
+/* Enable various video drivers */
+/* #undef SDL_VIDEO_DRIVER_ANDROID */
+/* #undef SDL_VIDEO_DRIVER_HAIKU */
+/* #undef SDL_VIDEO_DRIVER_COCOA */
+/* #undef SDL_VIDEO_DRIVER_DIRECTFB */
+/* #undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC */
+#define SDL_VIDEO_DRIVER_DUMMY 1
+/* #undef SDL_VIDEO_DRIVER_WINDOWS */
+/* #undef SDL_VIDEO_DRIVER_WAYLAND */
+#define SDL_VIDEO_DRIVER_RPI 1
+/* #undef SDL_VIDEO_DRIVER_VIVANTE */
+/* #undef SDL_VIDEO_DRIVER_VIVANTE_VDK */
+
+/* #undef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */
+/* #undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC */
+/* #undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL */
+/* #undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR */
+/* #undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON */
+
+/* #undef SDL_VIDEO_DRIVER_MIR */
+/* #undef SDL_VIDEO_DRIVER_MIR_DYNAMIC */
+/* #undef SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON */
+/* #undef SDL_VIDEO_DRIVER_EMSCRIPTEN */
+
+//#define SDL_VIDEO_DRIVER_X11 1
+//#define SDL_VIDEO_DRIVER_X11_DYNAMIC "libX11.so.6"
+//#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "libXext.so.6"
+/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR */
+/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA */
+//#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "libXi.so.6"
+/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR */
+/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS */
+//#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "libXxf86vm.so.1"
+/* #undef SDL_VIDEO_DRIVER_X11_XCURSOR */
+/* #undef SDL_VIDEO_DRIVER_X11_XDBE */
+/* #undef SDL_VIDEO_DRIVER_X11_XINERAMA */
+//#define SDL_VIDEO_DRIVER_X11_XINPUT2 1
+//#define SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH 1
+/* #undef SDL_VIDEO_DRIVER_X11_XRANDR */
+/* #undef SDL_VIDEO_DRIVER_X11_XSCRNSAVER */
+//#define SDL_VIDEO_DRIVER_X11_XSHAPE 1
+//#define SDL_VIDEO_DRIVER_X11_XVIDMODE 1
+//#define SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1
+//#define SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY 1
+//#define SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM 1
+
+/* #undef SDL_VIDEO_RENDER_D3D */
+/* #undef SDL_VIDEO_RENDER_D3D11 */
+//#define SDL_VIDEO_RENDER_OGL 1
+//#define SDL_VIDEO_RENDER_OGL_ES 1
+#define SDL_VIDEO_RENDER_OGL_ES2 1
+/* #undef SDL_VIDEO_RENDER_DIRECTFB */
+
+/* Enable OpenGL support */
+//#define SDL_VIDEO_OPENGL 1
+//#define SDL_VIDEO_OPENGL_ES 1
+#define SDL_VIDEO_OPENGL_ES2 1
+/* #undef SDL_VIDEO_OPENGL_BGL */
+/* #undef SDL_VIDEO_OPENGL_CGL */
+//#define SDL_VIDEO_OPENGL_GLX 1
+/* #undef SDL_VIDEO_OPENGL_WGL */
+#define SDL_VIDEO_OPENGL_EGL 1
+/* #undef SDL_VIDEO_OPENGL_OSMESA */
+/* #undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC */
+
+/* Enable system power support */
+/* #undef SDL_POWER_ANDROID */
+#define SDL_POWER_LINUX 1
+/* #undef SDL_POWER_WINDOWS */
+/* #undef SDL_POWER_MACOSX */
+/* #undef SDL_POWER_HAIKU */
+/* #undef SDL_POWER_EMSCRIPTEN */
+/* #undef SDL_POWER_HARDWIRED */
+
+/* Enable system filesystem support */
+/* #undef SDL_FILESYSTEM_ANDROID */
+/* #undef SDL_FILESYSTEM_HAIKU */
+/* #undef SDL_FILESYSTEM_COCOA */
+/* #undef SDL_FILESYSTEM_DUMMY */
+#define SDL_FILESYSTEM_UNIX 1
+/* #undef SDL_FILESYSTEM_WINDOWS */
+/* #undef SDL_FILESYSTEM_EMSCRIPTEN */
+
+/* Enable assembly routines */
+#define SDL_ASSEMBLY_ROUTINES 1
+/* #undef SDL_ALTIVEC_BLITTERS */
+
+
+/* Platform specific definitions */
+#if !defined(__WIN32__)
+#  if !defined(_STDINT_H_) && !defined(_STDINT_H) && !defined(HAVE_STDINT_H) && !defined(_HAVE_STDINT_H)
+typedef unsigned int size_t;
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+typedef signed short int16_t;
+typedef unsigned short uint16_t;
+typedef signed int int32_t;
+typedef unsigned int uint32_t;
+typedef signed long long int64_t;
+typedef unsigned long long uint64_t;
+typedef unsigned long uintptr_t;
+#  endif /* if (stdint.h isn't available) */
+#else /* __WIN32__ */
+#  if !defined(_STDINT_H_) && !defined(HAVE_STDINT_H) && !defined(_HAVE_STDINT_H)
+#    if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__)
+#define HAVE_STDINT_H	1
+#    elif defined(_MSC_VER)
+typedef signed __int8 int8_t;
+typedef unsigned __int8 uint8_t;
+typedef signed __int16 int16_t;
+typedef unsigned __int16 uint16_t;
+typedef signed __int32 int32_t;
+typedef unsigned __int32 uint32_t;
+typedef signed __int64 int64_t;
+typedef unsigned __int64 uint64_t;
+#      ifndef _UINTPTR_T_DEFINED
+#        ifdef  _WIN64
+typedef unsigned __int64 uintptr_t;
+#          else
+typedef unsigned int uintptr_t;
+#        endif
+#define _UINTPTR_T_DEFINED
+#      endif
+/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
+#      if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
+#define DWORD_PTR DWORD
+#      endif
+#      if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
+#define LONG_PTR LONG
+#      endif
+#    else /* !__GNUC__ && !_MSC_VER */
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+typedef signed short int16_t;
+typedef unsigned short uint16_t;
+typedef signed int int32_t;
+typedef unsigned int uint32_t;
+typedef signed long long int64_t;
+typedef unsigned long long uint64_t;
+#      ifndef _SIZE_T_DEFINED_
+#define _SIZE_T_DEFINED_
+typedef unsigned int size_t;
+#      endif
+typedef unsigned int uintptr_t;
+#    endif /* __GNUC__ || _MSC_VER */
+#  endif /* !_STDINT_H_ && !HAVE_STDINT_H */
+#endif /* __WIN32__ */
+
+#endif /* _SDL_config_h */

+ 3 - 0
modules/sdl2/SDL/src/video/raspberry/SDL_rpiopengles.c

@@ -29,6 +29,9 @@
 
 int
 RPI_GLES_LoadLibrary(_THIS, const char *path) {
+
+	bcm_host_init();
+	
     return SDL_EGL_LoadLibrary(_this, path, EGL_DEFAULT_DISPLAY);
 }
 

+ 6 - 2
modules/sdl2/makefile.monkey2

@@ -3,7 +3,7 @@ Namespace sdl2
 
 #If __TARGET__="windows"
 
-		#Import "makefile_windows.monkey2"
+	#Import "makefile_windows.monkey2"
 		
 #Else If __TARGET__="macos"
 	
@@ -12,7 +12,11 @@ Namespace sdl2
 #Else If __TARGET__="linux"
 	
 	#Import "makefile_linux.monkey2"
-		
+	
+#Else If __TARGET__="raspbian"
+
+	#Import "makefile_raspbian.monkey2"
+
 #Else If __TARGET__="emscripten"
 
 	#Import "makefile_emscripten.monkey2"

+ 153 - 0
modules/sdl2/makefile_raspbian.monkey2

@@ -0,0 +1,153 @@
+
+Namespace sdl2
+
+#Import "<libpthread.a>"
+#Import "<libdl.a>"
+#Import "<libpulse.a>"
+
+#rem
+#Import "<libX11.a>"
+#Import "<libXext.a>"
+#Import "<libXi.a>"
+#end
+
+#Import "SDL/src/SDL_error.c"
+#Import "SDL/src/SDL_hints.c"
+#Import "SDL/src/SDL_log.c"
+#Import "SDL/src/SDL_assert.c"
+#Import "SDL/src/SDL.c"
+#Import "SDL/src/atomic/SDL_spinlock.c"
+#Import "SDL/src/atomic/SDL_atomic.c"
+#Import "SDL/src/audio/SDL_audiocvt.c"
+#Import "SDL/src/audio/SDL_audiotypecvt.c"
+#Import "SDL/src/audio/SDL_audiodev.c"
+#Import "SDL/src/audio/SDL_wave.c"
+#Import "SDL/src/audio/SDL_mixer.c"
+#Import "SDL/src/audio/SDL_audio.c"
+#Import "SDL/src/cpuinfo/SDL_cpuinfo.c"
+#Import "SDL/src/dynapi/SDL_dynapi.c"
+#Import "SDL/src/events/SDL_gesture.c"
+#Import "SDL/src/events/SDL_events.c"
+#Import "SDL/src/events/SDL_windowevents.c"
+#Import "SDL/src/events/SDL_quit.c"
+#Import "SDL/src/events/SDL_dropevents.c"
+#Import "SDL/src/events/SDL_touch.c"
+#Import "SDL/src/events/SDL_keyboard.c"
+#Import "SDL/src/events/SDL_mouse.c"
+#Import "SDL/src/events/SDL_clipboardevents.c"
+#Import "SDL/src/file/SDL_rwops.c"
+#Import "SDL/src/libm/s_cos.c"
+#Import "SDL/src/libm/k_cos.c"
+#Import "SDL/src/libm/s_sin.c"
+#Import "SDL/src/libm/k_tan.c"
+#Import "SDL/src/libm/e_pow.c"
+#Import "SDL/src/libm/e_sqrt.c"
+#Import "SDL/src/libm/s_scalbn.c"
+#Import "SDL/src/libm/s_fabs.c"
+#Import "SDL/src/libm/e_atan2.c"
+#Import "SDL/src/libm/k_sin.c"
+#Import "SDL/src/libm/e_log.c"
+#Import "SDL/src/libm/s_atan.c"
+#Import "SDL/src/libm/s_copysign.c"
+#Import "SDL/src/libm/s_floor.c"
+#Import "SDL/src/libm/k_rem_pio2.c"
+#Import "SDL/src/libm/e_rem_pio2.c"
+#Import "SDL/src/libm/s_tan.c"
+#Import "SDL/src/render/SDL_yuv_mmx.c"
+#Import "SDL/src/render/SDL_d3dmath.c"
+#Import "SDL/src/render/SDL_yuv_sw.c"
+#Import "SDL/src/render/SDL_render.c"
+#Import "SDL/src/render/opengles/SDL_render_gles.c"
+#Import "SDL/src/render/direct3d/SDL_render_d3d.c"
+#Import "SDL/src/render/opengles2/SDL_render_gles2.c"
+#Import "SDL/src/render/opengles2/SDL_shaders_gles2.c"
+#Import "SDL/src/render/psp/SDL_render_psp.c"
+#Import "SDL/src/render/direct3d11/SDL_render_d3d11.c"
+#Import "SDL/src/render/opengl/SDL_shaders_gl.c"
+#Import "SDL/src/render/opengl/SDL_render_gl.c"
+#Import "SDL/src/render/software/SDL_blendline.c"
+#Import "SDL/src/render/software/SDL_rotate.c"
+#Import "SDL/src/render/software/SDL_render_sw.c"
+#Import "SDL/src/render/software/SDL_blendpoint.c"
+#Import "SDL/src/render/software/SDL_drawline.c"
+#Import "SDL/src/render/software/SDL_drawpoint.c"
+#Import "SDL/src/render/software/SDL_blendfillrect.c"
+#Import "SDL/src/stdlib/SDL_getenv.c"
+#Import "SDL/src/stdlib/SDL_iconv.c"
+#Import "SDL/src/stdlib/SDL_string.c"
+#Import "SDL/src/stdlib/SDL_malloc.c"
+#Import "SDL/src/stdlib/SDL_qsort.c"
+#Import "SDL/src/stdlib/SDL_stdlib.c"
+#Import "SDL/src/thread/SDL_thread.c"
+#Import "SDL/src/timer/SDL_timer.c"
+#Import "SDL/src/video/SDL_egl.c"
+#Import "SDL/src/video/SDL_RLEaccel.c"
+#Import "SDL/src/video/SDL_bmp.c"
+#Import "SDL/src/video/SDL_fillrect.c"
+#Import "SDL/src/video/SDL_video.c"
+#Import "SDL/src/video/SDL_blit_0.c"
+#Import "SDL/src/video/SDL_blit_copy.c"
+#Import "SDL/src/video/SDL_blit_A.c"
+#Import "SDL/src/video/SDL_rect.c"
+#Import "SDL/src/video/SDL_shape.c"
+#Import "SDL/src/video/SDL_blit_1.c"
+#Import "SDL/src/video/SDL_blit_slow.c"
+#Import "SDL/src/video/SDL_blit_auto.c"
+#Import "SDL/src/video/SDL_blit.c"
+#Import "SDL/src/video/SDL_stretch.c"
+#Import "SDL/src/video/SDL_pixels.c"
+#Import "SDL/src/video/SDL_clipboard.c"
+#Import "SDL/src/video/SDL_blit_N.c"
+#Import "SDL/src/video/SDL_surface.c"
+#Import "SDL/src/joystick/SDL_joystick.c"
+#Import "SDL/src/joystick/SDL_gamecontroller.c"
+#Import "SDL/src/haptic/SDL_haptic.c"
+#Import "SDL/src/power/SDL_power.c"
+#Import "SDL/src/audio/dummy/SDL_dummyaudio.c"
+#Import "SDL/src/audio/disk/SDL_diskaudio.c"
+#Import "SDL/src/loadso/dlopen/SDL_sysloadso.c"
+#Import "SDL/src/video/dummy/SDL_nullevents.c"
+#Import "SDL/src/video/dummy/SDL_nullframebuffer.c"
+#Import "SDL/src/video/dummy/SDL_nullvideo.c"
+#Import "SDL/src/audio/dsp/SDL_dspaudio.c"
+#Import "SDL/src/audio/alsa/SDL_alsa_audio.c"
+#Import "SDL/src/audio/pulseaudio/SDL_pulseaudio.c"
+#Import "SDL/src/video/raspberry/SDL_rpiopengles.c"
+#Import "SDL/src/video/raspberry/SDL_rpimouse.c"
+#Import "SDL/src/video/raspberry/SDL_rpivideo.c"
+#Import "SDL/src/video/raspberry/SDL_rpievents.c"
+
+#rem
+#Import "SDL/src/video/x11/SDL_x11messagebox.c"
+#Import "SDL/src/video/x11/SDL_x11framebuffer.c"
+#Import "SDL/src/video/x11/SDL_x11keyboard.c"
+#Import "SDL/src/video/x11/SDL_x11video.c"
+#Import "SDL/src/video/x11/SDL_x11window.c"
+#Import "SDL/src/video/x11/SDL_x11modes.c"
+#Import "SDL/src/video/x11/SDL_x11mouse.c"
+#Import "SDL/src/video/x11/SDL_x11opengles.c"
+#Import "SDL/src/video/x11/SDL_x11events.c"
+#Import "SDL/src/video/x11/SDL_x11dyn.c"
+#Import "SDL/src/video/x11/SDL_x11opengl.c"
+#Import "SDL/src/video/x11/SDL_x11xinput2.c"
+#Import "SDL/src/video/x11/SDL_x11touch.c"
+#Import "SDL/src/video/x11/edid-parse.c"
+#Import "SDL/src/video/x11/SDL_x11shape.c"
+#Import "SDL/src/video/x11/imKStoUCS.c"
+#Import "SDL/src/video/x11/SDL_x11clipboard.c"
+#end
+
+#Import "SDL/src/core/linux/SDL_udev.c"
+#Import "SDL/src/core/linux/SDL_dbus.c"
+#Import "SDL/src/core/linux/SDL_evdev.c"
+#Import "SDL/src/core/linux/SDL_ibus.c"
+#Import "SDL/src/haptic/linux/SDL_syshaptic.c"
+#Import "SDL/src/joystick/linux/SDL_sysjoystick.c"
+#Import "SDL/src/thread/pthread/SDL_systhread.c"
+#Import "SDL/src/thread/pthread/SDL_sysmutex.c"
+#Import "SDL/src/thread/pthread/SDL_syscond.c"
+#Import "SDL/src/thread/pthread/SDL_systls.c"
+#Import "SDL/src/thread/pthread/SDL_syssem.c"
+#Import "SDL/src/power/linux/SDL_syspower.c"
+#Import "SDL/src/filesystem/unix/SDL_sysfilesystem.c"
+#Import "SDL/src/timer/unix/SDL_systimer.c"

+ 2 - 2
modules/std/fiber/fcontext.monkey2

@@ -25,8 +25,8 @@ Namespace std.fiber
 	#import "native/asm/make_x86_64_sysv_elf_gas.S"
 	#import "native/asm/jump_x86_64_sysv_elf_gas.S"
 	#import "native/asm/ontop_x86_64_sysv_elf_gas.S"
-
-#Else If __TARGET__="android"
+	
+#Else If __TARGET__="android" or __TARGET__="raspbian"
 
 	#import "native/asm/make_arm_aapcs_elf_gas.S"
 	#import "native/asm/jump_arm_aapcs_elf_gas.S"

+ 2 - 2
modules/std/filesystem/native/filesystem.cpp

@@ -85,8 +85,8 @@ namespace bbFileSystem{
 			char buf[PATH_MAX];
 	
 			sprintf( lnk,"/proc/%i/exe",pid );
-			int i=readlink( lnk,buf,PATH_MAX )
-			;
+			int i=readlink( lnk,buf,PATH_MAX );
+			
 			if( i>0 && i<PATH_MAX ){
 				buf[i]=0;
 				_appPath=bbString( buf );

+ 1 - 0
scripts/common.bat

@@ -1,6 +1,7 @@
 
 set mx2cc=..\bin\mx2cc_windows.exe
 set mx2cc_new=..\src\mx2cc\mx2cc.buildv1.0.6\windows_release\mx2cc.exe
+set mx2cc_raspbian_new=..\src\mx2cc\mx2cc.buildv1.0.6\raspbian_release\mx2cc
 
 set ted2=..\bin\ted2_windows
 set ted2_new=..\src\ted2\ted2.buildv1.0.6\windows_release

+ 12 - 0
scripts/common.sh

@@ -18,6 +18,18 @@ then
 	launcher="../Monkey2 (Linux)"
 	launcher_new="../src/launcher/launcher.buildv1.0.6/linux_release/launcher"
 	
+elif [ "$OSTYPE" = "linux-gnueabihf" ]
+then
+
+	mx2cc="../bin/mx2cc_raspbian"
+	mx2cc_new="../src/mx2cc/mx2cc.buildv1.0.6/raspbian_release/mx2cc"
+	
+	ted2="../bin/ted2_raspbian"
+	ted2_new="../src/ted2/ted2.buildv1.0.6/raspbian_release"
+	
+	launcher="../Monkey2 (Raspbian)"
+	launcher_new="../src/launcher/launcher.buildv1.0.6/raspbian_release/launcher"
+	
 else
 
 	mx2cc="../bin/mx2cc_macos"

+ 12 - 0
scripts/rebuildmx2cc_raspbian.bat

@@ -0,0 +1,12 @@
+echo off
+
+call common.bat
+
+echo.
+echo ***** Rebuilding mx2cc *****
+echo.
+
+rem %mx2cc% makemods -clean -config=release -target=raspbian monkey libc miniz stb-image stb-image-write stb-vorbis std
+%mx2cc% makeapp -build -clean -apptype=console -config=release -target=raspbian ../src/mx2cc/mx2cc.monkey2
+
+copy %mx2cc_raspbian_new% ..\bin\mx2cc_raspbian

+ 13 - 0
scripts/rebuildted2.sh

@@ -19,6 +19,16 @@ then
 	rm -r -f "$launcher"
 	cp "$launcher_new" "$launcher"
 
+elif [ "$OSTYPE" = "linux-gnueabihf" ]
+then
+
+	rm -r -f "$ted2"
+	mkdir "$ted2"
+	cp -R "$ted2_new/assets" "$ted2/assets"
+	cp "$ted2_new/ted2" "$ted2/ted2"
+	rm -r -f "$launcher"
+	cp "$launcher_new" "$launcher"
+
 else
 
 	rm -r -f "$ted2"
@@ -26,4 +36,7 @@ else
 	rm -r -f "$launcher"
 	cp -R "$launcher_new" "$launcher"
 	
+	cp ../src/launcher/info.plist "$launcher/Contents"
+	cp ../src/launcher/Monkey2logo.icns "$launcher/Contents/Resources"
+	
 fi

+ 10 - 0
scripts/updateted2.sh

@@ -19,6 +19,16 @@ then
 	rm -r -f "$launcher"
 	cp "$launcher_new" "$launcher"
 
+elif [ "$OSTYPE" = "linux-gnueabihf" ]
+then
+
+	rm -r -f "$ted2"
+	mkdir "$ted2"
+	cp -R "$ted2_new/assets" "$ted2/assets"
+	cp "$ted2_new/ted2" "$ted2/ted2"
+	rm -r -f "$launcher"
+	cp "$launcher_new" "$launcher"
+
 else
 
 	rm -r -f "$ted2"

+ 3 - 0
src/launcher/launcher.monkey2

@@ -25,6 +25,9 @@ Function Main()
 
 	libc.system( "bin/ted2_linux/ted2 >/dev/null 2>/dev/null &" )
 
+#Else If __HOSTOS__="raspbian"
+
+	libc.system( "bin/ted2_raspbian/ted2 >/dev/null 2>/dev/null &" )
 
 #Endif
 

+ 12 - 3
src/mx2cc/builder.monkey2

@@ -75,14 +75,23 @@ Class BuilderInstance
 		
 		Builder=self
 
-		If opts.target="desktop" opts.target=HostOS
+		If opts.target="desktop"
 		
+			opts.target=HostOS
+			
+		Else If HostOS="windows" And opts.target="raspbian"
+		
+			SetEnv( "PATH",GetEnv( "MX2_RASPBIAN_TOOLS" )+";"+GetEnv( "PATH" ) )
+			
+		Endif
+		
+		ppsyms["__HOST__"]="~q"+HostOS+"~q"
 		ppsyms["__HOSTOS__"]="~q"+HostOS+"~q"
 		ppsyms["__TARGET__"]="~q"+opts.target+"~q"
 		ppsyms["__CONFIG__"]="~q"+opts.config+"~q"
 		
 		Select opts.target
-		Case "windows","macos","linux"
+		Case "windows","macos","linux","raspbian"
 			ppsyms["__DESKTOP_TARGET__"]="true"
 			ppsyms["__WEB_TARGET__"]="false"
 			ppsyms["__MOBILE_TARGET__"]="false"
@@ -95,7 +104,7 @@ Class BuilderInstance
 			ppsyms["__WEB_TARGET__"]="false"
 			ppsyms["__MOBILE_TARGET__"]="true"
 		End
-		
+
 		profileName=opts.target+"_"+opts.config
 		
 		MODULES_DIR=CurrentDir()+"modules/"

+ 6 - 0
src/mx2cc/buildproduct.monkey2

@@ -248,6 +248,12 @@ Class GccBuildProduct Extends BuildProduct
 			CXX_CMD="em++"
 			LD_CMD= "em++"
 			AS_CMD= ""
+		Case "raspbian"
+			AR_CMD= "arm-linux-gnueabihf-ar"
+			CC_CMD= "arm-linux-gnueabihf-gcc"
+			CXX_CMD="arm-linux-gnueabihf-g++"
+			LD_CMD= "arm-linux-gnueabihf-g++"
+			AS_CMD= "arm-linux-gnueabihf-as"
 		Default
 			AR_CMD= "ar"
 			CC_CMD= "gcc"

+ 10 - 7
src/mx2cc/mx2cc.monkey2

@@ -19,11 +19,9 @@ Using mx2..
 
 Global StartDir:String
 
-'Const TestArgs:="mx2cc makedocs mojo"
+Const TestArgs:="mx2cc makedocs mojo"
 
-'Const TestArgs:="mx2cc makemods"
-
-Const TestArgs:="mx2cc makeapp -clean -config=debug -target=desktop src/mx2cc/test.monkey2"
+'Const TestArgs:="mx2cc makeapp -clean -config=debug -target=desktop src/mx2cc/test.monkey2"
 
 'Const TestArgs:="mx2cc makeapp -clean -config=debug -target=desktop -product=D:/test_app/test.exe -assets=D:/test_app/assets -dlls=D:/test_app/ src/mx2cc/test.monkey2"
 
@@ -33,12 +31,17 @@ Const TestArgs:="mx2cc makeapp -clean -config=debug -target=desktop src/mx2cc/te
 
 'Const TestArgs:="mx2cc makeapp -verbose -target=desktop -config=release src/mx2cc/mx2cc"
 
+'To build rasbian mx2cc...
+'
+'Const TestArgs:="mx2cc makemods -clean -config=release -target=raspbian monkey libc miniz stb-image stb-image-write stb-vorbis std"
+'Const TestArgs:="mx2cc makeapp -build -clean -config=release -target=raspbian src/mx2cc/mx2cc.monkey2"
+
 Function Main()
 
 	Print "mx2cc version "+MX2CC_VERSION
 
 	StartDir=CurrentDir()
-
+	
 	ChangeDir( AppDir() )
 		
 	Local env:="bin/env_"+HostOS+".txt"
@@ -319,10 +322,10 @@ Function ParseOpts:String[]( opts:BuildOpts,args:String[] )
 			End
 		Case "-target"
 			Select val
-			Case "desktop","windows","macos","linux","emscripten","android","ios"
+			Case "desktop","windows","macos","linux","raspbian","emscripten","android","ios"
 				opts.target=val
 			Default
-				Fail( "Invalid value for 'target' option: '"+val+"' - must be 'desktop', 'emscripten', 'android' or 'ios'" )
+				Fail( "Invalid value for 'target' option: '"+val+"' - must be 'desktop', 'raspbian', 'emscripten', 'android' or 'ios'" )
 			End
 		Case "-config"
 			Select val

+ 4 - 2
src/ted2/buildactions.monkey2

@@ -47,10 +47,12 @@ Class BuildActions
 			If doc=_locked _locked=Null
 		End
 	
-#If __HOSTOS__="macos"
+#If __TARGET__="macos"
 		_mx2cc="bin/mx2cc_macos"
-#Else If __HOSTOS__="windows"
+#Else If __TARGET__="windows"
 		_mx2cc="bin/mx2cc_windows.exe"
+#Else If __TARGET__="raspbian"
+		_mx2cc="bin/mx2cc_raspbian"
 #Else
 		_mx2cc="bin/mx2cc_linux"
 #Endif

+ 5 - 1
src/ted2/buildproduct.monkey2

@@ -33,7 +33,7 @@ Class BuildProduct
 			product=New WindowsProduct( srcPath )
 #else if __TARGET__="macos"
 			product=New MacosProduct( srcPath )
-#else if __TARGET__="linux"
+#else if __TARGET__="linux" Or __TARGET__="raspbian"
 			product=New LinuxProduct( srcPath )
 #endif
 		Case "emscripten"
@@ -409,7 +409,11 @@ End
 Class LinuxProduct Extends DesktopProduct
 
 	Method New( srcPath:String )
+#if __TARGET__="linux"
 		Super.New( srcPath,"linux" )
+#Else
+		Super.New( srcPath,"raspbian" )
+#Endif
 	End
 
 	Protected

+ 2 - 0
src/ted2/mainwindow.monkey2

@@ -263,6 +263,8 @@ Class MainWindowInstance Extends Window
 			Local path:=_tmp+f
 			If GetFileType( path )=FileType.File
 				If Not _docsManager.FindDocument( path ) DeleteFile( path )
+			Else
+				DeleteDir( path,True )
 			Endif
 		Next
 		

+ 2 - 0
src/ted2/mx2ccenv.monkey2

@@ -22,6 +22,8 @@ Const HostOS:="windows"
 Const HostOS:="macos"
 #Else If __TARGET__="linux"
 Const HostOS:="linux"
+#Else IF __TARGET__="raspbian"
+Const HostOS:="raspbian"
 #Else
 Const HostOS:=""
 #Endif