@@ -44,6 +44,8 @@ store_path() {
4444NATIVE_GCC=" $( store_path gcc-toolchain) "
4545export LIBRARY_PATH=" ${NATIVE_GCC} /lib:${NATIVE_GCC} /lib64"
4646export CPATH=" ${NATIVE_GCC} /include"
47+ unset C_INCLUDE_PATH
48+ unset CPLUS_INCLUDE_PATH
4749case " $HOST " in
4850 * darwin* )
4951 # When targeting darwin, some native tools built by depends require
@@ -66,7 +68,8 @@ case "$HOST" in
6668 # Determine output paths to use in CROSS_* environment variables
6769 CROSS_GLIBC=" $( store_path " mingw-w64-x86_64-winpthreads" ) "
6870 CROSS_GCC=" $( store_path " gcc-cross-${HOST} " ) "
69- CROSS_GCC_LIBS=( " ${CROSS_GCC} /lib/gcc/${HOST} " /* ) # This expands to an array of directories...
71+ CROSS_GCC_LIB_STORE=" $( store_path " gcc-cross-${HOST} " lib) "
72+ CROSS_GCC_LIBS=( " ${CROSS_GCC_LIB_STORE} /lib/gcc/${HOST} " /* ) # This expands to an array of directories...
7073 CROSS_GCC_LIB=" ${CROSS_GCC_LIBS[0]} " # ...we just want the first one (there should only be one)
7174
7275 # The search path ordering is generally:
@@ -75,7 +78,7 @@ case "$HOST" in
7578 # 2. kernel-header-related search paths (not applicable to mingw-w64 hosts)
7679 export CROSS_C_INCLUDE_PATH=" ${CROSS_GCC_LIB} /include:${CROSS_GCC_LIB} /include-fixed:${CROSS_GLIBC} /include"
7780 export CROSS_CPLUS_INCLUDE_PATH=" ${CROSS_GCC} /include/c++:${CROSS_GCC} /include/c++/${HOST} :${CROSS_GCC} /include/c++/backward:${CROSS_C_INCLUDE_PATH} "
78- export CROSS_LIBRARY_PATH=" ${CROSS_GCC } /lib:${CROSS_GCC} /${HOST} /lib:${CROSS_GCC_LIB} :${CROSS_GLIBC} /lib"
81+ export CROSS_LIBRARY_PATH=" ${CROSS_GCC_LIB_STORE } /lib:${CROSS_GCC} /${HOST} /lib:${CROSS_GCC_LIB} :${CROSS_GLIBC} /lib"
7982 ;;
8083 * darwin* )
8184 # The CROSS toolchain for darwin uses the SDK and ignores environment variables.
@@ -86,12 +89,13 @@ case "$HOST" in
8689 CROSS_GLIBC_STATIC=" $( store_path " glibc-cross-${HOST} " static) "
8790 CROSS_KERNEL=" $( store_path " linux-libre-headers-cross-${HOST} " ) "
8891 CROSS_GCC=" $( store_path " gcc-cross-${HOST} " ) "
89- CROSS_GCC_LIBS=( " ${CROSS_GCC} /lib/gcc/${HOST} " /* ) # This expands to an array of directories...
92+ CROSS_GCC_LIB_STORE=" $( store_path " gcc-cross-${HOST} " lib) "
93+ CROSS_GCC_LIBS=( " ${CROSS_GCC_LIB_STORE} /lib/gcc/${HOST} " /* ) # This expands to an array of directories...
9094 CROSS_GCC_LIB=" ${CROSS_GCC_LIBS[0]} " # ...we just want the first one (there should only be one)
9195
9296 export CROSS_C_INCLUDE_PATH=" ${CROSS_GCC_LIB} /include:${CROSS_GCC_LIB} /include-fixed:${CROSS_GLIBC} /include:${CROSS_KERNEL} /include"
9397 export CROSS_CPLUS_INCLUDE_PATH=" ${CROSS_GCC} /include/c++:${CROSS_GCC} /include/c++/${HOST} :${CROSS_GCC} /include/c++/backward:${CROSS_C_INCLUDE_PATH} "
94- export CROSS_LIBRARY_PATH=" ${CROSS_GCC } /lib:${CROSS_GCC} /${HOST} /lib:${CROSS_GCC_LIB} :${CROSS_GLIBC} /lib:${CROSS_GLIBC_STATIC} /lib"
98+ export CROSS_LIBRARY_PATH=" ${CROSS_GCC_LIB_STORE } /lib:${CROSS_GCC} /${HOST} /lib:${CROSS_GCC_LIB} :${CROSS_GLIBC} /lib:${CROSS_GLIBC_STATIC} /lib"
9599 ;;
96100 * )
97101 exit 1 ;;
0 commit comments