d362b0b9556fca30d47b10c0a213ea037c6ea29b
[platform/upstream/automake.git] / m4 / mkdirp.m4
1 ##                                                          -*- Autoconf -*-
2 # Copyright (C) 2003-2012 Free Software Foundation, Inc.
3 #
4 # This file is free software; the Free Software Foundation
5 # gives unlimited permission to copy and/or distribute it,
6 # with or without modifications, as long as this notice is preserved.
7
8 # serial 3
9
10 # AM_PROG_MKDIR_P
11 # ---------------
12 # Check for 'mkdir -p'.
13 AC_DEFUN([AM_PROG_MKDIR_P],
14 [AC_PREREQ([2.60])dnl
15 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
16 dnl FIXME to be removed in Automake 1.13.
17 AC_DIAGNOSE([obsolete],
18 [$0: this macro is deprecated, and will soon be removed.
19 You should use the Autoconf-provided 'AC][_PROG_MKDIR_P' macro instead,
20 and use '$(MKDIR_P)' instead of '$(mkdir_p)'in your Makefile.am files.])
21 dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
22 dnl while keeping a definition of mkdir_p for backward compatibility.
23 dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
24 dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
25 dnl Makefile.ins that do not define MKDIR_P, so we do our own
26 dnl adjustment using top_builddir (which is defined more often than
27 dnl MKDIR_P).
28 AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
29 case $mkdir_p in
30   [[\\/$]]* | ?:[[\\/]]*) ;;
31   */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
32 esac
33 ])