Blob Blame History Raw
diff -up dhcp-4.2.1b1/bind/Makefile.PIE-RELRO dhcp-4.2.1b1/bind/Makefile
--- dhcp-4.2.1b1/bind/Makefile.PIE-RELRO	2011-01-21 01:11:42.000000000 +0100
+++ dhcp-4.2.1b1/bind/Makefile	2011-01-28 08:50:13.000000000 +0100
@@ -45,7 +45,7 @@ all:
 # Currently disable the epoll and devpoll options as they don't interact
 # well with the DHCP code.
 	@echo Configuring BIND Export libraries for DHCP.
-	@(cd ${bindsrcdir} && ./configure --disable-kqueue --disable-epoll --disable-devpoll --without-openssl --without-libxml2 --enable-exportlib --enable-threads=no --with-export-includedir=${binddir}/include --with-export-libdir=${binddir}/lib > ${binddir}/configure.log)
+	@(cd ${bindsrcdir} && ./configure --disable-kqueue --disable-epoll --disable-devpoll --without-openssl --without-libxml2 --enable-exportlib --enable-threads=no --with-export-includedir=${binddir}/include --with-export-libdir=${binddir}/lib --with-libtool --with-pic --disable-shared > ${binddir}/configure.log)
 
 # Build the export libraries
 	@echo Building BIND Export libraries - this takes some time.
diff -up dhcp-4.2.1b1/client/Makefile.am.PIE-RELRO dhcp-4.2.1b1/client/Makefile.am
--- dhcp-4.2.1b1/client/Makefile.am.PIE-RELRO	2011-01-28 08:47:43.000000000 +0100
+++ dhcp-4.2.1b1/client/Makefile.am	2011-01-28 08:51:57.000000000 +0100
@@ -4,15 +4,11 @@ dhclient_SOURCES = clparse.c dhclient.c 
 		   scripts/bsdos scripts/freebsd scripts/linux scripts/macos \
 		   scripts/netbsd scripts/nextstep scripts/openbsd \
 		   scripts/solaris scripts/openwrt
+dhclient_CPPFLAGS = -DCLIENT_PATH='"$(sbindir)"' -DLOCALSTATEDIR='"$(localstatedir)"'
+dhclient_CFLAGS = -fpie
 dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \
 		 ../bind/lib/libdns.a ../bind/lib/libisc.a $(CAPNG_LDADD)
+dhclient_LDFLAGS = -pie -Wl,-z,relro -Wl,-z,now
+
 man_MANS = dhclient.8 dhclient-script.8 dhclient.conf.5 dhclient.leases.5
 EXTRA_DIST = $(man_MANS)
-
-dhclient.o: dhclient.c
-	$(COMPILE) -DCLIENT_PATH='"PATH=$(sbindir):/sbin:/bin:/usr/sbin:/usr/bin"' \
-		   -DLOCALSTATEDIR='"$(localstatedir)"' -c dhclient.c
-
-dhc6.o: dhc6.c
-	$(COMPILE) -DCLIENT_PATH='"PATH=$(sbindir):/sbin:/bin:/usr/sbin:/usr/bin"' \
-		   -DLOCALSTATEDIR='"$(localstatedir)"' -c dhc6.c
diff -up dhcp-4.2.1b1/common/Makefile.am.PIE-RELRO dhcp-4.2.1b1/common/Makefile.am
--- dhcp-4.2.1b1/common/Makefile.am.PIE-RELRO	2009-10-28 05:12:29.000000000 +0100
+++ dhcp-4.2.1b1/common/Makefile.am	2011-01-28 08:47:43.000000000 +0100
@@ -1,4 +1,5 @@
 AM_CPPFLAGS = -I.. -DLOCALSTATEDIR='"@localstatedir@"'
+AM_CFLAGS = -fpic
 
 noinst_LIBRARIES = libdhcp.a
 libdhcp_a_SOURCES = alloc.c bpf.c comapi.c conflex.c ctrace.c discover.c \
diff -up dhcp-4.2.1b1/omapip/Makefile.am.PIE-RELRO dhcp-4.2.1b1/omapip/Makefile.am
--- dhcp-4.2.1b1/omapip/Makefile.am.PIE-RELRO	2010-02-12 01:13:54.000000000 +0100
+++ dhcp-4.2.1b1/omapip/Makefile.am	2011-01-28 08:47:43.000000000 +0100
@@ -1,3 +1,5 @@
+AM_CFLAGS = -fpic
+
 lib_LIBRARIES = libomapi.a
 noinst_PROGRAMS = svtest
 
@@ -10,5 +12,6 @@ man_MANS = omapi.3
 EXTRA_DIST = $(man_MANS)
 
 svtest_SOURCES = test.c
+svtest_CFLAGS = -fpie
 svtest_LDADD = libomapi.a ../bind/lib/libdns.a ../bind/lib/libisc.a
 
diff -up dhcp-4.2.1b1/relay/Makefile.am.PIE-RELRO dhcp-4.2.1b1/relay/Makefile.am
--- dhcp-4.2.1b1/relay/Makefile.am.PIE-RELRO	2009-10-28 05:12:30.000000000 +0100
+++ dhcp-4.2.1b1/relay/Makefile.am	2011-01-28 08:47:43.000000000 +0100
@@ -2,8 +2,11 @@ AM_CPPFLAGS = -DLOCALSTATEDIR='"@localst
 
 sbin_PROGRAMS = dhcrelay
 dhcrelay_SOURCES = dhcrelay.c
+dhcrelay_CFLAGS = -fpie
 dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \
 		 ../bind/lib/libdns.a ../bind/lib/libisc.a
+dhcrelay_LDFLAGS = -pie -Wl,-z,relro -Wl,-z,now
+
 man_MANS = dhcrelay.8
 EXTRA_DIST = $(man_MANS)
 
diff -up dhcp-4.2.1b1/server/Makefile.am.PIE-RELRO dhcp-4.2.1b1/server/Makefile.am
--- dhcp-4.2.1b1/server/Makefile.am.PIE-RELRO	2010-03-24 22:49:47.000000000 +0100
+++ dhcp-4.2.1b1/server/Makefile.am	2011-01-28 08:47:43.000000000 +0100
@@ -6,10 +6,11 @@ dhcpd_SOURCES = dhcpd.c dhcp.c bootp.c c
 		omapi.c mdb.c stables.c salloc.c ddns.c dhcpleasequery.c \
 		dhcpv6.c mdb6.c ldap.c ldap_casa.c
 
-dhcpd_CFLAGS = $(LDAP_CFLAGS)
+dhcpd_CFLAGS = $(LDAP_CFLAGS) -fpie
 dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \
 	      ../dhcpctl/libdhcpctl.a ../bind/lib/libdns.a \
 	      ../bind/lib/libisc.a
+dhcpd_LDFLAGS = -pie -Wl,-z,relro -Wl,-z,now
 
 man_MANS = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5
 EXTRA_DIST = $(man_MANS)