CT-NG 1.11.1: Using Spaces in *_EXTRA_CONFIG

Benoît THÉBAUDEAU benoit.thebaudeau@advansee.com
Fri May 13 19:58:00 GMT 2011


Hi all,

I am facing exactly the same issue.

> Yes, indeed. That's a limitation. The problem is that we want to:
>  - allow passing more than one configure argument
>  - allow for arguments with spaces
>
> But because kconfig only supports strings (and tristates), we have to
> make
> a choice between the two requirements. I initially choose to favour
> passing
> multiple arguments, and thus discarded the ability to pass argmuents
> with
> spaces in them.
>
> So, when using the *_EXTRA_CONFIG variables, crosstool-NG does not
> enclose
> expansion between double quotes.

Indeed, but there may have a solution without having to make a choice.

In CT-NG 1.11.1, kconfig leaves single quotes as is when saving menuconfig to .config, and it escapes double quotes, so there is no limitation on this side for *_EXTRA_CONFIG variables stored as strings.

However, there is an issue with bash word splitting for instance when ${CT_BINUTILS_EXTRA_CONFIG} is expanded when do_binutils() invokes CT_DoExecLog().

> Yes. Sorry... :-/
>
> So basically, if we want to support both multiple args *and* args
> with
> spaces in them, then we have to come up with a few tricks. And I have
> a
> few ideas.
>
> The first, relatively easy one:
>  - use a character as a separator between args. The pipe '|' seems
>  like
>   a rather good candidate here. I can't really see args with pipes in
>   them, and pipes are commonly used in AsciiArt to create tables, so
>   hard-core programmers (they are our target audience, aren't they?
>   ;-])
>   would not be too disoriented.
>  - then *_EXTRA_CONFIG variables (and potentially others) are split
>  up
>   around pipes to create bash-style arrays. I have a mostly-working
>   code snippet that does the trick (see below).
>  - code that needs to split such variables would call a function, eg.
>   somewhere in the binutils build function:
>      CT_SplitVar CT_BINUTILS_EXTRA_CONFIG extra_config
>  - works in all cases, but breaks existing .config files

Reserving special characters for that might cause trouble, especially if there is no escape sequence built for it.

Anyway, the pipe '|' may already be used, e.g.:
'--with-specs=%{save-temps: -fverbose-asm} %{funwind-tables|fno-unwind-tables|mabi=*|ffreestanding|nostdlib:;:-funwind-tables}'

> The second, relatively complex, but maybe more easy to use from an
> end-user perspective (or maybe not):
>  - allow for bash-style arrays assignments in the menuconfig, such as
>   (note the nultiple conflicting double-quotes):
>     CT_BINUTILS_EXTRA_CONFIG="--arg1="val with space"
>     --arg2=no_space"
>  - of course, this implies that .config is no longer sourceable as-is
>  and
>   needs a bit of love+sed so as to transform such variables into
>   proper
>   bash-style array assignments:
>     CT_BINUTILS_EXTRA_CONFIG=( --arg1="val with space"
>     "--arg2=no_space" )
>  - then the code that needs that variable should simply treat it as a
>   bash-style array.
>  - much more impact on the infrastructure code, and not very robust.

Indeed.

> The third idea would be to make kconfig aware of array variables.
> Well, no... Forget this idea. :-]

OK.

