Index: trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp
===================================================================
--- trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp	(revision 4486)
+++ trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp	(revision 4637)
@@ -128,5 +128,5 @@
     }
 #endif
-#ifdef RT_OS_LINUX
+#ifdef VBOXSDL_WITH_X11
     /* On some X servers the mouse is stuck inside the bottom right corner.
      * See http://wiki.clug.org.za/wiki/QEMU_mouse_not_working */
@@ -140,5 +140,5 @@
     }
 
-#ifdef RT_OS_LINUX
+#ifdef VBOXSDL_WITH_X11
     /* NOTE: we still want Ctrl-C to work, so we undo the SDL redirections */
     signal(SIGINT, SIG_DFL);
@@ -398,5 +398,5 @@
              x, y, w, h));
 
-#ifdef RT_OS_LINUX
+#ifdef VBOXSDL_WITH_X11
     /*
      * SDL does not allow us to make this call from any other thread than
@@ -412,7 +412,7 @@
     event.user.data2 = (void*)(w << 16 | h);
     PushNotifyUpdateEvent(&event);
-#else /* !RT_OS_LINUX */
+#else /* !VBOXSDL_WITH_X11 */
     update(x, y, w, h, true /* fGuestRelative */);
-#endif /* !RT_OS_LINUX */
+#endif /* !VBOXSDL_WITH_X11 */
 
     /*
@@ -712,6 +712,8 @@
      */
     int sdlFlags = SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL;
+#ifndef RT_OS_OS2 /* doesn't seem to work for some reason... */
     if (mfResizable)
         sdlFlags |= SDL_RESIZABLE;
+#endif
     if (mfFullscreen)
         sdlFlags |= SDL_FULLSCREEN;
@@ -832,5 +834,5 @@
 void VBoxSDLFB::update(int x, int y, int w, int h, bool fGuestRelative)
 {
-#ifdef RT_OS_LINUX
+#ifdef VBOXSDL_WITH_X11
     AssertMsg(mSdlNativeThread == RTThreadNativeSelf(), ("Wrong thread! SDL is not threadsafe!\n"));
 #endif
@@ -1031,5 +1033,5 @@
 void VBoxSDLFB::paintSecureLabel(int x, int y, int w, int h, bool fForce)
 {
-#ifdef RT_OS_LINUX
+#ifdef VBOXSDL_WITH_X11
     AssertMsg(mSdlNativeThread == RTThreadNativeSelf(), ("Wrong thread! SDL is not threadsafe!\n"));
 #endif
Index: trunk/src/VBox/Frontends/VBoxSDL/Makefile.kmk
===================================================================
--- trunk/src/VBox/Frontends/VBoxSDL/Makefile.kmk	(revision 4486)
+++ trunk/src/VBox/Frontends/VBoxSDL/Makefile.kmk	(revision 4637)
@@ -44,5 +44,7 @@
  VBoxSDL_DEFS     += VBOX_VRDP
 endif
-VBoxSDL_DEFS.linux = _GNU_SOURCE
+VBoxSDL_DEFS.freebsd = VBOXSDL_WITH_X11
+VBoxSDL_DEFS.linux = _GNU_SOURCE VBOXSDL_WITH_X11
+VBoxSDL_DEFS.solaris = VBOXSDL_WITH_X11
 ifdef VBOX_OPENGL
  #VBoxSDL_DEFS.linux += VBOX_OPENGL
Index: trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
===================================================================
--- trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp	(revision 4486)
+++ trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp	(revision 4637)
@@ -30,5 +30,5 @@
 using namespace com;
 
-#if defined (RT_OS_LINUX)
+#if defined (VBOXSDL_WITH_X11)
 #include <X11/Xlib.h>
 #include <X11/cursorfont.h>      /* for XC_left_ptr */
@@ -181,5 +181,5 @@
 static VBoxSDLFB  *gpFrameBuffer = NULL;
 static SDL_Cursor *gpDefaultCursor = NULL;
-#ifdef RT_OS_LINUX
+#ifdef VBOXSDL_WITH_X11
 static Cursor      gpDefaultOrigX11Cursor;
 #endif
@@ -189,5 +189,5 @@
 static SDL_TimerID gSdlResizeTimer = NULL;
 
-#ifdef RT_OS_LINUX
+#ifdef VBOXSDL_WITH_X11
 static SDL_SysWMinfo gSdlInfo;
 #endif
@@ -569,5 +569,5 @@
         if (SDL_GetWMInfo(&info))
         {
-#if defined (RT_OS_LINUX)
+#if defined (VBOXSDL_WITH_X11)
             *winId = (ULONG64) info.info.x11.wmwindow;
 #elif defined (RT_OS_WIN)
@@ -688,5 +688,5 @@
 }
 
-#ifdef RT_OS_LINUX
+#ifdef VBOXSDL_WITH_X11
 /**
  * Custom signal handler. Currently it is only used to release modifier
@@ -705,5 +705,5 @@
     }
 }
-#endif /* RT_OS_LINUX */
+#endif /* VBOXSDL_WITH_X11 */
 
 /** entry point */
@@ -720,5 +720,5 @@
     }
 
-#ifdef RT_OS_LINUX
+#ifdef VBOXSDL_WITH_X11
     /*
      * Lock keys on SDL behave different from normal keys: A KeyPress event is generated
@@ -1822,5 +1822,5 @@
     gpDefaultCursor = SDL_GetCursor();
 
-#ifdef RT_OS_LINUX
+#ifdef VBOXSDL_WITH_X11
     /* Get Window Manager info. We only need the X11 display. */
     SDL_VERSION(&gSdlInfo.version);
@@ -1836,5 +1836,5 @@
     *(Cursor*)gpDefaultCursor->wm_cursor = XCreateFontCursor(gSdlInfo.info.x11.display, XC_left_ptr);
     SDL_SetCursor(gpDefaultCursor);
-#endif /* RT_OS_LINUX */
+#endif /* VBOXSDL_WITH_X11 */
 
     /* create a fake empty cursor */
@@ -1849,5 +1849,5 @@
      * Register our user signal handler.
      */
-#ifdef RT_OS_LINUX
+#ifdef VBOXSDL_WITH_X11
     struct sigaction sa;
     sa.sa_sigaction = signal_handler;
@@ -1855,5 +1855,5 @@
     sa.sa_flags = SA_RESTART | SA_SIGINFO;
     sigaction (SIGUSR1, &sa, NULL);
-#endif /* RT_OS_LINUX */
+#endif /* VBOXSDL_WITH_X11 */
 
     /*
@@ -2495,12 +2495,12 @@
     if (gpDefaultCursor)
     {
-#ifdef RT_OS_LINUX
+#ifdef VBOXSDL_WITH_X11
         Cursor pDefaultTempX11Cursor = *(Cursor*)gpDefaultCursor->wm_cursor;
         *(Cursor*)gpDefaultCursor->wm_cursor = gpDefaultOrigX11Cursor;
-#endif /* RT_OS_LINUX */
+#endif /* VBOXSDL_WITH_X11 */
         SDL_SetCursor(gpDefaultCursor);
-#ifdef RT_OS_LINUX
+#ifdef VBOXSDL_WITH_X11
         XFreeCursor(gSdlInfo.info.x11.display, pDefaultTempX11Cursor);
-#endif /* RT_OS_LINUX */
+#endif /* VBOXSDL_WITH_X11 */
     }
 
