[Python-checkins] python/dist/src/PC/os2emx Makefile,1.12,1.13 pyconfig.h,1.5,1.6 python23.def,1.6,1.7
aimacintyre@users.sourceforge.net
aimacintyre@users.sourceforge.net
Sun, 13 Jul 2003 06:42:02 -0700
Update of /cvsroot/python/python/dist/src/PC/os2emx
In directory sc8-pr-cvs1:/tmp/cvs-serv26407
Modified Files:
Makefile pyconfig.h python23.def
Log Message:
More pre-2.3 build tweaks for the OS/2 EMX port:
- separate the building of the core from the wrapper executables and the
external modules (.PYDs), based on the Py_BUILD_CORE define;
- clean up the generated import library definiton (.DEF file) to remove
references to a number of non-static symbols that aren't part of the
Python API and which shouldn't be exported by the core DLL;
- compile the release build with -fomit-frame-pointer, for a small
performance gain;
- make "make clean" remove byte compiled Python library files.
Index: Makefile
===================================================================
RCS file: /cvsroot/python/python/dist/src/PC/os2emx/Makefile,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** Makefile 9 Jun 2003 08:14:03 -0000 1.12
--- Makefile 13 Jul 2003 13:41:59 -0000 1.13
***************
*** 84,87 ****
--- 84,88 ----
EXPLIB= emxexp
EXEOPT= emxbind
+ PY_DEF= -DPy_BUILD_CORE
***************
*** 91,97 ****
LDFLAGS+= -g
else
! CFLAGS+= -s -O2
LDFLAGS+= -s
endif
ifeq ($(ASSERTIONS),no)
CFLAGS+= -DNDEBUG
--- 92,99 ----
LDFLAGS+= -g
else
! CFLAGS+= -s -O2 -fomit-frame-pointer
LDFLAGS+= -s
endif
+ CFLAGS+= $(PY_DEF)
ifeq ($(ASSERTIONS),no)
CFLAGS+= -DNDEBUG
***************
*** 475,479 ****
# Targets
all: $(OUT) $(PYTHON.LIB) $(PYTHON.DEF) $(PYTHON.IMPLIB) $(PYTHON.DLL) \
! $(PYTHON.EXE) $(PYTHONPM.EXE) $(PGEN.EXE) $(EXTERNDLLS)
clean:
--- 477,484 ----
# Targets
all: $(OUT) $(PYTHON.LIB) $(PYTHON.DEF) $(PYTHON.IMPLIB) $(PYTHON.DLL) \
! python_noncore
!
! python_noncore:
! make PY_DEF= $(PYTHON.EXE) $(PYTHONPM.EXE) $(PGEN.EXE) $(EXTERNDLLS)
clean:
***************
*** 481,484 ****
--- 486,490 ----
rm -f $(PYTHON.LIB) $(PYTHON.IMPLIB) $(PYTHON.EXEIMP) $(PYTHON.DLL) \
$(PYTHON.EXE) $(PYTHONPM.EXE) $(PGEN.EXE) *$(MODULE.EXT)
+ find ../../Lib -name "*.py[co]" -exec rm {} ";"
lx:
***************
*** 499,502 ****
--- 505,511 ----
$(AR) $(ARFLAGS) $@ $^
+ # the Python core DLL .def file needs to have a number of non-static
+ # symbols that aren't part of the Python C API removed (commented out)
+ # from the DLL export list.
$(PYTHON.DEF): $(PYTHON.LIB)
@echo Creating .DEF file: $@
***************
*** 506,510 ****
@echo DATA MULTIPLE NONSHARED >>$@
@echo EXPORTS >>$@
! $(EXPLIB) -u $(PYTHON.LIB) >>$@
$(PYTHON.IMPLIB): $(PYTHON.DEF)
--- 515,541 ----
@echo DATA MULTIPLE NONSHARED >>$@
@echo EXPORTS >>$@
! $(EXPLIB) -u $(PYTHON.LIB) |\
! sed -e "/ .init.*/s/^ /; /" \
! -e "/ .pcre_.*/s/^ /; /" \
! -e "/ .array_methods/s/^ /; /" \
! -e "/ .fast_save_leave/s/^ /; /" \
! -e "/ .dlopen/s/^ /; /" \
! -e "/ .dlsym/s/^ /; /" \
! -e "/ .dlclose/s/^ /; /" \
! -e "/ .dlerror/s/^ /; /" \
! -e "/ .cycle_type/s/^ /; /" \
! -e "/ .dropwhile_type/s/^ /; /" \
! -e "/ .takewhile_type/s/^ /; /" \
! -e "/ .islice_type/s/^ /; /" \
! -e "/ .starmap_type/s/^ /; /" \
! -e "/ .imap_type/s/^ /; /" \
! -e "/ .chain_type/s/^ /; /" \
! -e "/ .ifilter_type/s/^ /; /" \
! -e "/ .ifilterfalse_type/s/^ /; /" \
! -e "/ .count_type/s/^ /; /" \
! -e "/ .izip_type/s/^ /; /" \
! -e "/ .repeat_type/s/^ /; /" \
! -e "/ ._Py_re_.*/s/^ /; /" \
! -e "/ ._Py_MD5.*/s/^ /; /" >>$@
$(PYTHON.IMPLIB): $(PYTHON.DEF)
***************
*** 628,632 ****
#_tkinter$(MODULE.EXT): $(OUT)_tkinter$O $(OUT)tclNotify$O $(OUT)tkappinit$O
_tkinter$(MODULE.EXT): $(OUT)_tkinter$O $(OUT)tclNotify$O \
! $(OUT)_tkinter_m.def $(PYTHON.IMPLIB)
$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) $(TK_LIBS)
--- 659,663 ----
#_tkinter$(MODULE.EXT): $(OUT)_tkinter$O $(OUT)tclNotify$O $(OUT)tkappinit$O
_tkinter$(MODULE.EXT): $(OUT)_tkinter$O $(OUT)tclNotify$O \
! $(OUT)_tkinter_m.def $(PYTHON.IMPLIB)
$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) $(TK_LIBS)
Index: pyconfig.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/PC/os2emx/pyconfig.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** pyconfig.h 9 Jun 2003 08:16:59 -0000 1.5
--- pyconfig.h 13 Jul 2003 13:41:59 -0000 1.6
***************
*** 27,30 ****
--- 27,42 ----
#endif
+ /* if building an extension or wrapper executable,
+ * mark Python API symbols "extern" so that symbols
+ * imported from the Python core DLL aren't duplicated.
+ */
+ #ifdef Py_BUILD_CORE
+ # define PyAPI_FUNC(RTYPE) RTYPE
+ #else
+ # define PyAPI_FUNC(RTYPE) extern RTYPE
+ #endif
+ #define PyAPI_DATA(RTYPE) extern RTYPE
+ #define PyMODINIT_FUNC void
+
/* Use OS/2 flavour of threads */
#define WITH_THREAD 1
Index: python23.def
===================================================================
RCS file: /cvsroot/python/python/dist/src/PC/os2emx/python23.def,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** python23.def 19 Feb 2003 12:42:36 -0000 1.6
--- python23.def 13 Jul 2003 13:41:59 -0000 1.7
***************
*** 9,22 ****
; From python23_s.lib(dlfcn)
! "dlopen"
! "dlsym"
! "dlclose"
! "dlerror"
; From python23_s.lib(getpathp)
! "Py_GetPath"
"Py_GetPrefix"
[...1638 lines suppressed...]
+ ; "inittermios"
+
+ ; From python23_s.lib(timemodule)
+ ; "inittime"
+ ; "inittimezone"
+
+ ; From python23_s.lib(timingmodule)
+ ; "inittiming"
+
+ ; From python23_s.lib(_weakref)
+ ; "init_weakref"
+
+ ; From python23_s.lib(xreadlinesmodule)
+ ; "initxreadlines"
+
+ ; From python23_s.lib(xxsubtype)
+ ; "initxxsubtype"
+
+ ; From python23_s.lib(zipimport)
+ ; "initzipimport"