aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2017-05-25 16:51:31 +0200
committerDuncaen <mail@duncano.de>2017-05-25 17:01:13 +0200
commita4f50e5358793887a46808f5bfa40f80fb4c4c76 (patch)
tree29d5482aa194e9915fffd216846996d985effb8a
parent8bb3dd2300f887ed2487850cf5e305f1eb09a5f9 (diff)
downloadlobase-a4f50e5358793887a46808f5bfa40f80fb4c4c76.tar.gz
{bin,usr.bin,lib}: move _GNU_SOURCE from Makefile to appropriate source file
-rw-r--r--bin/expr/Makefile1
-rw-r--r--bin/expr/expr.c2
-rw-r--r--bin/ksh/edit.c2
-rw-r--r--bin/ksh/history.c1
-rw-r--r--bin/ksh/io.c1
-rw-r--r--bin/ksh/lex.c4
-rw-r--r--bin/ksh/misc.c1
-rw-r--r--bin/ls/Makefile1
-rw-r--r--bin/ls/utf8.c2
-rw-r--r--bin/md5/Makefile2
-rw-r--r--bin/md5/crc.c2
-rw-r--r--lib/liboutil/Makefile1
-rw-r--r--lib/liboutil/imsg-buffer.c2
-rw-r--r--lib/liboutil/pidfile.c2
-rw-r--r--usr.bin/apply/Makefile1
-rw-r--r--usr.bin/apply/apply.c2
-rw-r--r--usr.bin/awk/Makefile1
-rw-r--r--usr.bin/awk/tran.c2
-rw-r--r--usr.bin/cal/Makefile1
-rw-r--r--usr.bin/cal/cal.c2
-rw-r--r--usr.bin/calendar/Makefile1
-rw-r--r--usr.bin/calendar/io.c2
-rw-r--r--usr.bin/colrm/Makefile1
-rw-r--r--usr.bin/colrm/colrm.c2
-rw-r--r--usr.bin/column/Makefile1
-rw-r--r--usr.bin/column/column.c2
-rw-r--r--usr.bin/fmt/Makefile1
-rw-r--r--usr.bin/fmt/fmt.c2
-rw-r--r--usr.bin/fold/Makefile1
-rw-r--r--usr.bin/fold/fold.c2
-rw-r--r--usr.bin/mktemp/Makefile1
-rw-r--r--usr.bin/mktemp/mktemp.c2
-rw-r--r--usr.bin/newsyslog/Makefile1
-rw-r--r--usr.bin/newsyslog/newsyslog.c2
-rw-r--r--usr.bin/patch/Makefile1
-rw-r--r--usr.bin/patch/backupfile.c2
-rw-r--r--usr.bin/patch/patch.c2
-rw-r--r--usr.bin/rs/Makefile1
-rw-r--r--usr.bin/rs/utf8.c2
-rw-r--r--usr.bin/sort/Makefile1
-rw-r--r--usr.bin/sort/mem.c2
-rw-r--r--usr.bin/touch/Makefile1
-rw-r--r--usr.bin/touch/touch.c2
43 files changed, 50 insertions, 18 deletions
diff --git a/bin/expr/Makefile b/bin/expr/Makefile
index 247c84c..895a65e 100644
--- a/bin/expr/Makefile
+++ b/bin/expr/Makefile
@@ -4,6 +4,5 @@
PROG= expr
SRCS= expr.c
-CPPFLAGS+=-D_GNU_SOURCE
include ${.TOPDIR}/mk/bsd.prog.mk
diff --git a/bin/expr/expr.c b/bin/expr/expr.c
index 99ae1ea..2898ef4 100644
--- a/bin/expr/expr.c
+++ b/bin/expr/expr.c
@@ -6,6 +6,8 @@
* Public domain.
*/
+#define _GNU_SOURCE
+
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
diff --git a/bin/ksh/edit.c b/bin/ksh/edit.c
index fb85f9f..66fe96d 100644
--- a/bin/ksh/edit.c
+++ b/bin/ksh/edit.c
@@ -5,6 +5,8 @@
*
*/
+#define _GNU_SOURCE
+
#include "config.h"
#ifdef EDIT
diff --git a/bin/ksh/history.c b/bin/ksh/history.c
index 8d75212..220fe7e 100644
--- a/bin/ksh/history.c
+++ b/bin/ksh/history.c
@@ -13,6 +13,7 @@
* to work on your system
*/
+#include <sys/file.h>
#include <sys/stat.h>
#include <sys/uio.h>
diff --git a/bin/ksh/io.c b/bin/ksh/io.c
index 16a0709..99fa0a8 100644
--- a/bin/ksh/io.c
+++ b/bin/ksh/io.c
@@ -9,6 +9,7 @@
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
+#include <stdlib.h>
#include <string.h>
#include <unistd.h>
diff --git a/bin/ksh/lex.c b/bin/ksh/lex.c
index c33a0b9..f356d0a 100644
--- a/bin/ksh/lex.c
+++ b/bin/ksh/lex.c
@@ -4,6 +4,10 @@
* lexical analysis and source input
*/
+#define _GNU_SOURCE
+
+#include <sys/time.h>
+
#include <ctype.h>
#include <errno.h>
#include <libgen.h>
diff --git a/bin/ksh/misc.c b/bin/ksh/misc.c
index 9ef6e64..e915ece 100644
--- a/bin/ksh/misc.c
+++ b/bin/ksh/misc.c
@@ -7,6 +7,7 @@
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
+#include <grp.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
diff --git a/bin/ls/Makefile b/bin/ls/Makefile
index 077e0b7..eb94833 100644
--- a/bin/ls/Makefile
+++ b/bin/ls/Makefile
@@ -6,6 +6,5 @@ PROG= ls
SRCS= cmp.c ls.c main.c print.c util.c utf8.c
DPADD= ${LIBUTIL}
LDADD= -loutil
-CPPFLAGS+=-D_GNU_SOURCE
include ${.TOPDIR}/mk/bsd.prog.mk
diff --git a/bin/ls/utf8.c b/bin/ls/utf8.c
index 08511f4..89f8a08 100644
--- a/bin/ls/utf8.c
+++ b/bin/ls/utf8.c
@@ -16,6 +16,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#define _GNU_SOURCE
+
#ifndef SMALL
#include <stdio.h>
#include <stdlib.h>
diff --git a/bin/md5/Makefile b/bin/md5/Makefile
index 4d18929..4cbc964 100644
--- a/bin/md5/Makefile
+++ b/bin/md5/Makefile
@@ -10,7 +10,7 @@ LINKS= ${BINDIR}/md5 ${BINDIR}/sha1 \
${BINDIR}/md5 ${BINDIR}/sha512 \
${BINDIR}/md5 ${BINDIR}/cksum
-CPPFLAGS+= -I${.CURDIR} -D_GNU_SOURCE
+CPPFLAGS+= -I${.CURDIR}
COPTS+= -Wall -Wconversion -Wmissing-prototypes
include ${.TOPDIR}/mk/bsd.prog.mk
diff --git a/bin/md5/crc.c b/bin/md5/crc.c
index 05a253f..2de1124 100644
--- a/bin/md5/crc.c
+++ b/bin/md5/crc.c
@@ -16,6 +16,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#define _GNU_SOURCE
+
#include <sys/types.h>
#include <errno.h>
diff --git a/lib/liboutil/Makefile b/lib/liboutil/Makefile
index 42bc023..2530538 100644
--- a/lib/liboutil/Makefile
+++ b/lib/liboutil/Makefile
@@ -5,7 +5,6 @@
.CURDIR?=.
LIB= outil
-CPPFLAGS+=-D_GNU_SOURCE
HDRS= util.h imsg.h
SRCS= bcrypt_pbkdf.c \
diff --git a/lib/liboutil/imsg-buffer.c b/lib/liboutil/imsg-buffer.c
index 821cb95..e753767 100644
--- a/lib/liboutil/imsg-buffer.c
+++ b/lib/liboutil/imsg-buffer.c
@@ -16,6 +16,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#define _GNU_SOURCE
+
#include <sys/types.h>
#include <sys/queue.h>
#include <sys/socket.h>
diff --git a/lib/liboutil/pidfile.c b/lib/liboutil/pidfile.c
index af049d1..e76ba4e 100644
--- a/lib/liboutil/pidfile.c
+++ b/lib/liboutil/pidfile.c
@@ -30,6 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#define _GNU_SOURCE
+
#include <sys/types.h>
#include <errno.h>
#include <paths.h>
diff --git a/usr.bin/apply/Makefile b/usr.bin/apply/Makefile
index 75dd8c3..009173e 100644
--- a/usr.bin/apply/Makefile
+++ b/usr.bin/apply/Makefile
@@ -3,6 +3,5 @@
.TOPDIR?=../..
PROG= apply
-CPPFLAGS+=-D_GNU_SOURCE
include ${.TOPDIR}/mk/bsd.prog.mk
diff --git a/usr.bin/apply/apply.c b/usr.bin/apply/apply.c
index ee9e481..cad43cd 100644
--- a/usr.bin/apply/apply.c
+++ b/usr.bin/apply/apply.c
@@ -33,6 +33,8 @@
* SUCH DAMAGE.
*/
+#define _GNU_SOURCE
+
#include <sys/wait.h>
#include <ctype.h>
diff --git a/usr.bin/awk/Makefile b/usr.bin/awk/Makefile
index b6f5eff..0b3503b 100644
--- a/usr.bin/awk/Makefile
+++ b/usr.bin/awk/Makefile
@@ -9,7 +9,6 @@ DPADD= ${LIBM}
CLEANFILES+=proctab.c maketab ytab.c ytab.h
CFLAGS+=-I. -I${.CURDIR} -DHAS_ISBLANK -DNDEBUG
HOSTCFLAGS+=-I. -I${.CURDIR} -DHAS_ISBLANK -DNDEBUG
-CPPFLAGS+=-D_GNU_SOURCE
# XXX: replace with make depends
lex.o b.o main.o tran.o run.o parse.o lib.o : ytab.h
diff --git a/usr.bin/awk/tran.c b/usr.bin/awk/tran.c
index 9c280d0..6cc4c63 100644
--- a/usr.bin/awk/tran.c
+++ b/usr.bin/awk/tran.c
@@ -23,6 +23,8 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
****************************************************************/
+#define _GNU_SOURCE
+
#define DEBUG
#include <stdio.h>
#include <math.h>
diff --git a/usr.bin/cal/Makefile b/usr.bin/cal/Makefile
index a7e25e9..a9681c6 100644
--- a/usr.bin/cal/Makefile
+++ b/usr.bin/cal/Makefile
@@ -3,6 +3,5 @@
.TOPDIR?=../..
PROG= cal
-CPPFLAGS+=-D_GNU_SOURCE
include ${.TOPDIR}/mk/bsd.prog.mk
diff --git a/usr.bin/cal/cal.c b/usr.bin/cal/cal.c
index a4655bd..79f3d16 100644
--- a/usr.bin/cal/cal.c
+++ b/usr.bin/cal/cal.c
@@ -33,6 +33,8 @@
* SUCH DAMAGE.
*/
+#define _GNU_SOURCE
+
#include <sys/types.h>
#include <ctype.h>
diff --git a/usr.bin/calendar/Makefile b/usr.bin/calendar/Makefile
index 4294f37..ae597f4 100644
--- a/usr.bin/calendar/Makefile
+++ b/usr.bin/calendar/Makefile
@@ -5,7 +5,6 @@
PROG= calendar
SRCS= calendar.c io.c day.c pesach.c ostern.c paskha.c
INTER= de_DE.UTF-8 hr_HR.UTF-8 ru_RU.UTF-8 fr_FR.UTF-8
-CPPFLAGS+=-D_GNU_SOURCE
beforeinstall:
${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 444 \
diff --git a/usr.bin/calendar/io.c b/usr.bin/calendar/io.c
index e4cb689..43dc98c 100644
--- a/usr.bin/calendar/io.c
+++ b/usr.bin/calendar/io.c
@@ -29,6 +29,8 @@
* SUCH DAMAGE.
*/
+#define _GNU_SOURCE
+
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
diff --git a/usr.bin/colrm/Makefile b/usr.bin/colrm/Makefile
index 7adaadd..6cee3c4 100644
--- a/usr.bin/colrm/Makefile
+++ b/usr.bin/colrm/Makefile
@@ -3,6 +3,5 @@
.TOPDIR?=../..
PROG= colrm
-CPPFLAGS+=-D_GNU_SOURCE -D_XOPEN_SOURCE
include ${.TOPDIR}/mk/bsd.prog.mk
diff --git a/usr.bin/colrm/colrm.c b/usr.bin/colrm/colrm.c
index d4fcfe7..94f1415 100644
--- a/usr.bin/colrm/colrm.c
+++ b/usr.bin/colrm/colrm.c
@@ -30,6 +30,8 @@
* SUCH DAMAGE.
*/
+#define _GNU_SOURCE
+
#include <sys/types.h>
#include <err.h>
diff --git a/usr.bin/column/Makefile b/usr.bin/column/Makefile
index a64d2bd..d5ea645 100644
--- a/usr.bin/column/Makefile
+++ b/usr.bin/column/Makefile
@@ -3,6 +3,5 @@
.TOPDIR?=../..
PROG= column
-CPPFLAGS+=-D_GNU_SOURCE -D_XOPEN_SOURCE
include ${.TOPDIR}/mk/bsd.prog.mk
diff --git a/usr.bin/column/column.c b/usr.bin/column/column.c
index 9453dba..0a327a1 100644
--- a/usr.bin/column/column.c
+++ b/usr.bin/column/column.c
@@ -30,6 +30,8 @@
* SUCH DAMAGE.
*/
+#define _GNU_SOURCE
+
#include <sys/types.h>
#include <sys/ioctl.h>
diff --git a/usr.bin/fmt/Makefile b/usr.bin/fmt/Makefile
index 8049568..54ed4c9 100644
--- a/usr.bin/fmt/Makefile
+++ b/usr.bin/fmt/Makefile
@@ -4,6 +4,5 @@
PROG= fmt
SRCS= fmt.c
-CPPFLAGS+=-D_XOPEN_SOURCE
include ${.TOPDIR}/mk/bsd.prog.mk
diff --git a/usr.bin/fmt/fmt.c b/usr.bin/fmt/fmt.c
index c2f50d8..416fa79 100644
--- a/usr.bin/fmt/fmt.c
+++ b/usr.bin/fmt/fmt.c
@@ -174,6 +174,8 @@
* been tested on my FreeBSD machine. Your mileage may vary.
*/
+#define _GNU_SOURCE
+
#include <ctype.h>
#include <err.h>
#include <locale.h>
diff --git a/usr.bin/fold/Makefile b/usr.bin/fold/Makefile
index 564d539..7ae00bf 100644
--- a/usr.bin/fold/Makefile
+++ b/usr.bin/fold/Makefile
@@ -3,6 +3,5 @@
.TOPDIR?=../..
PROG= fold
-CPPFLAGS+=-D_XOPEN_SOURCE
include ${.TOPDIR}/mk/bsd.prog.mk
diff --git a/usr.bin/fold/fold.c b/usr.bin/fold/fold.c
index cdb6e99..790706e 100644
--- a/usr.bin/fold/fold.c
+++ b/usr.bin/fold/fold.c
@@ -33,6 +33,8 @@
* SUCH DAMAGE.
*/
+#define _GNU_SOURCE
+
#include <ctype.h>
#include <err.h>
#include <limits.h>
diff --git a/usr.bin/mktemp/Makefile b/usr.bin/mktemp/Makefile
index 1e9dc53..6d406ca 100644
--- a/usr.bin/mktemp/Makefile
+++ b/usr.bin/mktemp/Makefile
@@ -3,6 +3,5 @@
.TOPDIR?=../..
PROG= mktemp
-CPPFLAGS+=-D_GNU_SOURCE
include ${.TOPDIR}/mk/bsd.prog.mk
diff --git a/usr.bin/mktemp/mktemp.c b/usr.bin/mktemp/mktemp.c
index 713b67f..ae6075c 100644
--- a/usr.bin/mktemp/mktemp.c
+++ b/usr.bin/mktemp/mktemp.c
@@ -17,6 +17,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#define _GNU_SOURCE
+
#include <err.h>
#include <paths.h>
#include <stdarg.h>
diff --git a/usr.bin/newsyslog/Makefile b/usr.bin/newsyslog/Makefile
index 3de4e08..4380724 100644
--- a/usr.bin/newsyslog/Makefile
+++ b/usr.bin/newsyslog/Makefile
@@ -3,7 +3,6 @@
.TOPDIR?=../..
PROG= newsyslog
-CPPFLAGS+=-D_GNU_SOURCE
BINOWN= root
diff --git a/usr.bin/newsyslog/newsyslog.c b/usr.bin/newsyslog/newsyslog.c
index b327c53..4dd8874 100644
--- a/usr.bin/newsyslog/newsyslog.c
+++ b/usr.bin/newsyslog/newsyslog.c
@@ -71,6 +71,8 @@
*
*/
+#define _GNU_SOURCE
+
#define CONF "/etc/newsyslog.conf"
#define PIDFILE "/var/run/syslog.pid"
#define COMPRESS "/usr/bin/gzip"
diff --git a/usr.bin/patch/Makefile b/usr.bin/patch/Makefile
index e1c436d..711f4aa 100644
--- a/usr.bin/patch/Makefile
+++ b/usr.bin/patch/Makefile
@@ -4,6 +4,5 @@
PROG= patch
SRCS= patch.c pch.c inp.c util.c backupfile.c mkpath.c ed.c
-CPPFLAGS+=-D_GNU_SOURCE
include ${.TOPDIR}/mk/bsd.prog.mk
diff --git a/usr.bin/patch/backupfile.c b/usr.bin/patch/backupfile.c
index 9cfc18f..407bb7e 100644
--- a/usr.bin/patch/backupfile.c
+++ b/usr.bin/patch/backupfile.c
@@ -16,6 +16,8 @@
* David MacKenzie <djm@ai.mit.edu>. Some algorithms adapted from GNU Emacs.
*/
+#define _GNU_SOURCE
+
#include <ctype.h>
#include <dirent.h>
#include <libgen.h>
diff --git a/usr.bin/patch/patch.c b/usr.bin/patch/patch.c
index 318a537..055973a 100644
--- a/usr.bin/patch/patch.c
+++ b/usr.bin/patch/patch.c
@@ -26,6 +26,8 @@
* behaviour
*/
+#define _GNU_SOURCE
+
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
diff --git a/usr.bin/rs/Makefile b/usr.bin/rs/Makefile
index ebec6e3..2714193 100644
--- a/usr.bin/rs/Makefile
+++ b/usr.bin/rs/Makefile
@@ -4,6 +4,5 @@
PROG= rs
SRCS= rs.c utf8.c
-CPPFLAGS+=-D_GNU_SOURCE -D_XOPEN_SOURCE
include ${.TOPDIR}/mk/bsd.prog.mk
diff --git a/usr.bin/rs/utf8.c b/usr.bin/rs/utf8.c
index c779d74..ff4b3b1 100644
--- a/usr.bin/rs/utf8.c
+++ b/usr.bin/rs/utf8.c
@@ -14,6 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#define _GNU_SOURCE
+
#include <err.h>
#include <stdlib.h>
#include <string.h>
diff --git a/usr.bin/sort/Makefile b/usr.bin/sort/Makefile
index e815c18..ba1cd8f 100644
--- a/usr.bin/sort/Makefile
+++ b/usr.bin/sort/Makefile
@@ -5,6 +5,5 @@
PROG= sort
SRCS= bwstring.c coll.c file.c mem.c radixsort.c sort.c vsort.c
-CPPFLAGS+=-D_GNU_SOURCE
include ${.TOPDIR}/mk/bsd.prog.mk
diff --git a/usr.bin/sort/mem.c b/usr.bin/sort/mem.c
index 000e187..def25f2 100644
--- a/usr.bin/sort/mem.c
+++ b/usr.bin/sort/mem.c
@@ -27,6 +27,8 @@
* SUCH DAMAGE.
*/
+#define _GNU_SOURCE
+
#include <err.h>
#include <stdio.h>
#include <string.h>
diff --git a/usr.bin/touch/Makefile b/usr.bin/touch/Makefile
index a410b62..43b6731 100644
--- a/usr.bin/touch/Makefile
+++ b/usr.bin/touch/Makefile
@@ -3,6 +3,5 @@
.TOPDIR?=../..
PROG= touch
-CPPFLAGS+=-D_XOPEN_SOURCE -D_GNU_SOURCE
include ${.TOPDIR}/mk/bsd.prog.mk
diff --git a/usr.bin/touch/touch.c b/usr.bin/touch/touch.c
index ec4821e..2f430ee 100644
--- a/usr.bin/touch/touch.c
+++ b/usr.bin/touch/touch.c
@@ -30,6 +30,8 @@
* SUCH DAMAGE.
*/
+#define _GNU_SOURCE
+
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>