Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 184308 | Differences between
and this patch

Collapse All | Expand All

(-)Python-2.5.orig/Lib/distutils/command/build_ext.py (+2 lines)
Lines 614-619 class build_ext (Command): Link Here
614
            ext_path[len(ext_path) - 1] = ext_path[len(ext_path) - 1][:8]
614
            ext_path[len(ext_path) - 1] = ext_path[len(ext_path) - 1][:8]
615
        # extensions in debug_mode are named 'module_d.pyd' under windows
615
        # extensions in debug_mode are named 'module_d.pyd' under windows
616
        so_ext = get_config_var('SO')
616
        so_ext = get_config_var('SO')
617
        if os.environ.get('CROSS_COMPILING') == 'yes':
618
            so_ext = os.environ.get('SO')
617
        if os.name == 'nt' and self.debug:
619
        if os.name == 'nt' and self.debug:
618
            return apply(os.path.join, ext_path) + '_d' + so_ext
620
            return apply(os.path.join, ext_path) + '_d' + so_ext
619
        return apply(os.path.join, ext_path) + so_ext
621
        return apply(os.path.join, ext_path) + so_ext
(-)Python-2.5.orig/Makefile.pre.in (-31 / +66 lines)
Lines 27-32 MODLIBS= _MODLIBS_ Link Here
27
VERSION=	@VERSION@
27
VERSION=	@VERSION@
28
srcdir=		@srcdir@
28
srcdir=		@srcdir@
29
VPATH=		@srcdir@
29
VPATH=		@srcdir@
30
export srcdir
30
31
31
CC=		@CC@
32
CC=		@CC@
32
CXX=		@CXX@
33
CXX=		@CXX@
Lines 72-77 CFLAGSFORSHARED=@CFLAGSFORSHARED@ Link Here
72
# C flags used for building the interpreter object files
73
# C flags used for building the interpreter object files
73
PY_CFLAGS=	$(CFLAGS) $(CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE
74
PY_CFLAGS=	$(CFLAGS) $(CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE
74
75
76
# For cross compile: build compiler options
77
CC_FOR_BUILD=	@CC_FOR_BUILD@
78
CROSS_COMPILING=	@cross_compiling@
79
EXEEXT_FOR_BUILD=	@EXEEXT_FOR_BUILD@
80
O_FOR_BUILD=	@O_FOR_BUILD@
81
82
CFLAGS_FOR_BUILD=	@CFLAGS_FOR_BUILD@
83
CPPFLAGS_FOR_BUILD=	@CPPFLAGS_FOR_BUILD@ -I$(srcdir)/Include
84
LDFLAGS_FOR_BUILD=	@LDFLAGS_FOR_BUILD@
85
LIBS_FOR_BUILD=	@LIBS_FOR_BUILD@
75
86
76
# Machine-dependent subdirectories
87
# Machine-dependent subdirectories
77
MACHDEP=	@MACHDEP@
88
MACHDEP=	@MACHDEP@
Lines 169-175 MACHDEP_OBJS= @MACHDEP_OBJS@ Link Here
169
UNICODE_OBJS=   @UNICODE_OBJS@
180
UNICODE_OBJS=   @UNICODE_OBJS@
170
181
171
PYTHON=		python$(EXE)
182
PYTHON=		python$(EXE)
172
BUILDPYTHON=	python$(BUILDEXE)
183
BUILDPYTHON=	python$(EXE)
184
PYTHON_FOR_BUILD=	@PYTHON_FOR_BUILD@
173
185
174
# === Definitions added by makesetup ===
186
# === Definitions added by makesetup ===
175
187
Lines 195-201 GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar Link Here
195
207
196
##########################################################################
208
##########################################################################
197
# Parser
209
# Parser
198
PGEN=		Parser/pgen$(EXE)
210
PGEN_FOR_BUILD=	Parser/pgen$(EXEEXT_FOR_BUILD)
199
211
200
POBJS=		\
212
POBJS=		\
201
		Parser/acceler.o \
213
		Parser/acceler.o \
Lines 212-225 POBJS= \ Link Here
212
224
213
PARSER_OBJS=	$(POBJS) Parser/myreadline.o Parser/tokenizer.o
225
PARSER_OBJS=	$(POBJS) Parser/myreadline.o Parser/tokenizer.o
214
226
215
PGOBJS=		\
227
POBJS_FOR_BUILD=		\
216
		Objects/obmalloc.o \
228
		Parser/acceler.$(O_FOR_BUILD) \
217
		Python/mysnprintf.o \
229
		Parser/grammar1.$(O_FOR_BUILD) \
218
		Parser/tokenizer_pgen.o \
230
		Parser/listnode.$(O_FOR_BUILD) \
219
		Parser/printgrammar.o \
231
		Parser/node.$(O_FOR_BUILD) \
220
		Parser/pgenmain.o
232
		Parser/parser.$(O_FOR_BUILD) \
233
		Parser/parsetok.$(O_FOR_BUILD) \
234
		Parser/bitset.$(O_FOR_BUILD) \
235
		Parser/metagrammar.$(O_FOR_BUILD) \
236
		Parser/firstsets.$(O_FOR_BUILD) \
237
		Parser/grammar.$(O_FOR_BUILD) \
238
		Parser/pgen.$(O_FOR_BUILD)
239
240
PGOBJS_FOR_BUILD=		\
241
		Objects/obmalloc.$(O_FOR_BUILD) \
242
		Python/mysnprintf.$(O_FOR_BUILD) \
243
		Parser/tokenizer_pgen.$(O_FOR_BUILD) \
244
		Parser/printgrammar.$(O_FOR_BUILD) \
245
		Parser/pgenmain.$(O_FOR_BUILD)
221
246
222
PGENOBJS=	$(PGENMAIN) $(POBJS) $(PGOBJS)
247
PGENOBJS=	$(POBJS_FOR_BUILD) $(PGOBJS_FOR_BUILD)
223
248
224
##########################################################################
249
##########################################################################
225
# AST
250
# AST
Lines 338-352 $(BUILDPYTHON): Modules/python.o $(LIBRA Link Here
338
			Modules/python.o \
363
			Modules/python.o \
339
			$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
364
			$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
340
365
341
platform: $(BUILDPYTHON)
366
platform: $(PYTHON_FOR_BUILD)
342
	$(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
367
	$(RUNSHARED) $(PYTHON_FOR_BUILD) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
343
368
344
369
345
# Build the shared modules
370
# Build the shared modules
346
sharedmods: $(BUILDPYTHON)
371
sharedmods: $(PYTHON_FOR_BUILD)
347
	case $$MAKEFLAGS in \
372
	case $$MAKEFLAGS in \
348
	*-s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
373
	*-s*) $(RUNSHARED) CROSS_COMPILING=$(CROSS_COMPILING) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(PYTHON_FOR_BUILD) -E $(srcdir)/setup.py -q build;; \
349
	*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
374
	*) $(RUNSHARED) CROSS_COMPILING=$(CROSS_COMPILING) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(PYTHON_FOR_BUILD) -E $(srcdir)/setup.py build;; \
350
	esac
375
	esac
351
376
352
# Build static library
377
# Build static library
Lines 469-479 Modules/python.o: $(srcdir)/Modules/pyth Link Here
469
	$(MAINCC) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/python.c
494
	$(MAINCC) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/python.c
470
495
471
496
472
$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
497
$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN_FOR_BUILD) $(GRAMMAR_INPUT)
473
		-$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
498
		-$(PGEN_FOR_BUILD) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
474
499
475
$(PGEN):	$(PGENOBJS)
500
$(PGEN_FOR_BUILD):	$(PGENOBJS)
476
		$(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
501
		$(CC_FOR_BUILD) $(OPT) $(LDFLAGS_FOR_BUILD) $(PGENOBJS) $(LIBS_FOR_BUILD) -o $(PGEN_FOR_BUILD)
477
502
478
Parser/grammar.o:	$(srcdir)/Parser/grammar.c \
503
Parser/grammar.o:	$(srcdir)/Parser/grammar.c \
479
				$(srcdir)/Include/token.h \
504
				$(srcdir)/Include/token.h \
Lines 500-505 Objects/unicodectype.o: $(srcdir)/Object Link Here
500
				$(srcdir)/Objects/unicodetype_db.h
525
				$(srcdir)/Objects/unicodetype_db.h
501
526
502
############################################################################
527
############################################################################
528
# Cross compile rules
529
530
# .x is a native object files during cross-compile. 
531
.SUFFIXES: .x 
532
.c.x:
533
	$(CC_FOR_BUILD) -c $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) -o $@ $<
534
535
############################################################################
503
# Header files
536
# Header files
504
537
505
PYTHON_HEADERS= \
538
PYTHON_HEADERS= \
Lines 572-578 $(LIBRARY_OBJS) $(MODOBJS) Modules/pytho Link Here
572
605
573
TESTOPTS=	-l $(EXTRATESTOPTS)
606
TESTOPTS=	-l $(EXTRATESTOPTS)
574
TESTPROG=	$(srcdir)/Lib/test/regrtest.py
607
TESTPROG=	$(srcdir)/Lib/test/regrtest.py
575
TESTPYTHON=	$(RUNSHARED) ./$(BUILDPYTHON) -E -tt
608
TESTPYTHON=	$(RUNSHARED) $(PYTHON_FOR_BUILD) -E -tt
576
test:		all platform
609
test:		all platform
577
		-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
610
		-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
578
		-$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
611
		-$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
Lines 593-599 testuniversal: all platform Link Here
593
		-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
626
		-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
594
		-$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
627
		-$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
595
		$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
628
		$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
596
		$(RUNSHARED) /usr/libexec/oah/translate ./$(BUILDPYTHON) -E -tt $(TESTPROG) $(TESTOPTS) -uall
629
		$(RUNSHARED) /usr/libexec/oah/translate $(PYTHON_FOR_BUILD) -E -tt $(TESTPROG) $(TESTOPTS) -uall
597
630
598
631
599
# Like testall, but with a single pass only
632
# Like testall, but with a single pass only
Lines 716-722 LIBSUBDIRS= lib-tk site-packages test te Link Here
716
		distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
749
		distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
717
		setuptools setuptools/command setuptools/tests setuptools.egg-info \
750
		setuptools setuptools/command setuptools/tests setuptools.egg-info \
718
		curses $(MACHDEPS)
751
		curses $(MACHDEPS)
719
libinstall:	$(BUILDPYTHON) $(srcdir)/Lib/$(PLATDIR)
752
libinstall: $(srcdir)/Lib/$(PLATDIR) $(PYTHON_FOR_BUILD)
720
	@for i in $(SCRIPTDIR) $(LIBDEST); \
753
	@for i in $(SCRIPTDIR) $(LIBDEST); \
721
	do \
754
	do \
722
		if test ! -d $(DESTDIR)$$i; then \
755
		if test ! -d $(DESTDIR)$$i; then \
Lines 773-791 libinstall: $(BUILDPYTHON) $(srcdir)/Lib Link Here
773
	done
806
	done
774
	$(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
807
	$(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
775
	PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
808
	PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
776
		./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
809
		$(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
777
		-d $(LIBDEST) -f \
810
		-d $(LIBDEST) -f \
778
		-x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
811
		-x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
779
	PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
812
	PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
780
		./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
813
		$(PYTHON_FOR_BUILD) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
781
		-d $(LIBDEST) -f \
814
		-d $(LIBDEST) -f \
782
		-x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
815
		-x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
783
	-PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
816
	-PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
784
		./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
817
		$(PYTHON_FOR_BUILD) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
785
		-d $(LIBDEST)/site-packages -f \
818
		-d $(LIBDEST)/site-packages -f \
786
		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
819
		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
787
	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
820
	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
788
		./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
821
		$(PYTHON_FOR_BUILD) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
789
		-d $(LIBDEST)/site-packages -f \
822
		-d $(LIBDEST)/site-packages -f \
790
		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
823
		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
791
824
Lines 826-832 libinstall: $(srcdir)/Lib/$(PLATDIR) $(P Link Here
826
$(srcdir)/Lib/$(PLATDIR):
826
$(srcdir)/Lib/$(PLATDIR):
827
	mkdir $(srcdir)/Lib/$(PLATDIR)
827
	mkdir $(srcdir)/Lib/$(PLATDIR)
828
	cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen
828
	cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen
829
	export PATH; PATH="`pwd`:$$PATH"; \
829
	export PATH; PATH="`dirname $(PYTHON_FOR_BUILD)`:$$PATH"; \
830
	export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
830
	export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
831
	export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \
831
	export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \
832
	export EXE; EXE="$(BUILDEXE)"; \
832
	export EXE; EXE="$(BUILDEXE)"; \
Lines 885-892 libainstall: all Link Here
885
# Install the dynamically loadable modules
918
# Install the dynamically loadable modules
886
# This goes into $(exec_prefix)
919
# This goes into $(exec_prefix)
887
sharedinstall:
920
sharedinstall:
888
	$(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
921
	CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' CROSS_COMPILING='$(CROSS_COMPILING)' \
889
	   	--prefix=$(prefix) \
922
		$(RUNSHARED) $(PYTHON_FOR_BUILD) -E $(srcdir)/setup.py install \
923
		--prefix=$(prefix) \
890
		--install-scripts=$(BINDIR) \
924
		--install-scripts=$(BINDIR) \
891
		--install-platlib=$(DESTSHARED) \
925
		--install-platlib=$(DESTSHARED) \
892
		--root=/$(DESTDIR)
926
		--root=/$(DESTDIR)
Lines 958-965 frameworkinstallextras: Link Here
958
992
959
# This installs a few of the useful scripts in Tools/scripts
993
# This installs a few of the useful scripts in Tools/scripts
960
scriptsinstall:
994
scriptsinstall:
961
	SRCDIR=$(srcdir) $(RUNSHARED) \
995
	$(RUNSHARED) \
962
	./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \
996
	$(PYTHON_FOR_BUILD) $(srcdir)/Tools/scripts/setup.py install \
963
	--prefix=$(prefix) \
997
	--prefix=$(prefix) \
964
	--install-scripts=$(BINDIR) \
998
	--install-scripts=$(BINDIR) \
965
	--root=/$(DESTDIR)
999
	--root=/$(DESTDIR)
Lines 1020-1030 clean: pycremoval Link Here
1020
	find $(srcdir)/build -name 'fficonfig.py' -exec rm -f {} ';' || true
1054
	find $(srcdir)/build -name 'fficonfig.py' -exec rm -f {} ';' || true
1021
1055
1022
clobber: clean
1056
clobber: clean
1023
	-rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
1057
	-rm -f $(BUILDPYTHON) $(PGEN_FOR_BUILD) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
1024
		tags TAGS \
1058
		tags TAGS \
1025
		config.cache config.log pyconfig.h Modules/config.c
1059
		config.cache config.log pyconfig.h Modules/config.c
1026
	-rm -rf build platform
1060
	-rm -rf build platform
1027
	-rm -rf $(PYTHONFRAMEWORKDIR)
1061
	-rm -rf $(PYTHONFRAMEWORKDIR)
1062
	-rm -rf buildpython
1028
1063
1029
# Make things extra clean, before making a distribution:
1064
# Make things extra clean, before making a distribution:
1030
# remove all generated files, even Makefile[.pre]
1065
# remove all generated files, even Makefile[.pre]
(-)Python-2.5.orig/README (+34 lines)
Lines 1196-1201 release-build performance). The Unix, W Link Here
1196
do this.
1196
do this.
1197
1197
1198
1198
1199
Cross Compiling
1200
---------------
1201
1202
Python can be cross compiled by supplying different --build and --host
1203
parameters to configure.  Python is compiled on the "build" system and
1204
executed on the "host" system.  Cross compiling python requires a
1205
native Python on the build host, and a natively compiled tool `Pgen'.
1206
1207
Before cross compiling, Python must first be compiled and installed on
1208
the build host.  The configure script will use `cc' and `python', or
1209
environment variables CC_FOR_BUILD or PYTHON_FOR_BUILD, eg:
1210
1211
   CC_FOR_BUILD=gcc-3.3 \
1212
   PYTHON_FOR_BUILD=python2.4 \
1213
   .../configure --build=i686-linux --host=i586-mingw32
1214
1215
Cross compiling has been tested under linux, mileage may vary for
1216
other platforms.
1217
1218
A few reminders on using configure to cross compile:
1219
- Cross compile tools must be in PATH,
1220
- Cross compile tools must be prefixed with the host type
1221
  (ie i586-mingw32-gcc, powerpc-darwin8-ranlib, ...),
1222
- CC, CXX, AR, and RANLIB must be undefined when running configure,
1223
  they will be auto-detected.
1224
- Autoconf must be stopped from autodetecting definitions for the
1225
  build machine.  This is easiest done by creating a config.cache
1226
  that overrides ac_cv_* variables appropriately.
1227
1228
If you need a cross compiler, Debian ships several several (eg: avr,
1229
m68hc1x, mingw32), while dpkg-cross easily creates others.  Otherwise,
1230
check out Dan Kegel's crosstool: http://www.kegel.com/crosstool .
1231
1232
1199
Miscellaneous issues
1233
Miscellaneous issues
1200
====================
1234
====================
1201
1235
(-)Python-2.5.orig/configure.in (-9 / +92 lines)
Lines 9-14 AC_INIT(python, PYTHON_VERSION, http://w Link Here
9
AC_CONFIG_SRCDIR([Include/object.h])
9
AC_CONFIG_SRCDIR([Include/object.h])
10
AC_CONFIG_HEADER(pyconfig.h)
10
AC_CONFIG_HEADER(pyconfig.h)
11
11
12
# find compiler while respecting --host setting
13
#AC_CANONICAL_HOST()
14
AC_CHECK_TOOLS(CC,gcc cc)
15
AC_CHECK_TOOLS(CXX,g++ c++)
16
12
dnl This is for stuff that absolutely must end up in pyconfig.h.
17
dnl This is for stuff that absolutely must end up in pyconfig.h.
13
dnl Please use pyport.h instead, if possible.
18
dnl Please use pyport.h instead, if possible.
14
AH_TOP([
19
AH_TOP([
Lines 163-170 AC_SUBST(FRAMEWORKUNIXTOOLSPREFIX) Link Here
163
# Set name for machine-dependent library files
168
# Set name for machine-dependent library files
164
AC_SUBST(MACHDEP)
169
AC_SUBST(MACHDEP)
165
AC_MSG_CHECKING(MACHDEP)
170
AC_MSG_CHECKING(MACHDEP)
166
if test -z "$MACHDEP"
171
if test -z "$MACHDEP"; then
167
then
172
    if test "$cross_compiling" = "no"; then
168
	ac_sys_system=`uname -s`
173
	ac_sys_system=`uname -s`
169
	if test "$ac_sys_system" = "AIX" -o "$ac_sys_system" = "Monterey64" \
174
	if test "$ac_sys_system" = "AIX" -o "$ac_sys_system" = "Monterey64" \
170
	-o "$ac_sys_system" = "UnixWare" -o "$ac_sys_system" = "OpenUNIX"; then
175
	-o "$ac_sys_system" = "UnixWare" -o "$ac_sys_system" = "OpenUNIX"; then
Lines 172-177 then Link Here
172
	else
177
	else
173
		ac_sys_release=`uname -r`
178
		ac_sys_release=`uname -r`
174
	fi
179
	fi
180
    else
181
	m=`$CC -dumpmachine`
182
 	changequote(<<, >>)#dnl
183
	ac_sys_system=`expr "$m" : "[^-]*-\([^-]*\)"`
184
 	changequote([, ])#dnl
185
186
187
	case $ac_sys_system in
188
	cygwin*) ac_sys_system=`echo $ac_sys_system | sed s/cygwin/CYGWIN/g `;;
189
	darwin*) ac_sys_system=`echo $ac_sys_system | sed s/darwin/Darwin/g `;;
190
	freebsd*) ac_sys_system=`echo $ac_sys_system | sed s/freebsd/FreeBSD/g `;;
191
	linux*) ac_sys_system=`echo $ac_sys_system | sed s/linux/Linux/g `;;
192
	esac
193
	
194
195
    fi
196
    
175
	ac_md_system=`echo $ac_sys_system |
197
	ac_md_system=`echo $ac_sys_system |
176
			   tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'`
198
			   tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'`
177
	ac_md_release=`echo $ac_sys_release |
199
	ac_md_release=`echo $ac_sys_release |
Lines 475-483 if test -d casesensitivetestdir Link Here
475
then
497
then
476
    AC_MSG_RESULT(yes)
498
    AC_MSG_RESULT(yes)
477
    BUILDEXEEXT=.exe
499
    BUILDEXEEXT=.exe
500
    case_sensitive=no
478
else
501
else
479
	AC_MSG_RESULT(no)
502
    AC_MSG_RESULT(no)
480
	BUILDEXEEXT=$EXEEXT
503
    BUILDEXEEXT=$EXEEXT
504
    case_sensitive=yes
481
fi
505
fi
482
rmdir CaseSensitiveTestDir
506
rmdir CaseSensitiveTestDir
483
507
Lines 676-684 fi Link Here
676
700
677
AC_MSG_RESULT($LDLIBRARY)
701
AC_MSG_RESULT($LDLIBRARY)
678
702
679
AC_PROG_RANLIB
703
# find tools while respecting --host setting
680
AC_SUBST(AR)
704
AC_CHECK_TOOL(RANLIB,ranlib)
681
AC_CHECK_PROGS(AR, ar aal, ar)
705
AC_CHECK_TOOLS(AR,ar aal,ar)
682
706
683
AC_SUBST(SVNVERSION)
707
AC_SUBST(SVNVERSION)
684
AC_CHECK_PROG(SVNVERSION, svnversion, found, not-found)
708
AC_CHECK_PROG(SVNVERSION, svnversion, found, not-found)
Lines 3346-3352 AC_CHECK_FILE(/dev/ptmx, AC_DEFINE(HAVE_ Link Here
3346
AC_CHECK_FILE(/dev/ptc, AC_DEFINE(HAVE_DEV_PTC, 1, [Define if we have /dev/ptc.]))
3370
AC_CHECK_FILE(/dev/ptc, AC_DEFINE(HAVE_DEV_PTC, 1, [Define if we have /dev/ptc.]))
3347
3371
3348
AC_MSG_CHECKING(for %zd printf() format support)
3372
AC_MSG_CHECKING(for %zd printf() format support)
3349
AC_TRY_RUN([#include <stdio.h>
3373
AC_CACHE_VAL(ac_cv_printf_zd_format,
3374
  AC_TRY_RUN([#include <stdio.h>
3350
#include <stddef.h>
3375
#include <stddef.h>
3351
#include <string.h>
3376
#include <string.h>
3352
3377
Lines 3364-3370 int main() Link Here
3364
}],
3389
}],
3365
[AC_MSG_RESULT(yes)
3390
[AC_MSG_RESULT(yes)
3366
 AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])],
3391
 AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])],
3367
 AC_MSG_RESULT(no))
3392
 AC_MSG_RESULT(no),
3393
 AC_MSG_RESULT(no)))
3368
3394
3369
AC_CHECK_TYPE(socklen_t,,
3395
AC_CHECK_TYPE(socklen_t,,
3370
  AC_DEFINE(socklen_t,int,
3396
  AC_DEFINE(socklen_t,int,
Lines 3394-3399 for dir in $SRCDIRS; do Link Here
3394
done
3419
done
3395
AC_MSG_RESULT(done)
3420
AC_MSG_RESULT(done)
3396
3421
3422
# Cross compiling
3423
AC_SUBST(cross_compiling)
3424
3425
if test "$cross_compiling" = "yes"; then
3426
    AC_MSG_CHECKING(cc for build)
3427
    CC_FOR_BUILD="${CC_FOR_BUILD-cc}"
3428
else
3429
    CC_FOR_BUILD="${CC_FOR_BUILD-$CC}"
3430
fi   
3431
     
3432
if test "$cross_compiling" = "yes"; then
3433
   AC_MSG_RESULT($CC_FOR_BUILD)
3434
fi
3435
3436
AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler (default: cc)])
3437
	
3438
if test "$cross_compiling" = "yes"; then
3439
    AC_MSG_CHECKING(python for build)
3440
    PYTHON_FOR_BUILD="${PYTHON_FOR_BUILD-python}"
3441
    PYTHON_FOR_BUILD=`which $PYTHON_FOR_BUILD`
3442
else
3443
    PYTHON_FOR_BUILD='./$(BUILDPYTHON)'
3444
fi   
3445
3446
if test "$cross_compiling" = "yes"; then
3447
    AC_MSG_RESULT($PYTHON_FOR_BUILD)
3448
fi
3449
AC_ARG_VAR(PYTHON_FOR_BUILD,[build system python (default: python)])
3450
AC_SUBST(PYTHON_FOR_BUILD)
3451
3452
if test "$cross_compiling" = "yes"; then
3453
    CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-}
3454
    CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD- -I.}
3455
    CROSS_COMMENT=#
3456
    if test "$case_sensitive" = "yes"
3457
    then
3458
        EXEEXT_FOR_BUILD=
3459
    else
3460
        EXEEXT_FOR_BUILD=.exe
3461
    fi
3462
    LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-}
3463
    LIBS_FOR_BUILD=${LIBS_FOR_BUILD-}
3464
    O_FOR_BUILD=x
3465
    RUNSHARED="CROSS_TARGET=$ac_sys_system SRCDIR=$srcdir SO=${SO}"
3466
else
3467
    CROSS_COMMENT=
3468
    EXEEXT_FOR_BUILD=$BUILDEXEEXT
3469
    O_FOR_BUILD=o
3470
fi
3471
AC_SUBST(CFLAGS_FOR_BUILD)
3472
AC_SUBST(CPPFLAGS_FOR_BUILD)
3473
AC_SUBST(CROSS_COMMENT)
3474
AC_SUBST(EXEEXT_FOR_BUILD)
3475
AC_SUBST(LDFLAGS_FOR_BUILD)
3476
AC_SUBST(LIBS_FOR_BUILD)
3477
AC_SUBST(O_FOR_BUILD)
3478
3397
# generate output files
3479
# generate output files
3398
AC_CONFIG_FILES(Makefile.pre Modules/Setup.config)
3480
AC_CONFIG_FILES(Makefile.pre Modules/Setup.config)
3399
AC_OUTPUT
3481
AC_OUTPUT
(-)Python-2.5.orig/setup.py (-12 / +52 lines)
Lines 17-22 from distutils.command.install_lib impor Link Here
17
# This global variable is used to hold the list of modules to be disabled.
17
# This global variable is used to hold the list of modules to be disabled.
18
disabled_module_list = []
18
disabled_module_list = []
19
19
20
import os
21
22
if os.environ.get('CROSS_COMPILING') == 'yes':
23
    sysconfig.get_config_vars()
24
    sysconfig._config_vars.update (os.environ)
25
else:
26
    sysconfig.get_config_vars()
27
    sysconfig._config_vars['srcdir'] = os.environ['srcdir']
28
    
20
def add_dir_to_list(dirlist, dir):
29
def add_dir_to_list(dirlist, dir):
21
    """Add the directory 'dir' to the list 'dirlist' (at the front) if
30
    """Add the directory 'dir' to the list 'dirlist' (at the front) if
22
    1) 'dir' is not already in 'dirlist'
31
    1) 'dir' is not already in 'dirlist'
Lines 203-208 class PyBuildExt(build_ext): Link Here
203
            self.announce('WARNING: skipping import check for Cygwin-based "%s"'
212
            self.announce('WARNING: skipping import check for Cygwin-based "%s"'
204
                % ext.name)
213
                % ext.name)
205
            return
214
            return
215
        if os.environ.get('CROSS_COMPILING') == 'yes':
216
            self.announce('WARNING: skipping import check for cross compiled "%s"'
217
                % ext.name)
218
            return
206
        ext_filename = os.path.join(
219
        ext_filename = os.path.join(
207
            self.build_lib,
220
            self.build_lib,
208
            self.get_ext_filename(self.get_ext_fullname(ext.name)))
221
            self.get_ext_filename(self.get_ext_fullname(ext.name)))
Lines 236-251 class PyBuildExt(build_ext): Link Here
236
                          level=3)
249
                          level=3)
237
250
238
    def get_platform(self):
251
    def get_platform(self):
239
        # Get value of sys.platform
252
        # Get value of target's sys.platform
240
        for platform in ['cygwin', 'beos', 'darwin', 'atheos', 'osf1']:
253
        p = sys.platform
241
            if sys.platform.startswith(platform):
254
        if os.environ.get('CROSS_COMPILING') == 'yes':
