Skip to contentSkip to conversation

flex: delete broken flex++ symlink from target

PATCH New Danomi Manchego 2 participants 4 messages Jul 29, 2014 – Jul 30, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 flex: delete broken flex++ symlink from target

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.

---
 package/flex/flex.mk |    6 ++++++
 1 file changed, 6 insertions(+)
package/flex/flex.mk +6 -0
index 17f651b..cd92dd7 100644
@@ -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))
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 flex: delete broken flex++ symlink from target

Dear Danomi Manchego,

Quoted 9 lines · Danomi Manchego

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.

---
 package/flex/flex.mk |    6 ++++++
 1 file changed, 6 insertions(+)

Thanks, applied. However, I'd really like if someone could take the time to do a proper patch upstream to add a new ./configure option to enable/disable the program compilation/installation. It would allow us to simplify the package a bit.

Danomi, would you be willing to work on this? The upstream seems to be active, and there is a git repository at
http://sourceforge.net/p/flex/flex/ci/master/tree/, so no need to work with horrible outdated version control systems.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 flex: delete broken flex++ symlink from target

Quoted 18 lines · Thomas Petazzoni

Dear Danomi Manchego,

Quoted 9 lines · Danomi Manchego

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.

---
 package/flex/flex.mk |    6 ++++++
 1 file changed, 6 insertions(+)

Thanks, applied. However, I'd really like if someone could take the time to do a proper patch upstream to add a new ./configure option to enable/disable the program compilation/installation. It would allow us to simplify the package a bit.

Quoted 4 lines

Danomi, would you be willing to work on this? The upstream seems to be active, and there is a git repository at
http://sourceforge.net/p/flex/flex/ci/master/tree/, so no need to work with horrible outdated version control systems.

Thomas,

Actually, I don't know *anything* about flex. The only reason I ran into this is that linux-pam now pulls in flex as a dependency, and the flex++ came up as a difference in my before-2014.05/after-2014.05 upgrade comparison check. But I am somewhat knowledgeable about makefiles, so if this amounts to sending patches to some sourceforge mailing list, then I can try.

We just want an option to officially not install the bin and the flex++ symlink, and add in the "AR" definition?

What's was the reason for dropping the tool - is it too large, or is the m4 dependency objectionable?

Additionally, I see that the last change to buildroot's flex package was to revert the bump to 2.5.39, because it broke a couple packages - back in April 2014. If the mods got in, would we be able to upgrade?

Danomi -

#3 lore raw

PATCH 1/1 flex: delete broken flex++ symlink from target

Dear Danomi Manchego,

Quoted 4 lines · Danomi Manchego

Actually, I don't know *anything* about flex. The only reason I ran into this is that linux-pam now pulls in flex as a dependency, and the flex++ came up as a difference in my before-2014.05/after-2014.05 upgrade comparison check.

Nice catch then, it was a good idea to do this comparison!

Quoted 3 lines

But I am somewhat knowledgeable about
makefiles, so if this amounts to sending patches to some sourceforge mailing list, then I can try.

Yes, I don't think you need to know much about flex, it's mostly about autotools that you need to know a few things.

Quoted 2 lines

We just want an option to officially not install the bin and the flex++ symlink, and add in the "AR" definition?

Yes, except for AR: our patch actually *removes* the AR definition, so that it can be passed from the environment. But I see that this might have been fixed in 2.5.39 (yes it does).

For the rest, a --enable-program / --disable-program autoconf option would be good to enable/disable the compilation/installation of the program.

Quoted 2 lines

What's was the reason for dropping the tool - is it too large, or is the m4 dependency objectionable?

The dependency on host-m4 is always there. No, the main reason is 1/ space and 2/ the library builds on noMMU platforms, but not the program, because it uses fork().

Quoted 3 lines

Additionally, I see that the last change to buildroot's flex package was to revert the bump to 2.5.39, because it broke a couple packages - back in April 2014. If the mods got in, would we be able to upgrade?

No, additional changes would be needed. As pointed out in the commit log of 1be95896dde41c668e1c884db704b0da2ea360c9, bumping flex broke at least two packages. It would be good to see if those packages have been fixed since then, and investigate if we can bump flex.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com