[Asterisk-code-review] build: Fix deb build issues with fakeroot and lib64. (asterisk[13])
Walter Doekes
asteriskteam at digium.com
Tue Mar 28 07:50:23 CDT 2017
Walter Doekes has uploaded a new change for review. ( https://gerrit.asterisk.org/5344 )
Change subject: build: Fix deb build issues with fakeroot and lib64.
......................................................................
build: Fix deb build issues with fakeroot and lib64.
Don't rely on the value of ${EUID}. If fakeroot is used, the uid appears
to be 0, but the ldconfig call would fail, stopping the build.
Further, the existence of /usr/lib64 on the build OS should not be taken
into account when creating a deb package.
ASTERISK-26705
Change-Id: I51739d4a03e60bff38be719b8d2ead0007afdd51
---
M Makefile
M configure.ac
2 files changed, 16 insertions(+), 11 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/44/5344/1
diff --git a/Makefile b/Makefile
index 0487abd..f95908b 100644
--- a/Makefile
+++ b/Makefile
@@ -638,13 +638,11 @@
ld-cache-update:
ifneq ($(LDCONFIG),)
- @if [ $${EUID} -eq 0 ] ; then \
- $(LDCONFIG) "$(DESTDIR)$(ASTLIBDIR)/" ; \
- else \
+ if ! $(LDCONFIG) "$(DESTDIR)$(ASTLIBDIR)/"; then \
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 " You MUST do one of the following..." ;\
echo " * Re-run 'make install' as root. " ;\
echo " * Run 'ldconfig $(DESTDIR)$(ASTLIBDIR)' as root. " ;\
echo " * Run asterisk with 'LD_LIBRARY_PATH=$(DESTDIR)$(ASTLIBDIR) asterisk' " ;\
diff --git a/configure.ac b/configure.ac
index 12f4a34..32f84d8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -135,15 +135,22 @@
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 ||\
+if test -n "$DEB_HOST_MULTIARCH"
+then
+ # This is a debian/ubuntu build. *If* we were to change
+ # directories, we'd use $DEB_HOST_MULTIARCH and not hardcode
+ # /lib64/. Do nothing for now, and default to /lib/.
+ # Check added to ignore stray lib64 dirs on the build OS.
+ true
+elif test "$prefix" = /usr ||\
{ test "$prefix" = NONE && test "$ac_default_prefix" = /usr ; }
then
+ #
+ # 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.
+ #
for i in x86_64 ppc64 s390x aarch64; do
if test $host_cpu = $i; then
if test "$libdir" = '${exec_prefix}/lib' &&\
--
To view, visit https://gerrit.asterisk.org/5344
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I51739d4a03e60bff38be719b8d2ead0007afdd51
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Walter Doekes <walter+asterisk at wjd.nu>
More information about the asterisk-code-review
mailing list