Skip to content

Commit 5c9e184

Browse files
author
Sebastian Pop
committed
add configure flag --with-default-sysroot
llvm-svn: 154791
1 parent 0066db9 commit 5c9e184

File tree

4 files changed

+27
-5
lines changed

4 files changed

+27
-5
lines changed

llvm/autoconf/configure.ac

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,13 @@ AC_ARG_WITH(gcc-toolchain,
838838
AC_DEFINE_UNQUOTED(GCC_INSTALL_PREFIX,"$withval",
839839
[Directory where gcc is installed.])
840840

841+
AC_ARG_WITH(sysroot,
842+
AS_HELP_STRING([--with-default-sysroot],
843+
[Add --sysroot=<path> to all compiler invocations.]),,
844+
withval="")
845+
AC_DEFINE_UNQUOTED(DEFAULT_SYSROOT,"$withval",
846+
[Default <path> to all compiler invocations for --sysroot=<path>.])
847+
841848
dnl Allow linking of LLVM with GPLv3 binutils code.
842849
AC_ARG_WITH(binutils-include,
843850
AS_HELP_STRING([--with-binutils-include],

llvm/configure

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,6 +1442,7 @@ Optional Packages:
14421442
--with-c-include-dirs Colon separated list of directories clang will
14431443
search for headers
14441444
--with-gcc-toolchain Directory where gcc is installed.
1445+
--with-default-sysroot Add --sysroot=<path> to all compiler invocations.
14451446
--with-binutils-include Specify path to binutils/include/ containing
14461447
plugin-api.h file for gold plugin.
14471448
--with-bug-report-url Specify the URL where bug reports should be
@@ -3802,7 +3803,7 @@ else
38023803
llvm_cv_target_os_type="Darwin" ;;
38033804
*-*-minix*)
38043805
llvm_cv_target_os_type="Minix" ;;
3805-
*-*-freebsd*| *-*-kfreebsd-gnu)
3806+
*-*-freebsd* | *-*-kfreebsd-gnu)
38063807
llvm_cv_target_os_type="FreeBSD" ;;
38073808
*-*-openbsd*)
38083809
llvm_cv_target_os_type="OpenBSD" ;;
@@ -5583,6 +5584,20 @@ _ACEOF
55835584

55845585

55855586

5587+
# Check whether --with-sysroot was given.
5588+
if test "${with_sysroot+set}" = set; then
5589+
withval=$with_sysroot;
5590+
else
5591+
withval=""
5592+
fi
5593+
5594+
5595+
cat >>confdefs.h <<_ACEOF
5596+
#define DEFAULT_SYSROOT "$withval"
5597+
_ACEOF
5598+
5599+
5600+
55865601
# Check whether --with-binutils-include was given.
55875602
if test "${with_binutils_include+set}" = set; then
55885603
withval=$with_binutils_include;
@@ -10386,7 +10401,7 @@ else
1038610401
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1038710402
lt_status=$lt_dlunknown
1038810403
cat > conftest.$ac_ext <<EOF
10389-
#line 10387 "configure"
10404+
#line 10404 "configure"
1039010405
#include "confdefs.h"
1039110406

1039210407
#if HAVE_DLFCN_H

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
/* Relative directory for resource files */
1212
#define CLANG_RESOURCE_DIR "${CLANG_RESOURCE_DIR}"
1313

14-
/* Directory wherelibstdc++ is installed. */
15-
#define GCC_INSTALL_PREFIX "${GCC_INSTALL_PREFIX}"
16-
1714
/* Directories clang will search for headers */
1815
#define C_INCLUDE_DIRS "${C_INCLUDE_DIRS}"
1916

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
/* Directories clang will search for headers */
1313
#undef C_INCLUDE_DIRS
1414

15+
/* Default <path> to all compiler invocations for --sysroot=<path>. */
16+
#undef DEFAULT_SYSROOT
17+
1518
/* Define if position independent code is enabled */
1619
#undef ENABLE_PIC
1720

0 commit comments

Comments
 (0)