Commit d7577b4daa4abed3b7c24ef9f46d94fffb93057e

Thomas de Grivel 2023-11-16T14:44:38

wip window

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
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
diff --git a/.gitignore b/.gitignore
index a41ca42..0e12d77 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,6 +24,7 @@ ic3/ic3_cov
 ic3/ic3_debug
 *.la
 libc3/window/cairo/quartz/build
+libc3/window/cairo/quartz/demo/demo.xcodeproj/project.xcworkspace/xcuserdata
 libc3/window/cairo/xcb/demo/c3_window_cairo_xcb_demo
 libc3/window/cairo/xcb/demo/c3_window_cairo_xcb_demo_asan
 libc3/window/cairo/xcb/demo/c3_window_cairo_xcb_demo_cov
diff --git a/libc3/window/Makefile b/libc3/window/Makefile
index 2f1e261..0ceae7b 100644
--- a/libc3/window/Makefile
+++ b/libc3/window/Makefile
@@ -10,8 +10,8 @@
 ## AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
 ## THIS SOFTWARE.
 
-build: ${LIB}
 build:
+	${MAKE} ${LIB}
 	if ${HAVE_CAIRO}; then ${MAKE} -C cairo build; fi
 
 all:
@@ -20,8 +20,8 @@ all:
 	${MAKE} debug
 	if ${HAVE_ASAN}; then ${MAKE} asan; fi
 
-asan: ${LIB_ASAN}
 asan:
+	${MAKE} ${LIB_ASAN}
 	if ${HAVE_CAIRO}; then ${MAKE} -C cairo asan; fi
 
 clean:
@@ -30,16 +30,15 @@ clean:
 clean_cov:
 	if ${HAVE_CAIRO}; then ${MAKE} -C cairo clean_cov; fi
 
-cov: ${LIB_COV}
 cov:
+	${MAKE} ${LIB_COV}
 	if ${HAVE_CAIRO}; then ${MAKE} -C cairo cov; fi
 
-debug: ${LIB_DEBUG}
 debug:
+	${MAKE} ${LIB_DEBUG}
 	if ${HAVE_CAIRO}; then ${MAKE} -C cairo debug; fi
 
 demo: build
-demo:
 	if ${HAVE_CAIRO}; then ${MAKE} -C cairo demo; fi
 
 distclean:
@@ -49,7 +48,6 @@ gcovr:
 	if ${HAVE_CAIRO}; then ${MAKE} -C cairo gcovr; fi
 
 gdb_demo: debug
-gdb_demo:
 	if ${HAVE_CAIRO}; then ${MAKE} -C cairo gdb_demo; fi
 
 install:
diff --git a/libc3/window/cairo/Makefile b/libc3/window/cairo/Makefile
index 79cd361..19e2891 100644
--- a/libc3/window/cairo/Makefile
+++ b/libc3/window/cairo/Makefile
@@ -10,8 +10,8 @@
 ## AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
 ## THIS SOFTWARE.
 
-build: ${LIB}
 build:
+	${MAKE} ${LIB}
 	if ${HAVE_SWIFT}; then ${MAKE} -C quartz build; fi
 	if ${HAVE_XCB}; then ${MAKE} -C xcb build; fi
 
@@ -21,8 +21,8 @@ all:
 	${MAKE} debug
 	if ${HAVE_ASAN}; then ${MAKE} asan; fi
 
-asan: ${LIB_ASAN}
 asan:
+	${MAKE} ${LIB_ASAN}
 	if ${HAVE_SWIFT}; then ${MAKE} -C quartz asan; fi
 	if ${HAVE_XCB}; then ${MAKE} -C xcb asan; fi
 
@@ -34,18 +34,17 @@ clean_cov:
 	if ${HAVE_SWIFT}; then ${MAKE} -C quartz clean_cov; fi
 	if ${HAVE_XCB}; then ${MAKE} -C xcb clean_cov; fi
 
-cov: ${LIB_COV}
 cov:
+	${MAKE} ${LIB_COV}
 	if ${HAVE_SWIFT}; then ${MAKE} -C quartz cov; fi
 	if ${HAVE_XCB}; then ${MAKE} -C xcb cov; fi
 
-debug: ${LIB_DEBUG}
 debug:
+	${MAKE} ${LIB_DEBUG}
 	if ${HAVE_SWIFT}; then ${MAKE} -C quartz debug; fi
 	if ${HAVE_XCB}; then ${MAKE} -C xcb debug; fi
 
 demo: build
