Skip to content

Commit ffae4a6

Browse files
committed
First step to allowing the resource directory of Clang to be adjusted for
strange packaging environments. The primary result of this is to expose a (normally empty) CLANG_RESOURCE_DIR string in the autoconf and CMake builds. This will in turn be used by a subsequent commit to Clang. Regenerated configure and config.h.in thanks to Nick. =D llvm-svn: 116802
1 parent 3e64de9 commit ffae4a6

File tree

5 files changed

+34
-1
lines changed

5 files changed

+34
-1
lines changed

llvm/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ else( MSVC )
8080
CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
8181
endif( MSVC )
8282

83+
set(CLANG_RESOURCE_DIR "" CACHE STRING
84+
"Relative directory from the Clang binary to its resource files.")
85+
8386
set(C_INCLUDE_DIRS "" CACHE STRING
8487
"Colon separated list of directories clang will search for headers.")
8588

llvm/autoconf/configure.ac

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,13 @@ case "$withval" in
804804
*) AC_MSG_ERROR([Invalid path for --with-ocaml-libdir. Provide full path]) ;;
805805
esac
806806

807+
AC_ARG_WITH(clang-resource-dir,
808+
AS_HELP_STRING([--with-clang-resource-dir],
809+
[Relative directory from the Clang binary for resource files]),,
810+
withval="")
811+
AC_DEFINE_UNQUOTED(CLANG_RESOURCE_DIR,"$withval",
812+
[Relative directory for resource files])
813+
807814
AC_ARG_WITH(c-include-dirs,
808815
AS_HELP_STRING([--with-c-include-dirs],
809816
[Colon separated list of directories clang will search for headers]),,

llvm/configure

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1442,6 +1442,9 @@ Optional Packages:
14421442
--with-extra-options Specify additional options to compile LLVM with
14431443
--with-ocaml-libdir Specify install location for ocaml bindings (default
14441444
is stdlib)
1445+
--with-clang-resource-dir
1446+
Relative directory from the Clang binary for
1447+
resource files
14451448
--with-c-include-dirs Colon separated list of directories clang will
14461449
search for headers
14471450
--with-cxx-include-root Directory with the libstdc++ headers.
@@ -5279,6 +5282,20 @@ echo "$as_me: error: Invalid path for --with-ocaml-libdir. Provide full path" >&
52795282
esac
52805283

52815284

5285+
# Check whether --with-clang-resource-dir was given.
5286+
if test "${with_clang_resource_dir+set}" = set; then
5287+
withval=$with_clang_resource_dir;
5288+
else
5289+
withval=""
5290+
fi
5291+
5292+
5293+
cat >>confdefs.h <<_ACEOF
5294+
#define CLANG_RESOURCE_DIR "$withval"
5295+
_ACEOF
5296+
5297+
5298+
52825299
# Check whether --with-c-include-dirs was given.
52835300
if test "${with_c_include_dirs+set}" = set; then
52845301
withval=$with_c_include_dirs;
@@ -11450,7 +11467,7 @@ else
1145011467
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1145111468
lt_status=$lt_dlunknown
1145211469
cat > conftest.$ac_ext <<EOF
11453-
#line 11453 "configure"
11470+
#line 11470 "configure"
1145411471
#include "confdefs.h"
1145511472

1145611473
#if HAVE_DLFCN_H

llvm/include/llvm/Config/config.h.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
/* Define if CBE is enabled for printf %a output */
1313
#undef ENABLE_CBE_PRINTF_A
1414

15+
/* Relative directory for resource files */
16+
#define CLANG_RESOURCE_DIR "${CLANG_RESOURCE_DIR}"
17+
1518
/* Directories clang will search for headers */
1619
#define C_INCLUDE_DIRS "${C_INCLUDE_DIRS}"
1720

llvm/include/llvm/Config/config.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
#ifndef CONFIG_H
44
#define CONFIG_H
55

6+
/* Relative directory for resource files */
7+
#undef CLANG_RESOURCE_DIR
8+
69
/* 32 bit multilib directory. */
710
#undef CXX_INCLUDE_32BIT_DIR
811

0 commit comments

Comments
 (0)