jdk/makefiles/CompileDemos.gmk
changeset 13702 efd6a05935b2
parent 13164 72c5d01a857d
child 14231 a0c23c1c010f
--- a/jdk/makefiles/CompileDemos.gmk	Wed Jul 05 18:22:17 2017 +0200
+++ b/jdk/makefiles/CompileDemos.gmk	Tue Sep 18 11:29:24 2012 -0700
@@ -44,10 +44,11 @@
 
 define SetupAppletDemo
      $$(eval $$(call SetupJavaCompilation,BUILD_DEMO_APPLET_$1,\
-                SETUP:=GENERATE_USINGJDKBYTECODE$2,\
+                SETUP:=GENERATE_USINGJDKBYTECODE,\
 		SRC:=$(JDK_TOPDIR)/src/$3share/demo/applets/$1,\
-		BIN:=$(JDK_OUTPUTDIR)/newdemo/applets/$1,\
-		COPY:=.html .java .xyz .obj .au .gif))
+		BIN:=$(JDK_OUTPUTDIR)/demo/applets/$1,\
+		COPY:=.html .java .xyz .obj .au .gif,\
+		DISABLE_SJAVAC:=$2))
      BUILD_DEMOS += $$(BUILD_DEMO_APPLET_$1)
 endef
 
@@ -67,11 +68,11 @@
 $(eval $(call SetupAppletDemo,SpreadSheet))
 # Build WireFrame without a server since it
 # has a class Matrix3D that also exists in MoleculeViewer.
-$(eval $(call SetupAppletDemo,WireFrame,_NOSERV))
+$(eval $(call SetupAppletDemo,WireFrame,true))
 
 ifndef OPENJDK
     $(eval $(call SetupAppletDemo,Animator,,closed/))
-    $(eval $(call SetupAppletDemo,GraphLayout,_NOSERV,closed/))
+    $(eval $(call SetupAppletDemo,GraphLayout,true,closed/))
     $(eval $(call SetupAppletDemo,JumpingBox,,closed/))
     $(eval $(call SetupAppletDemo,TicTacToe,,closed/))
 endif
@@ -111,29 +112,30 @@
 
     ifneq ($$($1_JAVA_FILES_EXIST),)
         $$(eval $$(call SetupJavaCompilation,BUILD_DEMO_$1,\
-                SETUP:=GENERATE_USINGJDKBYTECODE$(12),\
+                SETUP:=GENERATE_USINGJDKBYTECODE,\
                 ADD_JAVAC_FLAGS:=$3,\
 		SRC:=$$($1_MAIN_SRC) $5,\
-		BIN:=$(JDK_OUTPUTDIR)/newdemoclasses/$2/$1,\
+		BIN:=$(JDK_OUTPUTDIR)/democlasses/$2/$1,\
 		COPY:=$(PATTERNS_TO_COPY) $(10),\
-		JAR:=$(JDK_OUTPUTDIR)/newdemo/$2/$1/$$($1_JARFILE),\
+		JAR:=$(JDK_OUTPUTDIR)/demo/$2/$1/$$($1_JARFILE),\
 		JARMAIN:=$4,\
 		MANIFEST:=$(JDK_TOPDIR)/make/tools/manifest.mf,\
 		EXTRA_MANIFEST_ATTR:=$(11),\
-		SRCZIP:=$(JDK_OUTPUTDIR)/newdemo/$2/$1/src.zip,\
-		EXCLUDE_FILES:=$9))
+		SRCZIP:=$(JDK_OUTPUTDIR)/demo/$2/$1/src.zip,\
+		EXCLUDE_FILES:=$9,\
+		DISABLE_SJAVAC:=$(12)))
 
         BUILD_DEMOS +=  $$(BUILD_DEMO_$1) \
