diff options
author | Yvan Roux <yvan.roux@linaro.org> | 2015-10-12 14:03:52 +0200 |
---|---|---|
committer | Linaro Code Review <review@review.linaro.org> | 2015-10-13 10:31:34 +0000 |
commit | e94a9ba47d4902ecbb2dfac8d342deb6d32e67e9 (patch) | |
tree | 52bb27386794e2753eb4fa719c37738558379a91 | |
parent | 60269e13f902e75c2f5ac3e30da5f2df797882b3 (diff) |
gcc/
Backport from trunk r225921.
2015-07-17 Yvan Roux <yvan.roux@linaro.org>
Matthias Klose <doko@ubuntu.com>
* configure.ac: Move AC_ARG_WITH checks for native-system-header-dir,
build-sysroot, sysroot from the `Miscenalleous configure options' to
the `Directories' section and strip trailing `/' from with_sysroot.
(gcc_gxx_include_dir): Don't strip a `/' sysroot value.
* configure: Regenerated.
Change-Id: I33c84aa973af5d06eeaf2e503a3ce72e885d8367
-rwxr-xr-x | gcc/configure | 184 | ||||
-rw-r--r-- | gcc/configure.ac | 134 |
2 files changed, 165 insertions, 153 deletions
diff --git a/gcc/configure b/gcc/configure index 5de7715ff2c..9b858862ac4 100755 --- a/gcc/configure +++ b/gcc/configure @@ -767,10 +767,6 @@ REPORT_BUGS_TEXI REPORT_BUGS_TO PKGVERSION CONFIGURE_SPECS -CROSS_SYSTEM_HEADER_DIR -TARGET_SYSTEM_ROOT_DEFINE -TARGET_SYSTEM_ROOT -SYSROOT_CFLAGS_FOR_TARGET enable_shared enable_fixed_point enable_decimal_float @@ -809,6 +805,10 @@ LDFLAGS CFLAGS CC GENINSRC +CROSS_SYSTEM_HEADER_DIR +TARGET_SYSTEM_ROOT_DEFINE +TARGET_SYSTEM_ROOT +SYSROOT_CFLAGS_FOR_TARGET target_subdir host_subdir build_subdir @@ -870,6 +870,9 @@ ac_user_opts=' enable_option_checking with_build_libsubdir with_local_prefix +with_native_system_header_dir +with_build_sysroot +with_sysroot with_gxx_include_dir with_cpp_install_dir enable_generated_files_in_srcdir @@ -896,9 +899,6 @@ enable_tls enable_objc_gc with_dwarf2 enable_shared -with_native_system_header_dir -with_build_sysroot -with_sysroot with_specs with_pkgversion with_bugurl @@ -1680,6 +1680,12 @@ Optional Packages: --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-build-libsubdir=DIR Directory where to find libraries for build system --with-local-prefix=DIR specifies directory to put local include + --with-native-system-header-dir=dir + use dir as the directory to look for standard + system header files in. Defaults to /usr/include. + --with-build-sysroot=sysroot + use sysroot as the system root during the build + --with-sysroot[=DIR] search for usr/lib, usr/include, et al, within DIR --with-gxx-include-dir=DIR specifies directory to put g++ header files --with-cpp-install-dir=DIR @@ -1692,12 +1698,6 @@ Optional Packages: --with-as arrange to use the specified as (full pathname) --with-stabs arrange to use stabs instead of host debug format --with-dwarf2 force the default debug format to be DWARF 2 - --with-native-system-header-dir=dir - use dir as the directory to look for standard - system header files in. Defaults to /usr/include. - --with-build-sysroot=sysroot - use sysroot as the system root during the build - --with-sysroot[=DIR] search for usr/lib, usr/include, et al, within DIR --with-specs=SPECS add SPECS to driver command-line processing --with-pkgversion=PKG Use PKG in the version string in place of "Linaro GCC `cat $srcdir/LINARO-VERSION`" @@ -3340,6 +3340,83 @@ if test x$local_prefix = x; then local_prefix=/usr/local fi + +# Check whether --with-native-system-header-dir was given. +if test "${with_native_system_header_dir+set}" = set; then : + withval=$with_native_system_header_dir; + case ${with_native_system_header_dir} in + yes|no) as_fn_error "bad value ${withval} given for --with-native-system-header-dir" "$LINENO" 5 ;; + /* | [A-Za-z]:[\\/]*) ;; + *) as_fn_error "--with-native-system-header-dir argument ${withval} must be an absolute directory" "$LINENO" 5 ;; + esac + configured_native_system_header_dir="${withval}" + +else + configured_native_system_header_dir= +fi + + + +# Check whether --with-build-sysroot was given. +if test "${with_build_sysroot+set}" = set; then : + withval=$with_build_sysroot; if test x"$withval" != x ; then + SYSROOT_CFLAGS_FOR_TARGET="--sysroot=$withval" + fi +else + SYSROOT_CFLAGS_FOR_TARGET= +fi + + + +if test "x$prefix" = xNONE; then + test_prefix=/usr/local +else + test_prefix=$prefix +fi +if test "x$exec_prefix" = xNONE; then + test_exec_prefix=$test_prefix +else + test_exec_prefix=$exec_prefix +fi + + +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; + case ${with_sysroot} in + /) ;; + */) with_sysroot=`echo $with_sysroot | sed 's,/$,,'` ;; + esac + case ${with_sysroot} in + yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_noncanonical}/sys-root' ;; + *) TARGET_SYSTEM_ROOT=$with_sysroot ;; + esac + + TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"' + CROSS_SYSTEM_HEADER_DIR='$(TARGET_SYSTEM_ROOT)$${sysroot_headers_suffix}$(NATIVE_SYSTEM_HEADER_DIR)' + + case ${TARGET_SYSTEM_ROOT} in + "${test_prefix}"|"${test_prefix}/"*|\ + "${test_exec_prefix}"|"${test_exec_prefix}/"*|\ + '${prefix}'|'${prefix}/'*|\ + '${exec_prefix}'|'${exec_prefix}/'*) + t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE" + TARGET_SYSTEM_ROOT_DEFINE="$t" + ;; + esac + +else + + TARGET_SYSTEM_ROOT= + TARGET_SYSTEM_ROOT_DEFINE= + CROSS_SYSTEM_HEADER_DIR='$(gcc_tooldir)/sys-include' + +fi + + + + + # Don't set gcc_gxx_include_dir to gxx_include_dir since that's only # passed in by the toplevel make and thus we'd get different behavior # depending on where we built the sources. @@ -3373,7 +3450,9 @@ gcc_gxx_include_dir_add_sysroot=0 if test "${with_sysroot+set}" = set; then gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'` if test "${gcc_gxx_without_sysroot}"; then - gcc_gxx_include_dir="${gcc_gxx_without_sysroot}" + if test x${with_sysroot} != x/; then + gcc_gxx_include_dir="${gcc_gxx_without_sysroot}" + fi gcc_gxx_include_dir_add_sysroot=1 fi fi @@ -7270,79 +7349,6 @@ fi -# Check whether --with-native-system-header-dir was given. -if test "${with_native_system_header_dir+set}" = set; then : - withval=$with_native_system_header_dir; - case ${with_native_system_header_dir} in - yes|no) as_fn_error "bad value ${withval} given for --with-native-system-header-dir" "$LINENO" 5 ;; - /* | [A-Za-z]:[\\/]*) ;; - *) as_fn_error "--with-native-system-header-dir argument ${withval} must be an absolute directory" "$LINENO" 5 ;; - esac - configured_native_system_header_dir="${withval}" - -else - configured_native_system_header_dir= -fi - - - -# Check whether --with-build-sysroot was given. -if test "${with_build_sysroot+set}" = set; then : - withval=$with_build_sysroot; if test x"$withval" != x ; then - SYSROOT_CFLAGS_FOR_TARGET="--sysroot=$withval" - fi -else - SYSROOT_CFLAGS_FOR_TARGET= -fi - - - -if test "x$prefix" = xNONE; then - test_prefix=/usr/local -else - test_prefix=$prefix -fi -if test "x$exec_prefix" = xNONE; then - test_exec_prefix=$test_prefix -else - test_exec_prefix=$exec_prefix -fi - - -# Check whether --with-sysroot was given. -if test "${with_sysroot+set}" = set; then : - withval=$with_sysroot; - case ${with_sysroot} in - yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_noncanonical}/sys-root' ;; - *) TARGET_SYSTEM_ROOT=$with_sysroot ;; - esac - - TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"' - CROSS_SYSTEM_HEADER_DIR='$(TARGET_SYSTEM_ROOT)$${sysroot_headers_suffix}$(NATIVE_SYSTEM_HEADER_DIR)' - - case ${TARGET_SYSTEM_ROOT} in - "${test_prefix}"|"${test_prefix}/"*|\ - "${test_exec_prefix}"|"${test_exec_prefix}/"*|\ - '${prefix}'|'${prefix}/'*|\ - '${exec_prefix}'|'${exec_prefix}/'*) - t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE" - TARGET_SYSTEM_ROOT_DEFINE="$t" - ;; - esac - -else - - TARGET_SYSTEM_ROOT= - TARGET_SYSTEM_ROOT_DEFINE= - CROSS_SYSTEM_HEADER_DIR='$(gcc_tooldir)/sys-include' - -fi - - - - - - # Check whether --with-specs was given. if test "${with_specs+set}" = set; then : withval=$with_specs; CONFIGURE_SPECS=$withval @@ -18163,7 +18169,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 18166 "configure" +#line 18172 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -18269,7 +18275,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 18272 "configure" +#line 18278 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/gcc/configure.ac b/gcc/configure.ac index 61e0a87fb80..d534d9ff547 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -121,6 +121,73 @@ if test x$local_prefix = x; then local_prefix=/usr/local fi +AC_ARG_WITH([native-system-header-dir], + [ --with-native-system-header-dir=dir + use dir as the directory to look for standard + system header files in. Defaults to /usr/include.], +[ + case ${with_native_system_header_dir} in + yes|no) AC_MSG_ERROR([bad value ${withval} given for --with-native-system-header-dir]) ;; + /* | [[A-Za-z]]:[[\\/]]*) ;; + *) AC_MSG_ERROR([--with-native-system-header-dir argument ${withval} must be an absolute directory]) ;; + esac + configured_native_system_header_dir="${withval}" +], [configured_native_system_header_dir=]) + +AC_ARG_WITH(build-sysroot, + [AS_HELP_STRING([--with-build-sysroot=sysroot], + [use sysroot as the system root during the build])], + [if test x"$withval" != x ; then + SYSROOT_CFLAGS_FOR_TARGET="--sysroot=$withval" + fi], + [SYSROOT_CFLAGS_FOR_TARGET=]) +AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET) + +if test "x$prefix" = xNONE; then + test_prefix=/usr/local +else + test_prefix=$prefix +fi +if test "x$exec_prefix" = xNONE; then + test_exec_prefix=$test_prefix +else + test_exec_prefix=$exec_prefix +fi + +AC_ARG_WITH(sysroot, +[AS_HELP_STRING([[--with-sysroot[=DIR]]], + [search for usr/lib, usr/include, et al, within DIR])], +[ + case ${with_sysroot} in + /) ;; + */) with_sysroot=`echo $with_sysroot | sed 's,/$,,'` ;; + esac + case ${with_sysroot} in + yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_noncanonical}/sys-root' ;; + *) TARGET_SYSTEM_ROOT=$with_sysroot ;; + esac + + TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"' + CROSS_SYSTEM_HEADER_DIR='$(TARGET_SYSTEM_ROOT)$${sysroot_headers_suffix}$(NATIVE_SYSTEM_HEADER_DIR)' + + case ${TARGET_SYSTEM_ROOT} in + "${test_prefix}"|"${test_prefix}/"*|\ + "${test_exec_prefix}"|"${test_exec_prefix}/"*|\ + '${prefix}'|'${prefix}/'*|\ + '${exec_prefix}'|'${exec_prefix}/'*) + t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE" + TARGET_SYSTEM_ROOT_DEFINE="$t" + ;; + esac +], [ + TARGET_SYSTEM_ROOT= + TARGET_SYSTEM_ROOT_DEFINE= + CROSS_SYSTEM_HEADER_DIR='$(gcc_tooldir)/sys-include' +]) +AC_SUBST(TARGET_SYSTEM_ROOT) +AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE) +AC_SUBST(CROSS_SYSTEM_HEADER_DIR) + # Don't set gcc_gxx_include_dir to gxx_include_dir since that's only # passed in by the toplevel make and thus we'd get different behavior # depending on where we built the sources. @@ -152,7 +219,9 @@ gcc_gxx_include_dir_add_sysroot=0 if test "${with_sysroot+set}" = set; then gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'` if test "${gcc_gxx_without_sysroot}"; then - gcc_gxx_include_dir="${gcc_gxx_without_sysroot}" + if test x${with_sysroot} != x/; then + gcc_gxx_include_dir="${gcc_gxx_without_sysroot}" + fi gcc_gxx_include_dir_add_sysroot=1 fi fi @@ -791,69 +860,6 @@ AC_ARG_ENABLE(shared, ], [enable_shared=yes]) AC_SUBST(enable_shared) -AC_ARG_WITH([native-system-header-dir], - [ --with-native-system-header-dir=dir - use dir as the directory to look for standard - system header files in. Defaults to /usr/include.], -[ - case ${with_native_system_header_dir} in - yes|no) AC_MSG_ERROR([bad value ${withval} given for --with-native-system-header-dir]) ;; - /* | [[A-Za-z]]:[[\\/]]*) ;; - *) AC_MSG_ERROR([--with-native-system-header-dir argument ${withval} must be an absolute directory]) ;; - esac - configured_native_system_header_dir="${withval}" -], [configured_native_system_header_dir=]) - -AC_ARG_WITH(build-sysroot, - [AS_HELP_STRING([--with-build-sysroot=sysroot], - [use sysroot as the system root during the build])], - [if test x"$withval" != x ; then - SYSROOT_CFLAGS_FOR_TARGET="--sysroot=$withval" - fi], - [SYSROOT_CFLAGS_FOR_TARGET=]) -AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET) - -if test "x$prefix" = xNONE; then - test_prefix=/usr/local -else - test_prefix=$prefix -fi -if test "x$exec_prefix" = xNONE; then - test_exec_prefix=$test_prefix -else - test_exec_prefix=$exec_prefix -fi - -AC_ARG_WITH(sysroot, -[AS_HELP_STRING([[--with-sysroot[=DIR]]], - [search for usr/lib, usr/include, et al, within DIR])], -[ - case ${with_sysroot} in - yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_noncanonical}/sys-root' ;; - *) TARGET_SYSTEM_ROOT=$with_sysroot ;; - esac - - TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"' - CROSS_SYSTEM_HEADER_DIR='$(TARGET_SYSTEM_ROOT)$${sysroot_headers_suffix}$(NATIVE_SYSTEM_HEADER_DIR)' - - case ${TARGET_SYSTEM_ROOT} in - "${test_prefix}"|"${test_prefix}/"*|\ - "${test_exec_prefix}"|"${test_exec_prefix}/"*|\ - '${prefix}'|'${prefix}/'*|\ - '${exec_prefix}'|'${exec_prefix}/'*) - t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE" - TARGET_SYSTEM_ROOT_DEFINE="$t" - ;; - esac -], [ - TARGET_SYSTEM_ROOT= - TARGET_SYSTEM_ROOT_DEFINE= - CROSS_SYSTEM_HEADER_DIR='$(gcc_tooldir)/sys-include' -]) -AC_SUBST(TARGET_SYSTEM_ROOT) -AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE) -AC_SUBST(CROSS_SYSTEM_HEADER_DIR) - AC_ARG_WITH(specs, [AS_HELP_STRING([--with-specs=SPECS], [add SPECS to driver command-line processing])], |