From 596eeb57dc79eb4ad8293282639194ae5bb7e12e Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sun, 22 Mar 2015 12:30:59 +0000 Subject: Update CFLAGS to avoid deprication warning for glibc 2.21 and later. --- Makefile | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 37351f7..9d37f91 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,9 @@ +#!/bin/make +# +# Makefile for libnsfb +# +# Copyright 2013-2015 Vincent Sanders + # Component settings COMPONENT := nsfb COMPONENT_VERSION := 0.1.3 @@ -15,13 +21,24 @@ TESTRUNNER = test/runtest.sh $(BUILDDIR) $(EXEEXT) # Toolchain flags WARNFLAGS := -Wall -Wextra -Wundef -Wpointer-arith -Wcast-align \ -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \ - -Wmissing-declarations -Wnested-externs -Werror - + -Wmissing-declarations -Wnested-externs +# Non release variants should make compile warnings errors +ifneq ($(VARIANT),release) + WARNFLAGS:= $(WARNFLAGS) -Werror +endif # would like these flags but gcc earlier than 4.4 fail #-pedantic -Wno-overlength-strings # For nsglobe.c -CFLAGS := -g -std=c99 -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112L \ - -I$(CURDIR)/include/ -I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS) -Wno-error +CFLAGS := -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200112L \ + -I$(CURDIR)/include/ -I$(CURDIR)/src \ + $(WARNFLAGS) $(CFLAGS) +# Cope with gcc 2 +ifneq ($(GCCVER),2) + CFLAGS := $(CFLAGS) -std=c99 +else + # __inline__ is a GCCism + CFLAGS := $(CFLAGS) -Dinline="__inline__" +endif NSFB_XCB_PKG_NAMES := xcb xcb-icccm xcb-image xcb-keysyms xcb-atom -- cgit v1.2.3