flex: delete broken flex++ symlink from target
authorDanomi Manchego <danomimanchego123@gmail.com>
Tue, 29 Jul 2014 01:35:34 +0000 (21:35 -0400)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 29 Jul 2014 21:54:22 +0000 (23:54 +0200)
When flex is built for the target without installing the
flex binary, a flex++ symlink installed by flex's Makefile
points to the missing flex executable.  This mod adds
a post target install hook to remove the broken symlink.

Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/flex/flex.mk

index 17f651b802a999868bbbab820f2fb8bd821eb1b6..cd92dd7b00f2ba3e7227de57deffdb8e9b61d995 100644 (file)
@@ -29,6 +29,12 @@ define FLEX_DISABLE_PROGRAM
 endef
 FLEX_POST_PATCH_HOOKS += FLEX_DISABLE_PROGRAM
 
+# flex++ symlink is broken when flex binary is not installed
+define FLEX_REMOVE_BROKEN_SYMLINK
+       rm -f $(TARGET_DIR)/usr/bin/flex++
+endef
+FLEX_POST_INSTALL_TARGET_HOOKS += FLEX_REMOVE_BROKEN_SYMLINK
+
 endif
 
 $(eval $(autotools-package))