--- ./Makefile.pre.in.CROSS 2009-01-03 23:44:25.000000000 +0200
+++ ./Makefile.pre.in 2009-01-03 23:44:38.000000000 +0200
@@ -471,12 +471,7 @@
Modules/Setup.config \
Modules/Setup \
Modules/Setup.local
- $(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \
- -s Modules \
- Modules/Setup.config \
- Modules/Setup.local \
- Modules/Setup
- @mv config.c Modules
+ $(SHELL) ./config.status Makefile
@echo "The Makefile was updated, you may need to re-run make."
@@ -1083,7 +1078,7 @@
# Build the toplevel Makefile
Makefile.pre: Makefile.pre.in config.status
- CONFIG_FILES=Makefile.pre CONFIG_HEADERS= $(SHELL) config.status
+ $(SHELL) ./config.status $@
$(MAKE) -f Makefile.pre Makefile
# Run the configure script.
--- ./configure.in.CROSS 2009-01-05 00:09:49.000000000 +0200
+++ ./configure.in 2009-01-05 00:21:44.000000000 +0200
@@ -11,6 +11,7 @@
AC_INIT(python, PYTHON_VERSION, http://www.python.org/python-bugs)
AC_CONFIG_SRCDIR([Include/object.h])
AC_CONFIG_HEADER(pyconfig.h)
+AC_CANONICAL_HOST
dnl This is for stuff that absolutely must end up in pyconfig.h.
dnl Please use pyport.h instead, if possible.
@@ -33,6 +34,30 @@
rm confdefs.h
mv confdefs.h.new confdefs.h
+dnl makefile conditional (for future use)
+if test "x$cross_compiling" = xyes; then
+ CROSS_ON=''
+ CROSS_OFF='#'
+else
+ CROSS_ON='#'
+ CROSS_OFF=''
+fi
+AC_SUBST(CROSS_ON)
+AC_SUBST(CROSS_OFF)
+
+if test "x$cross_compiling" = xyes; then
+ AC_MSG_WARN([cross-compilation is incomplete])
+
+ dnl In cross-compilation environment we need python from
+ dnl the build system (for future use)
+ AC_PATH_PROG(SYSPYTHON, python, [none],
+ [$PATH:/usr/local/bin]
+ )
+ if test "x$PYTHON" = xnone; then
+ AC_MSG_ERROR([python program is required in cross-compilation environment])
+ fi
+fi
+
AC_SUBST(VERSION)
VERSION=PYTHON_VERSION
@@ -211,8 +236,39 @@
## Use (OpenStep|Rhapsody) dynamic linker))
##
# Set name for machine-dependent library files
+dnl Now configure script support cross-compilation and detection of host
+dnl system based on value of $ac_sys_system and/or $ac_sys_release
+dnl has to be avoided. It is superseded by "host triplet"(cpu-verdor-os).
+dnl FIXME: replace all cases based on $ac_sys_system and/or $ac_sys_release
+dnl with case based on $host ("host triplet") or $host_os.
+dnl Also cases with MACHDEP may be replaces by $host or $host_os. Note
+dnl script may not set this variable if cross compiling.
+
+dnl Next two variables are intended to be passed through makefile to other
+dnl scripts. As example setup.py check for CPU(machine) and OS(platform).
+HOST_CPU=$host_cpu
+AC_SUBST(HOST_CPU)
+HOST_OS=$host_os
+AC_SUBST(HOST_OS)
+
AC_SUBST(MACHDEP)
+if test "x$cross_compiling" = xyes; then
+AC_MSG_WARN([
+ May be value of MACHDEP isn't correct if cross-compiling.
+ You may tweak configure script for you host system: $host])
+fi
AC_MSG_CHECKING(MACHDEP)
+dnl Note that $host_os cann't be translated directly into python
+dnl specific $MACHDEP. As example on linux (kernel 2.x) the script below
+dnl will set MACHDEP to "linux2" but $host_os is only "linux".
+dnl Another point is in cross-compilation environment we cannot distinguish
+dnl linux with 1.x(if someone still use it) and 2.x host kernels.
+dnl As example setup.py check for linux2(get from sys.platform) and will
+dnl install some host plaform specific files into subdirectory "plat-linux2".
+dnl In addition $host_os may contain specific settings for some host systems
+dnl as example mingwNN{YYYY} but the host winNN. So we may set MACHDEP
+dnl to winNN in this case, i.e. different host systems from gnu autotools
+dnl point of view but same for python.
if test -z "$MACHDEP"
then
ac_sys_system=`uname -s`
@@ -229,14 +285,18 @@
MACHDEP="$ac_md_system$ac_md_release"
case $MACHDEP in
- cygwin*) MACHDEP="cygwin";;
- darwin*) MACHDEP="darwin";;
- atheos*) MACHDEP="atheos";;
irix646) MACHDEP="irix6";;
'') MACHDEP="unknown";;
esac
+
+ dnl override MACHDEP only on certain host systems
+ case $host in
+ *-*-cygwin*) MACHDEP="cygwin";;
+ *-*-darwin*) MACHDEP="darwin";;
+ *-*-atheos*) MACHDEP="atheos";;
+ esac
fi
-
+
# Some systems cannot stand _XOPEN_SOURCE being defined at all; they
# disable features if it is defined, without any means to access these
# features as extensions. For these systems, we skip the definition of
@@ -388,10 +448,6 @@
CONFIGURE_MACOSX_DEPLOYMENT_TARGET=
EXPORT_MACOSX_DEPLOYMENT_TARGET='#'
-AC_MSG_CHECKING(machine type as reported by uname -m)
-ac_sys_machine=`uname -m`
-AC_MSG_RESULT($ac_sys_machine)
-
# checks for alternative programs
# compiler flags are generated in two sets, BASECFLAGS and OPT. OPT is just
@@ -513,6 +569,13 @@
AC_AIX
# Check for unsupported systems
+case $host in
+ *-*-beos*)
+ AC_MSG_WARN([
+ Support for BeOS is deprecated as of Python 2.6.
+ See PEP 11 for the gory details.
+ ]);;
+esac
case $ac_sys_system/$ac_sys_release in
atheos*|Linux*/1*)
echo This system \($ac_sys_system/$ac_sys_release\) is no longer supported.
@@ -653,22 +716,23 @@
AC_MSG_CHECKING(for --enable-profiling)
AC_ARG_ENABLE(profiling,
- AC_HELP_STRING(--enable-profiling, enable C-level code profiling),
-[ac_save_cc="$CC"
- CC="$CC -pg"
- AC_TRY_RUN([int main() { return 0; }],
- ac_enable_profiling="yes",
- ac_enable_profiling="no",
- ac_enable_profiling="no")
- CC="$ac_save_cc"])
-AC_MSG_RESULT($ac_enable_profiling)
-
-case "$ac_enable_profiling" in
- "yes")
- BASECFLAGS="-pg $BASECFLAGS"
- LDFLAGS="-pg $LDFLAGS"
- ;;
-esac
+ AC_HELP_STRING([--enable-profiling], [enable C-level code profiling]))
+if test "x$enable_profiling" = xyes; then
+ py_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -pg"
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])],
+ [],
+ [enable_profiling=no])
+ CFLAGS="$py_save_CFLAGS"
+else
+ enable_profiling=no
+fi
+AC_MSG_RESULT($enable_profiling)
+
+if test "x$enable_profiling" = xyes; then
+ BASECFLAGS="-pg $BASECFLAGS"
+ LDFLAGS="-pg $LDFLAGS"
+fi
AC_MSG_CHECKING(LDLIBRARY)
@@ -756,8 +820,7 @@
AC_MSG_RESULT($LDLIBRARY)
AC_PROG_RANLIB
-AC_SUBST(AR)
-AC_CHECK_PROGS(AR, ar aal, ar)
+AC_CHECK_TOOLS(AR, ar aal, ar)
AC_SUBST(SVNVERSION)
AC_CHECK_PROG(SVNVERSION, svnversion, found, not-found)
@@ -881,9 +944,8 @@
AC_MSG_CHECKING(whether $CC accepts -fno-strict-aliasing)
ac_save_cc="$CC"
CC="$CC -fno-strict-aliasing"
- AC_TRY_RUN([int main() { return 0; }],
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])],
ac_cv_no_strict_aliasing_ok=yes,
- ac_cv_no_strict_aliasing_ok=no,
ac_cv_no_strict_aliasing_ok=no)
CC="$ac_save_cc"
AC_MSG_RESULT($ac_cv_no_strict_aliasing_ok)
@@ -895,7 +957,7 @@
# if using gcc on alpha, use -mieee to get (near) full IEEE 754
# support. Without this, treatment of subnormals doesn't follow
# the standard.
- case $ac_sys_machine in
+ case $host in
alpha*)
BASECFLAGS="$BASECFLAGS -mieee"
;;
@@ -1002,9 +1064,8 @@
AC_CACHE_VAL(ac_cv_opt_olimit_ok,
[ac_save_cc="$CC"
CC="$CC -OPT:Olimit=0"
-AC_TRY_RUN([int main() { return 0; }],
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])],
ac_cv_opt_olimit_ok=yes,
- ac_cv_opt_olimit_ok=no,
ac_cv_opt_olimit_ok=no)
CC="$ac_save_cc"])
AC_MSG_RESULT($ac_cv_opt_olimit_ok)
@@ -1024,9 +1085,8 @@
AC_CACHE_VAL(ac_cv_olimit_ok,
[ac_save_cc="$CC"
CC="$CC -Olimit 1500"
- AC_TRY_RUN([int main() { return 0; }],
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])],
ac_cv_olimit_ok=yes,
- ac_cv_olimit_ok=no,
ac_cv_olimit_ok=no)
CC="$ac_save_cc"])
AC_MSG_RESULT($ac_cv_olimit_ok)
@@ -1859,9 +1919,18 @@
fi
# check if we need libintl for locale functions
+case $host in
+ *-*-mingw*)
+ dnl Native windows build don't use libintl (see _localemodule.c).
+ dnl Also we don't like setup.py to add "intl" library to the list
+ dnl when build _locale module.
+ ;;
+ *)
AC_CHECK_LIB(intl, textdomain,
AC_DEFINE(WITH_LIBINTL, 1,
[Define to 1 if libintl is needed for locale functions.]))
+ ;;
+esac
# checks for system dependent C++ extensions support
case "$ac_sys_system" in
@@ -2449,7 +2518,11 @@
else
MACHDEP_OBJS="$MACHDEP_OBJS $extra_machdep_objs"
fi
-AC_MSG_RESULT(MACHDEP_OBJS)
+if test -z "$MACHDEP_OBJS"; then
+ AC_MSG_RESULT([none])
+else
+ AC_MSG_RESULT([$MACHDEP_OBJS])
+fi
# checks for library functions
AC_CHECK_FUNCS(alarm setitimer getitimer bind_textdomain_codeset chown \
@@ -2563,10 +2636,13 @@
AC_CHECK_LIB(resolv, inet_aton)
)
+AC_CHECK_FUNCS(chflags,
+[
# On Tru64, chflags seems to be present, but calling it will
# exit Python
-AC_MSG_CHECKING(for chflags)
-AC_TRY_RUN([
+AC_MSG_CHECKING(for working chflags)
+AC_RUN_IFELSE(
+[AC_LANG_SOURCE([[
#include