Warning: Undefined variable $n in /usr/local/www/websvn.planix.org/include/diff_util.php on line 243

Warning: Undefined variable $n in /usr/local/www/websvn.planix.org/include/diff_util.php on line 247

Warning: Undefined variable $m in /usr/local/www/websvn.planix.org/include/diff_util.php on line 251
WebSVN – tendra.SVN – Diff – /trunk/src/tools/tcc/flags.c – Rev 2 and 7

Subversion Repositories tendra.SVN

Rev

Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 7
Line -... Line 1...
-
 
1
/*
-
 
2
 * Copyright (c) 2002-2005 The TenDRA Project <http://www.tendra.org/>.
-
 
3
 * All rights reserved.
-
 
4
 *
-
 
5
 * Redistribution and use in source and binary forms, with or without
-
 
6
 * modification, are permitted provided that the following conditions are met:
-
 
7
 *
-
 
8
 * 1. Redistributions of source code must retain the above copyright notice,
-
 
9
 *    this list of conditions and the following disclaimer.
-
 
10
 * 2. Redistributions in binary form must reproduce the above copyright notice,
-
 
11
 *    this list of conditions and the following disclaimer in the documentation
-
 
12
 *    and/or other materials provided with the distribution.
-
 
13
 * 3. Neither the name of The TenDRA Project nor the names of its contributors
-
 
14
 *    may be used to endorse or promote products derived from this software
-
 
15
 *    without specific, prior written permission.
-
 
16
 *
-
 
17
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
-
 
18
 * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-
 
19
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-
 
20
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
-
 
21
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-
 
22
 * EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-
 
23
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-
 
24
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-
 
25
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-
 
26
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-
 
27
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
 
28
 *
-
 
29
 * $Id$
-
 
30
 */
1
/*
31
/*
2
    		 Crown Copyright (c) 1997
32
    		 Crown Copyright (c) 1997
3
    
33
 
4
    This TenDRA(r) Computer Program is subject to Copyright
34
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
35
    owned by the United Kingdom Secretary of State for Defence
6
    acting through the Defence Evaluation and Research Agency
36
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
37
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
38
    royalty-free licence for its use, reproduction, transfer
9
    to other parties and amendment for any purpose not excluding
39
    to other parties and amendment for any purpose not excluding
10
    product development provided that any such use et cetera
40
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
41
    shall be deemed to be acceptance of the following conditions:-
12
    
42
 
13
        (1) Its Recipients shall ensure that this Notice is
43
        (1) Its Recipients shall ensure that this Notice is
14
        reproduced upon any copies or amended versions of it;
44
        reproduced upon any copies or amended versions of it;
15
    
45
 
16
        (2) Any amended version of it shall be clearly marked to
46
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
47
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
48
        for the relevant amendment or amendments;
19
    
49
 
20
        (3) Its onward transfer from a recipient to another
50
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
51
        party shall be deemed to be that party's acceptance of
22
        these conditions;
52
        these conditions;
23
    
53
 
24
        (4) DERA gives no warranty or assurance as to its
54
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
55
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
56
        no liability whatsoever in relation to any use to which
27
        it may be put.
57
        it may be put.
28
*/
58
*/
Line 36... Line 66...
36
#include "environ.h"
66
#include "environ.h"
37
#include "flags.h"
67
#include "flags.h"
38
#include "startup.h"
68
#include "startup.h"
39
#include "suffix.h"
69
#include "suffix.h"
40
#include "utility.h"
70
#include "utility.h"
390
		}
473
		}
-
 
474
	}
-
 
475
	return;
-
 
476
}
-
 
477
 
-
 
478
 
-
 
479
/*
-
 
480
 * SET THE MACHINE NAME
-
 
481
 *
-
 
482
 * This routine sets any special flags required by the machine indicated by
-
 
483
 * machine_name.
-
 
484
 */
-
 
485
 
-
 
486
void
-
 
487
set_machine(void)
-
 
