octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MINGW build


From: Mumit Khan
Subject: Re: MINGW build
Date: Wed, 25 Sep 2002 10:42:15 -0500 (CDT)

On Mon, 23 Sep 2002, Paul Kienzle wrote:

> >
> > > liboctave/file-ops.cc:
> > >
> > >    ::mkdir doesn't accept a mode argument
> > >
> > > => proper fix is to check in ./configure if mkdir accepts a mode argument
> > > I hacked around it rather than fix ./configure.
> >
> > I added a test to GCC's configure for this way back, which should be
> > sufficient for Octave. It's trivial -- I'll work up a patch.
>

Paul,

Could you check if the following does the right thing? I'm quite tied up
till next week, so won't get to the rest till later.

Configury for hosts such as ix86-mingw32 where mkdir takes a single argument.
Need to run autogen.sh after patching.

2002-09-25  Mumit Khan  <address@hidden>

        * aclocal.m4 (OCTAVE_MKDIR_TAKES_ONE_ARG): New macro to determine if
        host mkdir accepts only one arg instead of the usual two.
        * configure.in: Use. Check for direct.h.
        (mkdir): Define.

Index: aclocal.m4
===================================================================
RCS file: /cvs/octave/aclocal.m4,v
retrieving revision 1.63
diff -u -3 -p -r1.63 aclocal.m4
--- aclocal.m4  2002/07/02 23:46:48     1.63
+++ aclocal.m4  2002/09/25 15:35:37
@@ -643,4 +643,24 @@ EOF
   AC_MSG_RESULT($octave_cv_cxx_abi)
   AC_DEFINE_UNQUOTED(CXX_ABI, $octave_cv_cxx_abi, [Define to the C++ ABI your 
compiler uses.])
 ])
-
+dnl
+dnl Determine if mkdir accepts only one argument instead dnl of the usual 2.
+dnl
+AC_DEFUN(OCTAVE_MKDIR_TAKES_ONE_ARG,
+[AC_CACHE_CHECK([if mkdir takes one argument], octave_cv_mkdir_takes_one_arg,
+[AC_TRY_COMPILE([
+#include <sys/types.h>
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#ifdef HAVE_DIRECT_H
+# include <direct.h>
+#endif], [mkdir ("foo", 0);],
+        octave_cv_mkdir_takes_one_arg=no, octave_cv_mkdir_takes_one_arg=yes)])
+if test $octave_cv_mkdir_takes_one_arg = yes ; then
+  AC_DEFINE(MKDIR_TAKES_ONE_ARG, 1, [Define if host mkdir takes a single 
argument.])
+fi
+])
Index: configure.in
===================================================================
RCS file: /cvs/octave/configure.in,v
retrieving revision 1.366
diff -u -3 -p -r1.366 configure.in
--- configure.in        2002/09/23 15:38:05     1.366
+++ configure.in        2002/09/25 15:35:37
@@ -792,7 +792,7 @@ AC_HEADER_SYS_WAIT

 ### C headers

-AC_CHECK_HEADERS(assert.h curses.h dlfcn.h fcntl.h float.h \
+AC_CHECK_HEADERS(assert.h curses.h direct.h dlfcn.h fcntl.h float.h \
   floatingpoint.h grp.h ieeefp.h limits.h memory.h nan.h \
   ncurses.h poll.h pwd.h stdlib.h string.h sys/ioctl.h \
   sys/param.h sys/poll.h sys/resource.h sys/select.h sys/stat.h \
@@ -1031,6 +1031,9 @@ AC_FUNC_CLOSEDIR_VOID

 AC_CHECK_MEMBERS(struct group.gr_passwd)

+# mkdir takes a single argument on some systems.
+OCTAVE_MKDIR_TAKES_ONE_ARG
+
 octave_found_termlib=no
 for termlib in ncurses curses termcap terminfo termlib; do
   AC_CHECK_LIB(${termlib}, tputs, [TERMLIBS="${TERMLIBS} -l${termlib}"])
@@ -1259,6 +1262,10 @@ typedef short nlink_t

 #if !defined(HAVE_SIGSET_T)
 typedef int sigset_t
+#endif
+
+#if defined(MKDIR_TAKES_ONE_ARG)
+#  define mkdir(a,b) mkdir(a)
 #endif
 ])


Regards,
Mumit




reply via email to

[Prev in Thread] Current Thread [Next in Thread]