[PATCH 3/6] make: check for greadlink first, fall back to readlink
Michael Olbrich
m.olbrich at pengutronix.de
Tue Jun 5 04:56:18 EDT 2012
On Mon, Jun 04, 2012 at 10:40:16PM +0200, Dirk Hörner wrote:
> OS X' readlink does not have an -f option.
>
> Signed-off-by: Dirk Hörner <dirker at gmail.com>
> ---
> common/Makefile | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/common/Makefile b/common/Makefile
> index 9c14d7b..48cf715 100644
> --- a/common/Makefile
> +++ b/common/Makefile
> @@ -48,7 +48,9 @@ ifneq ($(CONFIG_DEFAULT_ENVIRONMENT_PATH),"")
> DEFAULT_ENVIRONMENT_PATH += $(CONFIG_DEFAULT_ENVIRONMENT_PATH)
> endif
>
> -ENV_FILES := $(shell cd $(srctree); for i in $(DEFAULT_ENVIRONMENT_PATH); do find $${i} -type f -exec readlink -f '{}' \;; done)
> +READLINK := $(shell command -v greadlink || echo readlink)
> +
> +ENV_FILES := $(shell cd $(srctree); for i in $(DEFAULT_ENVIRONMENT_PATH); do find $${i} -type f -exec $(READLINK) -f '{}' \;; done)
This is already broken. '-type f' only matches regular files. And ENV_FILES
is only used for make dependencies. And make follows links. I think what we
really need here is 'find $${i} ! -type d -print'
Michael
>
> endif # ifdef CONFIG_DEFAULT_ENVIRONMENT
>
> --
> 1.7.10.3
>
>
> _______________________________________________
> barebox mailing list
> barebox at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
More information about the barebox
mailing list