-			$(JDK_OUTPUTDIR)/newdemo/$2/$1/$$($1_JARFILE) \
-			$(JDK_OUTPUTDIR)/newdemo/$2/$1/src.zip 
+			$(JDK_OUTPUTDIR)/demo/$2/$1/$$($1_JARFILE) \
+			$(JDK_OUTPUTDIR)/demo/$2/$1/src.zip 
     endif
 
     # Copy files.
     $1_COPY_TARGETS :=  $$(patsubst $(JDK_TOPDIR)/src/$6share/demo/$2/$1/%,\
-			$(JDK_OUTPUTDIR)/newdemo/$2/$1/%,\
+			$(JDK_OUTPUTDIR)/demo/$2/$1/%,\
 			$$(wildcard $$(addprefix $(JDK_TOPDIR)/src/$6share/demo/$2/$1/,$7)))
     ifneq ($7,)
-        $(JDK_OUTPUTDIR)/newdemo/$2/$1/% : $(JDK_TOPDIR)/src/$6share/demo/$2/$1/%
+        $(JDK_OUTPUTDIR)/demo/$2/$1/% : $(JDK_TOPDIR)/src/$6share/demo/$2/$1/%
 		$(MKDIR) -p $$(@D)
 		$(CP) $$< $$@
 		$(CHMOD) -f ug+w $$@
@@ -144,20 +146,20 @@
 endef
 
 $(eval $(call SetupDemo,CodePointIM,jfc,,CodePointIM,,,*.html))
