Commit c5c0b3d9 by Richard Kenner Committed by Richard Kenner

system.h (IS_DIR_SEPARATOR): Use uppercase macro name.

	* system.h (IS_DIR_SEPARATOR): Use uppercase macro name.
	(IS_ABSOLUTE_PATHNAME): New macro.
	* gcc.c (find_a_file, process_command, do_spec_1, main): Use it.

From-SVN: r37818
parent bb92901d
Tue Nov 28 09:53:50 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* system.h (IS_DIR_SEPARATOR): Use uppercase macro name.
(IS_ABSOLUTE_PATHNAME): New macro.
* gcc.c (find_a_file, process_command, do_spec_1, main): Use it.
2000-11-28 Jakub Jelinek <jakub@redhat.com> 2000-11-28 Jakub Jelinek <jakub@redhat.com>
* config/i386/i386.md (truncxfsf2_2): Fix predicate. * config/i386/i386.md (truncxfsf2_2): Fix predicate.
......
...@@ -2242,7 +2242,7 @@ find_a_file (pprefix, name, mode) ...@@ -2242,7 +2242,7 @@ find_a_file (pprefix, name, mode)
int len = pprefix->max_len + strlen (name) + strlen (file_suffix) + 1; int len = pprefix->max_len + strlen (name) + strlen (file_suffix) + 1;
#ifdef DEFAULT_ASSEMBLER #ifdef DEFAULT_ASSEMBLER
if (! strcmp(name, "as") && access (DEFAULT_ASSEMBLER, mode) == 0) if (! strcmp (name, "as") && access (DEFAULT_ASSEMBLER, mode) == 0)
return xstrdup (DEFAULT_ASSEMBLER); return xstrdup (DEFAULT_ASSEMBLER);
#endif #endif
...@@ -2258,12 +2258,7 @@ find_a_file (pprefix, name, mode) ...@@ -2258,12 +2258,7 @@ find_a_file (pprefix, name, mode)
/* Determine the filename to execute (special case for absolute paths). */ /* Determine the filename to execute (special case for absolute paths). */
if (IS_DIR_SEPARATOR (*name) if (IS_ABSOLUTE_PATHNAME (name))
#ifdef HAVE_DOS_BASED_FILE_SYSTEM
/* Check for disk name on MS-DOS-based systems. */
|| (name[0] && name[1] == ':' && IS_DIR_SEPARATOR (name[2]))
#endif
)
{ {
if (access (name, mode) == 0) if (access (name, mode) == 0)
{ {
...@@ -2918,6 +2913,7 @@ process_command (argc, argv) ...@@ -2918,6 +2913,7 @@ process_command (argc, argv)
if (gcc_exec_prefix) if (gcc_exec_prefix)
{ {
int len = strlen (gcc_exec_prefix); int len = strlen (gcc_exec_prefix);
if (len > (int) sizeof ("/lib/gcc-lib/") - 1 if (len > (int) sizeof ("/lib/gcc-lib/") - 1
&& (IS_DIR_SEPARATOR (gcc_exec_prefix[len-1]))) && (IS_DIR_SEPARATOR (gcc_exec_prefix[len-1])))
{ {
...@@ -3460,7 +3456,7 @@ process_command (argc, argv) ...@@ -3460,7 +3456,7 @@ process_command (argc, argv)
directories, so that we can search both the user specified directory directories, so that we can search both the user specified directory
and the standard place. */ and the standard place. */
if (!IS_DIR_SEPARATOR (*tooldir_prefix)) if (!IS_ABSOLUTE_PATHNAME (tooldir_prefix))
{ {
if (gcc_exec_prefix) if (gcc_exec_prefix)
{ {
...@@ -3957,7 +3953,7 @@ do_spec_1 (spec, inswitch, soft_matched_part) ...@@ -3957,7 +3953,7 @@ do_spec_1 (spec, inswitch, soft_matched_part)
/* Relative directories always come from -B, /* Relative directories always come from -B,
and it is better not to use them for searching and it is better not to use them for searching
at run time. In particular, stage1 loses. */ at run time. In particular, stage1 loses. */
if (!IS_DIR_SEPARATOR (pl->prefix[0])) if (!IS_ABSOLUTE_PATHNAME (pl->prefix))
continue; continue;
#endif #endif
/* Try subdirectory if there is one. */ /* Try subdirectory if there is one. */
...@@ -5405,14 +5401,7 @@ main (argc, argv) ...@@ -5405,14 +5401,7 @@ main (argc, argv)
standard_exec_prefix. This lets us move the installed tree standard_exec_prefix. This lets us move the installed tree
as a unit. If GCC_EXEC_PREFIX is defined, base as a unit. If GCC_EXEC_PREFIX is defined, base
standard_startfile_prefix on that as well. */ standard_startfile_prefix on that as well. */
if (IS_DIR_SEPARATOR (*standard_startfile_prefix) if (IS_ABSOLUTE_PATHNAME (standard_startfile_prefix))
|| *standard_startfile_prefix == '$'
#ifdef HAVE_DOS_BASED_FILE_SYSTEM
/* Check for disk name on MS-DOS-based systems. */
|| (standard_startfile_prefix[1] == ':'
&& (IS_DIR_SEPARATOR (standard_startfile_prefix[2])))
#endif
)
add_prefix (&startfile_prefixes, standard_startfile_prefix, "BINUTILS", add_prefix (&startfile_prefixes, standard_startfile_prefix, "BINUTILS",
PREFIX_PRIORITY_LAST, 0, NULL_PTR); PREFIX_PRIORITY_LAST, 0, NULL_PTR);
else else
...@@ -5440,7 +5429,8 @@ main (argc, argv) ...@@ -5440,7 +5429,8 @@ main (argc, argv)
} }
else else
{ {
if (!IS_DIR_SEPARATOR (*standard_startfile_prefix) && gcc_exec_prefix) if (!IS_ABSOLUTE_PATHNAME (standard_startfile_prefix)
&& gcc_exec_prefix)
add_prefix (&startfile_prefixes, add_prefix (&startfile_prefixes,
concat (gcc_exec_prefix, machine_suffix, concat (gcc_exec_prefix, machine_suffix,
standard_startfile_prefix, NULL_PTR), standard_startfile_prefix, NULL_PTR),
......
...@@ -538,12 +538,25 @@ extern void abort PARAMS ((void)); ...@@ -538,12 +538,25 @@ extern void abort PARAMS ((void));
/* Define IS_DIR_SEPARATOR. */ /* Define IS_DIR_SEPARATOR. */
#ifndef DIR_SEPARATOR_2 #ifndef DIR_SEPARATOR_2
# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) # define IS_DIR_SEPARATOR(CH) ((CH) == DIR_SEPARATOR)
#else /* DIR_SEPARATOR_2 */ #else /* DIR_SEPARATOR_2 */
# define IS_DIR_SEPARATOR(ch) \ # define IS_DIR_SEPARATOR(CH) \
(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) (((CH) == DIR_SEPARATOR) || ((CH) == DIR_SEPARATOR_2))
#endif /* DIR_SEPARATOR_2 */ #endif /* DIR_SEPARATOR_2 */
/* Say how to test for an absolute pathname. On Unix systems, this is if
it starts with a leading slash or a '$', the latter meaning the value of
an environment variable is to be used. On machien with DOS-based
file systems, it is also absolute if it starts with a drive identifier. */
#ifdef HAVE_DOS_BASED_FILE_SYSTEM
#define IS_ABSOLUTE_PATHNAME(STR) \
(IS_DIR_SEPARATOR ((STR)[0]) || (STR)[0] == '$' \
|| ((STR)[0] != '\0' && (STR)[1] == ':' && IS_DIR_SEPARATOR ((STR)[2])))
#else
#define IS_ABSOLUTE_PATHNAME(STR) \
(IS_DIR_SEPARATOR ((STR)[0]) || (STR)[0] == '$')
#endif
/* Get libiberty declarations. */ /* Get libiberty declarations. */
#include "libiberty.h" #include "libiberty.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment