Make sure the generated binary packages comply with the Debian Policy.

Everything used in shared libs has to be compiled with -fPIC, everything used
used in static libs mustn't use -fPIC/-fpic.

I've gone through the build log, and with this patch everything is built with
the right flags. Whee ;-)

Index: elfutils-0.123/backends/Makefile.am
===================================================================
--- elfutils-0.123.orig/backends/Makefile.am	2006-08-15 21:48:43.000000000 +0000
+++ elfutils-0.123/backends/Makefile.am	2006-08-15 21:49:31.000000000 +0000
@@ -32,7 +32,7 @@
 else
 AM_CFLAGS =
 endif
-AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2 \
+AM_CFLAGS += -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2 \
 	     -std=gnu99
 INCLUDES = -I$(srcdir) -I$(top_srcdir)/libebl \
 	   -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \
@@ -81,7 +81,7 @@
 am_libebl_backend_nopic_a_OBJECTS = $(all_SRCS:.c=.o)
 
 %.os: %.c %.o
-	if $(COMPILE) -c -o $@ -fpic -DPIC -DSHARED -MT $@ -MD -MP \
+	if $(COMPILE) -c -o $@ -fPIC -DPIC -DSHARED -MT $@ -MD -MP \
 	  -MF "$(DEPDIR)/$*.Tpo" `test -f '$<' || echo '$(srcdir)/'`$<; \
 	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
 	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
Index: elfutils-0.123/libasm/Makefile.am
===================================================================
--- elfutils-0.123.orig/libasm/Makefile.am	2006-08-15 21:48:33.000000000 +0000
+++ elfutils-0.123/libasm/Makefile.am	2006-08-15 21:48:59.000000000 +0000
@@ -77,7 +77,7 @@
 
 
 %.os: %.c %.o
-	if $(COMPILE.os) -c -o $@ -fpic -DPIC -DSHARED -MT $@ -MD -MP \
+	if $(COMPILE.os) -c -o $@ -fPIC -DPIC -DSHARED -MT $@ -MD -MP \
 	  -MF "$(DEPDIR)/$*.Tpo" `test -f '$<' || echo '$(srcdir)/'`$<; \
 	then cat "$(DEPDIR)/$*.Tpo" >> "$(DEPDIR)/$*.Po"; \
 	     rm -f "$(DEPDIR)/$*.Tpo"; \
Index: elfutils-0.123/libdw/Makefile.am
===================================================================
--- elfutils-0.123.orig/libdw/Makefile.am	2006-08-15 21:48:33.000000000 +0000
+++ elfutils-0.123/libdw/Makefile.am	2006-08-15 21:48:59.000000000 +0000
@@ -31,9 +31,6 @@
 else
 AM_CFLAGS =
 endif
-if BUILD_STATIC
-AM_CFLAGS += -fpic
-endif
 AM_CFLAGS += -Wall -Werror -Wshadow -Wunused -Wformat=2 $(WEXTRA) -std=gnu99
 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I.. -I$(srcdir)/../lib
 VERSION = 1
@@ -103,7 +100,7 @@
 	ln -fs $@ $@.$(VERSION)
 
 %.os: %.c %.o
-	if $(COMPILE.os) -c -o $@ -fpic -DPIC -DSHARED -MT $@ -MD -MP \
+	if $(COMPILE.os) -c -o $@ -fPIC -DPIC -DSHARED -MT $@ -MD -MP \
 	   -MF "$(DEPDIR)/$*.Tpo" `test -f '$<' || echo '$(srcdir)/'`$<; \
 	then cat "$(DEPDIR)/$*.Tpo" >> "$(DEPDIR)/$*.Po"; \
 	     rm -f "$(DEPDIR)/$*.Tpo"; \
Index: elfutils-0.123/libdwfl/Makefile.am
===================================================================
--- elfutils-0.123.orig/libdwfl/Makefile.am	2006-08-15 21:48:33.000000000 +0000
+++ elfutils-0.123/libdwfl/Makefile.am	2006-08-15 21:48:59.000000000 +0000
@@ -91,7 +91,7 @@
 am_libdwfl_pic_a_OBJECTS = $(libdwfl_a_SOURCES:.c=.os)
 
 %.os: %.c %.o
