aboutsummaryrefslogtreecommitdiff
path: root/gprofng/src
diff options
context:
space:
mode:
authorVladimir Mezentsev <vladimir.mezentsev@oracle.com>2023-10-03 23:53:01 -0700
committerVladimir Mezentsev <vladimir.mezentsev@oracle.com>2023-10-05 08:09:45 -0700
commite5b3bfa519a9704288219d09fef1a792663351c0 (patch)
treeabeff3f750232de254611125eae197e5fb1cef7d /gprofng/src
parent345309aadd64b701426fe3b4f4184ae689feef06 (diff)
downloadbinutils-e5b3bfa519a9704288219d09fef1a792663351c0.zip
binutils-e5b3bfa519a9704288219d09fef1a792663351c0.tar.gz
binutils-e5b3bfa519a9704288219d09fef1a792663351c0.tar.bz2
gprofng: 30894 bison should be no hard dependency
When running from a distribution tarball, bison should not be necessary. The generated files (QLParser.tab.cc, QLParser.tab.hh) should be distributed. configure.ac should not abort if bison is missing. configure.ac should remove temporary files (dummy.c, Simple.class). bison must be run once to create QLParser.tab.cc and QLParser.tab.hh. gprofng/ChangeLog 2023-10-03 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR gprofng/30894 * configure.ac: Don't abort if bison is missing. Remove temporary files. * src/Makefile.am: Distribute QLParser.tab.cc and QLParser.tab.hh. * Run bison once to create QLParser.tab.cc and QLParser.tab.hh. * configure: Rebuild. * src/Makefile.in: Rebuild.
Diffstat (limited to 'gprofng/src')
-rw-r--r--gprofng/src/Makefile.am19
-rw-r--r--gprofng/src/Makefile.in22
2 files changed, 33 insertions, 8 deletions
diff --git a/gprofng/src/Makefile.am b/gprofng/src/Makefile.am
index 219367f..20c8b00 100644
--- a/gprofng/src/Makefile.am
+++ b/gprofng/src/Makefile.am
@@ -117,12 +117,25 @@ AM_CFLAGS = $(GPROFNG_CFLAGS) $(PTHREAD_CFLAGS) \
$(GPROFNG_NO_SWITCH_CFLAGS)
AM_CXXFLAGS = $(AM_CFLAGS)
-QLParser.tab.cc QLParser.tab.hh: QLParser.yy
+# bison generates two files QLParser.tab.cc, QLParser.tab.hh.
+# we don't know which file will be newer.
+# Make QLParser.tab.cc always newer than QLParser.tab.hh.
+QLParser.tab.hh: QLParser.yy
+ if test "$(BISON)" = ":"; then \
+ echo "fatal: Building gprofng requires bison 3.0.4 or later."; \
+ exit 1; \
+ fi; \
$(BISON) $^
-BUILT_SOURCES = QLParser.tab.hh
-EXTRA_DIST = QLParser.yy
+QLParser.tab.cc: QLParser.tab.hh
+ touch $@
+BUILT_SOURCES = QLParser.tab.cc QLParser.tab.hh
+EXTRA_DIST = QLParser.tab.cc QLParser.tab.hh QLParser.yy
+
+# info and diststuff are needed for src-release.sh:
+info: $(BUILT_SOURCES)
+diststuff: info
lib_LTLIBRARIES = $(LIBGPROFNG)
libgprofng_la_SOURCES = $(CCSOURCES) $(CSOURCES)
diff --git a/gprofng/src/Makefile.in b/gprofng/src/Makefile.in
index b881268..47da873 100644
--- a/gprofng/src/Makefile.in
+++ b/gprofng/src/Makefile.in
@@ -543,8 +543,8 @@ AM_CFLAGS = $(GPROFNG_CFLAGS) $(PTHREAD_CFLAGS) \
$(GPROFNG_NO_SWITCH_CFLAGS)
AM_CXXFLAGS = $(AM_CFLAGS)
-BUILT_SOURCES = QLParser.tab.hh
-EXTRA_DIST = QLParser.yy
+BUILT_SOURCES = QLParser.tab.cc QLParser.tab.hh
+EXTRA_DIST = QLParser.tab.cc QLParser.tab.hh QLParser.yy
lib_LTLIBRARIES = $(LIBGPROFNG)
libgprofng_la_SOURCES = $(CCSOURCES) $(CSOURCES)
libgprofng_la_LDFLAGS = -version-info 0:0:0
@@ -1021,8 +1021,6 @@ html: html-am
html-am:
-info: info-am
-
info-am:
install-data-am: install-dbeDATA
@@ -1096,9 +1094,23 @@ uninstall-am: uninstall-binPROGRAMS uninstall-dbeDATA \
.PRECIOUS: Makefile
-QLParser.tab.cc QLParser.tab.hh: QLParser.yy
+# bison generates two files QLParser.tab.cc, QLParser.tab.hh.
+# we don't know which file will be newer.
+# Make QLParser.tab.cc always newer than QLParser.tab.hh.
+QLParser.tab.hh: QLParser.yy
+ if test "$(BISON)" = ":"; then \
+ echo "fatal: Building gprofng requires bison 3.0.4 or later."; \
+ exit 1; \
+ fi; \
$(BISON) $^
+QLParser.tab.cc: QLParser.tab.hh
+ touch $@
+
+# info and diststuff are needed for src-release.sh:
+info: $(BUILT_SOURCES)
+diststuff: info
+
# Distribution involves building the binaries to generate the manpage,
# so ensure that the necessary libraries are built at dist time.
dist-hook: $(LIBGPROFNG)