openbsd-ports/devel/pwlib/patches/patch-make_lib_mak
ajacoutot 7de7eeae8e - major upgrade to pwlib-1.12.0
- rework the way we handle shared_libs versus ptlib version so it stays
compatible with upstream
- install version.h
- dtmf decoder patch from FreeBSD
2008-03-15 17:38:07 +00:00

76 lines
2.3 KiB
Plaintext

$OpenBSD: patch-make_lib_mak,v 1.2 2008/03/15 17:38:07 ajacoutot Exp $
--- make/lib.mak.orig Fri Oct 19 08:22:33 2007
+++ make/lib.mak Mon Mar 3 14:23:51 2008
@@ -126,11 +126,22 @@
# Added copyright notice
#
+ifndef (LIB_MAJOR_VERSION)
+ LIB_MAJOR_VERSION = $(MAJOR_VERSION)
+endif
+
+ifndef (LIB_MINOR_VERSION)
+ LIB_MINOR_VERSION = $(MINOR_VERSION)
+endif
+
ifneq ($(OSTYPE),Darwin)
- LIBNAME_MAJ = $(LIB_FILENAME).$(MAJOR_VERSION)
- LIBNAME_MIN = $(LIBNAME_MAJ).$(MINOR_VERSION)
+ LIBNAME_MAJ = $(LIB_FILENAME).$(LIB_MAJOR_VERSION)
+ LIBNAME_MIN = $(LIBNAME_MAJ).$(LIB_MINOR_VERSION)
ifeq ($(BUILD_TYPE),.)
LIBNAME_PAT = $(LIBNAME_MIN).$(BUILD_NUMBER)
+ ifeq ($(OSTYPE),OpenBSD)
+ LIBNAME_PAT = $(LIBNAME_MIN)
+ endif
else
LIBNAME_PAT = $(LIBNAME_MIN)-$(BUILD_TYPE)$(BUILD_NUMBER)
endif
@@ -151,7 +162,7 @@ CLEAN_FILES += $(LIBDIR)/$(LIBNAME_PAT) $(LIBDIR)/$(LI
ifneq ($(P_SHAREDLIB),1)
STATIC_LIB_FILE = $(LIBDIR)/$(LIB_FILENAME)
else
- STATIC_LIB_FILE = $(LIBDIR)/$(subst .$(LIB_SUFFIX),_s.$(STATICLIBEXT),$(LIB_FILENAME))
+ STATIC_LIB_FILE = $(LIBDIR)/$(subst .$(LIB_SUFFIX),.$(STATICLIBEXT),$(LIB_FILENAME))
endif
$(LIBDIR)/$(LIB_FILENAME) : $(TARGETLIB)
@@ -178,7 +189,7 @@ ifeq ($(P_SHAREDLIB),1)
endif
ifneq ($(OSTYPE), QNX)
- ifneq (,$(findstring $(OSTYPE),FreeBSD OpenBSDs))
+ ifneq (,$(findstring $(OSTYPE),FreeBSD OpenBSD))
ifdef P_PTHREADS
EXTLIBS += -pthread
endif
@@ -207,10 +218,16 @@ ifeq ($(P_SHAREDLIB),1)
LD = $(CPLUS)
endif
+ ifeq ($(MACHTYPE),x86_64)
+ LDSOOPTS += -fPIC
+ endif
+
$(LIBDIR)/$(LIB_FILENAME): $(LIBDIR)/$(LIBNAME_PAT)
+ifneq ($(OSTYPE),OpenBSD)
cd $(LIBDIR) ; rm -f $(LIB_FILENAME) ; ln -sf $(LIBNAME_PAT) $(LIB_FILENAME)
cd $(LIBDIR) ; rm -f $(LIBNAME_MAJ) ; ln -sf $(LIBNAME_PAT) $(LIBNAME_MAJ)
cd $(LIBDIR) ; rm -f $(LIBNAME_MIN) ; ln -sf $(LIBNAME_PAT) $(LIBNAME_MIN)
+endif
$(LIBDIR)/$(LIBNAME_PAT): $(STATIC_LIB_FILE)
@echo EXTLIBS = $(EXTLIBS)
@@ -220,9 +237,11 @@ ifeq ($(P_SHAREDLIB),1)
install: $(LIBDIR)/$(LIBNAME_PAT)
$(INSTALL) $(LIBDIR)/$(LIBNAME_PAT) $(INSTALLLIB_DIR)/$(LIBNAME_PAT)
+ifneq ($(OSTYPE),OpenBSD)
ln -sf $(LIBNAME_PAT) $(INSTALLLIB_DIR)/$(LIB_FILENAME)
ln -sf $(LIBNAME_PAT) $(INSTALLLIB_DIR)/$(LIBNAME_MAJ)
ln -sf $(LIBNAME_PAT) $(INSTALLLIB_DIR)/$(LIBNAME_MIN)
+endif
endif # P_SHAREDLIB