X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=mk%2Frte.sharelib.mk;h=7bb72194b4033677fcce2f7f6369bcd0a9fe5b9c;hb=338af1171c7749802fcb7702e05adc945e0aec3b;hp=429309fc3aab888fc8cdfe8f7c80847223db0ecc;hpb=d82493c881c7cf1a7bcd6955a9f427b6291a41e5;p=dpdk.git diff --git a/mk/rte.sharelib.mk b/mk/rte.sharelib.mk index 429309fc3a..7bb72194b4 100644 --- a/mk/rte.sharelib.mk +++ b/mk/rte.sharelib.mk @@ -1,12 +1,12 @@ # BSD LICENSE -# +# # Copyright(c) 2010-2014 Intel Corporation. All rights reserved. # All rights reserved. -# +# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: -# +# # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright @@ -16,7 +16,7 @@ # * Neither the name of Intel Corporation nor the names of its # contributors may be used to endorse or promote products derived # from this software without specific prior written permission. -# +# # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -29,11 +29,13 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +include $(RTE_SDK)/mk/internal/rte.build-pre.mk + # VPATH contains at least SRCDIR VPATH += $(SRCDIR) -ifeq ($(RTE_BUILD_COMBINE_LIBS),y) -ifeq ($(RTE_BUILD_SHARED_LIB),y) +ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),y) +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) LIB_ONE := lib$(RTE_LIBNAME).so else LIB_ONE := lib$(RTE_LIBNAME).a @@ -45,7 +47,16 @@ sharelib: $(LIB_ONE) FORCE OBJS = $(wildcard $(RTE_OUTPUT)/build/lib/*.o) -O_TO_S = $(LD) $(CPU_LDFLAGS) -shared $(OBJS) -o $(RTE_OUTPUT)/lib/$(LIB_ONE) +ifeq ($(LINK_USING_CC),1) +# Override the definition of LD here, since we're linking with CC +LD := $(CC) $(CPU_CFLAGS) +O_TO_S = $(LD) $(call linkerprefix,$(CPU_LDFLAGS)) \ + -shared $(OBJS) -o $(RTE_OUTPUT)/lib/$(LIB_ONE) +else +O_TO_S = $(LD) $(CPU_LDFLAGS) \ + -shared $(OBJS) -o $(RTE_OUTPUT)/lib/$(LIB_ONE) +endif + O_TO_S_STR = $(subst ','\'',$(O_TO_S)) #'# fix syntax highlight O_TO_S_DISP = $(if $(V),"$(O_TO_S_STR)"," LD $(@)") O_TO_S_CMD = "cmd_$@ = $(O_TO_S_STR)" @@ -64,8 +75,8 @@ O_TO_A_DO = @set -e; \ # Archive objects to share library # -ifeq ($(RTE_BUILD_COMBINE_LIBS),y) -ifeq ($(RTE_BUILD_SHARED_LIB),y) +ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),y) +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) $(LIB_ONE): FORCE @[ -d $(dir $@) ] || mkdir -p $(dir $@) $(O_TO_S_DO)