From b0067bcf2c64660e3499f8d2f06e7874ab627898 Mon Sep 17 00:00:00 2001 From: George Joseph Date: Thu, 23 Feb 2017 14:49:17 -0700 Subject: build: Execute ldconfig to build cache. (take two) On some platforms a multiarch approach is used for libraries. The build system does not take this into account and still places libraries into the lib directory if no --libdir is specified to configure. On initial startup this results in libasteriskssl.so not being found, as it is not in the multiarch lib directory. To make matters worse, options were being passed to ldconfig on both Linux and FreeBSD that actually prevented the rebuild of the cache. * Fedora has a /usr/share/config.site that automatically tells autoconf to use /usr/lib64 but CentOS does not. This logic was copied to configure.ac and modified so systems like Ubuntu, which still use /usr/lib for 64-bit systems, aren't affected. Now that we have them in the correct directory... In order for the system loader to find libasteriskssl and libasteriskpj, one of 3 things has to happen... - The linker cache must be rebuilt including the directory where the libasterisk* libraries were installed. Only root can rebuild the cache. This was busted. - We have to link the asterisk binary with an rpath pointing to the directrory where the libasterisk* libraries were installed. This makes things very complicated and will happen over the collective dead bodies of everyone who's had to package a distribution with an rpath. - Finally, you can start asterisk with LD_LIBRARY_PATH set to the directrory where the libasterisk* libraries were installed. There are no other options. So... * The invokation of ldconfig has been moved from main/Makefile to ASTTOPDIR/Makefile, the options have been removed, and DESTDIR/ASTLIBDIR appended. If you aren't root, you will be warned after the "Asterisk Installation Compete" banner that you must re-run 'make install' as root, manually run 'ldconfig DESTDIR/ASTLIBDIR' as root, or run asterisk with LD_LIBRARY_PATH. ASTERISK-26705 Change-Id: I2a64b7c33a7d3e9bde20f47e3d3ab771977af982 --- main/Makefile | 6 ------ 1 file changed, 6 deletions(-) (limited to 'main/Makefile') diff --git a/main/Makefile b/main/Makefile index 4d1b2c41b..d3463f7b6 100644 --- a/main/Makefile +++ b/main/Makefile @@ -353,9 +353,6 @@ ifeq ($(findstring darwin,$(OSARCH)),) # not Darwin else # Darwin $(INSTALL) -m 755 $(ASTPJ_LIB) "$(DESTDIR)$(ASTLIBDIR)/" endif -endif -ifneq ($(LDCONFIG),) - $(LDCONFIG) $(LDCONFIG_FLAGS) "$(DESTDIR)$(ASTLIBDIR)/" endif $(LN) -sf asterisk "$(DESTDIR)$(ASTSBINDIR)/rasterisk" @@ -372,9 +369,6 @@ ifneq ($(ASTPJ_LIB).$(ASTPJ_SO_VERSION),.) rm -f "$(DESTDIR)$(ASTLIBDIR)/$(ASTPJ_LIB).$(ASTPJ_SO_VERSION)" || : rm -f "$(DESTDIR)$(ASTLIBDIR)/$(ASTPJ_LIB)" endif -ifneq ($(LDCONFIG),) - $(LDCONFIG) $(LDCONFIG_FLAGS) "$(DESTDIR)$(ASTLIBDIR)/" -endif clean:: rm -f asterisk libasteriskssl.o -- cgit v1.2.3