jdk/makefiles/CompileLaunchers.gmk
changeset 19399 e2e5122cd62e
parent 17732 79c019dd5279
child 21396 d72c10b67eb2
child 20203 2e0b3aab117a
child 20848 0dc5945a4b01
child 22592 2edfb3abb041
equal deleted inserted replaced
19398:0cd1d4845b2d 19399:e2e5122cd62e
    38 # Build tools
    38 # Build tools
    39 include Tools.gmk
    39 include Tools.gmk
    40 
    40 
    41 BUILD_LAUNCHERS=
    41 BUILD_LAUNCHERS=
    42 
    42 
    43 # When building a legacy overlay image (on solaris 64 bit), the launchers 
    43 # When building a legacy overlay image (on solaris 64 bit), the launchers
    44 # need to be built with a different rpath and a different output dir.
    44 # need to be built with a different rpath and a different output dir.
    45 ifeq ($(OVERLAY_IMAGES),true)
    45 ifeq ($(OVERLAY_IMAGES),true)
    46     ORIGIN_ROOT:=/../..
    46     ORIGIN_ROOT:=/../..
    47     OUTPUT_SUBDIR:=$(OPENJDK_TARGET_CPU_ISADIR)
    47     OUTPUT_SUBDIR:=$(OPENJDK_TARGET_CPU_ISADIR)
    48 else
    48 else
    61 # System.loadLibrary("jawt") first. This was the behaviour described in the
    61 # System.loadLibrary("jawt") first. This was the behaviour described in the
    62 # devloper documentation of JAWT and what worked with OpenJDK6.
    62 # devloper documentation of JAWT and what worked with OpenJDK6.
    63 #
    63 #
    64 ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris),)
    64 ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris),)
    65     ORIGIN_ARG+=$(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/lib$(OPENJDK_TARGET_CPU_LIBDIR)) \
    65     ORIGIN_ARG+=$(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/lib$(OPENJDK_TARGET_CPU_LIBDIR)) \
    66                 $(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)) 
    66                 $(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR))
    67 endif
    67 endif
    68 
    68 
    69 define SetupLauncher
    69 define SetupLauncher
    70     # TODO: Fix mapfile on solaris. Won't work with ld as linker.
    70     # TODO: Fix mapfile on solaris. Won't work with ld as linker.
    71     # Parameter 1 is the name of the launcher (java,javac,jar...)
    71     # Parameter 1 is the name of the launcher (java,javac,jar...)
   187     endif
   187     endif
   188 
   188 
   189     ifeq ($(OPENJDK_TARGET_OS),windows)
   189     ifeq ($(OPENJDK_TARGET_OS),windows)
   190         $$(BUILD_LAUNCHER_$1) : $(JDK_OUTPUTDIR)/objs/libjava/java.lib \
   190         $$(BUILD_LAUNCHER_$1) : $(JDK_OUTPUTDIR)/objs/libjava/java.lib \
   191 				$$($1_WINDOWS_JLI_LIB)
   191 				$$($1_WINDOWS_JLI_LIB)
   192     endif    	 
   192     endif
   193 endef
   193 endef
   194 
   194 
   195 ##########################################################################################
   195 ##########################################################################################
   196 
   196 
   197 XLIBS:=$(X_LIBS) -lX11
   197 XLIBS:=$(X_LIBS) -lX11
   439 ifeq ($(OPENJDK_TARGET_OS),solaris)
   439 ifeq ($(OPENJDK_TARGET_OS),solaris)
   440     UNPACKEXE_LANG:=C++
   440     UNPACKEXE_LANG:=C++
   441 endif
   441 endif
   442 # On windows, unpack200 is linked completely differently to all other
   442 # On windows, unpack200 is linked completely differently to all other
   443 # executables, using the compiler with the compiler arguments.
   443 # executables, using the compiler with the compiler arguments.
   444 # It's also linked incrementally, producing a .ilk file that needs to 
   444 # It's also linked incrementally, producing a .ilk file that needs to
   445 # be kept away.
   445 # be kept away.
   446 ifeq ($(OPENJDK_TARGET_OS),windows)
   446 ifeq ($(OPENJDK_TARGET_OS),windows)
   447     BUILD_UNPACKEXE_LDEXE:=$(CC)
   447     BUILD_UNPACKEXE_LDEXE:=$(CC)
   448     EXE_OUT_OPTION_save:=$(EXE_OUT_OPTION)
   448     EXE_OUT_OPTION_save:=$(EXE_OUT_OPTION)
   449     EXE_OUT_OPTION:=-Fe
   449     EXE_OUT_OPTION:=-Fe
   488 $(BUILD_UNPACKEXE) : $(UNPACKEXE_ZIPOBJS)
   488 $(BUILD_UNPACKEXE) : $(UNPACKEXE_ZIPOBJS)
   489 
   489 
   490 endif
   490 endif
   491 
   491 
   492 # Build into object dir and copy executable afterwards to avoid .ilk file in
   492 # Build into object dir and copy executable afterwards to avoid .ilk file in
   493 # image. The real fix would be clean up linking of unpack200 using 
   493 # image. The real fix would be clean up linking of unpack200 using
   494 # -link -incremental:no
   494 # -link -incremental:no
   495 # like all other launchers.
   495 # like all other launchers.
   496 $(JDK_OUTPUTDIR)/bin$(OUTPUT_SUBDIR)/unpack200$(EXE_SUFFIX): $(BUILD_UNPACKEXE)
   496 $(JDK_OUTPUTDIR)/bin$(OUTPUT_SUBDIR)/unpack200$(EXE_SUFFIX): $(BUILD_UNPACKEXE)
   497 	$(call install-file)
   497 	$(call install-file)
   498 
   498 
   499 BUILD_LAUNCHERS += $(JDK_OUTPUTDIR)/bin$(OUTPUT_SUBDIR)/unpack200$(EXE_SUFFIX)
   499 BUILD_LAUNCHERS += $(JDK_OUTPUTDIR)/bin$(OUTPUT_SUBDIR)/unpack200$(EXE_SUFFIX)
   500 
   500 
   501 ##########################################################################################
   501 ##########################################################################################
   502 
   502 
   503 
   503 
   504 BUILD_JEXEC := 
   504 BUILD_JEXEC :=
   505 BUILD_JEXEC_SRC :=
   505 BUILD_JEXEC_SRC :=
   506 BUILD_JEXEC_INC :=
   506 BUILD_JEXEC_INC :=
   507 BUILD_JEXEC_DST_DIR := $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)
   507 BUILD_JEXEC_DST_DIR := $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)
   508 
   508 
   509 #
   509 #
   579   ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
   579   ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
   580     BUILD_LAUNCHERS += $(JAVA_RMI_CGI)
   580     BUILD_LAUNCHERS += $(JAVA_RMI_CGI)
   581   endif
   581   endif
   582 endif
   582 endif
   583 
   583 
   584 # TODO: 
   584 # TODO:
   585 # On windows java-rmi.cgi shouldn't be bundled since Java 1.2, but has been built all
   585 # On windows java-rmi.cgi shouldn't be bundled since Java 1.2, but has been built all
   586 # this time anyway. Since jdk6, it has been built from the wrong source and resulted
   586 # this time anyway. Since jdk6, it has been built from the wrong source and resulted
   587 # in a (almost) copy of the standard java launcher named "java-rmi.exe" ending up in 
   587 # in a (almost) copy of the standard java launcher named "java-rmi.exe" ending up in
   588 # the final images bin dir. This weird behavior is mimicked here in the converted 
   588 # the final images bin dir. This weird behavior is mimicked here in the converted
   589 # makefiles for now. Should probably just be deleted.
   589 # makefiles for now. Should probably just be deleted.
   590 # http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6512052
   590 # http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6512052
   591 ifeq ($(OPENJDK_TARGET_OS),windows)
   591 ifeq ($(OPENJDK_TARGET_OS),windows)
   592     $(eval $(call SetupLauncher,java-rmi,,\
   592     $(eval $(call SetupLauncher,java-rmi,,\
   593         $(call SET_SHARED_LIBRARY_MAPFILE,$(JDK_TOPDIR)/makefiles/java/main/java/mapfile-$(OPENJDK_TARGET_CPU))))
   593         $(call SET_SHARED_LIBRARY_MAPFILE,$(JDK_TOPDIR)/makefiles/java/main/java/mapfile-$(OPENJDK_TARGET_CPU))))
   594 else
   594 else
   595     $(JAVA_RMI_CGI): $(JDK_TOPDIR)/src/solaris/bin/java-rmi.cgi.sh
   595     $(JAVA_RMI_CGI): $(JDK_TOPDIR)/src/solaris/bin/java-rmi.cgi.sh
   596 	$(call install-file)
   596 	$(call install-file)
   597 	$(CHMOD) a+x $@
   597 	$(CHMOD) a+x $@
       
   598 endif
       
   599 
       
   600 ##########################################################################################
       
   601 
       
   602 BUILD_JSPAWNHELPER :=
       
   603 BUILD_JSPAWNHELPER_SRC := $(JDK_TOPDIR)/src/solaris/native/java/lang
       
   604 BUILD_JSPAWNHELPER_DST_DIR := $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)
       
   605 LINK_JSPAWNHELPER_OBJECTS := $(JDK_OUTPUTDIR)/objs/libjava/childproc.o
       
   606 LINK_JSPAWNHELPER_FLAGS :=
       
   607 
       
   608 ifneq ($(findstring $(OPENJDK_TARGET_OS), macosx solaris),)
       
   609     BUILD_JSPAWNHELPER := 1
       
   610 endif
       
   611 
       
   612 ifeq ($(OPENJDK_TARGET_OS), macosx)
       
   613     BUILD_JSPAWNHELPER_DST_DIR := $(JDK_OUTPUTDIR)/lib
       
   614 endif
       
   615 
       
   616 ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
       
   617     LINK_JSPAWNHELPER_FLAGS += -m64
       
   618 endif
       
   619 
       
   620 ifeq ($(BUILD_JSPAWNHELPER), 1)
       
   621     $(eval $(call SetupNativeCompilation,BUILD_JSPAWNHELPER,\
       
   622         SRC:=$(BUILD_JSPAWNHELPER_SRC),\
       
   623         INCLUDE_FILES:=jspawnhelper.c,\
       
   624         LANG:=C,\
       
   625         OPTIMIZATION := LOW, \
       
   626         CFLAGS:=$(CFLAGS_JDKEXE), \
       
   627         LDFLAGS:=$(LDFLAGS_JDKEXE) $(LINK_JSPAWNHELPER_FLAGS), \
       
   628         LDFLAGS_SUFFIX:= $(LINK_JSPAWNHELPER_OBJECTS), \
       
   629         OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/jspawnhelper,\
       
   630         OUTPUT_DIR:=$(BUILD_JSPAWNHELPER_DST_DIR),\
       
   631         PROGRAM:=jspawnhelper))
       
   632 
       
   633     $(BUILD_JSPAWNHELPER): $(LINK_JSPAWNHELPER_OBJECTS)
       
   634 
       
   635     BUILD_LAUNCHERS += $(BUILD_JSPAWNHELPER)
   598 endif
   636 endif
   599 
   637 
   600 ##########################################################################################
   638 ##########################################################################################
   601 # jabswitch
   639 # jabswitch
   602 
   640