comparison mkoctfile.cc.in @ 9955:33537a4d223f

mkoctfile.cc.in: accept long options with single -
author John W. Eaton <jwe@octave.org>
date Thu, 10 Dec 2009 01:28:26 -0500
parents 0d4613a736e9
children f26a33e21db9
comparison
equal deleted inserted replaced
9954:de6b6173c990 9955:33537a4d223f
411 { 411 {
412 cout << usage_msg << endl; 412 cout << usage_msg << endl;
413 return 1; 413 return 1;
414 } 414 }
415 415
416 if (argc == 2 && (!strcmp (argv[1], "-v") || !strcmp (argv[1], "--version"))) 416 if (argc == 2 && (!strcmp (argv[1], "-v")
417 || !strcmp (argv[1], "-version")
418 || !strcmp (argv[1], "--version")))
417 { 419 {
418 cout << version_msg << endl; 420 cout << version_msg << endl;
419 return 0; 421 return 0;
420 } 422 }
421 423
449 else if (ends_with (arg, ".lib") || ends_with (arg, ".a")) 451 else if (ends_with (arg, ".lib") || ends_with (arg, ".a"))
450 { 452 {
451 file = arg; 453 file = arg;
452 libfiles += (" " + quote_path (arg)); 454 libfiles += (" " + quote_path (arg));
453 } 455 }
454 else if (arg == "-d" || arg == "--debug" || arg == "-v" 456 else if (arg == "-d" || arg == "-debug" || arg == "--debug"
455 || arg == "--verbose") 457 || arg == "-v" || arg == "-verbose" || arg == "--verbose")
456 { 458 {
457 debug = true; 459 debug = true;
458 if (vars["CC"] == "cc-msvc") 460 if (vars["CC"] == "cc-msvc")
459 vars["CC"] += " -d"; 461 vars["CC"] += " -d";
460 if (vars["CXX"] == "cc-msvc") 462 if (vars["CXX"] == "cc-msvc")
461 vars["CXX"] += " -d"; 463 vars["CXX"] += " -d";
462 if (vars["DL_LD"] == "cc-msvc") 464 if (vars["DL_LD"] == "cc-msvc")
463 vars["DL_LD"] += " -d"; 465 vars["DL_LD"] += " -d";
464 } 466 }
465 else if (arg == "-h" || arg == "-?" || arg == "--help") 467 else if (arg == "-h" || arg == "-?" || arg == "-help" || arg == "--help")
466 { 468 {
467 cout << usage_msg << endl; 469 cout << usage_msg << endl;
468 cout << help_msg << endl; 470 cout << help_msg << endl;
469 return 0; 471 return 0;
470 } 472 }
489 else if (starts_with (arg, "-Wl,") || starts_with (arg, "-l") 491 else if (starts_with (arg, "-Wl,") || starts_with (arg, "-l")
490 || starts_with (arg, "-L") || starts_with (arg, "-R")) 492 || starts_with (arg, "-L") || starts_with (arg, "-R"))
491 { 493 {
492 ldflags += (" " + arg); 494 ldflags += (" " + arg);
493 } 495 }
494 else if (arg == "-M" || arg == "--depend") 496 else if (arg == "-M" || arg == "-depend" || arg == "--depend")
495 { 497 {
496 depend = true; 498 depend = true;
497 compile = false; 499 compile = false;
498 } 500 }
499 else if (arg == "-o" || arg == "--output") 501 else if (arg == "-o" || arg == "-output" || arg == "--output")
500 { 502 {
501 if (i < argc-1) 503 if (i < argc-1)
502 { 504 {
503 arg = argv[++i]; 505 arg = argv[++i];
504 outputfile = arg; 506 outputfile = arg;
505 } 507 }
506 else 508 else
507 cerr << "mkoctfile: output file name missing" << endl; 509 cerr << "mkoctfile: output file name missing" << endl;
508 } 510 }
509 else if (arg == "-p" || arg == "--print") 511 else if (arg == "-p" || arg == "-print" || arg == "--print")
510 { 512 {
511 if (i < argc-1) 513 if (i < argc-1)
512 { 514 {
513 arg = argv[++i]; 515 arg = argv[++i];
514 cout << vars[arg] << endl; 516 cout << vars[arg] << endl;
515 return 0; 517 return 0;
516 } 518 }
517 else 519 else
518 cerr << "mkoctfile: --print requires argument" << endl; 520 cerr << "mkoctfile: --print requires argument" << endl;
519 } 521 }
520 else if (arg == "-s" || arg == "--strip") 522 else if (arg == "-s" || arg == "-strip" || arg == "--strip")
521 { 523 {
522 if (no_oct_file_strip_on_this_platform) 524 if (no_oct_file_strip_on_this_platform)
523 cerr << "mkoctfile: stripping disabled on this platform" << endl; 525 cerr << "mkoctfile: stripping disabled on this platform" << endl;
524 else 526 else
525 strip = true; 527 strip = true;
526 } 528 }
527 else if (arg == "-c" || arg == "--compile") 529 else if (arg == "-c" || arg == "-compile" || arg == "--compile")
528 { 530 {
529 link = false; 531 link = false;
530 } 532 }
531 else if (arg == "-g") 533 else if (arg == "-g")
532 { 534 {
533 vars["ALL_CFLAGS"] += " -g"; 535 vars["ALL_CFLAGS"] += " -g";
534 vars["ALL_CXXFLAGS"] += " -g"; 536 vars["ALL_CXXFLAGS"] += " -g";
535 vars["ALL_FFLAGS"] += " -g"; 537 vars["ALL_FFLAGS"] += " -g";
536 } 538 }
537 else if (arg == "--link-stand-alone") 539 else if (arg == "-link-stand-alone" || arg == "--link-stand-alone")
538 { 540 {
539 link_stand_alone = true; 541 link_stand_alone = true;
540 } 542 }
541 else if (arg == "--mex") 543 else if (arg == "-mex" || arg == "--mex")
542 { 544 {
543 incflags += " -I."; 545 incflags += " -I.";
544 #ifdef _MSC_VER 546 #ifdef _MSC_VER
545 ldflags += " -Wl,-export:mexFunction"; 547 ldflags += " -Wl,-export:mexFunction";
546 #endif 548 #endif