[asterisk-commits] Fixes for OS X (asterisk[13])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jun 5 13:20:39 CDT 2015


Joshua Colp has submitted this change and it was merged.

Change subject: Fixes for OS X
......................................................................


Fixes for OS X

 * Add some type casting so tv_usec can really be a long, instead of
   some strange platform specific type.

 * Add some .dylib style files to .gitignore.

 * Switch from using -Xlinker to -Wl,. For [reasons unknown][], newer
   versions of GCC, when compiling the Homebrew formula for Asterisk,
   are not properly passing the -Xlinker options to the linker. Given
   that -Wl, does exactly the [same thing][], and does it properly, this
   patch changes the -Xlinker options to use -Wl, instead.

 [reasons unknown]: http://bit.ly/1SUbEYx
 [same thing]: https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html

Change-Id: Id5e6b3c6cc86282ea5fca630dc3991137c5bf4dd
---
M Makefile
M codecs/gsm/Makefile
M main/.gitignore
M main/Makefile
M res/res_pjsip/pjsip_options.c
M utils/.gitignore
6 files changed, 7 insertions(+), 5 deletions(-)

Approvals:
  Mark Michelson: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Verified



diff --git a/Makefile b/Makefile
index 24347e4..8180a4f 100644
--- a/Makefile
+++ b/Makefile
@@ -261,10 +261,10 @@
 
 ifneq ($(findstring darwin,$(OSARCH)),)
   _ASTCFLAGS+=-D__Darwin__ -mmacosx-version-min=10.6
-  _SOLINK=-mmacosx-version-min=10.6 -Xlinker -undefined -Xlinker dynamic_lookup
+  _SOLINK=-mmacosx-version-min=10.6 -Wl,-undefined,dynamic_lookup
   _SOLINK+=/usr/lib/bundle1.o
   SOLINK=-bundle $(_SOLINK)
-  DYLINK=-Xlinker -dylib $(_SOLINK)
+  DYLINK=-Wl,-dylib $(_SOLINK)
   _ASTLDFLAGS+=-L/usr/local/lib
 else
 # These are used for all but Darwin
diff --git a/codecs/gsm/Makefile b/codecs/gsm/Makefile
index a072e6d..06f0829 100644
--- a/codecs/gsm/Makefile
+++ b/codecs/gsm/Makefile
@@ -315,7 +315,7 @@
 # The basic API: libgsm
 
 $(LIBGSMSO):	$(LIB) $(GSM_OBJECTS)
-		$(LD) -o $@.1.0.10 -shared -Xlinker -soname -Xlinker libgsm.so.1 $(GSM_OBJECTS) -lc
+		$(LD) -o $@.1.0.10 -shared -Wl,-soname,libgsm.so.1 $(GSM_OBJECTS) -lc
 		ln -fs libgsm.so.1.0.10 lib/libgsm.so.1
 		ln -fs libgsm.so.1.0.10 lib/libgsm.so
 
diff --git a/main/.gitignore b/main/.gitignore
index 23f5c58..3ff4656 100644
--- a/main/.gitignore
+++ b/main/.gitignore
@@ -1,3 +1,4 @@
 asterisk
 libasteriskssl.so.1
+libasteriskssl.dylib
 version.c
diff --git a/main/Makefile b/main/Makefile
index c0c0aff..2c4b576 100644
--- a/main/Makefile
+++ b/main/Makefile
@@ -60,7 +60,7 @@
 
 ifneq ($(findstring darwin,$(OSARCH)),)
   AST_LIBS+=-lresolv
-  ASTLINK=-mmacosx-version-min=10.6 -Xlinker -undefined -Xlinker dynamic_lookup -force_flat_namespace
+  ASTLINK=-mmacosx-version-min=10.6 -Wl,-undefined,dynamic_lookup -force_flat_namespace
   ASTLINK+=/usr/lib/bundle1.o
 else
 # These are used for all but Darwin
diff --git a/res/res_pjsip/pjsip_options.c b/res/res_pjsip/pjsip_options.c
index bc1e1ec..f888cc4 100644
--- a/res/res_pjsip/pjsip_options.c
+++ b/res/res_pjsip/pjsip_options.c
@@ -974,7 +974,7 @@
 {
 	const struct ast_sip_contact_status *status = obj;
 
-	if (ast_asprintf(buf, "%ld.%06ld", status->rtt_start.tv_sec, status->rtt_start.tv_usec) == -1) {
+	if (ast_asprintf(buf, "%ld.%06ld", (long)status->rtt_start.tv_sec, (long)status->rtt_start.tv_usec) == -1) {
 		return -1;
 	}
 
diff --git a/utils/.gitignore b/utils/.gitignore
index ed37a06..8e95c8d 100644
--- a/utils/.gitignore
+++ b/utils/.gitignore
@@ -9,6 +9,7 @@
 astdb2sqlite3
 check_expr
 check_expr2
+check_expr2.dSYM/
 conf2ael
 db1-ast/libdb1.a
 hashtab.c

-- 
To view, visit https://gerrit.asterisk.org/572
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id5e6b3c6cc86282ea5fca630dc3991137c5bf4dd
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: David M. Lee <dlee at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-commits mailing list