Re: [PATCH 13x, 14x] configure tests for mkdir

2004-12-16 Thread Jean-Marc Lasgouttes
 Angus == Angus Leeming [EMAIL PROTECTED] writes:

Angus It turned out that this solution was incorrect. Compilation
Angus failed on the Windows machine because the definition of a mkdir
Angus macro in config.h conflicted with another mkdir macro defined
Angus in mingw/include/os.h.

Angus I have therefore removed these nasty macros and placed the
Angus #ifdef HAVE_MKDIR conditional block inside the support/mkdir.C
Angus routine. Much more robust.

That is much much better anyway.

JMarc


Re: [PATCH 13x, 14x] configure tests for mkdir

2004-12-16 Thread Jean-Marc Lasgouttes
> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:

Angus> It turned out that this solution was incorrect. Compilation
Angus> failed on the Windows machine because the definition of a mkdir
Angus> macro in config.h conflicted with another mkdir macro defined
Angus> in mingw/include/os.h.

Angus> I have therefore removed these nasty macros and placed the
Angus> #ifdef HAVE_MKDIR conditional block inside the support/mkdir.C
Angus> routine. Much more robust.

That is much much better anyway.

JMarc


[PATCH 13x, 14x] configure tests for mkdir

2004-12-15 Thread Angus Leeming
Just a cut and paste job from the web page JMarc pointed me to.

-- 
AngusIndex: config/ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/ChangeLog,v
retrieving revision 1.86.2.29
diff -u -p -r1.86.2.29 ChangeLog
--- config/ChangeLog	7 Dec 2004 09:47:30 -	1.86.2.29
+++ config/ChangeLog	15 Dec 2004 15:43:02 -
@@ -1,3 +1,10 @@
+2003-12-15  Angus Leeming  [EMAIL PROTECTED]
+
+	* lyxinclude.m4: define AC_FUNC_MKDIR.
+
+	* configure.ac: add AC_FUNC_MKDIR test and code to
+	#define mkdir should a non-POSIX version be found.
+
 2004-12-06  Jean-Marc Lasgouttes  [EMAIL PROTECTED]
 
 	* *.m4: quote the name of the macro in AC_DEFUN
Index: config/configure.ac
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/Attic/configure.ac,v
retrieving revision 1.24.2.23
diff -u -p -r1.24.2.23 configure.ac
--- config/configure.ac	6 Oct 2004 15:03:39 -	1.24.2.23
+++ config/configure.ac	15 Dec 2004 15:43:02 -
@@ -248,6 +248,9 @@ LYX_CHECK_DECL(vsnprintf, stdio.h)
 LYX_CHECK_DECL(istreambuf_iterator, iterator)
 LYX_CHECK_DECL(mkstemp,[unistd.h stdlib.h])
 
+# Check the form of mkdir()
+AC_FUNC_MKDIR
+
 dnl This is a slight hack: the tests generated by autoconf 2.52 do not
 dnl work correctly because of some conflict with stdlib.h with g++ 2.96
 dnl We aim to remove this eventually, since we should test as much as
@@ -335,6 +338,20 @@ extern C
 #endif
 int mkstemp(char*);
 #endif
+#endif
+
+#if HAVE_MKDIR
+#  if MKDIR_TAKES_ONE_ARG
+ /* MinGW32 */
+#define mkdir(a, b) mkdir(a)
+#  endif
+#else
+#  if HAVE__MKDIR
+ /* plain Windows 32 */
+#define mkdir(a, b) _mkdir(a)
+#  else
+#error Don't know how to create a directory on this system.
+#  endif
 #endif
 
 #ifdef __EMX__
Index: config/lyxinclude.m4
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/lyxinclude.m4,v
retrieving revision 1.81.2.2
diff -u -p -r1.81.2.2 lyxinclude.m4
--- config/lyxinclude.m4	7 Dec 2004 09:47:30 -	1.81.2.2
+++ config/lyxinclude.m4	15 Dec 2004 15:43:03 -
@@ -693,3 +693,27 @@ AM_PROG_LIBTOOL dnl for libraries
 CC=$ac_save_cc
 CFLAGS=$ac_save_cflags
 ])