-$(JDK_OUTPUTDIR)/newdemo/jfc/CodePointIM/_the.services : \
-			$(JDK_OUTPUTDIR)/newdemo/jfc/CodePointIM/CodePointIM.jar \
+$(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/_the.services : \
+			$(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/CodePointIM.jar \
 			$(JDK_TOPDIR)/src/share/demo/jfc/CodePointIM/java.awt.im.spi.InputMethodDescriptor
-	(cd $(JDK_OUTPUTDIR)/newdemo/jfc/CodePointIM && \
+	(cd $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM && \
 		$(MKDIR) -p _the.tmp/META-INF/services && \
 		$(CP) $(JDK_TOPDIR)/src/share/demo/jfc/CodePointIM/java.awt.im.spi.InputMethodDescriptor _the.tmp/META-INF/services && \
 		cd _the.tmp && \
-		$(JAR) uf $(JDK_OUTPUTDIR)/newdemo/jfc/CodePointIM/CodePointIM.jar META-INF/services/java.awt.im.spi.InputMethodDescriptor && \
+		$(JAR) uf $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/CodePointIM.jar META-INF/services/java.awt.im.spi.InputMethodDescriptor && \
 		cd META-INF/services && \
-		$(JAR) uf $(JDK_OUTPUTDIR)/newdemo/jfc/CodePointIM/CodePointIM.jar java.awt.im.spi.InputMethodDescriptor)
-	$(RM) -r $(JDK_OUTPUTDIR)/newdemo/jfc/CodePointIM/_the.tmp
+		$(JAR) uf $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/CodePointIM.jar java.awt.im.spi.InputMethodDescriptor)
+	$(RM) -r $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/_the.tmp
 	$(TOUCH) $@
 
-BUILD_DEMOS+=$(JDK_OUTPUTDIR)/newdemo/jfc/CodePointIM/_the.services
+BUILD_DEMOS+=$(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/_the.services
 
 $(eval $(call SetupDemo,FileChooserDemo,jfc,,FileChooserDemo,,,README*))
 $(eval $(call SetupDemo,Font2DTest,jfc,,Font2DTest,,,*.html *.txt))
@@ -182,12 +184,12 @@
     $(eval $(call SetupDemo,Stylepad,jfc,,Stylepad,\
 		$(JDK_TOPDIR)/src/share/demo/jfc/Notepad,closed/,*.txt,,$(JDK_TOPDIR)/src/share/demo/jfc/Notepad/README.txt))
     $(eval $(call SetupDemo,SwingSet2,jfc,,SwingSet2,,closed/,README* *.html,,,.java COPYRIGHT,\
-		SplashScreen-Image: resources/images/splash.png,_NOSERV))
+		SplashScreen-Image: resources/images/splash.png,true))
 
     BUILD_DEMOS += $(patsubst $(JDK_TOPDIR)/src/closed/share/demo/nbproject/%,\
-			$(JDK_OUTPUTDIR)/newdemo/nbproject/%,\
+			$(JDK_OUTPUTDIR)/demo/nbproject/%,\
 			$(shell $(FIND) $(JDK_TOPDIR)/src/closed/share/demo/nbproject/ -type f))
-    $(JDK_OUTPUTDIR)/newdemo/nbproject/% : $(JDK_TOPDIR)/src/closed/share/demo/nbproject/%
+    $(JDK_OUTPUTDIR)/demo/nbproject/% : $(JDK_TOPDIR)/src/closed/share/demo/nbproject/%
 		$(MKDIR) -p $(@D)
 		$(CP) $< $@
 		$(CHMOD) -f ug+w $@
@@ -196,7 +198,7 @@
 ##################################################################################################
 
 # Why do we install a demo jar into the main jre/lib/ext????????????????
-$(JDK_OUTPUTDIR)/lib/ext/zipfs.jar : $(JDK_OUTPUTDIR)/newdemo/nio/zipfs/zipfs.jar
+$(JDK_OUTPUTDIR)/lib/ext/zipfs.jar : $(JDK_OUTPUTDIR)/demo/nio/zipfs/zipfs.jar
 		$(MKDIR) -p $(@D)
 		$(CP) $< $@
 
@@ -207,52 +209,74 @@
 # In the old makefiles, j2dbench was not compiled. 
 #$(eval $(call SetupDemo,J2DBench,java2d,/src,,j2dbench/J2DBench))
 
+# JVMTI demos are a bit strange and share some files, but be careful the
+#    shared files are just the *.c and *.h files, not the README or sample
+#    makefiles. So we always exclude the README.txt and sample.makefile.txt
+#    from the extra sources.
 define SetupJVMTIDemo
      # Param 1 = Name of the demo
      # Param 2 = add these directories to the includes, default is agent_util
      # Param 3 = extra CFLAGS
      # Param 4 = C or C++ (defaults to C)
      # Param 5 = libs for posix
-     # Param 6 = libs for winapi
+     # Param 6 = libs for windows
      # Param 7 = libs for solaris
-     BUILD_DEMO_JVMTI_$1_EXTRA_SRC:=	$$(wildcard $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/demo/jvmti/$1) \
-					$$(wildcard $$(addprefix $(JDK_TOPDIR)/src/share/demo/jvmti/,$2))
+     BUILD_DEMO_JVMTI_$1_EXTRA_SRC:= \
+        $$(wildcard $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/demo/jvmti/$1) \
+	$$(wildcard $$(addprefix $(JDK_TOPDIR)/src/share/demo/jvmti/,$2))
+     BUILD_DEMO_JVMTI_$1_EXTRA_SRC_EXCLUDE:= \
+	$$(wildcard $$(addprefix $(JDK_TOPDIR)/src/share/demo/jvmti/,$2)/README.txt) \
+	$$(wildcard $$(addprefix $(JDK_TOPDIR)/src/share/demo/jvmti/,$2)/sample.makefile.txt)
      BUILD_DEMO_JVMTI_$1_EXTRA_INC:=$$(addprefix -I,$$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC))
      BUILD_DEMO_JVMTI_$1_LANG:=C
-     BUILD_DEMO_JVMTI_$1_O_FLAG:=$(C_O_FLAG_NORM)
      ifneq (,$4)
          BUILD_DEMO_JVMTI_$1_LANG:=$4
      endif
      ifeq (C++,$4)
-         $1_EXTRA_CXX:=$(LIBCXX)
-         BUILD_DEMO_JVMTI_$1_O_FLAG:=$(CXX_O_FLAG_NORM)
+         $1_EXTRA_CXX:=$(LDFLAGS_CXX_JDK) $(LIBCXX)
      endif
 
-     $1_CXXFLAGS:=$(CXXFLAGS_JDKLIB) $$(BUILD_DEMO_JVMTI_$1_O_FLAG) -I$(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3
+     $1_CXXFLAGS:=$(CXXFLAGS_JDKLIB) -I$(JDK_TOPDIR)/src/share/demo/jvmti/$1 \
+		  $$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3 \
+		  $(CXXFLAGS_DEBUG_SYMBOLS)
      ifeq ($1-$(OPENJDK_TARGET_CPU_ARCH),waiters-sparc)
-       $1_FILTER:=-xregs=no%appl
-       $1_CXXFLAGS:=$$(filter-out $$($1_FILTER),$$($1_CXXFLAGS))
+         $1_FILTER:=-xregs=no%appl
+         $1_CXXFLAGS:=$$(filter-out $$($1_FILTER),$$($1_CXXFLAGS))
      endif
 
+     # Workaround for CFLAGS_JDKLIB containing ',' on solaris. If this is added as 'CFLAGS' to the
+     # eval call below, the comma gets expanded too early.
+     BUILD_DEMO_JVMTI_$1_CFLAGS:=$(CFLAGS_JDKLIB) $(CFLAGS_DEBUG_SYMBOLS) \
+		-I$(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3
+
+     # Remove the -incremental:no setting to get .ilk-files like in the old build.
      $$(eval $$(call SetupNativeCompilation,BUILD_DEMO_JVMTI_$1,\
 		SRC:=$(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC),\
 		LANG:=$$(BUILD_DEMO_JVMTI_$1_LANG),\
-		CFLAGS:=$(CFLAGS_JDKLIB) $$(BUILD_DEMO_JVMTI_$1_O_FLAG) -I$(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3,\
+		OPTIMIZATION:=LOW,\
 		CXXFLAGS:=$$($1_CXXFLAGS),\
-		LDFLAGS:=$(LDFLAGS_JDKLIB),\
+		LDFLAGS:=$(filter-out -incremental:no -opt:ref,$(LDFLAGS_JDKLIB)),\
+		LDFLAGS_macosx:=$(call SET_EXECUTABLE_ORIGIN),\
 		LDFLAGS_SUFFIX:=$$($1_EXTRA_CXX),\
 		LDFLAGS_SUFFIX_posix:=$5,\
-		LDFLAGS_SUFFIX_winapi:=$6,\
-		LDFLAGS_SUFFIX_solaris:=-lc $7,\
-		OBJECT_DIR:=$(JDK_OUTPUTDIR)/newdemoobjs/jvmti/$1,\
-		OUTPUT_DIR:=$(JDK_OUTPUTDIR)/newdemo/jvmti/$1/lib,\
+		LDFLAGS_SUFFIX_windows:=$6,\
+		LDFLAGS_SUFFIX_solaris:=$7 -lc,\
+		LDFLAGS_SUFFIX_linux:=$8,\
+		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
+		RC_FLAGS:=$$(RC_FLAGS) \
+			  /D "JDK_FNAME=$1.dll" \
+			  /D "JDK_INTERNAL_NAME=$1" \
+			  /D "JDK_FTYPE=0x2L",\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/demoobjs/jvmti/$1,\
+		OUTPUT_DIR:=$(JDK_OUTPUTDIR)/demo/jvmti/$1/lib,\
 		LIBRARY:=$1))
 
     $$(eval $$(call SetupZipArchive,BUILD_DEMO_JVMTI_SRC_$1,\
 		SRC:=$(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC),\
-		ZIP:=$(JDK_OUTPUTDIR)/newdemo/jvmti/$1/src.zip))
+		EXCLUDE_FILES:=$$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC_EXCLUDE), \
+		ZIP:=$(JDK_OUTPUTDIR)/demo/jvmti/$1/src.zip))
 
-     $(JDK_OUTPUTDIR)/newdemo/jvmti/$1/README.txt : $(JDK_TOPDIR)/src/share/demo/jvmti/$1/README.txt
+     $(JDK_OUTPUTDIR)/demo/jvmti/$1/README.txt : $(JDK_TOPDIR)/src/share/demo/jvmti/$1/README.txt
 		$(MKDIR) -p $$(@D)
 		$(CP) $$< $$@
 		$(CHMOD) -f ug+w $$@
