From 47be795df365174601a08535bf61d22301697ef8 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 7 Aug 2005 04:41:39 +0000 Subject: [PATCH] Implement --enable-gprof option in configure script. --- ChangeLog | 4 ++++ configure.ac | 14 +++++++++++++- lib/ChangeLog | 4 ++++ lib/Makefile.am | 2 ++ libelf/ChangeLog | 4 ++++ libelf/Makefile.am | 5 ++++- src/ChangeLog | 5 +++++ src/Makefile.am | 21 +++++++++++---------- tests/ChangeLog | 5 +++++ tests/Makefile.am | 8 ++++++-- 10 files changed, 58 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3192cee8d..9a7850aa2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-08-06 Ulrich Drepper + + * configure.ac: Add --enable-gprof option. + 2005-07-27 Roland McGrath * Makefile.am (all_SUBDIRS): Put libdwfl before libdw. diff --git a/configure.ac b/configure.ac index 578ec655b..960463c4a 100644 --- a/configure.ac +++ b/configure.ac @@ -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], diff --git a/lib/ChangeLog b/lib/ChangeLog index 9ddc21635..5b79d0962 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,7 @@ +2005-08-06 Ulrich Drepper + + * Makefile.am (xmalloc_CFLAGS): Define only if !GPROF. + 2005-05-03 Roland McGrath * crc32_file.c: New file. diff --git a/lib/Makefile.am b/lib/Makefile.am index facb5634d..b34d5440a 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -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 diff --git a/libelf/ChangeLog b/libelf/ChangeLog index 5d22c3264..4a8bc879b 100644 --- a/libelf/ChangeLog +++ b/libelf/ChangeLog @@ -1,3 +1,7 @@ +2005-08-06 Ulrich Drepper + + * Makefile.am (AM_CFLAGS): Add -fpic when BUILD_STATIC. + 2005-08-03 Ulrich Drepper * libelf.map: Move elf32_offscn, elf64_offscn, and gelf_offscn in diff --git a/libelf/Makefile.am b/libelf/Makefile.am index d9caac65e..3853608ba 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.. diff --git a/src/ChangeLog b/src/ChangeLog index 6533861bc..cf315fff2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-08-06 Ulrich Drepper + + * Makefile.am (AM_CFLAGS): Avoid duplication. + Link with statis libs if BUILD_STATIC. + 2005-08-05 Ulrich Drepper * elflint.c: Many, many more tests. Mostly related to symbol diff --git a/src/Makefile.am b/src/Makefile.am index 5229dce32..73c82dc68 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -15,18 +15,15 @@ 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 diff --git a/tests/ChangeLog b/tests/ChangeLog index d59264891..25474b066 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,8 @@ +2005-08-06 Ulrich Drepper + + * Makefile.am: Link with statis libs if BUILD_STATIC. + (dwflmodtest_LDADD): Also link with -ldl. + 2005-08-02 Ulrich Drepper * Makefile.am: Add -ldl to asm_tst[1-9]_LDASS. diff --git a/tests/Makefile.am b/tests/Makefile.am index 07b87e0ef..c0c23c093 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 -- 2.47.2