+
+## 
+## Check whether mkdir() is mkdir or _mkdir, and whether it takes
+## one or two arguments.
+##
+## http://ac-archive.sourceforge.net/C_Support/ac_func_mkdir.html
+## 
+##
+AC_DEFUN([AC_FUNC_MKDIR],
+[AC_CHECK_FUNCS([mkdir _mkdir])
+AC_CACHE_CHECK([whether mkdir takes one argument],
+   [ac_cv_mkdir_takes_one_arg],
+[AC_TRY_COMPILE([
+#include sys/stat.h
+#if HAVE_UNISTD_H
+#  include unistd.h
+#endif
+], [mkdir (.);],
+[ac_cv_mkdir_takes_one_arg=yes], [ac_cv_mkdir_takes_one_arg=no])])
+if test x$ac_cv_mkdir_takes_one_arg = xyes; then
+  AC_DEFINE([MKDIR_TAKES_ONE_ARG], 1,
+[Define if mkdir takes only one argument.])
+fi
+])
Index: ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/ChangeLog,v
retrieving revision 1.984
diff -u -p -r1.984 ChangeLog
--- ChangeLog	4 Dec 2004 14:50:21 -	1.984
+++ ChangeLog	15 Dec 2004 16:04:46 -
@@ -1,3 +1,8 @@
+2004-12-15  Angus Leeming  [EMAIL PROTECTED]
+
+	* configure.ac: add AC_FUNC_MKDIR test and code to
+	#define mkdir should a non-POSIX version be found.
+
 2004-12-04  Lars Gullik Bjonnes  [EMAIL PROTECTED]
 
 	* Most Makefile.am's: Move PCH_FLAGS to AM_CPP flags where
Index: configure.ac
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/configure.ac,v
retrieving revision 1.30
diff -u -p -r1.30 configure.ac
--- configure.ac	30 Nov 2004 09:21:10 -	1.30
+++ configure.ac	15 Dec 2004 16:04:46 -
@@ -266,6 +266,9 @@ AC_CHECK_FUNCS(strerror)
 LYX_CHECK_DECL(istreambuf_iterator, iterator)
 LYX_CHECK_DECL(mkstemp,[unistd.h stdlib.h])
 
