Commit 3dce1408 by Zack Weinberg

system.h: Include filenames.h.

	* 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
parent bacb96b2
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> 2003-07-02 Kazu Hirata <kazu@cs.umass.edu>
* config/i386/emmintrin.h: Fix comment typos. * config/i386/emmintrin.h: Fix comment typos.
...@@ -136,7 +156,7 @@ Wed Jul 2 08:12:36 CEST 2003 Jan Hubicka <jh@suse.cz> ...@@ -136,7 +156,7 @@ Wed Jul 2 08:12:36 CEST 2003 Jan Hubicka <jh@suse.cz>
(DEFAULT_SIGNED_CHAR): Likewise. (DEFAULT_SIGNED_CHAR): Likewise.
(ASM_OUTPUT_ASCII): Moved here from iris4.h. (ASM_OUTPUT_ASCII): Moved here from iris4.h.
Fix IRIX spelling. Fix IRIX spelling.
* config/mips/iris3.h: Remove, unused. * config/mips/iris3.h: Remove, unused.
* config/mips/iris4.h: Likewise. * config/mips/iris4.h: Likewise.
...@@ -148,7 +168,7 @@ Wed Jul 2 08:12:36 CEST 2003 Jan Hubicka <jh@suse.cz> ...@@ -148,7 +168,7 @@ Wed Jul 2 08:12:36 CEST 2003 Jan Hubicka <jh@suse.cz>
* config/mips/iris5.h: Move explicit includes ... * config/mips/iris5.h: Move explicit includes ...
* config.gcc (mips-sgi-irix6*o32, mips-sgi-irix5*): ... here. * config.gcc (mips-sgi-irix6*o32, mips-sgi-irix5*): ... here.
* config/mips/iris6.h (MIPS_ISA_DEFAULT, MIPS_ABI_DEFAULT): Move ... * config/mips/iris6.h (MIPS_ISA_DEFAULT, MIPS_ABI_DEFAULT): Move ...
* config.gcc (mips-sgi-irix6*, mips-sgi-irix5cross64): ... here to * config.gcc (mips-sgi-irix6*, mips-sgi-irix5cross64): ... here to
tm_defines. tm_defines.
...@@ -159,7 +179,7 @@ Wed Jul 2 08:12:36 CEST 2003 Jan Hubicka <jh@suse.cz> ...@@ -159,7 +179,7 @@ Wed Jul 2 08:12:36 CEST 2003 Jan Hubicka <jh@suse.cz>
* config/mips/iris6.h: Fix IRIX spelling. * config/mips/iris6.h: Fix IRIX spelling.
(MULTILIB_DEFAULTS): Undef before redefinition. (MULTILIB_DEFAULTS): Undef before redefinition.
* config/mips/iris6.h: Move explicit includes ... * config/mips/iris6.h: Move explicit includes ...
* config.gcc (mips-sgi-irix6*, mips-sgi-irix5cross64): ... here. * config.gcc (mips-sgi-irix6*, mips-sgi-irix5cross64): ... here.
...@@ -210,7 +230,7 @@ Wed Jul 2 02:12:51 CEST 2003 Jan Hubicka <jh@suse.cz> ...@@ -210,7 +230,7 @@ Wed Jul 2 02:12:51 CEST 2003 Jan Hubicka <jh@suse.cz>
* dbxout.c (DBXOUT_DECR_NESTING): Emit pending bincls, if required. * dbxout.c (DBXOUT_DECR_NESTING): Emit pending bincls, if required.
(binclstatus): New. (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. prev.
(pending_bincls): New. (pending_bincls): New.
(dbxout_init): Initialize new dbx_file members. (dbxout_init): Initialize new dbx_file members.
...@@ -218,7 +238,7 @@ Wed Jul 2 02:12:51 CEST 2003 Jan Hubicka <jh@suse.cz> ...@@ -218,7 +238,7 @@ Wed Jul 2 02:12:51 CEST 2003 Jan Hubicka <jh@suse.cz>
(emit_bincl_stab): New function. (emit_bincl_stab): New function.
(emit_pending_bincls): Same. (emit_pending_bincls): Same.
(emit_pending_bincls_if_required): 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. processed.
(dbxout_begin_block): Emit pending BINCL stabs. (dbxout_begin_block): Emit pending BINCL stabs.
(dbxout_end_block): Same. (dbxout_end_block): Same.
...@@ -229,7 +249,7 @@ Wed Jul 2 02:12:51 CEST 2003 Jan Hubicka <jh@suse.cz> ...@@ -229,7 +249,7 @@ Wed Jul 2 02:12:51 CEST 2003 Jan Hubicka <jh@suse.cz>
(dbxout_symbol): Same. (dbxout_symbol): Same.
(dbxout_symbol_location): Same. (dbxout_symbol_location): Same.
(dbxout_parms): Same. (dbxout_parms): Same.
2003-07-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2003-07-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* c-semantics.c (genrtl_case_label): Fix format specifier bug. * c-semantics.c (genrtl_case_label): Fix format specifier bug.
...@@ -472,7 +492,7 @@ Wed Jul 2 02:12:51 CEST 2003 Jan Hubicka <jh@suse.cz> ...@@ -472,7 +492,7 @@ Wed Jul 2 02:12:51 CEST 2003 Jan Hubicka <jh@suse.cz>
displacements. displacements.
2003-06-30 Hartmut Penner <hpenner@de.ibm.com> 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/2084.md: New file.
* config/s390/s390.md: Include it. * config/s390/s390.md: Include it.
...@@ -607,8 +627,8 @@ Mon Jun 30 15:36:29 CEST 2003 Jan Hubicka <jh@suse.cz> ...@@ -607,8 +627,8 @@ Mon Jun 30 15:36:29 CEST 2003 Jan Hubicka <jh@suse.cz>
2003-06-30 Hartmut Penner <hpenner@de.ibm.com> 2003-06-30 Hartmut Penner <hpenner@de.ibm.com>
* config/rs6000/rs6000.c (rs6000_split_altivec_in_gprs): New function. * config/rs6000/rs6000.c (rs6000_split_altivec_in_gprs): New function.
(altivec_in_gprs_p): New function. (altivec_in_gprs_p): New function.
* config/rs6000/rs6000-protos (rs6000_split_altivec_in_gprs): New * config/rs6000/rs6000-protos (rs6000_split_altivec_in_gprs): New
prototype. prototype.
...@@ -730,7 +750,7 @@ Sun Jun 29 23:06:32 CEST 2003 Jan Hubicka <jh@suse.cz> ...@@ -730,7 +750,7 @@ Sun Jun 29 23:06:32 CEST 2003 Jan Hubicka <jh@suse.cz>
2003-06-29 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> 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 (last_address): Number of bytes output for a function and its
associated thunks. associated thunks.
(compute_frame_size): Use BITS_PER_UNIT. (compute_frame_size): Use BITS_PER_UNIT.
......
...@@ -213,7 +213,7 @@ do \ ...@@ -213,7 +213,7 @@ do \
{ \ { \
char *cprefix = concat (tooldir_base_prefix, spec_machine, \ char *cprefix = concat (tooldir_base_prefix, spec_machine, \
dir_separator_str, NULL); \ dir_separator_str, NULL); \
if (!IS_ABSOLUTE_PATHNAME (cprefix)) \ if (!IS_ABSOLUTE_PATH (cprefix)) \
cprefix = concat (standard_exec_prefix, spec_machine, dir_separator_str, \ cprefix = concat (standard_exec_prefix, spec_machine, dir_separator_str, \
spec_version, dir_separator_str, tooldir_prefix, NULL); \ spec_version, dir_separator_str, tooldir_prefix, NULL); \
add_prefix (&exec_prefixes,\ add_prefix (&exec_prefixes,\
......
...@@ -20,16 +20,3 @@ the Free Software Foundation, 59 Temple Place - Suite 330, ...@@ -20,16 +20,3 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#define HOST_EXECUTABLE_SUFFIX ".exe" #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 '\\'
...@@ -23,13 +23,6 @@ Boston, MA 02111-1307, USA. */ ...@@ -23,13 +23,6 @@ Boston, MA 02111-1307, USA. */
#define HOST_EXECUTABLE_SUFFIX ".exe" #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 /* System dependent initialization for collect2
to tell system() to act like Unix. */ to tell system() to act like Unix. */
#define COLLECT2_HOST_INITIALIZATION \ #define COLLECT2_HOST_INITIALIZATION \
......
...@@ -19,14 +19,6 @@ along with GNU CC; see the file COPYING. If not, write to ...@@ -19,14 +19,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ 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" #define HOST_EXECUTABLE_SUFFIX ".exe"
#undef PATH_SEPARATOR #undef PATH_SEPARATOR
......
...@@ -547,7 +547,7 @@ cpp_included (cpp_reader *pfile, const char *fname) ...@@ -547,7 +547,7 @@ cpp_included (cpp_reader *pfile, const char *fname)
char *name, *n; char *name, *n;
splay_tree_node nd; splay_tree_node nd;
if (IS_ABSOLUTE_PATHNAME (fname)) if (IS_ABSOLUTE_PATH (fname))
{ {
/* Just look it up. */ /* Just look it up. */
nd = splay_tree_lookup (pfile->all_include_files, (splay_tree_key) fname); nd = splay_tree_lookup (pfile->all_include_files, (splay_tree_key) fname);
...@@ -592,7 +592,7 @@ find_include_file (cpp_reader *pfile, const char *fname, int angle_brackets, ...@@ -592,7 +592,7 @@ find_include_file (cpp_reader *pfile, const char *fname, int angle_brackets,
return NO_INCLUDE_PATH; return NO_INCLUDE_PATH;
} }
if (IS_ABSOLUTE_PATHNAME (fname)) if (IS_ABSOLUTE_PATH (fname))
return open_file_pch (pfile, fname); return open_file_pch (pfile, fname);
/* For #include_next, skip in the search path past the dir in which /* For #include_next, skip in the search path past the dir in which
...@@ -962,7 +962,7 @@ read_name_map (cpp_reader *pfile, const char *dirname) ...@@ -962,7 +962,7 @@ read_name_map (cpp_reader *pfile, const char *dirname)
ptr->map_from = from; ptr->map_from = from;
/* Make the real filename absolute. */ /* Make the real filename absolute. */
if (IS_ABSOLUTE_PATHNAME (to)) if (IS_ABSOLUTE_PATH (to))
ptr->map_to = to; ptr->map_to = to;
else else
{ {
......
...@@ -47,35 +47,40 @@ common thing to do in this hook is to detect stack overflow. ...@@ -47,35 +47,40 @@ common thing to do in this hook is to detect stack overflow.
@cindex configuration file @cindex configuration file
@cindex @file{xm-@var{machine}.h} @cindex @file{xm-@var{machine}.h}
GCC supports some filesystems that are very different to standard Unix GCC needs to know a number of things about the semantics of the host
filesystems. These macros, defined in @file{xm-@var{machine}.h}, machine's filesystem. Filesystems with Unix and MS-DOS semantics are
let you choose. automatically detected. For other systems, you can define the
following macros in @file{xm-@var{machine}.h}.
@ftable @code @ftable @code
@item VMS
Define this macro if the host system is VMS@.
@item HAVE_DOS_BASED_FILE_SYSTEM @item HAVE_DOS_BASED_FILE_SYSTEM
Define this macro if the host file system obeys the semantics defined by This macro is automatically defined by @file{system.h} if the host
MS-DOS instead of Unix. DOS file systems are case insensitive, file file system obeys the semantics defined by MS-DOS instead of Unix.
specifications may begin with a drive letter, and both forward slash and DOS file systems are case insensitive, file specifications may begin
backslash (@samp{/} and @samp{\}) are directory separators. If you with a drive letter, and both forward slash and backslash (@samp{/}
define this macro, you probably need to define the next three macros too. and @samp{\}) are directory separators.
@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{;}).
@item DIR_SEPARATOR @item DIR_SEPARATOR
@itemx DIR_SEPARATOR_2 @itemx DIR_SEPARATOR_2
If defined, these macros expand to character constants specifying If defined, these macros expand to character constants specifying
separators for directory names within a file specification. They are separators for directory names within a file specification.
used somewhat inconsistently throughout the compiler. If your system @file{system.h} will automatically give them appropriate values on
behaves like Unix (only forward slash separates pathnames), define Unix and MS-DOS file systems. If your file system is neither of
neither of them. If your system behaves like DOS (both forward and these, define one or both appropriately in @file{xm-@var{machine}.h}.
backward slash can be used), define @code{DIR_SEPARATOR} to @samp{/}
and @code{DIR_SEPARATOR_2} to @samp{\}. 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 @item HOST_OBJECT_SUFFIX
Define this macro to be a C string representing the suffix for object Define this macro to be a C string representing the suffix for object
......
...@@ -111,14 +111,6 @@ extern int getrusage PARAMS ((int, struct rusage *)); ...@@ -111,14 +111,6 @@ extern int getrusage PARAMS ((int, struct rusage *));
#define TARGET_OBJECT_SUFFIX ".o" #define TARGET_OBJECT_SUFFIX ".o"
#endif #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 }; static const char dir_separator_str[] = { DIR_SEPARATOR, 0 };
/* Most every one is fine with LIBRARY_PATH. For some, it conflicts. */ /* Most every one is fine with LIBRARY_PATH. For some, it conflicts. */
...@@ -2442,7 +2434,7 @@ find_a_file (pprefix, name, mode, multilib) ...@@ -2442,7 +2434,7 @@ find_a_file (pprefix, name, mode, multilib)
/* Determine the filename to execute (special case for absolute paths). */ /* 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) if (access (name, mode) == 0)
{ {
...@@ -2626,7 +2618,7 @@ add_sysrooted_prefix (pprefix, prefix, component, priority, ...@@ -2626,7 +2618,7 @@ add_sysrooted_prefix (pprefix, prefix, component, priority,
int *warn; int *warn;
int os_multilib; int os_multilib;
{ {
if (!IS_ABSOLUTE_PATHNAME (prefix)) if (!IS_ABSOLUTE_PATH (prefix))
abort (); abort ();
if (target_system_root) if (target_system_root)
...@@ -3823,7 +3815,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n" ...@@ -3823,7 +3815,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
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_ABSOLUTE_PATHNAME (tooldir_prefix)) if (!IS_ABSOLUTE_PATH (tooldir_prefix))
{ {
if (gcc_exec_prefix) if (gcc_exec_prefix)
{ {
...@@ -4530,7 +4522,7 @@ do_spec_1 (spec, inswitch, soft_matched_part) ...@@ -4530,7 +4522,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_ABSOLUTE_PATHNAME (pl->prefix)) if (!IS_ABSOLUTE_PATH (pl->prefix))
continue; continue;
#endif #endif
/* Try subdirectory if there is one. */ /* Try subdirectory if there is one. */
...@@ -6205,7 +6197,7 @@ main (argc, argv) ...@@ -6205,7 +6197,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_ABSOLUTE_PATHNAME (standard_startfile_prefix)) if (IS_ABSOLUTE_PATH (standard_startfile_prefix))
add_sysrooted_prefix (&startfile_prefixes, add_sysrooted_prefix (&startfile_prefixes,
standard_startfile_prefix, "BINUTILS", standard_startfile_prefix, "BINUTILS",
PREFIX_PRIORITY_LAST, 0, NULL, 1); PREFIX_PRIORITY_LAST, 0, NULL, 1);
...@@ -7453,7 +7445,7 @@ if_exists_spec_function (argc, argv) ...@@ -7453,7 +7445,7 @@ if_exists_spec_function (argc, argv)
const char **argv; const char **argv;
{ {
/* Must have only one argument. */ /* 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 argv[0];
return NULL; return NULL;
...@@ -7473,7 +7465,7 @@ if_exists_else_spec_function (argc, argv) ...@@ -7473,7 +7465,7 @@ if_exists_else_spec_function (argc, argv)
if (argc != 2) if (argc != 2)
return NULL; 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[0];
return argv[1]; return argv[1];
......
...@@ -195,7 +195,7 @@ process_include (rtx desc, int lineno) ...@@ -195,7 +195,7 @@ process_include (rtx desc, int lineno)
FILE *input_file; FILE *input_file;
/* If specified file name is absolute, skip the include stack. */ /* 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; 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> 2003-07-02 Neil Booth <neil@daikokuya.co.uk>
* lang.c (java_init_options): Update prototype. * lang.c (java_init_options): Update prototype.
......
...@@ -34,15 +34,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ ...@@ -34,15 +34,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "jcf.h" #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 #ifndef DIR_UP
#define DIR_UP ".." #define DIR_UP ".."
#endif #endif
...@@ -147,15 +138,15 @@ add_entry (struct entry **entp, const char *filename, int is_system) ...@@ -147,15 +138,15 @@ add_entry (struct entry **entp, const char *filename, int is_system)
len = strlen (filename); len = strlen (filename);
if (len > 4 && (COMPARE_FILENAMES (filename + len - 4, ".zip") == 0 if (len > 4 && (FILENAME_CMP (filename + len - 4, ".zip") == 0
|| COMPARE_FILENAMES (filename + len - 4, ".jar") == 0)) || FILENAME_CMP (filename + len - 4, ".jar") == 0))
{ {
n->flags |= FLAG_ZIP; n->flags |= FLAG_ZIP;
/* If the user uses -classpath then he'll have to include /* If the user uses -classpath then he'll have to include
libgcj.jar in the value. We check for this in a simplistic libgcj.jar in the value. We check for this in a simplistic
way. Symlinks will fool this test. This is only used for way. Symlinks will fool this test. This is only used for
-MM and -MMD, so it probably isn't terribly important. */ -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; n->flags |= FLAG_SYSTEM;
} }
......
...@@ -40,10 +40,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ ...@@ -40,10 +40,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "ggc.h" #include "ggc.h"
#include "tm_p.h" #include "tm_p.h"
#ifndef DIR_SEPARATOR
#define DIR_SEPARATOR '/'
#endif
extern struct obstack temporary_obstack; extern struct obstack temporary_obstack;
/* Base directory in which `.class' files should be written. /* Base directory in which `.class' files should be written.
......
...@@ -54,15 +54,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ ...@@ -54,15 +54,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#define JCF_USE_SCANDIR 0 #define JCF_USE_SCANDIR 0
#endif #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 /* 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 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 opened is of the exact case we are asking for. In other words, we
......
...@@ -48,11 +48,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -48,11 +48,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#endif #endif
/* Macro to see if the paths match. */ /* Macro to see if the paths match. */
#ifdef HAVE_DOS_BASED_FILE_SYSTEM #define IS_SAME_PATH(a,b) (FILENAME_CMP (a, b) == 0)
#define IS_SAME_PATH(a,b) (strcasecmp (a, b) == 0)
#else
#define IS_SAME_PATH(a,b) (strcmp (a, b) == 0)
#endif
/* Suffix for aux-info files. */ /* Suffix for aux-info files. */
#ifdef __MSDOS__ #ifdef __MSDOS__
...@@ -94,7 +90,6 @@ static int directory_specified_p PARAMS ((const char *)); ...@@ -94,7 +90,6 @@ static int directory_specified_p PARAMS ((const char *));
static int file_excluded_p PARAMS ((const char *)); static int file_excluded_p PARAMS ((const char *));
static char *unexpand_if_needed PARAMS ((const char *)); static char *unexpand_if_needed PARAMS ((const char *));
static char *abspath PARAMS ((const char *, 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 void check_aux_info PARAMS ((int));
static const char *find_corresponding_lparen PARAMS ((const char *)); static const char *find_corresponding_lparen PARAMS ((const char *));
static int referenced_file_is_newer PARAMS ((const char *, time_t)); static int referenced_file_is_newer PARAMS ((const char *, time_t));
...@@ -694,7 +689,7 @@ in_system_include_dir (path) ...@@ -694,7 +689,7 @@ in_system_include_dir (path)
{ {
const struct default_include *p; const struct default_include *p;
if (! is_abspath (path)) if (! IS_ABSOLUTE_PATH (path))
abort (); /* Must be an absolutized filename. */ abort (); /* Must be an absolutized filename. */
for (p = cpp_include_defaults; p->fname; p++) for (p = cpp_include_defaults; p->fname; p++)
...@@ -1114,20 +1109,6 @@ continue_outer: ; ...@@ -1114,20 +1109,6 @@ continue_outer: ;
return (got_unexpanded ? savestring (line_buf, copy_p - line_buf) : 0); return (got_unexpanded ? savestring (line_buf, copy_p - line_buf) : 0);
} }
/* 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
);
}
/* Return the absolutized filename for the given relative /* Return the absolutized filename for the given relative
filename. Note that if that filename is already absolute, it may filename. Note that if that filename is already absolute, it may
still be returned in a modified form because this routine also still be returned in a modified form because this routine also
...@@ -1156,7 +1137,7 @@ abspath (cwd, rel_filename) ...@@ -1156,7 +1137,7 @@ abspath (cwd, rel_filename)
{ {
const char *src_p; const char *src_p;
if (! is_abspath (rel_filename)) if (! IS_ABSOLUTE_PATH (rel_filename))
{ {
src_p = cwd2; src_p = cwd2;
while ((*endp++ = *src_p++)) while ((*endp++ = *src_p++))
...@@ -2264,7 +2245,7 @@ start_over: ; ...@@ -2264,7 +2245,7 @@ start_over: ;
continue; continue;
aux_info_second_line = p; aux_info_second_line = p;
aux_info_relocated_name = 0; aux_info_relocated_name = 0;
if (! is_abspath (invocation_filename)) if (! IS_ABSOLUTE_PATH (invocation_filename))
{ {
/* INVOCATION_FILENAME is relative; /* INVOCATION_FILENAME is relative;
append it to BASE_SOURCE_FILENAME's dir. */ append it to BASE_SOURCE_FILENAME's dir. */
......
...@@ -458,29 +458,15 @@ extern void abort (void); ...@@ -458,29 +458,15 @@ extern void abort (void);
#define PATH_SEPARATOR ':' #define PATH_SEPARATOR ':'
#endif #endif
/* Filename handling macros. */
#include "filenames.h"
/* These should be phased out in favor of IS_DIR_SEPARATOR, where possible. */
#ifndef DIR_SEPARATOR #ifndef DIR_SEPARATOR
#define DIR_SEPARATOR '/' # define DIR_SEPARATOR '/'
#endif # ifdef HAVE_DOS_BASED_FILE_SYSTEM
# define DIR_SEPARATOR_2 '\\'
/* Define IS_DIR_SEPARATOR. */ # endif
#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] == '$')
#endif #endif
/* Get libiberty declarations. */ /* Get libiberty declarations. */
......
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