488
{
-
 
489
#if 0
-
 
490
	char *mach = machine_name;
-
 
491
	use_assembler = 1;
-
 
492
	use_mips_assembler = 0;
-
 
493
	use_alpha_assembler = 0;
-
 
494
	use_hp_linker = 0;
-
 
495
	if (streq(mach, "hp") || streq(mach, "hppa")) {
-
 
496
		use_hp_linker = 1;
-
 
497
	} else if (streq(mach, "mips")) {
-
 
498
		use_mips_assembler = 1;
-
 
499
	} else if (streq(mach, "alpha")) {
-
 
500
		use_alpha_assembler = 1;
-
 
501
	} else if (streq(mach, "sparc") || streq(mach, "svr4_sparc")) {
391
		case INDEP_TDF :
502
		use_sparc_cc = 1;
-
 
503
	} else if (streq(mach, "svr4_i386")) {
-
 
504
		use_sparc_cc = 2;
-
 
505
	} else if (streq(mach, "transputer")) {
392
		case C_SPEC :
506
		use_assembler = 0;
-
 
507
	}
-
 
508
#endif
-
 
509
	return;
-
 
510
}
-
 
511
 
-
 
512
 
-
 
513
/*
-
 
514
 * INITIALISE ALL OPTIONS
-
 
515
 *
-
 
516
 * This routine initialises any necessary values before the command-line
-
 
517
 * options are read.
-
 
518
 */
-
 
519
 
-
 
520
void
-
 
521
initialise_options(void)
-
 
522
{
-
 
523
	/* Initialise executables */
-
 
524
	list *p;
-
 
525
	int sz;
-
 
526
	int i;
-
 
527
	exec_produce = make_list("builtin/undef C_producer");
-
 
528
	exec_preproc = make_list("builtin/undef C_preprocessor");
-
 
529
	exec_cpp_produce = make_list("builtin/undef C++_producer");
-
 
530
	exec_cpp_preproc = make_list("builtin/undef C++_preprocessor");
-
 
531
	exec_tdf_link = make_list("builtin/undef TDF_linker");
-
 
532
	exec_translate = make_list("builtin/undef TDF_translator");
-
 
533
	exec_assemble = make_list("builtin/undef system_assembler");
-
 
534
	exec_assemble_mips = make_list("builtin/undef mips_assembler");
-
 
535
	exec_link = make_list("builtin/undef system_linker");
-
 
536
	exec_notation = make_list("builtin/undef TDF_notation_compiler");
-
 
537
	exec_pl_tdf = make_list("builtin/undef PL_TDF_compiler");
-
 
538
	exec_pretty = make_list("builtin/undef TDF_pretty_printer");
-
 
539
	exec_spec_link = make_list("builtin/undef C_spec_linker");
-
 
540
	exec_cpp_spec_link = make_list("builtin/undef C++_spec_linker");
-
 
541
	exec_split_arch = make_list("builtin/split_archive");
-
 
542
	exec_build_arch = make_list("builtin/build_archive");
-
 
543
	exec_cat = make_list("builtin/cat");
-
 
544
	exec_cc = make_list("builtin/undef system_compiler");
-
 
545
	exec_mkdir = make_list("builtin/mkdir");
-
 
546
	exec_move = make_list("builtin/move");
-
 
547
	exec_remove = make_list("builtin/remove");
-
 
548
	exec_touch = make_list("builtin/touch");
-
 
549
	exec_dynlink = make_list("builtin/undef dynamic_initialiser");
-
 
550
 
-
 
551
	/* Initialise other options */
-
 
552
	find_envpath();
-
 
553
	for (p = opt_startup; p != null; p = p->next) {
-
 
554
		add_to_startup(p->item);
-
 
555
	}
-
 
556
	for (p = opt_endup; p != null; p = p->next) {
-
 
557
		add_to_endup(p->item);
-
 
558
	}
-
 
559
	if (checker) {
-
 
560
		allow_specs = 1;
-
 
561
	}
-
 
562
 
-
 
563
	/* allocate space for cmd line env args */
-
 
564
	sz = (sizeof(PATH_SUBS));
-
 
565
	env_paths = (char**) xalloc (sz * sizeof(char *));
-
 
566
 
-
 
567
	/* Here, we should set these to sane defaults.  For now, just NULL */
-
 
568
	for (i=0; i < sz; i++) {
-
 
569
		env_paths[i] = NULL;
-
 
570
	}
-
 
571
	return;
-
 
572
}
-
 
