HaikuPorts
  • Login
  • Preferences
  • Help/Guide
  • Wiki
  • Timeline
  • Roadmap
  • View Tickets
  • Search
  • Port Log
  • Blog

Context Navigation

  • Back to Ticket #313

Ticket #313: llvm-3.0-srcdirv2.diff

File llvm-3.0-srcdirv2.diff, 4.4 KB (added by kallisti5, 3 years ago)

not used patch to 3.0 to backport llvm's new "--with-clang-srcdir" flag to 3.0

  • Makefile.config.in

    diff --git a/Makefile.config.in b/Makefile.config.in
    index fff482e..9755a5d 100644
    a b realpath = $(shell cd $(1); $(PWD)) 
    4646PROJ_OBJ_DIR  := $(call realpath, .) 
    4747PROJ_OBJ_ROOT := $(call realpath, $(PROJ_OBJ_DIR)/$(LEVEL)) 
    4848 
     49CLANG_SRC_ROOT  := @CLANG_SRC_ROOT@ 
     50 
    4951ifeq ($(PROJECT_NAME),llvm) 
    5052LLVM_SRC_ROOT   := $(call realpath, @abs_top_srcdir@) 
    5153LLVM_OBJ_ROOT   := $(call realpath, @abs_top_builddir@) 
    5254PROJ_SRC_ROOT   := $(LLVM_SRC_ROOT) 
    53 PROJ_SRC_DIR    := $(call realpath, $(LLVM_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR))) 
     55PROJ_SRC_DIR    := $(LLVM_SRC_ROOT)$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR)) 
     56 
     57ifneq ($(CLANG_SRC_ROOT),) 
     58  CLANG_SRC_ROOT:= $(call realpath, $(CLANG_SRC_ROOT)) 
     59  PROJ_SRC_DIR  := $(patsubst $(LLVM_SRC_ROOT)/tools/clang%,$(CLANG_SRC_ROOT)%,$(PROJ_SRC_DIR)) 
     60endif 
     61 
    5462prefix          := @prefix@ 
    5563PROJ_prefix     := $(prefix) 
    5664PROJ_VERSION    := $(LLVMVersion) 
  • Makefile.rules

    diff --git a/Makefile.rules b/Makefile.rules
    index d057f04..54c3780 100644
    a b endif 
    806806# Handle the OPTIONAL_PARALLEL_DIRS options for optional parallel construction 
    807807#----------------------------------------------------------- 
    808808ifdef OPTIONAL_PARALLEL_DIRS 
    809   PARALLEL_DIRS += $(foreach T,$(OPTIONAL_PARALLEL_DIRS),$(shell test -d $(PROJ_SRC_DIR)/$(T) && echo "$(T)")) 
     809  PARALLEL_DIRS += $(foreach T,$(OPTIONAL_PARALLEL_DIRS),$(shell test -d $(PROJ_SRC_DIR)/$(T) -o -f $(T)/Makefile && echo "$(T)")) 
    810810endif 
    811811 
    812812#----------------------------------------------------------- 
    … … unitcheck:: $(addsuffix /.makeunitcheck,$(PARALLEL_DIRS)) 
    828828ParallelTargets := $(foreach T,$(RecursiveTargets),%/.make$(T)) 
    829829 
    830830$(ParallelTargets) : 
    831         $(Verb) if ([ ! -f $(@D)/Makefile ] || \ 
    832                     command test $(@D)/Makefile -ot \ 
    833                       $(PROJ_SRC_DIR)/$(@D)/Makefile ); then \ 
    834           $(MKDIR) $(@D); \ 
    835           $(CP) $(PROJ_SRC_DIR)/$(@D)/Makefile $(@D)/Makefile; \ 
     831        $(Verb) \ 
     832          SD=$(PROJ_SRC_DIR)/$(@D); \ 
     833          DD=$(@D); \ 
     834          if [ ! -f $$SD/Makefile ]; then \ 
     835            SD=$(@D); \ 
     836            DD=$(notdir $(@D)); \ 
     837          fi; \ 
     838          if ([ ! -f $$DD/Makefile ] || \ 
     839                    command test $$DD/Makefile -ot \ 
     840                      $$SD/Makefile ); then \ 
     841          $(MKDIR) $$DD; \ 
     842          $(CP) $$SD/Makefile $$DD/Makefile; \ 
    836843        fi; \ 
    837         $(MAKE) -C $(@D) $(subst $(@D)/.make,,$@) 
     844        $(MAKE) -C $$DD $(subst $(@D)/.make,,$@) 
    838845endif 
    839846 
    840847#--------------------------------------------------------- 
  • autoconf/configure.ac

    diff --git a/autoconf/configure.ac b/autoconf/configure.ac
    index 85fe8d4..c28ff7f 100644
    a b case "$withval" in 
    795795  *) AC_MSG_ERROR([Invalid path for --with-ocaml-libdir. Provide full path]) ;; 
    796796esac 
    797797 
     798AC_ARG_WITH(clang-srcdir, 
     799  AS_HELP_STRING([--with-clang-srcdir], 
     800    [Directory to the out-of-tree Clang source]),, 
     801    withval="-") 
     802case "$withval" in 
     803  -) clang_src_root="" ;; 
     804  /* | [[A-Za-z]]:[[\\/]]*) clang_src_root="$withval" ;; 
     805  *) clang_src_root="$ac_pwd/$withval" ;; 
     806esac 
     807AC_SUBST(CLANG_SRC_ROOT,[$clang_src_root]) 
     808 
    798809AC_ARG_WITH(clang-resource-dir, 
    799810  AS_HELP_STRING([--with-clang-resource-dir], 
    800811    [Relative directory from the Clang binary for resource files]),, 
  • test/Makefile

    diff --git a/test/Makefile b/test/Makefile
    index c0bc36c..b1550df 100644
    a b extra-lit-site-cfgs:: 
    5959 
    6060ifneq ($(strip $(filter check-local-all,$(MAKECMDGOALS))),) 
    6161ifndef TESTSUITE 
    62 ifeq ($(shell test -d $(PROJ_SRC_DIR)/../tools/clang && echo OK), OK) 
     62ifeq ($(shell test -f $(PROJ_OBJ_DIR)/../tools/clang/Makefile && echo OK), OK) 
    6363LIT_ALL_TESTSUITES += $(PROJ_OBJ_DIR)/../tools/clang/test 
    6464 
    6565# Force creation of Clang's lit.site.cfg. 
  • tools/Makefile

    diff --git a/tools/Makefile b/tools/Makefile
    index 68ce314..2da3917 100644
    a b  
    99 
    1010LEVEL := .. 
    1111 
     12include $(LEVEL)/Makefile.config 
     13 
    1214# Build clang if present. 
    13 OPTIONAL_PARALLEL_DIRS := clang 
     15 
     16ifneq ($(CLANG_SRC_ROOT),) 
     17  OPTIONAL_PARALLEL_DIRS := $(CLANG_SRC_ROOT) 
     18else 
     19  OPTIONAL_PARALLEL_DIRS := clang 
     20endif 
    1421 
    1522# Build LLDB if present. Note LLDB must be built last as it depends on the 
    1623# wider LLVM infrastructure (including Clang). 
    … … ifdef ONLY_TOOLS 
    3643  PARALLEL_DIRS := $(filter-out lldb,$(ONLY_TOOLS)) 
    3744endif 
    3845 
    39 include $(LEVEL)/Makefile.config 
    40  
    41  
    4246# These libraries build as dynamic libraries (.dylib /.so), they can only be 
    4347# built if ENABLE_PIC is set. 
    4448ifndef ONLY_TOOLS 

Download in other formats:

  • Original Format

Trac Powered

Powered by Trac 0.13dev-r10686
By Edgewall Software.

Visit the Trac open source project at
http://trac.edgewall.org/