-demo:
 	if ${HAVE_SWIFT}; then ${MAKE} -C quartz demo; fi
 	if ${HAVE_XCB}; then ${MAKE} -C xcb demo; fi
 
@@ -58,7 +57,6 @@ gcovr:
 	if ${HAVE_XCB}; then ${MAKE} -C xcb gcovr; fi
 
 gdb_demo: debug
-gdb_demo:
 	if ${HAVE_SWIFT}; then ${MAKE} -C quartz gdb_demo; fi
 	if ${HAVE_XCB}; then ${MAKE} -C xcb gdb_demo; fi
 
diff --git a/libc3/window/cairo/quartz/configure b/libc3/window/cairo/quartz/configure
index 8a077f1..26cbf86 100755
--- a/libc3/window/cairo/quartz/configure
+++ b/libc3/window/cairo/quartz/configure
@@ -144,18 +144,26 @@ for SRC in $SOURCES; do
     echo "	${LIBTOOL} --tag=CC --mode=compile \${CC} \${CPPFLAGS} \${CFLAGS_DEBUG} -c $SRC -o $SRC_DEBUG_LO" >> ${CONFIG_MK}
 done
 
-for SRC in $SWIFT_SOURCES; do
-    echo >> ${CONFIG_MK}
-    SRC_LO="$(swift2ext .main.lo "$SRC")"
-    swift_ext_rule .main.lo "$SRC" >> ${CONFIG_MK}
-    echo "	\${SWIFTC} \${SWIFT_CFLAGS} -c $SRC -o $SRC_LO" >> ${CONFIG_MK}
-done
-
 for SRC in $OBJC_SOURCES; do
     echo >> ${CONFIG_MK}
     SRC_LO="$(objc2ext .main.lo "$SRC")"
     objc_ext_rule .main.lo "$SRC" >> ${CONFIG_MK}
     echo "	${LIBTOOL} --tag=CC --mode=compile \${OBJCC} \${CPPFLAGS} \${CFLAGS} -c $SRC -o $SRC_LO" >> ${CONFIG_MK}
+
+    echo >> ${CONFIG_MK}
+    SRC_LO="$(objc2ext .asan.lo "$SRC")"
+    objc_ext_rule .asan.lo "$SRC" >> ${CONFIG_MK}
+    echo "	${LIBTOOL} --tag=CC --mode=compile \${OBJCC} \${CPPFLAGS} \${CFLAGS_ASAN} -c $SRC -o $SRC_LO" >> ${CONFIG_MK}
+
+    echo >> ${CONFIG_MK}
+    SRC_LO="$(objc2ext .cov.lo "$SRC")"
+    objc_ext_rule .cov.lo "$SRC" >> ${CONFIG_MK}
+    echo "	${LIBTOOL} --tag=CC --mode=compile \${OBJCC} \${CPPFLAGS} \${CFLAGS_COV} -c $SRC -o $SRC_LO" >> ${CONFIG_MK}
+
+    echo >> ${CONFIG_MK}
+    SRC_LO="$(objc2ext .debug.lo "$SRC")"
+    objc_ext_rule .debug.lo "$SRC" >> ${CONFIG_MK}
+    echo "	${LIBTOOL} --tag=CC --mode=compile \${OBJCC} \${CPPFLAGS} \${CFLAGS_DEBUG} -c $SRC -o $SRC_LO" >> ${CONFIG_MK}
 done
 
 update_config_mk
diff --git a/libc3/window/cairo/quartz/demo/Makefile b/libc3/window/cairo/quartz/demo/Makefile
index a139248..df12f45 100644
--- a/libc3/window/cairo/quartz/demo/Makefile
+++ b/libc3/window/cairo/quartz/demo/Makefile
@@ -10,18 +10,17 @@
 ## AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
 ## THIS SOFTWARE.
 
