]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Added MINGW32 changes.
authorPaul Smith <psmith@gnu.org>
Mon, 3 Nov 2003 22:04:09 +0000 (22:04 +0000)
committerPaul Smith <psmith@gnu.org>
Mon, 3 Nov 2003 22:04:09 +0000 (22:04 +0000)
This commits a number of changes from Earnie Boyd that allows GNU make
to build for MINGW32 systems.  Only missing from this commit are the
changes to configure.in etc.; I'm waiting for Earnie to sign papers for
those new files.

Also not here is any README.mingw32 etc. which would explain how to use
this port.

ChangeLog
dir.c
doc/make.texi
main.c
make.h
w32/include/dirent.h

index 6f4ac90f01f2cdbdc5c5c52f296527b80fbaa7d6..e56732a1914f1bf0b619ee80eebfa3509878dd76 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
        * dir.c (directory_contents_hash_1, directory_contents_hash_1)
        [WINDOWS32]: Initialize hash.
 
+2003-06-19  Earnie Boyd  <earnie@uses.sf.net>
+
+       * dir.c (read_dirstream): Provide a workaround for broken versions of
+       the MinGW dirent structure.
+
+2003-05-30  Earnie Boyd  <earnie@users.sf.net>
+
+       * w32/include/dirent.h: Add __MINGW32__ filter.
+
+2003-05-30  Earnie Boyd  <earnie@users.sf.net>
+
+       * make.h: Add global declaration of *make_host.
+       * main.c (print_usage): Remove local declaration of *make_host.
+       (print_version): Display "This program built for ..." after Copyright
+       notice.
+
+2003-05-30  Earnie Boyd  <earnie@users.sf.net>
+
+       * doc/make.texi: Change "ifinfo" to "ifnottex" as suggested by the
+       execution of "makeinfo --html make.texi".
+
 2003-04-30  Paul D. Smith  <psmith@gnu.org>
 
        * build.template: Make some changes to maybe allow this script to
diff --git a/dir.c b/dir.c
index 8b77ee68baae3427563758accd43fe19e0b3a9fb..9ab4ffc7ce0841073dbb426c8045d0f205f76f15 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -1130,6 +1130,12 @@ read_dirstream (__ptr_t stream)
              buf = xmalloc (bufsz);
            }
          d = (struct dirent *) buf;
+#ifdef __MINGW32__
+# if __MINGW32_VERSION_MAJOR < 3 || (__MINGW32_VERSION_MAJOR == 3 && \
+                                    __MINGW32_VERSION_MINOR == 0)
+         d->d_name = xmalloc(len);
+# endif
+#endif
          FAKE_DIR_ENTRY (d);
 #ifdef _DIRENT_HAVE_D_NAMLEN
          d->d_namlen = len - 1;
index e2b3dd66fc0abefa35bc6c9b477898dd885b1dba..a8bc6a6b855a25cd559968323ab1b2ca456c8049 100644 (file)
@@ -30,7 +30,7 @@
 * Make: (make).            Remake files automatically.
 @end direntry
 
-@ifinfo
+@ifnottex
 This file documents the GNU Make utility, which determines
 automatically which pieces of a large program need to be recompiled,
 and issues the commands to recompile them.
@@ -47,7 +47,7 @@ any later version published by the Free Software Foundation; with no
 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
 Texts.  A copy of the license is included in the section entitled
 ``GNU Free Documentation License''.
-@end ifinfo
+@end ifnottex
 
 @iftex
 @shorttitlepage GNU Make
@@ -88,7 +88,7 @@ Cover art by Etienne Suvasa.
 @end titlepage
 @page
 
-@ifinfo
+@ifnottex
 @node Top, Overview, (dir), (dir)
 @top Make
 
@@ -101,7 +101,7 @@ last updated @value{UPDATED},
 documents GNU @code{make} Version @value{VERSION}.@refill
 
 This manual describes @code{make} and contains the following chapters:@refill
