llvm.org GIT mirror llvm / e5ab51d
autoconf: Introduce --with-clang-srcdir, to build out-of-tree clang as tools/clang on tools/Makefile. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142102 91177308-0d34-0410-b5e6-96231b3b80d8 NAKAMURA Takumi 8 years ago
4 changed file(s) with 49 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
4545 PROJ_OBJ_DIR := $(call realpath, .)
4646 PROJ_OBJ_ROOT := $(call realpath, $(PROJ_OBJ_DIR)/$(LEVEL))
4747
48 CLANG_SRC_ROOT := @CLANG_SRC_ROOT@
49
4850 ifeq ($(PROJECT_NAME),llvm)
4951 LLVM_SRC_ROOT := $(call realpath, @abs_top_srcdir@)
5052 LLVM_OBJ_ROOT := $(call realpath, @abs_top_builddir@)
5153 PROJ_SRC_ROOT := $(LLVM_SRC_ROOT)
52 PROJ_SRC_DIR := $(call realpath, $(LLVM_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR)))
54 PROJ_SRC_DIR := $(LLVM_SRC_ROOT)$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR))
55
56 ifneq ($(CLANG_SRC_ROOT),)
57 CLANG_SRC_ROOT:= $(call realpath, $(CLANG_SRC_ROOT))
58 PROJ_SRC_DIR := $(patsubst $(LLVM_SRC_ROOT)/tools/clang%,$(CLANG_SRC_ROOT)%,$(PROJ_SRC_DIR))
59 endif
60
5361 prefix := @prefix@
5462 PROJ_prefix := $(prefix)
5563 PROJ_VERSION := $(LLVMVersion)
794794 *) AC_MSG_ERROR([Invalid path for --with-ocaml-libdir. Provide full path]) ;;
795795 esac
796796
797 AC_ARG_WITH(clang-srcdir,
798 AS_HELP_STRING([--with-clang-srcdir],
799 [Directory to the out-of-tree Clang source]),,
800 withval="-")
801 case "$withval" in
802 -) clang_src_root="" ;;
803 /* | [[A-Za-z]]:[[\\/]]*) clang_src_root="$withval" ;;
804 *) clang_src_root="$ac_pwd/$withval" ;;
805 esac
806 AC_SUBST(CLANG_SRC_ROOT,[$clang_src_root])
807
797808 AC_ARG_WITH(clang-resource-dir,
798809 AS_HELP_STRING([--with-clang-resource-dir],
799810 [Relative directory from the Clang binary for resource files]),,
707707 OPTIMIZE_OPTION
708708 EXTRA_OPTIONS
709709 EXTRA_LD_OPTIONS
710 CLANG_SRC_ROOT
710711 BINUTILS_INCDIR
711712 NM
712713 ifGNUmake
14321433 --with-extra-ld-options Specify additional options to link LLVM with
14331434 --with-ocaml-libdir Specify install location for ocaml bindings (default
14341435 is stdlib)
1436 --with-clang-srcdir Directory to the out-of-tree Clang source
14351437 --with-clang-resource-dir
14361438 Relative directory from the Clang binary for
14371439 resource files
55095511 esac
55105512
55115513
5514 # Check whether --with-clang-srcdir was given.
5515 if test "${with_clang_srcdir+set}" = set; then
5516 withval=$with_clang_srcdir;
5517 else
5518 withval="-"
5519 fi
5520
5521 case "$withval" in
5522 -) clang_src_root="" ;;
5523 /* | [A-Za-z]:[\\/]*) clang_src_root="$withval" ;;
5524 *) clang_src_root="$ac_pwd/$withval" ;;
5525 esac
5526 CLANG_SRC_ROOT=$clang_src_root
5527
5528
5529
55125530 # Check whether --with-clang-resource-dir was given.
55135531 if test "${with_clang_resource_dir+set}" = set; then
55145532 withval=$with_clang_resource_dir;
1045210470 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1045310471 lt_status=$lt_dlunknown
1045410472 cat > conftest.$ac_ext <
10455 #line 10456 "configure"
10473 #line 10474 "configure"
1045610474 #include "confdefs.h"
1045710475
1045810476 #if HAVE_DLFCN_H
2190521923 OPTIMIZE_OPTION!$OPTIMIZE_OPTION$ac_delim
2190621924 EXTRA_OPTIONS!$EXTRA_OPTIONS$ac_delim
2190721925 EXTRA_LD_OPTIONS!$EXTRA_LD_OPTIONS$ac_delim
21926 CLANG_SRC_ROOT!$CLANG_SRC_ROOT$ac_delim
2190821927 BINUTILS_INCDIR!$BINUTILS_INCDIR$ac_delim
2190921928 NM!$NM$ac_delim
2191021929 ifGNUmake!$ifGNUmake$ac_delim
2198622005 LTLIBOBJS!$LTLIBOBJS$ac_delim
2198722006 _ACEOF
2198822007
21989 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 88; then
22008 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 89; then
2199022009 break
2199122010 elif $ac_last_try; then
2199222011 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
88
99 LEVEL := ..
1010
11 include $(LEVEL)/Makefile.config
12
1113 # Build clang if present.
12 OPTIONAL_PARALLEL_DIRS := clang
14
15 ifneq ($(CLANG_SRC_ROOT),)
16 OPTIONAL_PARALLEL_DIRS := $(CLANG_SRC_ROOT)
17 else
18 OPTIONAL_PARALLEL_DIRS := clang
19 endif
1320
1421 # Build LLDB if present. Note LLDB must be built last as it depends on the
1522 # wider LLVM infrastructure (including Clang).
3441 OPTIONAL_DIRS := $(findstring lldb,$(ONLY_TOOLS))
3542 PARALLEL_DIRS := $(filter-out lldb,$(ONLY_TOOLS))
3643 endif
37
38 include $(LEVEL)/Makefile.config
39
4044
4145 # These libraries build as dynamic libraries (.dylib /.so), they can only be
4246 # built if ENABLE_PIC is set.