6960394: Stop linking with -lnsl on Linux
authormartin
Thu, 10 Jun 2010 15:54:25 -0700
changeset 5780 3f7be5f312ae
parent 5779 cee4951cdec7
child 5781 11a42d91eb56
6960394: Stop linking with -lnsl on Linux Summary: Define LIBNSL (like LIBSOCKET), non-empty only on Solaris Reviewed-by: ohair
jdk/make/common/Defs-linux.gmk
jdk/make/common/Defs-solaris.gmk
jdk/make/java/hpi/hpi_common.gmk
jdk/make/java/java/Makefile
jdk/make/java/java_hprof_demo/Makefile
jdk/make/java/net/Makefile
jdk/make/jpda/transport/socket/Makefile
jdk/make/mkdemo/jvmti/hprof/Makefile
jdk/src/share/demo/jvmti/hprof/sample.makefile.txt
--- a/jdk/make/common/Defs-linux.gmk	Thu Jun 10 14:21:37 2010 -0700
+++ b/jdk/make/common/Defs-linux.gmk	Thu Jun 10 15:54:25 2010 -0700
@@ -311,6 +311,7 @@
 endif
 override LIBPOSIX4               =
 override LIBSOCKET               =
+override LIBNSL                  =
 override LIBTHREAD               =
 override MOOT_PRIORITIES         = true
 override NO_INTERRUPTIBLE_IO     = true
--- a/jdk/make/common/Defs-solaris.gmk	Thu Jun 10 14:21:37 2010 -0700
+++ b/jdk/make/common/Defs-solaris.gmk	Thu Jun 10 15:54:25 2010 -0700
@@ -658,6 +658,9 @@
 # Socket library
 LIBSOCKET = -lsocket
 
+# Network Services library
+LIBNSL = -lnsl
+
 # GLOBAL_KPIC: If set means all libraries are PIC, position independent code
 #    EXCEPT for select compiles
 #    If a .o file is compiled non-PIC then it should be forced
--- a/jdk/make/java/hpi/hpi_common.gmk	Thu Jun 10 14:21:37 2010 -0700
+++ b/jdk/make/java/hpi/hpi_common.gmk	Thu Jun 10 15:54:25 2010 -0700
@@ -86,5 +86,5 @@
 # Things that must be linked in.
 #
 ifneq ($(PLATFORM), windows)
-OTHER_LDLIBS += $(LIBSOCKET) -lnsl $(LIBM) -ldl
+OTHER_LDLIBS += $(LIBSOCKET) $(LIBNSL) $(LIBM) -ldl
 endif
--- a/jdk/make/java/java/Makefile	Thu Jun 10 14:21:37 2010 -0700
+++ b/jdk/make/java/java/Makefile	Thu Jun 10 15:54:25 2010 -0700
@@ -204,7 +204,7 @@
 OTHER_LDLIBS += $(JVMLIB) -libpath:$(OBJDIR)/../../../fdlibm/$(OBJDIRNAME) fdlibm.lib \
 		       -libpath:$(OBJDIR)/../../../verify/$(OBJDIRNAME) verify.lib
 else
-OTHER_LDLIBS += $(JVMLIB) -lverify $(LIBSOCKET) -lnsl -ldl \
+OTHER_LDLIBS += $(JVMLIB) -lverify $(LIBSOCKET) $(LIBNSL) -ldl \
 		-L$(OBJDIR)/../../../fdlibm/$(OBJDIRNAME) -lfdlibm.$(ARCH)
 endif
 
--- a/jdk/make/java/java_hprof_demo/Makefile	Thu Jun 10 14:21:37 2010 -0700
+++ b/jdk/make/java/java_hprof_demo/Makefile	Thu Jun 10 15:54:25 2010 -0700
@@ -84,7 +84,7 @@
 ifeq ($(PLATFORM), windows)
   OTHER_LDLIBS += wsock32.lib winmm.lib
 else
-  OTHER_LDLIBS += $(LIBSOCKET) -lnsl -ldl
+  OTHER_LDLIBS += $(LIBSOCKET) $(LIBNSL) -ldl
 endif
 
 #
--- a/jdk/make/java/net/Makefile	Thu Jun 10 14:21:37 2010 -0700
+++ b/jdk/make/java/net/Makefile	Thu Jun 10 15:54:25 2010 -0700
@@ -96,7 +96,7 @@
 ifeq ($(PLATFORM), windows)
   OTHER_LDLIBS = ws2_32.lib $(JVMLIB)
 else
-  OTHER_LDLIBS = $(LIBSOCKET) -lnsl -ldl $(JVMLIB)
+  OTHER_LDLIBS = $(LIBSOCKET) $(LIBNSL) -ldl $(JVMLIB)
 endif
 ifeq ($(PLATFORM), linux)
   OTHER_LDLIBS += -lpthread
--- a/jdk/make/jpda/transport/socket/Makefile	Thu Jun 10 14:21:37 2010 -0700
+++ b/jdk/make/jpda/transport/socket/Makefile	Thu Jun 10 15:54:25 2010 -0700
@@ -38,11 +38,11 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 ifeq ($(PLATFORM), linux)
-  OTHER_LDLIBS += -lnsl $(LIBSOCKET) -lpthread
+  OTHER_LDLIBS += $(LIBNSL) $(LIBSOCKET) -lpthread
 endif
 
 ifeq ($(PLATFORM), solaris)
-  OTHER_LDLIBS += -lnsl $(LIBSOCKET)
+  OTHER_LDLIBS += $(LIBNSL) $(LIBSOCKET)
 endif
 
 ifeq ($(PLATFORM), windows)
--- a/jdk/make/mkdemo/jvmti/hprof/Makefile	Thu Jun 10 14:21:37 2010 -0700
+++ b/jdk/make/mkdemo/jvmti/hprof/Makefile	Thu Jun 10 15:54:25 2010 -0700
@@ -39,10 +39,10 @@
   EXTRA_LIBS += wsock32.lib winmm.lib
 endif
 ifeq ($(PLATFORM), solaris)
-  OTHER_LDLIBS += $(LIBSOCKET) -lnsl -ldl
+  OTHER_LDLIBS += $(LIBSOCKET) $(LIBNSL) -ldl
 endif
 ifeq ($(PLATFORM), linux)
-  OTHER_LDLIBS += $(LIBSOCKET) -lnsl -ldl -lpthread
+  OTHER_LDLIBS += $(LIBSOCKET) $(LIBNSL) -ldl -lpthread
 endif
 
 #
--- a/jdk/src/share/demo/jvmti/hprof/sample.makefile.txt	Thu Jun 10 14:21:37 2010 -0700
+++ b/jdk/src/share/demo/jvmti/hprof/sample.makefile.txt	Thu Jun 10 15:54:25 2010 -0700
@@ -132,7 +132,7 @@
     LIBRARY=lib$(LIBNAME).so
     LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text
     # Libraries we are dependent on
-    LIBRARIES= -lnsl -ldl -lc
+    LIBRARIES= -ldl -lc
     # Building a shared library
     LINK_SHARED=$(LINK.c) -shared -o $@
 endif