diff -Nur Python-3.0/Lib/distutils/command/build_ext.py Python-3.0.new/Lib/distutils/command/build_ext.py --- Python-3.0/Lib/distutils/command/build_ext.py 2008-08-14 10:35:13.000000000 +0300 +++ Python-3.0.new/Lib/distutils/command/build_ext.py 2008-12-05 20:59:28.000000000 +0200 @@ -642,6 +642,8 @@ ext_path[len(ext_path) - 1] = ext_path[len(ext_path) - 1][:8] # extensions in debug_mode are named 'module_d.pyd' under windows so_ext = get_config_var('SO') + if os.environ.get('CROSS_COMPILING') == 'yes': + so_ext = os.environ.get('SO') if os.name == 'nt' and self.debug: return os.path.join(*ext_path) + '_d' + so_ext return os.path.join(*ext_path) + so_ext @@ -720,6 +722,8 @@ # Don't use the default code below return ext.libraries else: + if os.environ.get('CROSS_COMPILING') == 'yes': + return [] from distutils import sysconfig if sysconfig.get_config_var('Py_ENABLE_SHARED'): template = "python%d.%d" diff -Nur Python-3.0/Lib/plat-linux/regen Python-3.0.new/Lib/plat-linux/regen --- Python-3.0/Lib/plat-linux/regen 1970-01-01 02:00:00.000000000 +0200 +++ Python-3.0.new/Lib/plat-linux/regen 2008-12-05 20:59:28.000000000 +0200 @@ -0,0 +1,3 @@ +#! /bin/sh +set -v +python$EXE ../../Tools/scripts/h2py.py -i '(u_long)' /usr/include/netinet/in.h diff -Nur Python-3.0/Makefile.pre.in Python-3.0.new/Makefile.pre.in --- Python-3.0/Makefile.pre.in 2008-11-19 00:37:15.000000000 +0200 +++ Python-3.0.new/Makefile.pre.in 2008-12-05 20:59:28.000000000 +0200 @@ -27,6 +27,7 @@ VERSION= @VERSION@ srcdir= @srcdir@ VPATH= @srcdir@ +export srcdir CC= @CC@ CXX= @CXX@ @@ -72,6 +73,16 @@ # C flags used for building the interpreter object files PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE +# For cross compile: build compiler options +CC_FOR_BUILD= @CC_FOR_BUILD@ +CROSS_COMPILING= @cross_compiling@ +EXEEXT_FOR_BUILD= @EXEEXT_FOR_BUILD@ +O_FOR_BUILD= @O_FOR_BUILD@ + +CFLAGS_FOR_BUILD= @CFLAGS_FOR_BUILD@ +CPPFLAGS_FOR_BUILD= @CPPFLAGS_FOR_BUILD@ -I$(srcdir)/Include +LDFLAGS_FOR_BUILD= @LDFLAGS_FOR_BUILD@ +LIBS_FOR_BUILD= @LIBS_FOR_BUILD@ # Machine-dependent subdirectories MACHDEP= @MACHDEP@ @@ -173,7 +184,8 @@ LIBOBJS= @LIBOBJS@ PYTHON= python$(EXE) -BUILDPYTHON= python$(BUILDEXE) +BUILDPYTHON= python$(EXE) +PYTHON_FOR_BUILD= @PYTHON_FOR_BUILD@ # The task to run while instrument when building the profile-opt target PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck @@ -203,7 +215,7 @@ ########################################################################## # Parser -PGEN= Parser/pgen$(EXE) +PGEN_FOR_BUILD= Parser/pgen$(EXEEXT_FOR_BUILD) POBJS= \ Parser/acceler.o \ @@ -220,18 +232,32 @@ PARSER_OBJS= $(POBJS) Parser/myreadline.o Parser/tokenizer.o -PGOBJS= \ - Objects/obmalloc.o \ - Python/mysnprintf.o \ - Parser/tokenizer_pgen.o \ - Parser/printgrammar.o \ - Parser/pgenmain.o +POBJS_FOR_BUILD= \ + Parser/acceler.$(O_FOR_BUILD) \ + Parser/grammar1.$(O_FOR_BUILD) \ + Parser/listnode.$(O_FOR_BUILD) \ + Parser/node.$(O_FOR_BUILD) \ + Parser/parser.$(O_FOR_BUILD) \ + Parser/parsetok.$(O_FOR_BUILD) \ + Parser/bitset.$(O_FOR_BUILD) \ + Parser/metagrammar.$(O_FOR_BUILD) \ + Parser/firstsets.$(O_FOR_BUILD) \ + Parser/grammar.$(O_FOR_BUILD) \ + Parser/pgen.$(O_FOR_BUILD) + +PGOBJS_FOR_BUILD= \ + Objects/obmalloc.$(O_FOR_BUILD) \ + Python/mysnprintf.$(O_FOR_BUILD) \ + Parser/tokenizer_pgen.$(O_FOR_BUILD) \ + Parser/printgrammar.$(O_FOR_BUILD) \ + Parser/pgenmain.$(O_FOR_BUILD) PARSER_HEADERS= \ Parser/parser.h \ Parser/tokenizer.h -PGENOBJS= $(PGENMAIN) $(POBJS) $(PGOBJS) +PGENOBJS= $(POBJS_FOR_BUILD) $(PGOBJS_FOR_BUILD) + ########################################################################## # AST @@ -385,15 +411,17 @@ Modules/python.o \ $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) -platform: $(BUILDPYTHON) - $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print(get_platform()+"-"+sys.version[0:3])' >platform +platform: $(PYTHON_FOR_BUILD) + $(RUNSHARED) ./$(PYTHON_FOR_BUILD) -E -c 'import sys ; from distutils.util import get_platform ; print(get_platform()+"-"+sys.version[0:3])' >platform # Build the shared modules -sharedmods: $(BUILDPYTHON) +sharedmods: $(PYTHON_FOR_BUILD) @case $$MAKEFLAGS in \ - *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \ - *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ + *s*) $(RUNSHARED) CROSS_COMPILING=$(CROSS_COMPILING) CC='$(CC)' \ + LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(PYTHON_FOR_BUILD) -E $(srcdir)/setup.py -q build;; \ + *) $(RUNSHARED) CROSS_COMPILING=$(CROSS_COMPILING) CC='$(CC)' \ + LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(PYTHON_FOR_BUILD) -E $(srcdir)/setup.py build;; \ esac # Build static library @@ -508,13 +536,12 @@ Modules/python.o: $(srcdir)/Modules/python.c $(MAINCC) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/python.c - -$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT) +$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN_FOR_BUILD) $(GRAMMAR_INPUT) -@$(INSTALL) -d Include - -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) + -$(PGEN_FOR_BUILD) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) -$(PGEN): $(PGENOBJS) - $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN) +$(PGEN_FOR_BUILD): $(PGENOBJS) + $(CC_FOR_BUILD) $(OPT) $(LDFLAGS_FOR_BUILD) $(PGENOBJS) $(LIBS_FOR_BUILD) -o $(PGEN_FOR_BUILD) Parser/grammar.o: $(srcdir)/Parser/grammar.c \ $(srcdir)/Include/token.h \ @@ -569,6 +596,14 @@ ############################################################################ +# Cross compile rules + +# .x is a native object file during cross-compile. +.SUFFIXES: .x +.c.x: + $(CC_FOR_BUILD) -c $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) -o $@ $< + +############################################################################ # Header files PYTHON_HEADERS= \ @@ -665,7 +700,7 @@ TESTOPTS= -l $(EXTRATESTOPTS) TESTPROG= $(srcdir)/Lib/test/regrtest.py -TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -E -bb +TESTPYTHON= $(RUNSHARED) ./$(PYTHON_FOR_BUILD) -E -bb test: all platform -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) @@ -688,7 +723,7 @@ -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall - $(RUNSHARED) /usr/libexec/oah/translate ./$(BUILDPYTHON) -E $(TESTPROG) $(TESTOPTS) -uall + $(RUNSHARED) /usr/libexec/oah/translate ./$(PYTHON_FOR_BUILD) -E $(TESTPROG) $(TESTOPTS) -uall # Like testall, but with a single pass only @@ -816,7 +851,7 @@ setuptools setuptools/command setuptools/tests setuptools.egg-info \ multiprocessing multiprocessing/dummy \ curses $(MACHDEPS) -libinstall: build_all $(srcdir)/Lib/$(PLATDIR) +libinstall: $(srcdir)/Lib/$(PLATDIR) $(PYTHON_FOR_BUILD) @for i in $(SCRIPTDIR) $(LIBDEST); \ do \ if test ! -d $(DESTDIR)$$i; then \ @@ -873,23 +908,23 @@ done $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ - ./$(BUILDPYTHON) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \ + ./$(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \ -d $(LIBDEST) -f \ -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST) -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ - ./$(BUILDPYTHON) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \ + ./$(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \ -d $(LIBDEST) -f \ -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST) -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ - ./$(BUILDPYTHON) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \ + ./$(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \ -d $(LIBDEST)/site-packages -f \ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ - ./$(BUILDPYTHON) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \ + ./$(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \ -d $(LIBDEST)/site-packages -f \ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ - ./$(BUILDPYTHON) -Wi -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()" + ./$(PYTHON_FOR_BUILD) -Wi -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()" # Create the PLATDIR source directory, if one wasn't distributed.. $(srcdir)/Lib/$(PLATDIR): @@ -976,8 +1011,9 @@ # Install the dynamically loadable modules # This goes into $(exec_prefix) sharedinstall: - $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \ - --prefix=$(prefix) \ + CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' CROSS_COMPILING='$(CROSS_COMPILING)' \ + $(RUNSHARED) $(PYTHON_FOR_BUILD) -E $(srcdir)/setup.py install \ + --prefix=$(prefix) \ --install-scripts=$(BINDIR) \ --install-platlib=$(DESTSHARED) \ --root=/$(DESTDIR) @@ -1054,8 +1090,8 @@ # This installs a few of the useful scripts in Tools/scripts scriptsinstall: - SRCDIR=$(srcdir) $(RUNSHARED) \ - ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \ + $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) $(srcdir)/Tools/scripts/setup.py install \ --prefix=$(prefix) \ --install-scripts=$(BINDIR) \ --root=/$(DESTDIR) @@ -1130,11 +1166,12 @@ find . -name '*.gc??' -exec rm -f {} ';' clobber: clean profile-removal - -rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \ + -rm -f $(BUILDPYTHON) $(PGEN_FOR_BUILD) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \ tags TAGS \ config.cache config.log pyconfig.h Modules/config.c -rm -rf build platform -rm -rf $(PYTHONFRAMEWORKDIR) + -rm -rf buildpython # Make things extra clean, before making a distribution: # remove all generated files, even Makefile[.pre] diff -Nur Python-3.0/configure Python-3.0.new/configure --- Python-3.0/configure 2008-11-16 20:33:53.000000000 +0200 +++ Python-3.0.new/configure 2008-12-05 20:59:35.000000000 +0200 @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 67100 . +# From configure.in Revision: 67461 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 3.0. # @@ -653,6 +653,18 @@ build_alias host_alias target_alias +build +build_cpu +build_vendor +build_os +host +host_cpu +host_vendor +host_os +CC +ac_ct_CC +CXX +ac_ct_CXX VERSION SOVERSION CONFIG_ARGS @@ -672,14 +684,11 @@ SGI_ABI CONFIGURE_MACOSX_DEPLOYMENT_TARGET EXPORT_MACOSX_DEPLOYMENT_TARGET -CC CFLAGS LDFLAGS CPPFLAGS -ac_ct_CC EXEEXT OBJEXT -CXX MAINCC CPP GREP @@ -695,6 +704,7 @@ LINKCC RANLIB AR +ac_ct_AR SVNVERSION INSTALL_PROGRAM INSTALL_SCRIPT @@ -731,6 +741,16 @@ LIBC THREADHEADERS SRCDIRS +cross_compiling +CC_FOR_BUILD +PYTHON_FOR_BUILD +CFLAGS_FOR_BUILD +CPPFLAGS_FOR_BUILD +CROSS_COMMENT +EXEEXT_FOR_BUILD +LDFLAGS_FOR_BUILD +LIBS_FOR_BUILD +O_FOR_BUILD LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias @@ -741,7 +761,9 @@ LDFLAGS LIBS CPPFLAGS -CPP' +CPP +CC_FOR_BUILD +PYTHON_FOR_BUILD' # Initialize some variables set by options. @@ -1300,6 +1322,10 @@ _ACEOF cat <<\_ACEOF + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi @@ -1363,6 +1389,10 @@ CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor + CC_FOR_BUILD + build system C compiler (default: cc) + PYTHON_FOR_BUILD + build system python (default: python) Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -1799,6 +1829,330 @@ ac_config_headers="$ac_config_headers pyconfig.h" +# find compiler while respecting --host setting +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { (exit 1); exit 1; }; } +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} + { (exit 1); exit 1; }; } + +{ echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6; } +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +echo "$as_me: error: invalid value of canonical build" >&2;} + { (exit 1); exit 1; }; };; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6; } +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} + { (exit 1); exit 1; }; } +fi + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +echo "$as_me: error: invalid value of canonical host" >&2;} + { (exit 1); exit 1; }; };; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +if test -n "$ac_tool_prefix"; then + for ac_prog in gcc cc + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in gcc cc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + @@ -2032,8 +2386,8 @@ { echo "$as_me:$LINENO: checking MACHDEP" >&5 echo $ECHO_N "checking MACHDEP... $ECHO_C" >&6; } -if test -z "$MACHDEP" -then +if test -z "$MACHDEP"; then + if test "$cross_compiling" = "no"; then ac_sys_system=`uname -s` if test "$ac_sys_system" = "AIX" -o "$ac_sys_system" = "Monterey64" \ -o "$ac_sys_system" = "UnixWare" -o "$ac_sys_system" = "OpenUNIX"; then @@ -2041,6 +2395,23 @@ else ac_sys_release=`uname -r` fi + else + m=`$CC -dumpmachine` + #dnl + ac_sys_system=`expr "$m" : "[^-]*-\([^-]*\)"` + #dnl + + + case $ac_sys_system in + cygwin*) ac_sys_system=`echo $ac_sys_system | sed s/cygwin/CYGWIN/g `;; + darwin*) ac_sys_system=`echo $ac_sys_system | sed s/darwin/Darwin/g `;; + freebsd*) ac_sys_system=`echo $ac_sys_system | sed s/freebsd/FreeBSD/g `;; + linux*) ac_sys_system=`echo $ac_sys_system | sed s/linux/Linux/g `;; + esac + + + fi + ac_md_system=`echo $ac_sys_system | tr -d '/ ' | tr '[A-Z]' '[a-z]'` ac_md_release=`echo $ac_sys_release | @@ -3215,26 +3586,25 @@ if test -z "$CXX" then case "$CC" in - gcc) # Extract the first word of "g++", so it can be a program name with args. -set dummy g++; ac_word=$2 + gcc) if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}g++", so it can be a program name with args. +set dummy ${ac_tool_prefix}g++; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_CXX+set}" = set; then +if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - case $CXX in - [\\/]* | ?:[\\/]*) - ac_cv_path_CXX="$CXX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in notfound + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_CXX="$as_dir/$ac_word$ac_exec_ext" + ac_cv_prog_CXX="${ac_tool_prefix}g++" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -3242,11 +3612,9 @@ done IFS=$as_save_IFS - test -z "$ac_cv_path_CXX" && ac_cv_path_CXX="g++" - ;; -esac fi -CXX=$ac_cv_path_CXX +fi +CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6; } @@ -3255,27 +3623,28 @@ echo "${ECHO_T}no" >&6; } fi - ;; - cc) # Extract the first word of "c++", so it can be a program name with args. -set dummy c++; ac_word=$2 + +fi +if test -z "$ac_cv_prog_CXX"; then + ac_ct_CXX=$CXX + # Extract the first word of "g++", so it can be a program name with args. +set dummy g++; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_CXX+set}" = set; then +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - case $CXX in - [\\/]* | ?:[\\/]*) - ac_cv_path_CXX="$CXX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in notfound + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_CXX="$as_dir/$ac_word$ac_exec_ext" + ac_cv_prog_ac_ct_CXX="g++" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -3283,11 +3652,65 @@ done IFS=$as_save_IFS - test -z "$ac_cv_path_CXX" && ac_cv_path_CXX="c++" - ;; +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_CXX" = x; then + CXX="notfound" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; esac + CXX=$ac_ct_CXX + fi +else + CXX="$ac_cv_prog_CXX" fi -CXX=$ac_cv_path_CXX + ;; + cc) if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}c++", so it can be a program name with args. +set dummy ${ac_tool_prefix}c++; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CXX="${ac_tool_prefix}c++" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6; } @@ -3296,6 +3719,64 @@ echo "${ECHO_T}no" >&6; } fi + +fi +if test -z "$ac_cv_prog_CXX"; then + ac_ct_CXX=$CXX + # Extract the first word of "c++", so it can be a program name with args. +set dummy c++; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CXX="c++" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_CXX" = x; then + CXX="notfound" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +else + CXX="$ac_cv_prog_CXX" +fi ;; esac if test "$CXX" = "notfound" @@ -3305,10 +3786,11 @@ fi if test -z "$CXX" then - for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 + if test -n "$ac_tool_prefix"; then + for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CXX+set}" = set; then @@ -3324,7 +3806,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CXX="$ac_prog" + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -3344,9 +3826,69 @@ fi - test -n "$CXX" && break + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break done -test -n "$CXX" || CXX="notfound" + + if test "x$ac_ct_CXX" = x; then + CXX="notfound" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi if test "$CXX" = "notfound" then @@ -3832,10 +4374,12 @@ { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } BUILDEXEEXT=.exe + case_sensitive=no else - { echo "$as_me:$LINENO: result: no" >&5 + { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } - BUILDEXEEXT=$EXEEXT + BUILDEXEEXT=$EXEEXT + case_sensitive=yes fi rmdir CaseSensitiveTestDir @@ -4098,6 +4642,7 @@ { echo "$as_me:$LINENO: result: $LDLIBRARY" >&5 echo "${ECHO_T}$LDLIBRARY" >&6; } +# find tools while respecting --host setting if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 @@ -4176,7 +4721,7 @@ fi if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" + RANLIB="" else case $cross_compiling:$ac_tool_warned in yes:) @@ -4191,21 +4736,65 @@ RANLIB=$ac_ct_RANLIB fi else - RANLIB="$ac_cv_prog_RANLIB" + RANLIB="$ac_cv_prog_RANLIB" +fi + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar aal + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -for ac_prog in ar aal + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar aal do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_AR+set}" = set; then +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -4214,7 +4803,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AR="$ac_prog" + ac_cv_prog_ac_ct_AR="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -4224,19 +4813,35 @@ fi fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6; } +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi - test -n "$AR" && break + test -n "$ac_ct_AR" && break done -test -n "$AR" || AR="ar" + + if test "x$ac_ct_AR" = x; then + AR="ar" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi @@ -4293,37 +4898,6 @@ INSTALL="${srcdir}/install-sh -c" fi esac -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} - { (exit 1); exit 1; }; } -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: @@ -4520,7 +5094,7 @@ ac_save_cc="$CC" CC="$CC -fno-strict-aliasing" if test "$cross_compiling" = yes; then - ac_cv_no_strict_aliasing_ok=no + ac_cv_no_strict_aliasing_ok=yes else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -16742,14 +17316,7 @@ # exit Python { echo "$as_me:$LINENO: checking for chflags" >&5 echo $ECHO_N "checking for chflags... $ECHO_C" >&6; } -if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else - cat >conftest.$ac_ext <<_ACEOF +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -16765,27 +17332,31 @@ return 0; } +int +main () +{ +void* p = chflags + ; + return 0; +} _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then cat >>confdefs.h <<\_ACEOF #define HAVE_CHFLAGS 1 @@ -16794,30 +17365,19 @@ { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -{ echo "$as_me:$LINENO: result: no" >&5 + { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: checking for lchflags" >&5 echo $ECHO_N "checking for lchflags... $ECHO_C" >&6; } -if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else - cat >conftest.$ac_ext <<_ACEOF +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -16833,27 +17393,31 @@ return 0; } +int +main () +{ +void* p = lchflags + ; + return 0; +} _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then cat >>confdefs.h <<\_ACEOF #define HAVE_LCHFLAGS 1 @@ -16862,19 +17426,15 @@ { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -{ echo "$as_me:$LINENO: result: no" >&5 + { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext case $ac_sys_system/$ac_sys_release in Darwin/*) @@ -24057,41 +24617,62 @@ { echo "$as_me:$LINENO: checking for /dev/ptmx" >&5 echo $ECHO_N "checking for /dev/ptmx... $ECHO_C" >&6; } - -if test -r /dev/ptmx -then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } +if test "${ac_cv_file__dev_ptmx+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + test "$cross_compiling" = yes && + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } +if test -r "/dev/ptmx"; then + ac_cv_file__dev_ptmx=yes +else + ac_cv_file__dev_ptmx=no +fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_file__dev_ptmx" >&5 +echo "${ECHO_T}$ac_cv_file__dev_ptmx" >&6; } +if test $ac_cv_file__dev_ptmx = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DEV_PTMX 1 _ACEOF -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } fi + { echo "$as_me:$LINENO: checking for /dev/ptc" >&5 echo $ECHO_N "checking for /dev/ptc... $ECHO_C" >&6; } - -if test -r /dev/ptc -then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } +if test "${ac_cv_file__dev_ptc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + test "$cross_compiling" = yes && + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } +if test -r "/dev/ptc"; then + ac_cv_file__dev_ptc=yes +else + ac_cv_file__dev_ptc=no +fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_file__dev_ptc" >&5 +echo "${ECHO_T}$ac_cv_file__dev_ptc" >&6; } +if test $ac_cv_file__dev_ptc = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DEV_PTC 1 _ACEOF -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } fi + { echo "$as_me:$LINENO: checking for %zd printf() format support" >&5 echo $ECHO_N "checking for %zd printf() format support... $ECHO_C" >&6; } -if test "$cross_compiling" = yes; then +if test "${ac_cv_printf_zd_format+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling @@ -24122,12 +24703,12 @@ int main() { - char buffer[256]; + char buffer256; if(sprintf(buffer, "%zd", (size_t)123) < 0) return 1; - if (strcmp(buffer, "123")) + if (strcmp(buffe,me) "123")) return 1; if (sprintf(buffer, "%zd", (Py_ssize_t)-123) < 0) @@ -24179,6 +24760,8 @@ fi +fi + { echo "$as_me:$LINENO: checking for socklen_t" >&5 echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6; } @@ -24336,6 +24919,67 @@ { echo "$as_me:$LINENO: result: done" >&5 echo "${ECHO_T}done" >&6; } +# Cross compiling + + +if test "$cross_compiling" = "yes"; then + { echo "$as_me:$LINENO: checking cc for build" >&5 +echo $ECHO_N "checking cc for build... $ECHO_C" >&6; } + CC_FOR_BUILD="${CC_FOR_BUILD-cc}" +else + CC_FOR_BUILD="${CC_FOR_BUILD-$CC}" +fi + +if test "$cross_compiling" = "yes"; then + { echo "$as_me:$LINENO: result: $CC_FOR_BUILD" >&5 +echo "${ECHO_T}$CC_FOR_BUILD" >&6; } +fi + + + +if test "$cross_compiling" = "yes"; then + { echo "$as_me:$LINENO: checking python for build" >&5 +echo $ECHO_N "checking python for build... $ECHO_C" >&6; } + PYTHON_FOR_BUILD="${PYTHON_FOR_BUILD-python}" + PYTHON_FOR_BUILD=`which $PYTHON_FOR_BUILD` +else + PYTHON_FOR_BUILD='./$(BUILDPYTHON)' +fi + +if test "$cross_compiling" = "yes"; then + { echo "$as_me:$LINENO: result: $PYTHON_FOR_BUILD" >&5 +echo "${ECHO_T}$PYTHON_FOR_BUILD" >&6; } +fi + + + +if test "$cross_compiling" = "yes"; then + CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-} + CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD- -I.} + CROSS_COMMENT=# + if test "$case_sensitive" = "yes" + then + EXEEXT_FOR_BUILD= + else + EXEEXT_FOR_BUILD=.exe + fi + LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-} + LIBS_FOR_BUILD=${LIBS_FOR_BUILD-} + O_FOR_BUILD=x + RUNSHARED="MACHDEP=$ac_sys_system SRCDIR=$srcdir SO=${SO}" +else + CROSS_COMMENT= + EXEEXT_FOR_BUILD=$BUILDEXEEXT + O_FOR_BUILD=o +fi + + + + + + + + # generate output files ac_config_files="$ac_config_files Makefile.pre Modules/Setup.config" @@ -24997,6 +25641,18 @@ build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim +build!$build$ac_delim +build_cpu!$build_cpu$ac_delim +build_vendor!$build_vendor$ac_delim +build_os!$build_os$ac_delim +host!$host$ac_delim +host_cpu!$host_cpu$ac_delim +host_vendor!$host_vendor$ac_delim +host_os!$host_os$ac_delim +CC!$CC$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +CXX!$CXX$ac_delim +ac_ct_CXX!$ac_ct_CXX$ac_delim VERSION!$VERSION$ac_delim SOVERSION!$SOVERSION$ac_delim CONFIG_ARGS!$CONFIG_ARGS$ac_delim @@ -25016,14 +25672,11 @@ SGI_ABI!$SGI_ABI$ac_delim CONFIGURE_MACOSX_DEPLOYMENT_TARGET!$CONFIGURE_MACOSX_DEPLOYMENT_TARGET$ac_delim EXPORT_MACOSX_DEPLOYMENT_TARGET!$EXPORT_MACOSX_DEPLOYMENT_TARGET$ac_delim -CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim -ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim -CXX!$CXX$ac_delim MAINCC!$MAINCC$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim @@ -25039,6 +25692,7 @@ LINKCC!$LINKCC$ac_delim RANLIB!$RANLIB$ac_delim AR!$AR$ac_delim +ac_ct_AR!$ac_ct_AR$ac_delim SVNVERSION!$SVNVERSION$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim @@ -25047,16 +25701,6 @@ OPT!$OPT$ac_delim BASECFLAGS!$BASECFLAGS$ac_delim UNIVERSAL_ARCH_FLAGS!$UNIVERSAL_ARCH_FLAGS$ac_delim -OTHER_LIBTOOL_OPT!$OTHER_LIBTOOL_OPT$ac_delim -LIBTOOL_CRUFT!$LIBTOOL_CRUFT$ac_delim -SO!$SO$ac_delim -LDSHARED!$LDSHARED$ac_delim -BLDSHARED!$BLDSHARED$ac_delim -CCSHARED!$CCSHARED$ac_delim -LINKFORSHARED!$LINKFORSHARED$ac_delim -CFLAGSFORSHARED!$CFLAGSFORSHARED$ac_delim -SHLIBS!$SHLIBS$ac_delim -USE_SIGNAL_MODULE!$USE_SIGNAL_MODULE$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -25098,6 +25742,16 @@ ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF +OTHER_LIBTOOL_OPT!$OTHER_LIBTOOL_OPT$ac_delim +LIBTOOL_CRUFT!$LIBTOOL_CRUFT$ac_delim +SO!$SO$ac_delim +LDSHARED!$LDSHARED$ac_delim +BLDSHARED!$BLDSHARED$ac_delim +CCSHARED!$CCSHARED$ac_delim +LINKFORSHARED!$LINKFORSHARED$ac_delim +CFLAGSFORSHARED!$CFLAGSFORSHARED$ac_delim +SHLIBS!$SHLIBS$ac_delim +USE_SIGNAL_MODULE!$USE_SIGNAL_MODULE$ac_delim SIGNAL_OBJS!$SIGNAL_OBJS$ac_delim USE_THREAD_MODULE!$USE_THREAD_MODULE$ac_delim LDLAST!$LDLAST$ac_delim @@ -25116,10 +25770,20 @@ LIBC!$LIBC$ac_delim THREADHEADERS!$THREADHEADERS$ac_delim SRCDIRS!$SRCDIRS$ac_delim +cross_compiling!$cross_compiling$ac_delim +CC_FOR_BUILD!$CC_FOR_BUILD$ac_delim +PYTHON_FOR_BUILD!$PYTHON_FOR_BUILD$ac_delim +CFLAGS_FOR_BUILD!$CFLAGS_FOR_BUILD$ac_delim +CPPFLAGS_FOR_BUILD!$CPPFLAGS_FOR_BUILD$ac_delim +CROSS_COMMENT!$CROSS_COMMENT$ac_delim +EXEEXT_FOR_BUILD!$EXEEXT_FOR_BUILD$ac_delim +LDFLAGS_FOR_BUILD!$LDFLAGS_FOR_BUILD$ac_delim +LIBS_FOR_BUILD!$LIBS_FOR_BUILD$ac_delim +O_FOR_BUILD!$O_FOR_BUILD$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 19; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 39; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff -Nur Python-3.0/configure.in Python-3.0.new/configure.in --- Python-3.0/configure.in 2008-12-01 00:46:23.000000000 +0200 +++ Python-3.0.new/configure.in 2008-12-05 20:59:28.000000000 +0200 @@ -12,6 +12,11 @@ AC_CONFIG_SRCDIR([Include/object.h]) AC_CONFIG_HEADER(pyconfig.h) +# find compiler while respecting --host setting +AC_CANONICAL_HOST() +AC_CHECK_TOOLS(CC,gcc cc) +AC_CHECK_TOOLS(CXX,g++ c++) + dnl This is for stuff that absolutely must end up in pyconfig.h. dnl Please use pyport.h instead, if possible. AH_TOP([ @@ -212,8 +217,8 @@ # Set name for machine-dependent library files AC_SUBST(MACHDEP) AC_MSG_CHECKING(MACHDEP) -if test -z "$MACHDEP" -then +if test -z "$MACHDEP"; then + if test "$cross_compiling" = "no"; then ac_sys_system=`uname -s` if test "$ac_sys_system" = "AIX" -o "$ac_sys_system" = "Monterey64" \ -o "$ac_sys_system" = "UnixWare" -o "$ac_sys_system" = "OpenUNIX"; then @@ -221,6 +226,23 @@ else ac_sys_release=`uname -r` fi + else + m=`$CC -dumpmachine` + changequote(<<, >>)#dnl + ac_sys_system=`expr "$m" : "[^-]*-\([^-]*\)"` + changequote([, ])#dnl + + + case $ac_sys_system in + cygwin*) ac_sys_system=`echo $ac_sys_system | sed s/cygwin/CYGWIN/g `;; + darwin*) ac_sys_system=`echo $ac_sys_system | sed s/darwin/Darwin/g `;; + freebsd*) ac_sys_system=`echo $ac_sys_system | sed s/freebsd/FreeBSD/g `;; + linux*) ac_sys_system=`echo $ac_sys_system | sed s/linux/Linux/g `;; + esac + + + fi + ac_md_system=`echo $ac_sys_system | tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'` ac_md_release=`echo $ac_sys_release | @@ -442,8 +464,8 @@ if test -z "$CXX" then case "$CC" in - gcc) AC_PATH_PROG(CXX, [g++], [g++], [notfound]) ;; - cc) AC_PATH_PROG(CXX, [c++], [c++], [notfound]) ;; + gcc) AC_CHECK_TOOL(CXX, [g++], [notfound]) ;; + cc) AC_CHECK_TOOL(CXX, [c++], [notfound]) ;; esac if test "$CXX" = "notfound" then @@ -452,7 +474,7 @@ fi if test -z "$CXX" then - AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++ cl, notfound) + AC_CHECK_TOOLS(CXX, $CCC c++ g++ gcc CC cxx cc++ cl, notfound) if test "$CXX" = "notfound" then CXX="" @@ -503,9 +525,11 @@ then AC_MSG_RESULT(yes) BUILDEXEEXT=.exe + case_sensitive=no else - AC_MSG_RESULT(no) - BUILDEXEEXT=$EXEEXT + AC_MSG_RESULT(no) + BUILDEXEEXT=$EXEEXT + case_sensitive=yes fi rmdir CaseSensitiveTestDir @@ -705,9 +729,9 @@ AC_MSG_RESULT($LDLIBRARY) -AC_PROG_RANLIB -AC_SUBST(AR) -AC_CHECK_PROGS(AR, ar aal, ar) +# find tools while respecting --host setting +AC_CHECK_TOOL(RANLIB,ranlib) +AC_CHECK_TOOLS(AR,ar aal,ar) AC_SUBST(SVNVERSION) AC_CHECK_PROG(SVNVERSION, svnversion, found, not-found) @@ -833,7 +857,7 @@ AC_TRY_RUN([int main() { return 0; }], ac_cv_no_strict_aliasing_ok=yes, ac_cv_no_strict_aliasing_ok=no, - ac_cv_no_strict_aliasing_ok=no) + ac_cv_no_strict_aliasing_ok=yes) CC="$ac_save_cc" AC_MSG_RESULT($ac_cv_no_strict_aliasing_ok) if test $ac_cv_no_strict_aliasing_ok = yes @@ -2473,7 +2497,7 @@ # On Tru64, chflags seems to be present, but calling it will # exit Python AC_MSG_CHECKING(for chflags) -AC_TRY_RUN([ +AC_TRY_COMPILE([ #include #include int main(int argc, char*argv[]) @@ -2482,13 +2506,14 @@ return 1; return 0; } -],AC_DEFINE(HAVE_CHFLAGS, 1, Define to 1 if you have the `chflags' function.) +], void* p = chflags, + AC_DEFINE(HAVE_CHFLAGS, 1, Define to 1 if you have the `chflags' function.) AC_MSG_RESULT(yes), AC_MSG_RESULT(no) ) AC_MSG_CHECKING(for lchflags) -AC_TRY_RUN([ +AC_TRY_COMPILE([ #include #include int main(int argc, char*argv[]) @@ -2497,7 +2522,8 @@ return 1; return 0; } -],AC_DEFINE(HAVE_LCHFLAGS, 1, Define to 1 if you have the `lchflags' function.) +], void* p = lchflags, + AC_DEFINE(HAVE_LCHFLAGS, 1, Define to 1 if you have the `lchflags' function.) AC_MSG_RESULT(yes), AC_MSG_RESULT(no) ) @@ -3523,30 +3549,19 @@ AC_MSG_RESULT(no) ) -AC_MSG_CHECKING(for /dev/ptmx) - -if test -r /dev/ptmx -then - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_DEV_PTMX, 1, - [Define if we have /dev/ptmx.]) -else - AC_MSG_RESULT(no) -fi - -AC_MSG_CHECKING(for /dev/ptc) - -if test -r /dev/ptc -then - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_DEV_PTC, 1, - [Define if we have /dev/ptc.]) -else - AC_MSG_RESULT(no) -fi +AC_CHECK_FILE(/dev/ptmx, + [AC_DEFINE(HAVE_DEV_PTMX, 1, + [Define if we have /dev/ptmx.])], + []) + +AC_CHECK_FILE(/dev/ptc, + [AC_DEFINE(HAVE_DEV_PTC, 1, + [Define if we have /dev/ptc.])], + []) AC_MSG_CHECKING(for %zd printf() format support) -AC_TRY_RUN([#include +AC_CACHE_VAL(ac_cv_printf_zd_format, + AC_TRY_RUN([#include #include #include @@ -3569,7 +3584,7 @@ if(sprintf(buffer, "%zd", (size_t)123) < 0) return 1; - if (strcmp(buffer, "123")) + if (strcmp(buffe,me) "123")) return 1; if (sprintf(buffer, "%zd", (Py_ssize_t)-123) < 0) @@ -3582,7 +3597,7 @@ }], [AC_MSG_RESULT(yes) AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])], - AC_MSG_RESULT(no)) + AC_MSG_RESULT(no))) AC_CHECK_TYPE(socklen_t,, AC_DEFINE(socklen_t,int, @@ -3633,6 +3648,63 @@ done AC_MSG_RESULT(done) +# Cross compiling +AC_SUBST(cross_compiling) + +if test "$cross_compiling" = "yes"; then + AC_MSG_CHECKING(cc for build) + CC_FOR_BUILD="${CC_FOR_BUILD-cc}" +else + CC_FOR_BUILD="${CC_FOR_BUILD-$CC}" +fi + +if test "$cross_compiling" = "yes"; then + AC_MSG_RESULT($CC_FOR_BUILD) +fi + +AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler (default: cc)]) + +if test "$cross_compiling" = "yes"; then + AC_MSG_CHECKING(python for build) + PYTHON_FOR_BUILD="${PYTHON_FOR_BUILD-python}" + PYTHON_FOR_BUILD=`which $PYTHON_FOR_BUILD` +else + PYTHON_FOR_BUILD='./$(BUILDPYTHON)' +fi + +if test "$cross_compiling" = "yes"; then + AC_MSG_RESULT($PYTHON_FOR_BUILD) +fi +AC_ARG_VAR(PYTHON_FOR_BUILD,[build system python (default: python)]) +AC_SUBST(PYTHON_FOR_BUILD) + +if test "$cross_compiling" = "yes"; then + CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-} + CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD- -I.} + CROSS_COMMENT=# + if test "$case_sensitive" = "yes" + then + EXEEXT_FOR_BUILD= + else + EXEEXT_FOR_BUILD=.exe + fi + LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-} + LIBS_FOR_BUILD=${LIBS_FOR_BUILD-} + O_FOR_BUILD=x + RUNSHARED="MACHDEP=$ac_sys_system SRCDIR=$srcdir SO=${SO}" +else + CROSS_COMMENT= + EXEEXT_FOR_BUILD=$BUILDEXEEXT + O_FOR_BUILD=o +fi +AC_SUBST(CFLAGS_FOR_BUILD) +AC_SUBST(CPPFLAGS_FOR_BUILD) +AC_SUBST(CROSS_COMMENT) +AC_SUBST(EXEEXT_FOR_BUILD) +AC_SUBST(LDFLAGS_FOR_BUILD) +AC_SUBST(LIBS_FOR_BUILD) +AC_SUBST(O_FOR_BUILD) + # generate output files AC_CONFIG_FILES(Makefile.pre Modules/Setup.config) AC_OUTPUT diff -Nur Python-3.0/setup.py Python-3.0.new/setup.py --- Python-3.0/setup.py 2008-11-04 22:45:29.000000000 +0200 +++ Python-3.0.new/setup.py 2008-12-05 20:59:28.000000000 +0200 @@ -16,8 +16,17 @@ from distutils.command.install_lib import install_lib # This global variable is used to hold the list of modules to be disabled. -disabled_module_list = [] +disabled_module_list = os.environ.get('DISABLED_MODULE_LIST', []).split() +import os + +if os.environ.get('CROSS_COMPILING') == 'yes': + sysconfig.get_config_vars() + sysconfig._config_vars.update (os.environ) +else: + sysconfig.get_config_vars() + sysconfig._config_vars['srcdir'] = os.environ['srcdir'] + def add_dir_to_list(dirlist, dir): """Add the directory 'dir' to the list 'dirlist' (at the front) if 1) 'dir' is not already in 'dirlist' @@ -260,6 +269,10 @@ self.announce('WARNING: skipping import check for Cygwin-based "%s"' % ext.name) return + if os.environ.get('CROSS_COMPILING') == 'yes': + self.announce('WARNING: skipping import check for cross compiled "%s"' + % ext.name) + return ext_filename = os.path.join( self.build_lib, self.get_ext_filename(self.get_ext_fullname(ext.name))) @@ -301,16 +314,21 @@ self.failed.append(ext.name) def get_platform(self): - # Get value of sys.platform - for platform in ['cygwin', 'darwin', 'atheos', 'osf1']: - if sys.platform.startswith(platform): + # Get value of target's sys.platform + p = sys.platform + if os.environ.get('CROSS_COMPILING') == 'yes': + p = os.environ.get('MACHDEP').lower() + + for platform in ['cygwin', 'mingw', 'beos', 'darwin', 'atheos', 'osf1']: + if p.startswith(platform): return platform - return sys.platform + return p def detect_modules(self): # Ensure that /usr/local is always used - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') + if os.environ.get('CROSS_COMPILING') != 'yes': + add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') + add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') # Add paths specified in the environment variables LDFLAGS and # CPPFLAGS for header and library files. @@ -355,11 +373,15 @@ # lib_dirs and inc_dirs are used to search for files; # if a file is found in one of those directories, it can # be assumed that no additional -I,-L directives are needed. - lib_dirs = self.compiler.library_dirs + [ - '/lib64', '/usr/lib64', - '/lib', '/usr/lib', - ] - inc_dirs = self.compiler.include_dirs + ['/usr/include'] + lib_dirs = [] + inc_dirs = [] + if os.environ.get('CROSS_COMPILING') != 'yes': + lib_dirs = self.compiler.library_dirs + [ + '/lib64', '/usr/lib64', + '/lib', '/usr/lib', + ] + inc_dirs = self.compiler.include_dirs + ['/usr/include'] + exts = [] missing = [] @@ -694,6 +716,9 @@ MIN_SQLITE_VERSION = ".".join([str(x) for x in MIN_SQLITE_VERSION_NUMBER]) + if os.environ.get('CROSS_COMPILING') == 'yes': + sqlite_inc_paths = [] + # Scan the default include directories before the SQLite specific # ones. This allows one to override the copy of sqlite on OSX, # where /usr/include contains an old version of sqlite.