"Jose E. Marchesi" <jose.march...@oracle.com> writes:
> [...]
> diff --git a/gcc/algol68/a68spec.cc b/gcc/algol68/a68spec.cc
> new file mode 100644
> index 00000000000..75766dd8c08
> --- /dev/null
> +++ b/gcc/algol68/a68spec.cc
> @@ -0,0 +1,212 @@
> +/* a68spec.c -- Specific flags and argument handling of the Algol 68 front 
> end.
> +   Copyright (C) 2025 Jose E. Marchesi.
> +
> +   This file is NOT part of GCC.
> +
> +   GCC is free software; you can redistribute it and/or modify it under the
> +   terms of the GNU General Public License as published by the Free Software
> +   Foundation; either version 3, or (at your option) any later version.
> +
> +   GCC is distributed in the hope that it will be useful, but WITHOUT ANY
> +   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
> +   FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
> +   details.
> +
> +   You should have received a copy of the GNU General Public License along 
> with
> +   GCC; see the file COPYING3.  If not see <http://www.gnu.org/licenses/>.  
> */
> +
> +#include "config.h"
> +#include "system.h"
> +#include "coretypes.h"
> +#include "opt-suggestions.h"
> +#include "gcc.h"
> +#include "tm.h"
> +#include "opts.h"
> +
> +/* satisfy intellisense  */
> +#include "options.h"
> +
> +/* How to link with libgac.  */
> +enum libgac_link_mode
> +{
> +  LIBGAC_STATIC,
> +  LIBGAC_DYNAMIC
> +};
> +
> +static enum libgac_link_mode libgac_link = LIBGAC_STATIC;
> +
> +/* This bit is set if we saw a `-xfoo' language specification.  */
> +#define LANGSPEC (1 << 1)
> +/* This bit is set if they did `-lc'.  */
> +#define WITHLIBC (1 << 2)
> +/* Skip this option.  */
> +#define SKIPOPT (1 << 3)
> +
> +void
> +lang_specific_driver (struct cl_decoded_option **in_decoded_options,
> +                   unsigned int *in_decoded_options_count,
> +                   int *in_added_libraries)
> +{
> +  unsigned int i, j;
> +
> +  /* The new argument list will be contained in this.  */
> +  struct cl_decoded_option *new_decoded_options;
> +
> +  /* "-lc" if it appears on the command line.  */
> +  const struct cl_decoded_option *saw_libc = 0;
> +
> +  /* An array used to flag each argument that needs a bit set for
> +     LANGSPEC or WITHLIBC.  */
> +  int *args;
> +
> +  /* True if we saw -static.  */
> +  int static_link = 0;
> +
> +  /* True if we should add -shared-libgcc to the command-line.  */
> +  int shared_libgcc = 1;
> +
> +  /* The total number of arguments with the new stuff.  */
> +  unsigned int argc;
> +
> +  /* The argument list.  */
> +  struct cl_decoded_option *decoded_options;
> +
> +  /* The number of libraries added in.  */
> +  int added_libraries;
> +
> +  /* The total number of arguments with the new stuff.  */
> +  int num_args = 1;
> +
> +  /* Whether the -o option was used.  */
> +  //  bool saw_opt_o = false;
> +
> +  argc = *in_decoded_options_count;
> +  decoded_options = *in_decoded_options;
> +  added_libraries = *in_added_libraries;
> +
> +  args = XCNEWVEC (int, argc);
> +
> +  for (i = 1; i < argc; i++)
> +    {
> +      const char *arg = decoded_options[i].arg;
> +
> +      switch (decoded_options[i].opt_index)
> +     {
> +     case OPT_l:
> +       if (strcmp (arg, "c") == 0)
> +         args[i] |= WITHLIBC;
> +       break;
> +
> +     case OPT_o:
> +       //saw_opt_o = true;
> +       break;
> +
> +     case OPT_static:
> +       static_link = 1;
> +       break;
> +
> +     case OPT_static_libgcc:
> +       shared_libgcc = 0;
> +       break;
> +
> +     case OPT_static_libgac:
> +       libgac_link = LIBGAC_STATIC;
> +#ifdef HAVE_LD_STATIC_DYNAMIC
> +       /* Remove -static-libphobos from the command only if target
> supports

pasto

Reply via email to