* system.h: Include filenames.h.
(IS_DIR_SEPARATOR, IS_ABSOLUTE_PATHNAME): Don't define.
(DIR_SEPARATOR, DIR_SEPARATOR_2): If not already defined,
define based on HAVE_DOS_BASED_FILE_SYSTEM.
* config/i386/xm-cygwin.h, config/i386/xm-djgpp.h
* config/i386/xm-mingw32.h: Don't define
HAVE_DOS_BASED_FILE_SYSTEM,
DIR_SEPARATOR, or DIR_SEPARATOR_2.
* doc/hostconfig.texi: Update to match.
* cppfiles.c, gcc.c, gensupport.c, protoize.c,
config/i386/cygwin.h:
Use IS_ABSOLUTE_PATH throughout.
* gcc.c (DIR_UP): Delete, unused.
* protoize.c (IS_SAME_PATH): Define in terms of
FILENAME_CMP.
(is_abspath): Delete.
java:
* jcf-path.c: Don't default-define PATH_SEPARATOR nor
DIR_SEPARATOR.
Use FILENAME_CMP.
* jcf-write.c: Don't default-define DIR_SEPARATOR.
* jcf.h: Delete COMPARE_FILENAMES definition.
From-SVN: r68863
+2003-07-02 Zack Weinberg <zack@codesourcery.com>
+
+ * system.h: Include filenames.h.
+ (IS_DIR_SEPARATOR, IS_ABSOLUTE_PATHNAME): Don't define.
+ (DIR_SEPARATOR, DIR_SEPARATOR_2): If not already defined,
+ define based on HAVE_DOS_BASED_FILE_SYSTEM.
+ * config/i386/xm-cygwin.h, config/i386/xm-djgpp.h
+ * config/i386/xm-mingw32.h: Don't define
+ HAVE_DOS_BASED_FILE_SYSTEM,
+ DIR_SEPARATOR, or DIR_SEPARATOR_2.
+ * doc/hostconfig.texi: Update to match.
+
+ * cppfiles.c, gcc.c, gensupport.c, protoize.c,
+ config/i386/cygwin.h:
+ Use IS_ABSOLUTE_PATH throughout.
+ * gcc.c (DIR_UP): Delete, unused.
+ * protoize.c (IS_SAME_PATH): Define in terms of
+ FILENAME_CMP.
+ (is_abspath): Delete.
+
2003-07-02 Kazu Hirata <kazu@cs.umass.edu>
* config/i386/emmintrin.h: Fix comment typos.
(DEFAULT_SIGNED_CHAR): Likewise.
(ASM_OUTPUT_ASCII): Moved here from iris4.h.
Fix IRIX spelling.
-
+
* config/mips/iris3.h: Remove, unused.
* config/mips/iris4.h: Likewise.
* config/mips/iris5.h: Move explicit includes ...
* config.gcc (mips-sgi-irix6*o32, mips-sgi-irix5*): ... here.
-
+
* config/mips/iris6.h (MIPS_ISA_DEFAULT, MIPS_ABI_DEFAULT): Move ...
* config.gcc (mips-sgi-irix6*, mips-sgi-irix5cross64): ... here to
tm_defines.
* config/mips/iris6.h: Fix IRIX spelling.
(MULTILIB_DEFAULTS): Undef before redefinition.
-
+
* config/mips/iris6.h: Move explicit includes ...
* config.gcc (mips-sgi-irix6*, mips-sgi-irix5cross64): ... here.
* dbxout.c (DBXOUT_DECR_NESTING): Emit pending bincls, if required.
(binclstatus): New.
- (struct dbx_file): New members - bincl_status, pending_bincl_name and
+ (struct dbx_file): New members - bincl_status, pending_bincl_name and
prev.
(pending_bincls): New.
(dbxout_init): Initialize new dbx_file members.
(emit_bincl_stab): New function.
(emit_pending_bincls): Same.
(emit_pending_bincls_if_required): Same.
- (dbxout_end_source_file): Emit EINCL stab only if BINCL is already
+ (dbxout_end_source_file): Emit EINCL stab only if BINCL is already
processed.
(dbxout_begin_block): Emit pending BINCL stabs.
(dbxout_end_block): Same.
(dbxout_symbol): Same.
(dbxout_symbol_location): Same.
(dbxout_parms): Same.
-
+
2003-07-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* c-semantics.c (genrtl_case_label): Fix format specifier bug.
displacements.
2003-06-30 Hartmut Penner <hpenner@de.ibm.com>
- Ulrich Weigand <uweigand@de.ibm.com>
+ Ulrich Weigand <uweigand@de.ibm.com>
* config/s390/2084.md: New file.
* config/s390/s390.md: Include it.
2003-06-30 Hartmut Penner <hpenner@de.ibm.com>
- * config/rs6000/rs6000.c (rs6000_split_altivec_in_gprs): New function.
- (altivec_in_gprs_p): New function.
+ * config/rs6000/rs6000.c (rs6000_split_altivec_in_gprs): New function.
+ (altivec_in_gprs_p): New function.
* config/rs6000/rs6000-protos (rs6000_split_altivec_in_gprs): New
prototype.
2003-06-29 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
- * pa.c (update_total_code_bytes): New function.
+ * pa.c (update_total_code_bytes): New function.
(last_address): Number of bytes output for a function and its
associated thunks.
(compute_frame_size): Use BITS_PER_UNIT.
{ \
char *cprefix = concat (tooldir_base_prefix, spec_machine, \
dir_separator_str, NULL); \
- if (!IS_ABSOLUTE_PATHNAME (cprefix)) \
+ if (!IS_ABSOLUTE_PATH (cprefix)) \
cprefix = concat (standard_exec_prefix, spec_machine, dir_separator_str, \
spec_version, dir_separator_str, tooldir_prefix, NULL); \
add_prefix (&exec_prefixes,\
Boston, MA 02111-1307, USA. */
#define HOST_EXECUTABLE_SUFFIX ".exe"
-
-/* Even though Cygwin tries to hide the DOS based filesystem, it
- still shows though at times. */
-#define HAVE_DOS_BASED_FILE_SYSTEM
-
-/* We support both "/" and "\" since everybody tests both but we
- default to "/". This is important because if gcc produces Win32
- paths containing backslashes, make and configure may treat the
- backslashes as escape characters. Many Win32 programs use forward
- slashes so using a forward slash shouldn't be problematic from the
- perspective of wanting gcc to produce native Win32 paths. */
-#undef DIR_SEPARATOR_2
-#define DIR_SEPARATOR_2 '\\'
#define HOST_EXECUTABLE_SUFFIX ".exe"
-/* Even though we support "/", allow "\" since everybody tests both. */
-#define DIR_SEPARATOR '/'
-#define DIR_SEPARATOR_2 '\\'
-
-/* Allow test for DOS drive names. */
-#define HAVE_DOS_BASED_FILE_SYSTEM
-
/* System dependent initialization for collect2
to tell system() to act like Unix. */
#define COLLECT2_HOST_INITIALIZATION \
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* Even though we support "/", allow "\" since everybody tests both. */
-#define DIR_SEPARATOR '\\'
-#define DIR_SEPARATOR_2 '/'
-
-/* Mingw32 does not try to hide the underlying DOS-based file system
- like Cygwin does. */
-#define HAVE_DOS_BASED_FILE_SYSTEM
-
#define HOST_EXECUTABLE_SUFFIX ".exe"
#undef PATH_SEPARATOR
char *name, *n;
splay_tree_node nd;
- if (IS_ABSOLUTE_PATHNAME (fname))
+ if (IS_ABSOLUTE_PATH (fname))
{
/* Just look it up. */
nd = splay_tree_lookup (pfile->all_include_files, (splay_tree_key) fname);
return NO_INCLUDE_PATH;
}
- if (IS_ABSOLUTE_PATHNAME (fname))
+ if (IS_ABSOLUTE_PATH (fname))
return open_file_pch (pfile, fname);
/* For #include_next, skip in the search path past the dir in which
ptr->map_from = from;
/* Make the real filename absolute. */
- if (IS_ABSOLUTE_PATHNAME (to))
+ if (IS_ABSOLUTE_PATH (to))
ptr->map_to = to;
else
{
@cindex configuration file
@cindex @file{xm-@var{machine}.h}
-GCC supports some filesystems that are very different to standard Unix
-filesystems. These macros, defined in @file{xm-@var{machine}.h},
-let you choose.
+GCC needs to know a number of things about the semantics of the host
+machine's filesystem. Filesystems with Unix and MS-DOS semantics are
+automatically detected. For other systems, you can define the
+following macros in @file{xm-@var{machine}.h}.
@ftable @code
-@item VMS
-Define this macro if the host system is VMS@.
-
@item HAVE_DOS_BASED_FILE_SYSTEM
-Define this macro if the host file system obeys the semantics defined by
-MS-DOS instead of Unix. DOS file systems are case insensitive, file
-specifications may begin with a drive letter, and both forward slash and
-backslash (@samp{/} and @samp{\}) are directory separators. If you
-define this macro, you probably need to define the next three macros too.
-
-@item PATH_SEPARATOR
-If defined, this macro should expand to a character constant specifying
-the separator for elements of search paths. The default value is a
-colon (@samp{:}). DOS-based systems usually use semicolon (@samp{;}).
+This macro is automatically defined by @file{system.h} if the host
+file system obeys the semantics defined by MS-DOS instead of Unix.
+DOS file systems are case insensitive, file specifications may begin
+with a drive letter, and both forward slash and backslash (@samp{/}
+and @samp{\}) are directory separators.
@item DIR_SEPARATOR
@itemx DIR_SEPARATOR_2
If defined, these macros expand to character constants specifying
-separators for directory names within a file specification. They are
-used somewhat inconsistently throughout the compiler. If your system
-behaves like Unix (only forward slash separates pathnames), define
-neither of them. If your system behaves like DOS (both forward and
-backward slash can be used), define @code{DIR_SEPARATOR} to @samp{/}
-and @code{DIR_SEPARATOR_2} to @samp{\}.
+separators for directory names within a file specification.
+@file{system.h} will automatically give them appropriate values on
+Unix and MS-DOS file systems. If your file system is neither of
+these, define one or both appropriately in @file{xm-@var{machine}.h}.
+
+However, operating systems like VMS, where constructing a pathname is
+more complicated than just stringing together directory names
+separated by a special character, should not define either of these
+macros.
+
+@item PATH_SEPARATOR
+If defined, this macro should expand to a character constant
+specifying the separator for elements of search paths. The default
+value is a colon (@samp{:}). DOS-based systems usually, but not
+always, use semicolon (@samp{;}).
+
+@item VMS
+Define this macro if the host system is VMS@.
@item HOST_OBJECT_SUFFIX
Define this macro to be a C string representing the suffix for object
#define TARGET_OBJECT_SUFFIX ".o"
#endif
-#ifndef VMS
-/* FIXME: the location independence code for VMS is hairier than this,
- and hasn't been written. */
-#ifndef DIR_UP
-#define DIR_UP ".."
-#endif /* DIR_UP */
-#endif /* VMS */
-
static const char dir_separator_str[] = { DIR_SEPARATOR, 0 };
/* Most every one is fine with LIBRARY_PATH. For some, it conflicts. */
/* Determine the filename to execute (special case for absolute paths). */
- if (IS_ABSOLUTE_PATHNAME (name))
+ if (IS_ABSOLUTE_PATH (name))
{
if (access (name, mode) == 0)
{
int *warn;
int os_multilib;
{
- if (!IS_ABSOLUTE_PATHNAME (prefix))
+ if (!IS_ABSOLUTE_PATH (prefix))
abort ();
if (target_system_root)
directories, so that we can search both the user specified directory
and the standard place. */
- if (!IS_ABSOLUTE_PATHNAME (tooldir_prefix))
+ if (!IS_ABSOLUTE_PATH (tooldir_prefix))
{
if (gcc_exec_prefix)
{
/* Relative directories always come from -B,
and it is better not to use them for searching
at run time. In particular, stage1 loses. */
- if (!IS_ABSOLUTE_PATHNAME (pl->prefix))
+ if (!IS_ABSOLUTE_PATH (pl->prefix))
continue;
#endif
/* Try subdirectory if there is one. */
standard_exec_prefix. This lets us move the installed tree
as a unit. If GCC_EXEC_PREFIX is defined, base
standard_startfile_prefix on that as well. */
- if (IS_ABSOLUTE_PATHNAME (standard_startfile_prefix))
+ if (IS_ABSOLUTE_PATH (standard_startfile_prefix))
add_sysrooted_prefix (&startfile_prefixes,
standard_startfile_prefix, "BINUTILS",
PREFIX_PRIORITY_LAST, 0, NULL, 1);
const char **argv;
{
/* Must have only one argument. */
- if (argc == 1 && IS_ABSOLUTE_PATHNAME (argv[0]) && ! access (argv[0], R_OK))
+ if (argc == 1 && IS_ABSOLUTE_PATH (argv[0]) && ! access (argv[0], R_OK))
return argv[0];
return NULL;
if (argc != 2)
return NULL;
- if (IS_ABSOLUTE_PATHNAME (argv[0]) && ! access (argv[0], R_OK))
+ if (IS_ABSOLUTE_PATH (argv[0]) && ! access (argv[0], R_OK))
return argv[0];
return argv[1];
FILE *input_file;
/* If specified file name is absolute, skip the include stack. */
- if (! IS_ABSOLUTE_PATHNAME (filename))
+ if (! IS_ABSOLUTE_PATH (filename))
{
struct file_name_list *stackp;
+2003-07-02 Zack Weinberg <zack@codesourcery.com>
+
+ * jcf-path.c: Don't default-define PATH_SEPARATOR nor
+ DIR_SEPARATOR.
+ Use FILENAME_CMP.
+ * jcf-write.c: Don't default-define DIR_SEPARATOR.
+ * jcf.h: Delete COMPARE_FILENAMES definition.
+
2003-07-02 Neil Booth <neil@daikokuya.co.uk>
* lang.c (java_init_options): Update prototype.
#include "jcf.h"
-/* By default, colon separates directories in a path. */
-#ifndef PATH_SEPARATOR
-#define PATH_SEPARATOR ':'
-#endif
-
-#ifndef DIR_SEPARATOR
-#define DIR_SEPARATOR '/'
-#endif
-
#ifndef DIR_UP
#define DIR_UP ".."
#endif
len = strlen (filename);
- if (len > 4 && (COMPARE_FILENAMES (filename + len - 4, ".zip") == 0
- || COMPARE_FILENAMES (filename + len - 4, ".jar") == 0))
+ if (len > 4 && (FILENAME_CMP (filename + len - 4, ".zip") == 0
+ || FILENAME_CMP (filename + len - 4, ".jar") == 0))
{
n->flags |= FLAG_ZIP;
/* If the user uses -classpath then he'll have to include
libgcj.jar in the value. We check for this in a simplistic
way. Symlinks will fool this test. This is only used for
-MM and -MMD, so it probably isn't terribly important. */
- if (! COMPARE_FILENAMES (filename, LIBGCJ_ZIP_FILE))
+ if (! FILENAME_CMP (filename, LIBGCJ_ZIP_FILE))
n->flags |= FLAG_SYSTEM;
}
#include "ggc.h"
#include "tm_p.h"
-#ifndef DIR_SEPARATOR
-#define DIR_SEPARATOR '/'
-#endif
-
extern struct obstack temporary_obstack;
/* Base directory in which `.class' files should be written.
#define JCF_USE_SCANDIR 0
#endif
-/* On case-insensitive file systems, file name components must be
- compared using "strcasecmp", if available, instead of "strcmp".
- Assumes "config.h" has already been included. */
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM) && defined (HAVE_STRCASECMP)
-#define COMPARE_FILENAMES(X, Y) strcasecmp ((X), (Y))
-#else
-#define COMPARE_FILENAMES(X, Y) strcmp ((X), (Y))
-#endif
-
/* On case-insensitive file systems, we need to ensure that a request
to open a .java or .class file is honored only if the file to be
opened is of the exact case we are asking for. In other words, we
#endif
/* Macro to see if the paths match. */
-#ifdef HAVE_DOS_BASED_FILE_SYSTEM
-#define IS_SAME_PATH(a,b) (strcasecmp (a, b) == 0)
-#else
-#define IS_SAME_PATH(a,b) (strcmp (a, b) == 0)
-#endif
+#define IS_SAME_PATH(a,b) (FILENAME_CMP (a, b) == 0)
/* Suffix for aux-info files. */
#ifdef __MSDOS__
static int file_excluded_p PARAMS ((const char *));
static char *unexpand_if_needed PARAMS ((const char *));
static char *abspath PARAMS ((const char *, const char *));
-static int is_abspath PARAMS ((const char *));
static void check_aux_info PARAMS ((int));
static const char *find_corresponding_lparen PARAMS ((const char *));
static int referenced_file_is_newer PARAMS ((const char *, time_t));
{
const struct default_include *p;
- if (! is_abspath (path))
+ if (! IS_ABSOLUTE_PATH (path))
abort (); /* Must be an absolutized filename. */
for (p = cpp_include_defaults; p->fname; p++)
return (got_unexpanded ? savestring (line_buf, copy_p - line_buf) : 0);
}
\f
-/* Return 1 if pathname is absolute. */
-
-static int
-is_abspath (path)
- const char *path;
-{
- return (IS_DIR_SEPARATOR (path[0])
-#ifdef HAVE_DOS_BASED_FILE_SYSTEM
- /* Check for disk name on MS-DOS-based systems. */
- || (path[0] && path[1] == ':' && IS_DIR_SEPARATOR (path[2]))
-#endif
- );
-}
-\f
/* Return the absolutized filename for the given relative
filename. Note that if that filename is already absolute, it may
still be returned in a modified form because this routine also
{
const char *src_p;
- if (! is_abspath (rel_filename))
+ if (! IS_ABSOLUTE_PATH (rel_filename))
{
src_p = cwd2;
while ((*endp++ = *src_p++))
continue;
aux_info_second_line = p;
aux_info_relocated_name = 0;
- if (! is_abspath (invocation_filename))
+ if (! IS_ABSOLUTE_PATH (invocation_filename))
{
/* INVOCATION_FILENAME is relative;
append it to BASE_SOURCE_FILENAME's dir. */
#define PATH_SEPARATOR ':'
#endif
+/* Filename handling macros. */
+#include "filenames.h"
+
+/* These should be phased out in favor of IS_DIR_SEPARATOR, where possible. */
#ifndef DIR_SEPARATOR
-#define DIR_SEPARATOR '/'
-#endif
-
-/* Define IS_DIR_SEPARATOR. */
-#ifndef DIR_SEPARATOR_2
-# define IS_DIR_SEPARATOR(CH) ((CH) == DIR_SEPARATOR)
-#else /* DIR_SEPARATOR_2 */
-# define IS_DIR_SEPARATOR(CH) \
- (((CH) == DIR_SEPARATOR) || ((CH) == 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 machine 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] == '$')
+# define DIR_SEPARATOR '/'
+# ifdef HAVE_DOS_BASED_FILE_SYSTEM
+# define DIR_SEPARATOR_2 '\\'
+# endif
#endif
/* Get libiberty declarations. */