[hackers] [st] use predefined OS macro instead of uname. || Aurélien Aptel

From: <hg_AT_suckless.org>
Date: Mon, 30 Aug 2010 09:04:46 +0000 (UTC)

changeset: 111:a17b1629b1b2
tag: tip
user: Aurélien Aptel <aurelien.aptel_AT_gmail.com>
date: Mon Aug 30 13:04:19 2010 +0200
files: Makefile config.mk st.c
description:
use predefined OS macro instead of uname.

diff -r 85b3d781b02e -r a17b1629b1b2 Makefile
--- a/Makefile Mon Aug 30 01:20:38 2010 +0200
+++ b/Makefile Mon Aug 30 13:04:19 2010 +0200
@@ -10,7 +10,6 @@
 
 options:
         @echo st build options:
- @echo "SYSTEM = ${SYSTEM}"
         @echo "CFLAGS = ${CFLAGS}"
         @echo "LDFLAGS = ${LDFLAGS}"
         @echo "CC = ${CC}"
diff -r 85b3d781b02e -r a17b1629b1b2 config.mk
--- a/config.mk Mon Aug 30 01:20:38 2010 +0200
+++ b/config.mk Mon Aug 30 13:04:19 2010 +0200
@@ -14,15 +14,8 @@
 INCS = -I. -I/usr/include -I${X11INC}
 LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 -lutil
 
-# uncomment manualy your system if compilation fail
-SYSTEM = -D`uname | tr a-z A-Z`
-#SYSTEM = -DLINUX
-#SYSTEM = -DOPENBSD
-#SYSTEM = -DFREEBSD
-#SYSTEM = -DNETBSD
-
 # flags
-CPPFLAGS = -DVERSION=\"${VERSION}\" ${SYSTEM}
+CPPFLAGS = -DVERSION=\"${VERSION}\"
 CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
 LDFLAGS = -s ${LIBS}
 
diff -r 85b3d781b02e -r a17b1629b1b2 st.c
--- a/st.c Mon Aug 30 01:20:38 2010 +0200
+++ b/st.c Mon Aug 30 13:04:19 2010 +0200
@@ -20,11 +20,11 @@
 #include <X11/keysym.h>
 #include <X11/Xutil.h>
 
-#if defined(LINUX)
+#if defined(__linux)
  #include <pty.h>
-#elif defined(OPENBSD) || defined(NETBSD)
+#elif defined(__OpenBSD__) || defined(__NetBSD__)
  #include <util.h>
-#elif defined(FREEBSD)
+#elif defined(__FreeBSD__) || defined(__DragonFly__)
  #include <libutil.h>
 #endif
 
Received on Mon Aug 30 2010 - 11:04:46 CEST

This archive was generated by hypermail 2.2.0 : Mon Aug 30 2010 - 11:12:05 CEST