| 1 |
dnl gnupg-misc.m4 - Autoconf macros originally from GnuPG |
| 2 |
dnl Copyright (C) 2017 g10 Code GmbH |
| 3 |
dnl |
| 4 |
dnl This file is free software; as a special exception the author gives |
| 5 |
dnl unlimited permission to copy and/or distribute it, with or without |
| 6 |
dnl modifications, as long as this notice is preserved. |
| 7 |
dnl |
| 8 |
dnl This file is distributed in the hope that it will be useful, but |
| 9 |
dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the |
| 10 |
dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 11 |
dnl SPDX-License-Identifier: FSFULLR |
| 12 |
|
| 13 |
|
| 14 |
dnl Define MKDIR_TAKES_ONE_ARG if mkdir accepts only one argument instead |
| 15 |
dnl of the usual 2. |
| 16 |
AC_DEFUN([GNUPG_FUNC_MKDIR_TAKES_ONE_ARG], |
| 17 |
[AC_CHECK_HEADERS(sys/stat.h unistd.h direct.h) |
| 18 |
AC_CACHE_CHECK([if mkdir takes one argument], gnupg_cv_mkdir_takes_one_arg, |
| 19 |
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 20 |
#include <sys/types.h> |
| 21 |
#ifdef HAVE_SYS_STAT_H |
| 22 |
# include <sys/stat.h> |
| 23 |
#endif |
| 24 |
#ifdef HAVE_UNISTD_H |
| 25 |
# include <unistd.h> |
| 26 |
#endif |
| 27 |
#ifdef HAVE_DIRECT_H |
| 28 |
# include <direct.h> |
| 29 |
#endif]], [[mkdir ("foo", 0);]])], |
| 30 |
gnupg_cv_mkdir_takes_one_arg=no, gnupg_cv_mkdir_takes_one_arg=yes)]) |
| 31 |
if test $gnupg_cv_mkdir_takes_one_arg = yes ; then |
| 32 |
AC_DEFINE(MKDIR_TAKES_ONE_ARG,1, |
| 33 |
[Defined if mkdir() does not take permission flags]) |
| 34 |
fi |
| 35 |
]) |