[svn-commits] kpfleming: branch kpfleming/libasteriskssl r352233 - in /team/kpfleming/libas...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Jan 23 14:51:50 CST 2012


Author: kpfleming
Date: Mon Jan 23 14:51:46 2012
New Revision: 352233

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=352233
Log:
Add SONAME versioning to libasteriskssl.so.

* Also clean up trailing whitespace in top-level Makefile.

* Correct configure script searching for 'sha1sum' and 'openssl' (AC_PATH_PROG
  should be used, not AC_CHECK_TOOL, as these are not buildchain tools).

* Make main/Makefile responsible for installing and uninstalling the main
  Asterisk binary and libasteriskssl.so (and the 'rasterisk' symlink).


Modified:
    team/kpfleming/libasteriskssl/Makefile
    team/kpfleming/libasteriskssl/configure
    team/kpfleming/libasteriskssl/configure.ac
    team/kpfleming/libasteriskssl/main/Makefile
    team/kpfleming/libasteriskssl/makeopts.in

Modified: team/kpfleming/libasteriskssl/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/kpfleming/libasteriskssl/Makefile?view=diff&rev=352233&r1=352232&r2=352233
==============================================================================
--- team/kpfleming/libasteriskssl/Makefile (original)
+++ team/kpfleming/libasteriskssl/Makefile Mon Jan 23 14:51:46 2012
@@ -1,6 +1,6 @@
 #
 # Asterisk -- A telephony toolkit for Linux.
-# 
+#
 # Top level Makefile
 #
 # Copyright (C) 1999-2010, Digium, Inc.
@@ -90,6 +90,8 @@
 export GREP
 export MD5
 export WGET_EXTRA_ARGS
+export LDCONFIG
+export LDCONFIG_FLAGS
 
 # even though we could use '-include makeopts' here, use a wildcard
 # lookup anyway, so that make won't try to build makeopts if it doesn't
@@ -149,7 +151,7 @@
 
 # If the file .asterisk.makeopts is present in your home directory, you can
 # include all of your favorite menuselect options so that every time you download
-# a new version of Asterisk, you don't have to run menuselect to set them. 
+# a new version of Asterisk, you don't have to run menuselect to set them.
 # The file /etc/asterisk.makeopts will also be included but can be overridden
 # by the file in your home directory.
 
@@ -189,10 +191,12 @@
       ifeq ($(SUB_PROC),xscale)
         OPTIONS+=-fsigned-char -mcpu=xscale
       else
-        OPTIONS+=-fsigned-char 
+        OPTIONS+=-fsigned-char
       endif
     endif
   endif
+  # flag to tell 'ldconfig' to only process specified directories
+  LDCONFIG_FLAGS=-n
 endif
 
 ifeq ($(findstring -save-temps,$(_ASTCFLAGS) $(ASTCFLAGS)),)
@@ -213,7 +217,7 @@
   _ASTCFLAGS+=-Wunused
   _ASTCFLAGS+=$(AST_DECLARATION_AFTER_STATEMENT)
   _ASTCFLAGS+=$(AST_FORTIFY_SOURCE)
-  _ASTCFLAGS+=-Wundef 
+  _ASTCFLAGS+=-Wundef
   _ASTCFLAGS+=-Wmissing-format-attribute
   _ASTCFLAGS+=-Wformat=2
   ADDL_TARGETS+=validate-docs
@@ -246,6 +250,8 @@
   # -V is understood by BSD Make, not by GNU make.
   BSDVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
   _ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
+  # flag to tell 'ldconfig' to only process specified directories
+  LDCONFIG_FLAGS=-m
 endif
 
 ifeq ($(OSARCH),NetBSD)
@@ -338,12 +344,12 @@
 endif
 
 all: _cleantest_all
-	@echo " +--------- Asterisk Build Complete ---------+"  
-	@echo " + Asterisk has successfully been built, and +"  
+	@echo " +--------- Asterisk Build Complete ---------+"
+	@echo " + Asterisk has successfully been built, and +"
 	@echo " + can be installed by running:              +"
 	@echo " +                                           +"
-	@echo " +               $(mK) install               +"  
-	@echo " +-------------------------------------------+"  
+	@echo " +               $(mK) install               +"
+	@echo " +-------------------------------------------+"
 
 # For parallel builds, we must call cleantest *before* running the
 # other dependencies on _all.
@@ -354,7 +360,7 @@
 
 makeopts: configure
 	@echo "****"
-	@echo "**** The configure script must be executed before running '$(MAKE)'." 
+	@echo "**** The configure script must be executed before running '$(MAKE)'."
 	@echo "****               Please run \"./configure\"."
 	@echo "****"
 	@exit 1
@@ -514,7 +520,7 @@
   endif
 endif
 
