summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorGeorge Joseph <gjoseph@digium.com>2017-02-23 14:49:17 -0700
committerGeorge Joseph <gjoseph@digium.com>2017-02-23 14:49:17 -0700
commitbee55aaf2cc2936100b16f5a4acb87a3ea1235cd (patch)
treeddd7b3d6e5a68d7e71f04fce376fe4e42d5dbd89 /configure.ac
parent803afec45ff61824c876e919cb2be467e33cb83d (diff)
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
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac21
1 files changed, 21 insertions, 0 deletions
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}