+# Check the form of mkdir()
+AC_FUNC_MKDIR
+
 AC_ARG_ENABLE(compression-support, AC_HELP_STRING([--enable-compression-support],[Support for compressed files.]),[
 case ${enableval} in
 	yes) use_compression=true ;;
@@ -352,6 +355,20 @@ extern C
 #endif
 int mkstemp(char*);
 #endif
+#endif
+
+#if HAVE_MKDIR
+#  if MKDIR_TAKES_ONE_ARG
+ /* MinGW32 */
+#define mkdir(a, b) mkdir(a)
+#  endif
+#else
+#  if HAVE__MKDIR
+ /* plain Windows 32 */
+#define mkdir(a, b) _mkdir(a)
+#  else
+#error Don't know how to create a directory on this system.
+#  endif
 #endif
 
 #ifdef __EMX__
Index: config/ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/ChangeLog,v
retrieving revision 1.147
diff -u -p -r1.147 ChangeLog
--- config/ChangeLog	5 Dec 2004 17:10:56 -	1.147
+++ config/ChangeLog	15 Dec 

Re: [PATCH 13x, 14x] configure tests for mkdir

2004-12-15 Thread Angus Leeming
Angus Leeming wrote:
 Just a cut and paste job from the web page JMarc pointed me to.
Committed.
-- 
Angus


Re: [PATCH 13x, 14x] configure tests for mkdir

2004-12-15 Thread Angus Leeming
Angus Leeming wrote:

 Angus Leeming wrote:
 Just a cut and paste job from the web page JMarc pointed me to.
 Committed.

It turned out that this solution was incorrect. Compilation failed on the
Windows machine because the definition of a mkdir macro in config.h
conflicted with another mkdir macro defined in mingw/include/os.h.

I have therefore removed these nasty macros and placed the
#ifdef HAVE_MKDIR conditional block inside the support/mkdir.C routine.
Much more robust.

I'm going to commit this now so you all have to rebuild your trees only
once...

-- 
AngusIndex: config/ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/ChangeLog,v
retrieving revision 1.86.2.30
diff -u -p -r1.86.2.30 ChangeLog
--- config/ChangeLog	15 Dec 2004 21:03:56 -	1.86.2.30
+++ config/ChangeLog	16 Dec 2004 00:54:32 -
@@ -1,4 +1,9 @@
-2003-12-15  Angus Leeming  [EMAIL PROTECTED]
+2004-12-16  Angus Leeming  [EMAIL PROTECTED]
+
+	* configure.ac: remove the HAVE_MKDIR conditional code to
+	src/support/mkdir.C
+
+2003-12-15  Angus Leeming  [EMAIL PROTECTED]
 
 	* lyxinclude.m4: define AC_FUNC_MKDIR.
 
Index: config/configure.ac
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/Attic/configure.ac,v
retrieving revision 1.24.2.24
diff -u -p -r1.24.2.24 configure.ac
--- config/configure.ac	15 Dec 2004 21:03:56 -	1.24.2.24
+++ config/configure.ac	16 Dec 2004 00:54:32 -
@@ -340,20 +340,6 @@ int mkstemp(char*);
 #endif
 #endif
 
-#if HAVE_MKDIR
-#  if MKDIR_TAKES_ONE_ARG
- /* MinGW32 */
-#define mkdir(a, b) mkdir(a)
-#  endif
-#else
-#  if HAVE__MKDIR
- /* plain Windows 32 */
-#define mkdir(a, b) _mkdir(a)
-#  else
-#error Don't know how to create a directory on this system.
-#  endif
-#endif
-
 #ifdef __EMX__
 #include support/os2_defines.h
 #endif
Index: src/support/ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/ChangeLog,v
retrieving revision 1.149.2.17
diff -u -p -r1.149.2.17 ChangeLog
--- src/support/ChangeLog	15 Dec 2004 21:40:03 -	1.149.2.17
+++ src/support/ChangeLog	16 Dec 2004 00:54:38 -
@@ -1,3 +1,8 @@
+2004-12-16  Angus Leeming  [EMAIL PROTECTED]
+
+	* mkdir.C: move the HAVE_MKDIR conditional code out of config.h
+	and into here.
+
 2004-12-15  Angus Leeming  [EMAIL PROTECTED]
 
 	* FileInfo.[Ch] (getNumberOfLinks): removed.
Index: src/support/mkdir.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/mkdir.C,v
retrieving revision 1.7
diff -u -p -r1.7 mkdir.C
--- src/support/mkdir.C	1 Dec 2002 22:59:25 -	1.7
+++ src/support/mkdir.C	16 Dec 2004 00:54:38 -
@@ -12,5 +12,21 @@
 int lyx::mkdir(string const  pathname, unsigned long int mode)
 {
 	// FIXME: why don't we have mode_t in lyx::mkdir prototype ??
+
+#if HAVE_MKDIR
+# if MKDIR_TAKES_ONE_ARG
+	// MinGW32
+	return ::mkdir(pathname.c_str());
+# else
+	// POSIX
 	return ::mkdir(pathname.c_str(), mode_t(mode));
+# endif
+#else
+# if HAVE__MKDIR
+	// plain Windows 32
+	return ::_mkdir(pathname.c_str());
+# else
+#  error Don't know how to create a directory on this system.
+# endif
+#endif
 }
Index: ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/ChangeLog,v
retrieving revision 1.985
diff -u -p -r1.985 ChangeLog
--- ChangeLog	15 Dec 2004 21:04:02 -	1.985
+++ ChangeLog	16 Dec 2004 00:54:56 -
@@ -1,3 +1,8 @@
+2004-12-16  Angus Leeming  [EMAIL PROTECTED]
+
+	* configure.ac: remove the HAVE_MKDIR conditional code to
+	src/support/mkdir.C
+
 2004-12-15  Angus Leeming  [EMAIL PROTECTED]
 
 	* configure.ac: add AC_FUNC_MKDIR test and code to
Index: configure.ac
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/configure.ac,v
retrieving revision 1.31
diff -u -p -r1.31 configure.ac
--- configure.ac	15 Dec 2004 21:04:03 -	1.31
+++ configure.ac	16 Dec 2004 00:54:57 -
@@ -357,20 +357,6 @@ int mkstemp(char*);
 #endif
 #endif
 
-#if HAVE_MKDIR
-#  if MKDIR_TAKES_ONE_ARG
- /* MinGW32 */
-#define mkdir(a, b) mkdir(a)
-#  endif
-#else
-#  if HAVE__MKDIR
- /* plain Windows 32 */
-#define mkdir(a, b) _mkdir(a)
-#  else
-#error Don't know how to create a directory on this system.
-#  endif
-#endif
-
 #ifdef __EMX__
 #include support/os2_defines.h
 #endif
Index: src/support/ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/ChangeLog,v
retrieving revision 1.286
diff -u -p -r1.286 ChangeLog
--- src/support/ChangeLog	15 Dec 2004 21:40:11 -	1.286
+++ src/support/ChangeLog	16 Dec 2004 00:55:09 -
@@ -1,3 +1,8 @@
+2004-12-16  Angus Leeming  [EMAIL PROTECTED]
+
+	* mkdir.C: move the HAVE_MKDIR 

[PATCH 13x, 14x] configure tests for mkdir

2004-12-15 Thread Angus Leeming
Just a cut and paste job from the web page JMarc pointed me to.

-- 
AngusIndex: config/ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/ChangeLog,v
retrieving revision 1.86.2.29
diff -u -p -r1.86.2.29 ChangeLog
--- config/ChangeLog	7 Dec 2004 09:47:30 -	1.86.2.29
+++ config/ChangeLog	15 Dec 2004 15:43:02 -
@@ -1,3 +1,10 @@
+2003-12-15  Angus Leeming  <[EMAIL PROTECTED]>
+
+	* lyxinclude.m4: define AC_FUNC_MKDIR.
+
+	* configure.ac: add AC_FUNC_MKDIR test and code to
+	#define mkdir should a non-POSIX version be found.
+
 2004-12-06  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
 	* *.m4: quote the name of the macro in AC_DEFUN
Index: config/configure.ac
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/Attic/configure.ac,v
retrieving revision 1.24.2.23
diff -u -p -r1.24.2.23 configure.ac
--- config/configure.ac	6 Oct 2004 15:03:39 -	1.24.2.23
+++ config/configure.ac	15 Dec 2004 15:43:02 -
@@ -248,6 +248,9 @@ LYX_CHECK_DECL(vsnprintf, stdio.h)
 LYX_CHECK_DECL(istreambuf_iterator, iterator)
 LYX_CHECK_DECL(mkstemp,[unistd.h stdlib.h])
 
+# Check the form of mkdir()
+AC_FUNC_MKDIR
+
 dnl This is a slight hack: the tests generated by autoconf 2.52 do not
 dnl work correctly because of some conflict with stdlib.h with g++ 2.96
 dnl We aim to remove this eventually, since we should test as much as
@@ -335,6 +338,20 @@ extern "C"
 #endif
 int mkstemp(char*);
 #endif
+#endif
+
+#if HAVE_MKDIR
+#  if MKDIR_TAKES_ONE_ARG
+ /* MinGW32 */
+#define mkdir(a, b) mkdir(a)
+#  endif
+#else
+#  if HAVE__MKDIR
+ /* plain Windows 32 */
+#define mkdir(a, b) _mkdir(a)
+#  else
+#error "Don't know how to create a directory on this system."
+#  endif
 #endif
 
 #ifdef __EMX__
Index: config/lyxinclude.m4
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/lyxinclude.m4,v
retrieving revision 1.81.2.2
diff -u -p -r1.81.2.2 lyxinclude.m4
--- config/lyxinclude.m4	7 Dec 2004 09:47:30 -	1.81.2.2
+++ config/lyxinclude.m4	15 Dec 2004 15:43:03 -
@@ -693,3 +693,27 @@ AM_PROG_LIBTOOL dnl for libraries
 CC=$ac_save_cc
 CFLAGS="$ac_save_cflags"
 ])
