Changeset 455
- Timestamp:
- Jul 28, 2003, 12:21:05 AM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/src/emxomf/emxomfld.c
-
Property cvs2svn:cvs-rev
changed from
1.10
to1.11
r454 r455 34 34 #include <emx/getopt.h> 35 35 #include <alloca.h> 36 #include <sys/omflib.h> 36 37 #include "defs.h" 37 38 … … 425 426 szFilename[cchPath++] = '\\'; 426 427 428 /* Files we're looking for: 429 * 1. file with .lib extention. 430 * 2. file with .lib extention and lib prefix. 431 * 3. file with .a extention which is an OMF library. 432 * 4. file with .a extention and lib prefix which is an OMF library. 433 */ 427 434 strcat(strcpy(szFilename + cchPath, list->name), ".lib"); 428 435 fFound = !stat(szFilename, &s); … … 431 438 strcat(strcpy(strcpy(szFilename + cchPath, "lib") + 3, list->name), ".lib"); 432 439 fFound = !stat(szFilename, &s); 440 if (!fFound) 441 { 442 strcat(strcpy(szFilename + cchPath, list->name), ".a"); 443 fFound = !stat(szFilename, &s); 444 if (!fFound) 445 { 446 strcat(strcpy(strcpy(szFilename + cchPath, "lib") + 3, list->name), ".a"); 447 fFound = !stat(szFilename, &s); 448 } 449 /* 450 * Is this an OMF library? 451 * We will open it hand do some verification of the LIBHDR. 452 */ 453 if (fFound) 454 { 455 FILE *pFile = fopen(szFilename, "rb"); 456 fFound = 0; 457 if (pFile) 458 { 459 #pragma pack(1) 460 struct 461 { 462 byte rec_type; 463 word rec_len; 464 dword dict_offset; 465 word dict_blocks; 466 byte flags; 467 } libhdr; 468 #pragma pack() 469 if ( fread(&libhdr, 1, sizeof(libhdr), pFile) == sizeof(libhdr) 470 && libhdr.rec_type == LIBHDR 471 && libhdr.flags <= 1 /* ASSUME only first bit is used... */ 472 ) 473 { 474 int page_size = libhdr.rec_len + 3; 475 if ( page_size >= 16 476 && page_size <= 32768 477 && !(page_size & (page_size - 1)) != 0) 478 fFound = 1; 479 } 480 fclose(pFile); 481 } 482 } 483 } 433 484 } 434 485 } … … 437 488 438 489 put_arg (fFound ? szFilename : list->name, TRUE, TRUE); 490 //fprintf(stderr, "%s -> %s\n", list->name, fFound ? szFilename : strpbrk(list->name, ":\\/.") ? "not searched for" : "not found"); 439 491 } /* foreach list entry */ 440 492 } … … 541 593 char tmp[512], *t; 542 594 static char emxshell [200]; 595 596 /* Get options from response files (@filename) and wildcard (*.o) on the command. */ 597 _response (&argc, &argv); 598 _wildcard (&argc, &argv); 543 599 544 600 /* Drop EMXSHELL since it can point to a Unix shell which is bad for us */ -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.