Ignore:
Timestamp:
Oct 29, 2008, 12:02:45 AM (17 years ago)
Author:
bird
Message:

Load gnumake-2008-10-28-CVS into vendor/gnumake/current.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/gnumake/current/job.c

    r900 r1989  
    11/* Job execution and handling for GNU Make.
    22Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
    3 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
     31998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
    44Foundation, Inc.
    55This file is part of GNU Make.
     
    77GNU Make is free software; you can redistribute it and/or modify it under the
    88terms of the GNU General Public License as published by the Free Software
    9 Foundation; either version 2, or (at your option) any later version.
     9Foundation; either version 3 of the License, or (at your option) any later
     10version.
    1011
    1112GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
     
    1415
    1516You should have received a copy of the GNU General Public License along with
    16 GNU Make; see the file COPYING.  If not, write to the Free Software
    17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.  */
     17this program.  If not, see <http://www.gnu.org/licenses/>.  */
    1818
    1919#include "make.h"
     
    10231023    argv = p;
    10241024#else
    1025     argv = construct_command_argv (p, &end, child->file, &child->sh_batch_file);
     1025    argv = construct_command_argv (p, &end, child->file,
     1026                                   child->file->cmds->lines_flags[child->command_line - 1],
     1027                                   &child->sh_batch_file);
    10261028#endif
    10271029    if (end == NULL)
     
    17291731
    17301732  /* The job is now primed.  Start it running.
    1731      (This will notice if there are in fact no commands.)  */
     1733     (This will notice if there is in fact no recipe.)  */
    17321734  if (cmds->fileinfo.filenm)
    1733     DB (DB_BASIC, (_("Invoking commands from %s:%lu to update target `%s'.\n"),
     1735    DB (DB_BASIC, (_("Invoking recipe from %s:%lu to update target `%s'.\n"),
    17341736                   cmds->fileinfo.filenm, cmds->fileinfo.lineno,
    17351737                   c->file->name));
    17361738  else
    1737     DB (DB_BASIC, (_("Invoking builtin commands to update target `%s'.\n"),
     1739    DB (DB_BASIC, (_("Invoking builtin recipe to update target `%s'.\n"),
    17381740                   c->file->name));
    17391741
     
    19081910
    19091911/* EMX: Start a child process. This function returns the new pid.  */
    1910 # if defined __MSDOS__ || defined __EMX__
     1912# if defined __EMX__
    19111913int
    19121914child_execute_job (int stdin_fd, int stdout_fd, char **argv, char **envp)
     
    22112213
    22122214   SHELL is the shell to use, or nil to use the default shell.
    2213    IFS is the value of $IFS, or nil (meaning the default).  */
     2215   IFS is the value of $IFS, or nil (meaning the default).
     2216
     2217   FLAGS is the value of lines_flags for this command line.  It is
     2218   used in the WINDOWS32 port to check whether + or $(MAKE) were found
     2219   in this command line, in which case the effect of just_print_flag
     2220   is overridden.  */
    22142221
    22152222static char **
    22162223construct_command_argv_internal (char *line, char **restp, char *shell,
    2217                                  char *ifs, char **batch_filename_ptr)
     2224                                 char *ifs, int flags,
     2225                                 char **batch_filename_ptr)
    22182226{
    22192227#ifdef __MSDOS__
     
    24642472                  *(ap++) = *p;
    24652473                }
    2466               /* If there's a command prefix char here, skip it.  */
    2467               if (p[1] == cmd_prefix)
    2468                 ++p;
    24692474            }
    24702475          else if (*p == '\n' && restp != NULL)
     
    25142519                ++p;
    25152520
    2516                 /* If there is a command prefix after a backslash-newline,
    2517                    remove it.  */
    2518                 if (p[1] == cmd_prefix)
    2519                   ++p;
    2520 
    25212521                /* If there's nothing in this argument yet, skip any
    25222522                   whitespace before the start of the next word.  */
     
    27462746        else if (*p == '\\' && p[1] == '\n')
    27472747          {
    2748             /* POSIX says we keep the backslash-newline, but throw out
    2749                the next char if it's a TAB.  If we don't have a POSIX
    2750                shell on DOS/Windows/OS2, mimic the pre-POSIX behavior
     2748            /* POSIX says we keep the backslash-newline.  If we don't have a
     2749               POSIX shell on DOS/Windows/OS2, mimic the pre-POSIX behavior
    27512750               and remove the backslash/newline.  */
    27522751#if defined (__MSDOS__) || defined (__EMX__) || defined (WINDOWS32)
     
    27582757              {
    27592758                *(ap++) = '\\';
    2760                 *(ap++) = '\\';
     2759                /* Only non-batch execution needs another backslash,
     2760                   because it will be passed through a recursive
     2761                   invocation of this function.  */
     2762                if (!batch_mode_shell)
     2763                  *(ap++) = '\\';
    27612764                *(ap++) = '\n';
    27622765              }
    2763 
    27642766            ++p;
    2765             if (p[1] == cmd_prefix)
    2766               ++p;
    2767 
    27682767            continue;
    27692768          }
     
    27952794       command line (e.g. Cygnus GNUWIN32 sh.exe on WIN32 systems).  In these
    27962795       cases, run commands via a script file.  */
    2797     if (just_print_flag) {
     2796    if (just_print_flag && !(flags & COMMANDS_RECURSE)) {
    27982797      /* Need to allocate new_argv, although it's unused, because
    27992798        start_job_command will want to free it and its 0'th element.  */
     
    28232822      fputc ('\n', batch);
    28242823      fclose (batch);
     2824      DB (DB_JOBS, (_("Batch file contents:%s\n\t%s\n"),
     2825                    !unixy_shell ? "\n\t@echo off" : "", command_ptr));
    28252826
    28262827      /* create argv */
     
    28372838#endif /* WINDOWS32 */
    28382839    if (unixy_shell)
    2839       new_argv = construct_command_argv_internal (new_line, 0, 0, 0, 0);
     2840      new_argv = construct_command_argv_internal (new_line, 0, 0, 0, flags, 0);
    28402841#ifdef __EMX__
    28412842    else if (!unixy_shell)
     
    28522853          {
    28532854            if (q[0] == '\\' && q[1] == '\n')
    2854               {
    2855                 q += 2; /* remove '\\' and '\n' */
    2856                 /* Remove any command prefix in the next line */
    2857                 if (q[0] == cmd_prefix)
    2858                   q++;
    2859               }
     2855              q += 2; /* remove '\\' and '\n' */
    28602856            else
    28612857              *p++ = *q++;
     
    29482944char **
    29492945construct_command_argv (char *line, char **restp, struct file *file,
    2950                         char **batch_filename_ptr)
     2946                        int cmd_flags, char **batch_filename_ptr)
    29512947{
    29522948  char *shell, *ifs;
     
    30603056  }
    30613057
    3062   argv = construct_command_argv_internal (line, restp, shell, ifs, batch_filename_ptr);
     3058  argv = construct_command_argv_internal (line, restp, shell, ifs,
     3059                                          cmd_flags, batch_filename_ptr);
    30633060
    30643061  free (shell);
Note: See TracChangeset for help on using the changeset viewer.