diff options
author | Joshua Colp <jcolp@digium.com> | 2017-02-24 11:51:50 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-02-24 11:51:50 -0600 |
commit | 1d5b6fe2b6ca0a019f8ad6f40cce5fb2d07902e2 (patch) | |
tree | 77ad4b9a61a16a729e8780e853c29890168efb5d | |
parent | da0cadd100a136038827f3be706372cd16134dcd (diff) | |
parent | bee55aaf2cc2936100b16f5a4acb87a3ea1235cd (diff) |
Merge "build: Execute ldconfig to build cache. (take two)" into 13
-rw-r--r-- | Makefile | 29 | ||||
-rwxr-xr-x | configure | 22 | ||||
-rw-r--r-- | configure.ac | 21 | ||||
-rw-r--r-- | main/Makefile | 6 |
4 files changed, 65 insertions, 13 deletions
@@ -183,11 +183,6 @@ OTHER_SUBDIR_CFLAGS="-I$(ASTTOPDIR)/include" # Create OPTIONS variable, but probably we can assign directly to ASTCFLAGS OPTIONS= -ifeq ($(OSARCH),linux-gnu) - # flag to tell 'ldconfig' to only process specified directories - LDCONFIG_FLAGS=-n -endif - ifeq ($(findstring -save-temps,$(_ASTCFLAGS) $(ASTCFLAGS)),) ifeq ($(findstring -pipe,$(_ASTCFLAGS) $(ASTCFLAGS)),) _ASTCFLAGS+=-pipe @@ -223,8 +218,6 @@ ifeq ($(OSARCH),FreeBSD) # -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) @@ -643,6 +636,23 @@ oldmodcheck: echo " WARNING WARNING WARNING" ;\ fi +ld-cache-update: +ifneq ($(LDCONFIG),) + @if [ $${EUID} -eq 0 ] ; then \ + $(LDCONFIG) "$(DESTDIR)$(ASTLIBDIR)/" ; \ + else \ + echo " WARNING WARNING WARNING" ;\ + echo "" ;\ + echo " You cannot rebuild the system linker cache unless you are root. " ;\ + echo " You MUST do one of the follwing..." ;\ + echo " * Re-run 'make install' as root. " ;\ + echo " * Run 'ldconfig $(DESTDIR)$(ASTLIBDIR)' as root. " ;\ + echo " * Run asterisk with 'LD_LIBRARY_PATH=$(DESTDIR)$(ASTLIBDIR) asterisk' " ;\ + echo "" ;\ + echo " WARNING WARNING WARNING" ;\ + fi +endif + badshell: ifneq ($(filter ~%,$(DESTDIR)),) @echo "Your shell doesn't do ~ expansion when expected (specifically, when doing \"make install DESTDIR=~/path\")." @@ -681,6 +691,7 @@ install: badshell bininstall datafiles @echo " + doxygen installed on your local system +" @echo " +-------------------------------------------+" @$(MAKE) -s oldmodcheck + @$(MAKE) -s ld-cache-update isntall: install @@ -913,6 +924,9 @@ ifeq ($(HAVE_DAHDI),1) rm -f $(DESTDIR)$(DAHDI_UDEV_HOOK_DIR)/40-asterisk endif $(MAKE) -C sounds uninstall +ifneq ($(LDCONFIG),) + $(LDCONFIG) || : +endif uninstall: _uninstall @echo " +--------- Asterisk Uninstall Complete -----+" @@ -1043,6 +1057,7 @@ check-alembic: makeopts .PHONY: ari-stubs .PHONY: basic-pbx .PHONY: check-alembic +.PHONY: ld-cache-update .PHONY: $(SUBDIRS_INSTALL) .PHONY: $(SUBDIRS_DIST_CLEAN) .PHONY: $(SUBDIRS_CLEAN) @@ -4856,6 +4856,28 @@ if test ${prefix} = ${ac_default_prefix} || test ${prefix} = 'NONE'; then fi fi +# +# The following code for detecting lib64 was taken from Fedora's +# /usr/share/config.site with a modification to check that the +# /usr/lib64 directory actually exists. This prevents libdir from +# being set to /usr/lib64 on 64-bit systems that still use /usr/lib. +# +if test "$prefix" = /usr ||\ + { test "$prefix" = NONE && test "$ac_default_prefix" = /usr ; } +then + for i in x86_64 ppc64 s390x aarch64; do + if test $host_cpu = $i; then + if test "$libdir" = '${exec_prefix}/lib' &&\ + { test -d "${exec_prefix}/lib64" || test -d "${ac_default_prefix}/lib64" ; } ; then + libdir='${exec_prefix}/lib64' + { $as_echo "$as_me:${as_lineno-$LINENO}: Setting libdir=${libdir} " >&5 +$as_echo "$as_me: Setting libdir=${libdir} " >&6;} + fi + break + fi + done +fi + BUILD_PLATFORM=${build} BUILD_CPU=${build_cpu} BUILD_VENDOR=${build_vendor} diff --git a/configure.ac b/configure.ac index 1d3b8a554..039648a43 100644 --- a/configure.ac +++ b/configure.ac @@ -135,6 +135,27 @@ if test ${prefix} = ${ac_default_prefix} || test ${prefix} = 'NONE'; then fi fi +# +# The following code for detecting lib64 was taken from Fedora's +# /usr/share/config.site with a modification to check that the +# /usr/lib64 directory actually exists. This prevents libdir from +# being set to /usr/lib64 on 64-bit systems that still use /usr/lib. +# +if test "$prefix" = /usr ||\ + { test "$prefix" = NONE && test "$ac_default_prefix" = /usr ; } +then + for i in x86_64 ppc64 s390x aarch64; do + if test $host_cpu = $i; then + if test "$libdir" = '${exec_prefix}/lib' &&\ + { test -d "${exec_prefix}/lib64" || test -d "${ac_default_prefix}/lib64" ; } ; then + libdir='${exec_prefix}/lib64' + AC_MSG_NOTICE([ Setting libdir=${libdir} ]) + fi + break + fi + done +fi + BUILD_PLATFORM=${build} BUILD_CPU=${build_cpu} BUILD_VENDOR=${build_vendor} diff --git a/main/Makefile b/main/Makefile index a51b48bb1..fb473141e 100644 --- a/main/Makefile +++ b/main/Makefile @@ -354,9 +354,6 @@ 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" binuninstall: @@ -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 |