@@ -261,29 +285,40 @@
          $$(eval $$(call SetupJavaCompilation,BUILD_DEMO_JVMTI_$1_JAVA,\
                 SETUP:=GENERATE_USINGJDKBYTECODE,\
 		SRC:=$(JDK_TOPDIR)/src/share/demo/jvmti/$1,\
-		BIN:=$(JDK_OUTPUTDIR)/newdemoclasses/jvmti/$1,\
+		BIN:=$(JDK_OUTPUTDIR)/democlasses/jvmti/$1,\
 		COPY:=$(PATTERNS_TO_COPY),\
-		JAR:=$(JDK_OUTPUTDIR)/newdemo/jvmti/$1/$1.jar,\
+		JAR:=$(JDK_OUTPUTDIR)/demo/jvmti/$1/$1.jar,\
 		EXTRA_MANIFEST_ATTR:=Main-Class: \n,\
 		MANIFEST:=$(JDK_TOPDIR)/make/tools/manifest.mf))
 
-         BUILD_DEMOS += $(JDK_OUTPUTDIR)/newdemo/jvmti/$1/$1.jar
+         BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jvmti/$1/$1.jar
      endif
 
      BUILD_DEMOS += 	$$(BUILD_DEMO_JVMTI_$1) \
-			$(JDK_OUTPUTDIR)/newdemo/jvmti/$1/src.zip \
-			$(JDK_OUTPUTDIR)/newdemo/jvmti/$1/README.txt
+			$(JDK_OUTPUTDIR)/demo/jvmti/$1/src.zip \
+			$(JDK_OUTPUTDIR)/demo/jvmti/$1/README.txt
+
+     ifeq ($(OPENJDK_TARGET_OS),windows)
+         # These files normally end up in OBJECT_DIR but for demos they
+         # are supposed to be included in the distro.
+         $(JDK_OUTPUTDIR)/demo/jvmti/$1/lib/$1.lib: $$(BUILD_DEMO_JVMTI_$1)
+		$(CP) $(JDK_OUTPUTDIR)/demoobjs/jvmti/$1/$1.lib $$@
+
+         $(JDK_OUTPUTDIR)/demo/jvmti/$1/lib/$1.exp: $$(BUILD_DEMO_JVMTI_$1)
+		$(CP) $(JDK_OUTPUTDIR)/demoobjs/jvmti/$1/$1.exp $$@
+
+         BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jvmti/$1/lib/$1.lib \
+			$(JDK_OUTPUTDIR)/demo/jvmti/$1/lib/$1.exp
+     endif
 endef
 
 $(eval $(call SetupJVMTIDemo,compiledMethodLoad,	agent_util))
 $(eval $(call SetupJVMTIDemo,gctest,			agent_util))
 $(eval $(call SetupJVMTIDemo,heapTracker,		agent_util java_crw_demo))
 $(eval $(call SetupJVMTIDemo,heapViewer,		agent_util))
-# hprof contains error messages using __FILE__ macro. These expand to the absolute path
-# in the new build system and relative in the old, causing the binaries to differ.
 $(eval $(call SetupJVMTIDemo,hprof,			java_crw_demo,\
-		-I$(JDK_TOPDIR)/src/share/npt -I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/npt,C,\
-		-ldl,ws2_32.lib winmm.lib,-lsocket -lnsl))
+		-I$(JDK_TOPDIR)/src/share/npt -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt,C,\
+		-ldl,ws2_32.lib winmm.lib,-lsocket -lnsl,-lpthread))
 
 $(eval $(call SetupJVMTIDemo,minst,			agent_util java_crw_demo))
 $(eval $(call SetupJVMTIDemo,mtrace,			agent_util java_crw_demo))
@@ -298,11 +333,11 @@
 # The number of files are few enough so that we can use echo safely below to list them.
 JPDA_FILES:=$(subst $(JDK_TOPDIR)/src/share/classes/,,$(JPDA_SOURCES))
 
-$(JDK_OUTPUTDIR)/newdemo/jpda/src.zip : $(JPDA_SOURCES)
+$(JDK_OUTPUTDIR)/demo/jpda/src.zip : $(JPDA_SOURCES)
 		$(MKDIR) -p $(@D)
 		(cd $(JDK_TOPDIR)/src/share/classes && $(ZIP) -qru $@ com -i "com/sun/tools/example/*")
 
