configure: Better check for the broken mkdir on Windows.

This commit is contained in:
Alexandre Julliard 2008-12-22 10:39:11 +01:00
parent e2cb0c82a6
commit 921e6624ad
4 changed files with 73 additions and 8 deletions

61
configure vendored
View File

@ -17785,11 +17785,9 @@ esac
for ac_func in \
_mkdir \
_pclose \
_popen \
_snprintf \
@ -18979,6 +18977,65 @@ esac
fi
{ $as_echo "$as_me:$LINENO: checking whether mkdir takes only one argument" >&5
$as_echo_n "checking whether mkdir takes only one argument... " >&6; }
if test "${wine_cv_one_arg_mkdir+set}" = set; then
$as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/stat.h>
int
main ()
{
mkdir("foo");
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
wine_cv_one_arg_mkdir=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
wine_cv_one_arg_mkdir=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:$LINENO: result: $wine_cv_one_arg_mkdir" >&5
$as_echo "$wine_cv_one_arg_mkdir" >&6; }
if test "$wine_cv_one_arg_mkdir" = "yes"
then
cat >>confdefs.h <<\_ACEOF
#define HAVE_ONE_ARG_MKDIR 1
_ACEOF
fi
{ $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
$as_echo_n "checking for an ANSI C-conforming const... " >&6; }

View File

@ -1354,7 +1354,6 @@ esac
dnl **** Check for functions ****
AC_CHECK_FUNCS(\
_mkdir \
_pclose \
_popen \
_snprintf \
@ -1487,6 +1486,15 @@ fi
WINE_NOTICE_WITH(ldap,[test "x$LDAPLIBS" = "x"],
[libldap (OpenLDAP) ${notice_platform}development files not found, LDAP won't be supported.])
AC_CACHE_CHECK([whether mkdir takes only one argument],
wine_cv_one_arg_mkdir,
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/stat.h>]],[[mkdir("foo");]])],
[wine_cv_one_arg_mkdir=yes],[wine_cv_one_arg_mkdir=no]))
if test "$wine_cv_one_arg_mkdir" = "yes"
then
AC_DEFINE(HAVE_ONE_ARG_MKDIR, 1, [Define if mkdir takes only one argument])
fi
dnl **** Check for types ****
AC_C_CONST

View File

@ -507,6 +507,9 @@
/* Define to 1 if the system has the type `off_t'. */
#undef HAVE_OFF_T
/* Define if mkdir takes only one argument */
#undef HAVE_ONE_ARG_MKDIR
/* Define if OpenGL is present on the system */
#undef HAVE_OPENGL
@ -1002,9 +1005,6 @@
/* Define if Xrender has the XRenderSetPictureTransform function */
#undef HAVE_XRENDERSETPICTURETRANSFORM
/* Define to 1 if you have the `_mkdir' function. */
#undef HAVE__MKDIR
/* Define to 1 if you have the `_pclose' function. */
#undef HAVE__PCLOSE

View File

@ -114,8 +114,8 @@ struct statvfs
#define RTLD_GLOBAL 0x100
#endif
#ifdef HAVE__MKDIR
#define mkdir(path,mode) _mkdir(path)
#ifdef HAVE_ONE_ARG_MKDIR
#define mkdir(path,mode) mkdir(path)
#endif
#if !defined(HAVE_FTRUNCATE) && defined(HAVE_CHSIZE)