Skip to content

Commit d6f1a6c

Browse files
committed
s
1 parent 58776a4 commit d6f1a6c

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,12 @@ else ifneq ($(HAVE_RULES),)
155155
$(error invalid HAVE_RULES value '$(HAVE_RULES)')
156156
endif
157157

158-
# older make versions do not support # in $(shell) and newer ones do not handle the escape sequence right
158+
# older make versions do not support # in $(shell) and newer ones handle the escape sequence literally
159159
REQUIRE_ESCAPE=$(shell echo "\#define DEF" | $(CXX) -c -xc - && echo "1" || echo "0")
160160
ifeq ($(REQUIRE_ESCAPE),1)
161-
HAVE_EXECINFO_H=$(shell echo "\#include <execinfo.h>" | $(CXX) -c -xc - 2> /dev/null && echo "1" || echo "0")
161+
HAVE_EXECINFO_H=$(shell echo "\#include <execinfo.h>" | $(CXX) -c -xc - 2> /dev/null && echo "1" || echo "0")
162162
else
163-
HAVE_EXECINFO_H=$(shell echo "#include <execinfo.h>" | $(CXX) -c -xc - 2> /dev/null && echo "1" || echo "0")
163+
HAVE_EXECINFO_H=$(shell echo "#include <execinfo.h>" | $(CXX) -c -xc - 2> /dev/null && echo "1" || echo "0")
164164
endif
165165
override CPPFLAGS += -DHAVE_EXECINFO_H=$(HAVE_EXECINFO_H)
166166

tools/dmake/dmake.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -771,9 +771,13 @@ int main(int argc, char **argv)
771771
<< " $(error invalid HAVE_RULES value '$(HAVE_RULES)')\n"
772772
<< "endif\n\n";
773773

774-
// older make versions require the # to be escaped.
775-
// the # needs to be specified as hex because newer make version use it verbatim and thus break this command.
776-
fout << "HAVE_EXECINFO_H=$(shell echo -e \"\\x23include <execinfo.h>\" | $(CXX) -c -xc - 2> /dev/null && echo \"1\" || echo \"0\")\n"
774+
fout << "# older make versions do not support # in $(shell) and newer ones handle the escape sequence literally\n"
775+
<< "REQUIRE_ESCAPE=$(shell echo \"\\#define DEF\" | $(CXX) -c -xc - && echo \"1\" || echo \"0\")\n"
776+
<< "ifeq ($(REQUIRE_ESCAPE),1)\n"
777+
<< " HAVE_EXECINFO_H=$(shell echo \"\\#include <execinfo.h>\" | $(CXX) -c -xc - 2> /dev/null && echo \"1\" || echo \"0\")\n"
778+
<< "else\n"
779+
<< " HAVE_EXECINFO_H=$(shell echo \"#include <execinfo.h>\" | $(CXX) -c -xc - 2> /dev/null && echo \"1\" || echo \"0\")\n"
780+
<< "endif\n"
777781
<< "override CPPFLAGS += -DHAVE_EXECINFO_H=$(HAVE_EXECINFO_H)\n\n";
778782

779783
fout << "override CXXFLAGS += $(CXXOPTS)\n";

0 commit comments

Comments
 (0)