|
Lines 10011-10013
Link Here
|
| 10011 |
]) |
10011 |
]) |
| 10012 |
|
10012 |
|
| 10013 |
|
10013 |
|
|
|
10014 |
# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. |
| 10015 |
# |
| 10016 |
# This file is free software; the Free Software Foundation |
| 10017 |
# gives unlimited permission to copy and/or distribute it, |
| 10018 |
# with or without modifications, as long as this notice is preserved. |
| 10019 |
|
| 10020 |
# AM_PROG_MKDIR_P |
| 10021 |
# --------------- |
| 10022 |
# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. |
| 10023 |
# |
| 10024 |
# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories |
| 10025 |
# created by `make install' are always world readable, even if the |
| 10026 |
# installer happens to have an overly restrictive umask (e.g. 077). |
| 10027 |
# This was a mistake. There are at least two reasons why we must not |
| 10028 |
# use `-m 0755': |
| 10029 |
# - it causes special bits like SGID to be ignored, |
| 10030 |
# - it may be too restrictive (some setups expect 775 directories). |
| 10031 |
# |
| 10032 |
# Do not use -m 0755 and let people choose whatever they expect by |
| 10033 |
# setting umask. |
| 10034 |
# |
| 10035 |
# We cannot accept any implementation of `mkdir' that recognizes `-p'. |
| 10036 |
# Some implementations (such as Solaris 8's) are not thread-safe: if a |
| 10037 |
# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' |
| 10038 |
# concurrently, both version can detect that a/ is missing, but only |
| 10039 |
# one can create it and the other will error out. Consequently we |
| 10040 |
# restrict ourselves to GNU make (using the --version option ensures |
| 10041 |
# this.) |
| 10042 |
AC_DEFUN([AM_PROG_MKDIR_P], |
| 10043 |
[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then |
| 10044 |
# We used to keeping the `.' as first argument, in order to |
| 10045 |
# allow $(mkdir_p) to be used without argument. As in |
| 10046 |
# $(mkdir_p) $(somedir) |
| 10047 |
# where $(somedir) is conditionally defined. However this is wrong |
| 10048 |
# for two reasons: |
| 10049 |
# 1. if the package is installed by a user who cannot write `.' |
| 10050 |
# make install will fail, |
| 10051 |
# 2. the above comment should most certainly read |
| 10052 |
# $(mkdir_p) $(DESTDIR)$(somedir) |
| 10053 |
# so it does not work when $(somedir) is undefined and |
| 10054 |
# $(DESTDIR) is not. |
| 10055 |
# To support the latter case, we have to write |
| 10056 |
# test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), |
| 10057 |
# so the `.' trick is pointless. |
| 10058 |
mkdir_p='mkdir -p --' |
| 10059 |
else |
| 10060 |
# On NextStep and OpenStep, the `mkdir' command does not |
| 10061 |
# recognize any option. It will interpret all options as |
| 10062 |
# directories to create, and then abort because `.' already |
| 10063 |
# exists. |
| 10064 |
for d in ./-p ./--version; |
| 10065 |
do |
| 10066 |
test -d $d && rmdir $d |
| 10067 |
done |
| 10068 |
# $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. |
| 10069 |
if test -f "$ac_aux_dir/mkinstalldirs"; then |
| 10070 |
mkdir_p='$(mkinstalldirs)' |
| 10071 |
else |
| 10072 |
mkdir_p='$(install_sh) -d' |
| 10073 |
fi |
| 10074 |
fi |
| 10075 |
AC_SUBST([mkdir_p])]) |