-include config.mk
-include sources.mk
-
-CLEANFILES = *.a ${PROG} ${PROG_ASAN} ${PROG_COV} ${PROG_DEBUG} *.css \
-	*.gcno *.html *.o .libs *.lo
+CLEANFILES = *.a ${APP_PROG} ${APP_PROG_ASAN} ${APP_PROG_COV} \
+	${APP_PROG_DEBUG} ${PROG} ${PROG_ASAN} ${PROG_COV} ${PROG_DEBUG} \
+	*.css *.gcno *.html *.o .libs *.lo
 
 CLEANFILES_COV = *.css *.gcda *.html .libs/*.gcda
 CLEANFILES += ${CLEANFILES_COV}
 
 DISTCLEANFILES = ${CLEANFILES} config.mk
 
-build: ${PROG}
+build:
+	${MAKE} ${APP_PROG}
 
 all:
 	${MAKE} build
@@ -29,7 +28,8 @@ all:
 	${MAKE} debug
 	if ${HAVE_ASAN}; then ${MAKE} asan; fi
 
-asan: ${PROG_ASAN}
+asan:
+	${MAKE} ${APP_PROG_ASAN}
 
 clean:
 	rm -rf ${CLEANFILES}
@@ -37,12 +37,14 @@ clean:
 clean_cov:
 	rm -rf ${CLEANFILES_COV}
 
-cov:   ${PROG_COV}
+cov:
+	${MAKE} ${APP_PROG_COV}
 
-debug: ${PROG_DEBUG}
+debug:
+	${MAKE} ${APP_PROG_DEBUG}
 
-demo: ${PROG}
-	time ./${PROG}
+demo: ${APP_PROG}
+	time open ${APP}
 
 distclean:
 	rm -rf ${DISTCLEANFILES}
@@ -59,6 +61,7 @@ install:
 
 .PHONY: \
 	all \
+	${APP_PROG} \
 	asan \
 	clean \
 	clean_cov \
@@ -67,3 +70,6 @@ install:
 	demo \
 	distclean \
 	gdb_demo
+
+include config.mk
+include sources.mk
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/Info.plist b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/Info.plist
index 26b8759..e17dd6f 100644
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/Info.plist
+++ b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/Info.plist
@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
-  <dict>
-    <key>CFBundleExecutable</key>
-    <string>c3_window_cairo_quartz_demo</string>
-    <key>CFBundleIconFile</key>
-    <string>c3</string> <!-- No extension needed -->
-    <key>CFBundleIdentifier</key>
-    <string>io.kmx.c3-window-cairo-quartz-demo</string>
-  </dict>
+<dict>
+	<key>CFBundleExecutable</key>
+	<string>c3_window_cairo_quartz_demo</string>
+	<key>CFBundleIconFile</key>
+	<string>c3</string>
+	<key>CFBundleIdentifier</key>
+	<string>io.kmx.c3-window-cairo-quartz-demo</string>
+</dict>
 </plist>
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/MacOS/c3_window_cairo_quartz_demo b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/MacOS/c3_window_cairo_quartz_demo
index f464801..ce05762 100755
Binary files a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/MacOS/c3_window_cairo_quartz_demo and b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/MacOS/c3_window_cairo_quartz_demo differ
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_asan.app/Contents/Info.plist b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_asan.app/Contents/Info.plist
new file mode 100644
index 0000000..bf9ee0e
--- /dev/null
+++ b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_asan.app/Contents/Info.plist
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleExecutable</key>
+	<string>c3_window_cairo_quartz_demo_asan</string>
+	<key>CFBundleIconFile</key>
+	<string>c3</string>
+	<key>CFBundleIdentifier</key>
+	<string>io.kmx.c3-window-cairo-quartz-demo-asan</string>
+</dict>
+</plist>
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_asan.app/Contents/Resources/c3.icns b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_asan.app/Contents/Resources/c3.icns
new file mode 100644
index 0000000..377277a
Binary files /dev/null and b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_asan.app/Contents/Resources/c3.icns differ
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_cov.app/Contents/Info.plist b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_cov.app/Contents/Info.plist
new file mode 100644
index 0000000..bd1c234
--- /dev/null
+++ b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_cov.app/Contents/Info.plist
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleExecutable</key>
+	<string>c3_window_cairo_quartz_demo_cov</string>
+	<key>CFBundleIconFile</key>
+	<string>c3</string>
+	<key>CFBundleIdentifier</key>
+	<string>io.kmx.c3-window-cairo-quartz-demo-cov</string>
+</dict>
+</plist>
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_cov.app/Contents/Resources/c3_window_cairo_quartz_demo.icns b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_cov.app/Contents/Resources/c3_window_cairo_quartz_demo.icns
new file mode 100644
index 0000000..377277a
Binary files /dev/null and b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_cov.app/Contents/Resources/c3_window_cairo_quartz_demo.icns differ
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug
new file mode 100755
index 0000000..7687f06
--- /dev/null
+++ b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug
@@ -0,0 +1,210 @@
+#! /bin/sh
+
+# c3_window_cairo_quartz_demo_debug - temporary wrapper script for .libs/c3_window_cairo_quartz_demo_debug
+# Generated by libtool (GNU libtool) 2.4.7
+#
+# The c3_window_cairo_quartz_demo_debug program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=""
+
+# This environment variable determines our operation mode.
+if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
+  # install mode needs the following variables:
+  generated_by_libtool_version='2.4.7'
+  notinst_deplibs=' ../libc3_window_cairo_quartz_debug.la /Users/thodg/c/thodg/c3-lang/c3/libc3/window/cairo/libc3_window_cairo_debug.la /Users/thodg/c/thodg/c3-lang/c3/libc3/window/libc3_window_debug.la /Users/thodg/c/thodg/c3-lang/c3/libc3/libc3_debug.la /Users/thodg/c/thodg/c3-lang/c3/libffi/libffi.la'
+else
+  # When we are sourced in execute mode, $file and $ECHO are already set.
+  if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
+    file="$0"
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+    ECHO="printf %s\\n"
+  fi
+
+# Very basic option parsing. These options are (a) specific to
+# the libtool wrapper, (b) are identical between the wrapper
+# /script/ and the wrapper /executable/ that is used only on
+# windows platforms, and (c) all begin with the string --lt-
+# (application programs are unlikely to have options that match
+# this pattern).
+#
+# There are only two supported options: --lt-debug and
+# --lt-dump-script. There is, deliberately, no --lt-help.
+#
+# The first argument to this parsing function should be the
+# script's /opt/homebrew/bin/glibtool value, followed by no.
+lt_option_debug=
+func_parse_lt_options ()
+{
+  lt_script_arg0=$0
+  shift
+  for lt_opt
+  do
+    case "$lt_opt" in
+    --lt-debug) lt_option_debug=1 ;;
+    --lt-dump-script)
+        lt_dump_D=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%/[^/]*$%%'`
+        test "X$lt_dump_D" = "X$lt_script_arg0" && lt_dump_D=.
+        lt_dump_F=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%^.*/%%'`
+        cat "$lt_dump_D/$lt_dump_F"
+        exit 0
+      ;;
+    --lt-*)
+        $ECHO "Unrecognized --lt- option: '$lt_opt'" 1>&2
+        exit 1
+      ;;
+    esac
+  done
+
+  # Print the debug banner immediately:
+  if test -n "$lt_option_debug"; then
+    echo "c3_window_cairo_quartz_demo_debug:c3_window_cairo_quartz_demo_debug:$LINENO: libtool wrapper (GNU libtool) 2.4.7" 1>&2
+  fi
+}
+
+# Used when --lt-debug. Prints its arguments to stdout
+# (redirection is the responsibility of the caller)
+func_lt_dump_args ()
+{
+  lt_dump_args_N=1;
+  for lt_arg
+  do
+    $ECHO "c3_window_cairo_quartz_demo_debug:c3_window_cairo_quartz_demo_debug:$LINENO: newargv[$lt_dump_args_N]: $lt_arg"
+    lt_dump_args_N=`expr $lt_dump_args_N + 1`
+  done
+}
+
+# Core function for launching the target application
+func_exec_program_core ()
+{
+
+      if test -n "$lt_option_debug"; then
+        $ECHO "c3_window_cairo_quartz_demo_debug:c3_window_cairo_quartz_demo_debug:$LINENO: newargv[0]: $progdir/$program" 1>&2
+        func_lt_dump_args ${1+"$@"} 1>&2
+      fi
+      exec "$progdir/$program" ${1+"$@"}
+
+      $ECHO "$0: cannot exec $program $*" 1>&2
+      exit 1
+}
+
+# A function to encapsulate launching the target application
+# Strips options in the --lt-* namespace from $@ and
+# launches target application with the remaining arguments.
+func_exec_program ()
+{
+  case " $* " in
+  *\ --lt-*)
+    for lt_wr_arg
+    do
+      case $lt_wr_arg in
+      --lt-*) ;;
+      *) set x "$@" "$lt_wr_arg"; shift;;
+      esac
+      shift
+    done ;;
+  esac
+  func_exec_program_core ${1+"$@"}
+}
+
+  # Parse options
+  func_parse_lt_options "$0" ${1+"$@"}
+
+  # Find the directory that this script lives in.
+  thisdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'`
+  test "x$thisdir" = "x$file" && thisdir=.
+
+  # Follow symbolic links until we get to the real thisdir.
+  file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'`
+  while test -n "$file"; do
+    destdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'`
+
+    # If there was a directory component, then change thisdir.
+    if test "x$destdir" != "x$file"; then
+      case "$destdir" in
+      [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
+      *) thisdir="$thisdir/$destdir" ;;
+      esac
+    fi
+
+    file=`$ECHO "$file" | /usr/bin/sed 's%^.*/%%'`
+    file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'`
+  done
+
+  # Usually 'no', except on cygwin/mingw when embedded into
+  # the cwrapper.
+  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no
+  if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then
+    # special case for '.'
+    if test "$thisdir" = "."; then
+      thisdir=`pwd`
+    fi
+    # remove .libs from thisdir
+    case "$thisdir" in
+    *[\\/].libs ) thisdir=`$ECHO "$thisdir" | /usr/bin/sed 's%[\\/][^\\/]*$%%'` ;;
+    .libs )   thisdir=. ;;
+    esac
+  fi
+
+  # Try to get the absolute directory name.
+  absdir=`cd "$thisdir" && pwd`
+  test -n "$absdir" && thisdir="$absdir"
+
+  program='c3_window_cairo_quartz_demo_debug'
+  progdir="$thisdir/.libs"
+
+
+  if test -f "$progdir/$program"; then
+    # Add our own library path to DYLD_LIBRARY_PATH
+    DYLD_LIBRARY_PATH="/Users/thodg/c/thodg/c3-lang/c3/libc3/window/cairo/quartz/.libs:/Users/thodg/c/thodg/c3-lang/c3/libc3/window/cairo/.libs:/Users/thodg/c/thodg/c3-lang/c3/libc3/window/.libs:/Users/thodg/c/thodg/c3-lang/c3/libc3/.libs:/Users/thodg/c/thodg/c3-lang/c3/libffi/.libs:$DYLD_LIBRARY_PATH"
+
+    # Some systems cannot cope with colon-terminated DYLD_LIBRARY_PATH
+    # The second colon is a workaround for a bug in BeOS R4 sed
+    DYLD_LIBRARY_PATH=`$ECHO "$DYLD_LIBRARY_PATH" | /usr/bin/sed 's/::*$//'`
+
+    export DYLD_LIBRARY_PATH
+
+    if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
+      # Run the actual program with our arguments.
+      func_exec_program ${1+"$@"}
+    fi
+  else
+    # The program doesn't exist.
+    $ECHO "$0: error: '$progdir/$program' does not exist" 1>&2
+    $ECHO "This script is just a wrapper for $program." 1>&2
+    $ECHO "See the libtool documentation for more information." 1>&2
+    exit 1
+  fi
+fi
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/Info.plist b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/Info.plist
new file mode 100644
index 0000000..853f6b8
--- /dev/null
+++ b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/Info.plist
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleExecutable</key>
+	<string>c3_window_cairo_quartz_demo_debug</string>
+	<key>CFBundleIconFile</key>
+	<string>c3</string>
+	<key>CFBundleIdentifier</key>
+	<string>io.kmx.c3-window-cairo-quartz-demo-debug</string>
+</dict>
+</plist>
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/MacOS/c3_window_cairo_quartz_demo_debug b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/MacOS/c3_window_cairo_quartz_demo_debug
new file mode 100755
index 0000000..f1564ac
Binary files /dev/null and b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/MacOS/c3_window_cairo_quartz_demo_debug differ
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/Resources/c3.icns b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/Resources/c3.icns
new file mode 100644
index 0000000..377277a
Binary files /dev/null and b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/Resources/c3.icns differ
diff --git a/libc3/window/cairo/quartz/demo/configure b/libc3/window/cairo/quartz/demo/configure
index 79ccc89..cfe9417 100755
--- a/libc3/window/cairo/quartz/demo/configure
+++ b/libc3/window/cairo/quartz/demo/configure
@@ -17,10 +17,10 @@ export SRC_TOP="$(dirname "$PWD")"
 
 . ../../../../../config.subr
 
