summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu.herrb@laas.fr>2013-08-18 11:21:41 +0200
committerMatthieu Herrb <matthieu.herrb@laas.fr>2013-08-18 11:21:41 +0200
commitb1d08065098a889d44e317fe699c4fb39c30558d (patch)
treea12cda2d5c5ddf7c17c6b51109bc22e9754fcf03
parentd84643971e24bb6802de8606eb090ea612184489 (diff)
parent14ea26b8dc0c601e445331e09a4cc9ca082a1345 (diff)
Merge remote-tracking branch 'origin/master' into obsd
-rw-r--r--configure.ac27
1 files changed, 18 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index 680cdc5..419f9ca 100644
--- a/configure.ac
+++ b/configure.ac
@@ -165,17 +165,26 @@ esac
AC_PATH_PROGS(MCOOKIE, [mcookie], [$MCOOKIE],
[$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/local/bin])
-case $host_os in
- *openbsd*)
- MCOOKIE='/usr/sbin/openssl rand -hex 16'
- ;;
- *solaris*)
- MCOOKIE="/usr/bin/od -X -A n -N 16 /dev/urandom | /usr/bin/tr -d ' '"
- ;;
-esac
-
+# If mcookie not found, try openssl, else per-system fallbacks
+if test "x$MCOOKIE" = x ; then
+ AC_PATH_PROGS(OPENSSL, [openssl], [$OPENSSL],
+ [$PATH:/bin:/usr/bin:/usr/sbin:/usr/lib:/usr/libexec:/usr/local/bin])
+ if test "x$OPENSSL" != x ; then
+ MCOOKIE="$OPENSSL rand -hex 16"
+ else
+ case $host_os in
+ *openbsd*)
+ MCOOKIE='/usr/sbin/openssl rand -hex 16'
+ ;;
+ *solaris*)
+ MCOOKIE="/usr/bin/od -X -A n -N 16 /dev/urandom | /usr/bin/tr -d ' '"
+ ;;
+ esac
+ fi
+fi
if test "x$MCOOKIE" != x ; then
STARTX_COOKIE_FLAGS='-DHAS_COOKIE_MAKER -DMK_COOKIE="$(MCOOKIE)"'
+ AC_MSG_NOTICE([startx will depend on "$MCOOKIE" to generate xauth cookies])
fi
AC_SUBST(STARTX_COOKIE_FLAGS)