summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-04-10 15:22:15 (GMT)
committerBrad King <brad.king@kitware.com>2007-04-10 15:22:15 (GMT)
commita017333d9a7c58e573a4a0ba98fed62909832445 (patch)
treee4257bc206bb3be7cedca940960d120b89003792 /Source
parent8b0c61c322f939f2d718e71c5c796df9d58c6cc2 (diff)
downloadCMake-a017333d9a7c58e573a4a0ba98fed62909832445.zip
CMake-a017333d9a7c58e573a4a0ba98fed62909832445.tar.gz
CMake-a017333d9a7c58e573a4a0ba98fed62909832445.tar.bz2
ENH: Added option CMAKE_INSTALL_SO_NO_EXE on linux to choose whether the default permissions for shared libraries include the executable bit. This is necessary to support the conflicting policies of Debian and Fedora. These changes address bug#4805.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmFileCommand.cxx22
-rw-r--r--Source/cmLocalGenerator.cxx12
2 files changed, 25 insertions, 9 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 1353988..d988dd3 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -1184,6 +1184,9 @@ bool cmFileCommand::HandleInstallCommand(
}
}
+ // Choose a default for shared library permissions.
+ bool install_so_no_exe = this->Makefile->IsOn("CMAKE_INSTALL_SO_NO_EXE");
+
// If file permissions were not specified set default permissions
// for this target type.
if(!use_given_permissions_file && !use_source_permissions)
@@ -1192,15 +1195,16 @@ bool cmFileCommand::HandleInstallCommand(
{
case cmTarget::SHARED_LIBRARY:
case cmTarget::MODULE_LIBRARY:
-#if defined(__linux__)
- // Use read/write permissions.
- permissions_file = 0;
- permissions_file |= mode_owner_read;
- permissions_file |= mode_owner_write;
- permissions_file |= mode_group_read;
- permissions_file |= mode_world_read;
- break;
-#endif
+ if(install_so_no_exe)
+ {
+ // Use read/write permissions.
+ permissions_file = 0;
+ permissions_file |= mode_owner_read;
+ permissions_file |= mode_owner_write;
+ permissions_file |= mode_group_read;
+ permissions_file |= mode_world_read;
+ break;
+ }
case cmTarget::EXECUTABLE:
case cmTarget::INSTALL_PROGRAMS:
// Use read/write/executable permissions.
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index a5fb1a0..8a45dee 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -393,6 +393,18 @@ void cmLocalGenerator::GenerateInstallRules()
"ENDIF(NOT CMAKE_INSTALL_COMPONENT)\n"
"\n";
+ // Copy user-specified install options to the install code.
+ if(const char* so_no_exe =
+ this->Makefile->GetDefinition("CMAKE_INSTALL_SO_NO_EXE"))
+ {
+ fout <<
+ "# Install shared libraries without execute permission?\n"
+ "IF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)\n"
+ " SET(CMAKE_INSTALL_SO_NO_EXE \"" << so_no_exe << "\")\n"
+ "ENDIF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)\n"
+ "\n";
+ }
+
// Ask each install generator to write its code.
std::vector<cmInstallGenerator*> const& installers =
this->Makefile->GetInstallGenerators();