From a6aeebda20393b7aeccaa344e62bbd7e77e468d5 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Fri, 7 Dec 2012 16:28:24 +1100 Subject: [PATCH] 3435. [bug] Cross compilation support in configure was broken. [RT #32078] Squashed commit of the following: commit 9c67d7a52346dffeb7609f08d3aaa8a8689d8094 Author: Mark Andrews Date: Fri Dec 7 13:31:50 2012 +1100 regen commit 4c1874dd3a98ea8e50b0860b107bd2deb8550af0 Author: Mark Andrews Date: Fri Dec 7 13:31:10 2012 +1100 improve cross compile support; tidy --help output commit 15ba411a728cc35c904804935477b15c8a65ebbd Author: Mark Andrews Date: Fri Dec 7 13:28:46 2012 +1100 add util/xc commit 165bc538fa6590752d7006348285a3ba48713498 Author: Mark Andrews Date: Fri Dec 7 13:27:35 2012 +1100 test cross compiler Conflicts: CHANGES config.h.in configure configure.in --- CHANGES | 3 +++ config.threads.in | 2 +- configure | 21 +++++++++++++-------- configure.in | 13 ++++++++++--- util/copyrights | 1 + util/xc | 39 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 67 insertions(+), 12 deletions(-) create mode 100755 util/xc diff --git a/CHANGES b/CHANGES index cf66b3c4f8..679cd0d1a3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +3435. [bug] Cross compilation support in configure was broken. + [RT #32078] + 3429. [bug] dns_zone_getserial2 could a return success without returning a valid serial. [RT #32007] diff --git a/config.threads.in b/config.threads.in index a56ca37d48..f41d68e1d5 100644 --- a/config.threads.in +++ b/config.threads.in @@ -60,7 +60,7 @@ case $host in esac AC_ARG_ENABLE(threads, - [ --enable-threads enable multithreading]) + [ --enable-threads enable multithreading]) case "$enable_threads" in yes) use_threads=true diff --git a/configure b/configure index be16a46367..c57515941b 100755 --- a/configure +++ b/configure @@ -2082,13 +2082,13 @@ Optional Features: optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-libbind deprecated - --enable-developer enable developer build settings + --enable-developer enable developer build settings --enable-kqueue use BSD kqueue when available [default=yes] --enable-epoll use Linux epoll when available [default=auto] --enable-devpoll use /dev/poll when available [default=yes] --enable-openssl-version-check Check OpenSSL Version [default=yes] - --enable-threads enable multithreading + --enable-threads enable multithreading --enable-largefile 64-bit file support --enable-ipv6 use IPv6 default=autodetect --enable-getifaddrs Enable the use of getifaddrs() [yes|no]. @@ -2123,7 +2123,7 @@ Optional Packages: --with-libiconv=IPREFIX GNU libiconv are in IPREFIX default PREFIX --with-iconv=LIBSPEC specify iconv library default -liconv --with-idnlib=ARG specify libidnkit - --with-atf=ARG Automated Test Framework support + --with-atf=ARG Automated Test Framework support --with-dlz-postgres=PATH Build with Postgres DLZ driver yes|no|path. (Required to use Postgres with DLZ) --with-dlz-mysql=PATH Build with MySQL DLZ driver yes|no|path. @@ -11784,7 +11784,6 @@ It is available from http://www.isc.org as a separate download." "$LINENO" 5 ;; esac - # Check whether --enable-developer was given. if test "${enable_developer+set}" = set; then : enableval=$enable_developer; @@ -13328,10 +13327,9 @@ auto) { $as_echo "$as_me:${as_lineno-$LINENO}: checking epoll support" >&5 $as_echo_n "checking epoll support... " >&6; } if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -14226,6 +14224,12 @@ fi case "$use_randomdev" in unspec) + case "$cross_compiling" in + yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unspecified" >&5 +$as_echo "unspecified" >&6; } + as_fn_error $? " need --with-randomdev=PATH or --with-randomdev=no" "$LINENO" 5 + esac case "$host" in *-openbsd*) devrandom=/dev/arandom @@ -14260,6 +14264,7 @@ _ACEOF fi + ;; yes) as_fn_error $? "--with-randomdev must specify a path" "$LINENO" 5 diff --git a/configure.in b/configure.in index 7fc713be65..af02efc4f5 100644 --- a/configure.in +++ b/configure.in @@ -62,8 +62,7 @@ It is available from http://www.isc.org as a separate download.]) ;; esac - -AC_ARG_ENABLE(developer, [ --enable-developer enable developer build settings]) +AC_ARG_ENABLE(developer, [ --enable-developer enable developer build settings]) case "$enable_developer" in yes) test "${enable_fixed_rrset+set}" = set || enable_fixed_rrset=yes @@ -443,6 +442,8 @@ int main() { [AC_MSG_RESULT(yes) ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1"], [AC_MSG_RESULT(no) + ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"], + [AC_MSG_RESULT(no) ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"]) ;; yes) @@ -908,6 +909,11 @@ AC_ARG_WITH(randomdev, case "$use_randomdev" in unspec) + case "$cross_compiling" in + yes) + AC_MSG_RESULT(unspecified) + AC_MSG_ERROR([ need --with-randomdev=PATH or --with-randomdev=no]) + esac case "$host" in *-openbsd*) devrandom=/dev/arandom @@ -920,6 +926,7 @@ case "$use_randomdev" in AC_CHECK_FILE($devrandom, AC_DEFINE_UNQUOTED(PATH_RANDOMDEV, "$devrandom"),) + ;; yes) AC_MSG_ERROR([--with-randomdev must specify a path]) @@ -2749,7 +2756,7 @@ AC_SUBST(IDNLIBS) # Check whether to build Automated Test Framework unit tests # AC_ARG_WITH(atf, - [ --with-atf=ARG Automated Test Framework support], + [ --with-atf=ARG Automated Test Framework support], atf="$withval", atf="no") if test "$atf" = yes; then atf=`pwd`/unit/atf diff --git a/util/copyrights b/util/copyrights index eac2f3cb9c..228a61823e 100644 --- a/util/copyrights +++ b/util/copyrights @@ -2813,6 +2813,7 @@ ./util/update-drafts.pl PERL 2000,2001,2004,2007,2012 ./util/update_branches PERL 2005,2007,2012 ./util/update_copyrights PERL 1998,1999,2000,2001,2004,2005,2006,2007,2008,2009,2010,2012 +./util/xc SH 2012 ./version X 1998,1999,2000,2001,2003,2005,2006,2007,2008,2009,2010,2011,2012 ./win32utils/BINDBuild.dsw X 2001,2005,2006,2008,2010 ./win32utils/BuildAll.bat BAT 2001,2002,2004,2005,2006,2007,2008 diff --git a/util/xc b/util/xc new file mode 100755 index 0000000000..6f4b037450 --- /dev/null +++ b/util/xc @@ -0,0 +1,39 @@ +# Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC") +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +# # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. + +# +# test cross compiler +# + +chmod= +next=0 +for t in ${BUILD_CC} gcc cc +do + type $t > /dev/null 2>&1 && cc=$t && break +done +for i in "$@" +do + [ $next = 1 ] && chmod="$i" + case "$i" in + -o) next=1;; + *) next=0;; + esac +done +if ${cc:-false} "$@" +then + [ "$chmod" != "" ] && chmod a-x "$chmod" + exit 0; +else + exit 1; +fi