This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: (java) jcf-write win32 fix
- To: law at cygnus dot com
- Subject: Re: (java) jcf-write win32 fix
- From: Mumit Khan <khan at xraylith dot wisc dot edu>
- Date: Tue, 13 Apr 1999 17:01:01 -0500 (CDT)
- cc: mark at codesourcery dot com, egcs-patches at egcs dot cygnus dot com
On Mon, 12 Apr 1999, Jeffrey A Law wrote:
> In message <199904130548.WAA23110@codesourcery.com>you write:
> > >>>>> "Mumit" == Mumit Khan <khan@xraylith.wisc.EDU> writes:
> >
> > Mumit> The following trivial patch is needed when using non-POSIX
> > Mumit> Microsoft C RTL which implements mkdir without the
> > Mumit> permission bits. DJGPP folks -- please check if you need
> > Mumit> this as well.
> >
> > Wouldn't it be better just to autoconf this kind of stuff? You could,
> > depending on the output of autoconf, do:
> >
> > #define mkdir(dir, bits) mkdir (dir)
> Agreed. Down with host ifdefs!
>
Would something like the following be acceptable/fit in with the
existing convention? If so, I'll submit a proper patch.
Note the actual test in aclocal.m4 -- it needs to be this way since
I see no other reliable way to tell how many args it takes.
Tue Apr 13 16:55:44 1999 Mumit Khan <khan@xraylith.wisc.edu>
* aclocal.m4 (GCC_FUNC_MKDIR_TAKES_ONE_ARG): Define.
* configure.in: Use.
* acconfig.h (MKDIR_TAKES_ONE_ARG): Add.
Index: configure.in
===================================================================
RCS file: /homes/khan/src/CVSROOT/egcs-19990410/gcc/configure.in,v
retrieving revision 1.1.1.2
diff -u -3 -p -r1.1.1.2 configure.in
--- configure.in 1999/04/12 14:09:14 1.1.1.2
+++ configure.in 1999/04/13 21:31:47
@@ -394,6 +394,9 @@ GCC_NEED_DECLARATIONS(getrlimit setrlimi
AC_DECL_SYS_SIGLIST
+# mkdir takes a single argument on some systems.
+GCC_FUNC_MKDIR_TAKES_ONE_ARG
+
# File extensions
manext='.1'
objext='.o'
Index: aclocal.m4
===================================================================
RCS file: /homes/khan/src/CVSROOT/egcs-19990410/gcc/aclocal.m4,v
retrieving revision 1.1.1.1
diff -u -3 -p -r1.1.1.1 aclocal.m4
--- aclocal.m4 1999/04/10 23:56:02 1.1.1.1
+++ aclocal.m4 1999/04/13 21:29:31
@@ -172,6 +172,23 @@ if test $gcc_cv_c_volatile = yes ; then
fi
])
+dnl See whether mkdir takes one or two args. Define MKDIR_TAKES_ONE_ARG
+dnl if it takes only one instead of the usual 2.
+AC_DEFUN(GCC_FUNC_MKDIR_TAKES_ONE_ARG,
+[AC_CACHE_CHECK([if mkdir takes one argument], gcc_cv_mkdir_takes_one_arg,
+[AC_EGREP_CPP(yes,
+[#if defined (_WIN32) && ! defined (__CYGWIN__) && ! defined (_UWIN)
+ yes
+#endif
+], gcc_cv_mkdir_takes_one_arg=yes, gcc_cv_mkdir_takes_one_arg=no)])
+if test $gcc_cv_mkdir_takes_one_arg = yes ; then
+ AC_DEFINE(MKDIR_TAKES_ONE_ARG)
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+])
+
AC_DEFUN(EGCS_PROG_INSTALL,
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
# Find a good install program. We prefer a C program (faster),
Index: acconfig.h
===================================================================
RCS file: /homes/khan/src/CVSROOT/egcs-19990410/gcc/acconfig.h,v
retrieving revision 1.1.1.1
diff -u -3 -p -r1.1.1.1 acconfig.h
--- acconfig.h 1999/04/10 23:56:02 1.1.1.1
+++ acconfig.h 1999/04/13 21:03:00
@@ -114,6 +114,9 @@
/* Define to enable the use of a default linker. */
#undef DEFAULT_LINKER
+/* Define if host mkdir takes a single argument. */
+#undef MKDIR_TAKES_ONE_ARG
+
/* Define to the name of the distribution. */
#undef PACKAGE
Index: java/jcf-write.c
===================================================================
RCS file: /homes/khan/src/CVSROOT/egcs-19990410/gcc/java/jcf-write.c,v
retrieving revision 1.1.1.1
diff -u -3 -p -r1.1.1.1 jcf-write.c
--- jcf-write.c 1999/04/10 23:56:04 1.1.1.1
+++ jcf-write.c 1999/04/13 21:26:49
@@ -39,6 +39,10 @@ The Free Software Foundation is independ
#define DIR_SEPARATOR '/'
#endif
+#ifdef MKDIR_TAKES_ONE_ARG
+#define mkdir(r,p) mkdir(r)
+#endif
+
extern struct obstack temporary_obstack;
/* Base directory in which `.class' files should be written.