const char *ldfile_output_machine_name = "";
unsigned long ldfile_output_machine;
enum bfd_architecture ldfile_output_architecture;
+search_dirs_type *search_head;
/* start-sanitize-mpw */
#ifndef MPW
#endif /* MPW */
/* end-sanitize-mpw */
-
-
-
/* LOCAL */
-typedef struct search_dirs
-{
- char *name;
- struct search_dirs *next;
-} search_dirs_type;
-static search_dirs_type *search_head;
static search_dirs_type **search_tail_ptr = &search_head;
typedef struct search_arch
static FILE *try_open PARAMS ((char *name, char *exten));
void
-ldfile_add_library_path(name)
-char *name;
+ldfile_add_library_path (name, cmdline)
+ const char *name;
+ boolean cmdline;
{
- search_dirs_type *new =
- (search_dirs_type *)xmalloc((bfd_size_type)(sizeof(search_dirs_type)));
+ search_dirs_type *new;
+
+ new = (search_dirs_type *) xmalloc (sizeof (search_dirs_type));
+ new->next = NULL;
new->name = name;
- new->next = (search_dirs_type*)NULL;
+ new->cmdline = cmdline;
*search_tail_ptr = new;
search_tail_ptr = &new->next;
}
/* ldfile.h -
-
- Copyright (C) 1991 Free Software Foundation, Inc.
+ Copyright 1991, 1992 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
along with GLD; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-
-PROTO(void,ldfile_add_arch,(CONST char *CONST));
-PROTO(void,ldfile_add_library_path,(char *));
-PROTO(void,ldfile_open_command_file,(char *name));
-PROTO(void,ldfile_open_file,(struct lang_input_statement_struct *));
-
+extern char *ldfile_input_filename;
+extern unsigned long ldfile_output_machine;
+extern enum bfd_architecture ldfile_output_architecture;
+extern const char *ldfile_output_machine_name;
+
+/* Structure used to hold the list of directories to search for
+ libraries. */
+
+typedef struct search_dirs
+{
+ /* Next directory on list. */
+ struct search_dirs *next;
+ /* Name of directory. */
+ const char *name;
+ /* true if this is from the command line. */
+ boolean cmdline;
+} search_dirs_type;
+
+extern search_dirs_type *search_head;
+
+void ldfile_add_arch PARAMS ((CONST char *));
+void ldfile_add_library_path PARAMS ((const char *, boolean cmdline));
+void ldfile_open_command_file PARAMS ((char *name));
+void ldfile_open_file PARAMS ((struct lang_input_statement_struct *));
+FILE *ldfile_find_command_file PARAMS ((char *name, char *extend));
+
+void ldfile_set_output_arch PARAMS ((CONST char *));
| TARGET_K '(' NAME ')'
{ lang_add_target($3); }
| SEARCH_DIR '(' filename ')'
- { ldfile_add_library_path($3); }
+ { ldfile_add_library_path ($3, false); }
| OUTPUT '(' filename ')'
{ lang_add_output($3, 1); }
| OUTPUT_FORMAT '(' NAME ')'
xexit (0);
break;
case 'L':
- ldfile_add_library_path (optarg);
+ ldfile_add_library_path (optarg, true);
break;
case 'l':
lang_add_input_file (optarg, lang_input_file_is_l_enum,
if (p != NULL)
*p = 0;
if (*dirlist_ptr)
- ldfile_add_library_path (dirlist_ptr);
+ ldfile_add_library_path (dirlist_ptr, true);
if (p == NULL)
break;
*p = ':';