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
36 # On NextStep and OpenStep, the `mkdir' command does not
37 # recognize any option. It will interpret all options as
38 # directories to create, and then abort because `.' already
42 test -d $d && rmdir $d
44 # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
45 if test -f "$ac_aux_dir/mkinstalldirs"; then
46 mkdir_p='$(mkinstalldirs)'
48 mkdir_p='$(install_sh) -d'