--- config.make.in | 1 + configure | 16 +++++++++++++++- configure.in | 1 + posix/Makefile | 2 +- sunrpc/Makefile | 2 +- timezone/Makefile | 2 +- 6 files changed, 20 insertions(+), 4 deletions(-) Index: config.make.in =================================================================== --- config.make.in.orig +++ config.make.in @@ -99,6 +99,7 @@ add-ons = @add_ons@ add-on-subdirs = @add_on_subdirs@ sysdeps-add-ons = @sysdeps_add_ons@ cross-compiling = @cross_compiling@ +compiled-binaries-can-run-on-buildhost = @compiled_binaries_can_run_on_buildhost@ force-install = @force_install@ # Build tools. Index: configure.in =================================================================== --- configure.in.orig 2011-05-20 15:39:31.237690293 +0200 +++ configure.in 2011-05-20 15:43:55.595111363 +0200 @@ -16,6 +16,7 @@ AC_CHECK_PROGS(BUILD_CC, gcc cc) fi AC_SUBST(cross_compiling) +AC_SUBST(compiled_binaries_can_run_on_buildhost) AC_PROG_CPP # We need the C++ compiler only for testing. AC_PROG_CXX Index: configure =================================================================== --- configure.orig 2011-05-20 15:46:40.675628746 +0200 +++ configure 2011-05-20 15:40:52.292884126 +0200 @@ -545,6 +545,7 @@ ac_config_libobj_dir=. LIBOBJS= cross_compiling=no +compiled_binaries_can_run_on_buildhost=yes subdirs= MFLAGS= MAKEFLAGS= @@ -697,6 +696,7 @@ CXX CPP cross_compiling +compiled_binaries_can_run_on_buildhost BUILD_CC OBJEXT ac_ct_CC @@ -1244,6 +1242,13 @@ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done +# Check whether --enable-runbinaries was given. +if test "${enable_runbinaries+set}" = set; then + enableval=$enable_runbinaries; compiled_binaries_can_run_on_buildhost=$enableval +else + compiled_binaries_can_run_on_buildhost=yes +fi + # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. @@ -1266,6 +1257,7 @@ If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes + compiled_binaries_can_run_on_buildhost=no fi fi @@ -1454,6 +1444,9 @@ --enable-experimental-malloc enable experimental malloc features --enable-nss-crypt enable libcrypt to use nss + --enable-runbinaries the compiled binaries should run on the buildhost because + it happens to have a compatible cpu + Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] Index: posix/Makefile =================================================================== --- posix/Makefile.orig +++ posix/Makefile @@ -302,7 +302,7 @@ $(inst_libexecdir)/getconf: $(inst_bindi done < $(objpfx)getconf.speclist $(objpfx)getconf.speclist: $(objpfx)getconf -ifeq (no,$(cross-compiling)) +ifeq (yes,$(compiled-binaries-can-run-on-buildhost)) LC_ALL=C GETCONF_DIR=/dev/null \ $(run-program-prefix) $< _POSIX_V7_WIDTH_RESTRICTED_ENVS > $@.new LC_ALL=C GETCONF_DIR=/dev/null \ Index: sunrpc/Makefile =================================================================== --- sunrpc/Makefile.orig +++ sunrpc/Makefile @@ -98,7 +98,7 @@ otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libresolv.a endif -ifeq (no,$(cross-compiling)) +ifeq (yes,$(compiled-binaries-can-run-on-buildhost)) # We can only build this library if we can run the rpcgen we build. headers += $(rpcsvc:%.x=rpcsvc/%.h) extra-libs := librpcsvc Index: timezone/Makefile =================================================================== --- timezone/Makefile.orig +++ timezone/Makefile @@ -69,7 +69,7 @@ installed-posixrules-file := $(firstword $(addprefix $(inst_zonedir)/, \ $(posixrules-file))) -ifeq ($(cross-compiling),no) +ifeq (yes,$(compiled-binaries-can-run-on-buildhost)) # Don't try to install the zoneinfo files since we can't run zic. install-others = $(addprefix $(inst_zonedir)/,$(zonenames) \ $(zonenames:%=posix/%) \