Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/PC/VS7.1/make_buildinfo.c

    r2 r391  
    2222int make_buildinfo2()
    2323{
    24         struct _stat st;
    25         HKEY hTortoise;
    26         char command[500];
    27         DWORD type, size;
    28         if (_stat(".svn", &st) < 0)
    29                 return 0;
    30         /* Allow suppression of subwcrev.exe invocation if a no_subwcrev file is present. */
    31         if (_stat("no_subwcrev", &st) == 0)
    32                 return 0;
    33         if (RegOpenKey(HKEY_LOCAL_MACHINE, "Software\\TortoiseSVN", &hTortoise) != ERROR_SUCCESS &&
    34             RegOpenKey(HKEY_CURRENT_USER, "Software\\TortoiseSVN", &hTortoise) != ERROR_SUCCESS)
    35                 /* Tortoise not installed */
    36                 return 0;
    37         command[0] = '"';  /* quote the path to the executable */
    38         size = sizeof(command) - 1;
    39         if (RegQueryValueEx(hTortoise, "Directory", 0, &type, command+1, &size) != ERROR_SUCCESS ||
    40             type != REG_SZ)
    41                 /* Registry corrupted */
    42                 return 0;
    43         strcat(command, "bin\\subwcrev.exe");
    44         if (_stat(command+1, &st) < 0)
    45                 /* subwcrev.exe not part of the release */
    46                 return 0;
    47         strcat(command, "\" ..\\.. ..\\..\\Modules\\getbuildinfo.c getbuildinfo2.c");
    48         puts(command); fflush(stdout);
    49         if (system(command) < 0)
    50                 return 0;
    51         return 1;
     24    struct _stat st;
     25    HKEY hTortoise;
     26    char command[500];
     27    DWORD type, size;
     28    if (_stat(".svn", &st) < 0)
     29        return 0;
     30    /* Allow suppression of subwcrev.exe invocation if a no_subwcrev file is present. */
     31    if (_stat("no_subwcrev", &st) == 0)
     32        return 0;
     33    if (RegOpenKey(HKEY_LOCAL_MACHINE, "Software\\TortoiseSVN", &hTortoise) != ERROR_SUCCESS &&
     34        RegOpenKey(HKEY_CURRENT_USER, "Software\\TortoiseSVN", &hTortoise) != ERROR_SUCCESS)
     35        /* Tortoise not installed */
     36        return 0;
     37    command[0] = '"';  /* quote the path to the executable */
     38    size = sizeof(command) - 1;
     39    if (RegQueryValueEx(hTortoise, "Directory", 0, &type, command+1, &size) != ERROR_SUCCESS ||
     40        type != REG_SZ)
     41        /* Registry corrupted */
     42        return 0;
     43    strcat(command, "bin\\subwcrev.exe");
     44    if (_stat(command+1, &st) < 0)
     45        /* subwcrev.exe not part of the release */
     46        return 0;
     47    strcat(command, "\" ..\\.. ..\\..\\Modules\\getbuildinfo.c getbuildinfo2.c");
     48    puts(command); fflush(stdout);
     49    if (system(command) < 0)
     50        return 0;
     51    return 1;
    5252}
    5353
    5454int main(int argc, char*argv[])
    5555{
    56         char command[500] = "cl.exe -c -D_WIN32 -DUSE_DL_EXPORT -D_WINDOWS -DWIN32 -D_WINDLL ";
    57         int do_unlink, result;
    58         if (argc != 2) {
    59                 fprintf(stderr, "make_buildinfo $(ConfigurationName)\n");
    60                 return EXIT_FAILURE;
    61         }
    62         if (strcmp(argv[1], "Release") == 0) {
    63                 strcat(command, "-MD ");
    64         }
    65         else if (strcmp(argv[1], "Debug") == 0) {
    66                 strcat(command, "-D_DEBUG -MDd ");
    67         }
    68         else if (strcmp(argv[1], "ReleaseItanium") == 0) {
    69                 strcat(command, "-MD /USECL:MS_ITANIUM ");
    70         }
    71         else if (strcmp(argv[1], "ReleaseAMD64") == 0) {
    72                 strcat(command, "-MD ");
    73                 strcat(command, "-MD /USECL:MS_OPTERON ");
    74         }
    75         else {
    76                 fprintf(stderr, "unsupported configuration %s\n", argv[1]);
    77                 return EXIT_FAILURE;
    78         }
     56    char command[500] = "cl.exe -c -D_WIN32 -DUSE_DL_EXPORT -D_WINDOWS -DWIN32 -D_WINDLL ";
     57    int do_unlink, result;
     58    if (argc != 2) {
     59        fprintf(stderr, "make_buildinfo $(ConfigurationName)\n");
     60        return EXIT_FAILURE;
     61    }
     62    if (strcmp(argv[1], "Release") == 0) {
     63        strcat(command, "-MD ");
     64    }
     65    else if (strcmp(argv[1], "Debug") == 0) {
     66        strcat(command, "-D_DEBUG -MDd ");
     67    }
     68    else if (strcmp(argv[1], "ReleaseItanium") == 0) {
     69        strcat(command, "-MD /USECL:MS_ITANIUM ");
     70    }
     71    else if (strcmp(argv[1], "ReleaseAMD64") == 0) {
     72        strcat(command, "-MD ");
     73        strcat(command, "-MD /USECL:MS_OPTERON ");
     74    }
     75    else {
     76        fprintf(stderr, "unsupported configuration %s\n", argv[1]);
     77        return EXIT_FAILURE;
     78    }
    7979
    80         if ((do_unlink = make_buildinfo2()))
    81                 strcat(command, "getbuildinfo2.c -DSUBWCREV ");
    82         else
    83                 strcat(command, "..\\..\\Modules\\getbuildinfo.c");
    84         strcat(command, " -Fogetbuildinfo.o -I..\\..\\Include -I..\\..\\PC");
    85         puts(command); fflush(stdout);
    86         result = system(command);
    87         if (do_unlink)
    88                 unlink("getbuildinfo2.c");
    89         if (result < 0)
    90                 return EXIT_FAILURE;
    91         return 0;
     80    if ((do_unlink = make_buildinfo2()))
     81        strcat(command, "getbuildinfo2.c -DSUBWCREV ");
     82    else
     83        strcat(command, "..\\..\\Modules\\getbuildinfo.c");
     84    strcat(command, " -Fogetbuildinfo.o -I..\\..\\Include -I..\\..\\PC");
     85    puts(command); fflush(stdout);
     86    result = system(command);
     87    if (do_unlink)
     88        unlink("getbuildinfo2.c");
     89    if (result < 0)
     90        return EXIT_FAILURE;
     91    return 0;
    9292}
Note: See TracChangeset for help on using the changeset viewer.