From d984763867f82879783c5b88615d9a458e3e7ad0 Mon Sep 17 00:00:00 2001 From: John Koleszar Date: Mon, 10 Dec 2012 12:07:59 -0800 Subject: [PATCH] configure: add --enable-external-build support First attempt at avoiding all the compile-time environment detection for cases where you can generate the environments statically, as when the real build is being performed by another build system. Change-Id: Ie3cf95d71d6c5169900f31e263b84bc123cdf73f --- build/make/configure.sh | 4 +--- configure | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/build/make/configure.sh b/build/make/configure.sh index d9b0fe7cd..e19efb03e 100755 --- a/build/make/configure.sh +++ b/build/make/configure.sh @@ -277,6 +277,7 @@ clean_temp_files() { # Toolchain Check Functions # check_cmd() { + enabled external_build && return log "$@" "$@" >>${logfile} 2>&1 } @@ -1175,9 +1176,6 @@ EOF ;; esac - # for sysconf(3) and friends. - check_header unistd.h - # glibc needs these if enabled linux; then add_cflags -D_LARGEFILE_SOURCE diff --git a/configure b/configure index d1d25b3d5..7d57d8ce6 100755 --- a/configure +++ b/configure @@ -298,6 +298,7 @@ CONFIG_LIST=" ${EXPERIMENT_LIST} " CMDLINE_SELECT=" + external_build extra_warnings werror install_docs @@ -497,7 +498,7 @@ process_detect() { fi fi fi - if [ -z "$CC" ]; then + if [ -z "$CC" ] || enabled external_build; then echo "Bypassing toolchain for environment detection." enable external_build check_header() { @@ -506,6 +507,7 @@ process_detect() { shift var=`echo $header | sed 's/[^A-Za-z0-9_]/_/g'` disable $var + # Headers common to all environments case $header in stdio.h) true; @@ -517,6 +519,25 @@ process_detect() { done ${result:-true} esac && enable $var + + # Specialize windows and POSIX environments. + case $toolchain in + *-win*-*) + case $header-$toolchain in + stdint*-gcc) true;; + *) false;; + esac && enable $var + ;; + *) + case $header in + stdint.h) true;; + pthread.h) true;; + sys/mman.h) true;; + unistd.h) true;; + *) false;; + esac && enable $var + esac + enabled $var } check_ld() { true @@ -530,6 +551,7 @@ EOF check_header stdint.h check_header pthread.h check_header sys/mman.h + check_header unistd.h # for sysconf(3) and friends. check_header vpx/vpx_integer.h -I${source_path} && enable vpx_ports }