OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [ada/] [switch-m.adb] - Blame information for rev 816

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 281 jeremybenn
------------------------------------------------------------------------------
2
--                                                                          --
3
--                         GNAT COMPILER COMPONENTS                         --
4
--                                                                          --
5
--                             S W I T C H - M                              --
6
--                                                                          --
7
--                                 B o d y                                  --
8
--                                                                          --
9
--          Copyright (C) 2001-2009, Free Software Foundation, Inc.         --
10
--                                                                          --
11
-- GNAT is free software;  you can  redistribute it  and/or modify it under --
12
-- terms of the  GNU General Public License as published  by the Free Soft- --
13
-- ware  Foundation;  either version 3,  or (at your option) any later ver- --
14
-- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
15
-- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
16
-- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
17
-- for  more details.  You should have  received  a copy of the GNU General --
18
-- Public License  distributed with GNAT; see file COPYING3.  If not, go to --
19
-- http://www.gnu.org/licenses for a complete copy of the license.          --
20
--                                                                          --
21
-- GNAT was originally developed  by the GNAT team at  New York University. --
22
-- Extensive contributions were provided by Ada Core Technologies Inc.      --
23
--                                                                          --
24
------------------------------------------------------------------------------
25
 
26
with Debug;    use Debug;
27
with Makeutl;  use Makeutl;
28
with Osint;    use Osint;
29
with Opt;      use Opt;
30
with Prj;      use Prj;
31
with Prj.Ext;  use Prj.Ext;
32
with Table;
33
 
34
package body Switch.M is
35
 
36
   package Normalized_Switches is new Table.Table
37
     (Table_Component_Type => String_Access,
38
      Table_Index_Type     => Integer,
39
      Table_Low_Bound      => 1,
40
      Table_Initial        => 20,
41
      Table_Increment      => 100,
42
      Table_Name           => "Switch.M.Normalized_Switches");
43
   --  This table is used to keep the normalized switches, so that they may be
44
   --  reused for subsequent invocations of Normalize_Compiler_Switches with
45
   --  similar switches.
46
 
47
   Initial_Number_Of_Switches : constant := 10;
48
 
49
   Global_Switches : Argument_List_Access := null;
50
   --  Used by function Normalize_Compiler_Switches
51
 
52
   ---------------------------------
53
   -- Normalize_Compiler_Switches --
54
   ---------------------------------
55
 
56
   procedure Normalize_Compiler_Switches
57
     (Switch_Chars : String;
58
      Switches     : in out Argument_List_Access;
59
      Last         : out Natural)
60
   is
61
      Switch_Starts_With_Gnat : Boolean;
62
 
63
      Ptr : Integer := Switch_Chars'First;
64
      Max : constant Integer := Switch_Chars'Last;
65
      C   : Character := ' ';
66
 
67
      Storing      : String := Switch_Chars;
68
      First_Stored : Positive := Ptr + 1;
69
      Last_Stored  : Positive := First_Stored;
70
 
71
      procedure Add_Switch_Component (S : String);
72
      --  Add a new String_Access component in Switches. If a string equal
73
      --  to S is already stored in the table Normalized_Switches, use it.
74
      --  Other wise add a new component to the table.
75
 
76
      --------------------------
77
      -- Add_Switch_Component --
78
      --------------------------
79
 
80
      procedure Add_Switch_Component (S : String) is
81
      begin
82
         --  If Switches is null, allocate a new array
83
 
84
         if Switches = null then
85
            Switches := new Argument_List (1 .. Initial_Number_Of_Switches);
86
 
87
         --  Otherwise, if Switches is full, extend it
88
 
89
         elsif Last = Switches'Last then
90
            declare
91
               New_Switches : constant Argument_List_Access :=
92
                                new Argument_List
93
                                      (1 .. Switches'Length + Switches'Length);
94
            begin
