changeset 3680:b2cf8f60a558

. Make BSD changes equivalent to the Linux specific changes.
author Greg Lewis <glewis@eyesbeyond.com>
date Thu, 03 Mar 2011 18:39:52 -0800
parents e8cb66d0416e
children 72291b68ff38
files make/common/Defs-bsd.gmk make/common/shared/Defs-bsd.gmk make/sun/awt/mapfile-vers-bsd src/solaris/classes/sun/nio/fs/BsdFileSystem.java src/solaris/classes/sun/nio/fs/BsdFileSystemProvider.java
diffstat 5 files changed, 66 insertions(+), 39 deletions(-) [+]
line wrap: on
line diff
--- a/make/common/Defs-bsd.gmk	Sun Feb 20 12:46:58 2011 -0800
+++ b/make/common/Defs-bsd.gmk	Thu Mar 03 18:39:52 2011 -0800
@@ -75,15 +75,6 @@
 CC_PROGRAM_OUTPUT_FLAG = -o #trailing blank required!
 
 #
-# Default HPI libraries. Build will build only native, unless
-# overriden at the make command line. This makes it convenient for
-# people doing, say, a pthreads port -- they can create a posix
-# directory here, and say "gnumake HPIS=posix" at the top
-# level.
-#
-HPIS = native
-
-#
 # Default optimization
 #
 
@@ -306,7 +297,7 @@
 # the library itself should not.
 #
 VM_NAME         = server
-JVMLIB          = -L$(LIBDIR)/$(LIBARCH)/$(VM_NAME) -ljvm
+JVMLIB          = -Xlinker -rpath -Xlinker $(LIBDIR)/$(LIBARCH)/$(VM_NAME) -L$(LIBDIR)/$(LIBARCH)/$(VM_NAME) -ljvm
 JAVALIB         = -ljava $(JVMLIB)
 
 #
--- a/make/common/shared/Defs-bsd.gmk	Sun Feb 20 12:46:58 2011 -0800
+++ b/make/common/shared/Defs-bsd.gmk	Thu Mar 03 18:39:52 2011 -0800
@@ -173,3 +173,20 @@
 endif
 HOTSPOT_SERVER_PATH:=$(call AltCheckValue,HOTSPOT_SERVER_PATH)
 
+# Special define for checking the binaries
+
+# Macro to check it's input file for banned dependencies and verify the
+#   binary built properly. Relies on process exit code.
+define binary_file_verification # binary_file
+( \
+  $(ECHO) "Checking for mapfile use in: $1" && \
+  if [ "`$(NM) -D -g --defined-only $1 | $(EGREP) 'SUNWprivate'`" = "" ] ; then \
+    $(ECHO) "WARNING: File was not built with a mapfile: $1"; \
+  fi && \
+  $(ECHO) "Library loads for: $1" && \
+  $(LDD) $1 && \
+  $(ECHO) "RUNPATH for: $1" && \
+  ( $(READELF) -d $1 | $(EGREP) 'NEEDED|RUNPATH|RPATH' ) \
+)
+endef
+
--- a/make/sun/awt/mapfile-vers-bsd	Sun Feb 20 12:46:58 2011 -0800
+++ b/make/sun/awt/mapfile-vers-bsd	Thu Mar 03 18:39:52 2011 -0800
@@ -535,11 +535,10 @@
 
 		X11SurfaceData_GetOps;
 		getDefaultConfig;
-                Java_sun_font_FontManager_getFontConfig;
-                Java_sun_font_FontManager_getFontConfigAASettings;
-		Java_sun_font_FontManager_getFontPath;
-		Java_sun_font_FontManager_setNativeFontPath;
-		Java_sun_font_FontManager_populateFontFileNameMap;
+                Java_sun_font_FontConfigManager_getFontConfig;
+                Java_sun_font_FontConfigManager_getFontConfigAASettings;
+		Java_sun_awt_X11FontManager_getFontPathNative;
+		Java_sun_font_SunFontManager_populateFontFileNameMap;
 
 		# CDE private entry point
 		Java_sun_awt_motif_XsessionWMcommand;
--- a/src/solaris/classes/sun/nio/fs/BsdFileSystem.java	Sun Feb 20 12:46:58 2011 -0800
+++ b/src/solaris/classes/sun/nio/fs/BsdFileSystem.java	Thu Mar 03 18:39:52 2011 -0800
@@ -26,7 +26,6 @@
 package sun.nio.fs;
 
 import java.nio.file.*;
-import java.nio.file.attribute.*;
 import java.io.IOException;
 import java.util.*;
 import java.security.AccessController;
@@ -50,31 +49,13 @@
         return new PollingWatchService();
     }
 
-    @Override
-    @SuppressWarnings("unchecked")
-    public <V extends FileAttributeView> V newFileAttributeView(Class<V> view,
-                                                                UnixPath file,
-                                                                LinkOption... options)
-    {
-        return super.newFileAttributeView(view, file, options);
-    }
-
-    @Override
-    @SuppressWarnings("unchecked")
-    public DynamicFileAttributeView newFileAttributeView(String name,
-                                                         UnixPath file,
-                                                         LinkOption... options)
-    {
-        return super.newFileAttributeView(name, file, options);
-    }
-
     // lazy initialization of the list of supported attribute views
     private static class SupportedFileFileAttributeViewsHolder {
         static final Set<String> supportedFileAttributeViews =
             supportedFileAttributeViews();
         private static Set<String> supportedFileAttributeViews() {
             Set<String> result = new HashSet<String>();
-            result.addAll(UnixFileSystem.standardFileAttributeViews());
+            result.addAll(standardFileAttributeViews());
             return Collections.unmodifiableSet(result);
         }
     }
@@ -114,10 +95,7 @@
         return entries;
     }
 
-    @Override
-    FileStore getFileStore(UnixPath path) throws IOException {
-        return new BsdFileStore(path);
-    }
+
 
     @Override
     FileStore getFileStore(UnixMountEntry entry) throws IOException {
--- a/src/solaris/classes/sun/nio/fs/BsdFileSystemProvider.java	Sun Feb 20 12:46:58 2011 -0800
+++ b/src/solaris/classes/sun/nio/fs/BsdFileSystemProvider.java	Thu Mar 03 18:39:52 2011 -0800
@@ -25,6 +25,10 @@
 
 package sun.nio.fs;
 
+import java.nio.file.*;
+import java.nio.file.attribute.*;
+import java.io.IOException;
+
 /**
  * Bsd implementation of FileSystemProvider
  */
@@ -38,4 +42,42 @@
     BsdFileSystem newFileSystem(String dir) {
         return new BsdFileSystem(this, dir);
     }
+
+    @Override
+    BsdFileStore getFileStore(UnixPath path) throws IOException {
+        return new BsdFileStore(path);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public <V extends FileAttributeView> V getFileAttributeView(Path obj,
+                                                                Class<V> type,
+                                                                LinkOption... options)
+    {
+        return super.getFileAttributeView(obj, type, options);
+    }
+
+    @Override
+    public DynamicFileAttributeView getFileAttributeView(Path obj,
+                                                         String name,
+                                                         LinkOption... options)
+    {
+        return super.getFileAttributeView(obj, name, options);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public <A extends BasicFileAttributes> A readAttributes(Path file,
+                                                            Class<A> type,
+                                                            LinkOption... options)
+        throws IOException
+    {
+        if (type == DosFileAttributes.class) {
+            DosFileAttributeView view =
+                getFileAttributeView(file, DosFileAttributeView.class, options);
+            return (A) view.readAttributes();
+        } else {
+            return super.readAttributes(file, type, options);
+        }
+    }
 }