+
+## 
+## Check whether mkdir() is mkdir or _mkdir, and whether it takes
+## one or two arguments.
+##
+## http://ac-archive.sourceforge.net/C_Support/ac_func_mkdir.html
+## 
+##
+AC_DEFUN([AC_FUNC_MKDIR],
+[AC_CHECK_FUNCS([mkdir _mkdir])
+AC_CACHE_CHECK([whether mkdir takes one argument],
+   [ac_cv_mkdir_takes_one_arg],
+[AC_TRY_COMPILE([
+#include 
+#if HAVE_UNISTD_H
+#  include 
+#endif
+], [mkdir (".");],
+[ac_cv_mkdir_takes_one_arg=yes], [ac_cv_mkdir_takes_one_arg=no])])
+if test x"$ac_cv_mkdir_takes_one_arg" = xyes; then
+  AC_DEFINE([MKDIR_TAKES_ONE_ARG], 1,
+[Define if mkdir takes only one argument.])
+fi
+])
Index: ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/ChangeLog,v
retrieving revision 1.984
diff -u -p -r1.984 ChangeLog
--- ChangeLog	4 Dec 2004 14:50:21 -	1.984
+++ ChangeLog	15 Dec 2004 16:04:46 -
@@ -1,3 +1,8 @@
+2004-12-15  Angus Leeming  <[EMAIL PROTECTED]>
+
+	* configure.ac: add AC_FUNC_MKDIR test and code to
+	#define mkdir should a non-POSIX version be found.
+
 2004-12-04  Lars Gullik Bjonnes  <[EMAIL PROTECTED]>
 
 	* Most Makefile.am's: Move PCH_FLAGS to AM_CPP flags where
