summaryrefslogtreecommitdiff
path: root/package/xenomai/xenomai.mk
diff options
context:
space:
mode:
authorThomas De Schampheleire <patrickdepinguin+buildroot@gmail.com>2011-09-17 22:22:52 +0200
committerPeter Korsgaard <jacmet@sunsite.dk>2011-09-18 22:59:44 +0200
commit956d4ab0f501c44f977297d8faac95afa43f3082 (patch)
tree1a41318da4d95f7c4b36659ee408434b4078a332 /package/xenomai/xenomai.mk
parent3011d235185b490e619dd8b01004538c5985b0ed (diff)
Add xenomai real-time Framework to buildroot
[Fixes by Thomas, including comments from Arnout: * Use AUTOTARGETS instead of GENTARGETS * Use $(KERNEL_ARCH) instead of $(BR2_ARCH) as argument to the prepare-kernel.sh script. This allows the arch name to be fixed with the usual sed expressions and the quotes to be stripped. * Add the --verbose option to prepare-kernel.sh. This allows to get some clear error message when no Xenomai patch has been found for the current kernel version. * Improve the help texts as suggested by Arnout, and remove the now useless README file. * Add a BR2_PACKAGE_XENOMAI_SMP option, instead of poking inside the kernel configuration to find out whether SMP is enabled or not. This cannot work because: 1) the kernel might be built outside of Buildroot and 2) if the kernel is built inside Buildroot, it is built *after* Xenomai, so the kernel configuration file is typically not yet present. * Simplify the ARM subarchitecture selection as suggested by Arnout. * Remove the documentation and development files according to Buildroot standards (using BR2_HAVE_DOCUMENTATION and BR2_HAVE_DEVFILES). * Simplify the /etc/ld.so.conf modification logic. ] [Peter: whitespace fixes] Signed-off-by: Benoit Mauduit <benoit.mauduit@openwide.fr> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package/xenomai/xenomai.mk')
-rw-r--r--package/xenomai/xenomai.mk99
1 files changed, 99 insertions, 0 deletions
diff --git a/package/xenomai/xenomai.mk b/package/xenomai/xenomai.mk
new file mode 100644
index 000000000..8f78333e0
--- /dev/null
+++ b/package/xenomai/xenomai.mk
@@ -0,0 +1,99 @@
+#############################################################
+# Xenomai
+# URL : http://xenomai.org
+# NOTE : Real-Time Framework for Linux
+#
+#############################################################
+
+XENOMAI_VERSION = $(call qstrip,$(BR2_PACKAGE_XENOMAI_VERSION))
+ifeq ($(XENOMAI_VERSION),)
+XENOMAI_VERSION = 2.5.6
+endif
+
+XENOMAI_SITE = http://download.gna.org/xenomai/stable/
+XENOMAI_SOURCE = xenomai-$(XENOMAI_VERSION).tar.bz2
+
+XENOMAI_INSTALL_STAGING = YES
+
+ifeq ($(BR2_arm),y)
+XENOMAI_CPU_TYPE = $(call qstrip,$(BR2_PACKAGE_XENOMAI_CPU_TYPE))
+# Set "generic" if not defined
+ifeq ($(XENOMAI_CPU_TYPE),)
+XENOMAI_CPU_TYPE = generic
+endif
+XENOMAI_CONF_OPT += --enable-arm-mach=$(XENOMAI_CPU_TYPE)
+endif #BR2_arm
+
+ifeq ($(BR2_PACKAGE_XENOMAI_SMP),y)
+XENOMAI_CONF_OPT += --enable-smp
+endif
+
+# The configure step needs to be overloaded, because Xenomai doesn't
+# support --prefix=/usr and the autotargets infrastructure enforces
+# this.
+define XENOMAI_CONFIGURE_CMDS
+ (cd $(@D); rm -rf config.cache; \
+ $(TARGET_CONFIGURE_OPTS) \
+ $(TARGET_CONFIGURE_ARGS) \
+ CCFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \
+ ./configure \
+ $(XENOMAI_CONF_OPT) \
+ --host=$(GNU_TARGET_NAME) \
+ )
+endef
+
+ifeq ($(BR2_HAVE_DOCUMENTATION),)
+define XENOMAI_REMOVE_DOCUMENTATION
+ rm -rf $(TARGET_DIR)/usr/xenomai/share/doc
+ rm -rf $(TARGET_DIR)/usr/xenomai/share/man
+endef
+
+XENOMAI_POST_INSTALL_TARGET_HOOKS += XENOMAI_REMOVE_DOCUMENTATION
+endif
+
+ifeq ($(BR2_HAVE_DEVFILES),)
+define XENOMAI_REMOVE_DEVFILES
+ rm -rf $(TARGET_DIR)/usr/xenomai/include
+ for i in xeno-config xeno-info wrap-link.sh ; do \
+ rm -f $(TARGET_DIR)/usr/xenomai/bin/$$i ; \
+ done
+endef
+
+XENOMAI_POST_INSTALL_TARGET_HOOKS += XENOMAI_REMOVE_DEVFILES
+endif
+
+define XENOMAI_ADD_LD_SO_CONF
+ # Add /usr/xenomai/lib in the library search path
+ grep -q "^/usr/xenomai/lib" $(TARGET_DIR)/etc/ld.so.conf || \
+ echo "/usr/xenomai/lib" >> $(TARGET_DIR)/etc/ld.so.conf
+endef
+
+XENOMAI_POST_INSTALL_TARGET_HOOKS += XENOMAI_ADD_LD_SO_CONF
+
+# If you use static /dev creation don't forget to update your
+# device_table_dev.txt
+ifeq ($(BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV),y)
+XENOMAI_DEPENDENCIES += udev
+
+define XENOMAI_INSTALL_UDEV_RULES
+ if test -d $(TARGET_DIR)/etc/udev/rules.d ; then \
+ for f in $(@D)/ksrc/nucleus/udev/*.rules ; do \
+ cp $$f $(TARGET_DIR)/etc/udev/rules.d/ ; \
+ done ; \
+ fi;
+endef
+
+XENOMAI_POST_INSTALL_TARGET_HOOKS += XENOMAI_INSTALL_UDEV_RULES
+endif # udev
+
+define XENOMAI_REMOVE_UDEV_RULES
+ if test -d $(TARGET_DIR)/etc/udev/rules.d ; then \
+ for f in $(@D)/ksrc/nucleus/udev/*.rules ; do \
+ rm -f $(TARGET_DIR)/etc/udev/rules.d/$$f ; \
+ done ; \
+ fi;
+endef
+
+XENOMAI_POST_UNINSTALL_TARGET_HOOKS += XENOMAI_REMOVE_UDEV_RULES
+
+$(eval $(call AUTOTARGETS,package,xenomai))