Subject: Bug#83: Also support CC and LDFLAGS

From: Bernard Cafarelli <[email-masked]>
Date: Tue, 08 Jan 2013 13:15:35 +0100

Nice to see the build system getting better :)

I used a different style to fix this, also allowing CC override and 
custom LDFLAGS. I attach the updated patch for 4.0.0.0

-- 
Bernard Cafarelli (Voyageur)
Gentoo developer (NX, GNUstep, net-misc, llvm/clang, ...)

--- x2goserver/Makefile.orig	2013-01-08 10:44:54.134787510 +0100
+++ x2goserver/Makefile	2013-01-08 10:46:06.721676563 +0100
@@ -3,6 +3,10 @@
 SRC_DIR=$(CURDIR)
 SHELL=/bin/bash
 
+CC?=gcc
+CFLAGS+=-fPIE -pie
+LDFLAGS+=
+
 INSTALL_DIR=install -d -o root -g root -m 755
 INSTALL_FILE=install -o root -g root -m 644
 INSTALL_PROGRAM=install -o root -g root -m 755
@@ -37,7 +41,7 @@
 build-arch: build_setgidwrappers
 
 build_setgidwrappers:
-	gcc -fPIE -pie $(CFLAGS) -o x2gosqlitewrapper x2gosqlitewrapper.c
+	$(CC) $(CFLAGS) $(LDFLAGS) -o x2gosqlitewrapper x2gosqlitewrapper.c
 
 build-indep: build_man2html

---

From: Jan Engelhardt <[email-masked]>
Date: Tue, 8 Jan 2013 22:40:10 +0100 (CET)

On Tuesday 2013-01-08 13:15, Bernard Cafarelli wrote:

> I used a different style to fix this, also allowing CC override and custom
> LDFLAGS. I attach the updated patch for 4.0.0.0

-pie belongs into LDFLAGS.