 bin/adv1tov2/Makefile.am     |    4 ++++
 bin/aecho/Makefile.am        |    4 ++++
 bin/afile/Makefile.am        |    4 ++++
 bin/afppasswd/Makefile.am    |    5 ++++-
 bin/cnid/Makefile.am         |    5 ++++-
 bin/getzones/Makefile.am     |    4 ++++
 bin/megatron/Makefile.am     |    4 ++++
 bin/nbp/Makefile.am          |    4 ++++
 bin/pap/Makefile.am          |    4 ++++
 bin/psorder/Makefile.am      |    4 ++++
 bin/uniconv/Makefile.am      |    4 ++++
 contrib/printing/Makefile.am |    4 ++++
 etc/afpd/Makefile.am         |    6 +++++-
 etc/atalkd/Makefile.am       |    5 ++++-
 etc/cnid_dbd/Makefile.am     |    5 +++++
 etc/papd/Makefile.am         |    5 +++++
 etc/psf/Makefile.am          |    5 +++++
 17 files changed, 72 insertions(+), 4 deletions(-)

--- a/bin/adv1tov2/Makefile.am
+++ b/bin/adv1tov2/Makefile.am
@@ -6,3 +6,7 @@ bin_PROGRAMS = adv1tov2
 
 adv1tov2_SOURCES = adv1tov2.c
 adv1tov2_LDADD = $(top_builddir)/libatalk/libatalk.la
+PIECFLAGS = -fpie
+PIELDFLAGS = -pie
+LDFLAGS = $(PIE_LDFLAGS)
+CFLAGS = @CFLAGS@ $(PIECFLAGS) $(PIELDFLAGS)
--- a/bin/aecho/Makefile.am
+++ b/bin/aecho/Makefile.am
@@ -6,3 +6,7 @@ bin_PROGRAMS = aecho
 
 aecho_SOURCES = aecho.c
 aecho_LDADD = $(top_builddir)/libatalk/libatalk.la
+PIECFLAGS = -fpie
+PIELDFLAGS = -pie
+LDFLAGS = $(PIE_LDFLAGS)
+CFLAGS = @CFLAGS@ $(PIECFLAGS) $(PIELDFLAGS)
--- a/bin/afile/Makefile.am
+++ b/bin/afile/Makefile.am
@@ -9,3 +9,7 @@ afile_SOURCES = afile.c common.c common.
 achfile_SOURCES = achfile.c common.c common.h
 
 EXTRA_DIST = acleandir.rc
+PIECFLAGS = -fpie
+PIELDFLAGS = -pie
+LDFLAGS = $(PIE_LDFLAGS)
+CFLAGS = @CFLAGS@ $(PIECFLAGS) $(PIELDFLAGS)
--- a/bin/afppasswd/Makefile.am
+++ b/bin/afppasswd/Makefile.am
@@ -11,10 +11,14 @@ endif
 afppasswd_SOURCES = afppasswd.c
 afppasswd_LDADD = $(top_builddir)/libatalk/libatalk.la @SSL_LIBS@
 
+PIECFLAGS = -fpie
+PIELDFLAGS = -pie
+LDFLAGS = $(PIE_LDFLAGS)
 CFLAGS = @CFLAGS@ @SSL_CFLAGS@ -I$(top_srcdir)/sys \
+    $(PIECFLAGS) $(PIELDFLAGS) \
     -D_PATH_AFPDPWFILE=\"$(pkgconfdir)/afppasswd\"
 
 install-exec-hook:
 if USE_DHX
 	chmod u+s $(DESTDIR)$(bindir)/afppasswd
-endif
\ No newline at end of file
+endif
--- a/bin/cnid/Makefile.am
+++ b/bin/cnid/Makefile.am
@@ -15,4 +15,7 @@ cnid_index_LDADD = $(top_builddir)/libat
 
 LIBS = @LIBS@ @BDB_LIBS@
  