-@end ifinfo
+@end ifnottex
 
 @menu
 * Overview::                    Overview of @code{make}.
@@ -371,9 +371,9 @@ from others whenever the others change.
 @end menu
 
 @node Preparing, Reading, Overview, Overview
-@ifinfo
+@ifnottex
 @heading Preparing and Running Make
-@end ifinfo
+@end ifnottex
 
 To prepare to use @code{make}, you must write a file called
 the @dfn{makefile} that describes the relationships among files
@@ -406,10 +406,10 @@ introduction, read the first few sections of each chapter, skipping the
 later sections.  In each chapter, the first few sections contain
 introductory or general information and the later sections contain
 specialized or technical information.
-@ifinfo
+@ifnottex
 The exception is the second chapter, @ref{Introduction, ,An
 Introduction to Makefiles}, all of which is introductory.
-@end ifinfo
+@end ifnottex
 @iftex
 The exception is @ref{Introduction, ,An Introduction to Makefiles},
 all of which is introductory.
@@ -1558,7 +1558,7 @@ the makefile (often with a target called @samp{all}).
                                   prerequisites from source files themselves.
 @end menu
 
-@ifinfo
+@ifnottex
 @node Rule Example, Rule Syntax, Rules, Rules
 @section Rule Example
 
@@ -1587,7 +1587,7 @@ The command does not explicitly mention @file{defs.h}, but we presume
 that @file{foo.c} includes it, and that that is why @file{defs.h} was
 added to the prerequisites.
 @end itemize
-@end ifinfo
+@end ifnottex
 
 @node Rule Syntax, Prerequisite Types, Rule Example, Rules
 @section Rule Syntax
@@ -1833,9 +1833,9 @@ make @file{*.o}.  This is not what you want!
 Actually it is possible to obtain the desired result with wildcard
 expansion, but you need more sophisticated techniques, including the
 @code{wildcard} function and string substitution.
-@ifinfo
+@ifnottex
 @xref{Wildcard Function, ,The Function @code{wildcard}}.
-@end ifinfo
+@end ifnottex
 @iftex
 These are described in the following section.
 @end iftex
@@ -3737,9 +3737,9 @@ on the command line, by putting them in the @code{MAKEFLAGS} variable.
 @iftex
 See the next section.
 @end iftex
-@ifinfo
+@ifnottex
 @xref{Options/Recursion}.
