Commits

Anonymous committed 5a0658c

- add build support for curses to be both extension and DLL, so that
curses_panel works;
- tweak compiler switches.

Comments (0)

Files changed (1)

   CFLAGS+=	-g -O
   LDFLAGS+=	-g
 else
-  CFLAGS+=	-s -O3 -fomit-frame-pointer
+  CFLAGS+=	-s -O3 -fomit-frame-pointer -mprobe
   LDFLAGS+=	-s
 endif
 CFLAGS+=	$(PY_DEF)
 
 # File extensions
 MODULE.EXT=	.pyd
+MODLIB.EXT=	.dll
 ifeq ($(OMF),yes)
   O=		.obj
   A=		.lib
 DESCRIPTION.mpz$(MODULE.EXT)=		Python Extension DLL for access to GNU multi-precision library
 DESCRIPTION.readline$(MODULE.EXT)=	Python Extension DLL for access to GNU ReadLine library
 DESCRIPTION.bsddb185$(MODULE.EXT)=	Python Extension DLL for access to BSD DB (v1.85) library
-DESCRIPTION._curses$(MODULE.EXT)=	Python Extension DLL for access to ncurses library
+DESCRIPTION._curses$(MODLIB.EXT)=	Python Extension DLL for access to ncurses library
 DESCRIPTION.pyexpat$(MODULE.EXT)=	Python Extension DLL for access to expat library
 DESCRIPTION.bz2$(MODULE.EXT)=		Python Extension DLL for accessing the bz2 compression library
 
 		_testcap \
 		unicoded
 
+# Python modules that are used as libraries and therefore must use
+# a .DLL extension
+LIBEXTMODULES=
+
 # Python external ($(MODULE.EXT)) modules - can be EASY or HARD
 ifeq ($(HAVE_ZLIB),yes)
   HARDEXTMODULES+=	zlib
   HARDEXTMODULES+=	bsddb185
 endif
 ifeq ($(HAVE_NCURSES),yes)
-  HARDEXTMODULES+=	_curses _curses_
+  LIBEXTMODULES+=	_curses
+  HARDEXTMODULES+=	_curses_
 endif
 ifeq ($(HAVE_GDBM),yes)
   HARDEXTMODULES+=	gdbm dbm
 # all the external modules
 EXTERNDLLS=	$(addsuffix $(MODULE.EXT),$(patsubst %module,%,$(EASYEXTMODULES)))
 EXTERNDLLS+=	$(addsuffix $(MODULE.EXT),$(patsubst %module,%,$(HARDEXTMODULES)))
+EXTERNDLLS+=	$(addsuffix $(MODLIB.EXT),$(patsubst %module,%,$(LIBEXTMODULES)))
 
 # Targets
 all:  $(OUT) $(PYTHON.LIB) $(PYTHON.DEF) $(PYTHON.IMPLIB) $(PYTHON.DLL) \
 $(OUT)_curses_m.def:
 	@echo Creating .DEF file: $@
 	@echo LIBRARY $(notdir $*) INITINSTANCE TERMINSTANCE >$@
-	@echo DESCRIPTION $(DQUOTE)$(DESCRIPTION.$(notdir $*)$(MODULE.EXT))$(DQUOTE) >>$@
+	@echo DESCRIPTION $(DQUOTE)$(DESCRIPTION.$(notdir $*)$(MODLIB.EXT))$(DQUOTE) >>$@
 	@echo DATA MULTIPLE NONSHARED >>$@
 	@echo EXPORTS >>$@
 	@echo 	init_curses >>$@
 	@echo EXPORTS >>$@
 	@echo 	init_curses_panel >>$@
 
-_curses$(MODULE.EXT): $(OUT)_cursesmodule$O $(OUT)_curses_m.def $(PYTHON.IMPLIB)
+_curses$(MODLIB.EXT): $(OUT)_cursesmodule$O $(OUT)_curses_m.def $(PYTHON.IMPLIB)
 	$(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lncurses
 
 # curses_panel needs to be renamed to be useful