This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Change libjava include directory (patch 4/4 for PR 7305)
- From: Richard Sandiford <rsandifo at redhat dot com>
- To: java-patches at gcc dot gnu dot org
- Date: Thu, 25 Nov 2004 20:58:31 +0000
- Subject: Change libjava include directory (patch 4/4 for PR 7305)
- References: <87is7tejx4.fsf@redhat.com>
Following up from: http://gcc.gnu.org/ml/gcc-patches/2004-11/msg02185.html
this patch changes where libjava installs its header files. Excluding
gcj/libgcj-config.h, which is already installed the tool-specific
include directory, there are three groups to worry about:
java/... }
javax/... } installed by libjava/Makefile
gnu/... }
gcj/... } installed by libjava/gcj/Makefile
jni.h } installed by libjava/include/Makefile
jvmpi.h }
Of these:
- jni.h is supposed to be C-compatible, so I think it and jvmpi.h should go
into the tool-specific include directory, just like gcj/libgcj-config.h.
- java/ javax/ and gnu/ are obviously C++-only and, as discussed, can go
in libstdc++'s include directory.
- As far as I can tell, the other gcj/* files are C++-only too. I notice
that part of gcj/field.h is conditional on __cplusplus, but since the
same file unconditionally includes stuff from the java/ hierarchy, I
can't see how it could be usable from C.
So in summary:
java/ }
javax/ } go into the libstdc++ include directory
gnu/ }
gcj/ }
jni.h } go into the tool-specific include directory
jvmpi.h }
The next question is: are the libstdc++ files target-dependent or not?
If they're target-independent, they should go into $gxx_include_dir,
otherwise they should go into $gxx_include_dir/$host_alias.
Tom seemed to think that the files were target-independent, so this
patch uses plain $gxx_include_dir.
Patch bootstrapped & regression tested on i686-pc-linux-gnu in
combination with the earlier patches. I also checked the same
things as before, and that the installed g++ can still find the
CNI files. OK to install?
Richard
libjava/
PR libgcj/7305
* configure.ac: Use TL_AC_GXX_INCLUDE_DIR.
* Makefile.am (install-data-local): Install headers into
$(gxx_include_dir) rather than $(includedir).
(AM_MAKEFLAGS): Pass down gxx_include_dir.
* gcj/Makefile.am (gcjdir): Set to $(gxx_include_dir)/gcj.
* include/Makefile.am (tool_include__HEADERS): Define this...
(include_HEADERS): ...instead of this.
* configure, aclocal.m4, Makefile.in, gcj/Makefile.in: Regenerate.
* include/Makefile.in, testsuite/Makefile.in: Regenerate.
Index: libjava/configure.ac
===================================================================
RCS file: /cvs/gcc/gcc/libjava/configure.ac,v
retrieving revision 1.14
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.14 configure.ac
--- libjava/configure.ac 25 Nov 2004 03:46:56 -0000 1.14
+++ libjava/configure.ac 25 Nov 2004 17:09:36 -0000
@@ -1204,6 +1202,8 @@ GCJVERSION=$gcjversion
AC_SUBST(GCJVERSION)
AC_DEFINE_UNQUOTED(GCJVERSION, "$GCJVERSION", [Short GCJ version ID])
+TL_AC_GXX_INCLUDE_DIR
+
# We check for sys/filio.h because Solaris 2.5 defines FIONREAD there.
# On that system, sys/ioctl.h will not include sys/filio.h unless
# BSD_COMP is defined; just including sys/filio.h is simpler.
Index: libjava/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libjava/Makefile.am,v
retrieving revision 1.432
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.432 Makefile.am
--- libjava/Makefile.am 25 Nov 2004 12:54:36 -0000 1.432
+++ libjava/Makefile.am 25 Nov 2004 17:09:37 -0000
@@ -786,10 +786,10 @@ install-data-local:
@: $(call write_entries_to_file,$(nat_headers_install) $(extra_headers),tmp-ilist)
@cat tmp-ilist | while read f; do \
d="`echo $$f | sed -e 's,/[^/]*$$,,'`"; \
- $(mkinstalldirs) $(DESTDIR)$(includedir)/$$d; \
+ $(mkinstalldirs) $(DESTDIR)$(gxx_include_dir)/$$d; \
if test -f $(srcdir)/$$f; then p=$(srcdir)/$$f; else p=$$f; fi; \
- echo " $(INSTALL_DATA) $$p $(DESTDIR)$(includedir)/$$f"; \
- $(INSTALL_DATA) $$p $(DESTDIR)$(includedir)/$$f; \
+ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(gxx_include_dir)/$$f"; \
+ $(INSTALL_DATA) $$p $(DESTDIR)$(gxx_include_dir)/$$f; \
done
-@rm -f tmp-ilist
## FIXME: the obvious approach using lib_DATA doesn't work with
@@ -801,16 +801,16 @@ install-data-local:
done
$(INSTALL_DATA) $(srcdir)/java/util/logging/logging.properties $(DESTDIR)$(propdir)/logging.properties
## Install inner class headers.
- $(INSTALL_DATA) 'java/io/ObjectOutputStream$$PutField.h' $(DESTDIR)$(includedir)/java/io/
- $(INSTALL_DATA) 'java/io/ObjectInputStream$$GetField.h' $(DESTDIR)$(includedir)/java/io/
- $(INSTALL_DATA) 'java/nio/channels/Pipe$$SinkChannel.h' $(DESTDIR)$(includedir)/java/nio/channels/
- $(INSTALL_DATA) 'java/nio/channels/Pipe$$SourceChannel.h' $(DESTDIR)$(includedir)/java/nio/channels/
- $(INSTALL_DATA) 'java/lang/reflect/Proxy$$ProxyData.h' $(DESTDIR)$(includedir)/java/lang/reflect/
- $(INSTALL_DATA) 'java/lang/reflect/Proxy$$ProxyType.h' $(DESTDIR)$(includedir)/java/lang/reflect/
- $(INSTALL_DATA) 'gnu/java/net/PlainSocketImpl$$SocketInputStream.h' $(DESTDIR)$(includedir)/gnu/java/net/
- $(INSTALL_DATA) 'gnu/java/net/PlainSocketImpl$$SocketOutputStream.h' $(DESTDIR)$(includedir)/gnu/java/net/
- $(INSTALL_DATA) 'gnu/java/nio/PipeImpl$$SinkChannelImpl.h' $(DESTDIR)$(includedir)/gnu/java/nio/
- $(INSTALL_DATA) 'gnu/java/nio/PipeImpl$$SourceChannelImpl.h' $(DESTDIR)$(includedir)/gnu/java/nio/
+ $(INSTALL_DATA) 'java/io/ObjectOutputStream$$PutField.h' $(DESTDIR)$(gxx_include_dir)/java/io/
+ $(INSTALL_DATA) 'java/io/ObjectInputStream$$GetField.h' $(DESTDIR)$(gxx_include_dir)/java/io/
+ $(INSTALL_DATA) 'java/nio/channels/Pipe$$SinkChannel.h' $(DESTDIR)$(gxx_include_dir)/java/nio/channels/
+ $(INSTALL_DATA) 'java/nio/channels/Pipe$$SourceChannel.h' $(DESTDIR)$(gxx_include_dir)/java/nio/channels/
+ $(INSTALL_DATA) 'java/lang/reflect/Proxy$$ProxyData.h' $(DESTDIR)$(gxx_include_dir)/java/lang/reflect/
+ $(INSTALL_DATA) 'java/lang/reflect/Proxy$$ProxyType.h' $(DESTDIR)$(gxx_include_dir)/java/lang/reflect/
+ $(INSTALL_DATA) 'gnu/java/net/PlainSocketImpl$$SocketInputStream.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/net/
+ $(INSTALL_DATA) 'gnu/java/net/PlainSocketImpl$$SocketOutputStream.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/net/
+ $(INSTALL_DATA) 'gnu/java/nio/PipeImpl$$SinkChannelImpl.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/nio/
+ $(INSTALL_DATA) 'gnu/java/nio/PipeImpl$$SourceChannelImpl.h' $(DESTDIR)$(gxx_include_dir)/gnu/java/nio/
## Don't install java/nio/DirectByteBufferImpl$$ReadWrite.h here. It's for internal use only.
@@ -3493,6 +3493,7 @@ AM_MAKEFLAGS = \
"infodir=$(infodir)" \
"libdir=$(libdir)" \
"prefix=$(prefix)" \
+ "gxx_include_dir=$(gxx_include_dir)" \
"AR=$(AR)" \
"AS=$(AS)" \
"LD=$(LD)" \
Index: libjava/gcj/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gcj/Makefile.am,v
retrieving revision 1.5
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.5 Makefile.am
--- libjava/gcj/Makefile.am 16 Jul 2004 05:36:35 -0000 1.5
+++ libjava/gcj/Makefile.am 25 Nov 2004 17:09:37 -0000
@@ -5,7 +5,7 @@ AUTOMAKE_OPTIONS = foreign
# autoconf2.13's target_alias
target_noncanonical = @target_noncanonical@
-gcjdir = $(includedir)/gcj
+gcjdir = $(gxx_include_dir)/gcj
gcj_HEADERS = array.h cni.h field.h javaprims.h method.h
toolgcjdir = @tool_include_dir@/gcj
Index: libjava/include/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libjava/include/Makefile.am,v
retrieving revision 1.5
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.5 Makefile.am
--- libjava/include/Makefile.am 16 Jul 2004 05:36:35 -0000 1.5
+++ libjava/include/Makefile.am 25 Nov 2004 17:09:37 -0000
@@ -5,4 +5,4 @@ AUTOMAKE_OPTIONS = foreign
# autoconf2.13's target_alias
target_noncanonical = @target_noncanonical@
-include_HEADERS = jni.h jvmpi.h
+tool_include__HEADERS = jni.h jvmpi.h