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/VS8.0/make_buildinfo.c

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