Skip to content

Commit

Permalink
Fix fatal error: math.h no such file or directory
Browse files Browse the repository at this point in the history
This fixes ponylang#3016 by adding lines back introduced in PR ponylang#824. This code
conditionally added llvm include directory only if it wasn't already
included. These lines were a small part of PR ponylang#2976 which adds LLVM
7.0.1 compatibility.
  • Loading branch information
winksaville committed Feb 21, 2019
1 parent c42ccd3 commit 34f6707
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Makefile-ponyc
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,17 @@ endif
# (3) a list of include directories for a set of libraries
# (4) a list of the libraries to link against
llvm.ldflags := -L$(CROSS_SYSROOT)$(subst -L,,$(shell $(LLVM_CONFIG) --ldflags $(LLVM_LINK_STATIC)))
llvm.include := $(CROSS_SYSROOT)$(shell sh -c "$(LLVM_CONFIG) --cflags $(LLVM_LINK_STATIC) | grep -oE -- '(^| )-I\s*\S+' | sed 's/^\s*-I\s*/-isystem /g'")
llvm.include.dir := $(CROSS_SYSROOT)$(shell $(LLVM_CONFIG) --includedir $(LLVM_LINK_STATIC))
include.paths := $(shell echo | $(CC) -v -E - 2>&1)
ifeq (,$(findstring $(llvm.include.dir),$(include.paths)))
# LLVM include directory is not in the existing paths;
# put it at the top of the system list
llvm.include := -isystem $(llvm.include.dir)
else
# LLVM include directory is already on the existing paths;
# do nothing
llvm.include :=
endif
llvm.libs := $(shell $(LLVM_CONFIG) --libs $(LLVM_LINK_STATIC)) -lz -lncurses

ifeq ($(OSTYPE), bsd)
Expand Down

0 comments on commit 34f6707

Please sign in to comment.