aboutsummaryrefslogtreecommitdiff
blob: 425e1493d37292c079797015aa047ba8c5d3af8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
http://bugs.python.org/issue12619

--- Lib/plat-aix4/regen
+++ Lib/plat-aix4/regen
@@ -5,4 +5,4 @@
         exit 1;;
 esac
 set -v
-h2py.py -i '(u_long)' /usr/include/netinet/in.h
+python$EXE ../../Tools/scripts/h2py.py -i '(u_long)' /usr/include/netinet/in.h
--- Lib/plat-linux2/regen
+++ Lib/plat-linux2/regen
@@ -5,4 +5,4 @@
 	exit 1;;
 esac
 set -v
-h2py -i '(u_long)' /usr/include/sys/types.h /usr/include/netinet/in.h /usr/include/dlfcn.h
+python$EXE ../../Tools/scripts/h2py.py -i '(u_long)' /usr/include/sys/types.h /usr/include/netinet/in.h /usr/include/dlfcn.h /usr/include/linux/cdrom.h
--- Lib/plat-sunos5/regen
+++ Lib/plat-sunos5/regen
@@ -5,5 +5,4 @@
 	exit 1;;
 esac
 set -v
-h2py -i '(u_long)' /usr/include/sys/types.h /usr/include/netinet/in.h /usr/include/sys/stropts.h /usr/include/dlfcn.h
-
+python$EXE ../../Tools/scripts/h2py.py -i '(u_long)' /usr/include/sys/types.h /usr/include/netinet/in.h /usr/include/sys/stropts.h /usr/include/dlfcn.h
--- Lib/plat-unixware7/regen
+++ Lib/plat-unixware7/regen
@@ -5,5 +5,5 @@
 	exit 1;;
 esac
 set -v
-h2py -i '(u_long)' /usr/include/netinet/in.h
-h2py /usr/include/sys/stropts.h
+python$EXE ../../Tools/scripts/h2py.py -i '(u_long)' /usr/include/netinet/in.h
+python$EXE ../../Tools/scripts/h2py.py /usr/include/sys/stropts.h
--- Makefile.pre.in
+++ Makefile.pre.in
@@ -355,7 +355,7 @@
 
 # Default target
 all:		build_all
-build_all:	$(BUILDPYTHON) oldsharedmods sharedmods
+build_all:	$(BUILDPYTHON) oldsharedmods sharedmods platformspecificmods
 
 # Compile a binary with gcc profile guided optimization.
 profile-opt:
@@ -400,6 +400,26 @@
 	*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
 	esac
 
+# Build the platform-specific modules
+platformspecificmods: $(BUILDPYTHON) sharedmods
+	@PLATDIR=$(PLATDIR); \
+	if test ! -f $(srcdir)/Lib/$(PLATDIR)/regen; then \
+		$(INSTALL) -d $(srcdir)/Lib/$(PLATDIR); \
+		if test -f $(srcdir)/Lib/$${PLATDIR%?}/regen; then \
+			cp $(srcdir)/Lib/$${PLATDIR%?}/regen $(srcdir)/Lib/$(PLATDIR)/regen; \
+		else \
+			cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen; \
+		fi \
+	fi
+	@EXE="$(BUILDEXE)"; export EXE; \
+	PATH="`pwd`:$$PATH"; export PATH; \
+	PYTHONPATH="`pwd`/Lib"; export PYTHONPATH; \
+	cd $(srcdir)/Lib/$(PLATDIR); \
+	$(RUNSHARED) ./regen || exit 1; \
+	for module in *.py; do \
+		$(RUNSHARED) $(BUILDPYTHON) -c "import py_compile; py_compile.compile('$$module', cfile='/dev/null', doraise=True)" || exit 1; \
+	done
+
 # Build static library
 # avoid long command lines, same as LIBRARY_OBJS
 $(LIBRARY): $(LIBRARY_OBJS)
@@ -845,7 +865,7 @@
 		multiprocessing multiprocessing/dummy \
 		lib-old \
 		curses pydoc_data $(MACHDEPS)
-libinstall:	build_all $(srcdir)/Lib/$(PLATDIR)
+libinstall:	build_all
 	@for i in $(SCRIPTDIR) $(LIBDEST); \
 	do \
 		if test ! -d $(DESTDIR)$$i; then \
@@ -920,16 +940,6 @@
 	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
 		./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
 
-# Create the PLATDIR source directory, if one wasn't distributed..
-$(srcdir)/Lib/$(PLATDIR):
-	mkdir $(srcdir)/Lib/$(PLATDIR)
-	cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen
-	export PATH; PATH="`pwd`:$$PATH"; \
-	export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
-	export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \
-	export EXE; EXE="$(BUILDEXE)"; \
-	cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
-
 # Install the include files
 INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
 inclinstall:
@@ -1212,7 +1222,7 @@
 Python/thread.o: @THREADHEADERS@
 
 # Declare targets that aren't real files
-.PHONY: all build_all sharedmods oldsharedmods test quicktest memtest
+.PHONY: all build_all sharedmods oldsharedmods platformspecificmods test quicktest memtest
 .PHONY: install altinstall oldsharedinstall bininstall altbininstall
 .PHONY: maninstall libinstall inclinstall libainstall sharedinstall
 .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure