From 1f1e27d68a85c4f07b4e05a59ba8a64bdc04fbca Mon Sep 17 00:00:00 2001 From: paulc Date: Wed, 9 Jul 2014 13:50:15 +0000 Subject: [PATCH] Added configuration option --enable-lib-exec that can remove executable permission from installed shared libraries and Yate modules. Attempt to detect the proper default to match Debian / Ubuntu install policy. git-svn-id: http://voip.null.ro/svn/yate@5866 acf43c95-373e-0410-b603-e72c3f656dc1 --- Makefile.in | 2 +- clients/qt4/Makefile.in | 2 +- configure.in | 25 +++++++++++++++++++++++++ modules/Makefile.in | 2 +- 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/Makefile.in b/Makefile.in index cf3b2adf..f50b8adc 100644 --- a/Makefile.in +++ b/Makefile.in @@ -214,7 +214,7 @@ install-noconf: all f=`readlink "$$i"` ; \ ln -sf "$$f" "$(DESTDIR)$(libdir)/$$i" ; \ else \ - install $$i "$(DESTDIR)$(libdir)/" ; \ + install @INSTALL_L@ $$i "$(DESTDIR)$(libdir)/" ; \ fi \ done @mkdir -p "$(DESTDIR)$(bindir)/" && \ diff --git a/clients/qt4/Makefile.in b/clients/qt4/Makefile.in index b252e324..69c8ef5d 100644 --- a/clients/qt4/Makefile.in +++ b/clients/qt4/Makefile.in @@ -81,7 +81,7 @@ install: all f=`readlink "../../$$i"` ; \ ln -sf "$$f" "$(DESTDIR)$(libdir)/$$i" ; \ else \ - install ../../$$i "$(DESTDIR)$(libdir)/" ; \ + install @INSTALL_L@ ../../$$i "$(DESTDIR)$(libdir)/" ; \ fi \ done; \ mkdir -p "$(DESTDIR)$(incdir)" && \ diff --git a/configure.in b/configure.in index 3cafae01..d553d871 100644 --- a/configure.in +++ b/configure.in @@ -1559,6 +1559,31 @@ fi fi +INSTALL_L="" +AC_ARG_ENABLE(lib-exec,AC_HELP_STRING([--enable-lib-exec],[Executable libraries and modules (default: auto)]),want_lib_exec=$enableval,want_lib_exec=auto) +case "x$want_lib_exec" in + xyes) + ;; + xno) + INSTALL_L="-m 0644" + ;; + xauto) + AC_MSG_CHECKING([if shared libraries should be executable]) + if stat -L "/usr/$ARCHLIB/libm.so" 2>/dev/null | grep -q '(0644/'; then + want_lib_exec=no + INSTALL_L="-m 0644" + else + want_lib_exec=yes + fi + AC_MSG_RESULT([$want_lib_exec]) + ;; + *) + AC_ERROR([Invalid argument passed to --enable-lib-exec]) + ;; +esac +AC_SUBST(INSTALL_L) + + INSTALL_D="install -D" CFLAGS=`echo "$CFLAGS" | sed 's/\(^\| *\)-g[[0-9]]*//' | sed 's/[[[:space:]]]\{2,\}/ /g'` MODULE_CFLAGS="-fno-exceptions -fPIC $HAVE_GCC_FORMAT_CHECK $HAVE_BLOCK_RETURN" diff --git a/modules/Makefile.in b/modules/Makefile.in index cb88fcde..5be28d20 100644 --- a/modules/Makefile.in +++ b/modules/Makefile.in @@ -235,7 +235,7 @@ install: all do-install mkdir -p "$(DESTDIR)$(moddir)/$$i" ; \ done; \ for i in $(PROGS) ; do \ - @INSTALL_D@ "$$i" "$(DESTDIR)$(moddir)/$$i" ; \ + @INSTALL_D@ @INSTALL_L@ "$$i" "$(DESTDIR)$(moddir)/$$i" ; \ done; .PHONY: uninstall