-$(JDK_OUTPUTDIR)/newdemo/jpda/examples.jar : $(JPDA_SOURCES)
+$(JDK_OUTPUTDIR)/demo/jpda/examples.jar : $(JPDA_SOURCES)
 		$(MKDIR) -p $(@D)
 		$(RM) $(@D)/_the.sources
 		$(call ListPathsSafely,JPDA_FILES,\n, >> $(@D)/_the.sources)
@@ -312,103 +347,104 @@
 		(cd $(JDK_TOPDIR)/src/share/classes && $(JAR) cfm  $@ $(@D)/_the.manifest @$(@D)/_the.sources)
 		(cd $(JDK_TOPDIR)/src/share/classes/com/sun/tools/example && $(JAR) uf $@ README)
 
-$(JDK_OUTPUTDIR)/newdemo/jpda/com/sun/tools/example/README : $(JDK_TOPDIR)/src/share/classes/com/sun/tools/example/README
+$(JDK_OUTPUTDIR)/demo/jpda/com/sun/tools/example/README : $(JDK_TOPDIR)/src/share/classes/com/sun/tools/example/README
 		$(MKDIR) -p $(@D)
 		$(CP) $< $@
 		$(CHMOD) -f ug+w $@
 
-BUILD_DEMOS += $(JDK_OUTPUTDIR)/newdemo/jpda/src.zip $(JDK_OUTPUTDIR)/newdemo/jpda/examples.jar \
-		$(JDK_OUTPUTDIR)/newdemo/jpda/com/sun/tools/example/README
+BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jpda/src.zip $(JDK_OUTPUTDIR)/demo/jpda/examples.jar \
+		$(JDK_OUTPUTDIR)/demo/jpda/com/sun/tools/example/README
 
 ##################################################################################################
 
-$(JDK_OUTPUTDIR)/newdemo/management/index.html : $(JDK_TOPDIR)/src/share/demo/management/index.html
+$(JDK_OUTPUTDIR)/demo/management/index.html : $(JDK_TOPDIR)/src/share/demo/management/index.html
 		$(MKDIR) -p $(@D)
 		$(CP) $< $@
 		$(CHMOD) -f ug+w $@
 
-$(JDK_OUTPUTDIR)/newdemo/jvmti/index.html : $(JDK_TOPDIR)/src/share/demo/jvmti/index.html
+$(JDK_OUTPUTDIR)/demo/jvmti/index.html : $(JDK_TOPDIR)/src/share/demo/jvmti/index.html
 		$(MKDIR) -p $(@D)
 		$(CP) $< $@
 		$(CHMOD) -f ug+w $@
 
-BUILD_DEMOS += $(JDK_OUTPUTDIR)/newdemo/management/index.html \
-		$(JDK_OUTPUTDIR)/newdemo/jvmti/index.html
+BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/management/index.html \
+		$(JDK_OUTPUTDIR)/demo/jvmti/index.html
 
 ##################################################################################################
 
 # The netbeans project files are copied into the demo directory.
 BUILD_DEMOS += $(patsubst $(JDK_TOPDIR)/src/share/demo/nbproject/%,\
-		$(JDK_OUTPUTDIR)/newdemo/nbproject/%,\
+		$(JDK_OUTPUTDIR)/demo/nbproject/%,\
 		$(shell $(FIND) $(JDK_TOPDIR)/src/share/demo/nbproject/ -type f))
 
-$(JDK_OUTPUTDIR)/newdemo/nbproject/% : $(JDK_TOPDIR)/src/share/demo/nbproject/%
+$(JDK_OUTPUTDIR)/demo/nbproject/% : $(JDK_TOPDIR)/src/share/demo/nbproject/%
 	$(MKDIR) -p $(@D)
 	$(CP) $< $@
 	$(CHMOD) -f ug+w $@
 
 ##################################################################################################
 
-$(JDK_OUTPUTDIR)/newdemo/README: $(JDK_TOPDIR)/src/share/demo/README
+$(JDK_OUTPUTDIR)/demo/README: $(JDK_TOPDIR)/src/share/demo/README
 	$(MKDIR) -p $(@D)
 	$(CP) $< $@
 