573
 
-
 
574
 
-
 
575
/*
-
 
576
 * UPDATE ALL OPTIONS
-
 
577
 *
-
 
578
 * This routine updates the values of the variables above after all the
-
 
579
 * command-line options have been read. The stops options need to be kept in
-
 
580
 * step with the general compilation scheme given in compile.c. Deciding which
-
 
581
 * versions of certain file types to preserve (INDEP_TDF and C_SPEC in
-
 
582
 * particular) gets pretty messy.
-
 
583
 */
-
 
584
 
-
 
585
void
-
 
586
update_options(void)
-
 
587
{
-
 
588
	char *mode = null;
-
 
589
	static boolean done_diag = 0;
-
 
590
	static boolean done_preproc = 0;
-
 
591
	static boolean done_prof = 0;
-
 
592
	static boolean done_time = 0;
-
 
593
 
-
 
594
	/* Process archive options */
-
 
595
	process_archive_opt();
-
 
596
 
-
 
597
	/* Deal with cc mode */
-
 
598
	if (checker) {
-
 
599
		mode = "checker";
-
 
600
	}
-
 
601
	if (use_system_cc) {
393
		case CPP_SPEC : {
602
		if (!checker) {
394
		    if ( t == C_SPEC || t == CPP_SPEC ) break ;
603
			error(WARNING, "Using the system C compiler");
-
 
604
		}
-
 
605
		mode = "system compiler";
-
 
606
	}
-
 
607
	if (mode) {
-
 
608
		if (make_archive) {
-
 
609
			error(WARNING, "Can't build TDF archive in %s mode",
-
 
610
			      mode);
395
		    if ( t == INDEP_TDF ) break ;
611
			stops[INDEP_TDF] = 1;
-
 
612
			make_archive = 0;
-
 
613
		}
-
 
614
		if (make_complex) {
-
 
615
			error(WARNING, "Can't build TDF complex in %s mode",
396
		    goto default_lab ;
616
			      mode);
-
 
617
			make_complex = 0;
397
		}
618
		}
398
		case PREPROC_C :
-
 
399
		case PREPROC_CPP : {
619
		if (make_pretty) {
400
		    if ( t == PREPROC_CPP ) {
620
			error(WARNING, "Can't pretty print TDF in %s mode",
401
			break ;
621
			      mode);
402
		    }
622
			stops[INDEP_TDF] = 1;
403
		    goto default_lab ;
623
			make_pretty = 0;
404
		}
624
		}
405
		default :
-
 
406
		default_lab : {
625
		allow_notation = 0;
407
		    if ( t != last_stop ) {
-
 
408
			error ( WARNING, "More than one stop option given" ) ;
-
 
409
		    }
-
 
410
		    break ;
626
		allow_pl_tdf = 0;
411
		}
627
	}
412
	    }
628
 
413
	    last_stop = t ;
629
	/* Register extra stops */
414
	} else if ( k == KEEP_STAGE ) {
630
	if (make_archive) {
415
	    if ( keeps [t] == 0 ) keeps [t] = 1 ;
631
		set_stage(TDF_ARCHIVE, STOP_STAGE);
-
 
632
	}
416
	    keeps_aux [t] = 1 ;
633
	if (make_preproc) {
417
	    if ( t == BINARY_OBJ ) keep_ofiles = 1 ;
-
 
418
	} else if ( k == DONT_KEEP_STAGE ) {
634
		set_stage(PREPROC_C, STOP_ONLY_STAGE);
419
	    if ( keeps [t] == 1 ) keeps [t] = 0 ;
-
 
420
	    keeps_aux [t] = 2 ;
-
 
421
	    if ( t == BINARY_OBJ ) keep_ofiles = 0 ;
635
		set_stage(PREPROC_CPP, STOP_ONLY_STAGE);
422
	}
636
	}
