configure.ac
branchstable-1.5
changeset 2433 3bdd7a747fae
parent 2419 fdb85a806585
child 2437 7b8078c1ad36
--- a/configure.ac	Thu Sep 20 09:20:51 2012 +0200
+++ b/configure.ac	Thu Sep 20 15:28:25 2012 +0200
@@ -426,13 +426,15 @@
 AC_ARG_WITH([rtai-dir],
     AC_HELP_STRING(
         [--with-rtai-dir=<DIR>],
-        [RTAI path (only for RTAI examples)]
+        [RTAI path, for RTDM interface and RTAI examples]
     ),
     [
         rtaidir=[$withval]
+        rtai=1
     ],
     [
         rtaidir=""
+        rtai=0
     ]
 )
 
@@ -445,9 +447,99 @@
         AC_MSG_ERROR([no RTAI installation found in ${rtaidir}!])
     fi
     AC_MSG_RESULT([$rtaidir])
+
+    rtai_lxrt_cflags=`$rtaidir/bin/rtai-config --lxrt-cflags`
+    rtai_lxrt_ldflags=`$rtaidir/bin/rtai-config --lxrt-ldflags`
 fi
 
 AC_SUBST(RTAI_DIR,[$rtaidir])
+AM_CONDITIONAL(ENABLE_RTAI, test "x$rtai" = "x1")
+AC_SUBST(ENABLE_RTAI,[$rtai])
+
+AC_SUBST(RTAI_LXRT_CFLAGS,[$rtai_lxrt_cflags])
+AC_SUBST(RTAI_LXRT_LDFLAGS,[$rtai_lxrt_ldflags])
+
+#------------------------------------------------------------------------------
+# Xenomai path (optional)
+#------------------------------------------------------------------------------
+
+AC_ARG_WITH([xenomai-dir],
+    AC_HELP_STRING(
+        [--with-xenomai-dir=<DIR>],
+        [Xenomai path, for RTDM interface and Xenomai examples]
+    ),
+    [
+        xenomaidir=[$withval]
+        xeno=1
+    ],
+    [
+        xenomaidir=""
+        xeno=0
+    ]
+)
+
+AC_MSG_CHECKING([for Xenomai path])
+
+if test -z "${xenomaidir}"; then
+    AC_MSG_RESULT([not specified.])
+else
+    if test \! -r ${xenomaidir}/include/xeno_config.h; then
+        AC_MSG_ERROR([no Xenomai installation found in ${xenomaidir}!])
+    fi
+    AC_MSG_RESULT([$xenomaidir])
+
+    xeno_native_cflags=`$xenomaidir/bin/xeno-config --skin native --cflags`
+    xeno_native_ldflags=`$xenomaidir/bin/xeno-config --skin native --ldflags`
+    xeno_posix_cflags=`$xenomaidir/bin/xeno-config --skin posix --cflags`
+    xeno_posix_ldflags=`$xenomaidir/bin/xeno-config --skin posix --ldflags`
+    xeno_rtdm_cflags=`$xenomaidir/bin/xeno-config --skin rtdm --cflags`
+    xeno_rtdm_ldflags=`$xenomaidir/bin/xeno-config --skin rtdm --ldflags`
+fi
+
+AC_SUBST(XENOMAI_DIR,[$xenomaidir])
+AM_CONDITIONAL(ENABLE_XENOMAI, test "x$xeno" = "x1")
+AC_SUBST(ENABLE_XENOMAI,[$xeno])
+
+AC_SUBST(XENOMAI_NATIVE_CFLAGS,[$xeno_native_cflags])
+AC_SUBST(XENOMAI_NATIVE_LDFLAGS,[$xeno_native_ldflags])
+AC_SUBST(XENOMAI_POSIX_CFLAGS,[$xeno_posix_cflags])
+AC_SUBST(XENOMAI_POSIX_LDFLAGS,[$xeno_posix_ldflags])
+AC_SUBST(XENOMAI_RTDM_CFLAGS,[$xeno_rtdm_cflags])
+AC_SUBST(XENOMAI_RTDM_LDFLAGS,[$xeno_rtdm_ldflags])
+
+#------------------------------------------------------------------------------
+# RTDM interface (optional)
+#------------------------------------------------------------------------------
+
+AC_ARG_ENABLE([rtdm],
+    AC_HELP_STRING(
+        [--enable-rtdm],
+        [Enable RTDM interface, depends on RTAI or Xenomai]
+    ),
+    [
+        case "${enableval}" in
+            yes) rtdm=1
+                ;;
+            no) rtdm=0
+                ;;
+            *) AC_MSG_ERROR([Invalid value for --enable-rtdm])
+                ;;
+        esac
+    ],
+    [rtdm=0]
+)
+
+AC_MSG_CHECKING([whether to build RTDM interface])
+
+if test "x${rtdm}" = "x1"; then
+    AC_DEFINE([EC_RTDM], [1], [RTDM interface enabled])
+    AC_MSG_RESULT([yes])
+else
+    AC_MSG_RESULT([no])
+fi
+
+AM_CONDITIONAL(ENABLE_RTDM, test "x$rtdm" = "x1")
+AC_SUBST(ENABLE_RTDM,[$rtdm])
 
 #------------------------------------------------------------------------------
 # Debug interface
@@ -711,9 +803,12 @@
         examples/mini/Makefile
         examples/rtai/Kbuild
         examples/rtai/Makefile
+        examples/rtai_rtdm/Makefile
         examples/tty/Kbuild
         examples/tty/Makefile
         examples/user/Makefile
+        examples/xenomai/Makefile
+        examples/xenomai_posix/Makefile
         include/Makefile
         lib/Makefile
         m4/Makefile