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 – /branches/tendra5/src/tools/tcc/compile.c – Rev 5 and 6

Subversion Repositories tendra.SVN

Rev

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

Rev 5 Rev 6
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 39... Line 69...
39
#include "options.h"
69
#include "options.h"
40
#include "stages.h"
70
#include "stages.h"
41
#include "startup.h"
71
#include "startup.h"
42
#include "suffix.h"
72
#include "suffix.h"
43
#include "utility.h"
73
#include "utility.h"
214
		}
275
		}
215
	    }
276
		tried = 1;
216
	}
277
	}
217
	output = add_filename ( output, p ) ;
-
 
218
	if ( ps ) output = add_filename ( output, ps ) ;
-
 
219
	p = pn ;
-
 
220
    }
-
 
221
    return ( output ) ;
-
 
222
}
-
 
223
 
-
 
224
 
-
 
225
/*
-
 
226
    APPLY THE TDF LINKER
-
 
227
 
-
 
228
    This routine applies the TDF linker to p, returning the result.
-
 
229
*/
-
 
230
 
-
 
231
static filename *apply_tdf_link
-
 
232
    PROTO_N ( ( p ) )
-
 
233
    PROTO_T ( filename *p )
-
 
234
{
-
 
235
    static boolean tried = 0 ;
-
 
236
    if ( p == null || stops [ INDEP_TDF ] ) return ( p ) ;
-
 
237
    if ( tokdef_name && tokdef_output == null && !tried ) {
-
 
238
	filename *q ;
-
 
239
	if ( !allow_notation ) read_env ( TNC_ENV ) ;
-
 
240
	q = find_filename ( tokdef_name, PRETTY_TDF ) ;
-
 
241
	q = do_notation ( q ) ;
-
 
242
	if ( q ) tokdef_output = q->name ;
-
 
243
	tried = 1 ;
-
 
244
    }
-
 
245
    return ( do_tdf_link ( p ) ) ;
278
	return (do_tdf_link(p));
246
}
279
}
247
 
280
 
248
 
281
 
249
/*
282
/*
250
    APPLY THE MAIN COMPILATION STAGES
283
 * APPLY THE MAIN COMPILATION STAGES
-
 
284
 *
-
 
285
 * This routine applies the main compilation phases to the input files input,
-
 
286
 * and returns the corresponding output files. If produce is true then the
-
 
287
 * compilation stops at the target independent TDF stage. This, and all the
-
 
288
 * routines in this module, needs to be kept in step with Table 1.
-
 
289
 */
251
 
290
 
252
    This routine applies the main compilation phases to the input files
-
 
253
    input, and returns the corresponding output files.  If produce is
-
 
254
    true then the compilation stops at the target independent TDF stage.
-
 
255
    This, and all the routines in this module, needs to be kept in step
-
 
256
    with Table 1.
-
 
257
*/
-
 
258
 
-
 
259
static filename *apply_compile
291
static filename *
260
    PROTO_N ( ( input, produce ) )
-
 
261
    PROTO_T ( filename *input X int produce )