95
               New_Switches (1 .. Switches'Length) := Switches.all;
96
               Last := Switches'Length;
97
               Switches := New_Switches;
98
            end;
99
         end if;
100
 
101
         --  If this is the first switch, Last designates the first component
102
 
103
         if Last = 0 then
104
            Last := Switches'First;
105
         else
106
            Last := Last + 1;
107
         end if;
108
 
109
         --  Look into the table Normalized_Switches for a similar string.
110
         --  If one is found, put it at the added component, and return.
111
 
112
         for Index in 1 .. Normalized_Switches.Last loop
113
            if S = Normalized_Switches.Table (Index).all then
114
               Switches (Last) := Normalized_Switches.Table (Index);
115
               return;
116
            end if;
117
         end loop;
118
 
119
         --  No string equal to S was found in the table Normalized_Switches.
120
         --  Add a new component in the table.
121
 
122
         Switches (Last) := new String'(S);
123
         Normalized_Switches.Append (Switches (Last));
124
      end Add_Switch_Component;
125
 
126
   --  Start of processing for Normalize_Compiler_Switches
127
 
128
   begin
129
      Last := 0;
130
 
131
      if Ptr = Max or else Switch_Chars (Ptr) /= '-' then
132
         return;
133
      end if;
134
 
135
      Ptr := Ptr + 1;
136
 
137
      Switch_Starts_With_Gnat :=
138
         Ptr + 3 <= Max and then Switch_Chars (Ptr .. Ptr + 3) = "gnat";
139
 
140
      if Switch_Starts_With_Gnat then
141
         Ptr := Ptr + 4;
142
         First_Stored := Ptr;
143
      end if;
144
 
145
      while Ptr <= Max loop
146
         C := Switch_Chars (Ptr);
147
 
148
         --  Processing for a switch
149
 
150
         case Switch_Starts_With_Gnat is
151
 
152
            when False =>
153
 
154
               --  All switches that don't start with -gnat stay as is,
155
               --  except -pg, -Wall, -k8, -w
156
 
157
               if Switch_Chars = "-pg" or else Switch_Chars = "-p" then
158
 
159
                  --  The gcc driver converts -pg to -p, so that is what
160
                  --  is stored in the ALI file.
161
 
162
                  Add_Switch_Component ("-p");
163
 
164
               elsif Switch_Chars = "-Wall" then
165
 
166
                  --  The gcc driver adds -gnatwa when -Wall is used
167
 
168
                  Add_Switch_Component ("-gnatwa");
169
                  Add_Switch_Component ("-Wall");
170
 
171
               elsif Switch_Chars = "-k8" then
172
 
173
                  --  The gcc driver transforms -k8 into -gnatk8
174
 
175
                  Add_Switch_Component ("-gnatk8");
176
 
177
               elsif Switch_Chars = "-w" then
178
 
179
                  --  The gcc driver adds -gnatws when -w is used
180
 
181
                  Add_Switch_Component ("-gnatws");
182
                  Add_Switch_Component ("-w");
183
 
184
               elsif Switch_Chars'Length > 6
185
                 and then
186
                   Switch_Chars (Switch_Chars'First .. Switch_Chars'First + 5)
187
                                                             = "--RTS="
188
               then
189
                  Add_Switch_Component (Switch_Chars);
190
 
191
                  --  When --RTS=mtp is used, the gcc driver adds -mrtp
192
 
193
                  if Switch_Chars = "--RTS=mtp" then
194
                     Add_Switch_Component ("-mrtp");
195
                  end if;
196
 
197
               --  Take only into account switches that are transmitted to
198
               --  gnat1 by the gcc driver and stored by gnat1 in the ALI file.
199
 
200
               else
201
                  case C is
202
                     when 'O' | 'W' | 'w' | 'f' | 'd' | 'g' | 'm' =>
203
                        Add_Switch_Component (Switch_Chars);
204
 
205
                     when others =>
206
                        null;
207
                  end case;
208
               end if;
209
 
210
               return;
211
 
212
            when True =>
213
 
214
               case C is
215
 
216
                  --  One-letter switches
217
 
218
                  when 'a' | 'A' | 'b' | 'c' | 'D' | 'E' | 'f' |
219
                    'F' | 'g' | 'h' | 'H' | 'k' | 'l' | 'L' | 'n' | 'N' |
220
                    'o' | 'O' | 'p' | 'P' | 'q' | 'Q' | 'r' | 's' | 't' |
221
                    'u' | 'U' | 'v' | 'x' | 'X' | 'Z' =>
222
                     Storing (First_Stored) := C;
223
                     Add_Switch_Component
224
                       (Storing (Storing'First .. First_Stored));
225
                     Ptr := Ptr + 1;
226
 
227
                  --  One-letter switches followed by a positive number
228
 
229
                  when 'm' | 'T' =>
230
                     Storing (First_Stored) := C;
231
                     Last_Stored := First_Stored;
232
 
233
                     loop
234
                        Ptr := Ptr + 1;
235
                        exit when Ptr > Max
236
                          or else Switch_Chars (Ptr) not in '0' .. '9';
237
                        Last_Stored := Last_Stored + 1;
238
                        Storing (Last_Stored) := Switch_Chars (Ptr);
239
                     end loop;
240
 
241
                     Add_Switch_Component
242
                       (Storing (Storing'First .. Last_Stored));
243
 
244
                  when 'd' =>
245
                     Storing (First_Stored) := 'd';
246
 
247
                     while Ptr < Max loop
248
                        Ptr := Ptr + 1;
249
                        C := Switch_Chars (Ptr);
250
                        exit when C = ASCII.NUL or else C = '/'
251
                          or else C = '-';
252
 
253
                        if C in '1' .. '9' or else
254
                           C in 'a' .. 'z' or else
255
                           C in 'A' .. 'Z'
256
                        then
257
                           Storing (First_Stored + 1) := C;
258
                           Add_Switch_Component
259
                             (Storing (Storing'First .. First_Stored + 1));
260
 
261
                        else
262
                           Last := 0;
263
                           return;
264
                        end if;
265
                     end loop;
266
 
267
                     return;
268
 
269
                  when 'e' =>
270
 
271
                     --  Store -gnateD, -gnatep= and -gnateG in the ALI file.
272
                     --  The other -gnate switches do not need to be stored.
273
 
274
                     Storing (First_Stored) := 'e';
275
                     Ptr := Ptr + 1;
276
 
277
                     if Ptr > Max
278
                       or else (Switch_Chars (Ptr) /= 'D'
279
                                 and then Switch_Chars (Ptr) /= 'G'
280
                                 and then Switch_Chars (Ptr) /= 'p')
281
                     then
282
                        Last := 0;
283
                        return;
284
                     end if;
285
 
286
                     --  Processing for -gnateD
287
 
288
                     if Switch_Chars (Ptr) = 'D' then
289
                        Storing (First_Stored + 1 ..
290
                                 First_Stored + Max - Ptr + 1) :=
291
                          Switch_Chars (Ptr .. Max);
292
                        Add_Switch_Component
293
                          (Storing (Storing'First ..
294
                                      First_Stored + Max - Ptr + 1));
295
 
296
                     --  Processing for -gnatep=
297
 
298
                     elsif Switch_Chars (Ptr) = 'p' then
299
                        Ptr := Ptr + 1;
300
 
301
                        if Ptr = Max then
302
                           Last := 0;
303
                           return;
304
                        end if;
305
 
306
                        if Switch_Chars (Ptr) = '=' then
307
                           Ptr := Ptr + 1;
308
                        end if;
309
 
310
                        --  To normalize, always put a '=' after -gnatep.
311
                        --  Because that could lengthen the switch string,
312
                        --  declare a local variable.
313
 
314
                        declare
315
                           To_Store : String (1 .. Max - Ptr + 9);
316
                        begin
317
                           To_Store (1 .. 8) := "-gnatep=";
318
                           To_Store (9 .. Max - Ptr + 9) :=
319
                             Switch_Chars (Ptr .. Max);
320
                           Add_Switch_Component (To_Store);
321
                        end;
322
 
323
                     elsif Switch_Chars (Ptr) = 'G' then
324
                        Add_Switch_Component ("-gnateG");
325
                     end if;
326
 
327
                     return;
328
 
329
                  when 'i' =>
330
                     Storing (First_Stored) := 'i';
331
 
332
                     Ptr := Ptr + 1;
333
 
334
                     if Ptr > Max then
335
                        Last := 0;
336
                        return;
337
                     end if;
338
 
339
                     C := Switch_Chars (Ptr);
340
 
341
                     if C in '1' .. '5'
342
                       or else C = '8'
343
                       or else C = 'p'
344
                       or else C = 'f'
345
                       or else C = 'n'
346
                       or else C = 'w'
347
                     then
348
                        Storing (First_Stored + 1) := C;
349
                        Add_Switch_Component
350
                          (Storing (Storing'First .. First_Stored + 1));
351
                        Ptr := Ptr + 1;
352
 
353
                     else
354
                        Last := 0;
355
                        return;
356
                     end if;
357
 
358
                  --  -gnatR may be followed by '0', '1', '2' or '3',
359
                  --  then by 's'
360
 
361
                  when 'R' =>
362
                     Last_Stored := First_Stored;
363
                     Storing (Last_Stored) := 'R';
364
                     Ptr := Ptr + 1;
365
 
366
                     if Ptr <= Max
367
                       and then Switch_Chars (Ptr) in '0' .. '9'
368
                     then
369
                        C := Switch_Chars (Ptr);
370
 
371
                        if C in '4' .. '9' then
372
                           Last := 0;
373
                           return;
374
 
375
                        else
376
                           Last_Stored := Last_Stored + 1;
377
                           Storing (Last_Stored) := C;
378
                           Ptr := Ptr + 1;
379
 
380
                           if Ptr <= Max
381
                             and then Switch_Chars (Ptr) = 's'
382
                           then
383
                              Last_Stored := Last_Stored + 1;
384
                              Storing (Last_Stored) := 's';
385
                              Ptr := Ptr + 1;
386
                           end if;
387
                        end if;
388
                     end if;
389
 
390
                     Add_Switch_Component
391
                       (Storing (Storing'First .. Last_Stored));
392
 
393
                  --  Multiple switches
394
 
395
                  when 'V' | 'w' | 'y' =>
396
                     Storing (First_Stored) := C;
397
                     Ptr := Ptr + 1;
398
 
399
                     if Ptr > Max then
400
                        if C = 'y' then
401
                           Add_Switch_Component
402
                             (Storing (Storing'First .. First_Stored));
403
 
404
                        else
405
                           Last := 0;
406
                           return;
407
                        end if;
408
                     end if;
409
 
410
                     --  Loop through remaining switch characters in string
411
 
412
                     while Ptr <= Max loop
413
                        C := Switch_Chars (Ptr);
414
                        Ptr := Ptr + 1;
415
 
416
                        --  -gnatyMxxx
417
 
418
                        if C = 'M' and then Storing (First_Stored) = 'y' then
419
                           Last_Stored := First_Stored + 1;
420
                           Storing (Last_Stored) := 'M';
421
                           while Ptr <= Max loop
422
                              C := Switch_Chars (Ptr);
423
                              exit when C not in '0' .. '9';
424
                              Last_Stored := Last_Stored + 1;
425
                              Storing (Last_Stored) := C;
426
                              Ptr := Ptr + 1;
427
                           end loop;
428
 
429
                           --  If there is no digit after -gnatyM,
430
                           --  the switch is invalid.
431
 
432
                           if Last_Stored = First_Stored + 1 then
433
                              Last := 0;
434
                              return;
435
 
436
                           else
437
                              Add_Switch_Component
438
                                (Storing (Storing'First .. Last_Stored));
439
                           end if;
440
 
441
                        --  --gnatx.x
442
 
443
                        elsif C = '.' and then Ptr <= Max then
444
                           Storing (First_Stored + 1) := '.';
445
                           Storing (First_Stored + 2) := Switch_Chars (Ptr);
446
                           Ptr := Ptr + 1;
447
                           Add_Switch_Component
448
                             (Storing (Storing'First .. First_Stored + 2));
449
 
450
                        --  All other switches are -gnatxx
451
 
452
                        else
453
                           Storing (First_Stored + 1) := C;
454
                           Add_Switch_Component
455
                             (Storing (Storing'First .. First_Stored + 1));
456
                        end if;
457
                     end loop;
458
 
459
                  --  -gnat95 -gnat05
460
 
461
                  when '0' | '9' =>
462
                     Last_Stored := First_Stored;
463
                     Storing (Last_Stored) := C;
464
                     Ptr := Ptr + 1;
465
 
466
                     if Ptr /= Max or else Switch_Chars (Ptr) /= '5' then
467
 
468
                        --  Invalid switch
469
 
470
                        Last := 0;
471
                        return;
472
 
473
                     else
474
                        Last_Stored := Last_Stored + 1;
475
                        Storing (Last_Stored) := '5';
476
                        Add_Switch_Component
477
                          (Storing (Storing'First .. Last_Stored));
478
                        Ptr := Ptr + 1;
479
                     end if;
480
 
481
                  --  -gnat83
482
 
483
                  when '8' =>
484
                     Last_Stored := First_Stored;
485
                     Storing (Last_Stored) := '8';
486
                     Ptr := Ptr + 1;
487
 
488
                     if Ptr /= Max or else Switch_Chars (Ptr) /= '3' then
489
 
490
                        --  Invalid switch
491
 
492
                        Last := 0;
493
                        return;
494
 
495
                     else
496
                        Last_Stored := Last_Stored + 1;
497
                        Storing (Last_Stored) := '3';
498
                        Add_Switch_Component
499
                          (Storing (Storing'First .. Last_Stored));
500
                        Ptr := Ptr + 1;
501
                     end if;
502
 
503
                  --  Not a valid switch
504
 
505
                  when others =>
506
                     Last := 0;
507
                     return;
508
 
509
               end case;
510
 
511
         end case;
512
      end loop;
513
   end Normalize_Compiler_Switches;
514
 
515
   function Normalize_Compiler_Switches
516
     (Switch_Chars : String) return Argument_List
517
   is
518
      Last : Natural;
519
 
520
   begin
521
      Normalize_Compiler_Switches (Switch_Chars, Global_Switches, Last);
522
 
523
      if Last = 0 then
524
         return (1 .. 0 => null);
525
      else
526
         return Global_Switches (Global_Switches'First .. Last);
527
      end if;
528
   end Normalize_Compiler_Switches;
529
 
530
   ------------------------
531
   -- Scan_Make_Switches --
532
   ------------------------
533
 
534
   procedure Scan_Make_Switches
535
     (Project_Node_Tree : Prj.Tree.Project_Node_Tree_Ref;
536
      Switch_Chars      : String;
537
      Success           : out Boolean)
538
   is
539
      Ptr : Integer          := Switch_Chars'First;
540
      Max : constant Integer := Switch_Chars'Last;
541
      C   : Character        := ' ';
542
 
543
   begin
544
      --  Assume a good switch
545
 
546
      Success := True;
547
 
548
      --  Skip past the initial character (must be the switch character)
549
 
550
      if Ptr = Max then
551
         Bad_Switch (Switch_Chars);
552
 
553
      else
554
         Ptr := Ptr + 1;
555
      end if;
556
 
557
      --  A little check, "gnat" at the start of a switch is for the compiler
558
 
559
      if Switch_Chars'Length >= Ptr + 3
560
        and then Switch_Chars (Ptr .. Ptr + 3) = "gnat"
561
      then
562
         Success := False;
563
         return;
564
      end if;
565
 
566
      C := Switch_Chars (Ptr);
567
 
568
      --  Multiple character switches
569
 
570
      if Switch_Chars'Length > 2 then
571
         if Switch_Chars = "--create-missing-dirs" then
572
            Setup_Projects := True;
573
 
574
         elsif Switch_Chars'Length > Subdirs_Option'Length
575
           and then
576
             Switch_Chars
577
               (Switch_Chars'First ..
578
                Switch_Chars'First + Subdirs_Option'Length - 1) =
579
                                                            Subdirs_Option
580
         then
581
            Subdirs :=
582
              new String'
583
                (Switch_Chars
584
                  (Switch_Chars'First + Subdirs_Option'Length ..
585
                   Switch_Chars'Last));
586
 
587
         elsif Switch_Chars (Ptr) = '-' then
588
            Bad_Switch (Switch_Chars);
589
 
590
         elsif Switch_Chars'Length > 3
591
           and then Switch_Chars (Ptr .. Ptr + 1) = "aP"
592
         then
593
            Add_Search_Project_Directory
594
              (Project_Node_Tree,
595
               Switch_Chars (Ptr + 2 .. Switch_Chars'Last));
596
 
597
         elsif C = 'v' and then Switch_Chars'Length = 3 then
598
            Ptr := Ptr + 1;
599
            Verbose_Mode := True;
600
 
601
            case Switch_Chars (Ptr) is
602
               when 'l' =>
603
                  Verbosity_Level := Opt.Low;
604
 
605
               when 'm' =>
606
                  Verbosity_Level := Opt.Medium;
607
 
608
               when 'h' =>
609
                  Verbosity_Level := Opt.High;
610
 
611
               when others =>
612
                  Success := False;
613
            end case;
614
 
615
         elsif C = 'd' then
616
 
617
            --  Note: for the debug switch, the remaining characters in this
618
            --  switch field must all be debug flags, since all valid switch
619
            --  characters are also valid debug characters. This switch is not
620
            --  documented on purpose because it is only used by the
621
            --  implementors.
622
 
623
            --  Loop to scan out debug flags
624
 
625
            while Ptr < Max loop
626
               Ptr := Ptr + 1;
627
               C := Switch_Chars (Ptr);
628
 
629
               if C in 'a' .. 'z' or else C in 'A' .. 'Z' then
630
                  Set_Debug_Flag (C);
631
               else
632
                  Bad_Switch (Switch_Chars);
633
               end if;
634
            end loop;
635
 
636
         elsif C = 'e' then
637
            Ptr := Ptr + 1;
638
 
639
            case Switch_Chars (Ptr) is
640
 
641
               --  Processing for eI switch
642
 
643
               when 'I' =>
644
                  Ptr := Ptr + 1;
645
                  Scan_Pos (Switch_Chars, Max, Ptr, Main_Index, C);
646
 
647
                  if Ptr <= Max then
648
                     Bad_Switch (Switch_Chars);
649
                  end if;
650
 
651
               --  Processing for eL switch
652
 
653
               when 'L' =>
654
                  if Ptr /= Max then
655
                     Bad_Switch (Switch_Chars);
656
 
657
                  else
658
                     Follow_Links_For_Files := True;
659
                     Follow_Links_For_Dirs  := True;
660
                  end if;
661
 
662
               --  Processing for eS switch
663
 
664
               when 'S' =>
665
                  if Ptr /= Max then
666
                     Bad_Switch (Switch_Chars);
667
 
668
                  else
669
                     Commands_To_Stdout := True;
670
                  end if;
671
 
672
               when others =>
673
                  Bad_Switch (Switch_Chars);
674
            end case;
675
 
676
         elsif C = 'j' then
677
            Ptr := Ptr + 1;
678
 
679
            declare
680
               Max_Proc : Pos;
681
            begin
682
               Scan_Pos (Switch_Chars, Max, Ptr, Max_Proc, C);
683
 
684
               if Ptr <= Max then
685
                  Bad_Switch (Switch_Chars);
686
 
687
               else
688
                  Maximum_Processes := Positive (Max_Proc);
689
               end if;
690
            end;
691
 
692
         elsif C = 'w' and then Switch_Chars'Length = 3 then
693
            Ptr := Ptr + 1;
694
 
695
            if Switch_Chars = "-we" then
696
               Warning_Mode := Treat_As_Error;
697
 
698
            elsif Switch_Chars = "-wn" then
699
               Warning_Mode := Normal;
700
 
701
            elsif Switch_Chars = "-ws" then
702
               Warning_Mode  := Suppress;
703
 
704
            else
705
               Success := False;
706
            end if;
707
 
708
         else
709
            Success := False;
710
         end if;
711
 
712
      --  Single-character switches
713
 
714
      else
715
         Check_Switch : begin
716
 
717
            case C is
718
 
719
               when 'a' =>
720
                  Check_Readonly_Files := True;
721
 
722
               --  Processing for b switch
723
 
724
               when 'b' =>
725
                  Bind_Only  := True;
726
                  Make_Steps := True;
727
 
728
               --  Processing for B switch
729
 
730
               when 'B' =>
731
                  Build_Bind_And_Link_Full_Project := True;
732
 
733
               --  Processing for c switch
734
 
735
               when 'c' =>
736
                  Compile_Only := True;
737
                  Make_Steps   := True;
738
 
739
               --  Processing for C switch
740
 
741
               when 'C' =>
742
                  Create_Mapping_File := True;
743
 
744
               --  Processing for D switch
745
 
746
               when 'D' =>
747
                  if Object_Directory_Present then
748
                     Osint.Fail ("duplicate -D switch");
749
 
750
                  else
751
                     Object_Directory_Present := True;
752
                  end if;
753
 
754
               --  Processing for f switch
755
 
756
               when 'f' =>
757
                  Force_Compilations := True;
758
 
759
               --  Processing for F switch
760
 
761
               when 'F' =>
762
                  Full_Path_Name_For_Brief_Errors := True;
763
 
764
               --  Processing for h switch
765
 
766
               when 'h' =>
767
                  Usage_Requested := True;
768
 
769
               --  Processing for i switch
770
 
771
               when 'i' =>
772
                  In_Place_Mode := True;
773
 
774
               --  Processing for j switch
775
 
776
               when 'j' =>
777
                  --  -j not followed by a number is an error
778
 
779
                  Bad_Switch (Switch_Chars);
780
 
781
               --  Processing for k switch
782
 
783
               when 'k' =>
784
                  Keep_Going := True;
785
 
786
               --  Processing for l switch
787
 
788
               when 'l' =>
789
                  Link_Only  := True;
790
                  Make_Steps := True;
791
 
792
               --  Processing for M switch
793
 
794
               when 'M' =>
795
                  List_Dependencies := True;
796
 
797
               --  Processing for n switch
798
 
799
               when 'n' =>
800
                  Do_Not_Execute := True;
801
 
802
               --  Processing for o switch
803
 
804
               when 'o' =>
805
                  if Output_File_Name_Present then
806
                     Osint.Fail ("duplicate -o switch");
807
                  else
808
                     Output_File_Name_Present := True;
809
                  end if;
810
 
811
               --  Processing for p switch
812
 
813
               when 'p' =>
814
                  Setup_Projects := True;
815
 
816
               --  Processing for q switch
817
 
818
               when 'q' =>
819
                  Quiet_Output := True;
820
 
821
               --  Processing for R switch
822
 
823
               when 'R' =>
824
                  Run_Path_Option := False;
825
 
826
               --  Processing for s switch
827
 
828
               when 's' =>
829
                  Ptr := Ptr + 1;
830
                  Check_Switches := True;
831
 
832
               --  Processing for v switch
833
 
834
               when 'v' =>
835
                  Verbose_Mode := True;
836
                  Verbosity_Level := Opt.High;
837
 
838
                  --  Processing for x switch
839
 
840
               when 'x' =>
841
                  External_Unit_Compilation_Allowed := True;
842
 
843
                  --  Processing for z switch
844
 
845
               when 'z' =>
846
                  No_Main_Subprogram := True;
847
 
848
                  --  Any other small letter is an illegal switch
849
 
850
               when others =>
851
                  if C in 'a' .. 'z' then
852
                     Bad_Switch (Switch_Chars);
853
 
854
                  else
855
                     Success := False;
856
                  end if;
857
 
858
            end case;
859
         end Check_Switch;
860
      end if;
861
   end Scan_Make_Switches;
862
 
863
end Switch.M;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.