* Updates for VMS, Windows, and DOS ports.
authorPaul Smith <psmith@gnu.org>
Sat, 5 Feb 2000 07:50:47 +0000 (07:50 +0000)
committerPaul Smith <psmith@gnu.org>
Sat, 5 Feb 2000 07:50:47 +0000 (07:50 +0000)
* Clean up some warnings.

16 files changed:
ChangeLog
Makefile.DOS.template
Makefile.am
config.h-vms.template
configure.in
default.c
dir.c
function.c
job.c
main.c
tests/ChangeLog
tests/run_make_tests.pl
tests/scripts/features/vpathplus
tests/scripts/targets/INTERMEDIATE
tests/scripts/targets/SECONDARY
vmsfunctions.c

index 8fdd6d7..2988bd4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
        pat_variables info; it's done earlier now to ensure the parent's
        pattern variables are set up correctly as well.
 
+2000-02-03  Paul D. Smith  <psmith@gnu.org>
+
+       * job.c (sh_chars_dos) [WINDOWS32]: Add "&" as a shell
+       metacharacter for the W32 DOS shell.
+       Reported by Warren Jones <wjones@tc.fluke.com>.
+
+2000-02-02  Paul D. Smith  <psmith@gnu.org>
+
+       Fixes for the OpenVMS port from Hartmut Becker <becker@rto.dec.com>
+
+       * config.h-vms [VMS]: Define LOCALEDIR to something; needed for
+       the expansion of bindtextdomain() even though it's a no-op.
+       * vmsfunctions.c (strcmpi): Remove duplicate definition of strcmpi().
+       (readdir): Use DB() instead of testing debug_flag.
+       * dir.c (file_impossible) [VMS]: Search "p" not "name".
+       * job.c [VMS]: Switch from debug_flag to the new DB macro.  Add
+       some i18n _() macros (even though VMS doesn't yet support it).
+
+       * function.c (patsubst_expand): Change "len" to not be unsigned to
+       avoid type mismatches.
+
+       * main.c (main): Declare signame_init() if we're going to call it.
+
+2000-01-29  Eli Zaretskii  <eliz@is.elta.co.il>
+
+       * Makefile.DOS.template: Track changes in Makefile.in
+       (install-recursive, uninstall-recursive): Add missing targets.
+       (DESTDIR): Define.
+       (install-binPROGRAMS, uninstall-binPROGRAMS): Use $(DESTDIR).
+
+       * default.c (default_variables) [__MSDOS__]: Define CXX to gpp.
+
 2000-01-25  Paul D. Smith  <psmith@gnu.org>
 
        Change gettext support to use the simplified version in libit 0.7.
index 7970c92..c445381 100644 (file)
@@ -5,8 +5,6 @@
 # This Makefile.DOS is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
 
-# -*-Makefile-*-, or close enough
-
 
 SHELL = /bin/sh
 
@@ -14,7 +12,7 @@ srcdir = .
 VPATH = $(srcdir)
 # $DJDIR is defined automatically by DJGPP to point
 # to the root of the DJGPP installation tree.
-prefix = ${DJDIR}
+prefix = /dev/env/DJDIR
 exec_prefix = ${prefix}
 
 bindir = ${exec_prefix}/bin
@@ -26,9 +24,12 @@ mandir = ${prefix}/info
 includedir = ${prefix}/include
 oldincludedir = c:/djgpp/include
 
+DESTDIR =
+
 pkgdatadir = $(datadir)/make
 pkglibdir = $(libdir)/make
 pkgincludedir = $(includedir)/make
+localedir = $(prefix)/share/locale
 
 INSTALL = ${bindir}/ginstall -c
 INSTALL_PROGRAM = ${bindir}/ginstall -c
@@ -70,11 +71,11 @@ make_LDADD =          glob/libglob.a
 info_TEXINFOS =        make.texinfo
 man_MANS =     make.1
 
-INCLUDES =     -I$(srcdir)/glob -DLIBDIR=\"c:/djgpp/lib\" -DINCLUDEDIR=\"c:/djgpp/include\"
+INCLUDES =     -I$(srcdir)/glob -DLIBDIR=\"c:/djgpp/lib\" -DINCLUDEDIR=\"c:/djgpp/include\" -DLOCALEDIR=\"$(localedir)\"
 
-BUILT_SOURCES =        README build.sh.in
+BUILT_SOURCES =        README build.sh-in
 
-EXTRA_DIST =   $(BUILT_SOURCES) $(man_MANS) README.customs remote-cstms.c  make-stds.texi texinfo.tex SCOPTIONS SMakefile  Makefile.ami README.Amiga config.ami amiga.c amiga.h  NMakefile README.DOS configh.dos configure.bat makefile.com  README.W32 build_w32.bat config.h.W32 subproc.bat make.lnk  config.h-vms makefile.vms readme.vms vmsdir.h vmsfunctions.c  vmsify.c
+EXTRA_DIST =   $(BUILT_SOURCES) $(man_MANS) README.customs remote-cstms.c  make-stds.texi texinfo.tex SCOPTIONS SMakefile  Makefile.ami README.Amiga config.ami amiga.c amiga.h  NMakefile README.DOS configh.dos configure.bat makefile.com  README.W32 build_w32.bat config.h-W32 subproc.bat make.lnk  config.h-vms makefile.vms readme.vms vmsdir.h vmsfunctions.c  vmsify.c
 
 SUBDIRS =      glob
 mkinstalldirs = ${bindir}/gmkdir -p
@@ -107,7 +108,7 @@ man1dir = $(mandir)/man1
 MANS = $(man_MANS)
 
 NROFF = nroff
-DIST_COMMON =  README AUTHORS COPYING ChangeLog INSTALL Makefile.am  Makefile.in NEWS acconfig.h aclocal.m4 alloca.c build.sh.in config.h.in  configure configure.in getloadavg.c install-sh missing mkinstalldirs  stamp-h.in texinfo.tex
+DIST_COMMON =  README ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL Makefile.am  Makefile.in NEWS acconfig.h aclocal.m4 alloca.c build.sh.in config.h.in  configure configure.in getloadavg.c gettext.c install-sh missing mkinstalldirs  stamp-h.in texinfo.tex
 
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
@@ -144,11 +145,11 @@ maintainer-clean-binPROGRAMS:
 install-binPROGRAMS: $(bin_PROGRAMS)
        @$(NORMAL_INSTALL)
        $(mkinstalldirs) $(DESTDIR)$(bindir)
-       @list='$(bin_PROGRAMS)'; for p in $$list; do    if test -f $$p; then      echo "  $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p | sed '$(transform)'`";       $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p | sed '$(transform)'`;    else :; fi;  done
+       @list='$(bin_PROGRAMS)'; for p in $$list; do    if test -f $$p; then      echo "  $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p | sed '$(transform)'`";       $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p | sed '$(transform)'`;    else :; fi;  done
 
 uninstall-binPROGRAMS:
        $(NORMAL_UNINSTALL)
-       list='$(bin_PROGRAMS)'; for p in $$list; do    rm -f $(bindir)/`echo $$p|sed '$(transform)'`.exe;  done
+       list='$(bin_PROGRAMS)'; for p in $$list; do    rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`.exe;  done
 
 .c.o:
        $(COMPILE) -c $<
@@ -388,6 +389,9 @@ install-exec: install-exec-recursive install-exec-am
 install-data: install-data-recursive install-data-am
        @$(NORMAL_INSTALL)
 
+install-recursive uninstall-recursive:
+       @:
+
 install: install-recursive install-exec-am install-data-am
        @:
 
index 0ed497c..08db1a6 100644 (file)
@@ -47,7 +47,7 @@ MAKE_HOST =   @MAKE_HOST@
 
 # --------------- Internationalization Section
 
-POTFILES     = $(SRCS) remote-cstms.c
+POTFILES     = $(SRCS) remote-cstms.c vmsfunctions.c
 
 localedir    = $(prefix)/share/locale
 aliaspath    = $(localedir):.
index 67b9447..2d060bb 100644 (file)
 #define alloca(n)      __ALLOCA(n)
 #endif
 
+/* Define to 1 if NLS is requested.  */
+/* #undef ENABLE_NLS */
+
+/* Define as 1 if you have dcgettext.  */
+/* #undef HAVE_DCGETTEXT */
+
+/* Define as 1 if you have gettext and don't want to use GNU gettext.  */
+/* #undef HAVE_GETTEXT */
+
+/* Define if your locale.h file contains LC_MESSAGES.  */
+/* #undef HAVE_LC_MESSAGES */
+
+/* Define to the installation directory for locales.  */
+#define LOCALEDIR ""
+
+/* Define as 1 if you have the stpcpy function.  */
+/* #undef HAVE_STPCPY */
+
 /* Define if the closedir function returns void instead of int.  */
 /* #undef CLOSEDIR_VOID */
 
index d7bd71b..83fbb52 100644 (file)
@@ -3,7 +3,7 @@ AC_REVISION([$Id$])
 AC_PREREQ(2.13)dnl             dnl Minimum Autoconf version required.
 AC_INIT(vpath.c)dnl            dnl A distinctive file to look for in srcdir.
 
-AM_INIT_AUTOMAKE(make, 3.78.90)
+AM_INIT_AUTOMAKE(make, 3.78.91)
 AM_CONFIG_HEADER(config.h)
 
 dnl Regular configure stuff
index e50813d..517d325 100644 (file)
--- a/default.c
+++ b/default.c
@@ -384,7 +384,11 @@ static char *default_variables[] =
     "AS", "as",
 #ifdef GCC_IS_NATIVE
     "CC", "gcc",
+# ifdef __MSDOS__
+    "CXX", "gpp",      /* g++ is an invalid name on MSDOS */
+# else
     "CXX", "gcc",
+# endif /* __MSDOS__ */
 #else
     "CC", "cc",
     "CXX", "g++",
diff --git a/dir.c b/dir.c
index ccc5163..caa8042 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -708,7 +708,7 @@ file_impossible (filename)
 #ifdef VMS
   dirend = strrchr (p, ']');
   if (dirend == 0)
-    dirend = strrchr (name, ':');
+    dirend = strrchr (p, ':');
   dirend++;
   if (dirend == (char *)1)
     dir = find_directory ("[]");
index ca66b91..743fe79 100644 (file)
@@ -128,7 +128,7 @@ patsubst_expand (o, text, pattern, replace, pattern_percent, replace_percent)
   unsigned int pattern_prepercent_len, pattern_postpercent_len;
   unsigned int replace_prepercent_len, replace_postpercent_len = 0;
   char *t;
-  unsigned int len;
+  int len;
   int doneany = 0;
 
   /* We call find_percent on REPLACE before checking PATTERN so that REPLACE
diff --git a/job.c b/job.c
index c4e30c9..e82865e 100644 (file)
--- a/job.c
+++ b/job.c
@@ -249,7 +249,10 @@ child_error (target_name, exit_code, exit_sig, coredump, ignored)
 
 #ifdef VMS
   if (!(exit_code & 1))
-      error (NILF, _("*** [%s] Error 0x%x%s"), target_name, exit_code, ((ignored)? _(" (ignored)") : ""));
+      error (NILF,
+             (ignored ? _("*** [%s] Error 0x%x (ignored)")
+              : _("*** [%s] Error 0x%x")),
+             target_name, exit_code);
 #else
   if (exit_sig == 0)
     error (NILF, ignored ? _("[%s] Error %d (ignored)") :
@@ -310,7 +313,7 @@ vms_redirect (desc, fname, ibuf)
   desc->dsc$b_class = DSC$K_CLASS_S;
 
   if (*fname == 0)
-    printf ("Warning: Empty redirection\n");
+    printf (_("Warning: Empty redirection\n"));
   return ibuf;
 }
 
@@ -346,7 +349,7 @@ handle_apos (char *p)
                inside = 0;
              else
                {
-                 fprintf (stderr, "Syntax error, still inside '\"'\n");
+                 fprintf (stderr, _("Syntax error, still inside '\"'\n"));
                  exit (3);
                }
            }
@@ -1559,7 +1562,8 @@ load_too_high ()
        {
          if (errno == 0)
            /* An errno value of zero means getloadavg is just unsupported.  */
-           error (NILF, _("cannot enforce load limits on this operating system"));
+           error (NILF,
+                   _("cannot enforce load limits on this operating system"));
          else
            perror_with_name (_("cannot enforce load limit: "), "getloadavg");
        }
@@ -1664,7 +1668,8 @@ int vmsHandleChildTerm(struct child *child)
            break;
 
          default:
-           error (NILF, _("internal error: `%s' command_state"), c->file->name);
+           error (NILF, _("internal error: `%s' command_state"),
+                   c->file->name);
            abort ();
            break;
          }