-PROG=c3_window_cairo_quartz_demo.app/Contents/MacOS/c3_window_cairo_quartz_demo
-PROG_ASAN=c3_window_cairo_quartz_demo.app/Contents/MacOS/c3_window_cairo_quartz_demo_asan
-PROG_COV=c3_window_cairo_quartz_demo.app/Contents/MacOS/c3_window_cairo_quartz_demo_cov
-PROG_DEBUG=c3_window_cairo_quartz_demo.app/Contents/MacOS/c3_window_cairo_quartz_demo_debug
+PROG=c3_window_cairo_quartz_demo
+PROG_ASAN=c3_window_cairo_quartz_demo_asan
+PROG_COV=c3_window_cairo_quartz_demo_cov
+PROG_DEBUG=c3_window_cairo_quartz_demo_debug
 
 echo "PROG = $PROG" >> ${CONFIG_MK}
 echo "PROG_ASAN = $PROG_ASAN" >> ${CONFIG_MK}
@@ -32,6 +32,21 @@ APP_ASAN=c3_window_cairo_quartz_demo_asan.app
 APP_COV=c3_window_cairo_quartz_demo_cov.app
 APP_DEBUG=c3_window_cairo_quartz_demo_debug.app
 
+echo "APP = $APP" >> ${CONFIG_MK}
+echo "APP_ASAN = $APP_ASAN" >> ${CONFIG_MK}
+echo "APP_COV = $APP_COV" >> ${CONFIG_MK}
+echo "APP_DEBUG = $APP_DEBUG" >> ${CONFIG_MK}
+
+APP_PROG=${APP}/Contents/MacOS/${PROG}
+APP_PROG_ASAN=${APP_ASAN}/Contents/MacOS/${PROG_ASAN}
+APP_PROG_COV=${APP_COV}/Contents/MacOS/${PROG_COV}
+APP_PROG_DEBUG=${APP_DEBUG}/Contents/MacOS/${PROG_DEBUG}
+
+echo "APP_PROG = $APP_PROG" >> ${CONFIG_MK}
+echo "APP_PROG_ASAN = $APP_PROG_ASAN" >> ${CONFIG_MK}
+echo "APP_PROG_COV = $APP_PROG_COV" >> ${CONFIG_MK}
+echo "APP_PROG_DEBUG = $APP_PROG_DEBUG" >> ${CONFIG_MK}
+
 . ./sources.sh
 
 OBJECTS="$(c2ext .main.lo "$SOURCES")"