-CFLAGS = @CFLAGS@ @BDB_CFLAGS@ 
+PIECFLAGS = -fpie
+PIELDFLAGS = -pie
+LDFLAGS = $(PIE_LDFLAGS)
+CFLAGS = @CFLAGS@ @BDB_CFLAGS@ $(PIECFLAGS) $(PIELDFLAGS)
--- a/bin/getzones/Makefile.am
+++ b/bin/getzones/Makefile.am
@@ -6,3 +6,7 @@ bin_PROGRAMS = getzones
 
 getzones_SOURCES = getzones.c
 getzones_LDADD = $(top_builddir)/libatalk/libatalk.la
+PIECFLAGS = -fpie
+PIELDFLAGS = -pie
+LDFLAGS = $(PIE_LDFLAGS)
+CFLAGS = @CFLAGS@ $(PIECFLAGS) $(PIELDFLAGS)
--- a/bin/megatron/Makefile.am
+++ b/bin/megatron/Makefile.am
@@ -10,6 +10,10 @@ megatron_LDADD = $(top_builddir)/libatal
 noinst_HEADERS = asingle.h megatron.h hqx.h macbin.h nad.h
 
 LINKS = unbin unhex unsingle hqx2bin single2bin macbinary binheader nadheader
+PIECFLAGS = -fpie
+PIELDFLAGS = -pie
+LDFLAGS = $(PIE_LDFLAGS)
+CFLAGS = @CFLAGS@ $(PIECFLAGS) $(PIELDFLAGS)
 
 install-exec-hook:
 	@for LINK in $(LINKS); do \
--- a/bin/nbp/Makefile.am
+++ b/bin/nbp/Makefile.am
@@ -12,3 +12,7 @@ nbprgstr_LDADD = $(top_builddir)/libatal
 
 nbpunrgstr_SOURCES = nbpunrgstr.c
 nbpunrgstr_LDADD = $(top_builddir)/libatalk/libatalk.la
+PIECFLAGS = -fpie
+PIELDFLAGS = -pie
+LDFLAGS = $(PIE_LDFLAGS)
+CFLAGS = @CFLAGS@ $(PIECFLAGS) $(PIELDFLAGS)
--- a/bin/pap/Makefile.am
+++ b/bin/pap/Makefile.am
@@ -9,3 +9,7 @@ pap_LDADD = $(top_builddir)/libatalk/lib
 
 papstatus_SOURCES = papstatus.c
 papstatus_LDADD = $(top_builddir)/libatalk/libatalk.la
+PIECFLAGS = -fpie
+PIELDFLAGS = -pie
+LDFLAGS = $(PIE_LDFLAGS)
+CFLAGS = @CFLAGS@ $(PIECFLAGS) $(PIELDFLAGS)
--- a/bin/psorder/Makefile.am
+++ b/bin/psorder/Makefile.am
@@ -8,3 +8,7 @@ psorder_SOURCES = psorder.c pa.c
 psorder_LDADD = $(top_builddir)/libatalk/libatalk.la
 
 noinst_HEADERS = psorder.h pa.h
+PIECFLAGS = -fpie
+PIELDFLAGS = -pie
+LDFLAGS = $(PIE_LDFLAGS)
+CFLAGS = @CFLAGS@ $(PIECFLAGS) $(PIELDFLAGS)
--- a/bin/uniconv/Makefile.am
+++ b/bin/uniconv/Makefile.am
@@ -6,3 +6,7 @@ bin_PROGRAMS = uniconv
 
 uniconv_SOURCES = uniconv.c iso8859_1_adapted.c
 uniconv_LDADD = $(top_builddir)/libatalk/cnid/libcnid.la $(top_builddir)/libatalk/libatalk.la
+PIECFLAGS = -fpie
+PIELDFLAGS = -pie
+LDFLAGS = $(PIE_LDFLAGS)
+CFLAGS = @CFLAGS@ $(PIECFLAGS) $(PIELDFLAGS)
--- a/contrib/printing/Makefile.am
+++ b/contrib/printing/Makefile.am
@@ -4,3 +4,7 @@ bin_PROGRAMS = timeout
 
 timeout_SOURCES = timeout.c
 timeout_LDADD = $(top_builddir)/libatalk/libatalk.la