292
apply_compile(filename *input, int produce)
262
{
293
{
263
    filename *p = input ;
294
	filename *p = input;
264
    filename *output = null ;
295
	filename *output = null;
-
 
296
	if (use_system_cc) {
265
    if ( use_system_cc ) return ( apply_cc ( input ) ) ;
297
		return (apply_cc(input));
-
 
298
	}
266
    while ( p != null ) {
299
	while (p != null) {
267
	filename *pc = p ;
300
		filename *pc = p;
268
	filename *pn = p->next ;
301
		filename *pn = p->next;
269
	p->next = null ;
302
		p->next = null;
270
	switch ( p->type ) {
303
		switch (p->type) {
-
 
304
		case C_SOURCE:
-
 
305
			/* C source */
-
 
306
			if (keeps[PREPROC_C]) {
-
 
307
				p = do_preproc(p);
-
 
308
			} else {
-
 
309
				p = do_produce(p);
-
 
310
			}
-
 
311
			if (allow_specs && stops[C_SPEC]) {
-
 
312
				p = null;
-
 
313
			}
-
 
314
			if (p != pc) {
-
 
315
				p = apply_compile(p, produce);
-
 
316
			}
-
 
317
			break;
-
 
318
		case PREPROC_C:
-
 
319
			/* Preprocessed C source */
-
 
320
			if (stops[PREPROC_C]) {
-
 
321
				break;
-
 
322
			}
-
 
323
			p = do_produce(p);
-
 
324
			if (allow_specs && stops[C_SPEC]) {
-
 
325
				p = null;
-
 
326
			}
-
 
327
			if (p != pc) {
-
 
328
				p = apply_compile(p, produce);
-
 
329
			}
-
 
330
			break;
-
 
331
		case CPP_SOURCE:
-
 
332
			/* C++ source */
-
 
333
			if (allow_cpp) {
-
 
334
				if (keeps[PREPROC_CPP]) {
-
 
335
					p = do_cpp_preproc(p);
-
 
336
				} else {
-
 
337
					p = do_cpp_produce(p);
-
 
338
				}
-
 
339
				if (allow_specs && stops[CPP_SPEC]) {
-
 
340
					p = null;
-
 
341
				}
-
 
342
				if (p != pc) {
-
 
343
					p = apply_compile(p, produce);
-
 
344
				}
-
 
345
			} else {
-
 
346
				error(WARNING, "'%s' is a C++ source file",
-
 
347
				      p->name);
-
 
348
				p->type = DEFAULT_TYPE;
-
 
349
			}
-
 
350
			break;
-
 
351
		case PREPROC_CPP:
-
 
352
			/* Preprocessed C++ source */
-
 
353
			if (stops[PREPROC_CPP]) {
-
 
354
				break;
-
 
355
			}
-
 
356
			if (allow_cpp) {
-
 
357
				p = do_cpp_produce(p);
-
 
358
				if (allow_specs && stops[CPP_SPEC]) {
-
 
359
					p = null;
-
 
360
				}
-
 
361
				if (p != pc) {
-
 
362
					p = apply_compile(p, produce);
-
 
363
				}
-
 
364
			} else {
-
 
365
				error(WARNING,
-
 
366
				      "'%s' is a preprocessed C++ source file",
-
 
367
				      p->name);
-
 
368
				p->type = DEFAULT_TYPE;
-
 
369
			}
-
 
370
			break;
-
 
371
		case INDEP_TDF:
-
 
372
			/* Target independent TDF */
-
 
373
			if (!produce) {
-
 
374
				p = apply_tdf_link(p);
-
 
375
				if (p != pc) {
-
 
376
					p = apply_compile(p, produce);
-
 
377
				}
-
 
378
			}
-
 
379
			break;
-
 
380
		case DEP_TDF:
-
 
381
			/* Target dependent TDF */
-
 
382
			if (!produce) {
-
 
383
				p = do_translate(p);
-
 
384
				if (p != pc) {
-
 
385
					p = apply_compile(p, produce);
-
 
386
				}
-
 
387
			}
-
 
388
			break;
-
 
389
		case AS_SOURCE:
-
 
390
			/* Assembly source */
-
 
391
			if (!produce) {
-
 
392
				p = do_assemble(p);
-
 
393
				if (p != pc) {
-
 
394
					p = apply_compile(p, produce);
-
 
395
				}
-
 
396
			}
-
 
397
			break;
-
 
398
		case PRETTY_TDF:
-
 
399
			/* TDF notation source */
-
 
400
			if (allow_notation) {
-
 
401
				p = do_notation(p);
-
 
402
				if (p != pc) {
-
 
403
					p = apply_compile(p, produce);
-
 
404
				}
-
 
405
			} else {
-
 
406
				error(WARNING,
-
 
407
				      "'%s' is a TDF notation source file",
-
 
408
				      p->name);
-
 
409
				p->type = DEFAULT_TYPE;
-
 
410
			}
-
 
411
			break;
-
 
412
		case PL_TDF:
-
 
413
			/* PL_TDF source */
-
 
414
			if (allow_pl_tdf) {
-
 
415
				p = do_pl_tdf(p);
-
 
416
				if (p != pc) {
-
 
417
					p = apply_compile(p, produce);
-
 
418
				}
-
 
419
			} else {
-
 
420
				error(WARNING,
-
 
421
				      "'%s' is a PL_TDF source file", p->name);
-
 
422
				p->type = DEFAULT_TYPE;
-
 
423
			}
-
 
424
			break;
-
 
425
		case C_SPEC:
-
 
426
			/* C spec file */
-
 
427
			if (!allow_specs) {
-
 
428
				error(WARNING, "'%s' is a C spec file",
-
 
429
				      p->name);
-
 
430
				p->type = DEFAULT_TYPE;
-
 
431
			} else {
-
 
432
				if (p->storage == INPUT_FILE &&
-
 
433
				    keeps_aux[BINARY_OBJ] == 1 &&
-
 
434
				    !stops[AS_SOURCE]) {
-
 
435
					p = do_build_file(p, BINARY_OBJ);
-
 
436
				}
-
 
437
			}
-
 
438
			break;
-
 
439
		case CPP_SPEC:
-
 
440
			/* C++ spec file */
-
 
441
			if (!allow_specs || !allow_cpp) {
-
 
442
				error(WARNING, "'%s' is a C++ spec file",
-
 
443
				      p->name);
-
 
444
				p->type = DEFAULT_TYPE;
-
 
445
			} else {
-
 
446
				if (p->storage == INPUT_FILE &&
-
 
447
				    keeps_aux[BINARY_OBJ] == 1 &&
-
 
448
				    !stops[AS_SOURCE]) {
-
 
449
					p = do_build_file(p, BINARY_OBJ);
-
 
450
				}
-
 
451
			}
-
 
452
			break;
-
 
453
		}
-
 
454
		if (p && p->storage != INPUT_FILE && p->aux == null) {
-
 
455
			boolean have_spec = 0;
-
 
456
			filename *p_archive = p;
-
 
457
			if (spec_of(p_archive, p_archive->next)) {
-
 
458
				p_archive = p_archive->next;
-
 
459
				have_spec = 1;
-
 
460
			} else if (spec_of(p_archive, pn)) {
-
 
461
				p_archive->next = pn;
-
 
462
				p_archive = p_archive->next;
-
 
463
				pn = pn->next;
-
 
464
				p_archive->next = null;
-
 
465
				have_spec = 1;
-
 
466
			}
-
 
467
			if (have_spec) {
-
 
468
				int t = p->type;
-
 
469
				if (t == INDEP_TDF && checker && !stops[t]) {
-
 
470
					if (stops[BINARY_OBJ] ||
-
 
471
					    keeps_aux[BINARY_OBJ] == 1) {
-
 
472
						p = do_build_file(p->next,
-
 
473
								  BINARY_OBJ);
-
 
474
					}
-
 
475
				}
-
 
476
				if (t == BINARY_OBJ && keeps[t]) {
-
 
477
					p = do_build_file(p, BINARY_OBJ);
-
 
478
				}
-
 
479
			}
-
 
480
		}
-
 
481
		output = add_filename(output, p);
-
 
482
		p = pn;
-
 
483
	}
-
 
484
	return (output);
-
 
485
}
-
 
486
 
271
 
487
 
272
	    case C_SOURCE : {
-
 
273
		/* C source */
-
 
274
		if ( keeps [ PREPROC_C ] ) {
-
 
275
		    p = do_preproc ( p ) ;
-
 
276
		} else {
-
 
277
		    p = do_produce ( p ) ;
-
 
278
		}
488
/*
279
		if ( allow_specs && stops [ C_SPEC ] ) p = null ;
-
 
280
		if ( p != pc ) p = apply_compile ( p, produce ) ;
-
 
281
		break ;
-
 
282
	    }
-
 
283
 
-
 
284
	    case PREPROC_C : {
-
 
285
		/* Preprocessed C source */
-
 
286
		if ( stops [ PREPROC_C ] ) break ;
-
 
287
		p = do_produce ( p ) ;
-
 
288
		if ( allow_specs && stops [ C_SPEC ] ) p = null ;
-
 
289
		if ( p != pc ) p = apply_compile ( p, produce ) ;
-
 
290
		break ;
-
 
291
	    }
-
 
292
 
-
 
293
	    case CPP_SOURCE : {
-
 
294
		/* C++ source */
-
 
295
		if ( allow_cpp ) {
-
 
296
		    if ( keeps [ PREPROC_CPP ] ) {
489
 * FILTER OUT LIST OF BINARY OBJECT FILES
297
			p = do_cpp_preproc ( p ) ;
-
 
298
		    } else {
-
 
299
			p = do_cpp_produce ( p ) ;
-
 
300
		    }
-
 
301
		    if ( allow_specs && stops [ CPP_SPEC ] ) p = null ;
-
 
302
		    if ( p != pc ) p = apply_compile ( p, produce ) ;
-
 
303
		} else {
-
 
304
		    error ( WARNING, "'%s' is a C++ source file",
-
 
305
			    p->name ) ;
-
 
306
		    p->type = DEFAULT_TYPE ;
-
 
307
		}
-
 
308
		break ;
-
 
309
	    }
-
 
310
 
-
 
311
	    case PREPROC_CPP : {
-
 
312
		/* Preprocessed C++ source */
-
 
313
		if ( stops [ PREPROC_CPP ] ) break ;
-
 
314
		if ( allow_cpp ) {
-
 
315
		    p = do_cpp_produce ( p ) ;
-
 
316
		    if ( allow_specs && stops [ CPP_SPEC ] ) p = null ;
-
 
317
		    if ( p != pc ) p = apply_compile ( p, produce ) ;
-
 
318
		} else {
-
 
319
		    error ( WARNING, "'%s' is a preprocessed C++ source file",
-
 
320
			    p->name ) ;
-
 
321
		    p->type = DEFAULT_TYPE ;
-
 
322
		}
-
 
323
		break ;
-
 
324
	    }
-
 
325
 
-
 
326
	    case INDEP_TDF : {
-
 
327
		/* Target independent TDF */
-
 
328
		if ( !produce ) {
-
 
329
		    p = apply_tdf_link ( p ) ;
-
 
330
		    if ( p != pc ) p = apply_compile ( p, produce ) ;
-
 
331
		}
-
 
332
		break ;
-
 
333
	    }
-
 
334
 
490
 *
335
	    case DEP_TDF : {
-
 
336
		/* Target dependent TDF */
-
 
337
		if ( !produce ) {
-
 
338
		    p = do_translate ( p ) ;
-
 
339
		    if ( p != pc ) p = apply_compile ( p, produce ) ;
-
 
340
		}
-
 
341
		break ;
-
 
342
	    }
-
 
343
 
-
 
344
	    case AS_SOURCE : {
-
 
345
		/* Assembly source */
-
 
346
		if ( !produce ) {
-
 
347
		    p = do_assemble ( p ) ;
-
 
348
		    if ( p != pc ) p = apply_compile ( p, produce ) ;
-
 
349
		}
-
 
350
		break ;
-
 
351
	    }
-
 
352
 
-
 
353
	    case PRETTY_TDF : {
-
 
354
		/* TDF notation source */
-
 
355
		if ( allow_notation ) {
-
 
356
		    p = do_notation ( p ) ;
-
 
357
		    if ( p != pc ) p = apply_compile ( p, produce ) ;
491
 * This routine picks out the TDF capsules from the input files, input,
358
		} else {
-
 
359
		    error ( WARNING, "'%s' is a TDF notation source file",
-
 
360
			    p->name ) ;
-
 
361
		    p->type = DEFAULT_TYPE ;
-
 
362
		}
-
 
363
		break ;
-
 
364
	    }
-
 
365
 
-
 
366
	    case PL_TDF : {
-
 
367
		/* PL_TDF source */
-
 
368
		if ( allow_pl_tdf ) {
-
 
369
		    p = do_pl_tdf ( p ) ;
-
 
370
		    if ( p != pc ) p = apply_compile ( p, produce ) ;
492
 * compiles them to binary object files, and returns them.
371
		} else {
-
 
372
		    error ( WARNING, "'%s' is a PL_TDF source file",
-
 
373
			    p->name ) ;
-
 
374
		    p->type = DEFAULT_TYPE ;
-
 
375
		}
-
 
376
		break ;
-
 
377
	    }
-
 
378
 
-
 
379
	    case C_SPEC : {
-
 
380
		/* C spec file */
-
 
381
		if ( !allow_specs ) {
-
 
382
		    error ( WARNING, "'%s' is a C spec file", p->name ) ;
-
 
383
		    p->type = DEFAULT_TYPE ;
-
 
384
		} else {
-
 
385
		    if ( p->storage == INPUT_FILE &&
-
 
386
			 keeps_aux [ BINARY_OBJ ] == 1 &&
-
 
387
			 !stops [ AS_SOURCE ] ) {
-
 
388
			p = do_build_file ( p, BINARY_OBJ ) ;
-
 
389
		    }
-
 
390
		}
493
 */
391
		break ;
-
 
392
	    }
-
 
393
 
494
 
394
	    case CPP_SPEC : {
495
static filename *
-
 
496
filter_ofiles(filename *input)
-
 
497
{
395
		/* C++ spec file */
498
	filename *p = input;
-
 
499
	filename *links = null;
396
		if ( !allow_specs || !allow_cpp ) {
500
	while (p != null) {
397
		    error ( WARNING, "'%s' is a C++ spec file", p->name ) ;
501
		filename *pn = p->next;
398
		    p->type = DEFAULT_TYPE ;
502
		p->next = null;
399
		} else {
503
		p->aux = pn;
400
		    if ( p->storage == INPUT_FILE &&
504
		if (p->type == INDEP_TDF) {
401
			 keeps_aux [ BINARY_OBJ ] == 1 &&
505
			filename *q = apply_compile(p, 0);
402
			 !stops [ AS_SOURCE ] ) {
506
			if (q && q->type == BINARY_OBJ) {
403
			p = do_build_file ( p, BINARY_OBJ ) ;
507
				links = add_filename(links, q);
404
		    }
508
			}
405
		}
509
		}
406
		break ;
510
		p = pn;
407
	    }
-
 
408
	}
511
	}
409
	if ( p && p->storage != INPUT_FILE && p->aux == null ) {
-
 
410
	    boolean have_spec = 0 ;
-
 
411
	    filename *p_archive = p ;
-
 
412
	    if ( spec_of ( p_archive, p_archive->next ) ) {
-
 
413
		p_archive = p_archive->next ;
-
 
414
		have_spec = 1 ;
-
 
415
	    } else if ( spec_of ( p_archive, pn ) ) {
-
 
416
		p_archive->next = pn ;
-
 
417
		p_archive = p_archive->next ;
-
 
418
		pn = pn->next ;
-
 
419
		p_archive->next = null ;
-
 
420
		have_spec = 1 ;
-
 
421
	    }
-
 
422
	    if ( have_spec ) {
-
 
423
		int t = p->type ;
-
 
424
		if ( t == INDEP_TDF && checker && !stops [t] ) {
-
 
425
		    if ( stops [ BINARY_OBJ ] ||
-
 
426
			 keeps_aux [ BINARY_OBJ ] == 1 ) {
-
 
427
			p = do_build_file ( p->next, BINARY_OBJ ) ;
-
 
428
		    }
-
 
429
		}
-
 
430
		if ( t == BINARY_OBJ && keeps [t] ) {
-
 
431
		    p = do_build_file ( p, BINARY_OBJ ) ;
-
 
432
		}
-
 
433
	    }
-
 
434
	}
-
 
435
	output = add_filename ( output, p ) ;
-
 
436
	p = pn ;
-
 
437
    }
-
 
438
    return ( output ) ;
512
	return (links);
439
}
513
}
440
 
