- Comment out NetBSD/SanOS garbage
authorRoman Bogorodskiy <mirrorbox@users.sourceforge.net>
Sat, 12 Aug 2006 06:10:18 +0000 (06:10 +0000)
committerRoman Bogorodskiy <mirrorbox@users.sourceforge.net>
Sat, 12 Aug 2006 06:10:18 +0000 (06:10 +0000)
- Print OS information in `conky -v`

git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@688 7f574dfc-610e-0410-a909-a81674777703

configure.ac
src/Makefile.am
src/build.h.in [new file with mode: 0644]
src/conky.c

index 6416012..7faad0f 100644 (file)
@@ -15,6 +15,7 @@ AC_CONFIG_FILES(
        Makefile
        doc/Makefile
        src/Makefile
+       src/build.h
        )
 
 uname=`uname`
@@ -50,11 +51,16 @@ case $uname in
 esac
 
 AM_CONDITIONAL(BUILD_LINUX, test x$uname = xLinux)
-AM_CONDITIONAL(BUILD_SOLARIS, test x$uname = xSunOS)
+#AM_CONDITIONAL(BUILD_SOLARIS, test x$uname = xSunOS)
 AM_CONDITIONAL(BUILD_FREEBSD, test x$uname = xFreeBSD)
-AM_CONDITIONAL(BUILD_NETBSD, test x$uname = xNetBSD)
+#AM_CONDITIONAL(BUILD_NETBSD, test x$uname = xNetBSD)
 # AM_CONDITIONAL(BUILD_OPENBSD, test x$uname = xOpenBSD)
 
+BUILD_DATE=$(LANG=en_US LC_ALL=en_US LOCALE=en_US date)
+BUILD_ARCH="$(uname -sr) ($(uname -m))"
+AC_SUBST(BUILD_DATE)
+AC_SUBST(BUILD_ARCH)
+
 dnl
 dnl XFT option
 dnl
index d45d992..62a1d48 100644 (file)
@@ -37,18 +37,18 @@ linux = linux.c top.c
 PTHREAD_LIBS =  -lpthread
 endif
 
-if BUILD_SOLARIS
-solaris = solaris.c
-endif
+#if BUILD_SOLARIS
+#solaris = solaris.c
+#endif
 
 if BUILD_FREEBSD
 freebsd = freebsd.c
 PTHREAD_LIBS =  -pthread
 endif
 
-if BUILD_NETBSD
-netbsd = netbsd.c
-endif
+#if BUILD_NETBSD
+#netbsd = netbsd.c
+#endif
 
 if BUILD_PORT_MONITORS
 port_monitors = libtcp-portmon.h libtcp-portmon.c hash.h hash.c
diff --git a/src/build.h.in b/src/build.h.in
new file mode 100644 (file)
index 0000000..a9f8411
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef __BUILD_H
+#define __BUILD_H
+
+/* Conky build info */
+
+#define BUILD_DATE "@BUILD_DATE@"
+#define BUILD_ARCH "@BUILD_ARCH@"
+
+#endif /* __BUILD_H */
index a9fc7de..7dfce67 100644 (file)
@@ -41,6 +41,8 @@
 #include <iconv.h>
 #endif
 
+#include "build.h"
+
 #define CONFIG_FILE "$HOME/.conkyrc"
 #define MAIL_FILE "$MAIL"
 #define MAX_IF_BLOCK_DEPTH 5
@@ -104,6 +106,13 @@ struct font_list *fonts = NULL;
 
 static void set_font();
 
+static void print_version()
+{
+       printf("Conky %s compiled %s for %s\n",
+                       VERSION, BUILD_DATE, BUILD_ARCH);
+       exit(0);
+}
+
 int addfont(const char *data_in)
 {
        if (font_count > MAX_FONTS) {
@@ -6874,10 +6883,7 @@ int main(int argc, char **argv)
                switch (c) {
                case 'v':
                case 'V':
-                       printf
-                           ("Conky " VERSION " compiled " __DATE__ "\n");
-                       return 0;
-
+                       print_version();
                case 'c':
                        /* if current_config is set to a strdup of CONFIG_FILE, free it (even
                         * though free() does the NULL check itself;), then load optarg value */