[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Changing mkinstalldirs to avoid using mkdir -p
From: |
Alexandre Duret-Lutz |
Subject: |
Re: Changing mkinstalldirs to avoid using mkdir -p |
Date: |
Wed, 11 Feb 2004 10:24:46 +0100 |
User-agent: |
Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) |
Nathanael Nerode <address@hidden> writes:
> +# Solaris 8's mkdir -p isn't thread-safe! If you mkdir -p a/b and
> +# mkdir -p a/c at the same time, both will detect that a is missing,
> +# one will create a, then the other will try to create a and die with
> +# a "File exists" error. So we have to disable this code on Solaris 8.
> +#
> +#case $dirmode in
> +# '')
> +# if mkdir -p -- . 2>/dev/null; then
> +# echo "mkdir -p -- $*"
> +# exec mkdir -p -- "$@"
> +# fi
> +# ;;
> +# *)
> +# if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
> +# echo "mkdir -m $dirmode -p -- $*"
> +# exec mkdir -m "$dirmode" -p -- "$@"
> +# fi
> +# ;;
> +#esac
Does anybody see a way to disable this only when needed?
An idea would be to skip this code if
1. " -$MAKEFLAGS" matches `" "-[BdeikrRsSw]*j' or `" "---?jobs'
and
2. `mkdir -p --help' doesn't work.
That way we would always GNU's mkdir -p, and we would ignore
other mkdir -p implementations only in parallel builds.
Unfortunately, the problem is not only in mkinstalldirs, it is
also in AM_PROG_MKDIR_P, and we cannot check $MAKEFLAGS there.
I presume we will end up setting `mkdir_p = mkdir -p' only if
mkdir supports --help. I find this quite frustrating.
If you consider a system such as Solaris 8, whose make does not
support parallel builds, there is no reason not to use `mkdir
-p'. The problem only exist when users mix tools, doesn't it?
It's a bit of a shame, we have to disable `mkdir -p' everywhere
because of such setups.
Other ideas?
--
Alexandre Duret-Lutz