Skip to content

Commit 67367c8

Browse files
committed
s
1 parent 09c0285 commit 67367c8

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ else ifneq ($(HAVE_RULES),)
155155
$(error invalid HAVE_RULES value '$(HAVE_RULES)')
156156
endif
157157

158-
HAVE_EXECINFO_H=$(shell (echo "#include <execinfo.h>") | $(CXX) -c -xc - 2> /dev/null && echo "1" || echo "0")
158+
HAVE_EXECINFO_H=$(shell echo -e "\x23#include <execinfo.h>" | $(CXX) -c -xc - 2> /dev/null && echo "1" || echo "0")
159159
override CPPFLAGS += -DHAVE_EXECINFO_H=$(HAVE_EXECINFO_H)
160160

161161
override CXXFLAGS += $(CXXOPTS)

tools/dmake/dmake.cpp

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

774-
// the # needs to be escaped on older make versions
775-
fout << "HAVE_EXECINFO_H=$(shell echo \"#include <execinfo.h>\" | $(CXX) -c -xc - 2> /dev/null && echo \"1\" || echo \"0\")\n"
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 \"\\x23#include <execinfo.h>\" | $(CXX) -c -xc - 2> /dev/null && echo \"1\" || echo \"0\")\n"
776777
<< "override CPPFLAGS += -DHAVE_EXECINFO_H=$(HAVE_EXECINFO_H)\n\n";
777778

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

0 commit comments

Comments
 (0)