255
            p = os.environ.get('CROSS_TARGET')
256
        for platform in ['cygwin', 'mingw', 'beos', 'darwin', 'atheos', 'osf1']:
257
            if p.startswith(platform):
242
                return platform
258
                return platform
243
        return sys.platform
259
        return p
244
260
245
    def detect_modules(self):
261
    def detect_modules(self):
246
        # Ensure that /usr/local is always used
262
        # Ensure that /usr/local is always used
247
        add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
263
248
        add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
264
        if os.environ.get('CROSS_COMPILING') != 'yes':
265
            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
266
            add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
249
267
250
        # Add paths specified in the environment variables LDFLAGS and
268
        # Add paths specified in the environment variables LDFLAGS and
251
        # CPPFLAGS for header and library files.
269
        # CPPFLAGS for header and library files.
Lines 293-303 class PyBuildExt(build_ext): Link Here
293
        # lib_dirs and inc_dirs are used to search for files;
311
        # lib_dirs and inc_dirs are used to search for files;
294
        # if a file is found in one of those directories, it can
312
        # if a file is found in one of those directories, it can
295
        # be assumed that no additional -I,-L directives are needed.
313
        # be assumed that no additional -I,-L directives are needed.
296
        lib_dirs = self.compiler.library_dirs + [
314
        lib_dirs = []
297
            '/lib64', '/usr/lib64',
315
        inc_dirs = []
298
            '/lib', '/usr/lib',
316
        if os.environ.get('CROSS_COMPILING') != 'yes':
299
            ]
