public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gprofng: zlib handling
@ 2022-04-08 16:09 Vladimir Mezentsev
  0 siblings, 0 replies; only message in thread
From: Vladimir Mezentsev @ 2022-04-08 16:09 UTC (permalink / raw)
  To: bfd-cvs, gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c10622fef4660111a53f4ccbd7b336dbdd7971ab

commit c10622fef4660111a53f4ccbd7b336dbdd7971ab
Author: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
Date:   Wed Apr 6 15:31:27 2022 -0700

    gprofng: zlib handling
    
    gprofng/ChangeLog
    2022-04-06  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
    
            * configure.ac: Add AM_ZLIB.
            * src/Makefile.am: Add $(ZLIBINC) and $(ZLIB).
            * gprofng/src/DbeSession.h: Likewise.
            * configure: Regenerate.
            * Makefile.in: Regenerate.
            * doc/Makefile.in: Regenerate.
            * gp-display-html/Makefile.in: Regenerate.
            * src/Makefile.in: Regenerate.

Diff:
---
 gprofng/Makefile.in                 |  4 +++-
 gprofng/configure                   | 25 +++++++++++++++++++++++--
 gprofng/configure.ac                |  2 ++
 gprofng/doc/Makefile.in             |  4 +++-
 gprofng/gp-display-html/Makefile.in |  4 +++-
 gprofng/src/Makefile.am             | 18 ++++++++++++------
 gprofng/src/Makefile.in             | 37 +++++++++++++++++++++++++------------
 7 files changed, 71 insertions(+), 23 deletions(-)

diff --git a/gprofng/Makefile.in b/gprofng/Makefile.in
index 3c41d247590..e77b06d60e4 100644
--- a/gprofng/Makefile.in
+++ b/gprofng/Makefile.in
@@ -114,7 +114,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../libtool.m4 \
 	$(top_srcdir)/../config/enable.m4 \
 	$(top_srcdir)/../config/ax_pthread.m4 \
 	$(top_srcdir)/config/bison.m4 $(top_srcdir)/../bfd/version.m4 \
-	$(top_srcdir)/configure.ac
+	$(top_srcdir)/../config/zlib.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
@@ -375,6 +375,8 @@ target_vendor = @target_vendor@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
+zlibdir = @zlibdir@
+zlibinc = @zlibinc@
 ACLOCAL_AMFLAGS = -I . -I .. 
 AUTOMAKE_OPTIONS = dejagnu foreign
 @BUILD_COLLECTOR_TRUE@COLLECTOR_SUBDIRS = libcollector
diff --git a/gprofng/configure b/gprofng/configure
index e21f7886b77..08af658da8e 100755
--- a/gprofng/configure
+++ b/gprofng/configure
@@ -641,6 +641,8 @@ LD_NO_AS_NEEDED
 BUILD_MAN_FALSE
 BUILD_MAN_TRUE
 HELP2MAN
+zlibinc
+zlibdir
 TCL_TRY_FALSE
 TCL_TRY_TRUE
 EXPECT
@@ -804,6 +806,7 @@ enable_werror_always
 enable_gprofng_tools
 with_jdk
 enable_gprofng_debug
+with_system_zlib
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1462,6 +1465,7 @@ Optional Packages:
                           both]
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
   --with-jdk=PATH         specify prefix directory for installed JDK.
+  --with-system-zlib      use installed libz
 
 Some influential environment variables:
   CC          C compiler command
@@ -12142,7 +12146,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12145 "configure"
+#line 12149 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12248,7 +12252,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12251 "configure"
+#line 12255 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -16674,6 +16678,23 @@ fi
 
 
 
+  # Use the system's zlib library.
+  zlibdir="-L\$(top_builddir)/../zlib"
+  zlibinc="-I\$(top_srcdir)/../zlib"
+
+# Check whether --with-system-zlib was given.
+if test "${with_system_zlib+set}" = set; then :
+  withval=$with_system_zlib; if test x$with_system_zlib = xyes ; then
+    zlibdir=
+    zlibinc=
+  fi
+
+fi
+
+
+
+
+
 # Generate manpages, if possible.
 if test $cross_compiling = no; then
 
diff --git a/gprofng/configure.ac b/gprofng/configure.ac
index 95bffe0e4e2..550dd80d331 100644
--- a/gprofng/configure.ac
+++ b/gprofng/configure.ac
@@ -17,6 +17,7 @@ dnl along with this program; see the file COPYING3.  If not see
 dnl <http://www.gnu.org/licenses/>.
 
 m4_include([../bfd/version.m4])
+m4_include([../config/zlib.m4])
 AC_INIT([gprofng], BFD_VERSION)
 AC_CANONICAL_TARGET
 AM_INIT_AUTOMAKE([subdir-objects])
@@ -182,6 +183,7 @@ fi`
 ])
 AM_CONDITIONAL(TCL_TRY, test "${ac_cv_libctf_tcl_try}" = yes)
 
+AM_ZLIB
 
 # Generate manpages, if possible.
 if test $cross_compiling = no; then
diff --git a/gprofng/doc/Makefile.in b/gprofng/doc/Makefile.in
index 7eb552b2a6d..03d9e242d9a 100644
--- a/gprofng/doc/Makefile.in
+++ b/gprofng/doc/Makefile.in
@@ -115,7 +115,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../libtool.m4 \
 	$(top_srcdir)/../config/enable.m4 \
 	$(top_srcdir)/../config/ax_pthread.m4 \
 	$(top_srcdir)/config/bison.m4 $(top_srcdir)/../bfd/version.m4 \
-	$(top_srcdir)/configure.ac
+	$(top_srcdir)/../config/zlib.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/version.texi \
@@ -357,6 +357,8 @@ target_vendor = @target_vendor@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
+zlibdir = @zlibdir@
+zlibinc = @zlibinc@
 AUTOMAKE_OPTIONS = info-in-builddir foreign no-texinfo.tex
 info_TEXINFOS = gprofng.texi
 gprofng_TEXINFOS = fdl.texi
diff --git a/gprofng/gp-display-html/Makefile.in b/gprofng/gp-display-html/Makefile.in
index e0df2d73be8..e75703c9a0b 100644
--- a/gprofng/gp-display-html/Makefile.in
+++ b/gprofng/gp-display-html/Makefile.in
@@ -115,7 +115,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../libtool.m4 \
 	$(top_srcdir)/../config/enable.m4 \
 	$(top_srcdir)/../config/ax_pthread.m4 \
 	$(top_srcdir)/config/bison.m4 $(top_srcdir)/../bfd/version.m4 \
-	$(top_srcdir)/configure.ac
+	$(top_srcdir)/../config/zlib.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
@@ -321,6 +321,8 @@ target_vendor = @target_vendor@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
+zlibdir = @zlibdir@
+zlibinc = @zlibinc@
 AUTOMAKE_OPTIONS = foreign
 ACLOCAL_AMFLAGS = -I . -I .. -I ../.. 
 dist_man_MANS = gp-display-html.1
diff --git a/gprofng/src/Makefile.am b/gprofng/src/Makefile.am
index 4c5a836b3fd..47fd8c9302b 100644
--- a/gprofng/src/Makefile.am
+++ b/gprofng/src/Makefile.am
@@ -98,10 +98,16 @@ CSOURCES = \
 
 LIBGPROFNG = libgprofng.la
 
+# This is where we get zlib from.  zlibdir is -L../zlib and zlibinc is
+# -I../zlib, unless we were configured with --with-system-zlib, in which
+# case both are empty.
+ZLIB = @zlibdir@ -lz
+ZLIBINC = @zlibinc@
+
 AM_CPPFLAGS = $(GPROFNG_CPPFLAGS) -DLOCALEDIR=\"@localedir@\" -I.. -I$(srcdir) \
 	-I$(srcdir)/../common \
 	-I$(srcdir)/../../include -I$(srcdir)/../../opcodes \
-	-I../../bfd -I$(srcdir)/../../bfd
+	-I../../bfd -I$(srcdir)/../../bfd $(ZLIBINC)
 AM_CFLAGS = $(GPROFNG_CFLAGS) $(PTHREAD_CFLAGS) \
 	$(GPROFNG_NO_FORMAT_TRUNCATION_CFLAGS) \
 	$(GPROFNG_NO_SWITCH_CFLAGS)
@@ -133,19 +139,19 @@ dbe_DATA = $(srcdir)/gprofng.rc
 bin_PROGRAMS = gp-archive gp-collect-app gprofng gp-display-text gp-display-src
 
 gp_archive_SOURCES = gp-archive.cc ArchiveExp.cc
-gp_archive_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK)
+gp_archive_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB)
 
 gp_collect_app_SOURCES = gp-collect-app.cc checks.cc envsets.cc count.cc
-gp_collect_app_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK)
+gp_collect_app_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB)
 
 gprofng_SOURCES = gprofng.cc
-gprofng_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK)
+gprofng_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB)
 
 gp_display_src_SOURCES = gp-display-src.cc
-gp_display_src_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK)
+gp_display_src_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB)
 
 gp_display_text_SOURCES = gp-display-text.cc ipc.cc ipcio.cc
-gp_display_text_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK)
+gp_display_text_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB)
 
 
 if BUILD_MAN
diff --git a/gprofng/src/Makefile.in b/gprofng/src/Makefile.in
index 0cdc3b9477b..7d3f9c6f7d0 100644
--- a/gprofng/src/Makefile.in
+++ b/gprofng/src/Makefile.in
@@ -120,7 +120,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../libtool.m4 \
 	$(top_srcdir)/../config/enable.m4 \
 	$(top_srcdir)/../config/ax_pthread.m4 \
 	$(top_srcdir)/config/bison.m4 $(top_srcdir)/../bfd/version.m4 \
-	$(top_srcdir)/configure.ac
+	$(top_srcdir)/../config/zlib.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
@@ -193,21 +193,26 @@ libgprofng_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
 PROGRAMS = $(bin_PROGRAMS)
 am_gp_archive_OBJECTS = gp-archive.$(OBJEXT) ArchiveExp.$(OBJEXT)
 gp_archive_OBJECTS = $(am_gp_archive_OBJECTS)
-gp_archive_DEPENDENCIES = $(LIBGPROFNG) $(am__DEPENDENCIES_1)
+gp_archive_DEPENDENCIES = $(LIBGPROFNG) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1)
 am_gp_collect_app_OBJECTS = gp-collect-app.$(OBJEXT) checks.$(OBJEXT) \
 	envsets.$(OBJEXT) count.$(OBJEXT)
 gp_collect_app_OBJECTS = $(am_gp_collect_app_OBJECTS)
-gp_collect_app_DEPENDENCIES = $(LIBGPROFNG) $(am__DEPENDENCIES_1)
+gp_collect_app_DEPENDENCIES = $(LIBGPROFNG) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1)
 am_gp_display_src_OBJECTS = gp-display-src.$(OBJEXT)
 gp_display_src_OBJECTS = $(am_gp_display_src_OBJECTS)
-gp_display_src_DEPENDENCIES = $(LIBGPROFNG) $(am__DEPENDENCIES_1)
+gp_display_src_DEPENDENCIES = $(LIBGPROFNG) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1)
 am_gp_display_text_OBJECTS = gp-display-text.$(OBJEXT) ipc.$(OBJEXT) \
 	ipcio.$(OBJEXT)
 gp_display_text_OBJECTS = $(am_gp_display_text_OBJECTS)
-gp_display_text_DEPENDENCIES = $(LIBGPROFNG) $(am__DEPENDENCIES_1)
+gp_display_text_DEPENDENCIES = $(LIBGPROFNG) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1)
 am_gprofng_OBJECTS = gprofng.$(OBJEXT)
 gprofng_OBJECTS = $(am_gprofng_OBJECTS)
-gprofng_DEPENDENCIES = $(LIBGPROFNG) $(am__DEPENDENCIES_1)
+gprofng_DEPENDENCIES = $(LIBGPROFNG) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1)
 AM_V_P = $(am__v_P_@AM_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
 am__v_P_0 = false
@@ -440,6 +445,8 @@ target_vendor = @target_vendor@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
+zlibdir = @zlibdir@
+zlibinc = @zlibinc@
 AUTOMAKE_OPTIONS = foreign
 ACLOCAL_AMFLAGS = -I . -I .. -I ../.. 
 CCSOURCES = \
@@ -520,10 +527,16 @@ CSOURCES = \
 	$(NULL)
 
 LIBGPROFNG = libgprofng.la
+
+# This is where we get zlib from.  zlibdir is -L../zlib and zlibinc is
+# -I../zlib, unless we were configured with --with-system-zlib, in which
+# case both are empty.
+ZLIB = @zlibdir@ -lz
+ZLIBINC = @zlibinc@
 AM_CPPFLAGS = $(GPROFNG_CPPFLAGS) -DLOCALEDIR=\"@localedir@\" -I.. -I$(srcdir) \
 	-I$(srcdir)/../common \
 	-I$(srcdir)/../../include -I$(srcdir)/../../opcodes \
-	-I../../bfd -I$(srcdir)/../../bfd
+	-I../../bfd -I$(srcdir)/../../bfd $(ZLIBINC)
 
 AM_CFLAGS = $(GPROFNG_CFLAGS) $(PTHREAD_CFLAGS) \
 	$(GPROFNG_NO_FORMAT_TRUNCATION_CFLAGS) \
@@ -549,15 +562,15 @@ libgprofng_la_LIBADD = $(top_builddir)/../opcodes/libopcodes.la \
 dbedir = $(prefix)/etc
 dbe_DATA = $(srcdir)/gprofng.rc
 gp_archive_SOURCES = gp-archive.cc ArchiveExp.cc
-gp_archive_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK)
+gp_archive_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB)
 gp_collect_app_SOURCES = gp-collect-app.cc checks.cc envsets.cc count.cc
-gp_collect_app_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK)
+gp_collect_app_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB)
 gprofng_SOURCES = gprofng.cc
-gprofng_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK)
+gprofng_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB)
 gp_display_src_SOURCES = gp-display-src.cc
-gp_display_src_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK)
+gp_display_src_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB)
 gp_display_text_SOURCES = gp-display-text.cc ipc.cc ipcio.cc
-gp_display_text_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK)
+gp_display_text_LDADD = $(LIBGPROFNG) $(CLOCK_GETTIME_LINK) $(ZLIB)
 
 # The man pages depend on the version number and on a help2man include file.
 @BUILD_MAN_TRUE@common_mandeps = $(top_srcdir)/../bfd/version.m4


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-08 16:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-08 16:09 [binutils-gdb] gprofng: zlib handling Vladimir Mezentsev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).