[PATCH:xdm] Show compile time options in Debug output

Alan Coopersmith alan.coopersmith at oracle.com
Tue Sep 3 10:35:43 PDT 2013


When debugging, helps figure out which options the distro or builder
chose to enable or disable.

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 xdm/dm.c |   43 ++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 42 insertions(+), 1 deletion(-)

diff --git a/xdm/dm.c b/xdm/dm.c
index 815950c..90543c1 100644
--- a/xdm/dm.c
+++ b/xdm/dm.c
@@ -168,7 +168,48 @@ main (int argc, char **argv)
 	exit (1);
     }
 
-    LogInfo ("Starting\n");
+    LogInfo ("Starting %s\n", PACKAGE_STRING);
+    if (debugLevel > 0)
+    {
+	Debug("%s was built with these options:\n", PACKAGE_STRING);
+#ifdef USE_PAM
+	Debug(" - USE_PAM = yes\n");
+#else
+	Debug(" - USE_PAM = no\n");
+#endif
+#ifdef USE_SELINUX
+	Debug(" - USE_SELINUX = yes\n");
+#else
+	Debug(" - USE_SELINUX = no\n");
+#endif
+#ifdef USE_SYSTEMD_DAEMON
+	Debug(" - USE_SYSTEMD_DAEMON = yes\n");
+#else
+	Debug(" - USE_SYSTEMD_DAEMON = no\n");
+#endif
+#ifdef USE_XFT
+	Debug(" - USE_XFT = yes\n");
+#else
+	Debug(" - USE_XFT = no\n");
+#endif
+#ifdef USE_XINERAMA
+	Debug(" - USE_XINERAMA = yes\n");
+#else
+	Debug(" - USE_XINERAMA = no\n");
+#endif
+#ifdef XPM
+	Debug(" - XPM = yes\n");
+#else
+	Debug(" - XPM = no\n");
+#endif
+#ifdef HAVE_ARC4RANDOM
+	Debug(" - Random number source: arc4random()\n\n");
+#elif defined(DEV_RANDOM)
+	Debug(" - Random number source: %s\n", DEV_RANDOM);
+#else
+	Debug(" - Random number source: built-in PRNG\n\n");
+#endif
+    }
 
     if (atexit (RemovePid))
 	LogError ("could not register RemovePid() with atexit()\n");
-- 
1.7.9.2



More information about the xorg-devel mailing list