@@ -166,4 +181,20 @@ for SRC in $OBJC_SOURCES; do
     echo "	${LIBTOOL} --tag=OBJCC --mode=compile \${OBJCC} \${CFLAGS} -c $SRC -o $SRC_LO" >> ${CONFIG_MK}
 done
 
+echo >> ${CONFIG_MK}
+echo "${APP_PROG}: ${PROG}" >> ${CONFIG_MK}
+echo "	cp .libs/${PROG} ${APP_PROG}" >> ${CONFIG_MK}
+
+echo >> ${CONFIG_MK}
+echo "${APP_PROG_ASAN}: ${PROG_ASAN}" >> ${CONFIG_MK}
+echo "	cp .libs/${PROG_ASAN} ${APP_PROG_ASAN}" >> ${CONFIG_MK}
+
+echo >> ${CONFIG_MK}
+echo "${APP_PROG_COV}: ${PROG_COV}" >> ${CONFIG_MK}
+echo "	cp .libs/${PROG_COV} ${APP_PROG_COV}" >> ${CONFIG_MK}
+
+echo >> ${CONFIG_MK}
+echo "${APP_PROG_DEBUG}: ${PROG_DEBUG}" >> ${CONFIG_MK}
+echo "	cp .libs/${PROG_DEBUG} ${APP_PROG_DEBUG}" >> ${CONFIG_MK}
+
 update_config_mk
diff --git a/libc3/window/cairo/quartz/demo/demo.xcodeproj/project.xcworkspace/xcuserdata/thodg.xcuserdatad/UserInterfaceState.xcuserstate b/libc3/window/cairo/quartz/demo/demo.xcodeproj/project.xcworkspace/xcuserdata/thodg.xcuserdatad/UserInterfaceState.xcuserstate
deleted file mode 100644
index b269ef9..0000000
Binary files a/libc3/window/cairo/quartz/demo/demo.xcodeproj/project.xcworkspace/xcuserdata/thodg.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