makefiles/CompileLaunchers.gmk

Print this page
rev 7322 : 8017568: Enable new build on Linux/PPC64


   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #
  25 
  26 defalt: all
  27 
  28 include $(SPEC)
  29 include MakeBase.gmk
  30 include NativeCompilation.gmk
  31 
  32 # Setup the java compilers for the JDK build.
  33 include Setup.gmk
  34 
  35 # Prepare the find cache. Only used on windows.
  36 $(eval $(call FillCacheFind,$(JDK_TOPDIR)/src/share/bin))
  37 
  38 # Build tools
  39 include Tools.gmk
  40 
  41 BUILD_LAUNCHERS=
  42 
  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.
  45 ifeq ($(OVERLAY_IMAGES),true)
  46     ORIGIN_ROOT:=/../..


 111     endif
 112 
 113     $1_OUTPUT_DIR_ARG:=$9
 114     ifeq (,$$($1_OUTPUT_DIR_ARG))
 115         $1_OUTPUT_DIR_ARG:=$(JDK_OUTPUTDIR)/bin
 116     endif
 117 
 118     # TODO: maybe it's better to move this if-statement out of this function
 119     ifeq ($1,java)
 120         $1_OPTIMIZATION_ARG:=HIGH
 121         $1_LDFLAGS_solaris:=-R$(OPENWIN_HOME)/lib$(OPENJDK_TARGET_CPU_ISADIR)
 122     else
 123         $1_OPTIMIZATION_ARG:=LOW
 124     endif
 125 
 126     $1_CFLAGS:=$(CFLAGS_JDKEXE)
 127     ifeq ($(10),true)
 128         $1_CFLAGS:=$(filter-out -MD,$(CFLAGS_JDKEXE))
 129     endif
 130 










 131     ifneq ($(wildcard $(JDK_TOPDIR)/makefiles/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU)),)
 132         $1_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU)
 133     else
 134         $1_MAPFILE:=
 135     endif

 136 
 137     $(call SetupNativeCompilation,BUILD_LAUNCHER_$1,\
 138         SRC:=$(JDK_TOPDIR)/src/share/bin,\
 139         INCLUDE_FILES:=main.c,\
 140         LANG:=C,\
 141         OPTIMIZATION:=$$($1_OPTIMIZATION_ARG), \
 142         CFLAGS:=$$($1_CFLAGS) \
 143                 -I$(JDK_TOPDIR)/src/share/bin \
 144                 -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin \
 145                 -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS)/bin \
 146                 -DFULL_VERSION='"$(FULL_VERSION)"' \
 147                 -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
 148                 -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' \
 149                 -DLIBARCHNAME='"$(OPENJDK_TARGET_CPU_LEGACY)"' \
 150                 -DLAUNCHER_NAME='"$(LAUNCHER_NAME)"' \
 151                 -DPROGNAME='"$1"' $(DPACKAGEPATH) \
 152                 $2,\
 153         CFLAGS_linux:=-fPIC,\
 154         CFLAGS_solaris:=-KPIC -DHAVE_GETHRTIME,\
 155         LDFLAGS:=$(LDFLAGS_JDKEXE) \


 431 endif
 432 
 433 ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
 434     UNPACKEXE_CFLAGS += -xregs=no%appl
 435     UNPACKEXE_LDFLAGS_solaris += -xmemalign=4s
 436 endif
 437 
 438 UNPACKEXE_LANG:=C
 439 ifeq ($(OPENJDK_TARGET_OS),solaris)
 440     UNPACKEXE_LANG:=C++
 441 endif
 442 # On windows, unpack200 is linked completely differently to all other
 443 # executables, using the compiler with the compiler arguments.
 444 # It's also linked incrementally, producing a .ilk file that needs to 
 445 # be kept away.
 446 ifeq ($(OPENJDK_TARGET_OS),windows)
 447     BUILD_UNPACKEXE_LDEXE:=$(CC)
 448     EXE_OUT_OPTION_save:=$(EXE_OUT_OPTION)
 449     EXE_OUT_OPTION:=-Fe
 450 endif










 451 $(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE,\
 452                 SRC:=$(JDK_TOPDIR)/src/share/native/com/sun/java/util/jar/pack,\
 453                 EXCLUDE_FILES:=jni.cpp,\
 454                 LANG:=$(UNPACKEXE_LANG),\
 455                 OPTIMIZATION:=LOW, \
 456                 CFLAGS:=$(UNPACKEXE_CFLAGS) $(CXXFLAGS_JDKEXE)\
 457                         -DFULL, \
 458                 CFLAGS_release:=-DPRODUCT,\
 459                 CFLAGS_linux:=-fPIC,\
 460                 CFLAGS_solaris:=-KPIC, \
 461                 CFLAGS_macosx:=-fPIC, \
 462                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libunpack/mapfile-vers-unpack200,\
 463                 LDFLAGS:=$(UNPACKEXE_ZIPOBJS),\
 464                 LDFLAGS_windows:=$(CXXFLAGS_JDKEXE),\
 465                 LDFLAGS_posix:=$(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
 466                          $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)unpack$(SHARED_LIBRARY_SUFFIX)) \
 467                          $(call SET_SHARED_LIBRARY_ORIGIN),\
 468                 LDFLAGS_linux:=-lc,\
 469                 LDFLAGS_solaris:=$(UNPACKEXE_LDFLAGS_solaris) -lc,\
 470                 LDFLAGS_SUFFIX:=$(LIBCXX),\
 471                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/unpackexe$(OUTPUT_SUBDIR),\
 472                 OUTPUT_DIR:=$(JDK_OUTPUTDIR)/objs/unpackexe$(OUTPUT_SUBDIR),\
 473                 PROGRAM:=unpack200,\
 474                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
 475                 RC_FLAGS:=$(RC_FLAGS)\
 476                           -D "JDK_FNAME=unpack200.exe" \
 477                           -D "JDK_INTERNAL_NAME=unpack200" \
 478                           -D "JDK_FTYPE=0x1L",\
 479                 DEBUG_SYMBOLS:=true,\
 480                 MANIFEST:=$(JDK_TOPDIR)/src/windows/resource/unpack200_proto.exe.manifest))
 481 
 482 ifeq ($(OPENJDK_TARGET_OS),windows)




   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #
  25 
  26 default: all
  27 
  28 include $(SPEC)
  29 include MakeBase.gmk
  30 include NativeCompilation.gmk
  31 
  32 # Setup the java compilers for the JDK build.
  33 include Setup.gmk
  34 
  35 # Prepare the find cache. Only used on windows.
  36 $(eval $(call FillCacheFind,$(JDK_TOPDIR)/src/share/bin))
  37 
  38 # Build tools
  39 include Tools.gmk
  40 
  41 BUILD_LAUNCHERS=
  42 
  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.
  45 ifeq ($(OVERLAY_IMAGES),true)
  46     ORIGIN_ROOT:=/../..


 111     endif
 112 
 113     $1_OUTPUT_DIR_ARG:=$9
 114     ifeq (,$$($1_OUTPUT_DIR_ARG))
 115         $1_OUTPUT_DIR_ARG:=$(JDK_OUTPUTDIR)/bin
 116     endif
 117 
 118     # TODO: maybe it's better to move this if-statement out of this function
 119     ifeq ($1,java)
 120         $1_OPTIMIZATION_ARG:=HIGH
 121         $1_LDFLAGS_solaris:=-R$(OPENWIN_HOME)/lib$(OPENJDK_TARGET_CPU_ISADIR)
 122     else
 123         $1_OPTIMIZATION_ARG:=LOW
 124     endif
 125 
 126     $1_CFLAGS:=$(CFLAGS_JDKEXE)
 127     ifeq ($(10),true)
 128         $1_CFLAGS:=$(filter-out -MD,$(CFLAGS_JDKEXE))
 129     endif
 130 
 131     # The linker on older SuSE distros (e.g. on SLES 10) complains with:
 132     # "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable."
 133     # if feeded with a version script which contains named tags.
 134     ifeq ($(USING_BROKEN_SUSE_LD),yes)
 135         ifneq ($(wildcard $(JDK_TOPDIR)/makefiles/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU).anonymous),)
 136             $1_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU).anonymous
 137         else
 138             $1_MAPFILE:=
 139         endif
 140     else
 141         ifneq ($(wildcard $(JDK_TOPDIR)/makefiles/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU)),)
 142             $1_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU)
 143         else
 144             $1_MAPFILE:=
 145         endif
 146     endif
 147 
 148     $(call SetupNativeCompilation,BUILD_LAUNCHER_$1,\
 149         SRC:=$(JDK_TOPDIR)/src/share/bin,\
 150         INCLUDE_FILES:=main.c,\
 151         LANG:=C,\
 152         OPTIMIZATION:=$$($1_OPTIMIZATION_ARG), \
 153         CFLAGS:=$$($1_CFLAGS) \
 154                 -I$(JDK_TOPDIR)/src/share/bin \
 155                 -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin \
 156                 -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS)/bin \
 157                 -DFULL_VERSION='"$(FULL_VERSION)"' \
 158                 -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
 159                 -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' \
 160                 -DLIBARCHNAME='"$(OPENJDK_TARGET_CPU_LEGACY)"' \
 161                 -DLAUNCHER_NAME='"$(LAUNCHER_NAME)"' \
 162                 -DPROGNAME='"$1"' $(DPACKAGEPATH) \
 163                 $2,\
 164         CFLAGS_linux:=-fPIC,\
 165         CFLAGS_solaris:=-KPIC -DHAVE_GETHRTIME,\
 166         LDFLAGS:=$(LDFLAGS_JDKEXE) \


 442 endif
 443 
 444 ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
 445     UNPACKEXE_CFLAGS += -xregs=no%appl
 446     UNPACKEXE_LDFLAGS_solaris += -xmemalign=4s
 447 endif
 448 
 449 UNPACKEXE_LANG:=C
 450 ifeq ($(OPENJDK_TARGET_OS),solaris)
 451     UNPACKEXE_LANG:=C++
 452 endif
 453 # On windows, unpack200 is linked completely differently to all other
 454 # executables, using the compiler with the compiler arguments.
 455 # It's also linked incrementally, producing a .ilk file that needs to 
 456 # be kept away.
 457 ifeq ($(OPENJDK_TARGET_OS),windows)
 458     BUILD_UNPACKEXE_LDEXE:=$(CC)
 459     EXE_OUT_OPTION_save:=$(EXE_OUT_OPTION)
 460     EXE_OUT_OPTION:=-Fe
 461 endif
 462 
 463 # The linker on older SuSE distros (e.g. on SLES 10) complains with:
 464 # "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable."
 465 # if feeded with a version script which contains named tags.
 466 ifeq ($(USING_BROKEN_SUSE_LD),yes)
 467   UNPACK_MAPFILE=$(JDK_TOPDIR)/makefiles/mapfiles/libunpack/mapfile-vers-unpack200.anonymous
 468 else
 469   UNPACK_MAPFILE=$(JDK_TOPDIR)/makefiles/mapfiles/libunpack/mapfile-vers-unpack200
 470 endif
 471 
 472 $(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE,\
 473                 SRC:=$(JDK_TOPDIR)/src/share/native/com/sun/java/util/jar/pack,\
 474                 EXCLUDE_FILES:=jni.cpp,\
 475                 LANG:=$(UNPACKEXE_LANG),\
 476                 OPTIMIZATION:=LOW, \
 477                 CFLAGS:=$(UNPACKEXE_CFLAGS) $(CXXFLAGS_JDKEXE)\
 478                         -DFULL, \
 479                 CFLAGS_release:=-DPRODUCT,\
 480                 CFLAGS_linux:=-fPIC,\
 481                 CFLAGS_solaris:=-KPIC, \
 482                 CFLAGS_macosx:=-fPIC, \
 483                 MAPFILE:=$(UNPACK_MAPFILE),\
 484                 LDFLAGS:=$(UNPACKEXE_ZIPOBJS),\
 485                 LDFLAGS_windows:=$(CXXFLAGS_JDKEXE),\
 486                 LDFLAGS_posix:=$(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
 487                          $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)unpack$(SHARED_LIBRARY_SUFFIX)) \
 488                          $(call SET_SHARED_LIBRARY_ORIGIN),\
 489                 LDFLAGS_linux:=-lc,\
 490                 LDFLAGS_solaris:=$(UNPACKEXE_LDFLAGS_solaris) -lc,\
 491                 LDFLAGS_SUFFIX:=$(LIBCXX),\
 492                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/unpackexe$(OUTPUT_SUBDIR),\
 493                 OUTPUT_DIR:=$(JDK_OUTPUTDIR)/objs/unpackexe$(OUTPUT_SUBDIR),\
 494                 PROGRAM:=unpack200,\
 495                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
 496                 RC_FLAGS:=$(RC_FLAGS)\
 497                           -D "JDK_FNAME=unpack200.exe" \
 498                           -D "JDK_INTERNAL_NAME=unpack200" \
 499                           -D "JDK_FTYPE=0x1L",\
 500                 DEBUG_SYMBOLS:=true,\
 501                 MANIFEST:=$(JDK_TOPDIR)/src/windows/resource/unpack200_proto.exe.manifest))
 502 
 503 ifeq ($(OPENJDK_TARGET_OS),windows)