summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorTor Didriksen <tor.didriksen@oracle.com>2013-12-18 11:05:18 +0100
committerTor Didriksen <tor.didriksen@oracle.com>2013-12-18 11:05:18 +0100
commita3c97756577c135219d7e6eaa34d8d49d4b12acc (patch)
tree799f10a187f6a64433df060f0b46fa02e11eb886 /CMakeLists.txt
parent42be8c16f5cc1d4d18adec946e9d993bd3ab1ebb (diff)
downloadmariadb-git-a3c97756577c135219d7e6eaa34d8d49d4b12acc.tar.gz
Bug#16316074 RFE: MAKE TMPDIR A BUILD-TIME CONFIGURABLE OPTION
Bug#68338 RFE: make tmpdir a build-time configurable option Background: Some distributions use tmpfs for mounting /tmp by default, which has some advantages, but brings also new issues. Fedora started using tmpfs on /tmp in version 18 for example. If not configured otherwise in my.cnf, MySQL uses system's constant P_tmpdir expanded to /tmp on Linux. This can introduce some problems with limited space in /tmp and also some data loss in case of replication slave [1]. In case distributions would like to use /var/tmp, which should be better for MySQL purposes, then we have to patch the source or change tmpdir option in my.cnf, which is however not updated in case it has already existed. Thus, it would be useful to be able to specify default tmpdir path using a configure option, while using P_tmpdir in case it is not defined explicitly. Based on a contribution from Honza Horak
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a9c0da97525..d47e04c61b1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -329,6 +329,15 @@ IF(SYSCONFDIR)
SET(DEFAULT_SYSCONFDIR "${SYSCONFDIR}")
ENDIF()
+OPTION(TMPDIR
+"PATH to MySQL TMP dir. If unspecified, defaults to P_tmpdir in <stdio.h>" OFF)
+IF(TMPDIR)
+ # Quote it, to make it a const char string.
+ SET(DEFAULT_TMPDIR "\"${TMPDIR}\"")
+ELSE()
+ # Do not quote it, to refer to the P_tmpdir macro in <stdio.h>.
+ SET(DEFAULT_TMPDIR "P_tmpdir")
+ENDIF()
# Run platform tests
INCLUDE(configure.cmake)