[Asterisk-code-review] pjproject/Makefile: Updates for Darwin compatible builds (...asterisk[master])

Matt Jordan asteriskteam at digium.com
Thu May 2 14:03:11 CDT 2019


Matt Jordan has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/11338


Change subject: pjproject/Makefile: Updates for Darwin compatible builds
......................................................................

pjproject/Makefile: Updates for Darwin compatible builds

This patch fixes three compatibility issues for Darwin compatible builds:

(1) Use BSD compatible command line option for sed

For some versions of BSD sed, the -r command line option is unknown.
Both GNU and BSD sed support the -E command line option for enabling
extended regular expressions; as such, this patch replaces the -r
option with -E.

(2) Look for '_' in pjproject generated symbols

In Darwin comaptible systems, the symbols generated for pjproject may be
prefixed with an '_'. When exporting these to a symbol file, the invocation
to sed has to optionally look for a prefix of said '_' character.

(3) Use -all_load/-noall_load when linking

The flags -whole-archive/-no-whole-archive are not supported by the
linker, and must instead be replaced with -all_load/-noall_load.

Change-Id: I58121756de6a0560a6e49ca9d6bf9566a333cde3
---
M third-party/pjproject/Makefile
1 file changed, 7 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/38/11338/1

diff --git a/third-party/pjproject/Makefile b/third-party/pjproject/Makefile
index 97835e4..a591b48 100644
--- a/third-party/pjproject/Makefile
+++ b/third-party/pjproject/Makefile
@@ -63,7 +63,12 @@
             CF += -DPJPROJECT_BUNDLED_ASSERTIONS=yes
         endif
         MALLOC_DEBUG_LIBS = source/pjsip-apps/lib/libasterisk_malloc_debug.a
-        MALLOC_DEBUG_LDFLAGS = -L$(PJDIR)/pjsip-apps/lib -Wl,-whole-archive -lasterisk_malloc_debug -Wl,-no-whole-archive
+        ifneq ($(findstring darwin,$(OSARCH)),)
+            MALLOC_DEBUG_LDFLAGS = -L$(PJDIR)/pjsip-apps/lib -Wl,-all_load -lasterisk_malloc_debug -Wl,-noall_load
+        else
+             # These are used for all but Darwin
+            MALLOC_DEBUG_LDFLAGS = -L$(PJDIR)/pjsip-apps/lib -Wl,-whole-archive -lasterisk_malloc_debug -Wl,-no-whole-archive
+        endif
         ifeq ($(findstring DONT_OPTIMIZE,$(MENUSELECT_CFLAGS)),)
             CF += -O3
         endif
@@ -153,7 +158,7 @@
 
 pjproject.symbols: $(ALL_LIB_FILES)
 	$(ECHO_PREFIX) Generating symbols
-	$(CMD_PREFIX) $(NM) -Pog $(ALL_LIB_FILES) | $(SED) -n -r -e "s/.+: ([pP][jJ][^ ]+) .+/\1/gp" | sort -u > pjproject.symbols
+	$(CMD_PREFIX) $(NM) -Pog $(ALL_LIB_FILES) | $(SED) -n -E -e "s/.+: ([_]?[pP][jJ][^ ]+) .+/\1/gp" | sort -u > pjproject.symbols
 
 source/pjsip-apps/src/asterisk_malloc_debug.c: patches/asterisk_malloc_debug.c
 	$(ECHO_PREFIX) Copying $< to $@

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/11338
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I58121756de6a0560a6e49ca9d6bf9566a333cde3
Gerrit-Change-Number: 11338
Gerrit-PatchSet: 1
Gerrit-Owner: Matt Jordan <mjordan at digium.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190502/d7ef6079/attachment.html>


More information about the asterisk-code-review mailing list