From 8193b5de7b25df4efc1ec9fb7fa13ae2c61332cc Mon Sep 17 00:00:00 2001 From: Alex Lin Date: Fri, 12 Jun 2015 16:59:00 -0500 Subject: [PATCH] Standardize directory names Tried using clang/llvm from ubuntu distribution. Needed to change the include directory for compiling ICG. Also found that the clang include files can be in a linked directory. Used realpath to make sure we have the absolute path. refs #63 --- trick_source/codegen/Interface_Code_Gen/HeaderSearchDirs.cpp | 3 ++- trick_source/codegen/Interface_Code_Gen/makefile | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/trick_source/codegen/Interface_Code_Gen/HeaderSearchDirs.cpp b/trick_source/codegen/Interface_Code_Gen/HeaderSearchDirs.cpp index a32d1491..13cdf86a 100644 --- a/trick_source/codegen/Interface_Code_Gen/HeaderSearchDirs.cpp +++ b/trick_source/codegen/Interface_Code_Gen/HeaderSearchDirs.cpp @@ -43,7 +43,8 @@ void HeaderSearchDirs::AddCompilerBuiltInSearchDirs () { icg_dir << "." << __clang_patchlevel__ ; #endif icg_dir << "/include" ; - hso.AddPath(icg_dir.str() , clang::frontend::System, IsFramework, IsSysRootRelative); + char * resolved_path = realpath(icg_dir.str().c_str(), NULL ) ; + hso.AddPath(resolved_path , clang::frontend::System, IsFramework, IsSysRootRelative); #endif fp = popen("${TRICK_HOME}/bin/trick-gte TRICK_CPPC" , "r") ; diff --git a/trick_source/codegen/Interface_Code_Gen/makefile b/trick_source/codegen/Interface_Code_Gen/makefile index a4706060..38f79bcd 100644 --- a/trick_source/codegen/Interface_Code_Gen/makefile +++ b/trick_source/codegen/Interface_Code_Gen/makefile @@ -4,7 +4,7 @@ include ${TRICK_HOME}/share/trick/makefiles/Makefile.common CC := $(shell $(LLVM_HOME)/bin/llvm-config --bindir)/clang CXX := $(shell $(LLVM_HOME)/bin/llvm-config --bindir)/clang++ -CXXFLAGS := -I${LLVM_HOME}/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-rtti +CXXFLAGS := -I$(shell $(LLVM_HOME)/bin/llvm-config --includedir) -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-rtti CLANG_MINOR_GTEQ5 := $(shell expr `$(LLVM_HOME)/bin/llvm-config --version | cut -f2 -d. ` \>= 5 )