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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
|
diff -Nru PDCurses-3.9.orig/configure.ac PDCurses-3.9/configure.ac
--- PDCurses-3.9.orig/configure.ac 1970-01-01 01:00:00.000000000 +0100
+++ PDCurses-3.9/configure.ac 2025-06-10 22:23:49.585676788 +0200
@@ -0,0 +1,194 @@
+AC_INIT(PDCurses, 3.9, wmcbrine@gmail.com, PDCurses)
+AC_CONFIG_SRCDIR(curses.h)
+AC_CONFIG_MACRO_DIRS([m4])
+AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
+
+AC_SUBST(prefix)
+
+AC_PROG_CC
+AM_PROG_AR
+
+PKG_PROG_PKG_CONFIG
+
+LT_INIT([win32-dll])
+
+AC_CONFIG_HEADERS([config.h])
+
+AC_SUBST(SYS_DEFS)
+
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+
+AC_CHECK_FUNCS(vsscanf usleep poll vsnprintf)
+
+dnl ==================== Backend Selection ====================
+
+dnl Default backend selection
+DEFAULT_BACKEND=""
+AVAILABLE_BACKENDS=""
+ALL_BACKENDS="x11 sdl1 sdl2 wincon dos os2"
+
+dnl Check for X11
+AC_PATH_X
+if test "$have_x" != "no" ; then
+ AVAILABLE_BACKENDS="$AVAILABLE_BACKENDS x11"
+ if test "$DEFAULT_BACKEND" = "" ; then
+ DEFAULT_BACKEND="x11"
+ fi
+fi
+
+AVAILABLE_BACKENDS="$AVAILABLE_BACKENDS sdl1 sdl2 wincon dos os2"
+
+AC_ARG_WITH(backend,
+ [ --with-backend=BACKEND select backend (available: x11 sdl1 sdl2 wincon dos os2)],
+ [BACKEND="$withval"],
+ [BACKEND="$DEFAULT_BACKEND"]
+)
+
+if test "$BACKEND" = "" ; then
+ AC_MSG_ERROR([No suitable backend found. Available backends: $AVAILABLE_BACKENDS])
+fi
+
+dnl Validate selected backend
+case "$BACKEND" in
+ x11)
+ if test "$have_x" = "no" ; then
+ AC_MSG_ERROR([X11 backend selected but X11 development libraries not found])
+ fi
+ BACKEND_CFLAGS="$X_CFLAGS"
+ BACKEND_LIBS="$X_LIBS -lX11"
+ BACKEND_DEFS=""
+ LIBNAME="XCurses"
+ ;;
+ sdl1)
+ PKG_CHECK_MODULES([SDL], [sdl], [
+ BACKEND_CFLAGS="$SDL_CFLAGS"
+ BACKEND_LIBS="$SDL_LIBS"
+ ], [
+ BACKEND_CFLAGS=""
+ BACKEND_LIBS="-lSDL"
+ ])
+ BACKEND_DEFS=""
+ LIBNAME="SDLCurses"
+ ;;
+ sdl2)
+ PKG_CHECK_MODULES([SDL2], [sdl2], [
+ BACKEND_CFLAGS="$SDL2_CFLAGS"
+ BACKEND_LIBS="$SDL2_LIBS"
+ ], [
+ BACKEND_CFLAGS=""
+ BACKEND_LIBS="-lSDL2"
+ ])
+ BACKEND_DEFS=""
+ LIBNAME="SDL2Curses"
+ ;;
+ wincon)
+ BACKEND_CFLAGS=""
+ BACKEND_LIBS=""
+ BACKEND_DEFS=""
+ LIBNAME="pdcurses"
+ ;;
+ dos)
+ BACKEND_CFLAGS=""
+ BACKEND_LIBS=""
+ BACKEND_DEFS=""
+ LIBNAME="pdcurses"
+ ;;
+ os2)
+ BACKEND_CFLAGS=""
+ BACKEND_LIBS=""
+ BACKEND_DEFS=""
+ LIBNAME="pdcurses"
+ ;;
+ *)
+ AC_MSG_ERROR([Unknown backend: $BACKEND. Available: $AVAILABLE_BACKENDS])
+ ;;
+esac
+
+AC_SUBST(BACKEND)
+AC_SUBST(BACKEND_CFLAGS)
+AC_SUBST(BACKEND_LIBS)
+AC_SUBST(BACKEND_DEFS)
+AC_SUBST(LIBNAME)
+AC_SUBST(CONFIG_SCRIPT)
+
+echo "Selected backend: $BACKEND"
+echo "Available backends: $AVAILABLE_BACKENDS"
+
+dnl Set up conditionals for automake
+AM_CONDITIONAL([BACKEND_X11], [test "$BACKEND" = "x11"])
+AM_CONDITIONAL([BACKEND_SDL1], [test "$BACKEND" = "sdl1"])
+AM_CONDITIONAL([BACKEND_SDL2], [test "$BACKEND" = "sdl2"])
+AM_CONDITIONAL([BACKEND_WINCON], [test "$BACKEND" = "wincon"])
+AM_CONDITIONAL([BACKEND_DOS], [test "$BACKEND" = "dos"])
+AM_CONDITIONAL([BACKEND_OS2], [test "$BACKEND" = "os2"])
+
+dnl --------------- check for wide character support -----------------
+dnl allow --enable-widec to include wide character support
+AC_ARG_ENABLE(widec,
+ [ --enable-widec include support for wide characters],
+)
+PDC_WIDE=""
+if test "$enable_widec" = "yes"; then
+ case "$BACKEND" in
+ sdl1)
+ PDC_WIDE="-DPDC_WIDE"
+ BACKEND_LIBS="$BACKEND_LIBS -lSDL_ttf"
+ ;;
+ sdl2)
+ PDC_WIDE="-DPDC_WIDE"
+ BACKEND_LIBS="$BACKEND_LIBS -lSDL2_ttf"
+ ;;
+ x11|wincon|dos|os2)
+ PDC_WIDE="-DPDC_WIDE"
+ ;;
+ esac
+fi
+AC_SUBST(PDC_WIDE)
+
+dnl ------------------------ force UTF-8? ----------------------------
+dnl allow --enable-force-utf8 to override locale settings
+AC_ARG_ENABLE(force-utf8,
+ [ --enable-force-utf8 override locale settings; use UTF-8],
+)
+if test "$enable_force_utf8" = "yes"; then
+ SYS_DEFS="$SYS_DEFS -DPDC_FORCE_UTF8"
+fi
+
+dnl --------------------- check for Xaw3d library --------------------
+dnl allow --with-xaw3d to link with PDCurses (X11 only)
+if test "$BACKEND" = "x11" ; then
+ AC_ARG_WITH(xaw3d,
+ [ --with-xaw3d link with Xaw3d (X11 only)],
+ )
+ if test "$with_xaw3d" = "yes"; then
+ AC_DEFINE([USE_XAW3D], [1],
+ [Define if you want to use Xaw3d library]
+ )
+ fi
+
+ dnl --------------------- check for neXtaw library -------------------
+ dnl allow --with-nextaw to link with PDCurses (X11 only)
+ AC_ARG_WITH(nextaw,
+ [ --with-nextaw link with neXtaw (X11 only)],
+ )
+ if test "$with_nextaw" = "yes"; then
+ AC_DEFINE([USE_NEXTAW], [1],
+ [Define if you want to use neXtaw library]
+ )
+ fi
+fi
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+
+dnl Define config.h values based on backend
+case "$BACKEND" in
+ x11)
+ AC_DEFINE([XCURSES], [1], [Define if building X11 backend])
+ AC_DEFINE([HAVE_DECKEYSYM_H], [], [Define if you have the <DECkeySym.h> header file])
+ AC_DEFINE([HAVE_SUNKEYSYM_H], [], [Define if you have the <Sunkeysym.h> header file])
+ AC_DEFINE([HAVE_XPM_H], [], [Define if you have the <xpm.h> header file])
+ AC_DEFINE([XPOINTER_TYPEDEFED], [], [Define XPointer is typedefed in X11/Xlib.h])
+ ;;
+esac
diff -Nru PDCurses-3.9.orig/m4/.dummy PDCurses-3.9/m4/.dummy
--- PDCurses-3.9.orig/m4/.dummy 1970-01-01 01:00:00.000000000 +0100
+++ PDCurses-3.9/m4/.dummy 2025-06-10 22:30:57.006533239 +0200
@@ -0,0 +1 @@
+
diff -Nru PDCurses-3.9.orig/Makefile.am PDCurses-3.9/Makefile.am
--- PDCurses-3.9.orig/Makefile.am 1970-01-01 01:00:00.000000000 +0100
+++ PDCurses-3.9/Makefile.am 2025-06-10 22:27:56.504501215 +0200
@@ -0,0 +1,201 @@
+ACLOCAL_AMFLAGS = -I m4
+
+if BACKEND_X11
+lib_LTLIBRARIES = libXCurses.la
+endif
+
+if BACKEND_SDL1
+lib_LTLIBRARIES = libSDLCurses.la
+endif
+
+if BACKEND_SDL2
+lib_LTLIBRARIES = libSDL2Curses.la
+endif
+
+if BACKEND_WINCON
+lib_LTLIBRARIES = libpdcurses.la
+endif
+
+if BACKEND_DOS
+lib_LTLIBRARIES = libpdcurses.la
+endif
+
+if BACKEND_OS2
+lib_LTLIBRARIES = libpdcurses.la
+endif
+
+
+pdcurses_sources = \
+ pdcurses/addch.c \
+ pdcurses/addchstr.c \
+ pdcurses/addstr.c \
+ pdcurses/attr.c \
+ pdcurses/beep.c \
+ pdcurses/bkgd.c \
+ pdcurses/border.c \
+ pdcurses/clear.c \
+ pdcurses/color.c \
+ pdcurses/delch.c \
+ pdcurses/deleteln.c \
+ pdcurses/getch.c \
+ pdcurses/getstr.c \
+ pdcurses/getyx.c \
+ pdcurses/inch.c \
+ pdcurses/inchstr.c \
+ pdcurses/initscr.c \
+ pdcurses/inopts.c \
+ pdcurses/insch.c \
+ pdcurses/insstr.c \
+ pdcurses/instr.c \
+ pdcurses/kernel.c \
+ pdcurses/keyname.c \
+ pdcurses/mouse.c \
+ pdcurses/move.c \
+ pdcurses/outopts.c \
+ pdcurses/overlay.c \
+ pdcurses/pad.c \
+ pdcurses/panel.c \
+ pdcurses/printw.c \
+ pdcurses/refresh.c \
+ pdcurses/scanw.c \
+ pdcurses/scr_dump.c \
+ pdcurses/scroll.c \
+ pdcurses/slk.c \
+ pdcurses/termattr.c \
+ pdcurses/touch.c \
+ pdcurses/util.c \
+ pdcurses/window.c \
+ pdcurses/debug.c
+
+# Backend-specific source files
+x11_backend_sources = \
+ x11/pdcclip.c \
+ x11/pdcdisp.c \
+ x11/pdcgetsc.c \
+ x11/pdckbd.c \
+ x11/pdcscrn.c \
+ x11/pdcsetsc.c \
+ x11/pdcutil.c \
+ x11/ScrollBox.c \
+ x11/sb.c
+
+sdl1_backend_sources = \
+ sdl1/pdcclip.c \
+ sdl1/pdcdisp.c \
+ sdl1/pdcgetsc.c \
+ sdl1/pdckbd.c \
+ sdl1/pdcscrn.c \
+ sdl1/pdcsetsc.c \
+ sdl1/pdcutil.c
+
+sdl2_backend_sources = \
+ sdl2/pdcclip.c \
+ sdl2/pdcdisp.c \
+ sdl2/pdcgetsc.c \
+ sdl2/pdckbd.c \
+ sdl2/pdcscrn.c \
+ sdl2/pdcsetsc.c \
+ sdl2/pdcutil.c
+
+wincon_backend_sources = \
+ wincon/pdcclip.c \
+ wincon/pdcdisp.c \
+ wincon/pdcgetsc.c \
+ wincon/pdckbd.c \
+ wincon/pdcscrn.c \
+ wincon/pdcsetsc.c \
+ wincon/pdcutil.c
+
+dos_backend_sources = \
+ dos/pdcclip.c \
+ dos/pdcdisp.c \
+ dos/pdcgetsc.c \
+ dos/pdckbd.c \
+ dos/pdcscrn.c \
+ dos/pdcsetsc.c \
+ dos/pdcutil.c
+
+os2_backend_sources = \
+ os2/pdcclip.c \
+ os2/pdcdisp.c \
+ os2/pdcgetsc.c \
+ os2/pdckbd.c \
+ os2/pdcscrn.c \
+ os2/pdcsetsc.c \
+ os2/pdcutil.c
+
+# Library targets
+if BACKEND_X11
+libXCurses_la_SOURCES = $(pdcurses_sources) $(x11_backend_sources)
+libXCurses_la_CPPFLAGS = @BACKEND_DEFS@ @SYS_DEFS@ @BACKEND_CFLAGS@ @PDC_WIDE@ -I.
+libXCurses_la_LIBADD = @BACKEND_LIBS@
+libXCurses_la_LDFLAGS = -version-info 3:9:0 -no-undefined
+endif
+
+if BACKEND_SDL1
+libSDLCurses_la_SOURCES = $(pdcurses_sources) $(sdl1_backend_sources)
+libSDLCurses_la_CPPFLAGS = @BACKEND_DEFS@ @SYS_DEFS@ @BACKEND_CFLAGS@ @PDC_WIDE@ -I.
+libSDLCurses_la_LIBADD = @BACKEND_LIBS@
+libSDLCurses_la_LDFLAGS = -version-info 3:9:0 -no-undefined
+endif
+
+if BACKEND_SDL2
+libSDL2Curses_la_SOURCES = $(pdcurses_sources) $(sdl2_backend_sources)
+libSDL2Curses_la_CPPFLAGS = @BACKEND_DEFS@ @SYS_DEFS@ @BACKEND_CFLAGS@ @PDC_WIDE@ -I.
+libSDL2Curses_la_LIBADD = @BACKEND_LIBS@
+libSDL2Curses_la_LDFLAGS = -version-info 3:9:0 -no-undefined
+endif
+
+if BACKEND_WINCON
+libpdcurses_la_SOURCES = $(pdcurses_sources) $(wincon_backend_sources)
+libpdcurses_la_CPPFLAGS = @BACKEND_DEFS@ @SYS_DEFS@ @BACKEND_CFLAGS@ @PDC_WIDE@ -I. -DPDC_DLL_BUILD
+libpdcurses_la_LIBADD = @BACKEND_LIBS@
+libpdcurses_la_LDFLAGS = -version-info 3:9:0 -no-undefined
+endif
+
+if BACKEND_DOS
+libpdcurses_la_SOURCES = $(pdcurses_sources) $(dos_backend_sources)
+libpdcurses_la_CPPFLAGS = @BACKEND_DEFS@ @SYS_DEFS@ @BACKEND_CFLAGS@ @PDC_WIDE@ -I.
+libpdcurses_la_LIBADD = @BACKEND_LIBS@
+libpdcurses_la_LDFLAGS = -version-info 3:9:0 -no-undefined
+endif
+
+if BACKEND_OS2
+libpdcurses_la_SOURCES = $(pdcurses_sources) $(os2_backend_sources)
+libpdcurses_la_CPPFLAGS = @BACKEND_DEFS@ @SYS_DEFS@ @BACKEND_CFLAGS@ @PDC_WIDE@ -I.
+libpdcurses_la_LIBADD = @BACKEND_LIBS@
+libpdcurses_la_LDFLAGS = -version-info 3:9:0 -no-undefined
+endif
+
+# Headers to install (in subdirectory to avoid ncurses conflicts)
+pdcursesincludedir = $(includedir)/pdcurses
+pdcursesinclude_HEADERS = curses.h panel.h
+
+# Demo programs
+noinst_PROGRAMS = firework ozdemo ptest rain testcurs tuidemo worm xmas
+
+firework_SOURCES = demos/firework.c
+firework_LDADD = $(lib_LTLIBRARIES)
+
+ozdemo_SOURCES = demos/ozdemo.c
+ozdemo_LDADD = $(lib_LTLIBRARIES)
+
+ptest_SOURCES = demos/ptest.c
+ptest_LDADD = $(lib_LTLIBRARIES)
+
+rain_SOURCES = demos/rain.c
+rain_LDADD = $(lib_LTLIBRARIES)
+
+testcurs_SOURCES = demos/testcurs.c
+testcurs_LDADD = $(lib_LTLIBRARIES)
+
+tuidemo_SOURCES = demos/tuidemo.c demos/tui.c
+tuidemo_CPPFLAGS = -Idemos
+tuidemo_LDADD = $(lib_LTLIBRARIES)
+
+worm_SOURCES = demos/worm.c
+worm_LDADD = $(lib_LTLIBRARIES)
+
+xmas_SOURCES = demos/xmas.c
+xmas_LDADD = $(lib_LTLIBRARIES)
+
|