514
 
441
 
515
 
442
/*
516
/*
-
 
517
 * APPLY THE SYSTEM LINKER
-
 
518
 *
-
 
519
 * This routine applies the system linker to the input files, input, and
443
    FILTER OUT LIST OF BINARY OBJECT FILES
520
 * returns the corresponding output files.
-
 
521
 */
444
 
522
 
-
 
523
static filename *
-
 
524
apply_link(filename *input)
-
 
525
{
-
 
526
	filename *p = input;
-
 
527
	int spec_out = C_SPEC_2;
-
 
528
	filename *links = null, *links_out = null;
-
 
529
	filename *specs = null, *specs_out;
-
 
530
	filename *others = null;
-
 
531
	while (p != null) {
-
 
532
		filename *pn = p->next;
-
 
533
		p->next = null;
-
 
534
		p->aux = pn;
-
 
535
		if (p->type == BINARY_OBJ) {
-
 
536
			links = add_filename(links, p);
-
 
537
		} else if (p->type == C_SPEC) {
-
 
538
			specs = add_filename(specs, p);
-
 
539
		} else if (p->type == CPP_SPEC) {
-
 
540
			specs = add_filename(specs, p);
-
 
541
			spec_out = CPP_SPEC_2;
-
 
542
		} else {
-
 
543
			others = add_filename(others, p);
-
 
544
		}
-
 
545
		p = pn;
-
 
546
	}
-
 
547
	last_return = 0;
-
 
548
	keeps[binary_obj_type] = 0;
-
 
549
	specs_out = do_link_specs(specs, spec_out);
-
 
550
	links = add_filename(links, filter_ofiles(specs_out));
-
 
551
	if (use_dynlink != 0 && use_system_cc == 0) {
-
 
552
		links = do_dynlink(links);
-
 
553
	}
-
 
554
	if (links) {
-
 
555
		links_out = do_link(links);
-
 
556
	}
-
 
557
	if (specs_out && links_out) {
-
 
558
		specs_out->uniq = links_out->uniq;
-
 
559
	}
-
 
560
	p = add_filename(links_out, specs_out);
-
 
561
	p = add_filename(p, others);
-
 
562
	if (last_return) {
-
 
563
		/* If the linking failed, keep the .o files */
-
 
564
		filename *q = input;
-
 
565
		boolean b = keeps[BINARY_OBJ];
-
 
566
		keeps[BINARY_OBJ] = 1;
-
 
567
		p = null;
-
 
568
		while (q != null) {
-
 
569
			filename *qa = q->aux;
-
 
570
			q->next = null;
-
 
571
			if (q->type == C_SPEC || q->type == CPP_SPEC) {
-
 
572
				q = null;
-
 
573
			} else if (q->type == BINARY_OBJ) {
-
 
574
				if (q->storage == INPUT_FILE || b) {
-
 
575
					q = null;
-
 
576
				} else if (allow_specs) {
-
 
577
					if (link_specs) {
-
 
578
						q = do_keep(q);
-
 
579
					}
-
 
580
					if (spec_of(q, qa)) {
-
 
581
						q->next = qa;
-
 
582
						qa->next = null;
-
 
583
						qa = qa->aux;
-
 
584
						if (link_specs) {
-
 
585
							q->next =
-
 
586
							    do_keep(q->next);
-
 
587
						}
-
 
588
					}
-
 
589
					q = do_build_file(q, BINARY_OBJ);
-
 
590
				} else {
-
 
591
					q = do_keep(q);
-
 
592
				}
-
 
593
			}
-
 
594
			p = add_filename(p, q);
-
 
595
			q = qa;
-
 
596
		}
-
 
597
	}
-
 
598
	return (p);
-
 
599
}
-
 
