make/common/NativeCompilation.gmk
changeset 58846 f9ac726ab347
parent 58361 ad863044567e
child 58921 d92acb18e300
equal deleted inserted replaced
58845:e492513d3630 58846:f9ac726ab347
   451     ifeq ($$($1_TYPE), LIBRARY)
   451     ifeq ($$($1_TYPE), LIBRARY)
   452       $1_TYPE := STATIC_LIBRARY
   452       $1_TYPE := STATIC_LIBRARY
   453     endif
   453     endif
   454   endif
   454   endif
   455 
   455 
       
   456   $$(call SetIfEmpty, $1_COMPILE_WITH_DEBUG_SYMBOLS, $$(COMPILE_WITH_DEBUG_SYMBOLS))
       
   457 
       
   458   # STATIC_LIBS is set from Main.gmk when building static versions of certain
       
   459   # native libraries.
       
   460   ifeq ($(STATIC_LIBS), true)
       
   461     $1_TYPE := STATIC_LIBRARY
       
   462     # The static versions need to be redirected to different output dirs, both
       
   463     # to not interfere with the main build as well as to not end up inside the
       
   464     # jmods.
       
   465     $1_OBJECT_DIR := $$($1_OBJECT_DIR)/static
       
   466     $1_OUTPUT_DIR := $$($1_OBJECT_DIR)
       
   467     # For release builds where debug symbols are configured to be moved to
       
   468     # separate debuginfo files, disable debug symbols for static libs instead.
       
   469     # We don't currently support this configuration and we don't want symbol
       
   470     # information in release builds unless explicitly asked to provide it.
       
   471     ifeq ($(DEBUG_LEVEL), release)
       
   472       ifeq ($(COPY_DEBUG_SYMBOLS), true)
       
   473         $1_COMPILE_WITH_DEBUG_SYMBOLS := false
       
   474       endif
       
   475     endif
       
   476   endif
       
   477 
   456   ifeq ($$($1_TYPE), EXECUTABLE)
   478   ifeq ($$($1_TYPE), EXECUTABLE)
   457     $1_PREFIX :=
   479     $1_PREFIX :=
   458     ifeq ($$($1_SUFFIX), )
   480     ifeq ($$($1_SUFFIX), )
   459       $1_SUFFIX := $(EXE_SUFFIX)
   481       $1_SUFFIX := $(EXE_SUFFIX)
   460     endif
   482     endif
   590     $1_EXTRA_CFLAGS += $$($1_CFLAGS_release)
   612     $1_EXTRA_CFLAGS += $$($1_CFLAGS_release)
   591     $1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)_release)
   613     $1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)_release)
   592     $1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS)_release)
   614     $1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS)_release)
   593     $1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS)_$(OPENJDK_TARGET_CPU)_release)
   615     $1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS)_$(OPENJDK_TARGET_CPU)_release)
   594   endif
   616   endif
       
   617   ifeq ($(STATIC_LIBS), true)
       
   618     $1_EXTRA_CFLAGS += $$(STATIC_LIBS_CFLAGS)
       
   619   endif
   595 
   620 
   596   # Pickup extra OPENJDK_TARGET_OS_TYPE and/or OPENJDK_TARGET_OS dependent variables for CXXFLAGS.
   621   # Pickup extra OPENJDK_TARGET_OS_TYPE and/or OPENJDK_TARGET_OS dependent variables for CXXFLAGS.
   597   $1_EXTRA_CXXFLAGS := $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS))
   622   $1_EXTRA_CXXFLAGS := $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS))
   598   ifneq ($(DEBUG_LEVEL), release)
   623   ifneq ($(DEBUG_LEVEL), release)
   599     # Pickup extra debug dependent variables for CXXFLAGS
   624     # Pickup extra debug dependent variables for CXXFLAGS
   603   else
   628   else
   604     $1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_release)
   629     $1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_release)
   605     $1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)_release)
   630     $1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)_release)
   606     $1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_release)
   631     $1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_release)
   607   endif
   632   endif
       
   633   ifeq ($(STATIC_LIBS), true)
       
   634     $1_EXTRA_CXXFLAGS += $$(STATIC_LIB_CFLAGS)
       
   635   endif
   608 
   636 
   609   # If no C++ flags are explicitly set, default to using the C flags.
   637   # If no C++ flags are explicitly set, default to using the C flags.
   610   # After that, we can set additional C++ flags that should not interfere
   638   # After that, we can set additional C++ flags that should not interfere
   611   # with the mechanism for copying the C flags by default.
   639   # with the mechanism for copying the C flags by default.
   612   ifeq ($$($1_CXXFLAGS), )
   640   ifeq ($$($1_CXXFLAGS), )
   614   endif
   642   endif
   615   ifeq ($$(strip $$($1_EXTRA_CXXFLAGS)), )
   643   ifeq ($$(strip $$($1_EXTRA_CXXFLAGS)), )
   616     $1_EXTRA_CXXFLAGS := $$($1_EXTRA_CFLAGS)
   644     $1_EXTRA_CXXFLAGS := $$($1_EXTRA_CFLAGS)
   617   endif
   645   endif
   618 
   646 
   619   ifeq ($(COMPILE_WITH_DEBUG_SYMBOLS), true)
   647   ifeq ($$($1_COMPILE_WITH_DEBUG_SYMBOLS), true)
   620     $1_EXTRA_CFLAGS += $$(CFLAGS_DEBUG_SYMBOLS)
   648     $1_EXTRA_CFLAGS += $$(CFLAGS_DEBUG_SYMBOLS)
   621     $1_EXTRA_CXXFLAGS += $$(CFLAGS_DEBUG_SYMBOLS)
   649     $1_EXTRA_CXXFLAGS += $$(CFLAGS_DEBUG_SYMBOLS)
   622     $1_EXTRA_ASFLAGS += $$(ASFLAGS_DEBUG_SYMBOLS)
   650     $1_EXTRA_ASFLAGS += $$(ASFLAGS_DEBUG_SYMBOLS)
   623   endif
   651   endif
   624 
   652