Index: configure.ac
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/configure.ac,v
retrieving revision 1.30
diff -u -p -r1.30 configure.ac
--- configure.ac	30 Nov 2004 09:21:10 -	1.30
+++ configure.ac	15 Dec 2004 16:04:46 -
@@ -266,6 +266,9 @@ AC_CHECK_FUNCS(strerror)
 LYX_CHECK_DECL(istreambuf_iterator, iterator)
 LYX_CHECK_DECL(mkstemp,[unistd.h stdlib.h])
 
+# Check the form of mkdir()
+AC_FUNC_MKDIR
+
 AC_ARG_ENABLE(compression-support, AC_HELP_STRING([--enable-compression-support],[Support for compressed files.]),[
 case "${enableval}" in
 	yes) use_compression=true ;;
@@ -352,6 +355,20 @@ extern "C"
 #endif
 int mkstemp(char*);
 #endif
+#endif
+
+#if HAVE_MKDIR
+#  if MKDIR_TAKES_ONE_ARG
+ /* MinGW32 */
+#define mkdir(a, b) mkdir(a)
+#  endif
+#else
+#  if HAVE__MKDIR
+ /* plain Windows 32 */
+#define mkdir(a, b) _mkdir(a)
+#  else
+#error "Don't know how to create a directory on this system."
+#  endif
 #endif
 
 #ifdef __EMX__
Index: config/ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/ChangeLog,v
retrieving revision 1.147
diff -u -p -r1.147 ChangeLog
--- config/ChangeLog	5 Dec 2004 17:10:56 -	1.147
+++ config/ChangeLog	

Re: [PATCH 13x, 14x] configure tests for mkdir

2004-12-15 Thread Angus Leeming
Angus Leeming wrote:
> Just a cut and paste job from the web page JMarc pointed me to.
Committed.
-- 
Angus


Re: [PATCH 13x, 14x] configure tests for mkdir

2004-12-15 Thread Angus Leeming
Angus Leeming wrote:

> Angus Leeming wrote:
>> Just a cut and paste job from the web page JMarc pointed me to.
> Committed.

It turned out that this solution was incorrect. Compilation failed on the
Windows machine because the definition of a mkdir macro in config.h
conflicted with another mkdir macro defined in mingw/include/os.h.

I have therefore removed these nasty macros and placed the
#ifdef HAVE_MKDIR conditional block inside the support/mkdir.C routine.
Much more robust.

I'm going to commit this now so you all have to rebuild your trees only
once...

-- 
AngusIndex: config/ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/ChangeLog,v
retrieving revision 1.86.2.30
diff -u -p -r1.86.2.30 ChangeLog
--- config/ChangeLog	15 Dec 2004 21:03:56 -	1.86.2.30
+++ config/ChangeLog	16 Dec 2004 00:54:32 -
@@ -1,4 +1,9 @@
-2003-12-15  Angus Leeming  <[EMAIL PROTECTED]>
+2004-12-16  Angus Leeming  <[EMAIL PROTECTED]>
+
+	* configure.ac: remove the HAVE_MKDIR conditional code to
+	src/support/mkdir.C
+
+2003-12-15  Angus Leeming  <[EMAIL PROTECTED]>
 
 	* lyxinclude.m4: define AC_FUNC_MKDIR.
 
Index: config/configure.ac
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/Attic/configure.ac,v
retrieving revision 1.24.2.24
diff -u -p -r1.24.2.24 configure.ac
--- config/configure.ac	15 Dec 2004 21:03:56 -	1.24.2.24
+++ config/configure.ac	16 Dec 2004 00:54:32 -
@@ -340,20 +340,6 @@ int mkstemp(char*);
 #endif
 #endif
 
-#if HAVE_MKDIR
-#  if MKDIR_TAKES_ONE_ARG
- /* MinGW32 */
-#define mkdir(a, b) mkdir(a)
-#  endif
-#else
-#  if HAVE__MKDIR
- /* plain Windows 32 */
-#define mkdir(a, b) _mkdir(a)
-#  else
-#error "Don't know how to create a directory on this system."
-#  endif
-#endif
-
 #ifdef __EMX__
 #include "support/os2_defines.h"
 #endif
Index: src/support/ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/ChangeLog,v
retrieving revision 1.149.2.17
diff -u -p -r1.149.2.17 ChangeLog
--- src/support/ChangeLog	15 Dec 2004 21:40:03 -	1.149.2.17
+++ src/support/ChangeLog	16 Dec 2004 00:54:38 -
@@ -1,3 +1,8 @@
+2004-12-16  Angus Leeming  <[EMAIL PROTECTED]>
+
+	* mkdir.C: move the HAVE_MKDIR conditional code out of config.h
+	and into here.
+
 2004-12-15  Angus Leeming  <[EMAIL PROTECTED]>
 
 	* FileInfo.[Ch] (getNumberOfLinks): removed.
Index: src/support/mkdir.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/mkdir.C,v
retrieving revision 1.7
diff -u -p -r1.7 mkdir.C
--- src/support/mkdir.C	1 Dec 2002 22:59:25 -	1.7
+++ src/support/mkdir.C	16 Dec 2004 00:54:38 -
@@ -12,5 +12,21 @@
 int lyx::mkdir(string const & pathname, unsigned long int mode)
 {
 	// FIXME: why don't we have mode_t in lyx::mkdir prototype ??
+
+#if HAVE_MKDIR
+# if MKDIR_TAKES_ONE_ARG
+	// MinGW32
+	return ::mkdir(pathname.c_str());
+# else
+	// POSIX
 	return ::mkdir(pathname.c_str(), mode_t(mode));
+# endif
+#else
+# if HAVE__MKDIR
+	// plain Windows 32
+	return ::_mkdir(pathname.c_str());
+# else
+#  error "Don't know how to create a directory on this system."
+# endif
+#endif
 }
Index: ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/ChangeLog,v
retrieving revision 1.985
diff -u -p -r1.985 ChangeLog
--- ChangeLog	15 Dec 2004 21:04:02 -	1.985
+++ ChangeLog	16 Dec 2004 00:54:56 -
@@ -1,3 +1,8 @@
+2004-12-16  Angus Leeming  <[EMAIL PROTECTED]>
+
+	* configure.ac: remove the HAVE_MKDIR conditional code to
+	src/support/mkdir.C
+
 2004-12-15  Angus Leeming  <[EMAIL PROTECTED]>
 
 	* configure.ac: add AC_FUNC_MKDIR test and code to
Index: configure.ac
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/configure.ac,v
retrieving revision 1.31
diff -u -p -r1.31 configure.ac
--- configure.ac	15 Dec 2004 21:04:03 -	1.31
+++ configure.ac	16 Dec 2004 00:54:57 -
@@ -357,20 +357,6 @@ int mkstemp(char*);
 #endif
 #endif
 
-#if HAVE_MKDIR
-#  if MKDIR_TAKES_ONE_ARG
- /* MinGW32 */
-#define mkdir(a, b) mkdir(a)
-#  endif
-#else
-#  if HAVE__MKDIR
- /* plain Windows 32 */
-#define mkdir(a, b) _mkdir(a)
-#  else
-#error "Don't know how to create a directory on this system."
-#  endif
-#endif
-
 #ifdef __EMX__
 #include "support/os2_defines.h"
 #endif
Index: src/support/ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/ChangeLog,v
retrieving revision 1.286
diff -u -p -r1.286 ChangeLog
--- src/support/ChangeLog	15 Dec 2004 21:40:11 -	1.286
+++ src/support/ChangeLog	16 Dec 2004 00:55:09 -
@@ -1,3 +1,8 @@
+2004-12-16  Angus Leeming  <[EMAIL PROTECTED]>
+
+	*