summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-11-13 12:17:10 +0900
committerKeith Packard <keithp@keithp.com>2013-12-02 12:56:33 -0800
commit5a969f0928b84da5cfe0777dfb542caaacc915ad (patch)
tree3de24e44154a1cee50de5d6497a47de577aa345b
parentd695cb7fb6bb8fd159a332d902673edbbd2237d7 (diff)
Select directory for MIT-SHM temp files at configure time
By default, this looks through a list of directories to find one which exists, but can be overridden with --with-shared-memory-dir=PATH This patch doesn't actually do anything with this directory, just makes it available in the configuration Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Julien Cristau <jcristau@debian.org>
-rw-r--r--configure.ac43
-rw-r--r--include/dix-config.h.in3
2 files changed, 46 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 6197e9bed..f6ecdc6fe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1086,6 +1086,49 @@ case "$DRI2,$HAVE_DRI2PROTO" in
esac
AM_CONDITIONAL(DRI2, test "x$DRI2" = xyes)
+dnl
+dnl Locate a suitable tmp file system for creating shared memeory files
+dnl
+
+AC_ARG_WITH(shared-memory-dir, AS_HELP_STRING([--with-shared-memory-dir=PATH], [Path to directory in a world-writable temporary directory for anonymous shared memory (default: auto)]),
+[],
+[with_shared_memory_dir=yes])
+
+shmdirs="/run/shm /var/tmp /tmp"
+
+case x"$with_shared_memory_dir" in
+xyes)
+ for dir in $shmdirs; do
+ case x"$with_shared_memory_dir" in
+ xyes)
+ echo Checking temp dir "$dir"
+ if test -d "$dir"; then
+ with_shared_memory_dir="$dir"
+ fi
+ ;;
+ esac
+ done
+ ;;
+x/*)
+ ;;
+xno)
+ ;;
+*)
+ AC_MSG_ERROR([Invalid directory specified for --with-shared-memory-dir: $with_shared_memory_dir])
+ ;;
+esac
+
+case x"$with_shared_memory_dir" in
+xyes)
+ AC_MSG_ERROR([No directory found for shared memory temp files.])
+ ;;
+xno)
+ ;;
+*)
+ AC_DEFINE_UNQUOTED(SHMDIR, ["$with_shared_memory_dir"], [Directory for shared memory temp files])
+ ;;
+esac
+
AC_ARG_ENABLE(xtrans-send-fds, AS_HELP_STRING([--disable-xtrans-send-fds], [Use Xtrans support for fd passing (default: auto)]), [XTRANS_SEND_FDS=$enableval], [XTRANS_SEND_FDS=auto])
case "x$XTRANS_SEND_FDS" in
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index d4fbe99fa..306610000 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -466,4 +466,7 @@
/* Wrap SIGBUS to catch MIT-SHM faults */
#undef BUSFAULT
+/* Directory for shared memory temp files */
+#undef SHMDIR
+
#endif /* _DIX_CONFIG_H_ */