@@ -1747,8 +1752,8 @@ static void tryToSetupYAst(void) {
        if (status==SS$_ILLIOFUNC) {
                sys$dassgn(chan);
 #ifdef CTRLY_ENABLED_ANYWAY
-               fprintf (stderr, "-warning, CTRL-Y will leave "
-                       "sub-process(es) around.\n");
+               fprintf (stderr,
+                         _("-warning, CTRL-Y will leave sub-process(es) around.\n"));
 #else
                return;
 #endif
@@ -1764,8 +1769,8 @@ static void tryToSetupYAst(void) {
        if (setupYAstTried>1)
                return;
        if (atexit(reEnableAst))
-               fprintf (stderr, "-warning, you may have to re-enable CTRL-Y"
-                       "handling from DCL.\n");
+               fprintf (stderr,
+                         _("-warning, you may have to re-enable CTRL-Y handling from DCL.\n"));
        status= lib$disable_ctrl (&ctrlMask, &oldCtrlMask);
        if (!(status&SS$_NORMAL)) {
                lib$signal(status);
@@ -1799,8 +1804,7 @@ child_execute_job (argv, child)
   ofile[0] = 0;
   efile[0] = 0;
 
-  if (debug_flag)
-    printf ("child_execute_job (%s)\n", argv);
+  DB (DB_JOBS, ("child_execute_job (%s)\n", argv));
 
   while (isspace (*argv))
     argv++;
@@ -1879,8 +1883,7 @@ child_execute_job (argv, child)
       child->efn = 0;
       child->cstatus = 1;
 
-      if (debug_flag)
-       printf ("BUILTIN [%s][%s]\n", cmd, cmd+8);
+      DB (DB_JOBS, (_("BUILTIN [%s][%s]\n"), cmd, cmd+8));
 
       p = cmd + 8;
 
@@ -1891,8 +1894,7 @@ child_execute_job (argv, child)
          p += 3;
          while ((*p == ' ') || (*p == '\t'))
            p++;
-         if (debug_flag)
-           printf ("BUILTIN CD %s\n", p);
+         DB (DB_JOBS, (_("BUILTIN CD %s\n"), p));
          if (chdir (p))
            return 0;
          else
@@ -1910,8 +1912,7 @@ child_execute_job (argv, child)
            p++;
          in_arg = 1;
 
-         if (debug_flag)
-           printf ("BUILTIN RM %s\n", p);
+         DB (DB_JOBS, (_("BUILTIN RM %s\n"), p));
          while (*p)
            {
              switch (*p)
@@ -1932,7 +1933,7 @@ child_execute_job (argv, child)
        }
       else
        {
-         printf("Unknown builtin command '%s'\n", cmd);
+         printf(_("Unknown builtin command '%s'\n"), cmd);
          fflush(stdout);
          return 0;
        }
@@ -1956,7 +1957,7 @@ child_execute_job (argv, child)
 
       if (strlen (cmd) == 0)
        {
-         printf ("Error, empty command\n");
+         printf (_("Error, empty command\n"));
          fflush (stdout);
          return 0;
        }
@@ -2145,11 +2146,11 @@ child_execute_job (argv, child)
 
   if (!(status & 1))
     {
-      printf ("Error spawning, %d\n",status);
+      printf (_("Error spawning, %d\n") ,status);
       fflush (stdout);
     }
 
-  if (comname[0] && !ISDB (DB_JOBS)))
+  if (comname[0] && !ISDB (DB_JOBS))
     unlink (comname);
 
   return (status & 1);
@@ -2397,7 +2398,7 @@ construct_command_argv_internal (line, restp, shell, ifs, batch_filename_ptr)
                             0 };
 #else
 #ifdef WINDOWS32
-  static char sh_chars_dos[] = "\"|<>";
+  static char sh_chars_dos[] = "\"|&<>";
   static char *sh_cmds_dos[] = { "break", "call", "cd", "chcp", "chdir", "cls",
                             "copy", "ctty", "date", "del", "dir", "echo",
                             "erase", "exit", "for", "goto", "if", "if", "md",
@@ -2989,8 +2990,7 @@ construct_command_argv (line, restp, file, batch_filename_ptr)
        cptr++;
       if (*cptr == 0)
        break;
-      if (debug_flag)
-       printf ("argv[%d] = [%s]\n", argc, cptr);
+      DB (DB_JOBS, ("argv[%d] = [%s]\n", argc, cptr));
       argv[argc++] = cptr;
       while ((*cptr != 0)
             && (!isspace(*cptr)))
diff --git a/main.c b/main.c
index 9891b43..0cc72ec 100644 (file)
--- a/main.c
+++ b/main.c
@@ -776,7 +776,10 @@ int main (int argc, char ** argv)
   textdomain (PACKAGE);
 
 #if !defined (HAVE_STRSIGNAL) && !defined (HAVE_SYS_SIGLIST)
-  signame_init ();
+  {
+    extern void signame_init ();
+    signame_init ();
+  }
 #endif
 
 #ifdef POSIX
index 368a30c..231c486 100644 (file)
@@ -2,6 +2,21 @@
 
        * scripts/features/patspecific_vars: Add a test for PR/1407.
 
+2000-02-02  Paul D. Smith  <psmith@gnu.org>
+
+       * run_make_tests.pl (set_more_defaults): Hard-code the LANG to C
+       to make sure porting order, etc. is predictable.
+       Reported by Andreas Jaeger <aj@suse.de>.
+
+       * run_make_tests.pl (set_more_defaults): Set the $wtime variable
+       depending on the OS.  Eli Zaretskii <eliz@is.elta.co.il> reports
+       this seems to need to be *4* on DOS/Windows, not just 2.  Keep it
+       1 for other systems.
+       * scripts/features/vpathplus (touchfiles): Use the $wtime value
+       instead of hardcoding 2.
+       * scripts/targets/SECONDARY: Ditto.
+       * scripts/targets/INTERMEDIATE: Ditto.
+
 2000-01-23  Paul D. Smith  <psmith@gnu.org>
 
        * scripts/features/include: Remove a check; the fix caused more
index 70b1cf8..baf55f8 100755 (executable)
@@ -129,6 +129,11 @@ sub set_more_defaults
    local($string);
    local($index);
 
+   # Make sure we're in the C locale for those systems that support it,
+   # so sorting, etc. is predictable.
+   #
+   $ENV{LANG} = 'C';
+
    # find the type of the port.  We do this up front to have a single
    # point of change if it needs to be tweaked.
    #
@@ -152,6 +157,12 @@ sub set_more_defaults
      $port_type = 'UNIX';
    }
 
+   # On DOS/Windows system the filesystem apparently can't track
+   # timestamps with second granularity (!!).  Change the sleep time
+   # needed to force a file to be considered "old".
+   #
+   $wtime = $port_type eq 'UNIX' ? 1 : 4;
+
    # Find the full pathname of Make.  For DOS systems this is more
    # complicated, so we ask make itself.
 
index 6c9a2a0..76312b3 100644 (file)
@@ -57,12 +57,10 @@ close(MAKEFILE);
 
 sub touchfiles {
   foreach (@_) {
+    sleep($wtime);
     ($f = $_) =~ s,VP/,$VP,g;
     &touch($f);
     push(@touchedfiles, $f);
-    # Sleep 2 seconds for DOS/Windows FAT volumes which have 2-second
-    # granularity of file times.
-    sleep(2);
   }
 }
 
index a1df8bf..7041e83 100644 (file)
@@ -35,6 +35,7 @@ close(MAKEFILE);
 
 &touch('foo.f');
 &touch('bar.f');
+sleep($wtime);
 
 &run_make_with_options($makefile,'foo.d',&get_logfile);
 $answer = "cp foo.f foo.e\ncp foo.e foo.d\nrm foo.e\n";
@@ -48,9 +49,7 @@ $answer = "$make_name: `foo.d' is up to date.\n";
 
 # TEST #2
 
-# Sleep 2 seconds for DOS/Windows FAT volumes which have 2-second
-# granularity of file times.
-sleep(2);
+sleep($wtime);
 &touch('foo.f');
 
 &run_make_with_options($makefile,'foo.d',&get_logfile);
@@ -71,9 +70,7 @@ $answer = "$make_name: `foo.c' is up to date.\n";
 
 # TEST #5
 
-# Sleep 2 seconds for DOS/Windows FAT volumes which have 2-second
-# granularity of file times.
-sleep(2);
+sleep($wtime);
 &touch('foo.f');
 
 &run_make_with_options($makefile,'foo.c',&get_logfile);
index dbf052d..3ae34fd 100644 (file)
@@ -49,9 +49,7 @@ $answer = "$make_name: `foo.d' is up to date.\n";
 
 # TEST #3
 
-# Sleep 2 seconds for DOS/Windows FAT volumes which have 2-second
-# granularity of file times.
-sleep(2);
+sleep($wtime);
 &touch('foo.f');
 
 &run_make_with_options($makefile,'foo.d',&get_logfile);
@@ -74,9 +72,7 @@ $answer = "$make_name: `foo.c' is up to date.\n";
 
 # TEST #6
 
-# Sleep 2 seconds for DOS/Windows FAT volumes which have 2-second
-# granularity of file times.
-sleep(2);
+sleep($wtime);
 &touch('foo.f');
 
 &run_make_with_options($makefile,'foo.c',&get_logfile);
index 69ba28c..f6708cc 100644 (file)
@@ -73,13 +73,11 @@ readdir (dir)
   dnam->nam$l_rsa = dir->d_result;
   dnam->nam$b_rss = MAXNAMLEN;
 
-  if (debug_flag)
-    printf (".");
+  DB (DB_VERBOSE, ("."));
 
   if (!((i = sys$search (dfab)) & 1))
     {
-      if (debug_flag)
-       printf ("sys$search failed with %d\n", i);
+      DB (DB_VERBOSE, (_("sys$search failed with %d\n"), i));
       return (NULL);
     }
 
@@ -248,22 +246,6 @@ cvt_time (tval)
   return (str);
 }
 
-
-int
-strcmpi (s1, s2)
-    const char *s1;
-    const char *s2;
-{
-  while (*s1 != '\0' && toupper(*s1) == toupper(*s2))
-    {
-      s1++;
-      s2++;
-    }
-
-  return toupper(*(unsigned char *) s1) - toupper(*(unsigned char *) s2);
-}
-
-
 int
 strcmpi (s1, s2)
     const char *s1;