[asterisk-commits] kpfleming: branch kpfleming/libasteriskssl r352518 - in /team/kpfleming/libas...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jan 25 10:56:45 CST 2012


Author: kpfleming
Date: Wed Jan 25 10:56:42 2012
New Revision: 352518

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=352518
Log:
Add support for producing a Darwin 'dylib' of libasteriskssl.

Linker flags and other bits provided by Tilghman Lesher via email.


Modified:
    team/kpfleming/libasteriskssl/Makefile
    team/kpfleming/libasteriskssl/main/Makefile

Modified: team/kpfleming/libasteriskssl/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/kpfleming/libasteriskssl/Makefile?view=diff&rev=352518&r1=352517&r2=352518
==============================================================================
--- team/kpfleming/libasteriskssl/Makefile (original)
+++ team/kpfleming/libasteriskssl/Makefile Wed Jan 25 10:56:42 2012
@@ -19,8 +19,10 @@
 # _ASTLDFLAGS - linker flags (not libraries) provided by the build system
 # LIBS - additional libraries, at top-level for all links,
 #      on a single object just for that object
-# SOLINK - linker flags used only for creating shared objects (.so files),
-#      used for all .so links
+# SOLINK - linker flags used only for creating dynamically loadable modules
+#          as .so files
+# DYLINK - linker flags used only for creating shared libaries
+#          (.so files on Unix-type platforms, .dylib on Darwin)
 #
 # Values for ASTCFLAGS and ASTLDFLAGS can be specified in the
 # environment when running make, as follows:
@@ -71,7 +73,9 @@
 export AST_DEVMODE		# Set to "yes" for additional compiler
                                 # and runtime checks
 
-export SOLINK			# linker flags for shared objects
+export _SOLINK			# linker flags for all shared objects
+export SOLINK			# linker flags for loadable modules
+export DYLINK			# linker flags for shared libraries
 export STATIC_BUILD		# Additional cflags, set to -static
                                 # for static builds. Probably
                                 # should go directly to ASTLDFLAGS
@@ -292,14 +296,17 @@
 
 ifneq ($(findstring darwin,$(OSARCH)),)
   _ASTCFLAGS+=-D__Darwin__
-  SOLINK=-bundle -Xlinker -macosx_version_min -Xlinker 10.4 -Xlinker -undefined -Xlinker dynamic_lookup -force_flat_namespace
+  _SOLINK=-Xlinker -macosx_version_min -Xlinker 10.4 -Xlinker -undefined -Xlinker dynamic_lookup -force_flat_namespace
   ifeq ($(shell if test `/usr/bin/sw_vers -productVersion | cut -c4` -gt 5; then echo 6; else echo 0; fi),6)
-    SOLINK+=/usr/lib/bundle1.o
+    _SOLINK+=/usr/lib/bundle1.o
   endif
+  SOLINK=-bundle $(_SOLINK)
+  DYLINK=-Xlinker -dylib $(_SOLINK)
   _ASTLDFLAGS+=-L/usr/local/lib
 else
 # These are used for all but Darwin
   SOLINK=-shared
+  DYLINK=$(SOLINK)
   ifneq ($(findstring BSD,$(OSARCH)),)
     _ASTLDFLAGS+=-L/usr/local/lib
   endif
@@ -307,10 +314,12 @@
 
 ifeq ($(OSARCH),SunOS)
   SOLINK=-shared -fpic -L/usr/local/ssl/lib -lrt
+  DYLINK=$(SOLINK)
 endif
 
 ifeq ($(OSARCH),OpenBSD)
   SOLINK=-shared -fpic
+  DYLINK=$(SOLINK)
 endif
 
 # comment to print directories during submakes

Modified: team/kpfleming/libasteriskssl/main/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/kpfleming/libasteriskssl/main/Makefile?view=diff&rev=352518&r1=352517&r2=352518
==============================================================================
--- team/kpfleming/libasteriskssl/main/Makefile (original)
+++ team/kpfleming/libasteriskssl/main/Makefile Wed Jan 25 10:56:42 2012
@@ -198,6 +198,7 @@
 $(ASTSSL_LIB).$(ASTSSL_SO_VERSION): _ASTCFLAGS+=-fPIC -DAST_MODULE=\"asteriskssl\"
 $(ASTSSL_LIB).$(ASTSSL_SO_VERSION): LIBS+=$(ASTSSL_LIBS)
 $(ASTSSL_LIB).$(ASTSSL_SO_VERSION): SO_SUPPRESS_SYMBOLS=-Wl,--version-script,libasteriskssl.exports,--warn-common
+$(ASTSSL_LIB).$(ASTSSL_SO_VERSION): SOLINK=$(DYLINK)
 
 # These rules are duplicated from $(ASTTOPDIR)/Makefile.rules because the library name
 # being built does not match the "%.so" pattern; there are also additional steps
@@ -217,6 +218,16 @@
 	$(LN) -sf $< $@
 
 else # Darwin
+ASTSSL_LIB:=libasteriskssl.dylib
+
+$(ASTSSL_LIB): _ASTCFLAGS+=-fPIC -DAST_MODULE=\"asteriskssl\"
+$(ASTSSL_LIB): LIBS+=$(ASTSSL_LIBS)
+$(ASTSSL_LIB): SOLINK=$(DYLINK)
+
+# Special rules for building a shared library (not a dynamically loadable module)
+$(ASTSSL_LIB): libasteriskssl.o
+	$(ECHO_PREFIX) echo "   [LD] $^ -> $@"
+	$(CMD_PREFIX) $(CC) $(STATIC_BUILD) -o $@ $(CC_LDFLAGS_SO) $^ $(CC_LIBS)
 endif
 
 endif




More information about the asterisk-commits mailing list