Edit

kc3-lang/automake/m4/mkdirp.m4

Branch :

  • Show log

    Commit

  • Author : Alexandre Duret-Lutz
    Date : 2004-01-08 23:32:11
    Hash : 7dd9fee1
    Message : * m4/mkdirp.m4 (AM_PROG_MKDIR_P): Append `.' to $(mkdir_p). * lib/install-sh: Accept `install-sh -d' with 0..n arguments, as well as `install-sh sources... dest' with multiple sources. * tests/cond33.test: New file. * tests/instsh2.test: Add more checks for install-sh. * tests/transform.test: Test for installdirs. * tests/Makefile.am (TESTS): Add cond33.test Report from Ralf Corsepius.

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