summaryrefslogtreecommitdiff
path: root/pjlib
diff options
context:
space:
mode:
authorJason Parker <jparker@digium.com>2013-03-11 15:49:45 -0500
committerJason Parker <jparker@digium.com>2013-03-11 15:49:45 -0500
commit09114052f74fe74bbf652189cedefe41b7141b86 (patch)
tree6814977399b53176a53efc7ef5dffda1643b9d27 /pjlib
parent1873b7a03a08b00140610d531bb6c0bb71e0e91a (diff)
parent1ab0bfe2d710db21587a9bf6c01b2392d5bd8ac7 (diff)
Merge branch 'patch/shared-libraries' of github.com:asterisk/pjproject
Conflicts: aconfigure build/rules.mak
Diffstat (limited to 'pjlib')
-rw-r--r--pjlib/build/Makefile51
-rw-r--r--pjlib/build/os-auto.mak.in2
-rw-r--r--pjlib/build/os-darwinos.mak2
-rw-r--r--pjlib/build/os-linux-kernel.mak2
-rw-r--r--pjlib/build/os-linux.mak2
-rw-r--r--pjlib/build/os-rtems.mak2
-rw-r--r--pjlib/build/os-sunos.mak2
-rw-r--r--pjlib/build/os-win32.mak2
8 files changed, 39 insertions, 26 deletions
diff --git a/pjlib/build/Makefile b/pjlib/build/Makefile
index 272206d..9b70994 100644
--- a/pjlib/build/Makefile
+++ b/pjlib/build/Makefile
@@ -2,10 +2,18 @@ include ../../build.mak
include ../../version.mak
include $(PJDIR)/build/common.mak
+export LIBDIR := ../lib
+export BINDIR := ../bin
+
RULES_MAK := $(PJDIR)/build/rules.mak
+export PJLIB_LIB := libpj-$(TARGET_NAME)$(LIBEXT)
-export PJLIB_LIB := ../lib/libpj-$(TARGET_NAME)$(LIBEXT)
+ifeq ($(PJ_SHARED_LIBRARIES),)
+else
+export PJLIB_SONAME := libpj.$(SHLIB_SUFFIX)
+export PJLIB_SHLIB := $(PJLIB_SONAME).$(PJ_VERSION_MAJOR)
+endif
###############################################################################
# Gather all flags.
@@ -14,9 +22,9 @@ export _CFLAGS := $(CC_CFLAGS) $(OS_CFLAGS) $(HOST_CFLAGS) $(M_CFLAGS) \
$(CFLAGS) $(CC_INC)../include
export _CXXFLAGS:= $(_CFLAGS) $(CC_CXXFLAGS) $(OS_CXXFLAGS) $(M_CXXFLAGS) \
$(HOST_CXXFLAGS) $(CXXFLAGS)
-export _LDFLAGS := $(subst /,$(HOST_PSEP),$(PJLIB_LIB)) \
- $(CC_LDFLAGS) $(OS_LDFLAGS) $(M_LDFLAGS) $(HOST_LDFLAGS) \
- $(LDFLAGS)
+export _LDFLAGS := $(CC_LDFLAGS) $(OS_LDFLAGS) $(M_LDFLAGS) $(HOST_LDFLAGS) \
+ $(APP_LDFLAGS) $(LDFLAGS)
+
###############################################################################
# Defines for building PJLIB library
@@ -30,6 +38,7 @@ export PJLIB_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \
ssl_sock_common.o ssl_sock_ossl.o ssl_sock_dump.o \
string.o timer.o types.o
export PJLIB_CFLAGS += $(_CFLAGS)
+export PJLIB_LDFLAGS += $(_LDFLAGS)
###############################################################################
# Defines for building test application
@@ -44,10 +53,10 @@ export TEST_OBJS += activesock.o atomic.o echo_clt.o errno.o exception.o \
udp_echo_srv_sync.o udp_echo_srv_ioqueue.o \
util.o
export TEST_CFLAGS += $(_CFLAGS)
-export TEST_LDFLAGS += $(_LDFLAGS)
-export TEST_EXE := ../bin/pjlib-test-$(TARGET_NAME)$(HOST_EXE)
+export TEST_LDFLAGS += $(PJLIB_LDLIB) $(_LDFLAGS)
+export TEST_EXE := pjlib-test-$(TARGET_NAME)$(HOST_EXE)
+
-
export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT
###############################################################################
# Main entry
@@ -74,34 +83,38 @@ print:
depend: ../include/pj/config_site.h
$(MAKE) -f $(RULES_MAK) APP=PJLIB app=pjlib depend
$(MAKE) -f $(RULES_MAK) APP=TEST app=pjlib-test depend
- echo '$(TEST_EXE): $(PJLIB_LIB)' >> .pjlib-test-$(TARGET_NAME).depend
+ echo '$(BINDIR)/$(TEST_EXE): $(LIBDIR)/$(PJLIB_LIB)' >> .pjlib-test-$(TARGET_NAME).depend
-.PHONY: dep depend clean realclean distclean
+.PHONY: all dep depend clean realclean distclean
.PHONY: $(TARGETS)
-.PHONY: $(PJLIB_LIB) $(TEST_EXE)
+.PHONY: $(PJLIB_LIB) $(PJLIB_SONAME)
+.PHONY: $(TEST_EXE)
dep: depend
pjlib: $(PJLIB_LIB)
$(PJLIB_LIB): ../include/pj/config_site.h
- $(MAKE) -f $(RULES_MAK) APP=PJLIB app=pjlib $(PJLIB_LIB)
+
+$(PJLIB_SONAME): $(PJLIB_LIB)
+$(PJLIB_LIB) $(PJLIB_SONAME):
+ $(MAKE) -f $(RULES_MAK) APP=PJLIB app=pjlib $(subst /,$(HOST_PSEP),$(LIBDIR)/$@)
../include/pj/config_site.h:
touch ../include/pj/config_site.h
pjlib-test: $(TEST_EXE)
-$(TEST_EXE): $(PJLIB_LIB)
- $(MAKE) -f $(RULES_MAK) APP=TEST app=pjlib-test $(TEST_EXE)
+$(TEST_EXE): $(PJLIB_LIB) $(PJLIB_SONAME)
+ $(MAKE) -f $(RULES_MAK) APP=TEST app=pjlib-test $(subst /,$(HOST_PSEP),$(BINDIR)/$@)
-.PHONY: ../lib/pjlib.ko
-../lib/pjlib.ko:
+.PHONY: pjlib.ko
+pjlib.ko:
echo Making $@
- $(MAKE) -f $(RULES_MAK) APP=PJLIB app=pjlib $@
+ $(MAKE) -f $(RULES_MAK) APP=PJLIB app=pjlib $(subst /,$(HOST_PSEP),$(LIBDIR)/$@)
-.PHONY: ../lib/pjlib-test.ko
-../lib/pjlib-test.ko:
- $(MAKE) -f $(RULES_MAK) APP=TEST app=pjlib-test $@
+.PHONY: pjlib-test.ko
+pjlib-test.ko:
+ $(MAKE) -f $(RULES_MAK) APP=TEST app=pjlib-test $(subst /,$(HOST_PSEP),$(LIBDIR)/$@)
clean:
$(MAKE) -f $(RULES_MAK) APP=PJLIB app=pjlib clean
diff --git a/pjlib/build/os-auto.mak.in b/pjlib/build/os-auto.mak.in
index a4a2b8a..3f35dce 100644
--- a/pjlib/build/os-auto.mak.in
+++ b/pjlib/build/os-auto.mak.in
@@ -29,7 +29,7 @@ export TEST_LDFLAGS += @LDFLAGS@ @LIBS@
# TARGETS are make targets in the Makefile, to be executed for this given
# operating system.
#
-export TARGETS = pjlib pjlib-test
+export TARGETS = $(PJLIB_LIB) $(PJLIB_SONAME) $(TEST_EXE)
diff --git a/pjlib/build/os-darwinos.mak b/pjlib/build/os-darwinos.mak
index ee83dec..a0d99e7 100644
--- a/pjlib/build/os-darwinos.mak
+++ b/pjlib/build/os-darwinos.mak
@@ -33,5 +33,5 @@ export TEST_LDFLAGS += -lm
# TARGETS are make targets in the Makefile, to be executed for this given
# operating system.
#
-export TARGETS = pjlib pjlib-test
+export TARGETS = $(PJLIB_LIB) $(PJLIB_SONAME) $(TEST_EXE)
diff --git a/pjlib/build/os-linux-kernel.mak b/pjlib/build/os-linux-kernel.mak
index 934c889..28cfbc7 100644
--- a/pjlib/build/os-linux-kernel.mak
+++ b/pjlib/build/os-linux-kernel.mak
@@ -42,6 +42,6 @@ export TEST_LDFLAGS += -lgcc
# TARGETS are make targets in the Makefile, to be executed for this given
# operating system.
#
-export TARGETS := ../lib/pjlib.ko ../lib/pjlib-test.ko
+export TARGETS := pjlib.ko pjlib-test.ko
diff --git a/pjlib/build/os-linux.mak b/pjlib/build/os-linux.mak
index 11c6fa7..78123ef 100644
--- a/pjlib/build/os-linux.mak
+++ b/pjlib/build/os-linux.mak
@@ -35,5 +35,5 @@ export TEST_LDFLAGS += -lm
# TARGETS are make targets in the Makefile, to be executed for this given
# operating system.
#
-export TARGETS = pjlib pjlib-test
+export TARGETS = $(PJLIB_LIB) $(PJLIB_SONAME) $(TEST_EXE)
diff --git a/pjlib/build/os-rtems.mak b/pjlib/build/os-rtems.mak
index 1501dd9..30a81f9 100644
--- a/pjlib/build/os-rtems.mak
+++ b/pjlib/build/os-rtems.mak
@@ -40,7 +40,7 @@ export TEST_LDFLAGS +=
# TARGETS are make targets in the Makefile, to be executed for this given
# operating system.
#
-export TARGETS = pjlib pjlib-test
+export TARGETS = $(PJLIB_LIB) $(TEST_EXE)
diff --git a/pjlib/build/os-sunos.mak b/pjlib/build/os-sunos.mak
index f0043ad..7aa658d 100644
--- a/pjlib/build/os-sunos.mak
+++ b/pjlib/build/os-sunos.mak
@@ -32,5 +32,5 @@ export TEST_LDFLAGS += -lm
# TARGETS are make targets in the Makefile, to be executed for this given
# operating system.
#
-export TARGETS = pjlib pjlib-test
+export TARGETS = $(PJLIB_LIB) $(PJLIB_SONAME) $(TEST_EXE)
diff --git a/pjlib/build/os-win32.mak b/pjlib/build/os-win32.mak
index 0290fea..5be3c8e 100644
--- a/pjlib/build/os-win32.mak
+++ b/pjlib/build/os-win32.mak
@@ -29,5 +29,5 @@ export TEST_OBJS += main.o
# TARGETS are make targets in the Makefile, to be executed for this given
# operating system.
#
-export TARGETS = pjlib pjlib-test
+export TARGETS = $(PJLIB_LIB) $(TEST_EXE)