+PIECFLAGS = -fpie
+PIELDFLAGS = -pie
+LDFLAGS = $(PIE_LDFLAGS)
+CFLAGS = @CFLAGS@ $(PIECFLAGS) $(PIELDFLAGS)
--- a/etc/afpd/Makefile.am
+++ b/etc/afpd/Makefile.am
@@ -18,9 +18,13 @@ noinst_HEADERS = auth.h afp_config.h des
 	 uam_auth.h uid.h unix.h volume.h
 
 LIBS = @LIBS@ @PAM_LIBS@ @QUOTA_LIBS@ @SLP_LIBS@ @WRAP_LIBS@
-
+PIECFLAGS = -fPIE
+PIELDFLAGS = -pie
+LDFLAGS = $(PIE_LDFLAGS)
 CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/sys \
 	 @CFLAGS@ @SLP_CFLAGS@ \
+	 $(PIECFLAGS) \
+	 $(PIELDFLAGS) \
 	 -D_PATH_AFPDDEFVOL=\"$(pkgconfdir)/AppleVolumes.default\" \
 	 -D_PATH_AFPDSYSVOL=\"$(pkgconfdir)/AppleVolumes.system\" \
 	 -D_PATH_AFPDPWFILE=\"$(pkgconfdir)/afppasswd\" \
--- a/etc/atalkd/Makefile.am
+++ b/etc/atalkd/Makefile.am
@@ -19,4 +19,7 @@ noinst_HEADERS =	\
 	rtmp.h		\
 	zip.h
 
-CFLAGS = @CFLAGS@ -D_PATH_ATALKDCONF=\"$(pkgconfdir)/atalkd.conf\"
+PIECFLAGS = -fpie
+PIELDFLAGS = -pie
+LDFLAGS = $(PIE_LDFLAGS)
+CFLAGS = @CFLAGS@ $(PIECFLAGS) $(PIELDFLAGS) -D_PATH_ATALKDCONF=\"$(pkgconfdir)/atalkd.conf\"
--- a/etc/cnid_dbd/Makefile.am
+++ b/etc/cnid_dbd/Makefile.am
@@ -24,5 +24,10 @@ EXTRA_DIST = README
 LIBS = @LIBS@ @BDB_LIBS@
 
 
+PIECFLAGS = -fpie
+PIELDFLAGS = -pie
+LDFLAGS = $(PIE_LDFLAGS)
 CFLAGS = @CFLAGS@ @BDB_CFLAGS@ \
+	$(PIECFLAGS) \
+	 $(PIELDFLAGS) \
          -D_PATH_CNID_DBD=\"$(sbindir)/cnid_dbd\"
--- a/etc/papd/Makefile.am
+++ b/etc/papd/Makefile.am
@@ -27,9 +27,14 @@ noinst_HEADERS =	\
 	print_cups.h	\
 	uam_auth.h
 
+PIECFLAGS = -fpie
+PIELDFLAGS = -pie
+LDFLAGS = $(PIE_LDFLAGS)
 CFLAGS = \
 	-I$(top_srcdir)/include -I$(top_srcdir)/sys \
 	@CFLAGS@ @CUPS_CFLAGS@\
+	$(PIECFLAGS) \
+	 $(PIELDFLAGS) \
 	-D_PATH_PAPDCONF=\"$(pkgconfdir)/papd.conf\" \
 	-D_PATH_PAPDUAMPATH=\"$(UAMS_PATH)/\" \
  	-DSPOOLDIR=\"$(spooldir)/\"
--- a/etc/psf/Makefile.am
+++ b/etc/psf/Makefile.am
@@ -8,7 +8,12 @@ pkgdata_DATA = pagecount.ps
 psf_SOURCES = psf.c
 psa_SOURCES = psa.c
 
+PIECFLAGS = -fpie
+PIELDFLAGS = -pie
+LDFLAGS = $(PIE_LDFLAGS)
 CFLAGS = @CFLAGS@ -DZEROWIDTH \
+	$(PIECFLAGS) \
+	 $(PIELDFLAGS) \
 	-D_PATH_PAP=\"$(bindir)/pap\" \
 	-D_PATH_PSORDER=\"$(bindir)/psorder\" \
 	-D_PATH_PSA=\"$(libexecdir)/psa\" \