317
            lib_dirs = self.compiler.library_dirs + [
300
        inc_dirs = self.compiler.include_dirs + ['/usr/include']
318
                '/lib64', '/usr/lib64',
319
                '/lib', '/usr/lib',
320
                ]
321
            inc_dirs = self.compiler.include_dirs + ['/usr/include']
322
            
301
        exts = []
323
        exts = []
302
324
303
        config_h = sysconfig.get_config_h_filename()
325
        config_h = sysconfig.get_config_h_filename()
Lines 531-536 class PyBuildExt(build_ext): Link Here
531
                               ['/usr/kerberos/include'])
553
                               ['/usr/kerberos/include'])
532
            if krb5_h:
554
            if krb5_h:
533
                ssl_incs += krb5_h
555
                ssl_incs += krb5_h
556
534
        ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
557
        ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
535
                                     ['/usr/local/ssl/lib',
558
                                     ['/usr/local/ssl/lib',
536
                                      '/usr/contrib/ssl/lib/'
559
                                      '/usr/contrib/ssl/lib/'
Lines 612-617 class PyBuildExt(build_ext): Link Here
612
635
613
        # construct a list of paths to look for the header file in on
636
        # construct a list of paths to look for the header file in on
614
        # top of the normal inc_dirs.
637
        # top of the normal inc_dirs.
638
        
615
        db_inc_paths = [
639
        db_inc_paths = [
616
            '/usr/include/db4',
640
            '/usr/include/db4',
617
            '/usr/local/include/db4',
641
            '/usr/local/include/db4',
Lines 622-627 class PyBuildExt(build_ext): Link Here
622
            '/opt/sfw/include/db3',
646
            '/opt/sfw/include/db3',
623
            '/sw/include/db3',
647
            '/sw/include/db3',
624
        ]
648
        ]
649
        
625
        # 4.x minor number specific paths
650
        # 4.x minor number specific paths
626
        for x in (0,1,2,3,4):
651
        for x in (0,1,2,3,4):
627
            db_inc_paths.append('/usr/include/db4%d' % x)
652
            db_inc_paths.append('/usr/include/db4%d' % x)
Lines 638-643 class PyBuildExt(build_ext): Link Here
638
            db_inc_paths.append('/pkg/db-3.%d/include' % x)
663
            db_inc_paths.append('/pkg/db-3.%d/include' % x)
639
            db_inc_paths.append('/opt/db-3.%d/include' % x)
664
            db_inc_paths.append('/opt/db-3.%d/include' % x)
640
665
666
667
        
668
        if os.environ.get('CROSS_COMPILING') == 'yes':
669
            db_inc_paths = []
670
641
        # Add some common subdirectories for Sleepycat DB to the list,
671
        # Add some common subdirectories for Sleepycat DB to the list,
642
        # based on the standard include directories. This way DB3/4 gets
672
        # based on the standard include directories. This way DB3/4 gets
643
        # picked up when it is installed in a non-standard prefix and
673
        # picked up when it is installed in a non-standard prefix and
Lines 757-762 class PyBuildExt(build_ext): Link Here
757
        MIN_SQLITE_VERSION = ".".join([str(x)
787
        MIN_SQLITE_VERSION = ".".join([str(x)
758
                                    for x in MIN_SQLITE_VERSION_NUMBER])
788
                                    for x in MIN_SQLITE_VERSION_NUMBER])
759
789
790
        if os.environ.get('CROSS_COMPILING') == 'yes':
791
            sqlite_inc_paths = []
792
793
760
        # Scan the default include directories before the SQLite specific
794
        # Scan the default include directories before the SQLite specific
761
        # ones. This allows one to override the copy of sqlite on OSX,
795
        # ones. This allows one to override the copy of sqlite on OSX,
762
        # where /usr/include contains an old version of sqlite.
796
        # where /usr/include contains an old version of sqlite.
Lines 837-843 class PyBuildExt(build_ext): Link Here
837
        # accidentally building this module with a later version of the
871
        # accidentally building this module with a later version of the
838
        # underlying db library.  May BSD-ish Unixes incorporate db 1.85
872
        # underlying db library.  May BSD-ish Unixes incorporate db 1.85
839
        # symbols into libc and place the include file in /usr/include.
873
        # symbols into libc and place the include file in /usr/include.
874
875
840
        f = "/usr/include/db.h"
876
        f = "/usr/include/db.h"
877
        if os.environ.get('CROSS_COMPILING') == 'yes':
878
            f = ''
879
841
        if os.path.exists(f):
880
        if os.path.exists(f):
842
            data = open(f).read()
881
            data = open(f).read()
843
            m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data)
882
            m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data)
