VirtualBox

Changeset 2596 in kBuild for vendor/gnumake/current/w32


Ignore:
Timestamp:
Jun 19, 2012 10:44:52 PM (12 years ago)
Author:
bird
Message:

gnumake/current -> 3.82-cvs.

Location:
vendor/gnumake/current
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • vendor/gnumake/current

    • Property svn:ignore deleted
  • vendor/gnumake/current/w32/Makefile.am

    • Property svn:keywords deleted
    r1989 r2596  
    11# Makefile.am to create libw32.a for mingw32 host.
    22# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
    3 # 2007 Free Software Foundation, Inc.
     3# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
    44# This file is part of GNU Make.
    55#
  • vendor/gnumake/current/w32/compat/dirent.c

    r1989 r2596  
    11/* Directory entry code for Window platforms.
    22Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
    3 2006, 2007 Free Software Foundation, Inc.
     32006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
    44This file is part of GNU Make.
    55
     
    1717
    1818
     19#include <config.h>
    1920#include <sys/types.h>
    2021#include <sys/stat.h>
     
    133134
    134135        /* fill in struct dirent values */
    135         pDir->dir_sdReturn.d_ino = -1;
     136        pDir->dir_sdReturn.d_ino = (ino_t)-1;
    136137        strcpy(pDir->dir_sdReturn.d_name, wfdFindData.cFileName);
    137138
  • vendor/gnumake/current/w32/include/dirent.h

    r1989 r2596  
    11/* Windows version of dirent.h
    22Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
    3 2007 Free Software Foundation, Inc.
     32007, 2008, 2009, 2010 Free Software Foundation, Inc.
    44This file is part of GNU Make.
    55
  • vendor/gnumake/current/w32/include/pathstuff.h

    r1989 r2596  
    11/* Definitions for Windows path manipulation.
    22Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
    3 2007 Free Software Foundation, Inc.
     32007, 2008, 2009, 2010 Free Software Foundation, Inc.
    44This file is part of GNU Make.
    55
  • vendor/gnumake/current/w32/include/sub_proc.h

    r1989 r2596  
    11/* Definitions for Windows process invocation.
    22Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
    3 2006, 2007 Free Software Foundation, Inc.
     32006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
    44This file is part of GNU Make.
    55
     
    2222 * Component Name:
    2323 *
    24  * $Date: 2007/10/24 20:06:32 $
     24 * $Date: 2010/07/13 01:20:43 $
    2525 *
    2626 * $Source: /sources/make/make/w32/include/sub_proc.h,v $
    2727 *
    28  * $Id: sub_proc.h,v 1.10 2007/10/24 20:06:32 eliz Exp $
     28 * $Id: sub_proc.h,v 1.12 2010/07/13 01:20:43 psmith Exp $
    2929 */
    3030
  • vendor/gnumake/current/w32/include/w32err.h

    r1989 r2596  
    11/* Definitions for Windows error handling.
    22Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
    3 2006, 2007 Free Software Foundation, Inc.
     32006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
    44This file is part of GNU Make.
    55
  • vendor/gnumake/current/w32/pathstuff.c

    r1989 r2596  
    11/* Path conversion for Windows pathnames.
    22Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
    3 2007 Free Software Foundation, Inc.
     32007, 2008, 2009, 2010 Free Software Foundation, Inc.
    44This file is part of GNU Make.
    55
     
    1616this program.  If not, see <http://www.gnu.org/licenses/>.  */
    1717
     18#include "make.h"
    1819#include <string.h>
    1920#include <stdlib.h>
    20 #include "make.h"
    2121#include "pathstuff.h"
    2222
     
    5050
    5151    /* is this a multi-element Path ? */
     52    /* FIXME: Perhaps use ":;\"" in strpbrk to convert all quotes to
     53       delimiters as well, as a way to handle quoted directories in
     54       PATH?  */
    5255    for (p = Path, etok = strpbrk(p, ":;");
    5356         etok;
     
    7578                ;
    7679            etok = strpbrk(p, ":;");        /* find next delimiter */
    77             *etok = to_delim;
    78             p = ++etok;
     80            if (etok) {
     81                *etok = to_delim;
     82                p = ++etok;
     83            } else
     84                p += strlen(p);
    7985        } else {
    8086            /* found another one, no drive letter */
  • vendor/gnumake/current/w32/subproc/NMakefile

    r1989 r2596  
    33#
    44# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
    5 # 2006, 2007 Free Software Foundation, Inc.
     5# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
    66# This file is part of GNU Make.
    77#
  • vendor/gnumake/current/w32/subproc/build.bat

    r1991 r2596  
    1919@echo off
    2020rem Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
    21 rem 2005, 2006, 2007 Free Software Foundation, Inc.
     21rem 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
    2222rem This file is part of GNU Make.
    2323rem
  • vendor/gnumake/current/w32/subproc/misc.c

    r1989 r2596  
    11/* Process handling for Windows
    22Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
    3 2006, 2007 Free Software Foundation, Inc.
     32006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
    44This file is part of GNU Make.
    55
     
    1616this program.  If not, see <http://www.gnu.org/licenses/>.  */
    1717
     18#include <config.h>
    1819#include <stddef.h>
    1920#include <stdlib.h>
     
    7879        }
    7980
    80         free(tmp);
     81        free(tmp);
    8182        return TRUE;
    8283}
  • vendor/gnumake/current/w32/subproc/proc.h

    r1989 r2596  
    11/* Definitions for Windows
    22Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
    3 2006, 2007 Free Software Foundation, Inc.
     32006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
    44This file is part of GNU Make.
    55
  • vendor/gnumake/current/w32/subproc/sub_proc.c

    r1989 r2596  
    11/* Process handling for Windows.
    22Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
    3 2006, 2007 Free Software Foundation, Inc.
     32006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
    44This file is part of GNU Make.
    55
     
    1616this program.  If not, see <http://www.gnu.org/licenses/>.  */
    1717
     18#include <config.h>
    1819#include <stdlib.h>
    1920#include <stdio.h>
     21#ifdef _MSC_VER
     22# include <stddef.h>    /* for intptr_t */
     23#else
     24# include <stdint.h>
     25#endif
    2026#include <process.h>  /* for msvc _beginthreadex, _endthreadex */
    2127#include <signal.h>
     
    2531#include "proc.h"
    2632#include "w32err.h"
    27 #include "config.h"
    2833#include "debug.h"
    2934
    3035static char *make_command_line(char *shell_name, char *exec_path, char **argv);
     36extern char *xmalloc (unsigned int);
    3137
    3238typedef struct sub_process_t {
    33         int sv_stdin[2];
    34         int sv_stdout[2];
    35         int sv_stderr[2];
     39        intptr_t sv_stdin[2];
     40        intptr_t sv_stdout[2];
     41        intptr_t sv_stderr[2];
    3642        int using_pipes;
    3743        char *inp;
     
    4147        char * volatile errp;
    4248        volatile DWORD errcnt;
    43         int pid;
     49        pid_t pid;
    4450        int exit_code;
    4551        int signal;
     
    310316                return((HANDLE)pproc);
    311317        }
    312         pproc->sv_stdin[0]  = (int) stdin_pipes[0];
    313         pproc->sv_stdin[1]  = (int) stdin_pipes[1];
    314         pproc->sv_stdout[0] = (int) stdout_pipes[0];
    315         pproc->sv_stdout[1] = (int) stdout_pipes[1];
    316         pproc->sv_stderr[0] = (int) stderr_pipes[0];
    317         pproc->sv_stderr[1] = (int) stderr_pipes[1];
     318        pproc->sv_stdin[0]  = (intptr_t) stdin_pipes[0];
     319        pproc->sv_stdin[1]  = (intptr_t) stdin_pipes[1];
     320        pproc->sv_stdout[0] = (intptr_t) stdout_pipes[0];
     321        pproc->sv_stdout[1] = (intptr_t) stdout_pipes[1];
     322        pproc->sv_stderr[0] = (intptr_t) stderr_pipes[0];
     323        pproc->sv_stderr[1] = (intptr_t) stderr_pipes[1];
    318324
    319325        pproc->using_pipes = 1;
     
    337343         * pipe, bypassing pipes altogether.
    338344         */
    339         pproc->sv_stdin[1]  = (int) stdinh;
    340         pproc->sv_stdout[1] = (int) stdouth;
    341         pproc->sv_stderr[1] = (int) stderrh;
     345        pproc->sv_stdin[1]  = (intptr_t) stdinh;
     346        pproc->sv_stdout[1] = (intptr_t) stdouth;
     347        pproc->sv_stderr[1] = (intptr_t) stderrh;
    342348
    343349        pproc->last_err = pproc->lerrno = 0;
     
    348354
    349355static HANDLE
    350 find_file(char *exec_path, LPOFSTRUCT file_info)
     356find_file(const char *exec_path, const char *path_var,
     357          char *full_fname, DWORD full_len)
    351358{
    352359        HANDLE exec_handle;
    353360        char *fname;
    354361        char *ext;
    355 
    356         fname = malloc(strlen(exec_path) + 5);
     362        DWORD req_len;
     363        int i;
     364        static const char *extensions[] =
     365          /* Should .com come before no-extension case?  */
     366          { ".exe", ".cmd", ".bat", "", ".com", NULL };
     367
     368        fname = xmalloc(strlen(exec_path) + 5);
    357369        strcpy(fname, exec_path);
    358370        ext = fname + strlen(fname);
    359371
    360         strcpy(ext, ".exe");
    361         if ((exec_handle = (HANDLE)OpenFile(fname, file_info,
    362                         OF_READ | OF_SHARE_COMPAT)) != (HANDLE)HFILE_ERROR) {
    363                 free(fname);
    364                 return(exec_handle);
    365         }
    366 
    367         strcpy(ext, ".cmd");
    368         if ((exec_handle = (HANDLE)OpenFile(fname, file_info,
    369                         OF_READ | OF_SHARE_COMPAT)) != (HANDLE)HFILE_ERROR) {
    370                 free(fname);
    371                 return(exec_handle);
    372         }
    373 
    374         strcpy(ext, ".bat");
    375         if ((exec_handle = (HANDLE)OpenFile(fname, file_info,
    376                         OF_READ | OF_SHARE_COMPAT)) != (HANDLE)HFILE_ERROR) {
    377                 free(fname);
    378                 return(exec_handle);
    379         }
    380 
    381         /* should .com come before this case? */
    382         if ((exec_handle = (HANDLE)OpenFile(exec_path, file_info,
    383                         OF_READ | OF_SHARE_COMPAT)) != (HANDLE)HFILE_ERROR) {
    384                 free(fname);
    385                 return(exec_handle);
    386         }
    387 
    388         strcpy(ext, ".com");
    389         if ((exec_handle = (HANDLE)OpenFile(fname, file_info,
    390                         OF_READ | OF_SHARE_COMPAT)) != (HANDLE)HFILE_ERROR) {
    391                 free(fname);
    392                 return(exec_handle);
     372        for (i = 0; extensions[i]; i++) {
     373                strcpy(ext, extensions[i]);
     374                if (((req_len = SearchPath (path_var, fname, NULL, full_len,
     375                                            full_fname, NULL)) > 0
     376                     /* For compatibility with previous code, which
     377                        used OpenFile, and with Windows operation in
     378                        general, also look in various default
     379                        locations, such as Windows directory and
     380                        Windows System directory.  Warning: this also
     381                        searches PATH in the Make's environment, which
     382                        might not be what the Makefile wants, but it
     383                        seems to be OK as a fallback, after the
     384                        previous SearchPath failed to find on child's
     385                        PATH.  */
     386                     || (req_len = SearchPath (NULL, fname, NULL, full_len,
     387                                               full_fname, NULL)) > 0)
     388                    && req_len <= full_len
     389                    && (exec_handle =
     390                                CreateFile(full_fname,
     391                                           GENERIC_READ,
     392                                           FILE_SHARE_READ | FILE_SHARE_WRITE,
     393                                           NULL,
     394                                           OPEN_EXISTING,
     395                                           FILE_ATTRIBUTE_NORMAL,
     396                                           NULL)) != INVALID_HANDLE_VALUE) {
     397                        free(fname);
     398                        return(exec_handle);
     399                }
    393400        }
    394401
    395402        free(fname);
    396         return(exec_handle);
     403        return INVALID_HANDLE_VALUE;
    397404}
    398405
     
    417424        int file_not_found=0;
    418425        HANDLE exec_handle;
     426        char exec_fname[MAX_PATH];
     427        const char *path_var = NULL;
     428        char **ep;
    419429        char buf[256];
    420430        DWORD bytes_returned;
     
    424434        PROCESS_INFORMATION procInfo;
    425435        char *envblk=NULL;
    426         OFSTRUCT file_info;
    427 
    428436
    429437        /*
     
    434442         *  assume it's in the path somewhere (generally, the NT tools
    435443         *  bin directory)
    436          *  We use OpenFile here because it is capable of searching the Path.
    437          */
    438 
    439         exec_handle = find_file(exec_path, &file_info);
     444         */
     445
     446        /* Use the Makefile's value of PATH to look for the program to
     447           execute, because it could be different from Make's PATH
     448           (e.g., if the target sets its own value.  */
     449        if (envp)
     450                for (ep = envp; *ep; ep++) {
     451                        if (strncmp (*ep, "PATH=", 5) == 0
     452                            || strncmp (*ep, "Path=", 5) == 0) {
     453                                path_var = *ep + 5;
     454                                break;
     455                        }
     456                }
     457        exec_handle = find_file(exec_path, path_var,
     458                                exec_fname, sizeof(exec_fname));
    440459
    441460        /*
    442          * If we couldn't open the file, just assume that Windows32 will be able
    443          * to find and execute it.
    444          */
    445         if (exec_handle == (HANDLE)HFILE_ERROR) {
     461         * If we couldn't open the file, just assume that Windows will be
     462         * somehow able to find and execute it.
     463         */
     464        if (exec_handle == INVALID_HANDLE_VALUE) {
    446465                file_not_found++;
    447466        }
     
    497516                command_line = make_command_line( shell_name, exec_path, argv);
    498517        else
    499                 command_line = make_command_line( shell_name, file_info.szPathName,
    500                                  argv);
     518                command_line = make_command_line( shell_name, exec_fname, argv);
    501519
    502520        if ( command_line == NULL ) {
     
    518536                exec_path = 0;  /* Search for the program in %Path% */
    519537        } else {
    520                 exec_path = file_info.szPathName;
     538                exec_path = exec_fname;
    521539        }
    522540
     
    563581        }
    564582
    565         pproc->pid = (int)procInfo.hProcess;
     583        pproc->pid = (pid_t)procInfo.hProcess;
    566584        /* Close the thread handle -- we'll just watch the process */
    567585        CloseHandle(procInfo.hThread);
  • vendor/gnumake/current/w32/subproc/w32err.c

    r1989 r2596  
    11/* Error handling for Windows
    22Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
    3 2006, 2007 Free Software Foundation, Inc.
     32006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
    44This file is part of GNU Make.
    55
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette