diff --git a/qb/config.libs.sh b/qb/config.libs.sh index e27a35da22..32d8c33f00 100644 --- a/qb/config.libs.sh +++ b/qb/config.libs.sh @@ -4,9 +4,9 @@ check_switch_c NOUNUSED -Wno-unused-result add_define_make NOUNUSED "$HAVE_NOUNUSED" # There are still broken 64-bit Linux distros out there. :) -[ -d /usr/lib64 ] && add_library_dirs /usr/lib64 +[ -z "$CROSS_COMPILE" ] && [ -d /usr/lib64 ] && add_library_dirs /usr/lib64 -[ -d /opt/local/lib ] && add_library_dirs /opt/local/lib +[ -z "$CROSS_COMPILE" ] && [ -d /opt/local/lib ] && add_library_dirs /opt/local/lib if [ "$OS" = 'BSD' ]; then DYLIB=-lc; else DYLIB=-ldl; fi [ "$OS" = 'Darwin' ] && HAVE_X11=no # X11 breaks on recent OSXes even if present. diff --git a/qb/qb.comp.sh b/qb/qb.comp.sh index 20324b4edb..f3f80a2b73 100644 --- a/qb/qb.comp.sh +++ b/qb/qb.comp.sh @@ -24,7 +24,7 @@ if [ "$USE_LANG_C" = 'yes' ]; then #include int main(void) { puts("Hai world!"); return 0; } EOF - for CC in ${CC:=$(which gcc cc)} ''; do + for CC in ${CC:=$(which ${CROSS_COMPILE}gcc ${CROSS_COMPILE}cc)} ''; do "$CC" -o "$TEMP_EXE" "$TEMP_C" >/dev/null 2>&1 && break done [ "$CC" ] || { echo "$ECHOBUF ... Not found. Exiting."; exit 1;} @@ -40,7 +40,7 @@ if [ "$USE_LANG_CXX" = 'yes' ]; then #include int main() { std::cout << "Hai guise" << std::endl; return 0; } EOF - for CXX in ${CXX:=$(which g++ c++)} ''; do + for CXX in ${CXX:=$(which ${CROSS_COMPILE}g++ ${CROSS_COMPILE}c++)} ''; do "$CXX" -o "$TEMP_EXE" "$TEMP_CXX" >/dev/null 2>&1 && break done [ "$CXX" ] || { echo "$ECHOBUF ... Not found. Exiting."; exit 1;} diff --git a/qb/qb.params.sh b/qb/qb.params.sh index 13a962c946..68070343e6 100644 --- a/qb/qb.params.sh +++ b/qb/qb.params.sh @@ -16,6 +16,7 @@ LDFLAGS: Linker flags General options: --prefix=\$path: Install path prefix +--host=HOST: cross-compile to build programs to run on HOST --help: Show this help Custom options: @@ -50,6 +51,7 @@ parse_input() # Parse stuff :V while [ "$1" ]; do case "$1" in --prefix=*) PREFIX=${1##--prefix=};; + --host=*) CROSS_COMPILE=${1##--host=}-;; --enable-*) opt_exists "${1##--enable-}" eval "HAVE_$opt=yes"