-update: 
+update:
 	@if [ -d .svn ]; then \
 		echo "Updating from Subversion..." ; \
 		fromrev="`svn info | $(AWK) '/Revision: / {print $$2}'`"; \
@@ -568,10 +574,10 @@
 	$(INSTALL) -d "$(DESTDIR)$(AGI_DIR)"
 	$(INSTALL) -d "$(DESTDIR)$(ASTDBDIR)"
 
-bininstall: _cleantest_all installdirs $(SUBDIRS_INSTALL)
-	$(INSTALL) -m 755 main/asterisk "$(DESTDIR)$(ASTSBINDIR)/"
-	$(INSTALL) -m 755 main/libasteriskssl.so "$(DESTDIR)$(ASTLIBDIR)/"
-	$(LN) -sf asterisk "$(DESTDIR)$(ASTSBINDIR)/rasterisk"
+main-bininstall:
+	+ at DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" ASTLIBDIR="$(ASTLIBDIR)" $(SUBMAKE) -C main bininstall
+
+bininstall: _cleantest_all installdirs $(SUBDIRS_INSTALL) main-bininstall
 	$(INSTALL) -m 755 contrib/scripts/astgenkey "$(DESTDIR)$(ASTSBINDIR)/"
 	$(INSTALL) -m 755 contrib/scripts/autosupport "$(DESTDIR)$(ASTSBINDIR)/"
 	if [ ! -f "$(DESTDIR)$(ASTSBINDIR)/safe_asterisk" -a ! -f /sbin/launchd ]; then \
@@ -597,7 +603,7 @@
 	fi
 
 $(SUBDIRS_INSTALL):
