File hsflowd-obey-cflags.diff of Package hsflowd

diff --git a/src/Linux/Makefile b/src/Linux/Makefile
index 6130f48..a9554fe 100644
--- a/src/Linux/Makefile
+++ b/src/Linux/Makefile
@@ -143,12 +143,12 @@ SFLOWDIR=../sflow
 JSONDIR=../json
 
 # CFLAGS and LIBS - common
-CFLAGS_HSFLOWD= -I. -I$(JSONDIR) -I$(SFLOWDIR)
+CFLAGS_HSFLOWD= -I. -I$(JSONDIR) -I$(SFLOWDIR) -fPIE
 LIBS_HSFLOWD= $(JSONDIR)/libcjson.a $(SFLOWDIR)/libsflow.a -lm -pthread -ldl -lrt
 
 CFLAGS_SHARED= -fPIC
 LDFLAGS_SHARED= -shared
-# LDFLAGS_SHARED += --build-id
+LDFLAGS_SHARED += --build-id
 
 # CFLAGS and LIBS - modules
 CFLAGS_JSON=
@@ -217,7 +217,7 @@ CFLAGS_EAPI=
 LIBS_EAPI=
 
 # common CFLAGS and LIBS	
-CFLAGS = $(CFLAGS_HSFLOWD) $(CFLAGS_LOAD) $(CFLAGS_SHARED) $(OPT) -D_GNU_SOURCE -DHSP_VERSION=$(VERSION)
+CFLAGS = $(EXTRA_FLAGS) $(CFLAGS_HSFLOWD) $(CFLAGS_LOAD) $(CFLAGS_SHARED) $(OPT) -D_GNU_SOURCE -DHSP_VERSION=$(VERSION)
 CFLAGS += $(CFLAGS_MOUNTPOINTS)
 CFLAGS += -DUTHEAP
 CFLAGS += -DHSP_OPTICAL_STATS
@@ -321,7 +321,7 @@ EAPI: mod_eapi.so
 #########  hsflowd  #########
 
 hsflowd: $(OBJS_HSFLOWD) $(HEADERS)
-	$(CC) $(CFLAGS) -o $@ $(OBJS_HSFLOWD) $(LIBS) $(LIBS_HSFLOWD) -rdynamic
+	$(CC) $(CFLAGS) -o $@ $(OBJS_HSFLOWD) $(LIBS) $(LIBS_HSFLOWD) -pie -rdynamic
 
 ######## DBUS utils ##########
 
diff --git a/src/json/Makefile b/src/json/Makefile
index 8adbaea..7ab3297 100644
--- a/src/json/Makefile
+++ b/src/json/Makefile
@@ -11,7 +11,7 @@ INSTALL_LIBRARY_PATH = $(DESTDIR)$(PREFIX)/$(LIBRARY_PATH)
 
 INSTALL ?= cp -a
 
-R_CFLAGS = -fpic $(CFLAGS) -Wall -Werror -Wstrict-prototypes -Wwrite-strings -D_POSIX_C_SOURCE=200112L $(OPT)
+R_CFLAGS = -fPIC -fPIE $(EXTRA_FLAGS) $(CFLAGS) -Wall -Werror -Wstrict-prototypes -Wwrite-strings -D_POSIX_C_SOURCE=200112L $(OPT)
 #R_CFLAGS += -Wno-misleading-indentation
 
 uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo false')
@@ -34,7 +34,7 @@ STLIBNAME = $(LIBNAME).a
 
 .PHONY: all clean install
 
-all: $(DYLIBNAME) $(STLIBNAME) $(TESTS)
+all: $(STLIBNAME)
 
 $(DYLIBNAME): $(OBJ)
 		$(DYLIBCMD) $< $(LDFLAGS)
diff --git a/src/sflow/Makefile b/src/sflow/Makefile
index ecdbd72..cd9c8c5 100644
--- a/src/sflow/Makefile
+++ b/src/sflow/Makefile
@@ -3,12 +3,13 @@
 
 HEADERS= sflow_api.h sflow.h Makefile
 
-OPT = -O3 -DNDEBUG
+#OPT = -O3 -DNDEBUG
 #OPT = -g -ggdb -O2
 #OPT= -g -ggdb
+OPT = -g -O2
 
-CFLAGS= -D_GNU_SOURCE -DSTDC_HEADERS $(OPT) -Wall -Wcast-align
-LDFLAGS=
+CFLAGS = -fPIC -fPIE $(EXTRA_FLAGS) -D_GNU_SOURCE -DSTDC_HEADERS $(OPT) -Wall -Wcast-align
+LDFLAGS = -pie
 
 #CC= g++
 #CC= gcc -std=c99
openSUSE Build Service is sponsored by