diff --git a/UseOROCOS-RTT.cmake b/UseOROCOS-RTT.cmake
index 6c6e718..dba774f 100644
--- a/UseOROCOS-RTT.cmake
+++ b/UseOROCOS-RTT.cmake
@@ -61,6 +61,14 @@ if(OROCOS-RTT_FOUND)
     set(USE_OROCOS_COMPILE_FLAGS " " )
   endif (MSVC)
 
+  # Xeno-config
+  execute_process(COMMAND xeno-config --skin=native --ldflags OUTPUT_VARIABLE XENOMAI_LDFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
+  execute_process(COMMAND xeno-config --skin=native --cflags OUTPUT_VARIABLE XENOMAI_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+  # set Xenomai flags to use_orocos_compile_flags
+  SET( USE_OROCOS_COMPILE_FLAGS "${USE_OROCOS_COMPILE_FLAGS} ${XENOMAI_CFLAGS}")
+  SET( USE_OROCOS_LINK_FLAGS "${USE_OROCOS_LINK_FLAGS} ${XENOMAI_LDFLAGS}")
+
   # On windows, the CMAKE_INSTALL_PREFIX is forced to the Orocos-RTT path.
   # There's two alternatives to disable this behavior:
   #
@@ -461,6 +469,10 @@ macro( orocos_typekit LIB_TARGET_NAME )
     INSTALL_RPATH_USE_LINK_PATH 1
     INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib;${CMAKE_INSTALL_PREFIX}/lib/orocos${OROCOS_SUFFIX}/types;${CMAKE_INSTALL_PREFIX}/${AC_INSTALL_DIR}"
     )
+
+  orocos_add_compile_flags(${LIB_TARGET_NAME} ${USE_OROCOS_COMPILE_FLAGS})
+  orocos_add_link_flags(${LIB_TARGET_NAME} ${USE_OROCOS_LINK_FLAGS})
+
   TARGET_LINK_LIBRARIES( ${LIB_TARGET_NAME} ${OROCOS-RTT_LIBRARIES} )
 
   # On win32, typekit runtime (.dll) should go in orocos/types folder
diff --git a/config/FindXenomai.cmake b/config/FindXenomai.cmake
index 8ea44c9..ff864cb 100644
--- a/config/FindXenomai.cmake
+++ b/config/FindXenomai.cmake
@@ -30,24 +30,25 @@ if ( Xenomai_FIND_REQUIRED )
 endif()
 
 # Header files to find
-set(header_NAME    native/task.h)
+set(header_NAME    alchemy/task.h)
 
 # Libraries to find
-set(XENOMAI_NAME   xenomai)
-set(XENOMAI_NATIVE_NAME   native)
+set(XENOMAI_NATIVE_NAME   alchemy)
+set(XENOMAI_COPPERPLATE_NAME   copperplate) # middleware between skin & core posix Xenomai 3
+set(XENOMAI_TRANK_NAME   trank) # for compatibility with Xenomai 2
 
 # Find headers and libraries
 if(XENOMAI_ROOT_DIR)
   # Use location specified by environment variable
   find_program(XENOMAI_XENO_CONFIG NAMES xeno-config  PATHS ${XENOMAI_ROOT_DIR}/bin NO_DEFAULT_PATH)
   find_path(XENOMAI_INCLUDE_DIR        NAMES ${header_NAME}        PATHS ${XENOMAI_ROOT_DIR}/include PATH_SUFFIXES xenomai NO_DEFAULT_PATH)
-  find_library(XENOMAI_LIBRARY         NAMES ${XENOMAI_NAME}       PATHS ${XENOMAI_ROOT_DIR}/lib     NO_DEFAULT_PATH)
   find_library(XENOMAI_NATIVE_LIBRARY         NAMES ${XENOMAI_NATIVE_NAME}       PATHS ${XENOMAI_ROOT_DIR}/lib     NO_DEFAULT_PATH)
+  find_library(XENOMAI_COPPERPLATE_LIBRARY         NAMES ${XENOMAI_COPPERPLATE_NAME}       PATHS ${XENOMAI_ROOT_DIR}/lib     NO_DEFAULT_PATH)
+  find_library(XENOMAI_TRANK_LIBRARY         NAMES ${XENOMAI_TRANK_NAME}       PATHS ${XENOMAI_ROOT_DIR}/lib     NO_DEFAULT_PATH)
 else()
   # Use default CMake search process
   find_program(XENOMAI_XENO_CONFIG NAMES xeno-config )
   find_path(XENOMAI_INCLUDE_DIR       NAMES ${header_NAME} PATH_SUFFIXES xenomai )
-  find_library(XENOMAI_LIBRARY        NAMES ${XENOMAI_NAME})
   find_library(XENOMAI_NATIVE_LIBRARY        NAMES ${XENOMAI_NATIVE_NAME})
 endif()
 
@@ -62,11 +63,11 @@ endif()
 # Set the include dir variables and the libraries and let libfind_process do the rest.
 # NOTE: Singular variables for this library, plural for libraries this this lib depends on.
 set(XENOMAI_PROCESS_INCLUDES XENOMAI_INCLUDE_DIR)
-if ( XENOMAI_LIBRARY )
-  set(XENOMAI_PROCESS_LIBS XENOMAI_NATIVE_LIBRARY XENOMAI_LIBRARY )
-else( XENOMAI_LIBRARY )
+if ( XENOMAI_NATIVE_LIBRARY )
+  set(XENOMAI_PROCESS_LIBS XENOMAI_COPPERPLATE_LIBRARY XENOMAI_NATIVE_LIBRARY XENOMAI_TRANK_LIBRARY)
+else( XENOMAI_NATIVE_LIBRARY )
   set(XENOMAI_PROCESS_LIBS XENOMAI_NATIVE_LIBRARY)
-endif( XENOMAI_LIBRARY )
+endif( XENOMAI_NATIVE_LIBRARY )
 
 
 libfind_process(XENOMAI)
diff --git a/config/FindXenomaiPosix.cmake b/config/FindXenomaiPosix.cmake
index 9422085..80cfe6d 100644
--- a/config/FindXenomaiPosix.cmake
+++ b/config/FindXenomaiPosix.cmake
@@ -30,10 +30,10 @@ if ( XenomaiPosix_FIND_REQUIRED )
 endif()
 
 # Header files to find
-set(header_NAME    pthread.h)
+set(header_NAME    cobalt/pthread.h)
 
 # Libraries to find
-set(XENOMAI_POSIX_NAME   pthread_rt)
+set(XENOMAI_POSIX_NAME   cobalt)
 
 # Find headers and libraries
 if(XENOMAI_ROOT_DIR)
@@ -51,8 +51,8 @@ endif()
 if( XENOMAI_POSIX_LIBRARY AND XENOMAI_POSIX_INCLUDE_DIR AND NOT XENOMAI_XENO_CONFIG )
   message(SEND_ERROR "Your Xenomai installation is broken: I can not determine Xenomai POSIX cflags/ldflags without xeno-config.")
 else()
-  execute_process(COMMAND ${XENOMAI_XENO_CONFIG} --skin=posix --ldflags OUTPUT_VARIABLE XENOMAI_POSIX_LDFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
-  execute_process(COMMAND ${XENOMAI_XENO_CONFIG} --skin=posix --cflags OUTPUT_VARIABLE XENOMAI_POSIX_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
+  execute_process(COMMAND ${XENOMAI_XENO_CONFIG} --compat --skin=cobalt --ldflags OUTPUT_VARIABLE XENOMAI_POSIX_LDFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
+  execute_process(COMMAND ${XENOMAI_XENO_CONFIG} --compat --skin=cobalt --cflags OUTPUT_VARIABLE XENOMAI_POSIX_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
 endif()
 
 # Set the include dir variables and the libraries and let libfind_process do the rest.
diff --git a/rtt/CMakeLists.txt b/rtt/CMakeLists.txt
index 0062859..7e2888e 100644
--- a/rtt/CMakeLists.txt
+++ b/rtt/CMakeLists.txt
@@ -49,8 +49,12 @@ IF ( OS_NOEXCEPTIONS )
   SET( CMAKE_CXX_FLAGS_ADD "${CMAKE_CXX_FLAGS_ADD} -fno-exceptions")
 ENDIF ( OS_NOEXCEPTIONS )
 
+# Xenomai flags set
+SET( CMAKE_CXX_FLAGS_ADD "${CMAKE_CXX_FLAGS_ADD} ${XENOMAI_CFLAGS}")
+SET( CMAKE_LD_FLAGS_ADD "${CMAKE_LD_FLAGS_ADD} ${XENOMAI_LDFLAGS}")
+
 IF ( OS_EMBEDDED )
-  SET( CMAKE_CXX_FLAGS_ADD "${CMAKE_CXX_FLAGS_ADD} -ffunction-sections -fdata-sections")
+  SET( CMAKE_CXX_FLAGS_ADD "${CMAKE_CXX_FLAGS_ADD} ${XENOMAI_CFLAGS} -ffunction-sections -fdata-sections")
 ENDIF ( OS_EMBEDDED )
 
 ### Logger
diff --git a/rtt/extras/IRQActivity.cpp b/rtt/extras/IRQActivity.cpp
index 1a9500c..fdfbfb0 100644
--- a/rtt/extras/IRQActivity.cpp
+++ b/rtt/extras/IRQActivity.cpp
@@ -35,6 +35,7 @@
  *                                                                         *
  ***************************************************************************/
 
+#ifdef ORO_RTT_USE_DEPRECATED
 
 #include "IRQActivity.hpp"
 #include "../ExecutionEngine.hpp"
@@ -156,3 +157,4 @@ void IRQActivity::step()
 
 #endif // OS is xenomai
 
+#endif // Use of deprecated interrupt management of Xenomai 2
diff --git a/rtt/extras/IRQActivity.hpp b/rtt/extras/IRQActivity.hpp
index 1ef15f6..4231e2d 100644
--- a/rtt/extras/IRQActivity.hpp
+++ b/rtt/extras/IRQActivity.hpp
@@ -35,6 +35,7 @@
  *                                                                         *
  ***************************************************************************/
 
+#ifdef ORO_RTT_USE_DEPRECATED
 
 #ifndef IRQ_ACTIVITY_HPP
 #define IRQ_ACTIVITY_HPP
@@ -123,3 +124,5 @@ namespace RTT { namespace extras {
 }}
 
 #endif
+
+#endif //Use of deprecated interrupt management of Xenomai 2
diff --git a/rtt/extras/rtt-extras-fwd.hpp b/rtt/extras/rtt-extras-fwd.hpp
index 6aaed7c..99ca33d 100644
--- a/rtt/extras/rtt-extras-fwd.hpp
+++ b/rtt/extras/rtt-extras-fwd.hpp
@@ -4,7 +4,9 @@
 namespace RTT {
     namespace extras {
         class FileDescriptorActivity;
+#ifdef ORO_RTT_USE_DEPRECATED
         class IRQActivity;
+#endif
         class PeriodicActivity;
         class SequentialActivity;
         class SimulationActivity;
diff --git a/rtt/os/TimeService.cpp b/rtt/os/TimeService.cpp
index 64b6b37..bfebb42 100644
--- a/rtt/os/TimeService.cpp
+++ b/rtt/os/TimeService.cpp
@@ -83,12 +83,12 @@ namespace RTT {
         if ( use_clock == true )
             {
                 // if offset is X, then start counting from X.
-                offset = offset - rtos_get_time_ticks();
+                offset = offset - rt_timer_read();
             }
         else
             {
                 // start counting from _now_ + old offset
-                offset = offset + rtos_get_time_ticks();
+                offset = offset + rt_timer_read();
             }
     }
 
@@ -96,7 +96,7 @@ namespace RTT {
     TimeService::ticks
     TimeService::getTicks() const
     {
-        return use_clock ? rtos_get_time_ticks() + offset : 0 + offset;
+        return use_clock ? rt_timer_read() + offset : 0 + offset;
     }
 
     TimeService::ticks
diff --git a/rtt/os/xenomai/fosi.h b/rtt/os/xenomai/fosi.h
index 61fd919..2614bcb 100644
--- a/rtt/os/xenomai/fosi.h
+++ b/rtt/os/xenomai/fosi.h
@@ -119,20 +119,8 @@ extern "C" {
 #define ORO_SCHED_RT    0 /** Hard real-time */
 #define ORO_SCHED_OTHER 1 /** Soft real-time */
 
-	// hrt is in ticks
-static inline TIME_SPEC ticks2timespec(TICK_TIME hrt)
-{
-	TIME_SPEC timevl;
-	timevl.tv_sec = rt_timer_tsc2ns(hrt) / 1000000000LL;
-	timevl.tv_nsec = rt_timer_tsc2ns(hrt) % 1000000000LL;
-	return timevl;
-}
 
-	// hrt is in ticks
-static inline TICK_TIME timespec2ticks(const TIME_SPEC* ts)
-{
-	return  rt_timer_ns2tsc(ts->tv_nsec + ts->tv_sec*1000000000LL);
-}
+
 
 // turn this on to have maximum detection of valid system calls.
 #ifdef OROSEM_OS_XENO_CHECK
@@ -153,17 +141,14 @@ static inline TICK_TIME timespec2ticks(const TIME_SPEC* ts)
 
 static inline NANO_TIME rtos_get_time_ns(void) { return rt_timer_ticks2ns(rt_timer_read()); }
 
-static inline TICK_TIME rtos_get_time_ticks(void) { return rt_timer_tsc(); }
-
-static inline TICK_TIME ticksPerSec(void) { return rt_timer_ns2tsc( 1000 * 1000 * 1000 ); }
 
 // WARNING: Orocos 'ticks' are 'Xenomai tsc' and Xenomai `ticks' are not
 // used in the Orocos API. Thus Orocos uses `Xenomai tsc' and `Xenomai ns',
 // yet Xenomai requires `Xenomai ticks' at the interface
 // ==> do not use nano2ticks to convert to `Xenomai ticks' because it
 // converts to `Xenomai tsc'.
-static inline TICK_TIME nano2ticks(NANO_TIME t) { return rt_timer_ns2tsc(t); }
-static inline NANO_TIME ticks2nano(TICK_TIME t) { return rt_timer_tsc2ns(t); }
+static inline TICK_TIME nano2ticks(NANO_TIME t) { return rt_timer_ns2ticks(t); }
+static inline NANO_TIME ticks2nano(TICK_TIME t) { return rt_timer_ticks2ns(t); }
 
 static inline int rtos_nanosleep(const TIME_SPEC *rqtp, TIME_SPEC *rmtp)
 	{
@@ -260,15 +245,10 @@ static inline int rtos_nanosleep(const TIME_SPEC *rqtp, TIME_SPEC *rmtp)
     static inline int rtos_mutex_trylock( rt_mutex_t* m)
     {
         CHK_XENO_CALL();
-        struct rt_mutex_info info;
+        RT_MUTEX_INFO info;
         rt_mutex_inquire(m, &info );
-#if ((CONFIG_XENO_VERSION_MAJOR*1000)+(CONFIG_XENO_VERSION_MINOR*100)+CONFIG_XENO_REVISION_LEVEL) >= 2500
-        if (info.locked)
-            return 0;
-#else
-        if (info.lockcnt)
+	if (&(info.owner)==NULL)
             return 0;
-#endif
         // from here on: we're sure our thread didn't lock it
         // now check if any other thread locked it:
         return rt_mutex_acquire(m, TM_NONBLOCK);
diff --git a/rtt/os/xenomai/fosi_internal.cpp b/rtt/os/xenomai/fosi_internal.cpp
index 9e8ee7a..748cde7 100644
--- a/rtt/os/xenomai/fosi_internal.cpp
+++ b/rtt/os/xenomai/fosi_internal.cpp
@@ -441,7 +441,7 @@ namespace RTT
             RT_TASK* tt = mytask->xenoptr;
             if ( tt )
                 if ( rt_task_inquire ( tt, &info) == 0 )
-                    return info.bprio;
+                    return info.prio;
             return -1;
         }
 
diff --git a/rtt/transports/corba/TaskContextProxy.cpp b/rtt/transports/corba/TaskContextProxy.cpp
index cdedc90..662aa79 100644
--- a/rtt/transports/corba/TaskContextProxy.cpp
+++ b/rtt/transports/corba/TaskContextProxy.cpp
@@ -86,7 +86,7 @@ namespace RTT
             deletePropertyBag( *this->properties() );
         }
         this->attributes()->clear();
-        for (list<PortInterface*>::iterator it = port_proxies.begin(); it != port_proxies.end(); ++it)
+        for (std::list<PortInterface*>::iterator it = port_proxies.begin(); it != port_proxies.end(); ++it)
             delete *it;
         proxies.erase(this);
     }