600
 
-
 
601
 
-
 
602
/*
-
 
603
 * SPLIT ALL TDF ARCHIVES
-
 
604
 *
445
    This routine picks out the TDF capsules from the input files, input,
605
 * This routine splits any TDF archives in the input files, input, and returns
446
    compiles them to binary object files, and returns them.
606
 * the corresponding output files.
447
*/
607
 */
448
 
608
 
449
static filename *filter_ofiles
609
static filename *
450
    PROTO_N ( ( input ) )
-
 
451
    PROTO_T ( filename *input )
610
apply_split_arch(filename *input)
452
{
611
{
453
    filename *p = input ;
612
	filename *p = input;
454
    filename *links = null ;
613
	filename *output = null;
-
 
614
	archive_type = TDF_ARCHIVE;
455
    while ( p != null ) {
615
	while (p != null) {
456
	filename *pn = p->next ;
616
		filename *pn = p->next;
457
	p->next = null ;
617
		p->next = null;
458
	p->aux = pn ;
618
		if (p->type == TDF_ARCHIVE) {
459
	if ( p->type == INDEP_TDF ) {
619
			if (use_system_cc) {
460
	    filename *q = apply_compile ( p, 0 ) ;
620
				error(WARNING, "'%s' is a TDF archive",
-
 
621
				      p->name);
461
	    if ( q && q->type == BINARY_OBJ ) {
622
				p->type = DEFAULT_TYPE;
-
 
623
			} else {
-
 
624
				p = do_split_arch(p);
-
 
625
			}
-
 
626
		}
462
		links = add_filename ( links, q ) ;
627
		output = add_filename(output, p);
463
	    }
628
		p = pn;
464
	}
629
	}
465
	p = pn ;
-
 
466
    }
-
 
467
    return ( links ) ;
630
	return (output);
468
}
631
}
469
 
632
 
470
 
633
 
471
/*
634
/*
472
    APPLY THE SYSTEM LINKER
635
 * BUILD A TDF ARCHIVE
473
 
636
 *
474
    This routine applies the system linker to the input files, input,
637
 * This routine creates a TDF archive from the input files, input, and returns
475
    and returns the corresponding output files.
638
 * the corresponding output files.
476
*/
639
 */
477
 
640
 
478
static filename *apply_link
641
static filename *
479
    PROTO_N ( ( input ) )
-
 
480
    PROTO_T ( filename *input )
642
apply_build_arch(filename *input)
481
{
643
{
482
    filename *p = input ;
644
	filename *p = input;
483
    int spec_out = C_SPEC_2 ;
-
 
484
    filename *links = null, *links_out = null ;
645
	filename *links = null;
485
    filename *specs = null, *specs_out ;
646
	filename *specs = null;
486
    filename *others = null ;
647
	filename *others = null;
-
 
648
	int spec_out = C_SPEC_1;
487
    while ( p != null ) {
649
	while (p != null) {
488
	filename *pn = p->next ;
650
		filename *pn = p->next;
489
	p->next = null ;
651
		p->next = null;
490
	p->aux = pn ;
-
 
491
	if ( p->type == BINARY_OBJ ) {
652
		if (p->type == INDEP_TDF) {
492
	    links = add_filename ( links, p ) ;
653
			links = add_filename(links, p);
493
	} else if ( p->type == C_SPEC ) {
654
		} else if (p->type == C_SPEC) {
494
	    specs = add_filename ( specs, p ) ;
655
			specs = add_filename(specs, p);
495
	} else if ( p->type == CPP_SPEC ) {
656
		} else if (p->type == CPP_SPEC) {
496
	    specs = add_filename ( specs, p ) ;
657
			specs = add_filename(specs, p);
497
	    spec_out = CPP_SPEC_2 ;
658
			spec_out = CPP_SPEC_1;
498
	} else {
659
		} else {
499
	    others = add_filename ( others, p ) ;
660
			others = add_filename(others, p);
500
	}
661
		}
501
	p = pn ;
662
		p = pn;
502
    }
-
 
503
    last_return = 0 ;
-
 
504
    keeps [ binary_obj_type ] = 0 ;
-
 
505
    specs_out = do_link_specs ( specs, spec_out ) ;
-
 
506
    links = add_filename ( links, filter_ofiles ( specs_out ) ) ;
-
 
507
    if ( use_dynlink != 0 && use_system_cc == 0 ) links = do_dynlink ( links ) ;
-
 
508
    if ( links ) links_out = do_link ( links ) ;
-
 
509
    if ( specs_out && links_out ) specs_out->uniq = links_out->uniq ;
-
 
510
    p = add_filename ( links_out, specs_out ) ;
-
 
511
    p = add_filename ( p, others ) ;
-
 
512
    if ( last_return ) {
-
 
513
	/* If the linking failed, keep the .o files */
-
 
514
	filename *q = input ;
-
 
515
	boolean b = keeps [ BINARY_OBJ ] ;
-
 
516
	keeps [ BINARY_OBJ ] = 1 ;
-
 
517
	p = null ;
-
 
518
	while ( q != null ) {
-
 
519
	    filename *qa = q->aux ;
-
 
520
	    q->next = null ;
-
 
521
	    if ( q->type == C_SPEC || q->type == CPP_SPEC ) {
-
 
522
		q = null ;
-
 
523
	    } else if ( q->type == BINARY_OBJ ) {
-
 
524
		if ( q->storage == INPUT_FILE || b ) {
-
 
525
		    q = null ;
-
 
526
		} else if ( allow_specs ) {
-
 
527
		    if ( link_specs ) q = do_keep ( q ) ;
-
 
528
		    if ( spec_of ( q, qa ) ) {
-
 
529
			q->next = qa ;
-
 
530
			qa->next = null ;
-
 
531
			qa = qa->aux ;
-
 
532
			if ( link_specs ) q->next = do_keep ( q->next ) ;
-
 
533
		    }
-
 
534
		    q = do_build_file ( q, BINARY_OBJ ) ;
-
 
535
		} else {
-
 
536
		    q = do_keep ( q ) ;
-
 
537
		}
-
 
538
	    }
-
 
539
	    p = add_filename ( p, q ) ;
-
 
540
	    q = qa ;
-
 
541
	}
663
	}
542
    }
-
 
543
    return ( p ) ;
-
 
544
}
-
 
545
 
-
 
546
 
-
 
547
/*
-
 
548
    SPLIT ALL TDF ARCHIVES
-
 
549
 
-
 
550
    This routine splits any TDF archives in the input files, input,
-
 
551
    and returns the corresponding output files.
-
 
552
*/
-
 
553
 
-
 
554
static filename *apply_split_arch
-
 
555
    PROTO_N ( ( input ) )
-
 
556
    PROTO_T ( filename *input )
-
 
557
{
-
 
558
    filename *p = input ;
-
 
559
    filename *output = null ;
-
 
560
    archive_type = TDF_ARCHIVE ;
-
 
561
    while ( p != null ) {
-
 
562
	filename *pn = p->next ;
-
 
563
	p->next = null ;
-
 
564
	if ( p->type == TDF_ARCHIVE ) {
-
 
565
	    if ( use_system_cc ) {
-
 
566
		error ( WARNING, "'%s' is a TDF archive", p->name ) ;
-
 
567
		p->type = DEFAULT_TYPE ;
-
 
568
	    } else {
-
 
569
		p = do_split_arch ( p ) ;
-
 
570
	    }
-
 
571
	}
-
 
572
	output = add_filename ( output, p ) ;
-
 
573
	p = pn ;
-
 
574
    }
-
 
575
    return ( output ) ;
-
 
576
}
-
 
577
 
-
 
578
 
-
 
579
/*
-
 
580
    BUILD A TDF ARCHIVE
-
 
581
 
-
 
582
    This routine creates a TDF archive from the input files, input,
-
 
583
    and returns the corresponding output files.
-
 
584
*/
-
 
585
 
-
 
586
static filename *apply_build_arch
-
 
587
    PROTO_N ( ( input ) )
-
 
588
    PROTO_T ( filename *input )
-
 
589
{
-
 
590
    filename *p = input ;
-
 
591
    filename *links = null ;
-
 
592
    filename *specs = null ;
-
 
593
    filename *others = null ;
-
 
594
    int spec_out = C_SPEC_1 ;
-
 
595
    while ( p != null ) {
-
 
596
	filename *pn = p->next ;
-
 
597
	p->next = null ;
-
 
598
	if ( p->type == INDEP_TDF ) {
-
 
599
	    links = add_filename ( links, p ) ;
-
 
600
	} else if ( p->type == C_SPEC ) {
-
 
601
	    specs = add_filename ( specs, p ) ;
-
 
602
	} else if ( p->type == CPP_SPEC ) {
-
 
603
	    specs = add_filename ( specs, p ) ;
-
 
604
	    spec_out = CPP_SPEC_1 ;
-
 
605
	} else {
-
 
606
	    others = add_filename ( others, p ) ;
-
 
607
	}
-
 
608
	p = pn ;
-
 
609
    }
-
 
610
    specs = do_link_specs ( specs, spec_out ) ;
664
	specs = do_link_specs(specs, spec_out);
611
    links = do_build_arch ( links ) ;
665
	links = do_build_arch(links);
612
    if ( specs && links ) specs->uniq = links->uniq ;
-
 
613
    p = add_filename ( links, specs ) ;
-
 
614
    p = add_filename ( p, others ) ;
-
 
615
    return ( p ) ;
-
 
616
}
-
 
617
 
-
 
618
 
-
 
619
/*
-
 
620
    BUILD A TDF COMPLEX
-
 
621
 
-
 
622
    This routine creates a complex TDF capsule from the input files,
-
 
623
    input, and returns the corresponding output files.
-
 
624
*/
-
 
625
 
-
 
626
static filename *apply_build
-
 
627
    PROTO_N ( ( input ) )
-
 
628
    PROTO_T ( filename *input )
-
 
629
{
-
 
630
    filename *p = input ;
-
 
631
    filename *links = null ;
-
 
632
    filename *specs = null ;
-
 
633
    filename *others = null ;
-
 
634
    int spec_out = C_SPEC_1 ;
-
 
635
    while ( p != null ) {
-
 
636
	filename *pn = p->next ;
-
 
637
	p->next = null ;
-
 
638
	if ( p->type == INDEP_TDF ) {
666
	if (specs && links) {
639
	    links = add_filename ( links, p ) ;
-
 
640
	} else if ( p->type == C_SPEC ) {
-
 
641
	    specs = add_filename ( specs, p ) ;
-
 
642
	} else if ( p->type == CPP_SPEC ) {
-
 
643
	    specs = add_filename ( specs, p ) ;
-
 
644
	    spec_out = CPP_SPEC_1 ;
667
		specs->uniq = links->uniq;
645
	} else {
-
 
646
	    others = add_filename ( others, p ) ;
-
 
647
	}
668
	}
648
	p = pn ;
-
 
649
    }
-
 
650
    specs = do_link_specs ( specs, spec_out ) ;
-
 
651
    links = do_tdf_build ( links ) ;
-
 
652
    if ( specs && links ) specs->uniq = links->uniq ;
-
 
653
    p = add_filename ( links, specs ) ;
669
	p = add_filename(links, specs);
654
    p = add_filename ( p, others ) ;
670
	p = add_filename(p, others);
655
    return ( p ) ;
671
	return (p);
656
}
-
 
657
 
-
 
658
 
-
 
659
/*
-
 
660
    APPLY THE PREPROCESSOR
-
 
661
 
-
 
662
    This routine applies the preprocessor to the input files, input,
-
 
663
    and returns the corresponding output files.
-
 
664
*/
-
 
665
 
-
 
666
static filename *apply_preproc
-
 
667
    PROTO_N ( ( input ) )
-
 
668
    PROTO_T ( filename *input )
-
 
669
{
-
 
670
    filename *p = input ;
-
 
671
    filename *output = null ;
-
 
672
    if ( use_system_cc ) return ( apply_cc ( input ) ) ;
-
 
673
    while ( p != null ) {
-
 
674
	filename *pn = p->next ;
-
 
675
	p->next = null ;
-
 
676
	if ( p->type == C_SOURCE ) p = do_preproc ( p ) ;
-
 
677
	else if ( p->type == CPP_SOURCE ) p = do_cpp_preproc ( p ) ;
-
 
678
	output = add_filename ( output, p ) ;
-
 
679
	p = pn ;
-
 
680
    }
-
 
681
    return ( output ) ;
-
 
682
}
672
}
683
 
673
 
684
 
674
 
685
/*
675
/*
686
    APPLY THE TDF PRETTY PRINTER
676
 * BUILD A TDF COMPLEX
687
 
677
 *
688
    This routine applies the TDF pretty printer to the input files,
678
 * This routine creates a complex TDF capsule from the input files, input, and
689
    input, and returns the corresponding output files.
679
 * returns the corresponding output files.
690
*/
680
 */
691
 
681
 
692
static filename *apply_pretty
682
static filename *
693
    PROTO_N ( ( input ) )
-
 
694
    PROTO_T ( filename *input )
683
apply_build(filename *input)
695
{
684
{
696
    filename *p = input ;
685
	filename *p = input;
-
 
686
	filename *links = null;
-
 
687
	filename *specs = null;
697
    filename *output = null ;
688
	filename *others = null;
-
 
689
	int spec_out = C_SPEC_1;
698
    while ( p != null ) {
690
	while (p != null) {
699
	filename *pn = p->next ;
691
		filename *pn = p->next;
700
	p->next = null ;
692
		p->next = null;
701
	if ( make_tspec ) {
693
		if (p->type == INDEP_TDF) {
702
	    if ( p->type == C_SPEC ) p = do_pretty ( p ) ;
694
			links = add_filename(links, p);
703
        } else if ( p->type == INDEP_TDF ) {
695
		} else if (p->type == C_SPEC) {
704
	    if ( make_pretty == 2 ) p = apply_tdf_link ( p ) ;
-
 
705
	    p = do_pretty ( p ) ;
696
			specs = add_filename(specs, p);
706
	} else if ( p->type == DEP_TDF ) {
697
		} else if (p->type == CPP_SPEC) {
707
	    p = do_pretty ( p ) ;
698
			specs = add_filename(specs, p);
-
 
699
			spec_out = CPP_SPEC_1;
-
 
700
		} else {
-
 
701
			others = add_filename(others, p);
-
 
702
		}
-
 
703
		p = pn;
708
	}
704
	}
-
 
705
	specs = do_link_specs(specs, spec_out);
-
 
706
	links = do_tdf_build(links);
-
 
707
	if (specs && links) {
-
 
708
		specs->uniq = links->uniq;
-
 
709
	}
-
 
710
	p = add_filename(links, specs);
-
 
711
	p = add_filename(p, others);
-
 
712
	return (p);
-
 
713
}
-
 
714
 
-
 
715
 
-
 
716
/*
-
 
717
 * APPLY THE PREPROCESSOR
-
 
718
 *
-
 
719
 * This routine applies the preprocessor to the input files, input, and returns
-
 
720
 * the corresponding output files.
-
 
721
 */
-
 
722
 
-
 
723
static filename *
-
 
724
apply_preproc(filename *input)
-
 
725
{
-
 
726
	filename *p = input;
-
 
727
	filename *output = null;
-
 
728
	if (use_system_cc) {
-
 
729
		return (apply_cc(input));
-
 
730
	}
-
 
731
	while (p != null) {
-
 
732
		filename *pn = p->next;
-
 
733
		p->next = null;
-
 
734
		if (p->type == C_SOURCE) {
-
 
735
			p = do_preproc(p);
-
 
736
		} else if (p->type == CPP_SOURCE) {
-
 
737
			p = do_cpp_preproc(p);
-
 
738
		}
709
	output = add_filename ( output, p ) ;
739
		output = add_filename(output, p);
710
	p = pn ;
740
		p = pn;
711
    }
741
	}
712
    return ( output ) ;
742
	return (output);
713
}
743
}
714
 
744
 
715
 
745
 
716
/*
746
/*
717
    APPLY THE ARCHIVER TO UNJOIN C SPEC FILES
747
 * APPLY THE TDF PRETTY PRINTER
718
 
748
 *
719
    This routine scans input for input archives of type t.  It splits these
749
 * This routine applies the TDF pretty printer to the input files, input, and
720
    into their component files.  For internal archives the contents are
-
 
721
    in the aux field.
750
 * returns the corresponding output files.
722
*/
751
 */
723
 
752
 
724
static filename *apply_unjoin
753
static filename *
725
    PROTO_N ( ( input, t ) )
-
 
726
    PROTO_T ( filename *input X int t )
754
apply_pretty(filename *input)
727
{
755
{
728
    filename *p = input ;
756
	filename *p = input;
729
    filename *output = null ;
757
	filename *output = null;
730
    archive_type = t ;
-
 
731
    while ( p != null ) {
758
	while (p != null) {
732
	filename *pn = p->next ;
759
		filename *pn = p->next;
733
	p->next = null ;
760
		p->next = null;
734
	if ( p->type == t ) {
761
		if (make_tspec) {
735
	    if ( p->storage == INPUT_FILE ) {
762
			if (p->type == C_SPEC) {
736
		if ( is_archive ( p->name ) ) p = do_split_arch ( p ) ;
763
				p = do_pretty(p);
-
 
764
			}
737
	    } else if ( p->aux != null ) {
765
		} else if (p->type == INDEP_TDF) {
-
 
766
			if (make_pretty == 2) {
738
		p = p->aux ;
767
				p = apply_tdf_link(p);
739
	    }
768
			}
-
 
769
			p = do_pretty(p);
-
 
770
		} else if (p->type == DEP_TDF) {
-
 
771
			p = do_pretty(p);
740
	}
772
		}
741
	output = add_filename ( output, p ) ;
773
		output = add_filename(output, p);
742
	p = pn ;
774
		p = pn;
743
    }
775
	}
744
    return ( output ) ;
776
	return (output);
745
}
777
}
746
 
