Merge branch 'test-repeated-options-portability-fix'
[platform/upstream/automake.git] / m4 / mkdirp.m4
1 ##                                                          -*- Autoconf -*-
2 # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
3 # Inc.
4 #
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # serial 1
10
11 # AM_PROG_MKDIR_P
12 # ---------------
13 # Check for `mkdir -p'.
14 AC_DEFUN([AM_PROG_MKDIR_P],
15 [AC_PREREQ([2.60])dnl
16 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
17 dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
18 dnl while keeping a definition of mkdir_p for backward compatibility.
19 dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
20 dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
21 dnl Makefile.ins that do not define MKDIR_P, so we do our own
22 dnl adjustment using top_builddir (which is defined more often than
23 dnl MKDIR_P).
24 AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
25 case $mkdir_p in
26   [[\\/$]]* | ?:[[\\/]]*) ;;
27   */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
28 esac
29 ])