Module: wine Branch: master Commit: 921e6624ad63a026b27753c3ae06f931c6d65eba URL: http://source.winehq.org/git/wine.git/?a=commit;h=921e6624ad63a026b27753c3ae...
Author: Alexandre Julliard julliard@winehq.org Date: Mon Dec 22 10:39:11 2008 +0100
configure: Better check for the broken mkdir on Windows.
---
configure | 61 +++++++++++++++++++++++++++++++++++++++++++++++++- configure.ac | 10 +++++++- include/config.h.in | 6 ++-- include/wine/port.h | 4 +- 4 files changed, 73 insertions(+), 8 deletions(-)
diff --git a/configure b/configure index e1ce1cf..710a174 100755 --- a/configure +++ b/configure @@ -17787,9 +17787,7 @@ 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; } diff --git a/configure.ac b/configure.ac index 4bf1ec3..c22b4eb 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/include/config.h.in b/include/config.h.in index 330564e..ec24fe2 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -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
diff --git a/include/wine/port.h b/include/wine/port.h index fd37698..6e1e454 100644 --- a/include/wine/port.h +++ b/include/wine/port.h @@ -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)