> No need to say that I like the first idea much more than the second
> one.
> Thoughts?
>
> Regards,
> Yann E. MORIN.
>
> PS. Mostly-working code snippet to split variables, but breaks on
> empty
>    input variable for now. Easy to fix.
>    split_me() {
>      local var_to_split="${1}"
>      local out_var="${2}"
>      local ___foo
>      local -a ___bar
>
>      eval ___foo="\${${var_to_split}}\|"
>      while [ -n "${___foo}" ]; do
>        ___bar+=( "${___foo%%|*}" )
>        ___foo="${___foo#*|}"
>      done
>      eval ${out_var}=\(\"\${___bar[@]}\"\)
>    }
> I'll see what I can do about it during the WE...

Well, I propose the patch below. I have tested it on a full build, and it works nicely. It addresses the bash word splitting issue without disturbing much the infrastructure or the menuconfig. Feel free to improve it and to integrate it. eval may be moved to CT_DoExecLog() and a function may be created to automatically add a double quoting level to each entry of an variable array like extra_config[@]. I don't know if it would be cleaner.

Best regards,
Benoît

---
This patch delays the bash word splitting in *EXTRA_CONFIG variables using eval
so that quotes can be used in the corresponding menuconfig entries for configure
arguments including spaces. E.g.:
'--with-specs=%{save-temps: -fverbose-asm} %{funwind-tables|fno-unwind-tables|mabi=*|ffreestanding|nostdlib:;:-funwind-tables}'
'--with-pkgversion=${CT_CC_PKGVERSION}'

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
---
diff -Nrdup crosstool-ng-1.11.1.orig/scripts/build/binutils/binutils.sh crosstool-ng-1.11.1/scripts/build/binutils/binutils.sh
--- crosstool-ng-1.11.1.orig/scripts/build/binutils/binutils.sh	2011-05-02 18:11:24.000000000 +0200
+++ crosstool-ng-1.11.1/scripts/build/binutils/binutils.sh	2011-05-13 16:25:27.944984290 +0200
@@ -58,19 +58,20 @@ do_binutils() {

     CT_DoLog DEBUG "Extra config passed: '${extra_config[*]}'"

-    CT_DoExecLog CFG                                            \
-    CFLAGS="${CT_CFLAGS_FOR_HOST}"                              \
-    "${CT_SRC_DIR}/binutils-${CT_BINUTILS_VERSION}/configure"   \
-        --build=${CT_BUILD}                                     \
-        --host=${CT_HOST}                                       \
-        --target=${CT_TARGET}                                   \
-        --prefix=${CT_PREFIX_DIR}                               \
-        --disable-nls                                           \
-        --disable-multilib                                      \
-        --disable-werror                                        \
-        "${extra_config[@]}"                                    \
-        ${CT_ARCH_WITH_FLOAT}                                   \
-        ${CT_BINUTILS_EXTRA_CONFIG}                             \
+    CT_DoExecLog CFG                                              \
+    CFLAGS="${CT_CFLAGS_FOR_HOST}"                                \
+    eval                                                          \
+    "\"${CT_SRC_DIR}/binutils-${CT_BINUTILS_VERSION}/configure\"" \
+        --build=${CT_BUILD}                                       \
+        --host=${CT_HOST}                                         \
+        --target=${CT_TARGET}                                     \
+        --prefix=${CT_PREFIX_DIR}                                 \
+        --disable-nls                                             \
+        --disable-multilib                                        \
+        --disable-werror                                          \
+        ${extra_config[@]}                                        \
+        ${CT_ARCH_WITH_FLOAT}                                     \
+        ${CT_BINUTILS_EXTRA_CONFIG}                               \
         ${BINUTILS_SYSROOT_ARG}

     if [ "${CT_STATIC_TOOLCHAIN}" = "y" ]; then
@@ -141,19 +142,20 @@ do_binutils_target() {
         CT_Pushd "${CT_BUILD_DIR}/build-binutils-for-target"

         CT_DoLog EXTRA "Configuring binutils for target"
-        CT_DoExecLog CFG                                            \
-        "${CT_SRC_DIR}/binutils-${CT_BINUTILS_VERSION}/configure"   \
-            --build=${CT_BUILD}                                     \
-            --host=${CT_TARGET}                                     \
-            --target=${CT_TARGET}                                   \
-            --prefix=/usr                                           \
-            --disable-werror                                        \
-            --enable-shared                                         \
-            --enable-static                                         \
-            --disable-nls                                           \
-            --disable-multilib                                      \
-            "${extra_config[@]}"                                    \
-            ${CT_ARCH_WITH_FLOAT}                                   \
+        CT_DoExecLog CFG                                              \
+        eval                                                          \
+        "\"${CT_SRC_DIR}/binutils-${CT_BINUTILS_VERSION}/configure\"" \
+            --build=${CT_BUILD}                                       \
+            --host=${CT_TARGET}                                       \
+            --target=${CT_TARGET}                                     \
+            --prefix=/usr                                             \
+            --disable-werror                                          \
+            --enable-shared                                           \
+            --enable-static                                           \
+            --disable-nls                                             \
+            --disable-multilib                                        \
+            ${extra_config[@]}                                        \
+            ${CT_ARCH_WITH_FLOAT}                                     \
             ${CT_BINUTILS_EXTRA_CONFIG}

         CT_DoLog EXTRA "Building binutils' libraries (${targets[*]}) for target"
diff -Nrdup crosstool-ng-1.11.1.orig/scripts/build/binutils/elf2flt.sh crosstool-ng-1.11.1/scripts/build/binutils/elf2flt.sh
--- crosstool-ng-1.11.1.orig/scripts/build/binutils/elf2flt.sh	2011-05-02 18:11:24.000000000 +0200
+++ crosstool-ng-1.11.1/scripts/build/binutils/elf2flt.sh	2011-05-13 16:17:02.866751881 +0200
@@ -37,18 +37,19 @@ do_elf2flt() {
     binutils_src=${CT_SRC_DIR}/binutils-${CT_BINUTILS_VERSION}

     CT_DoLog EXTRA "Configuring elf2flt"
-    CT_DoExecLog CFG                                            \
-    CFLAGS="${CT_CFLAGS_FOR_HOST}"                              \
-    "${CT_SRC_DIR}/elf2flt-cvs-${CT_ELF2FLT_VERSION}/configure" \
-        --build=${CT_BUILD}                                     \
-        --host=${CT_HOST}                                       \
-        --target=${CT_TARGET}                                   \
-        --prefix=${CT_PREFIX_DIR}                               \
-        --with-bfd-include-dir=${binutils_bld}/bfd              \
-        --with-binutils-include-dir=${binutils_src}/include     \
-        --with-libbfd=${binutils_bld}/bfd/libbfd.a              \
-        --with-libiberty=${binutils_bld}/libiberty/libiberty.a  \
-        ${elf2flt_opts}                                         \
+    CT_DoExecLog CFG                                                \
+    CFLAGS="${CT_CFLAGS_FOR_HOST}"                                  \
+    eval                                                            \
+    "\"${CT_SRC_DIR}/elf2flt-cvs-${CT_ELF2FLT_VERSION}/configure\"" \
+        --build=${CT_BUILD}                                         \
+        --host=${CT_HOST}                                           \
+        --target=${CT_TARGET}                                       \
+        --prefix=${CT_PREFIX_DIR}                                   \
+        --with-bfd-include-dir=${binutils_bld}/bfd                  \
+        --with-binutils-include-dir=${binutils_src}/include         \
+        --with-libbfd=${binutils_bld}/bfd/libbfd.a                  \
+        --with-libiberty=${binutils_bld}/libiberty/libiberty.a      \
+        ${elf2flt_opts}                                             \
         ${CT_ELF2FLT_EXTRA_CONFIG}

     CT_DoLog EXTRA "Building elf2flt"
diff -Nrdup crosstool-ng-1.11.1.orig/scripts/build/cc/gcc.sh crosstool-ng-1.11.1/scripts/build/cc/gcc.sh
--- crosstool-ng-1.11.1.orig/scripts/build/cc/gcc.sh	2011-05-02 18:11:24.000000000 +0200
+++ crosstool-ng-1.11.1/scripts/build/cc/gcc.sh	2011-05-13 16:33:49.298981899 +0200
@@ -160,8 +160,8 @@ do_cc_core() {
     cd "${CT_BUILD_DIR}/build-cc-core-${mode}"

     # Bare metal delivers the core compiler as final compiler, so add version info and bugurl
-    [ -n "${CT_CC_BUGURL}" ]     && extra_config+=("--with-bugurl=${CT_CC_BUGURL}")
-    [ -n "${CT_CC_PKGVERSION}" ] && extra_config+=("--with-pkgversion=${CT_CC_PKGVERSION}")
+    [ -n "${CT_CC_BUGURL}" ]     && extra_config+=("\"--with-bugurl=${CT_CC_BUGURL}\"")
+    [ -n "${CT_CC_PKGVERSION}" ] && extra_config+=("\"--with-pkgversion=${CT_CC_PKGVERSION}\"")

     if [ "${copy_headers}" = "y" ]; then
         CT_DoLog DEBUG "Copying headers to install area of bootstrap gcc, so it can build libgcc2"
@@ -173,7 +173,7 @@ do_cc_core() {
     for tmp in ARCH ABI CPU TUNE FPU FLOAT; do
         eval tmp="\${CT_ARCH_WITH_${tmp}}"
         if [ -n "${tmp}" ]; then
-            extra_config+=("${tmp}")
+            extra_config+=("\"${tmp}\"")
         fi
     done
     if [ "${CT_CC_CXA_ATEXIT}" = "y" ]; then
@@ -216,26 +216,26 @@ do_cc_core() {
     fi

     if [ "${CT_CC_GCC_USE_GMP_MPFR}" = "y" ]; then
-        extra_config+=("--with-gmp=${CT_COMPLIBS_DIR}")
-        extra_config+=("--with-mpfr=${CT_COMPLIBS_DIR}")
+        extra_config+=("\"--with-gmp=${CT_COMPLIBS_DIR}\"")
+        extra_config+=("\"--with-mpfr=${CT_COMPLIBS_DIR}\"")
     fi
     if [ "${CT_CC_GCC_USE_MPC}" = "y" ]; then
-        extra_config+=("--with-mpc=${CT_COMPLIBS_DIR}")
+        extra_config+=("\"--with-mpc=${CT_COMPLIBS_DIR}\"")
     fi
     if [ "${CT_CC_GCC_USE_GRAPHITE}" = "y" ]; then
-        extra_config+=("--with-ppl=${CT_COMPLIBS_DIR}")
+        extra_config+=("\"--with-ppl=${CT_COMPLIBS_DIR}\"")
         # With PPL 0.11+, also pull libpwl if needed
         if [ "${CT_PPL_NEEDS_LIBPWL}" = "y" ]; then
             host_libstdcxx_flags+=("-L${CT_COMPLIBS_DIR}/lib")
             host_libstdcxx_flags+=("-lpwl")
         fi
-        extra_config+=("--with-cloog=${CT_COMPLIBS_DIR}")
+        extra_config+=("\"--with-cloog=${CT_COMPLIBS_DIR}\"")
     elif [ "${CT_CC_GCC_HAS_GRAPHITE}" = "y" ]; then
         extra_config+=("--with-ppl=no")
         extra_config+=("--with-cloog=no")
     fi
     if [ "${CT_CC_GCC_USE_LTO}" = "y" ]; then
-        extra_config+=("--with-libelf=${CT_COMPLIBS_DIR}")
+        extra_config+=("\"--with-libelf=${CT_COMPLIBS_DIR}\"")
         extra_config+=("--enable-lto")
     elif [ "${CT_CC_GCC_HAS_LTO}" = "y" ]; then
         extra_config+=("--with-libelf=no")
@@ -243,7 +243,7 @@ do_cc_core() {
     fi

     if [ ${#host_libstdcxx_flags[@]} -ne 0 ]; then
-        extra_config+=("--with-host-libstdcxx=${host_libstdcxx_flags[*]}")
+        extra_config+=("\"--with-host-libstdcxx=${host_libstdcxx_flags[*]}\"")
     fi

     if [ "${CT_CC_GCC_ENABLE_TARGET_OPTSPACE}" = "y" ]; then
@@ -259,23 +259,24 @@ do_cc_core() {
     CT_DoLog DEBUG "Extra config passed: '${extra_config[*]}'"

     # Use --with-local-prefix so older gccs don't look in /usr/local (http://gcc.gnu.org/PR10532)
-    CT_DoExecLog CFG                                \
-    CC_FOR_BUILD="${CT_BUILD}-gcc"                  \
-    CFLAGS="${CT_CFLAGS_FOR_HOST}"                  \
-    LDFLAGS="${core_LDFLAGS[*]}"                    \
-    "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/configure"  \
-        --build=${CT_BUILD}                         \
-        --host=${CT_HOST}                           \
-        --target=${CT_TARGET}                       \
-        --prefix="${core_prefix_dir}"               \
-        --with-local-prefix="${CT_SYSROOT_DIR}"     \
-        --disable-multilib                          \
-        --disable-libmudflap                        \
-        ${CC_CORE_SYSROOT_ARG}                      \
-        "${extra_config[@]}"                        \
-        --disable-nls                               \
-        --enable-symvers=gnu                        \
-        --enable-languages="${lang_opt}"            \
+    CT_DoExecLog CFG                                    \
+    CC_FOR_BUILD="${CT_BUILD}-gcc"                      \
+    CFLAGS="${CT_CFLAGS_FOR_HOST}"                      \
+    LDFLAGS="${core_LDFLAGS[*]}"                        \
+    eval                                                \
+    "\"${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/configure\""  \
+        --build=${CT_BUILD}                             \
+        --host=${CT_HOST}                               \
+        --target=${CT_TARGET}                           \
+        --prefix="\"${core_prefix_dir}\""               \
+        --with-local-prefix="\"${CT_SYSROOT_DIR}\""     \
+        --disable-multilib                              \
+        --disable-libmudflap                            \
+        ${CC_CORE_SYSROOT_ARG}                          \
+        ${extra_config[@]}                              \
+        --disable-nls                                   \
+        --enable-symvers=gnu                            \
+        --enable-languages="\"${lang_opt}\""            \
         ${CT_CC_CORE_EXTRA_CONFIG}

     if [ "${build_libgcc}" = "yes" ]; then
@@ -392,18 +393,18 @@ do_cc() {
     CT_Test "Building ${CT_CC_LANG_OTHERS//,/ } language(s) is not yet supported. Will try..." -n "${CT_CC_LANG_OTHERS}"
     lang_opt=$(echo "${lang_opt},${CT_CC_LANG_OTHERS}" |sed -r -e 's/,+/,/g; s/,*$//;')

-    extra_config+=("--enable-languages=${lang_opt}")
+    extra_config+=("\"--enable-languages=${lang_opt}\"")
     extra_config+=("--disable-multilib")
     for tmp in ARCH ABI CPU TUNE FPU FLOAT; do
         eval tmp="\${CT_ARCH_WITH_${tmp}}"
         if [ -n "${tmp}" ]; then
-            extra_config+=("${tmp}")
+            extra_config+=("\"${tmp}\"")
         fi
     done

     [ "${CT_SHARED_LIBS}" = "y" ]                   || extra_config+=("--disable-shared")
-    [ -n "${CT_CC_PKGVERSION}" ]                    && extra_config+=("--with-pkgversion=${CT_CC_PKGVERSION}")
-    [ -n "${CT_CC_BUGURL}" ]                        && extra_config+=("--with-bugurl=${CT_CC_BUGURL}")
+    [ -n "${CT_CC_PKGVERSION}" ]                    && extra_config+=("\"--with-pkgversion=${CT_CC_PKGVERSION}\"")
+    [ -n "${CT_CC_BUGURL}" ]                        && extra_config+=("\"--with-bugurl=${CT_CC_BUGURL}\"")
     case "${CT_CC_GCC_SJLJ_EXCEPTIONS}" in
         y)  extra_config+=("--enable-sjlj-exceptions");;
         m)  ;;
@@ -415,7 +416,7 @@ do_cc() {
         extra_config+=("--disable-__cxa_atexit")
     fi
     if [ -n "${CC_ENABLE_CXX_FLAGS}" ]; then
-        extra_config+=("--enable-cxx-flags=${CC_ENABLE_CXX_FLAGS}")
+        extra_config+=("\"--enable-cxx-flags=${CC_ENABLE_CXX_FLAGS}\"")
     fi
     if [ "${CT_CC_GCC_LIBMUDFLAP}" = "y" ]; then
         extra_config+=(--enable-libmudflap)
@@ -467,32 +468,32 @@ do_cc() {
     fi

     if [ "${CT_CC_GCC_USE_GMP_MPFR}" = "y" ]; then
-        extra_config+=("--with-gmp=${CT_COMPLIBS_DIR}")
-        extra_config+=("--with-mpfr=${CT_COMPLIBS_DIR}")
+        extra_config+=("\"--with-gmp=${CT_COMPLIBS_DIR}\"")
+        extra_config+=("\"--with-mpfr=${CT_COMPLIBS_DIR}\"")
     fi
     if [ "${CT_CC_GCC_USE_MPC}" = "y" ]; then
-        extra_config+=("--with-mpc=${CT_COMPLIBS_DIR}")
+        extra_config+=("\"--with-mpc=${CT_COMPLIBS_DIR}\"")
     fi
     if [ "${CT_CC_GCC_USE_GRAPHITE}" = "y" ]; then
-        extra_config+=("--with-ppl=${CT_COMPLIBS_DIR}")
+        extra_config+=("\"--with-ppl=${CT_COMPLIBS_DIR}\"")
         # With PPL 0.11+, also pull libpwl if needed
         if [ "${CT_PPL_NEEDS_LIBPWL}" = "y" ]; then
             host_libstdcxx_flags+=("-L${CT_COMPLIBS_DIR}/lib")
             host_libstdcxx_flags+=("-lpwl")
         fi
-        extra_config+=("--with-cloog=${CT_COMPLIBS_DIR}")
+        extra_config+=("\"--with-cloog=${CT_COMPLIBS_DIR}\"")
     elif [ "${CT_CC_GCC_HAS_GRAPHITE}" = "y" ]; then
         extra_config+=("--with-ppl=no")
         extra_config+=("--with-cloog=no")
     fi
     if [ "${CT_CC_GCC_USE_LTO}" = "y" ]; then
-        extra_config+=("--with-libelf=${CT_COMPLIBS_DIR}")
+        extra_config+=("\"--with-libelf=${CT_COMPLIBS_DIR}\"")
     elif [ "${CT_CC_GCC_HAS_LTO}" = "y" ]; then
         extra_config+=("--with-libelf=no")
     fi

     if [ ${#host_libstdcxx_flags[@]} -ne 0 ]; then
-        extra_config+=("--with-host-libstdcxx=${host_libstdcxx_flags[*]}")
+        extra_config+=("\"--with-host-libstdcxx=${host_libstdcxx_flags[*]}\"")
     fi

     if [ "${CT_THREADS}" = "none" ]; then
@@ -536,25 +537,26 @@ do_cc() {
     # detection problem only matters for gcc-3.2.x and later, I think.
     # --disable-nls to work around crash bug on ppc405, but also because
     # embedded systems don't really need message catalogs...
-    CT_DoExecLog CFG                                \
-    CC_FOR_BUILD="${CT_BUILD}-gcc"                  \
-    CFLAGS="${CT_CFLAGS_FOR_HOST}"                  \
-    LDFLAGS="${final_LDFLAGS[*]}"                   \
-    CFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}"         \
-    CXXFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}"       \
-    LDFLAGS_FOR_TARGET="${CT_TARGET_LDFLAGS}"       \
-    "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/configure"  \
-        --build=${CT_BUILD}                         \
-        --host=${CT_HOST}                           \
-        --target=${CT_TARGET}                       \
-        --prefix="${CT_PREFIX_DIR}"                 \
-        ${CC_SYSROOT_ARG}                           \
-        "${extra_config[@]}"                        \
-        --with-local-prefix="${CT_SYSROOT_DIR}"     \
-        --disable-nls                               \
-        --enable-symvers=gnu                        \
-        --enable-c99                                \
-        --enable-long-long                          \
+    CT_DoExecLog CFG                                    \
+    CC_FOR_BUILD="${CT_BUILD}-gcc"                      \
+    CFLAGS="${CT_CFLAGS_FOR_HOST}"                      \
+    LDFLAGS="${final_LDFLAGS[*]}"                       \
+    CFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}"             \
+    CXXFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}"           \
+    LDFLAGS_FOR_TARGET="${CT_TARGET_LDFLAGS}"           \
+    eval                                                \
+    "\"${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/configure\""  \
+        --build=${CT_BUILD}                             \
+        --host=${CT_HOST}                               \
+        --target=${CT_TARGET}                           \
+        --prefix="\"${CT_PREFIX_DIR}\""                 \
+        ${CC_SYSROOT_ARG}                               \
+        ${extra_config[@]}                              \
+        --with-local-prefix="\"${CT_SYSROOT_DIR}\""     \
+        --disable-nls                                   \
+        --enable-symvers=gnu                            \
+        --enable-c99                                    \
+        --enable-long-long                              \
         ${CT_CC_EXTRA_CONFIG}

     if [ "${CT_CANADIAN}" = "y" ]; then
diff -Nrdup crosstool-ng-1.11.1.orig/scripts/build/libc/glibc-eglibc.sh-common crosstool-ng-1.11.1/scripts/build/libc/glibc-eglibc.sh-common
--- crosstool-ng-1.11.1.orig/scripts/build/libc/glibc-eglibc.sh-common	2011-05-02 18:11:24.000000000 +0200
+++ crosstool-ng-1.11.1/scripts/build/libc/glibc-eglibc.sh-common	2011-05-13 16:38:28.398981905 +0200
@@ -153,7 +153,7 @@ do_libc() {
     # We don't need to be conditional on wether the user did set different
     # values, as they CT_LIBC_GLIBC_EXTRA_CONFIG is passed after extra_config

-    extra_config+=("$(do_libc_min_kernel_config)")
+    extra_config+=("\"$(do_libc_min_kernel_config)\"")

     case "${CT_THREADS}" in
         nptl)           extra_config+=("--with-__thread" "--with-tls");;
@@ -181,12 +181,12 @@ do_libc() {
     fi

     if [ "${CT_LIBC_OLDEST_ABI}" != "" ]; then
-        extra_config+=("--enable-oldest-abi=${CT_LIBC_OLDEST_ABI}")
+        extra_config+=("--enable-oldest-abi=\"${CT_LIBC_OLDEST_ABI}\"")
     fi

     case "$(do_libc_add_ons_list ,)" in
         "") ;;
-        *)  extra_config+=("--enable-add-ons=$(do_libc_add_ons_list ,)");;
+        *)  extra_config+=("--enable-add-ons=\"$(do_libc_add_ons_list ,)\"");;
     esac

     extra_cc_args="${extra_cc_args} ${CT_ARCH_ENDIAN_OPT}"
@@ -240,16 +240,17 @@ do_libc() {
     CC="${CT_TARGET}-gcc ${CT_LIBC_EXTRA_CC_ARGS} ${extra_cc_args}" \
     AR=${CT_TARGET}-ar                                              \
     RANLIB=${CT_TARGET}-ranlib                                      \
-    "${src_dir}/configure"                                          \
+    eval                                                            \
+    "\"${src_dir}/configure\""                                      \
         --prefix=/usr                                               \
         --build=${CT_BUILD}                                         \
         --host=${CT_TARGET}                                         \
-        --cache-file="$(pwd)/config.cache"                          \
+        --cache-file="\"$(pwd)/config.cache\""                      \
         --without-cvs                                               \
         --disable-profile                                           \
         --without-gd                                                \
-        --with-headers="${CT_HEADERS_DIR}"                          \
-        "${extra_config[@]}"                                        \
+        --with-headers="\"${CT_HEADERS_DIR}\""                      \
+        ${extra_config[@]}                                          \
         ${CT_LIBC_GLIBC_EXTRA_CONFIG}

     # build hacks

--
For unsubscribe information see http://sourceware.org/lists.html#faq



More information about the crossgcc mailing list