SHA256
1
0
forked from pool/postfix
postfix/dynamic_maps_pie.patch

788 lines
21 KiB
Diff

Index: makedefs
===================================================================
--- makedefs.orig
+++ makedefs
@@ -682,4 +682,5 @@ AWK = $AWK
STRCASE = $STRCASE
EXPORT = AUXLIBS='$AUXLIBS' CCARGS='$CCARGS' OPT='$OPT' DEBUG='$DEBUG'
WARN = $WARN
+PIE = $PIE
EOF
Index: src/anvil/Makefile.in
===================================================================
--- src/anvil/Makefile.in.orig
+++ src/anvil/Makefile.in
@@ -9,11 +9,14 @@ TESTPROG=
PROG = anvil
INC_DIR = ../../include
LIBS = ../../lib/libmaster.a ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/bounce/Makefile.in
===================================================================
--- src/bounce/Makefile.in.orig
+++ src/bounce/Makefile.in
@@ -16,13 +16,16 @@ PROG = bounce
SAMPLES = ../../conf/bounce.cf.default
INC_DIR = ../../include
LIBS = ../../lib/libmaster.a ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
all: $(PROG) ../../conf/bounce.cf.default
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
# Eliminate dependency on installed Postfix.
../../conf/bounce.cf.default: template_test.ref annotate.pl
Index: src/cleanup/Makefile.in
===================================================================
--- src/cleanup/Makefile.in.orig
+++ src/cleanup/Makefile.in
@@ -20,11 +20,14 @@ PROG = cleanup
INC_DIR = ../../include
LIBS = ../../lib/libmaster.a ../../lib/libmilter.a ../../lib/libglobal.a \
../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/discard/Makefile.in
===================================================================
--- src/discard/Makefile.in.orig
+++ src/discard/Makefile.in
@@ -9,11 +9,14 @@ TESTPROG=
PROG = discard
INC_DIR = ../../include
LIBS = ../../lib/libmaster.a ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/error/Makefile.in
===================================================================
--- src/error/Makefile.in.orig
+++ src/error/Makefile.in
@@ -9,11 +9,14 @@ TESTPROG=
PROG = error
INC_DIR = ../../include
LIBS = ../../lib/libmaster.a ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/flush/Makefile.in
===================================================================
--- src/flush/Makefile.in.orig
+++ src/flush/Makefile.in
@@ -9,11 +9,14 @@ TESTPROG=
PROG = flush
INC_DIR = ../../include
LIBS = ../../lib/libmaster.a ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/fsstone/Makefile.in
===================================================================
--- src/fsstone/Makefile.in.orig
+++ src/fsstone/Makefile.in
@@ -9,6 +9,9 @@ TESTPROG=
PROG = fsstone
INC_DIR = ../../include
LIBS = ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
@@ -20,7 +23,7 @@ Makefile: Makefile.in
cat ../../conf/makedefs.out $? >$@
fsstone: fsstone.o $(LIBS)
- $(CC) $(CFLAGS) -o $@ fsstone.o $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ fsstone.o $(LIBS) $(SYSLIBS) $(PIE)
test: $(TESTPROG)
Index: src/local/Makefile.in
===================================================================
--- src/local/Makefile.in.orig
+++ src/local/Makefile.in
@@ -15,11 +15,14 @@ PROG = local
TESTPROG=
INC_DIR = ../../include
LIBS = ../../lib/libmaster.a ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/master/Makefile.in
===================================================================
--- src/master/Makefile.in.orig
+++ src/master/Makefile.in
@@ -20,7 +20,7 @@ LIB_DIR = ../../lib
INC_DIR = ../../include
BIN_DIR = ../../libexec
-.c.o:; $(CC) `for i in $(LIB_OBJ); do [ $$i = $@ ] && echo -fPIC; done` $(CFLAGS) -c $*.c
+.c.o:; $(CC) -fPIC $(CFLAGS) -c $*.c
all: $(PROG) $(LIB)
@@ -30,7 +30,7 @@ Makefile: Makefile.in
cat ../../conf/makedefs.out $? >$@
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
test: $(TESTPROG)
Index: src/oqmgr/Makefile.in
===================================================================
--- src/oqmgr/Makefile.in.orig
+++ src/oqmgr/Makefile.in
@@ -15,11 +15,14 @@ TESTPROG=
PROG = qmgr
INC_DIR = ../../include
LIBS = ../../lib/libmaster.a ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/pickup/Makefile.in
===================================================================
--- src/pickup/Makefile.in.orig
+++ src/pickup/Makefile.in
@@ -9,11 +9,14 @@ TESTPROG=
PROG = pickup
INC_DIR = ../../include
LIBS = ../../lib/libmaster.a ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/pipe/Makefile.in
===================================================================
--- src/pipe/Makefile.in.orig
+++ src/pipe/Makefile.in
@@ -9,11 +9,14 @@ TESTPROG=
PROG = pipe
INC_DIR = ../../include
LIBS = ../../lib/libmaster.a ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/postalias/Makefile.in
===================================================================
--- src/postalias/Makefile.in.orig
+++ src/postalias/Makefile.in
@@ -9,11 +9,14 @@ TESTPROG=
PROG = postalias
INC_DIR = ../../include
LIBS = ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/postcat/Makefile.in
===================================================================
--- src/postcat/Makefile.in.orig
+++ src/postcat/Makefile.in
@@ -9,11 +9,14 @@ TESTPROG=
PROG = postcat
INC_DIR = ../../include
LIBS = ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/postconf/Makefile.in
===================================================================
--- src/postconf/Makefile.in.orig
+++ src/postconf/Makefile.in
@@ -20,11 +20,14 @@ PROG = postconf
SAMPLES = ../../conf/main.cf.default
INC_DIR = ../../include
LIBS = ../../lib/libxsasl.a ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
../../conf/main.cf.default: $(PROG) Makefile
rm -f $@
Index: src/postdrop/Makefile.in
===================================================================
--- src/postdrop/Makefile.in.orig
+++ src/postdrop/Makefile.in
@@ -9,11 +9,14 @@ TESTPROG=
PROG = postdrop
INC_DIR = ../../include
LIBS = ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/postfix/Makefile.in
===================================================================
--- src/postfix/Makefile.in.orig
+++ src/postfix/Makefile.in
@@ -10,11 +10,14 @@ INC_DIR = ../../include
TESTPROG=
PROG = postfix
LIBS = ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/postkick/Makefile.in
===================================================================
--- src/postkick/Makefile.in.orig
+++ src/postkick/Makefile.in
@@ -9,11 +9,14 @@ TESTPROG=
PROG = postkick
INC_DIR = ../../include
LIBS = ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/postlock/Makefile.in
===================================================================
--- src/postlock/Makefile.in.orig
+++ src/postlock/Makefile.in
@@ -9,11 +9,14 @@ TESTPROG=
PROG = postlock
INC_DIR = ../../include
LIBS = ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/postlog/Makefile.in
===================================================================
--- src/postlog/Makefile.in.orig
+++ src/postlog/Makefile.in
@@ -10,11 +10,14 @@ INC_DIR = ../../include
TESTPROG=
PROG = postlog
LIBS = ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/postmap/Makefile.in
===================================================================
--- src/postmap/Makefile.in.orig
+++ src/postmap/Makefile.in
@@ -9,11 +9,14 @@ TESTPROG=
PROG = postmap
INC_DIR = ../../include
LIBS = ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/postqueue/Makefile.in
===================================================================
--- src/postqueue/Makefile.in.orig
+++ src/postqueue/Makefile.in
@@ -9,11 +9,14 @@ TESTPROG=
PROG = postqueue
INC_DIR = ../../include
LIBS = ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/postsuper/Makefile.in
===================================================================
--- src/postsuper/Makefile.in.orig
+++ src/postsuper/Makefile.in
@@ -9,11 +9,14 @@ TESTPROG=
PROG = postsuper
INC_DIR = ../../include
LIBS = ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/proxymap/Makefile.in
===================================================================
--- src/proxymap/Makefile.in.orig
+++ src/proxymap/Makefile.in
@@ -9,11 +9,14 @@ TESTPROG=
PROG = proxymap
INC_DIR = ../../include
LIBS = ../../lib/libmaster.a ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/qmgr/Makefile.in
===================================================================
--- src/qmgr/Makefile.in.orig
+++ src/qmgr/Makefile.in
@@ -17,11 +17,14 @@ TESTPROG=
PROG = qmgr
INC_DIR = ../../include
LIBS = ../../lib/libmaster.a ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/qmqpd/Makefile.in
===================================================================
--- src/qmqpd/Makefile.in.orig
+++ src/qmqpd/Makefile.in
@@ -9,11 +9,14 @@ TESTPROG=
PROG = qmqpd
INC_DIR = ../../include
LIBS = ../../lib/libmaster.a ../../lib/libglobal.a ../../lib/libdns.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/scache/Makefile.in
===================================================================
--- src/scache/Makefile.in.orig
+++ src/scache/Makefile.in
@@ -9,11 +9,14 @@ TESTPROG=
PROG = scache
INC_DIR = ../../include
LIBS = ../../lib/libmaster.a ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/sendmail/Makefile.in
===================================================================
--- src/sendmail/Makefile.in.orig
+++ src/sendmail/Makefile.in
@@ -9,11 +9,14 @@ TESTPROG=
PROG = sendmail
INC_DIR = ../../include
LIBS = ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/showq/Makefile.in
===================================================================
--- src/showq/Makefile.in.orig
+++ src/showq/Makefile.in
@@ -9,11 +9,14 @@ TESTPROG=
PROG = showq
INC_DIR = ../../include
LIBS = ../../lib/libmaster.a ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/smtp/Makefile.in
===================================================================
--- src/smtp/Makefile.in.orig
+++ src/smtp/Makefile.in
@@ -16,11 +16,14 @@ PROG = smtp
INC_DIR = ../../include
LIBS = ../../lib/libmaster.a ../../lib/libtls.a ../../lib/libdns.a \
../../lib/libxsasl.a ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/smtpd/Makefile.in
===================================================================
--- src/smtpd/Makefile.in.orig
+++ src/smtpd/Makefile.in
@@ -19,11 +19,14 @@ INC_DIR = ../../include
LIBS = ../../lib/libmaster.a ../../lib/libtls.a ../../lib/libdns.a \
../../lib/libxsasl.a ../../lib/libmilter.a ../../lib/libglobal.a \
../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/smtpstone/Makefile.in
===================================================================
--- src/smtpstone/Makefile.in.orig
+++ src/smtpstone/Makefile.in
@@ -9,6 +9,9 @@ TESTPROG=
INC_DIR = ../../include
PROG = smtp-source smtp-sink qmqp-source qmqp-sink
LIBS = ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
@@ -20,16 +23,16 @@ Makefile: Makefile.in
cat ../../conf/makedefs.out $? >$@
smtp-sink: smtp-sink.o $(LIBS)
- $(CC) $(CFLAGS) -o $@ smtp-sink.o $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ smtp-sink.o $(LIBS) $(SYSLIBS) $(PIE)
smtp-source: smtp-source.o $(LIBS)
- $(CC) $(CFLAGS) -o $@ smtp-source.o $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ smtp-source.o $(LIBS) $(SYSLIBS) $(PIE)
qmqp-sink: qmqp-sink.o $(LIBS)
- $(CC) $(CFLAGS) -o $@ qmqp-sink.o $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ qmqp-sink.o $(LIBS) $(SYSLIBS) $(PIE)
qmqp-source: qmqp-source.o $(LIBS)
- $(CC) $(CFLAGS) -o $@ qmqp-source.o $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ qmqp-source.o $(LIBS) $(SYSLIBS) $(PIE)
test: $(TESTPROG)
Index: src/spawn/Makefile.in
===================================================================
--- src/spawn/Makefile.in.orig
+++ src/spawn/Makefile.in
@@ -9,11 +9,14 @@ TESTPROG=
PROG = spawn
INC_DIR = ../../include
LIBS = ../../lib/libmaster.a ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/tlsmgr/Makefile.in
===================================================================
--- src/tlsmgr/Makefile.in.orig
+++ src/tlsmgr/Makefile.in
@@ -10,11 +10,14 @@ PROG = tlsmgr
INC_DIR = ../../include
LIBS = ../../lib/libmaster.a ../../lib/libtls.a ../../lib/libglobal.a \
../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/trivial-rewrite/Makefile.in
===================================================================
--- src/trivial-rewrite/Makefile.in.orig
+++ src/trivial-rewrite/Makefile.in
@@ -12,13 +12,16 @@ LIBS = ../../lib/libmaster.a ../../lib/l
LIB_DIR = ../../lib
INC_DIR = ../../include
BIN_DIR = ../../libexec
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
all: $(PROG) $(LIB)
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/verify/Makefile.in
===================================================================
--- src/verify/Makefile.in.orig
+++ src/verify/Makefile.in
@@ -9,11 +9,14 @@ TESTPROG=
PROG = verify
INC_DIR = ../../include
LIBS = ../../lib/libmaster.a ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/virtual/Makefile.in
===================================================================
--- src/virtual/Makefile.in.orig
+++ src/virtual/Makefile.in
@@ -9,11 +9,14 @@ PROG = virtual
TESTPROG=
INC_DIR = ../../include
LIBS = ../../lib/libmaster.a ../../lib/libglobal.a ../../lib/libutil.a
+ifdef PIE
+CFLAGS += -fPIE
+endif
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) $(PIE)
$(OBJS): ../../conf/makedefs.out
Index: src/xsasl/Makefile.in
===================================================================
--- src/xsasl/Makefile.in.orig
+++ src/xsasl/Makefile.in
@@ -18,7 +18,7 @@ LIB_DIR = ../../lib
INC_DIR = ../../include
MAKES =
-.c.o:; $(CC) $(CFLAGS) -c $*.c
+.c.o:; $(CC) -fPIC $(CFLAGS) -c $*.c
all: $(LIB)