lobase

Linux port of OpenBSDs userland.
Log | Files | Refs | README

commit a4f50e5358793887a46808f5bfa40f80fb4c4c76
parent 8bb3dd2300f887ed2487850cf5e305f1eb09a5f9
Author: Duncaen <mail@duncano.de>
Date:   Thu, 25 May 2017 16:51:31 +0200

{bin,usr.bin,lib}: move _GNU_SOURCE from Makefile to appropriate source file

Diffstat:
bin/expr/Makefile | 1-
bin/expr/expr.c | 2++
bin/ksh/edit.c | 2++
bin/ksh/history.c | 1+
bin/ksh/io.c | 1+
bin/ksh/lex.c | 4++++
bin/ksh/misc.c | 1+
bin/ls/Makefile | 1-
bin/ls/utf8.c | 2++
bin/md5/Makefile | 2+-
bin/md5/crc.c | 2++
lib/liboutil/Makefile | 1-
lib/liboutil/imsg-buffer.c | 2++
lib/liboutil/pidfile.c | 2++
usr.bin/apply/Makefile | 1-
usr.bin/apply/apply.c | 2++
usr.bin/awk/Makefile | 1-
usr.bin/awk/tran.c | 2++
usr.bin/cal/Makefile | 1-
usr.bin/cal/cal.c | 2++
usr.bin/calendar/Makefile | 1-
usr.bin/calendar/io.c | 2++
usr.bin/colrm/Makefile | 1-
usr.bin/colrm/colrm.c | 2++
usr.bin/column/Makefile | 1-
usr.bin/column/column.c | 2++
usr.bin/fmt/Makefile | 1-
usr.bin/fmt/fmt.c | 2++
usr.bin/fold/Makefile | 1-
usr.bin/fold/fold.c | 2++
usr.bin/mktemp/Makefile | 1-
usr.bin/mktemp/mktemp.c | 2++
usr.bin/newsyslog/Makefile | 1-
usr.bin/newsyslog/newsyslog.c | 2++
usr.bin/patch/Makefile | 1-
usr.bin/patch/backupfile.c | 2++
usr.bin/patch/patch.c | 2++
usr.bin/rs/Makefile | 1-
usr.bin/rs/utf8.c | 2++
usr.bin/sort/Makefile | 1-
usr.bin/sort/mem.c | 2++
usr.bin/touch/Makefile | 1-
usr.bin/touch/touch.c | 2++
43 files changed, 50 insertions(+), 18 deletions(-)

diff --git 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 @@ -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 @@ -5,6 +5,8 @@ * */ +#define _GNU_SOURCE + #include "config.h" #ifdef EDIT diff --git 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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -30,6 +30,8 @@ * SUCH DAMAGE. */ +#define _GNU_SOURCE + #include <sys/types.h> #include <sys/stat.h> #include <sys/time.h>