-BUILD_DEMOS += $(JDK_OUTPUTDIR)/newdemo/README
+BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/README
 
 ##################################################################################################
 
 ifeq ($(OPENJDK_TARGET_OS), solaris)
 
-$(JDK_OUTPUTDIR)/newdemoclasses/jni/Poller/% : $(JDK_TOPDIR)/src/solaris/demo/jni/Poller/%
+$(JDK_OUTPUTDIR)/democlasses/jni/Poller/% : $(JDK_TOPDIR)/src/solaris/demo/jni/Poller/%
 		$(MKDIR) -p $(@D)
 		$(CP) $< $@
 		$(CHMOD) -f ug+w $@
 
-$(JDK_OUTPUTDIR)/newdemo/jni/Poller/README.txt : $(JDK_TOPDIR)/src/solaris/demo/jni/Poller/README.txt
+$(JDK_OUTPUTDIR)/demo/jni/Poller/README.txt : $(JDK_TOPDIR)/src/solaris/demo/jni/Poller/README.txt
 		$(MKDIR) -p $(@D)
 		$(CP) $< $@
 		$(CHMOD) -f ug+w $@
 
-$(JDK_OUTPUTDIR)/newdemo/jni/Poller/Poller.jar : \
-  $(JDK_OUTPUTDIR)/newdemoclasses/jni/Poller/README.txt $(JDK_OUTPUTDIR)/newdemoclasses/jni/Poller/Poller.c
+$(JDK_OUTPUTDIR)/demo/jni/Poller/Poller.jar : \
+  $(JDK_OUTPUTDIR)/democlasses/jni/Poller/README.txt $(JDK_OUTPUTDIR)/democlasses/jni/Poller/Poller.c
 
 $(eval $(call SetupJavaCompilation,BUILD_DEMO_POLLER_JAR,\
 		SETUP:=GENERATE_USINGJDKBYTECODE, \
 		SRC:=$(JDK_TOPDIR)/src/solaris/demo/jni/Poller, \
-		BIN:=$(JDK_OUTPUTDIR)/newdemoclasses/jni/Poller, \
-		HEADERS:=$(JDK_OUTPUTDIR)/newdemoclasses/jni/Poller, \
-		JAR:=$(JDK_OUTPUTDIR)/newdemo/jni/Poller/Poller.jar, \
+		BIN:=$(JDK_OUTPUTDIR)/democlasses/jni/Poller, \
+		HEADERS:=$(JDK_OUTPUTDIR)/democlasses/jni/Poller, \
+		JAR:=$(JDK_OUTPUTDIR)/demo/jni/Poller/Poller.jar, \
 		MANIFEST:=$(JDK_TOPDIR)/make/tools/manifest.mf, \
-		SRCZIP:=$(JDK_OUTPUTDIR)/newdemo/jni/Poller/src.zip, \
-		COPY := README.txt Poller.c, \
-		JARMAIN := Client))
+		SRCZIP:=$(JDK_OUTPUTDIR)/demo/jni/Poller/src.zip, \
+		COPY:=README.txt Poller.c, \
+		JARMAIN:=Client))
 
 
 
-BUILD_DEMOS += $(JDK_OUTPUTDIR)/newdemo/jni/Poller/Poller.jar $(JDK_OUTPUTDIR)/newdemo/jni/Poller/src.zip \
-               $(JDK_OUTPUTDIR)/newdemo/jni/Poller/README.txt
+BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jni/Poller/Poller.jar $(JDK_OUTPUTDIR)/demo/jni/Poller/src.zip \
+               $(JDK_OUTPUTDIR)/demo/jni/Poller/README.txt
 
 $(eval $(call SetupNativeCompilation,BUILD_LIBPOLLER,\
 		SRC:=$(JDK_TOPDIR)/src/solaris/demo/jni/Poller, \
-		LANG := C, \
-		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
-                        -I$(JDK_OUTPUTDIR)/newdemoclasses/jni/Poller, \
+		LANG:=C,\
+		OPTIMIZATION:=LOW,\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(SHARED_LIBRARY_FLAGS) \
+                        -I$(JDK_OUTPUTDIR)/democlasses/jni/Poller, \
 		LDFLAGS:=$(LDFLAGS_JDKLIB), \
-		OBJECT_DIR:=$(JDK_OUTPUTDIR)/newdemoobjs/jni/Poller,\
-                OUTPUT_DIR:=$(JDK_OUTPUTDIR)/newdemoobjs, \
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/demoobjs/jni/Poller,\
+                OUTPUT_DIR:=$(JDK_OUTPUTDIR)/demoobjs, \
 		LIBRARY:=Poller))
 
 #
 # We can only compile native code after jar has been build (since we depend on generated .h files)
 #
