Implement --enable-gprof option in configure script.
diff --git a/libelf/Makefile.am b/libelf/Makefile.am
index d9caac6..3853608 100644
--- a/libelf/Makefile.am
+++ b/libelf/Makefile.am
@@ -17,10 +17,13 @@
##
DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
if MUDFLAP
-AM_CFLAGS = -fpic -fmudflap
+AM_CFLAGS = -fmudflap
else
AM_CFLAGS =
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..