778
 
747
 
779
 
748
/*
780
/*
749
    APPLY ALL THE COMPILATION STAGES
781
 * APPLY THE ARCHIVER TO UNJOIN C SPEC FILES
-
 
782
 *
-
 
783
 * This routine scans input for input archives of type t. It splits these into
-
 
784
 * their component files. For internal archives the contents are in the aux
-
 
785
 * field.
-
 
786
 */
750
 
787
 
751
    This routine applies all the compilation stages to the input files,
-
 
752
    input, and returns the corresponding output files.
-
 
753
*/
-
 
754
 
-
 
755
filename *apply_all
788
static filename *
756
    PROTO_N ( ( input ) )
-
 
757
    PROTO_T ( filename *input )
789
apply_unjoin(filename *input, int t)
758
{
790
{
759
    filename *p = input ;
791
	filename *p = input;
-
 
792
	filename *output = null;
-
 
793
	archive_type = t;
-
 
794
	while (p != null) {
-
 
795
		filename *pn = p->next;
-
 
796
		p->next = null;
-
 
797
		if (p->type == t) {
-
 
798
			if (p->storage == INPUT_FILE) {
-
 
799
				if (is_archive(p->name)) {
-
 
800
					p = do_split_arch(p);
-
 
801
				}
-
 
802
			} else if (p->aux != null) {
-
 
803
				p = p->aux;
-
 
804
			}
-
 
805
		}
-
 
806
		output = add_filename(output, p);
-
 
807
		p = pn;
-
 
808
	}
-
 
809
	return (output);
-
 
810
}
-
 
811
 
-
 
812
 
-
 
813
/*
-
 
814
 * APPLY ALL THE COMPILATION STAGES
-
 
815
 *
-
 
816
 * This routine applies all the compilation stages to the input files, input,
-
 
817
 * and returns the corresponding output files.
-
 
818
 */
-
 
819
 
-
 
820
filename *
-
 
821
apply_all(filename *input)
-
 
822
{
-
 
823
	filename *p = input;
760
 
824
 
761
    /* Set up file types */
825
	/* Set up file types */
-
 
826
	if (allow_specs) {
762
    if ( allow_specs ) binary_obj_type = BINARY_OBJ_AUX ;
827
		binary_obj_type = BINARY_OBJ_AUX;
-
 
828
	}
763
 
829
 
764
    /* Preprocessing is a special case */
830
	/* Preprocessing is a special case */
-
 
831
	if (make_preproc) {
765
    if ( make_preproc ) return ( apply_preproc ( p ) ) ;
832
		return (apply_preproc(p));
-
 
833
	}
766
 
834
 
767
    /* Any TDF archives are split immediately */
835
	/* Any TDF archives are split immediately */
768
    p = apply_split_arch ( input ) ;
836
	p = apply_split_arch(input);
769
 
837
 
770
    /* Deal with building TDF archive case */
838
	/* Deal with building TDF archive case */
771
    if ( make_archive ) {
839
	if (make_archive) {
772
	p = apply_compile ( p, 1 ) ;
840
		p = apply_compile(p, 1);
-
 
841
		if (make_complex) {
773
	if ( make_complex ) p = apply_build ( p ) ;
842
			p = apply_build(p);
-
 
843
		}
774
	return ( apply_build_arch ( p ) ) ;
844
		return (apply_build_arch(p));
-
 
845
	}
-
 
846
 
-
 
847
	/* Deal with pretty printing case */
-
 
848
	if (make_pretty) {
-
 
849
		p = apply_compile(p, 1);
-
 
850
		if (make_complex) {
-
 
851
			p = apply_build(p);
775
    }
852
		}
-
 
853
		return (apply_pretty(p));
-
 
854
	}
776
 
855
 
777
    /* Deal with pretty printing case */
856
	/* Deal with building TDF complex */
778
    if ( make_pretty ) {
857
	if (make_complex) {
779
	p = apply_compile ( p, 1 ) ;
858
		p = apply_compile(p, 1);
780
	if ( make_complex ) p = apply_build ( p ) ;
-
 
781
	return ( apply_pretty ( p ) ) ;
859
		p = apply_build(p);
782
    }
860
	}
783
 
861
 
784
    /* Deal with building TDF complex */
-
 
785
    if ( make_complex ) {
-
 
786
	p = apply_compile ( p, 1 ) ;
-
 
787
	p = apply_build ( p ) ;
-
 
788
    }
-
 
789
 
-
 
790
    /* Main compilation phases */
862
	/* Main compilation phases */
791
    p = apply_compile ( p, ( int ) checker ) ;
863
	p = apply_compile(p, (int)checker);
792
    if ( allow_specs && !stops [ BINARY_OBJ ] ) {
864
	if (allow_specs && !stops[BINARY_OBJ]) {
793
	p = apply_unjoin ( p, BINARY_OBJ ) ;
865
		p = apply_unjoin(p, BINARY_OBJ);
794
    }
866
	}
795
    p = apply_link ( p ) ;
867
	p = apply_link(p);
796
    return ( p ) ;
868
	return (p);
797
}
869
}