-	+ at DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" $(SUBMAKE) -C $(@:-install=) install 
+	+ at DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" $(SUBMAKE) -C $(@:-install=) install
 
 NEWMODS:=$(foreach d,$(MOD_SUBDIRS),$(notdir $(wildcard $(d)/*.so)))
 OLDMODS=$(filter-out $(NEWMODS) $(notdir $(DESTDIR)$(ASTMODDIR)),$(notdir $(wildcard $(DESTDIR)$(ASTMODDIR)/*.so)))
@@ -631,14 +637,14 @@
 	@if [ -x /usr/sbin/asterisk-post-install ]; then \
 		/usr/sbin/asterisk-post-install "$(DESTDIR)" . ; \
 	fi
-	@echo " +---- Asterisk Installation Complete -------+"  
+	@echo " +---- Asterisk Installation Complete -------+"
 	@echo " +                                           +"
 	@echo " +    YOU MUST READ THE SECURITY DOCUMENT    +"
 	@echo " +                                           +"
-	@echo " + Asterisk has successfully been installed. +"  
-	@echo " + If you would like to install the sample   +"  
+	@echo " + Asterisk has successfully been installed. +"
+	@echo " + If you would like to install the sample   +"
 	@echo " + configuration files (overwriting any      +"
-	@echo " + existing config files), run:              +"  
+	@echo " + existing config files), run:              +"
 	@echo " +                                           +"
 	@echo " +               $(mK) samples               +"
 	@echo " +                                           +"
@@ -736,7 +742,7 @@
 	for x in images/*.gif; do \
 		$(INSTALL) -m 644 $$x "$(DESTDIR)$(HTTP_DOCSDIR)/_asterisk/"; \
 	done
-	@echo " +--------- Asterisk Web Voicemail ----------+"  
+	@echo " +--------- Asterisk Web Voicemail ----------+"
 	@echo " +                                           +"
 	@echo " + Asterisk Web Voicemail is installed in    +"
 	@echo " + your cgi-bin directory:                   +"
@@ -752,11 +758,11 @@
 	@echo " + in your Makefile of HTTP_CGIDIR and       +"
 	@echo " + HTTP_DOCSDIR                              +"
 	@echo " +                                           +"
-	@echo " +-------------------------------------------+"  
+	@echo " +-------------------------------------------+"
 
 progdocs:
 	(cat contrib/asterisk-ng-doxygen; echo "HAVE_DOT=$(HAVEDOT)"; \
-	echo "PROJECT_NUMBER=$(ASTERISKVERSION)") | doxygen - 
+	echo "PROJECT_NUMBER=$(ASTERISKVERSION)") | doxygen -
 
 install-logrotate:
 	if [ ! -d "$(DESTDIR)$(ASTETCDIR)/../logrotate.d" ]; then \
@@ -843,7 +849,7 @@
 	$(MAKE) -C sounds all
 
 # If the cleancount has been changed, force a make clean.
-# .cleancount is the global clean count, and .lastclean is the 
+# .cleancount is the global clean count, and .lastclean is the
 # last clean count we had
 
 cleantest:
@@ -853,9 +859,11 @@
 $(SUBDIRS_UNINSTALL):
 	+@$(SUBMAKE) -C $(@:-uninstall=) uninstall
 
-_uninstall: $(SUBDIRS_UNINSTALL)
+main-binuninstall:
+	+ at DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" ASTLIBDIR="$(ASTLIBDIR)" $(SUBMAKE) -C main binuninstall
+
+_uninstall: $(SUBDIRS_UNINSTALL) main-binuninstall
 	rm -f "$(DESTDIR)$(ASTMODDIR)/"*
-	rm -f "$(DESTDIR)$(ASTSBINDIR)/"*asterisk*
 	rm -f "$(DESTDIR)$(ASTSBINDIR)/astgenkey"
 	rm -f "$(DESTDIR)$(ASTSBINDIR)/autosupport"
 	rm -rf "$(DESTDIR)$(ASTHEADERDIR)"
@@ -867,18 +875,18 @@
 	$(MAKE) -C sounds uninstall
 
 uninstall: _uninstall
-	@echo " +--------- Asterisk Uninstall Complete -----+"  
-	@echo " + Asterisk binaries, sounds, man pages,     +"  
-	@echo " + headers, modules, and firmware builds,    +"  
-	@echo " + have all been uninstalled.                +"  
+	@echo " +--------- Asterisk Uninstall Complete -----+"
+	@echo " + Asterisk binaries, sounds, man pages,     +"
+	@echo " + headers, modules, and firmware builds,    +"
+	@echo " + have all been uninstalled.                +"
 	@echo " +                                           +"
 	@echo " + To remove ALL traces of Asterisk,         +"
 	@echo " + including configuration, spool            +"
 	@echo " + directories, and logs, run the following  +"
 	@echo " + command:                                  +"
 	@echo " +                                           +"
-	@echo " +            $(mK) uninstall-all            +"  
-	@echo " +-------------------------------------------+"  
+	@echo " +            $(mK) uninstall-all            +"
+	@echo " +-------------------------------------------+"
 
 uninstall-all: _uninstall
 	rm -rf "$(DESTDIR)$(ASTLIBDIR)"

Modified: team/kpfleming/libasteriskssl/configure.ac
URL: http://svnview.digium.com/svn/asterisk/team/kpfleming/libasteriskssl/configure.ac?view=diff&rev=352233&r1=352232&r2=352233
==============================================================================
--- team/kpfleming/libasteriskssl/configure.ac (original)
+++ team/kpfleming/libasteriskssl/configure.ac Mon Jan 23 14:51:46 2012
@@ -236,8 +236,6 @@
 
 AC_CHECK_TOOLS([STRIP], [strip gstrip], :)
 AC_CHECK_TOOLS([AR], [ar gar], :)
-AC_CHECK_TOOLS([SHA1SUM], [sha1sum], $ac_aux_dir/build_tools/sha1sum-sh)
-AC_CHECK_TOOLS([OPENSSL], [openssl], :)
 
 GNU_LD=0
 if test "x$with_gnu_ld" = "xyes" ; then
@@ -273,6 +271,9 @@
 fi
 fi
 AC_SUBST(DOWNLOAD)
+AC_PATH_PROG([LDCONFIG], [ldconfig], :)
+AC_PATH_PROG([SHA1SUM], [sha1sum], $ac_aux_dir/build_tools/sha1sum-sh)
+AC_PATH_PROG([OPENSSL], [openssl], :)
 
 AC_CACHE_CHECK([for bison that supports parse-param], [ac_cv_path_BISON2], [
 	if test "x$BISON" != "x:" ; then

Modified: team/kpfleming/libasteriskssl/main/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/kpfleming/libasteriskssl/main/Makefile?view=diff&rev=352233&r1=352232&r2=352233
==============================================================================
--- team/kpfleming/libasteriskssl/main/Makefile (original)
+++ team/kpfleming/libasteriskssl/main/Makefile Mon Jan 23 14:51:46 2012
@@ -185,16 +185,41 @@
 $(OBJS): _ASTCFLAGS+=-DAST_MODULE=\"core\"
 
 ifeq ($(AST_ASTERISKSSL),yes)
-ASTSSL_LIB=libasteriskssl.so
+# The ABI *version* of the asteriskssl library; don't change this unless there truly is a
+# non-backwards-compatible ABI change in the library
+ASTSSL_SO_VERSION=1
+
 ASTSSL_LDLIBS=-L. -lasteriskssl
-endif
-
-ifeq ($(findstring $(OSARCH), mingw32 cygwin ),)
-# don't define -fPIC on mingw32 and cygwin, it is the default
-libasteriskssl.so: _ASTCFLAGS+=-fPIC
-endif
-libasteriskssl.so: _ASTCFLAGS+=-DAST_MODULE=\"asteriskssl\"
-libasteriskssl.so: LIBS+=$(ASTSSL_LIBS)
+
+ifeq ($(findstring Darwin,$(OSARCH)),) # not Darwin
+ASTSSL_LIB:=libasteriskssl.so
+
+$(ASTSSL_LIB).$(ASTSSL_SO_VERSION): _ASTLDFLAGS+=-Wl,-soname=$(ASTSSL_LIB).$(ASTSSL_SO_VERSION)
+$(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
+
+# 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
+# required to build a proper shared library (as opposed to the 'loadable module'
+# type that are built by the standard rules)
+$(ASTSSL_LIB).$(ASTSSL_SO_VERSION): libasteriskssl.o
+ifeq ($(GNU_LD),1)
+	$(CMD_PREFIX) $(ASTTOPDIR)/build_tools/make_linker_version_script libasteriskssl "$(LINKER_SYMBOL_PREFIX)" "$(ASTTOPDIR)"
+endif
+	$(ECHO_PREFIX) echo "   [LD] $^ -> $@"
+	$(CMD_PREFIX) $(CC) $(STATIC_BUILD) -o $@ $(CC_LDFLAGS_SO) $^ $(CC_LIBS)
+ifneq ($(LDCONFIG),)
+	$(LDCONFIG) $(LDCONFIG_FLAGS) .
+endif
+
+$(ASTSSL_LIB): $(ASTSSL_LIB).$(ASTSSL_SO_VERSION)
+	$(LN) -sf $< $@
+
+else # Darwin
+endif
+
+endif
 
 $(MAIN_TGT): $(OBJS) $(ASTSSL_LIB) editline/libedit.a $(AST_EMBED_LDSCRIPTS)
 	@$(CC) -c -o buildinfo.o $(_ASTCFLAGS) buildinfo.c $(ASTCFLAGS)
@@ -211,9 +236,28 @@
 	$(CMD_PREFIX) $(ASTTOPDIR)/build_tools/make_linker_version_script asterisk $(LINKER_SYMBOL_PREFIX)
 endif
 
+bininstall:
+	$(INSTALL) -m 755 $(MAIN_TGT) "$(DESTDIR)$(ASTSBINDIR)/"
+ifeq ($(AST_ASTERISKSSL),yes)
+	$(INSTALL) -m 755 $(ASTSSL_LIB).$(ASTSSL_SO_VERSION) "$(DESTDIR)$(ASTLIBDIR)/"
+	$(LN) -sf "$(DESTDIR)$(ASTLIBDIR)/$(ASTSSL_LIB).$(ASTSSL_SO_VERSION)" "$(DESTDIR)$(ASTLIBDIR)/$(ASTSSL_LIB)"
+ifneq ($(LDCONFIG),)
+	$(LDCONFIG) $(LDCONFIG_FLAGS) "$(DESTDIR)$(ASTLIBDIR)/"
+endif
+endif
+	$(LN) -sf asterisk "$(DESTDIR)$(ASTSBINDIR)/rasterisk"
+
+binuninstall:
+	rm -f "$(DESTDIR)$(ASTSBINDIR)/$(MAIN_TGT)"
+	rm -f "$(DESTDIR)$(ASTSBINDIR)/rasterisk"
+	rm -f "$(DESTDIR)$(ASTLIBDIR)/$(ASTSSL_LIB).$(ASTSSL_SO_VERSION)"
+ifneq ($(LDCONFIG),)
+	$(LDCONFIG) $(LDCONFIG_FLAGS) "$(DESTDIR)$(ASTLIBDIR)/"
+endif
+
 clean::
-	rm -f asterisk libasteriskssl.o libasteriskssl.so
-	rm -f asterisk.exports
+	rm -f asterisk libasteriskssl.o $(ASTSSL_LIB) $(ASTSSL_LIB).*
+	rm -f asterisk.exports libasteriskssl.exports
 	@if [ -f editline/Makefile ]; then $(MAKE) -C editline distclean ; fi
 	@$(MAKE) -C stdtime clean
 	rm -f libresample/src/*.o

Modified: team/kpfleming/libasteriskssl/makeopts.in
URL: http://svnview.digium.com/svn/asterisk/team/kpfleming/libasteriskssl/makeopts.in?view=diff&rev=352233&r1=352232&r2=352233
==============================================================================
--- team/kpfleming/libasteriskssl/makeopts.in (original)
+++ team/kpfleming/libasteriskssl/makeopts.in Mon Jan 23 14:51:46 2012
@@ -34,6 +34,7 @@
 MD5=@MD5@
 SHA1SUM=@SHA1SUM@
 OPENSSL=@OPENSSL@
+LDCONFIG=@LDCONFIG@
 
 BUILD_PLATFORM=@BUILD_PLATFORM@
 BUILD_CPU=@BUILD_CPU@




More information about the svn-commits mailing list