Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
2a85660d
Commit
2a85660d
authored
Mar 03, 2002
by
Per Bothner
Committed by
Per Bothner
Mar 03, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make --CLASSPATH by a synonym for --classpath and -classpath.
Implement --bootclasspath. From-SVN: r50247
parent
c26a6db8
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
101 additions
and
76 deletions
+101
-76
gcc/java/ChangeLog
+27
-0
gcc/java/gcj.texi
+14
-21
gcc/java/gjavah.c
+6
-5
gcc/java/jcf-dump.c
+6
-5
gcc/java/jcf-path.c
+28
-38
gcc/java/jcf.h
+1
-1
gcc/java/jvspec.c
+5
-3
gcc/java/lang-options.h
+4
-2
gcc/java/lang.c
+10
-1
No files found.
gcc/java/ChangeLog
View file @
2a85660d
2002-03-02 Per Bothner <per@bothner.com>
Make --CLASSPATH by a synonym for --classpath and -classpath.
Implement --bootclasspath.
* jcf-path.c (classpath_u): Rename static variable to classpath_user.
(classpath_l): Remove.
(jcf_path_CLASSPATH_arg): Remove.
(jcf_path_bootclasspath_arg): New function.
(jcf_path_seal): Simplify accordingly.
* jcf.h (jcf_path_bootclasspath_arg): New declarations.
(jcf_path_CLASSPATH): Remove declaration.
* jvspec.c (jvgenmain_spec): Also accept -fbootclasspath*.
(lang_specific_driver): Translate -bootclasspath.
* lang-options.h: Add --bootclasspath. Update --CLASSPATH.
* lang.c (decode_lang_options): Do jcf_path_init first.
Handle -fCLASSPATH same as -fclasspath. Also process -fbootclasspath.
* gjavah.c: Also handle --bootclasspath.
Handle --CLASSPATH as a synonum for --classpath.
* jcf-dump.c: Likewise.
"." is not part of system path, but is the default for --classpath.
* jcf-path.c (jcf_path_init): Don't add "." to sys_dirs.
(jcf_path_seal): Add "." if no CLASSPATH specified.
* gcj.texi: Document changes.
2002-03-01 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
* expr.c (build_java_arraystore_check): Fix formatting.
...
...
gcc/java/gcj.texi
View file @
2a85660d
...
...
@@ -240,16 +240,16 @@ compatibility with tools like @code{javac} is imported, we recommend
always
using
@
code
{-
I
}
instead
of
the
other
options
for
manipulating
the
class
path
.
@
item
--
CLASSPATH
=@
var
{
path
}
This
sets
the
class
path
to
@
var
{
path
},
a
colon
-
separated
list
of
paths
(
on
Windows
-
based
systems
,
a
semicolon
-
separate
list
of
paths
).
Using
this
option
causes
the
built
in
path
to
be
suppressed
.
@
item
--
classpath
=@
var
{
path
}
This
sets
the
class
path
to
@
var
{
path
},
a
colon
-
separated
list
of
paths
(
on
Windows
-
based
systems
,
a
semicolon
-
separate
list
of
paths
).
This
differs
from
the
@
code
{--
classpath
}
option
in
that
it
does
not
suppress
the
built
-
in
system
path
.
(
on
Windows
-
based
systems
,
a
semicolon
-
separate
list
of
paths
).
This
does
not
override
the
builtin
(``
boot
''
)
search
path
.
@
item
--
CLASSPATH
=@
var
{
path
}
Deprecated
synonym
for
@
code
{--
classpath
}.
@
item
--
bootclasspath
=@
var
{
path
}
Where
to
find
the
standard
builtin
classes
,
such
as
@
code
{
java
.
lang
.
String
}.
@
item
CLASSPATH
This
is
an
environment
variable
which
holds
a
list
of
paths
.
...
...
@@ -262,21 +262,14 @@ The final class path is constructed like so:
First
come
all
directories
specified
via
@
code
{-
I
}.
@
item
If
@
option
{--
CLASSPATH
}
is
specified
,
its
value
is
appended
and
processing
stops
.
That
is
,
@
option
{--
CLASSPATH
}
suppresses
all
the
options
mentioned
later
in
this
list
.
@
item
If
@
option
{--
classpath
}
is
specified
,
its
value
is
appended
and
the
@
code
{
CLASSPATH
}
environment
variable
is
suppressed
.
@
item
If
the
@
code
{
CLASSPATH
}
environment
variable
is
specified
(
and
was
not
suppressed
by
@
option
{--
classpath
}
or
@
option
{--
CLASSPATH
}),
then
its
value
is
appended
.
If
@
option
{--
classpath
}
is
specified
,
its
value
is
appended
.
Otherwise
,
if
the
@
code
{
CLASSPATH
}
environment
variable
is
specified
,
then
its
value
is
appended
.
Otherwise
,
the
current
directory
(@
code
{
"."
})
is
appended
.
@
item
Finally
,
the
built
-
in
system
directory
,
@
file
{
libgcj
.
jar
},
is
appended
.
Finally
,
if
@
code
{--
bootclasspath
}
was
specified
,
append
its
value
.
Otherwise
,
append
the
built
-
in
system
directory
,
@
file
{
libgcj
.
jar
}.
@
end
itemize
The
classfile
built
by
@
code
{
gcj
}
for
the
class
@
code
{
java
.
lang
.
Object
}
...
...
gcc/java/gjavah.c
View file @
2a85660d
...
...
@@ -2102,7 +2102,8 @@ DEFUN(process_file, (jcf, out),
#define LONG_OPT(Num) ((Num) + 128)
#define OPT_classpath LONG_OPT (0)
#define OPT_CLASSPATH LONG_OPT (1)
#define OPT_CLASSPATH OPT_classpath
#define OPT_bootclasspath LONG_OPT (1)
#define OPT_HELP LONG_OPT (2)
#define OPT_TEMP LONG_OPT (3)
#define OPT_VERSION LONG_OPT (4)
...
...
@@ -2119,6 +2120,7 @@ DEFUN(process_file, (jcf, out),
static
const
struct
option
options
[]
=
{
{
"classpath"
,
required_argument
,
NULL
,
OPT_classpath
},
{
"bootclasspath"
,
required_argument
,
NULL
,
OPT_bootclasspath
},
{
"CLASSPATH"
,
required_argument
,
NULL
,
OPT_CLASSPATH
},
{
"help"
,
no_argument
,
NULL
,
OPT_HELP
},
{
"stubs"
,
no_argument
,
&
stubs
,
1
},
...
...
@@ -2158,10 +2160,9 @@ help ()
printf
(
" -friend TEXT Insert TEXT as `friend' declaration
\n
"
);
printf
(
" -prepend TEXT Insert TEXT before start of class
\n
"
);
printf
(
"
\n
"
);
printf
(
" --CLASSPATH PATH Set path to find .class files, overriding
\n
\
built-in class path
\n
"
);
printf
(
" --classpath PATH Set path to find .class files
\n
"
);
printf
(
" -IDIR Append directory to class path
\n
"
);
printf
(
" --bootclasspath PATH Override built-in class path
\n
"
);
printf
(
" -d DIRECTORY Set output directory name
\n
"
);
printf
(
" -o FILE Set output file name
\n
"
);
printf
(
" -td DIRECTORY Set temporary directory name
\n
"
);
...
...
@@ -2241,8 +2242,8 @@ DEFUN(main, (argc, argv),
jcf_path_classpath_arg
(
optarg
);
break
;
case
OPT_
CLASSPATH
:
jcf_path_
CLASSPATH
_arg
(
optarg
);
case
OPT_
bootclasspath
:
jcf_path_
bootclasspath
_arg
(
optarg
);
break
;
case
OPT_HELP
:
...
...
gcc/java/jcf-dump.c
View file @
2a85660d
...
...
@@ -774,7 +774,8 @@ DEFUN(process_class, (jcf),
#define LONG_OPT(Num) ((Num) + 128)
#define OPT_classpath LONG_OPT (0)
#define OPT_CLASSPATH LONG_OPT (1)
#define OPT_CLASSPATH OPT_classpath
#define OPT_bootclasspath LONG_OPT (1)
#define OPT_HELP LONG_OPT (2)
#define OPT_VERSION LONG_OPT (3)
#define OPT_JAVAP LONG_OPT (4)
...
...
@@ -782,6 +783,7 @@ DEFUN(process_class, (jcf),
static
const
struct
option
options
[]
=
{
{
"classpath"
,
required_argument
,
NULL
,
OPT_classpath
},
{
"bootclasspath"
,
required_argument
,
NULL
,
OPT_bootclasspath
},
{
"CLASSPATH"
,
required_argument
,
NULL
,
OPT_CLASSPATH
},
{
"help"
,
no_argument
,
NULL
,
OPT_HELP
},
{
"verbose"
,
no_argument
,
NULL
,
'v'
},
...
...
@@ -806,10 +808,9 @@ help ()
printf
(
" -c Disassemble method bodies
\n
"
);
printf
(
" --javap Generate output in `javap' format
\n
"
);
printf
(
"
\n
"
);
printf
(
" --CLASSPATH PATH Set path to find .class files, overriding
\n
\
built-in class path
\n
"
);
printf
(
" --classpath PATH Set path to find .class files
\n
"
);
printf
(
" -IDIR Append directory to class path
\n
"
);
printf
(
" --bootclasspath PATH Override built-in class path
\n
"
);
printf
(
" -o FILE Set output file name
\n
"
);
printf
(
"
\n
"
);
printf
(
" --help Print this help, then exit
\n
"
);
...
...
@@ -876,8 +877,8 @@ DEFUN(main, (argc, argv),
jcf_path_classpath_arg
(
optarg
);
break
;
case
OPT_
CLASSPATH
:
jcf_path_
CLASSPATH
_arg
(
optarg
);
case
OPT_
bootclasspath
:
jcf_path_
bootclasspath
_arg
(
optarg
);
break
;
case
OPT_HELP
:
...
...
gcc/java/jcf-path.c
View file @
2a85660d
/* Handle CLASSPATH, -classpath, and path searching.
Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
Copyright (C) 1998, 1999, 2000, 2001
, 2002
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -72,7 +72,8 @@ static void add_path PARAMS ((struct entry **, const char *, int));
built-in system directory (only libgcj.jar)
CLASSPATH environment variable
-classpath option overrides $CLASSPATH
-CLASSPATH option overrides $CLASSPATH, -classpath, and built-in
-CLASSPATH option is a synonym for -classpath (for compatibility)
-bootclasspath overrides built-in
-I prepends path to list
We implement this by keeping several path lists, and then simply
...
...
@@ -85,10 +86,7 @@ static struct entry *include_dirs;
static
struct
entry
*
classpath_env
;
/* This holds the -classpath command-line option. */
static
struct
entry
*
classpath_u
;
/* This holds the -CLASSPATH command-line option. */
static
struct
entry
*
classpath_l
;
static
struct
entry
*
classpath_user
;
/* This holds the default directories. Some of these will have the
"system" flag set. */
...
...
@@ -222,6 +220,8 @@ add_path (entp, cp, is_system)
}
}
static
int
init_done
=
0
;
/* Initialize the path module. */
void
jcf_path_init
()
...
...
@@ -231,7 +231,9 @@ jcf_path_init ()
struct
stat
stat_b
;
int
found
=
0
,
len
;
add_entry
(
&
sys_dirs
,
"."
,
0
);
if
(
init_done
)
return
;
init_done
=
1
;
sep
[
0
]
=
DIR_SEPARATOR
;
sep
[
1
]
=
'\0'
;
...
...
@@ -284,27 +286,25 @@ jcf_path_init ()
add_path
(
&
classpath_env
,
cp
,
0
);
}
/* Call this when -CLASSPATH is seen on the command line.
This is the override-all switch, even the built in classes
are overridden.
/* Call this when -classpath is seen on the command line.
This overrides only the $CLASSPATH environment variable.
*/
void
jcf_path_
CLASSPATH
_arg
(
path
)
jcf_path_
classpath
_arg
(
path
)
const
char
*
path
;
{
free_entry
(
&
classpath_
l
);
add_path
(
&
classpath_
l
,
path
,
0
);
free_entry
(
&
classpath_
user
);
add_path
(
&
classpath_
user
,
path
,
0
);
}
/* Call this when -classpath is seen on the command line.
This overrides only the $CLASSPATH environment variable.
/* Call this when -bootclasspath is seen on the command line.
*/
void
jcf_path_classpath_arg
(
path
)
jcf_path_
boot
classpath_arg
(
path
)
const
char
*
path
;
{
free_entry
(
&
classpath_u
);
add_path
(
&
classpath_u
,
path
,
0
);
free_entry
(
&
sys_dirs
);
add_path
(
&
sys_dirs
,
path
,
1
);
}
/* Call this when -I is seen on the command line. */
...
...
@@ -322,42 +322,32 @@ void
jcf_path_seal
(
print
)
int
print
;
{
int
do_system
=
1
;
struct
entry
*
secondary
;
sealed
=
include_dirs
;
include_dirs
=
NULL
;
if
(
classpath_
l
)
if
(
classpath_
user
)
{
secondary
=
classpath_l
;
classpath_l
=
NULL
;
do_system
=
0
;
}
else
if
(
classpath_u
)
{
secondary
=
classpath_u
;
classpath_u
=
NULL
;
secondary
=
classpath_user
;
classpath_user
=
NULL
;
}
else
{
if
(
!
classpath_env
)
add_entry
(
&
classpath_env
,
"."
,
0
);
secondary
=
classpath_env
;
classpath_env
=
NULL
;
}
free_entry
(
&
classpath_l
);
free_entry
(
&
classpath_u
);
free_entry
(
&
classpath_u
ser
);
free_entry
(
&
classpath_env
);
append_entry
(
&
sealed
,
secondary
);
if
(
do_system
)
{
append_entry
(
&
sealed
,
sys_dirs
);
sys_dirs
=
NULL
;
}
else
free_entry
(
&
sys_dirs
);
append_entry
(
&
sealed
,
sys_dirs
);
sys_dirs
=
NULL
;
if
(
print
)
{
...
...
gcc/java/jcf.h
View file @
2a85660d
...
...
@@ -271,8 +271,8 @@ extern void jcf_dependency_print_dummies PARAMS ((void));
/* Declarations for path handling code. */
extern
void
jcf_path_init
PARAMS
((
void
));
extern
void
jcf_path_CLASSPATH_arg
PARAMS
((
const
char
*
));
extern
void
jcf_path_classpath_arg
PARAMS
((
const
char
*
));
extern
void
jcf_path_bootclasspath_arg
PARAMS
((
const
char
*
));
extern
void
jcf_path_include_arg
PARAMS
((
const
char
*
));
extern
void
jcf_path_seal
PARAMS
((
int
));
extern
void
*
jcf_path_start
PARAMS
((
void
));
...
...
gcc/java/jvspec.c
View file @
2a85660d
/* Specific flags and argument handling of the front-end of the
GNU compiler for the Java(TM) language.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
, 2002
Free Software Foundation, Inc.
This file is part of GNU CC.
...
...
@@ -66,8 +66,8 @@ static const char jvgenmain_spec[] =
%{<femit-class-file} %{<femit-class-files} %{<fencoding*}\
%{<fuse-boehm-gc} %{<fhash-synchronization} %{<fjni}\
%{<findirect-dispatch} \
%{<fno-store-check}\
%{<fclasspath*} %{<fCLASSPATH*} %{<f
output-class-dir
}\
%{<fno-store-check}
%{<foutput-class-dir}
\
%{<fclasspath*} %{<fCLASSPATH*} %{<f
bootclasspath*
}\
%{<fuse-divide-subroutine} %{<fno-use-divide-subroutine}\
%{<fcheck-references} %{<fno-check-references}\
%{<ffilelist-file}\
...
...
@@ -329,6 +329,7 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
quote
=
argv
[
i
];
}
else
if
(
strcmp
(
argv
[
i
],
"-classpath"
)
==
0
||
strcmp
(
argv
[
i
],
"-bootclasspath"
)
==
0
||
strcmp
(
argv
[
i
],
"-CLASSPATH"
)
==
0
)
{
quote
=
argv
[
i
];
...
...
@@ -522,6 +523,7 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
}
if
(
strcmp
(
argv
[
i
],
"-classpath"
)
==
0
||
strcmp
(
argv
[
i
],
"-bootclasspath"
)
==
0
||
strcmp
(
argv
[
i
],
"-CLASSPATH"
)
==
0
)
{
arglist
[
j
]
=
concat
(
"-f"
,
argv
[
i
]
+
1
,
"="
,
argv
[
i
+
1
],
NULL
);
...
...
gcc/java/lang-options.h
View file @
2a85660d
...
...
@@ -34,10 +34,12 @@ DEFINE_LANG_NAME ("Java")
N_
(
"Disable assignability checks for stores into object arrays"
)
},
{
"-fjni"
,
N_
(
"Assume native functions are implemented using JNI"
)
},
{
"--
CLASSPATH
"
,
N_
(
"
Set class path and suppress
system path"
)
},
{
"--
bootclasspath
"
,
N_
(
"
Replace
system path"
)
},
{
"--classpath"
,
N_
(
"Set class path"
)
},
{
"--CLASSPATH"
,
N_
(
"Set class path (deprecated: use --classpath instead)"
)
},
{
"--main"
,
N_
(
"Choose class whose main method should be used"
)
},
{
"--encoding"
,
...
...
gcc/java/lang.c
View file @
2a85660d
...
...
@@ -263,6 +263,8 @@ java_decode_option (argc, argv)
{
char
*
p
=
argv
[
0
];
jcf_path_init
();
if
(
strcmp
(
p
,
"-version"
)
==
0
)
{
version_flag
=
1
;
...
...
@@ -308,7 +310,7 @@ java_decode_option (argc, argv)
#define CLARG "-fCLASSPATH="
if
(
strncmp
(
p
,
CLARG
,
sizeof
(
CLARG
)
-
1
)
==
0
)
{
jcf_path_
CLASSPATH
_arg
(
p
+
sizeof
(
CLARG
)
-
1
);
jcf_path_
classpath
_arg
(
p
+
sizeof
(
CLARG
)
-
1
);
return
1
;
}
#undef CLARG
...
...
@@ -319,6 +321,13 @@ java_decode_option (argc, argv)
return
1
;
}
#undef CLARG
#define CLARG "-fbootclasspath="
if
(
strncmp
(
p
,
CLARG
,
sizeof
(
CLARG
)
-
1
)
==
0
)
{
jcf_path_bootclasspath_arg
(
p
+
sizeof
(
CLARG
)
-
1
);
return
1
;
}
#undef CLARG
else
if
(
strncmp
(
p
,
"-I"
,
2
)
==
0
)
{
jcf_path_include_arg
(
p
+
2
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment