File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -155,12 +155,12 @@ else ifneq ($(HAVE_RULES),)
155155 $(error invalid HAVE_RULES value '$(HAVE_RULES)')
156156endif
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
159159REQUIRE_ESCAPE =$(shell echo "\#define DEF" | $(CXX ) -c -xc - && echo "1" || echo "0")
160160ifeq ($(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")
162162else
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")
164164endif
165165override CPPFLAGS += -DHAVE_EXECINFO_H=$(HAVE_EXECINFO_H )
166166
Original file line number Diff line number Diff 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 " ;
You can’t perform that action at this time.
0 commit comments