Ignore:
Timestamp:
Nov 23, 2013 7:13:40 AM (11 years ago)
Author:
bennylp
Message:

Fixed #1713: Enable building the libraries as shared libraries/DLLs for GNU targets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/third_party/build/resample/Makefile

    r3999 r4656  
    2222export RESAMPLE_CFLAGS = $(_CFLAGS) 
    2323 
    24 SHLIB_NAME := libresample.$(SHLIB_SUFFIX) 
    25 export RESAMPLE_SHLIB := ../../lib/$(SHLIB_NAME).$(PJ_VERSION_MAJOR) 
    26 export RESAMPLE_LIB := ../../lib/libresample-$(TARGET_NAME)$(LIBEXT) 
     24export RESAMPLE_LIB := libresample-$(TARGET_NAME)$(LIBEXT) 
     25 
     26ifeq ($(PJ_SHARED_LIBRARIES),) 
     27else 
     28export RESAMPLE_SONAME := libresample.$(SHLIB_SUFFIX) 
     29export RESAMPLE_SHLIB := $(RESAMPLE_SONAME).$(PJ_VERSION_MAJOR) 
     30endif 
    2731 
    2832export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT  
     
    3236# $(TARGET) is defined in os-$(OS_NAME).mak file in current directory. 
    3337# 
    34 ifeq ($(PJ_RESAMPLE_DLL),1) 
    35 TARGETS := ../../lib/$(SHLIB_NAME) 
    36 ifeq ($(SHLIB_SUFFIX),so) 
    37 SHLIB_OPT := -Wl,-soname,$(SHLIB_NAME).$(PJ_VERSION_MAJOR) 
     38TARGETS := $(RESAMPLE_LIB) $(RESAMPLE_SONAME) 
     39ifneq ($(PJ_SHARED_LIBRARIES),) 
    3840else 
    39 SHLIB_OPT :=  
     41ifneq ($(PJ_RESAMPLE_DLL),) 
     42export RESAMPLE_CFLAGS := -fPIC $(RESAMPLE_CFLAGS) 
    4043endif 
    41 export RESAMPLE_CFLAGS := -fPIC $(RESAMPLE_CFLAGS) 
    42 export RESAMPLE_LDFLAGS := -shared $(SHLIB_OPT) $(RESAMPLE_LDFLAGS) 
    43 else 
    44 TARGETS := libresample 
    4544endif 
    4645 
     
    5352distclean: realclean 
    5453 
    55 .PHONY: dep depend libresample clean realclean distclean 
     54.PHONY: all dep depend clean realclean distclean 
     55.PHONY: $(TARGETS) 
     56.PHONY: $(RESAMPLE_LIB) $(RESAMPLE_SONAME) 
    5657 
    57 libresample: 
    58         $(MAKE) -f $(RULES_MAK) APP=RESAMPLE app=libresample $(RESAMPLE_LIB) 
     58dep: depend 
    5959 
    60 ../../lib/$(SHLIB_NAME): $(RESAMPLE_SHLIB) 
    61         ln -s $(SHLIB_NAME).$(PJ_VERSION_MAJOR) $@ 
     60libresample: $(RESAMPLE_LIB) 
     61$(RESAMPLE_SONAME): $(RESAMPLE_LIB) 
     62$(RESAMPLE_LIB) $(RESAMPLE_SONAME): 
     63        $(MAKE) -f $(RULES_MAK) APP=RESAMPLE app=libresample $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) 
    6264 
    63 $(RESAMPLE_SHLIB): 
    64         $(MAKE) -f $(RULES_MAK) APP=RESAMPLE app=libresample $(RESAMPLE_SHLIB) 
    65          
    6665clean print_lib: 
    6766        $(MAKE) -f $(RULES_MAK) APP=RESAMPLE app=libresample $@ 
    6867 
    6968realclean: 
    70         $(subst @@,$(subst /,$(HOST_PSEP),../../lib/$(SHLIB_NAME)),$(HOST_RMR)) 
    71         $(subst @@,$(subst /,$(HOST_PSEP),$(RESAMPLE_SHLIB)),$(HOST_RMR)) 
    7269        $(MAKE) -f $(RULES_MAK) APP=RESAMPLE app=libresample $@ 
    7370 
Note: See TracChangeset for help on using the changeset viewer.