Patch: FYI: support --libdir install

Tom Tromey tromey@redhat.com
Wed Mar 26 22:22:00 GMT 2003


I'm checking this in on the trunk.

If you configure with a --libdir that points to some random place,
libgcj won't find the .security files properly.  I had reason to do
this recently.  The appended patch fixes the problem.  If you don't
specify --libdir, you'll still get the correct results with the
appended.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* java/lang/natRuntime.cc (insertSystemProperties): Set
	gnu.classpath.home.url.
	* Makefile.in: Rebuilt.
	* Makefile.am: Define LIBDIR.

Index: Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libjava/Makefile.am,v
retrieving revision 1.288
diff -u -r1.288 Makefile.am
--- Makefile.am 17 Mar 2003 09:18:17 -0000 1.288
+++ Makefile.am 26 Mar 2003 21:11:28 -0000
@@ -97,7 +97,7 @@
 ## Detect bugs in the verifier implementation, and maybe other places.
 	-Wswitch-enum \
 	@LIBGCJ_CXXFLAGS@ @X_CFLAGS@ $(WARNINGS) -D_GNU_SOURCE \
-	-DPREFIX="\"$(prefix)\""
+	-DPREFIX="\"$(prefix)\"" -DLIBDIR="\"$(libdir)\""
 if USING_GCC
 AM_CFLAGS = @LIBGCJ_CFLAGS@ $(WARNINGS)
 else
Index: java/lang/natRuntime.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/natRuntime.cc,v
retrieving revision 1.35
diff -u -r1.35 natRuntime.cc
--- java/lang/natRuntime.cc 17 Mar 2003 00:45:37 -0000 1.35
+++ java/lang/natRuntime.cc 26 Mar 2003 21:11:31 -0000
@@ -422,6 +422,12 @@
   // redefine `java.home' with `-D' if necessary.
   SET ("java.home", PREFIX);
   SET ("gnu.classpath.home", PREFIX);
+  // This is set to $(libdir) because we use this to find .security
+  // files at runtime.
+  char val2[sizeof ("file://") + sizeof (LIBDIR) + 1];
+  strcpy (val2, "file://");
+  strcat (val2, LIBDIR);
+  SET ("gnu.classpath.home.url", val2);
 
   SET ("file.encoding", default_file_encoding);
 



More information about the Java-patches mailing list