Implement --enable-gprof option in configure script.
authorUlrich Drepper <drepper@redhat.com>
Sun, 7 Aug 2005 04:41:39 +0000 (04:41 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sun, 7 Aug 2005 04:41:39 +0000 (04:41 +0000)
ChangeLog
configure.ac
lib/ChangeLog
lib/Makefile.am
libelf/ChangeLog
libelf/Makefile.am
src/ChangeLog
src/Makefile.am
tests/ChangeLog
tests/Makefile.am

index 3192cee..9a7850a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-08-06  Ulrich Drepper  <drepper@redhat.com>
+
+       * configure.ac: Add --enable-gprof option.
+
 2005-07-27  Roland McGrath  <roland@redhat.com>
 
        * Makefile.am (all_SUBDIRS): Put libdwfl before libdw.
index 578ec65..960463c 100644 (file)
@@ -16,7 +16,7 @@ dnl You should have received a copy of the GNU General Public License
 dnl along with this program; if not, write to the Free Software Foundation,
 dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 dnl
-AC_INIT([Red Hat elfutils],[0.112],[http://bugzilla.redhat.com/bugzilla/],
+AC_INIT([Red Hat elfutils],[0.113],[http://bugzilla.redhat.com/bugzilla/],
        [elfutils])
 
 AC_CONFIG_AUX_DIR([config])
@@ -129,6 +129,18 @@ if test "$use_mudflap" = fail; then
 fi
 AM_CONDITIONAL(MUDFLAP, test "$use_mudflap" = yes)
 
+# Enable gprof suport.
+AC_ARG_ENABLE([gprof],
+AC_HELP_STRING([--enable-gprof],
+[build binaries with gprof support]), [use_gprof=yes], [use_gprof=no])
+if test "$use_gprof" = yes; then
+  CFLAGS="$CFLAGS -pg"
+  LDFLAGS="$LDFLAGS -pg"
+fi
+AM_CONDITIONAL(GPROF, test "$use_gprof" = yes)
+AM_CONDITIONAL(BUILD_STATIC, [dnl
+test "$use_mudflap" = yes -o "$use_gprof" = yes])
+
 LIBEBL_SUBDIR="$PACKAGE"
 AC_ARG_ENABLE([libebl-subdir],
 AS_HELP_STRING([--enable-libebl-subdir=DIR],
index 9ddc216..5b79d09 100644 (file)
@@ -1,3 +1,7 @@
+2005-08-06  Ulrich Drepper  <drepper@redhat.com>
+
+       * Makefile.am (xmalloc_CFLAGS): Define only if !GPROF.
+
 2005-05-03  Roland McGrath  <roland@redhat.com>
 
        * crc32_file.c: New file.
index facb563..b34d544 100644 (file)
@@ -32,4 +32,6 @@ libeu_a_SOURCES = xstrdup.c xstrndup.c xmalloc.c next_prime.c \
 noinst_HEADERS = fixedsizehash.h system.h dynamicsizehash.h list.h
 EXTRA_DIST = dynamicsizehash.c
 
+if !GPROF
 xmalloc_CFLAGS = -ffunction-sections
+endif
index 5d22c32..4a8bc87 100644 (file)
@@ -1,3 +1,7 @@
+2005-08-06  Ulrich Drepper  <drepper@redhat.com>
+
+       * Makefile.am (AM_CFLAGS): Add -fpic when BUILD_STATIC.
+
 2005-08-03  Ulrich Drepper  <drepper@redhat.com>
 
        * libelf.map: Move elf32_offscn, elf64_offscn, and gelf_offscn in
index d9caac6..3853608 100644 (file)
 ##
 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..
index 6533861..cf315ff 100644 (file)
@@ -1,3 +1,8 @@
+2005-08-06  Ulrich Drepper  <drepper@redhat.com>
+
+       * Makefile.am (AM_CFLAGS): Avoid duplication.
+       Link with statis libs if BUILD_STATIC.
+
 2005-08-05  Ulrich Drepper  <drepper@redhat.com>
 
        * elflint.c: Many, many more tests.  Mostly related to symbol
index 5229dce..73c82dc 100644 (file)
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H $(YYDEBUG) \
        -DSRCDIR=\"$(shell cd $(srcdir);pwd)\" -DOBJDIR=\"$(shell pwd)\"
 if MUDFLAP
-AM_CFLAGS = -Wall -Wshadow -Wunused -Wextra -std=gnu99 -fmudflap \
-           $(native_ld_cflags) $(if $($(*F)_no_Wunused),,-Wunused) \
-           $(if $($(*F)_no_Wformat),,-Wformat=2)
+AM_CFLAGS = -fmudflap
 else
-AM_CFLAGS = -Wall -Wshadow -std=gnu99 $(native_ld_cflags) \
-           $(if $($(*F)_no_Werror),,-Werror) \
-           $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
-           $(if $($(*F)_no_Wformat),,-Wformat=2)
-endif
-if MUDFLAP
-libmudflap = -lmudflap
+AM_CFLAGS =
 endif
+AM_CFLAGS += -Wall -Wshadow -std=gnu99 $(native_ld_cflags) \
+            $(if $($(*F)_no_Werror),,-Werror) \
+            $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
+            $(if $($(*F)_no_Wformat),,-Wformat=2)
+
 INCLUDES = -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl -I$(srcdir)/../lib -I$(srcdir)/../libdw  -I..
 
 YACC = @YACC@ -d
@@ -64,6 +61,10 @@ EXTRA_DIST = elf32-i386.script libld_elf_i386.map $(ld_modules)
 ld_modules = i386_ld.c
 
 if MUDFLAP
+libmudflap = -lmudflap
+endif
+
+if BUILD_STATIC
 libdw = ../libdw/libdw.a
 libelf = ../libelf/libelf.a
 else
index d592648..25474b0 100644 (file)
@@ -1,3 +1,8 @@
+2005-08-06  Ulrich Drepper  <drepper@redhat.com>
+
+       * Makefile.am: Link with statis libs if BUILD_STATIC.
+       (dwflmodtest_LDADD): Also link with -ldl.
+
 2005-08-02  Ulrich Drepper  <drepper@redhat.com>
 
        * Makefile.am: Add -ldl to asm_tst[1-9]_LDASS.
index 07b87e0..c0c23c0 100644 (file)
@@ -64,10 +64,14 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
             testfile18.bz2
 
 if MUDFLAP
+static_build=yes
+libmudflap = -lmudflap
+endif
+
+if BUILD_STATIC
 libdw = ../libdw/libdw.a
 libelf = ../libelf/libelf.a
 libasm = ../libasm/libasm.a
-libmudflap = -lmudflap
 else
 libdw = ../libdw/libdw.so
 libelf = ../libelf/libelf.so
@@ -110,6 +114,6 @@ asm_tst6_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
 asm_tst7_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
 asm_tst8_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
 asm_tst9_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
-dwflmodtest_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap)
+dwflmodtest_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
 
 CLEANFILES = xxx