@@ -2514,5 +2514,5 @@
 #if defined (RT_OS_WINDOWS)
             ::DestroyCursor(*(HCURSOR *) pCustomTempWMCursor);
-#elif defined (RT_OS_LINUX)
+#elif defined (VBOXSDL_WITH_X11)
             XFreeCursor(gSdlInfo.info.x11.display, *(Cursor *) pCustomTempWMCursor);
 #endif
@@ -2752,5 +2752,5 @@
     int keycode = ev->keysym.scancode;
 
-#ifdef RT_OS_LINUX
+#ifdef VBOXSDL_WITH_X11
     // workaround for SDL keyboard translation issues on Linux
     // keycodes > 0x100 are sent as 0xe0 keycode
@@ -4003,5 +4003,5 @@
             ::DeleteObject (hBitmap);
 
-#elif defined (RT_OS_LINUX)
+#elif defined (VBOXSDL_WITH_X11)
 
         XcursorImage *img = XcursorImageCreate (data->width, data->height);
@@ -4381,5 +4381,5 @@
 }
 
-#ifdef RT_OS_LINUX
+#ifdef VBOXSDL_WITH_X11
 /**
  * Special SDL_PushEvent function for NotifyUpdate events. These events may occur in bursts
@@ -4406,3 +4406,3 @@
         RTThreadYield();
 }
-#endif /* RT_OS_LINUX */
+#endif /* VBOXSDL_WITH_X11 */
Index: trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.h
===================================================================
--- trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.h	(revision 4486)
+++ trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.h	(revision 4637)
@@ -68,5 +68,5 @@
 #endif /* VBOX_WIN32_UI */
 
-#ifdef RT_OS_LINUX
+#ifdef VBOXSDL_WITH_X11
 void PushNotifyUpdateEvent(SDL_Event *event);
 #endif