-$(JDK_OUTPUTDIR)/newdemoobjs/jni/Poller/Poller.o : $(JDK_OUTPUTDIR)/newdemo/jni/Poller/Poller.jar
+$(JDK_OUTPUTDIR)/demoobjs/jni/Poller/Poller.o : $(JDK_OUTPUTDIR)/demo/jni/Poller/Poller.jar
 
-$(JDK_OUTPUTDIR)/newdemo/jni/Poller/lib/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX) : \
-  $(JDK_OUTPUTDIR)/newdemoobjs/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX)
+$(JDK_OUTPUTDIR)/demo/jni/Poller/lib/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX) : \
+  $(JDK_OUTPUTDIR)/demoobjs/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX)
 	$(MKDIR) -p $(@D)
 	$(CP) $< $@
 
-BUILD_DEMOS += $(JDK_OUTPUTDIR)/newdemo/jni/Poller/lib/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX)
+BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jni/Poller/lib/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX)
 
 endif
 
@@ -417,20 +453,20 @@
 ifndef OPENJDK
     DB_DEMO_ZIPFILE := $(shell $(FIND) $(JDK_TOPDIR)/src/closed/share/db -name "*demo*.zip")
 
-    $(JDK_OUTPUTDIR)/newdemo/_the.db.unzipped: $(DB_DEMO_ZIPFILE)
+    $(JDK_OUTPUTDIR)/demo/_the.db.unzipped: $(DB_DEMO_ZIPFILE)
 	$(MKDIR) -p $(@D)
-	$(RM) -rf $(JDK_OUTPUTDIR)/newdemo/db $(JDK_OUTPUTDIR)/newdemo/demo
-	$(CD) $(JDK_OUTPUTDIR)/newdemo && $(UNZIP) -o $<
-	$(MV) $(JDK_OUTPUTDIR)/newdemo/demo $(JDK_OUTPUTDIR)/newdemo/db
+	$(RM) -r $(JDK_OUTPUTDIR)/demo/db $(JDK_OUTPUTDIR)/demo/demo
+	$(CD) $(JDK_OUTPUTDIR)/demo && $(UNZIP) -o $<
+	$(MV) $(JDK_OUTPUTDIR)/demo/demo $(JDK_OUTPUTDIR)/demo/db
 	$(TOUCH) $@
 
 #    Copy this after the unzip above to avoid race with directory creation and mv command.
-     $(JDK_OUTPUTDIR)/newdemo/db/README-JDK-DEMOS.html: \
+     $(JDK_OUTPUTDIR)/demo/db/README-JDK-DEMOS.html: \
 		$(JDK_TOPDIR)/src/closed/share/db/README-JDK-DEMOS.html \
-		| $(JDK_OUTPUTDIR)/newdemo/_the.db.unzipped
+		| $(JDK_OUTPUTDIR)/demo/_the.db.unzipped
 	$(MKDIR) -p $(@D)
 	$(CP) '$<' '$@'
-     BUILD_DEMOS += $(JDK_OUTPUTDIR)/newdemo/_the.db.unzipped $(JDK_OUTPUTDIR)/newdemo/db/README-JDK-DEMOS.html
+     BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/_the.db.unzipped $(JDK_OUTPUTDIR)/demo/db/README-JDK-DEMOS.html
 endif
 
 ##################################################################################################