|
Packit |
fc043f |
dnl gnupg-misc.m4 - Autoconf macros originally from GnuPG
|
|
Packit |
fc043f |
dnl Copyright (C) 2017 g10 Code GmbH
|
|
Packit |
fc043f |
dnl
|
|
Packit |
fc043f |
dnl This file is free software; as a special exception the author gives
|
|
Packit |
fc043f |
dnl unlimited permission to copy and/or distribute it, with or without
|
|
Packit |
fc043f |
dnl modifications, as long as this notice is preserved.
|
|
Packit |
fc043f |
dnl
|
|
Packit |
fc043f |
dnl This file is distributed in the hope that it will be useful, but
|
|
Packit |
fc043f |
dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
|
Packit |
fc043f |
dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
Packit |
fc043f |
dnl SPDX-License-Identifier: FSFULLR
|
|
Packit |
fc043f |
|
|
Packit |
fc043f |
|
|
Packit |
fc043f |
dnl Define MKDIR_TAKES_ONE_ARG if mkdir accepts only one argument instead
|
|
Packit |
fc043f |
dnl of the usual 2.
|
|
Packit |
fc043f |
AC_DEFUN([GNUPG_FUNC_MKDIR_TAKES_ONE_ARG],
|
|
Packit |
fc043f |
[AC_CHECK_HEADERS(sys/stat.h unistd.h direct.h)
|
|
Packit |
fc043f |
AC_CACHE_CHECK([if mkdir takes one argument], gnupg_cv_mkdir_takes_one_arg,
|
|
Packit |
fc043f |
[AC_TRY_COMPILE([
|
|
Packit |
fc043f |
#include <sys/types.h>
|
|
Packit |
fc043f |
#ifdef HAVE_SYS_STAT_H
|
|
Packit |
fc043f |
# include <sys/stat.h>
|
|
Packit |
fc043f |
#endif
|
|
Packit |
fc043f |
#ifdef HAVE_UNISTD_H
|
|
Packit |
fc043f |
# include <unistd.h>
|
|
Packit |
fc043f |
#endif
|
|
Packit |
fc043f |
#ifdef HAVE_DIRECT_H
|
|
Packit |
fc043f |
# include <direct.h>
|
|
Packit |
fc043f |
#endif], [mkdir ("foo", 0);],
|
|
Packit |
fc043f |
gnupg_cv_mkdir_takes_one_arg=no, gnupg_cv_mkdir_takes_one_arg=yes)])
|
|
Packit |
fc043f |
if test $gnupg_cv_mkdir_takes_one_arg = yes ; then
|
|
Packit |
fc043f |
AC_DEFINE(MKDIR_TAKES_ONE_ARG,1,
|
|
Packit |
fc043f |
[Defined if mkdir() does not take permission flags])
|
|
Packit |
fc043f |
fi
|
|
Packit |
fc043f |
])
|