1 /* Specific flags and argument handling of the C front-end.
2 Copyright (C) 1999, 2001 Free Software Foundation, Inc.
4 This file is part of GNU CC.
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
25 /* Filter argc and argv before processing by the gcc driver proper. */
27 lang_specific_driver (in_argc
, in_argv
, in_added_libraries
)
28 int *in_argc ATTRIBUTE_UNUSED
;
29 const char *const **in_argv ATTRIBUTE_UNUSED
;
30 int *in_added_libraries ATTRIBUTE_UNUSED
;
32 #ifdef ENABLE_SHARED_LIBGCC
35 /* The new argument list will be contained in this. */
38 /* True if we should add -shared-libgcc to the command-line. */
39 int shared_libgcc
= 0;
41 /* The total number of arguments with the new stuff. */
44 /* The argument list. */
45 const char *const *argv
;
50 for (i
= 1; i
< argc
; i
++)
52 if (argv
[i
][0] == '-')
54 if (strcmp (argv
[i
], "-static-libgcc") == 0
55 || strcmp (argv
[i
], "-static") == 0)
62 /* If the filename ends in .m or .mi, we are compiling ObjC
63 and want to pass -shared-libgcc. */
64 len
= strlen (argv
[i
]);
65 if ((len
> 2 && argv
[i
][len
- 2] == '.' && argv
[i
][len
- 1] == 'm')
66 || (len
> 3 && argv
[i
][len
- 3] == '.' && argv
[i
][len
- 2] == 'm'
67 && argv
[i
][len
- 1] == 'i'))
74 /* Make sure to have room for the trailing NULL argument. */
75 arglist
= (const char **) xmalloc ((argc
+2) * sizeof (char *));
85 arglist
[i
++] = "-shared-libgcc";
95 /* Called before linking. Returns 0 on success and -1 on failure. */
97 lang_specific_pre_link ()
99 return 0; /* Not used for C. */
102 /* Number of extra output files that lang_specific_pre_link may generate. */
103 int lang_specific_extra_outfiles
= 0; /* Not used for C. */