Lines 1347-1352 class PyBuildExt(build_ext): Link Here
1347
            ext.sources.extend(fficonfig['ffi_sources'])
1386
            ext.sources.extend(fficonfig['ffi_sources'])
1348
            ext.include_dirs.extend(include_dirs)
1387
            ext.include_dirs.extend(include_dirs)
1349
            ext.extra_compile_args.extend(extra_compile_args)
1388
            ext.extra_compile_args.extend(extra_compile_args)
1389
1350
        return True
1390
        return True
1351
1391
1352
    def detect_ctypes(self, inc_dirs, lib_dirs):
1392
    def detect_ctypes(self, inc_dirs, lib_dirs):
Lines 1495-1500 def main(): Link Here
1495
    # turn off warnings when deprecated modules are imported
1535
    # turn off warnings when deprecated modules are imported
1496
    import warnings
1536
    import warnings
1497
    warnings.filterwarnings("ignore",category=DeprecationWarning)
1537
    warnings.filterwarnings("ignore",category=DeprecationWarning)
1538
    
1498
    setup(# PyPI Metadata (PEP 301)
1539
    setup(# PyPI Metadata (PEP 301)
1499
          name = "Python",
1540
          name = "Python",
1500
          version = sys.version.split()[0],
1541
          version = sys.version.split()[0],
Lines 1513-1519 def main(): Link Here
1513
          # The struct module is defined here, because build_ext won't be
1554
          # The struct module is defined here, because build_ext won't be
1514
          # called unless there's at least one extension module defined.
1555
          # called unless there's at least one extension module defined.
1515
          ext_modules=[Extension('_struct', ['_struct.c'])],
1556
          ext_modules=[Extension('_struct', ['_struct.c'])],
1516
1517
          # Scripts to install
1557
          # Scripts to install
1518
          scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle',
1558
          scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle',
1519
                     'Lib/smtpd.py']
1559
                     'Lib/smtpd.py']

Return to bug 184308