-	if $(COMPILE.os) -c -o $@ -fpic -DPIC -DSHARED -MT $@ -MD -MP \
+	if $(COMPILE.os) -c -o $@ -fPIC -DPIC -DSHARED -MT $@ -MD -MP \
 	   -MF "$(DEPDIR)/$*.Tpo" `test -f '$<' || echo '$(srcdir)/'`$<; \
 	then cat "$(DEPDIR)/$*.Tpo" >> "$(DEPDIR)/$*.Po"; \
 	     rm -f "$(DEPDIR)/$*.Tpo"; \
Index: elfutils-0.123/libebl/Makefile.am
===================================================================
--- elfutils-0.123.orig/libebl/Makefile.am	2006-08-15 21:48:33.000000000 +0000
+++ elfutils-0.123/libebl/Makefile.am	2006-08-15 21:48:59.000000000 +0000
@@ -31,7 +31,7 @@
 else
 AM_CFLAGS =
 endif
-AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2 \
+AM_CFLAGS += -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2 \
 	     -std=gnu99
 
 INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \
@@ -72,7 +72,7 @@
 
 
 %.os: %.c %.o
-	if $(COMPILE) -c -o $@ -fpic -DPIC -DSHARED -MT $@ -MD -MP \
+	if $(COMPILE) -c -o $@ -fPIC -DPIC -DSHARED -MT $@ -MD -MP \
 	  -MF "$(DEPDIR)/$*.Tpo" `test -f '$<' || echo '$(srcdir)/'`$<; \
 	then cat "$(DEPDIR)/$*.Tpo" >> "$(DEPDIR)/$*.Po"; \
 	     rm -f "$(DEPDIR)/$*.Tpo"; \
Index: elfutils-0.123/libelf/Makefile.am
===================================================================
--- elfutils-0.123.orig/libelf/Makefile.am	2006-08-15 21:48:33.000000000 +0000
+++ elfutils-0.123/libelf/Makefile.am	2006-08-15 21:48:59.000000000 +0000
@@ -31,12 +31,6 @@
 else
 AM_CFLAGS =
 endif
-if BUILD_STATIC
-AM_CFLAGS += -fpic
-endif
-if BUILD_STATIC
-AM_CFLAGS += -fpic
-endif
 AM_CFLAGS += -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2 -std=gnu99 \
 	     $($(*F)_CFLAGS)
 INCLUDES = -I$(srcdir) -I$(top_srcdir)/lib -I..
@@ -116,7 +110,7 @@
 	ln -fs $@ $@.$(VERSION)
 
 %.os: %.c %.o
-	if $(COMPILE.os) -c -o $@ -fpic -DPIC -DSHARED -MT $@ -MD -MP \
+	if $(COMPILE.os) -c -o $@ -fPIC -DPIC -DSHARED -MT $@ -MD -MP \
 	  -MF "$(DEPDIR)/$*.Tpo" `test -f '$<' || echo '$(srcdir)/'`$<; \
 	then cat "$(DEPDIR)/$*.Tpo" >> "$(DEPDIR)/$*.Po"; \
 	     rm -f "$(DEPDIR)/$*.Tpo"; \
Index: elfutils-0.123/src/Makefile.am
===================================================================
--- elfutils-0.123.orig/src/Makefile.am	2006-08-15 21:48:33.000000000 +0000
+++ elfutils-0.123/src/Makefile.am	2006-08-15 21:48:59.000000000 +0000
@@ -142,7 +142,7 @@
 
 
 %.os: %.c %.o
-	if $(filter-out -fmudflap,$(COMPILE)) -c -o $@ -fpic -DPIC -DSHARED \
+	if $(filter-out -fmudflap,$(COMPILE)) -c -o $@ -fPIC -DPIC -DSHARED \
 	  -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
 	  `test -f '$<' || echo '$(srcdir)/'`$<; \
 	then cat "$(DEPDIR)/$*.Tpo" >> "$(DEPDIR)/$*.Po"; \
Index: elfutils-0.123/lib/Makefile.am
===================================================================
--- elfutils-0.123.orig/lib/Makefile.am	2006-08-15 21:48:33.000000000 +0000
+++ elfutils-0.123/lib/Makefile.am	2006-08-15 21:48:59.000000000 +0000
@@ -31,7 +31,7 @@
 else
 AM_CFLAGS =
 endif
-AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused $(WEXTRA) $($(*F)_CFLAGS)
+AM_CFLAGS += -fPIC -Wall -Wshadow -Werror -Wunused $(WEXTRA) $($(*F)_CFLAGS)
 INCLUDES = -I$(srcdir)/../libelf -I..
 
 noinst_LIBRARIES = libeu.a