423
    }
-
 
424
    return ;
637
	if (make_pretty) {
-
 
638
		set_stage(PRETTY_TDF, STOP_STAGE);
425
}
639
	}
426
 
640
 
-
 
641
	/* Read special environments etc. */
-
 
642
	if (make_preproc && keeps[PREPROC_C] && !done_preproc) {
-
 
643
		read_env(PREPROC_ENV);
-
 
644
		done_preproc = 1;
-
 
645
	}
-
 
646
	if (flag_diag && !done_diag) {
-
 
647
		read_env(DIAG_ENV);
-
 
648
		done_diag = 1;
-
 
649
	}
-
 
650
	if (flag_prof && !done_prof) {
-
 
651
		read_env(PROF_ENV);
-
 
652
		done_prof = 1;
-
 
653
	}
-
 
654
	if (time_commands && !done_time) {
-
 
655
		read_env(TIME_ENV);
-
 
656
		done_time = 1;
-
 
657
	}
427
 
658
 
-
 
659
	/* Print API information */
-
 
660
	if (show_api) {
-
 
661
		error(INFO, "API is %s", api_info);
-
 
662
		show_api = 0;
428
/*
663
	}
429
    SET THE MACHINE NAME
-
 
430
 
664
 
431
    This routine sets any special flags required by the machine indicated
-
 
432
    by machine_name.
-
 
433
*/
-
 
434
 
-
 
435
void set_machine
-
 
436
    PROTO_Z ()
-
 
437
{
-
 
438
#if 0
665
#if 0
439
    char *mach = machine_name ;
-
 
440
    use_assembler = 1 ;
-
 
441
    use_mips_assembler = 0 ;
-
 
442
    use_alpha_assembler = 0 ;
-
 
443
    use_hp_linker = 0 ;
-
 
444
    if ( streq ( mach, "hp" ) || streq ( mach, "hppa" ) ) {
-
 
445
	use_hp_linker = 1 ;
-
 
446
    } else if ( streq ( mach, "mips" ) ) {
666
	/* The option -Fk means stop after producer */
447
	use_mips_assembler = 1 ;
-
 
448
    } else if ( streq ( mach, "alpha" ) ) {
667
	if (stops[C_SPEC] || stops[CPP_SPEC] ||
449
      use_alpha_assembler = 1 ;
-
 
450
    } else if ( streq ( mach, "sparc" ) || streq ( mach, "svr4_sparc" ) ) {
-
 
451
	use_sparc_cc = 1 ;
-
 
452
    } else if ( streq ( mach, "svr4_i386" ) ) {
668
	    stops[PREPROC_C] || stops[PREPROC_CPP]) {
453
	use_sparc_cc = 2 ;
669
		stops[INDEP_TDF] = 1;
454
    } else if ( streq ( mach, "transputer" ) ) {
-
 
455
	use_assembler = 0 ;
-
 
456
    }
670
	}
457
#endif
671
#endif
458
    return ;
-
 
459
}
-
 
460
 
-
 
461
 
-
 
462
/*
-
 
463
    INITIALISE ALL OPTIONS
-
 
464
 
-
 
465
    This routine initialises any necessary values before the
-
 
466
    command-line options are read.
-
 
467
*/
-
 
468
 
-
 
469
void initialise_options
-
 
470
    PROTO_Z ()
-
 
471
{
-
 
472
    /* Initialise executables */
-
 
473
    list *p ;
-
 
474
    exec_produce = make_list ( "builtin/undef C_producer" ) ;
-
 
475
    exec_preproc = make_list ( "builtin/undef C_preprocessor" ) ;
-
 
476
    exec_cpp_produce = make_list ( "builtin/undef C++_producer" ) ;
-
 
477
    exec_cpp_preproc = make_list ( "builtin/undef C++_preprocessor" ) ;
-
 
478
    exec_tdf_link = make_list ( "builtin/undef TDF_linker" ) ;
-
 
479
    exec_translate = make_list ( "builtin/undef TDF_translator" ) ;
-
 
480
    exec_assemble = make_list ( "builtin/undef system_assembler" ) ;
-
 
481
    exec_assemble_mips = make_list ( "builtin/undef mips_assembler" ) ;
-
 
482
    exec_link = make_list ( "builtin/undef system_linker" ) ;
-
 
483
    exec_notation = make_list ( "builtin/undef TDF_notation_compiler" ) ;
-
 
484
    exec_pl_tdf = make_list ( "builtin/undef PL_TDF_compiler" ) ;
-
 
485
    exec_pretty = make_list ( "builtin/undef TDF_pretty_printer" ) ;
-
 
486
    exec_spec_link = make_list ( "builtin/undef C_spec_linker" ) ;
-
 
487
    exec_cpp_spec_link = make_list ( "builtin/undef C++_spec_linker" ) ;
-
 
488
    exec_split_arch = make_list ( "builtin/split_archive" ) ;
-
 
489
    exec_build_arch = make_list ( "builtin/build_archive" ) ;
-
 
490
    exec_cat = make_list ( "builtin/cat" ) ;
-
 
491
    exec_cc = make_list ( "builtin/undef system_compiler" ) ;
-
 
492
    exec_mkdir = make_list ( "builtin/mkdir" ) ;
-
 
493
    exec_move = make_list ( "builtin/move" ) ;
-
 
494
    exec_remove = make_list ( "builtin/remove" ) ;
-
 
495
    exec_touch = make_list ( "builtin/touch" ) ;
-
 
496
    exec_dynlink = make_list ( "builtin/undef dynamic_initialiser" ) ;
-
 
497
 
-
 
498
    /* Initialise other options */
-
 
499
    find_envpath () ;
-
 
500
    for ( p = opt_startup ; p != null ; p = p->next ) {
-
 
501
	add_to_startup ( p->item ) ;
-
 
502
    }
-
 
503
    for ( p = opt_endup ; p != null ; p = p->next ) {
-
 
504
	add_to_endup ( p->item ) ;
-
 
505
    }
-
 
506
    if ( checker ) allow_specs = 1 ;
-
 
507
    return ;
-
 
508
}
-
 
509
 
-
 
510
 
-
 
511
/*
-
 
512
    UPDATE ALL OPTIONS
-
 
513
 
-
 
514
    This routine updates the values of the variables above after all the
-
 
515
    command-line options have been read.  The stops options need to be
-
 
516
    kept in step with the general compilation scheme given in compile.c.
-
 
517
    Deciding which versions of certain file types to preserve (INDEP_TDF
-
 
518
    and C_SPEC in particular) gets pretty messy.
-
 
519
*/
-
 
520
 
672
 
521
void update_options
673
	/* Propagate stop options down */
-
 
674
	if (stops[INDEP_TDF]) {
-
 
675
		stops[INDEP_TDF_COMPLEX] = 1;
522
    PROTO_Z ()
676
		stops[DEP_TDF] = 1;
523
{
-
 
-
 
677
		stops[AS_SOURCE] = 1;
-
 
678
		stops[BINARY_OBJ] = 1;
-
 
679
	} else if (stops[DEP_TDF]) {
-
 
680
		stops[AS_SOURCE] = 1;
524
    char *mode = null ;
681
		stops[BINARY_OBJ] = 1;
-
 
682
	} else if (stops[AS_SOURCE]) {
525
    static boolean done_diag = 0 ;
683
		stops[BINARY_OBJ] = 1;
526
    static boolean done_preproc = 0 ;
684
	} else if (stops[MIPS_G_FILE]) {
-
 
685
		stops[BINARY_OBJ] = 1;
527
    static boolean done_prof = 0 ;
686
	} else if (stops[MIPS_T_FILE]) {
528
    static boolean done_time = 0 ;
687
		stops[BINARY_OBJ] = 1;
-
 
688
	}
529
 
689
 
530
    /* Process archive options */
690
	/* Check keep options */
-
 
691
	if (make_complex) {
531
    process_archive_opt () ;
692
		if (keeps[INDEP_TDF]) {
-
 
693
			keeps[INDEP_TDF] = keep_all;
-
 
694
			keeps[INDEP_TDF_COMPLEX] = 1;
532
 
695
		}
-
 
696
		if (stops[INDEP_TDF]) {
533
    /* Deal with cc mode */
697
			keeps[C_SPEC_1] = 1;
534
    if ( checker ) mode = "checker" ;
698
			keeps[CPP_SPEC_1] = 1;
-
 
699
		}
-
 
700
	}
535
    if ( use_system_cc ) {
701
	if (keeps[C_SPEC]) {
536
	if ( !checker ) {
702
		if (make_complex) {
537
	    error ( WARNING, "Using the system C compiler" ) ;
703
			keeps[C_SPEC] = keep_all;
-
 
704
			keeps[C_SPEC_1] = 1;
538
	}
705
		}
-
 
706
	} else {
-
 
707
		if (keeps_aux[C_SPEC] == 2) {
-
 
708
			keeps[C_SPEC_1] = 0;
539
	mode = "system compiler" ;
709
			keeps[C_SPEC_2] = 0;
540
    }
710
		}
-
 
711
	}
541
    if ( mode ) {
712
	if (keeps[CPP_SPEC]) {
542
	if ( make_archive ) {
713
		if (make_complex) {
-
 
714
			keeps[CPP_SPEC] = keep_all;
-
 
715
			keeps[CPP_SPEC_1] = 1;
-
 
716
		}
543
	    error ( WARNING, "Can't build TDF archive in %s mode", mode ) ;
717
	} else if (keeps_aux[CPP_SPEC] == 2) {
544
	    stops [ INDEP_TDF ] = 1 ;
718
		keeps[CPP_SPEC_1] = 0;
545
	    make_archive = 0 ;
719
		keeps[CPP_SPEC_2] = 0;
546
	}
720
	}
-
 
721
	if (keep_ofiles && no_input_files > 1 && !make_complex) {
547
	if ( make_complex ) {
722
		keeps[BINARY_OBJ] = 1;
-
 
723
	}
548
	    error ( WARNING, "Can't build TDF complex in %s mode", mode ) ;
724
	if (keeps_aux[BINARY_OBJ] == 1) {
549
	    make_complex = 0 ;
725
		keeps[BINARY_OBJ_AUX] = 1;
550
	}
726
	}
551
	if ( make_pretty ) {
727
	if (link_specs) {
-
 
728
		boolean b;
-
 
729
		if (checker && !use_system_cc) {
-
 
730
			if (keeps_aux[BINARY_OBJ]) {
-
 
731
				b = 1;
552
	    error ( WARNING, "Can't pretty print TDF in %s mode", mode ) ;
732
			} else if (stops[BINARY_OBJ] && !stops[AS_SOURCE]) {
-
 
733
				b = keeps[BINARY_OBJ];
-
 
734
			} else {
-
 
735
				b = 0;
-
 
736
			}
-
 
737
		} else {
-
 
738
			b = keeps[BINARY_OBJ];
-
 
739
		}
-
 
740
		if (b) {
-
 
741
			if (make_complex) {
-
 
742
				keeps[C_SPEC_1] = 1;
-
 
743
				keeps[CPP_SPEC_1] = 1;
-
 
744
			} else {
-
 
745
				keeps[C_SPEC] = 1;
553
	    stops [ INDEP_TDF ] = 1 ;
746
				keeps[CPP_SPEC] = 1;
-
 
747
			}
-
 
748
			keeps[BINARY_OBJ_AUX] = 1;
-
 
749
		}
-
 
750
	}
-
 
751
 
-
 
752
	/* Set checker options */
-
 
753
	if (checker) {
554
	    make_pretty = 0 ;
754
		if (allow_specs == 0) {
-
 
755
			allow_specs = 1;
-
 
756
		}
-
 
757
		if (!use_system_cc) {
-
 
758
			stops[C_SPEC_2] = 1;
-
 
759
			stops[CPP_SPEC_2] = 1;
-
 
760
		}
555
	}
761
	}
556
	allow_notation = 0 ;
-
 
557
	allow_pl_tdf = 0 ;
-
 
558
    }
-
 
559
 
762
 
560
    /* Register extra stops */
-
 
561
    if ( make_archive ) set_stage ( TDF_ARCHIVE, STOP_STAGE ) ;
-
 
562
    if ( make_preproc ) {
-
 
563
	set_stage ( PREPROC_C, STOP_ONLY_STAGE ) ;
-
 
564
	set_stage ( PREPROC_CPP, STOP_ONLY_STAGE ) ;
-
 
565
    }
-
 
566
    if ( make_pretty ) set_stage ( PRETTY_TDF, STOP_STAGE ) ;
-
 
567
 
-
 
568
    /* Read special environments etc. */
-
 
569
    if ( make_preproc && keeps [ PREPROC_C ] && !done_preproc ) {
-
 
570
	read_env ( PREPROC_ENV ) ;
-
 
571
	done_preproc = 1 ;
-
 
572
    }
-
 
573
    if ( flag_diag && !done_diag ) {
-
 
574
	read_env ( DIAG_ENV ) ;
-
 
575
	done_diag = 1 ;
-
 
576
    }
-
 
577
    if ( flag_prof && !done_prof ) {
-
 
578
	read_env ( PROF_ENV ) ;
-
 
579
	done_prof = 1 ;
-
 
580
    }
-
 
581
    if ( time_commands && !done_time ) {
-
 
582
	read_env ( TIME_ENV ) ;
-
 
583
	done_time = 1 ;
-
 
584
    }
-
 
585
 
-
 
586
    /* Print API information */
-
 
587
    if ( show_api ) {
-
 
588
	error ( INFO, "API is %s", api_info ) ;
-
 
589
	show_api = 0 ;
-
 
590
    }
-
 
591
 
-
 
592
#if 0
-
 
593
    /* The option -Fk means stop after producer */
763
	/* Print the copyright message if required */
594
    if ( stops [ C_SPEC ] || stops [ CPP_SPEC ] ||
-
 
595
	 stops [ PREPROC_C ] || stops [ PREPROC_CPP ] ) {
-
 
596
	stops [ INDEP_TDF ] = 1 ;
-
 
597
    }
-
 
598
#endif
-
 
599
 
-
 
600
    /* Propagate stop options down */
-
 
601
    if ( stops [ INDEP_TDF ] ) {
-
 
602
	stops [ INDEP_TDF_COMPLEX ] = 1 ;
-
 
603
	stops [ DEP_TDF ] = 1 ;
-
 
604
	stops [ AS_SOURCE ] = 1 ;
-
 
605
	stops [ BINARY_OBJ ] = 1 ;
-
 
606
    } else if ( stops [ DEP_TDF ] ) {
-
 
607
	stops [ AS_SOURCE ] = 1 ;
-
 
608
	stops [ BINARY_OBJ ] = 1 ;
-
 
609
    } else if ( stops [ AS_SOURCE ] ) {
-
 
610
	stops [ BINARY_OBJ ] = 1 ;
-
 
611
    } else if ( stops [ MIPS_G_FILE ] ) {
-
 
612
	stops [ BINARY_OBJ ] = 1 ;
-
 
613
    } else if ( stops [ MIPS_T_FILE ] ) {
-
 
614
	stops [ BINARY_OBJ ] = 1 ;
-
 
615
    }
-
 
616
 
-
 
617
    /* Check keep options */
-
 
618
    if ( make_complex ) {
-
 
619
	if ( keeps [ INDEP_TDF ] ) {
-
 
620
	    keeps [ INDEP_TDF ] = keep_all ;
-
 
621
	    keeps [ INDEP_TDF_COMPLEX ] = 1 ;
-
 
622
	}
-
 
623
	if ( stops [ INDEP_TDF ] ) {
-
 
624
	    keeps [ C_SPEC_1 ] = 1 ;
-
 
625
	    keeps [ CPP_SPEC_1 ] = 1 ;
-
 
626
	}
-
 
627
    }
-
 
628
    if ( keeps [ C_SPEC ] ) {
-
 
629
	if ( make_complex ) {
764
	if (copyright) {
630
	    keeps [ C_SPEC ] = keep_all ;
-
 
631
	    keeps [ C_SPEC_1 ] = 1 ;
-
 
632
	}
-
 
633
    } else {
-
 
634
	if ( keeps_aux [ C_SPEC ] == 2 ) {
-
 
635
	    keeps [ C_SPEC_1 ] = 0 ;
-
 
636
	    keeps [ C_SPEC_2 ] = 0 ;
-
 
637
	}
-
 
638
    }
-
 
639
    if ( keeps [ CPP_SPEC ] ) {
-
 
640
	if ( make_complex ) {
765
		print_copyright();
641
	    keeps [ CPP_SPEC ] = keep_all ;
-
 
642
	    keeps [ CPP_SPEC_1 ] = 1 ;
-
 
643
	}
-
 
644
    } else if ( keeps_aux [ CPP_SPEC ] == 2 ) {
-
 
645
	keeps [ CPP_SPEC_1 ] = 0 ;
-
 
646
	keeps [ CPP_SPEC_2 ] = 0 ;
-
 
647
    }
-
 
648
    if ( keep_ofiles && no_input_files > 1 && !make_complex ) {
-
 
649
	keeps [ BINARY_OBJ ] = 1 ;
-
 
650
    }
-
 
651
    if ( keeps_aux [ BINARY_OBJ ] == 1 ) {
-
 
652
	keeps [ BINARY_OBJ_AUX ] = 1 ;
-
 
653
    }
-
 
654
    if ( link_specs ) {
-
 
655
	boolean b ;
766
		copyright = 0;
656
	if ( checker && !use_system_cc ) {
-
 
657
	    if ( keeps_aux [ BINARY_OBJ ] ) {
-
 
658
		b = 1 ;
-
 
659
	    } else if ( stops [ BINARY_OBJ ] && !stops [ AS_SOURCE ] ) {
-
 
660
		b = keeps [ BINARY_OBJ ] ;
-
 
661
	    } else {
-
 
662
		b = 0 ;
-
 
663
	    }
-
 
664
	} else {
-
 
665
	    b = keeps [ BINARY_OBJ ] ;
-
 
666
	}
-
 
667
	if ( b ) {
-
 
668
	    if ( make_complex ) {
-
 
669
		keeps [ C_SPEC_1 ] = 1 ;
-
 
670
		keeps [ CPP_SPEC_1 ] = 1 ;
-
 
671
	    } else {
-
 
672
		keeps [ C_SPEC ] = 1 ;
-
 
673
		keeps [ CPP_SPEC ] = 1 ;
-
 
674
	    }
-
 
675
	    keeps [ BINARY_OBJ_AUX ] = 1 ;
-
 
676
	}
-
 
677
    }
-
 
678
 
-
 
679
    /* Set checker options */
-
 
680
    if ( checker ) {
-
 
681
	if ( allow_specs == 0 ) allow_specs = 1 ;
-
 
682
	if ( !use_system_cc ) {
-
 
683
	    stops [ C_SPEC_2 ] = 1 ;
-
 
684
	    stops [ CPP_SPEC_2 ] = 1 ;
-
 
685
	}
767
	}
686
    }
-
 
687
 
-
 
688
    /* Print the copyright message if required */
-
 
689
    if ( copyright ) {
-
 
690
	print_copyright () ;
-
 
691
	copyright = 0 ;
-
 
692
    }
-
 
693
 
768
 
694
    /* A couple of housekeeping routines */
769
	/* A couple of housekeeping routines */
695
    close_startup () ;
770
	close_startup();
696
    find_envpath () ;
771
	find_envpath();
697
    return ;
772
	return;
698
}
773
}