New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Makefile: fix install failure if path contains "m4/" string #49
Conversation
Makefile
Outdated
@@ -88,6 +88,6 @@ $(DESTDIR)$(datadir)/%: % | |||
$(INSTALL) -D -m 644 $< $@ | |||
|
|||
$(DESTDIR)$(acdir)/%: % | |||
$(INSTALL) -D -l ../$(subst $(datarootdir)/,,$(datadir))/$< $(subst m4/,,$@) | |||
$(INSTALL) -D -l ../$(subst $(datarootdir)/,,$(datadir))/$< $(shell echo $@ | sed 's,\(.*\)m4/,\1,') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about:
- $(subst m4/,,$@)
+ $(patsubst %m4/,%,$@)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. This also works and is more elegant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is more elegant. Tomorrow I'll resend the patch here and to Buildroot ML.
Thank you for proposing and testing!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ehm this doesn't work for me instead. @hthiery can you please give it a try and check if it works for you? Basically it doesn't do the trick to remove "m4/", so I find all .m4 files in:
host/share/aclocal/m4/
instead of:
host/share/aclocal/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're right ... this does not work
Sorry but this patch doesn't work for me, see: |
OK. I notice a much simpler patch:
EDIT: but i dont quite understand why patsubst does not work. |
If I'm correct this should work. This replaces the m4 from the path Note: |
Confirmed. But i noticed this in gnu doc:
So i would suggest use function instead of magic
|
ok ... i was not aware of these functions... thank you
|
@hthiery do you want to take over and submit this patch? Basically you've found the cleanest way. Otherwise I will do it. |
You can do that. No problem. I just wanted to help. |
Actually Makefile install recipe substitutes every occurence of "m4/" in file name of the target of the rule($@), in an absolute path there could more than one "m4/" occurence, so install will fail. Let's change $(subst ...) with $(patsubst ...) substituting only last occurence of "m4/" pattern. Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Here is the corrected patch. King regards |
@giuliobenetti thank you |
Actually Makefile install recipe substitutes every occurence of "m4/" in
file name of the target of the rule($@), in an absolute path there could
more than one "m4/" occurence, so install will fail. Let's change
$(susbst ...) call with a call to sed substituting only last occurence
of "m4/".
Signed-off-by: Giulio Benetti giulio.benetti@benettiengineering.com