-@end ifinfo
+@end ifnottex
 
 Variables are @emph{not} normally passed down if they were created by
 default by @code{make} (@pxref{Implicit Variables, ,Variables Used by
@@ -5051,9 +5051,9 @@ endef
 @iftex
 See the next section for information about @code{define}.
 @end iftex
-@ifinfo
+@ifnottex
 @xref{Defining, ,Defining Variables Verbatim}.
-@end ifinfo
+@end ifnottex
 
 @node Defining, Environment, Override Directive, Using Variables
 @section Defining Variables Verbatim
diff --git a/main.c b/main.c
index 5a6e924cabf4e6bd5bf7e3c2f0edbf870d6f41b9..7af539d3138617646799e28abc722da4dd8bfc73 100644 (file)
--- a/main.c
+++ b/main.c
@@ -2141,7 +2141,6 @@ handle_non_switch_argument (char *arg, int env)
 static void
 print_usage (int bad)
 {
-  extern char *make_host;
   const char *const *cpp;
   FILE *usageto;
 
@@ -2700,7 +2699,7 @@ print_version (void)
      word "Copyright", so it hardly seems worth it.  */
 
   printf ("%sGNU Make %s\n\
-%sCopyright (C) 2002  Free Software Foundation, Inc.\n",
+%sCopyright (C) 2003  Free Software Foundation, Inc.\n",
           precede, version_string, precede);
 
   printf (_("%sThis is free software; see the source for copying conditions.\n\
@@ -2708,6 +2707,12 @@ print_version (void)
 %sPARTICULAR PURPOSE.\n"),
             precede, precede, precede);
 
+  if (!remote_description || *remote_description == '\0')
+    printf (_("\n%sThis program built for %s\n"), precede, make_host);
+  else
+    printf (_("\n%sThis program built for %s (%s)\n"),
+            precede, make_host, remote_description);
+
   printed_version = 1;
 
   /* Flush stdout so the user doesn't have to wait to see the
diff --git a/make.h b/make.h
index f7c2ad72bc1f959720321650aedc0bff27f11921..3fae1bff379ca82aaf9308f508e2402770a32a57 100644 (file)
--- a/make.h
+++ b/make.h
@@ -505,7 +505,7 @@ extern int max_load_average;
 extern char *program;
 extern char *starting_directory;
 extern unsigned int makelevel;
-extern char *version_string, *remote_description;
+extern char *version_string, *remote_description, *make_host;
 
 extern unsigned int commands_started;
 
index 3437bd0681358f1b1b485e87a3da532367194544..ed182b34e8b013cd6932189a796a5e70e6696db6 100644 (file)
@@ -1,37 +1,62 @@
-#ifndef _DIRENT_H\r
-#define _DIRENT_H\r
-\r
-#include <stdlib.h>\r
-#include <windows.h>\r
-#include <limits.h>\r
-#include <sys/types.h>\r
-\r
-#ifndef NAME_MAX\r
-#define NAME_MAX 255\r
-#endif\r
-\r
-#define __DIRENT_COOKIE 0xfefeabab\r
-\r
-\r
-struct dirent\r
-{\r
-  ino_t d_ino;                         /* unused - no equivalent on WINDOWS32 */\r
-  char d_name[NAME_MAX+1];\r
-};\r
-\r
-typedef struct dir_struct {\r
-       ULONG   dir_ulCookie;\r
-       HANDLE  dir_hDirHandle;\r
-       DWORD   dir_nNumFiles;\r
-       char    dir_pDirectoryName[NAME_MAX+1];\r
-       struct dirent dir_sdReturn;\r
-} DIR;\r
-\r
-DIR *opendir(const char *);\r
-struct dirent *readdir(DIR *);\r
-void rewinddir(DIR *);\r
-void closedir(DIR *);\r
-int telldir(DIR *);\r
-void seekdir(DIR *, long);\r
-\r
-#endif\r
+/* Windows version of dirent.h
+Copyright (C) 1996, 1997, 2003 Free Software Foundation, Inc.
+This file is part of GNU Make.
+
+GNU Make is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Make is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Make; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+MA 02111-1307, USA.  */
+
+#ifndef _DIRENT_H
+#define _DIRENT_H
+
+#ifdef __MINGW32__
+# include <windows.h>
+# include_next <dirent.h>
+#else
+
+#include <stdlib.h>
+#include <windows.h>
+#include <limits.h>
+#include <sys/types.h>
+
+#ifndef NAME_MAX
+#define NAME_MAX 255
+#endif
+
+#define __DIRENT_COOKIE 0xfefeabab
+
+
+struct dirent
+{
+  ino_t d_ino;                         /* unused - no equivalent on WINDOWS32 */
+  char d_name[NAME_MAX+1];
+};
+
+typedef struct dir_struct {
+       ULONG   dir_ulCookie;
+       HANDLE  dir_hDirHandle;
+       DWORD   dir_nNumFiles;
+       char    dir_pDirectoryName[NAME_MAX+1];
+       struct dirent dir_sdReturn;
+} DIR;
+
+DIR *opendir(const char *);
+struct dirent *readdir(DIR *);
+void rewinddir(DIR *);
+void closedir(DIR *);
+int telldir(DIR *);
+void seekdir(DIR *, long);
+
+#endif  /* !__MINGW32__ */
+#endif