make/common/Library.gmk

Print this page




 228 $(LIBDIR)/$(LIBRARY).lib:: $(OBJDIR)/$(LIBRARY).lib
 229         $(install-file)
 230 
 231 $(LIBDIR)/$(LIBRARY).dll:: $(OBJDIR)/$(LIBRARY).dll
 232         $(install-file)
 233 
 234 endif # INSTALL_DOT_LIB
 235 
 236 else # PLATFORM
 237 
 238 #
 239 # On Solaris, use mcs to write the version into the comment section of
 240 # the shared library.  On other platforms set this to false at the
 241 # make command line.
 242 #
 243 
 244 ifneq ($(PLATFORM), macosx)
 245   ARFLAGS = -r
 246 endif
 247 






 248 $(ACTUAL_LIBRARY):: $(COMPILE_FILES_o) $(FILES_m) $(FILES_reorder)
 249         @$(prep-target)
 250         @$(ECHO) "STATS: LIBRARY=$(LIBRARY), PRODUCT=$(PRODUCT), OPTIMIZATION_LEVEL=$(OPTIMIZATION_LEVEL)"
 251         @$(ECHO) "Rebuilding $@ because of $?"
 252 ifeq ($(LIBRARY), fdlibm)
 253         $(AR) $(ARFLAGS) $@ $(FILES_o)
 254 else # LIBRARY
 255         $(LINKER) $(SHARED_LIBRARY_FLAG) -o $@ $(FILES_o) $(LDLIBS)
 256         @$(call binary_file_verification,$@)
 257 ifeq ($(WRITE_LIBVERSION),true)
 258         $(MCS) -d -a "$(FULL_VERSION)" $@
 259 endif # WRITE_LIBVERSION
 260   ifneq ($(PLATFORM), macosx)
 261     ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 262       ifeq ($(LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS),1)










 263         (set -e ; \
 264          $(CD) $(@D) ; \
 265          $(OBJCOPY) --only-keep-debug $(@F) $(LIBRARY).debuginfo ; \
 266          $(OBJCOPY) --add-gnu-debuglink=$(LIBRARY).debuginfo $(@F) ; \

 267         )







 268         ifeq ($(STRIP_POLICY),all_strip)
 269           $(STRIP) $@
 270         else
 271           ifeq ($(STRIP_POLICY),min_strip)
 272             ifeq ($(PLATFORM), solaris)
 273               $(STRIP) -x $@
 274             else
 275               # assume Linux
 276               $(STRIP) -g $@
 277             endif
 278           # implied else here is no stripping at all
 279           endif
 280         endif
 281         ifeq ($(ZIP_DEBUGINFO_FILES),1)
 282           (set -e ; \
 283            $(CD) $(@D) ; \
 284            $(ZIPEXE) -q $(LIBRARY).diz $(LIBRARY).debuginfo ; \
 285            $(RM) $(LIBRARY).debuginfo ; \
 286           )
 287         endif
 288       endif # LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS
 289     endif # ENABLE_FULL_DEBUG_SYMBOLS
 290   endif # PLATFORM-!macosx
 291 endif # LIBRARY
 292 
 293 endif # PLATFORM
 294 
 295 #
 296 # Cross check all linted files against each other
 297 #
 298 ifeq ($(PLATFORM),solaris)
 299 lint.errors : $(FILES_ln)
 300         $(LINT.c) $(FILES_ln) $(LDLIBS) 
 301 endif
 302 
 303 #
 304 # Class libraries with JNI native methods get a include to the package.
 305 #




 228 $(LIBDIR)/$(LIBRARY).lib:: $(OBJDIR)/$(LIBRARY).lib
 229         $(install-file)
 230 
 231 $(LIBDIR)/$(LIBRARY).dll:: $(OBJDIR)/$(LIBRARY).dll
 232         $(install-file)
 233 
 234 endif # INSTALL_DOT_LIB
 235 
 236 else # PLATFORM
 237 
 238 #
 239 # On Solaris, use mcs to write the version into the comment section of
 240 # the shared library.  On other platforms set this to false at the
 241 # make command line.
 242 #
 243 
 244 ifneq ($(PLATFORM), macosx)
 245   ARFLAGS = -r
 246 endif
 247 
 248 ifeq ($(PLATFORM), solaris)
 249   ifeq ($(LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS),1)
 250 $(ACTUAL_LIBRARY):: $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS)
 251   endif
 252 endif
 253 
 254 $(ACTUAL_LIBRARY):: $(COMPILE_FILES_o) $(FILES_m) $(FILES_reorder)
 255         @$(prep-target)
 256         @$(ECHO) "STATS: LIBRARY=$(LIBRARY), PRODUCT=$(PRODUCT), OPTIMIZATION_LEVEL=$(OPTIMIZATION_LEVEL)"
 257         @$(ECHO) "Rebuilding $@ because of $?"
 258 ifeq ($(LIBRARY), fdlibm)
 259         $(AR) $(ARFLAGS) $@ $(FILES_o)
 260 else # LIBRARY
 261         $(LINKER) $(SHARED_LIBRARY_FLAG) -o $@ $(FILES_o) $(LDLIBS)
 262         @$(call binary_file_verification,$@)
 263 ifeq ($(WRITE_LIBVERSION),true)
 264         $(MCS) -d -a "$(FULL_VERSION)" $@
 265 endif # WRITE_LIBVERSION
 266   ifneq ($(PLATFORM), macosx)
 267     ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 268       ifeq ($(LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS),1)
 269         ifeq ($(PLATFORM), solaris)
 270 # gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
 271 # Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from
 272 # empty section headers until a fixed $(OBJCOPY) is available.
 273 # An empty section header has sh_addr == 0 and sh_size == 0.
 274 # This problem has only been seen on Solaris X64, but we call this tool
 275 # on all Solaris builds just in case.
 276 #
 277 # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
 278 # Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
 279         (set -e ; \
 280          $(CD) $(@D) ; \
 281          $(FIX_EMPTY_SEC_HDR_FLAGS) $(@F) ; \
 282          $(OBJCOPY) --only-keep-debug $(@F) $(LIB_PREFIX)$(LIBRARY).debuginfo ; \
 283          $(ADD_GNU_DEBUGLINK) $(LIB_PREFIX)$(LIBRARY).debuginfo $(@F) ; \
 284         )
 285         else # PLATFORM != solaris
 286         (set -e ; \
 287          $(CD) $(@D) ; \
 288          $(OBJCOPY) --only-keep-debug $(@F) $(LIB_PREFIX)$(LIBRARY).debuginfo ; \
 289          $(OBJCOPY) --add-gnu-debuglink=$(LIB_PREFIX)$(LIBRARY).debuginfo $(@F) ; \
 290         )
 291         endif # PLATFORM == solaris
 292         ifeq ($(STRIP_POLICY),all_strip)
 293           $(STRIP) $@
 294         else
 295           ifeq ($(STRIP_POLICY),min_strip)
 296             ifeq ($(PLATFORM), solaris)
 297               $(STRIP) -x $@
 298             else
 299               # assume Linux
 300               $(STRIP) -g $@
 301             endif
 302           # implied else here is no stripping at all
 303           endif
 304         endif
 305         ifeq ($(ZIP_DEBUGINFO_FILES),1)
 306           (set -e ; \
 307            $(CD) $(@D) ; \
 308            $(ZIPEXE) -q $(LIB_PREFIX)$(LIBRARY).diz $(LIB_PREFIX)$(LIBRARY).debuginfo ; \
 309            $(RM) $(LIB_PREFIX)$(LIBRARY).debuginfo ; \
 310           )
 311         endif
 312       endif # LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS
 313     endif # ENABLE_FULL_DEBUG_SYMBOLS
 314   endif # PLATFORM-!macosx
 315 endif # LIBRARY
 316 
 317 endif # PLATFORM
 318 
 319 #
 320 # Cross check all linted files against each other
 321 #
 322 ifeq ($(PLATFORM),solaris)
 323 lint.errors : $(FILES_ln)
 324         $(LINT.c) $(FILES_ln) $(LDLIBS) 
 325 endif
 326 
 327 #
 328 # Class libraries with JNI native methods get a include to the package.
 329 #