3 # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
5 # Copyright (C) 2003, 2004 Free Software Foundation, Inc.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22 # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
23 # created by `make install' are always world readable, even if the
24 # installer happens to have an overly restrictive umask (e.g. 077).
25 # This was a mistake. There are at least two reasons why we must not
27 # - it causes special bits like SGID to be ignored,
28 # - it may be too restrictive (some setups expect 775 directories).
30 # Do not use -m 0755 and let people choose whatever they expect by
32 AC_DEFUN([AM_PROG_MKDIR_P],
33 [if mkdir -p -- . 2>/dev/null; then
34 # Keeping the `.' argument allows $(mkdir_p) to be used without
35 # argument. Indeed, we sometimes output rules like
36 # $(mkdir_p) $(somedir)
37 # where $(somedir) is conditionally defined.
38 # (`test -n '$(somedir)' && $(mkdir_p) $(somedir)' is a more
39 # expensive solution, as it forces Make to start a sub-shell.)
40 mkdir_p='mkdir -p -- .'
42 # On NextStep and OpenStep, the `mkdir' command does not
43 # recognize any option. It will interpret all options as
44 # directories to create, and then abort because `.' already
48 test -d $d && rmdir $d
50 # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
51 if test -f "$ac_aux_dir/mkinstalldirs"; then
52 mkdir_p='$(mkinstalldirs)'
54 mkdir_p='$(install_sh) -d'