/* VMS linker wrapper.
- Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2007
Free Software Foundation, Inc.
Contributed by Douglas B. Rupp (rupp@gnat.com).
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+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 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
any later version.
-GNU CC is distributed in the hope that it will be useful,
+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 GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
/* This program is a wrapper around the VMS linker.
It translates Unix style command line options into corresponding
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
typedef struct dsc {unsigned short len, mbz; char *adr; } Descr;
/* File specification for vms-dwarf2eh.o. */
static char *vmsdwarf2ehspec = 0;
-/* verbose = 1 if -v passed. */
+/* verbose = 1 if -v passed. */
static int verbose = 0;
/* save_temps = 1 if -save-temps passed. */
/* Add STR to the list of arguments to pass to the linker. Expand the list as
necessary to accommodate. */
-static void addarg PARAMS ((const char *));
+static void addarg (const char *);
/* Check to see if NAME is a regular file, i.e. not a directory */
-static int is_regular_file PARAMS ((char *));
+static int is_regular_file (char *);
/* Translate a Unix syntax file specification FILESPEC into VMS syntax.
- If indicators of VMS syntax found, return input string. */
-static char *to_host_file_spec PARAMS ((char *));
+ If indicators of VMS syntax found, return input string. */
+static char *to_host_file_spec (char *);
-/* Locate the library named LIB_NAME in the set of paths PATH_VAL. */
-static char *locate_lib PARAMS ((char *, char *));
+/* Locate the library named LIB_NAME in the set of paths PATH_VAL. */
+static char *locate_lib (char *, char *);
/* Given a library name NAME, i.e. foo, Look for libfoo.lib and then
libfoo.a in the set of directories we are allowed to search in. */
-static const char *expand_lib PARAMS ((char *));
+static const char *expand_lib (char *);
/* Preprocess the number of args P_ARGC in ARGV.
- Look for special flags, etc. that must be handled first. */
-static void preprocess_args PARAMS ((int *, char **));
+ Look for special flags, etc. that must be handled first. */
+static void preprocess_args (int *, char **);
/* Preprocess the number of args P_ARGC in ARGV. Look for
- special flags, etc. that must be handled for the VMS linker. */
-static void process_args PARAMS ((int *, char **));
+ special flags, etc. that must be handled for the VMS linker. */
+static void process_args (int *, char **);
/* Action routine called by decc$to_vms. NAME is a file name or
- directory name. TYPE is unused. */
-static int translate_unix PARAMS ((char *, int));
+ directory name. TYPE is unused. */
+static int translate_unix (char *, int);
-int main PARAMS ((int, char **));
+int main (int, char **);
\f
static void
-addarg (str)
- const char *str;
+addarg (const char *str)
{
int i;
}
static char *
-locate_lib (lib_name, path_val)
- char *lib_name;
- char *path_val;
+locate_lib (char *lib_name, char *path_val)
{
int lib_len = strlen (lib_name);
char *eptr, *sptr;
}
static const char *
-expand_lib (name)
- char *name;
+expand_lib (char *name)
{
char *lib, *lib_path;
}
static int
-is_regular_file (name)
- char *name;
+is_regular_file (char *name)
{
int ret;
struct stat statbuf;
}
static void
-preprocess_args (p_argc, argv)
- int *p_argc;
- char **argv;
+preprocess_args (int *p_argc, char **argv)
{
int i;
}
static void
-process_args (p_argc, argv)
- int *p_argc;
- char **argv;
+process_args (int *p_argc, char **argv)
{
int i;
and args to be what the VMS linker wants. */
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int i;
char cwdev [128], *devptr;
strncpy (cwdev, cwd, devlen);
cwdev [devlen] = '\0';
- search_dirs = xmalloc (strlen (system_search_dirs) + 1);
- strcpy (search_dirs, system_search_dirs);
+ search_dirs = xstrdup (system_search_dirs);
addarg ("link");
static char filename_buff [256];
static int
-translate_unix (name, type)
- char *name;
- int type ATTRIBUTE_UNUSED;
+translate_unix (char *name, int type ATTRIBUTE_UNUSED)
{
strcpy (filename_buff, name);
return 0;
}
static char *
-to_host_file_spec (filespec)
- char *filespec;
+to_host_file_spec (char *filespec)
{
strcpy (new_host_filespec, "");
if (strchr (filespec, ']') || strchr (filespec, ':'))