summaryrefslogtreecommitdiff
path: root/debian/patches/debian-changes
blob: 6b9ddd4b8748d9bee59ff8263f7e1f736567b077 (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
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
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
Combined patches from git.
--- /dev/null
+++ fltk1.1-1.1.10/.gitignore
@@ -0,0 +1,98 @@
+.pc
+FL/Makefile
+config.*
+documentation/*.[0-9]
+documentation/fltk.p*
+fltk-config
+fltk-config.unhardened
+fltk.list
+fluid/fluid
+fluid/fluid-shared
+lib/lib*.a
+makeinclude
+src/lib*.so*
+test/CubeView
+test/CubeViewUI.cxx
+test/CubeViewUI.h
+test/adjuster
+test/arc
+test/ask
+test/bitmap
+test/blocks
+test/boxtype
+test/browser
+test/button
+test/buttons
+test/checkers
+test/clock
+test/colbrowser
+test/color_chooser
+test/cube
+test/cursor
+test/curve
+test/demo
+test/doublebuffer
+test/editor
+test/fast_slow
+test/fast_slow.cxx
+test/fast_slow.h
+test/file_chooser
+test/fonts
+test/forms
+test/fractals
+test/fullscreen
+test/gl_overlay
+test/glpuzzle
+test/hello
+test/help
+test/iconize
+test/image
+test/inactive
+test/inactive.cxx
+test/inactive.h
+test/input
+test/input_choice
+test/keyboard
+test/keyboard_ui.cxx
+test/keyboard_ui.h
+test/label
+test/line_style
+test/list_visuals
+test/mandelbrot
+test/mandelbrot_ui.cxx
+test/mandelbrot_ui.h
+test/menubar
+test/message
+test/minimum
+test/navigation
+test/output
+test/overlay
+test/pack
+test/pixmap
+test/pixmap_browser
+test/preferences
+test/preferences.cxx
+test/preferences.h
+test/radio
+test/radio.cxx
+test/radio.h
+test/resize
+test/resize.cxx
+test/resize.h
+test/resizebox
+test/scroll
+test/shape
+test/subwindow
+test/sudoku
+test/symbols
+test/tabs
+test/tabs.cxx
+test/tabs.h
+test/threads
+test/tile
+test/tiled_image
+test/unittests
+test/valuators
+test/valuators.cxx
+test/valuators.h
+*/*.o
--- fltk1.1-1.1.10.orig/FL/forms.H
+++ fltk1.1-1.1.10/FL/forms.H
@@ -651,7 +651,7 @@ inline int fl_show_question(const char*
 FL_EXPORT void fl_show_message(const char *,const char *,const char *);
 FL_EXPORT void fl_show_alert(const char *,const char *,const char *,int=0);
 FL_EXPORT int fl_show_question(const char *,const char *,const char *);
-inline const char *fl_show_input(const char *l,const char*d=0) {return fl_input(l,d);}
+inline const char *fl_show_input(const char *l,const char*d=0) {return fl_input("%s",l,d);}
 FL_EXPORT /*const*/ char *fl_show_simple_input(const char *label, const char *deflt = 0);
 FL_EXPORT int fl_show_choice(
     const char *m1,
--- fltk1.1-1.1.10.orig/FL/x.H
+++ fltk1.1-1.1.10/FL/x.H
@@ -65,10 +65,30 @@ extern FL_EXPORT int fl_screen;
 extern FL_EXPORT XVisualInfo *fl_visual;
 extern FL_EXPORT Colormap fl_colormap;
 
+// access to core fonts
+FL_EXPORT XFontStruct* fl_xxfont();
+class Fl_XFont_On_Demand
+{
+public:
+  Fl_XFont_On_Demand(XFontStruct* p = NULL) : ptr(p) { }
+  Fl_XFont_On_Demand& operator=(const Fl_XFont_On_Demand& x)
+    { ptr = x.ptr;  return *this; }
+  Fl_XFont_On_Demand& operator=(XFontStruct* p)
+    { ptr = p;  return *this; }
+  XFontStruct* value() { if (!ptr) { ptr = fl_xxfont(); }  return ptr; }
+  operator XFontStruct*() { return value(); }
+  XFontStruct& operator*() { return *value(); }
+  XFontStruct* operator->() { return value(); }
+  bool operator==(const Fl_XFont_On_Demand& x) { return ptr == x.ptr; }
+  bool operator!=(const Fl_XFont_On_Demand& x) { return ptr != x.ptr; }
+private:
+  XFontStruct* ptr;
+};
+extern FL_EXPORT Fl_XFont_On_Demand fl_xfont;
+
 // drawing functions:
 extern FL_EXPORT GC fl_gc;
 extern FL_EXPORT Window fl_window;
-extern FL_EXPORT XFontStruct* fl_xfont;
 extern FL_EXPORT void *fl_xftfont;
 FL_EXPORT ulong fl_xpixel(Fl_Color i);
 FL_EXPORT ulong fl_xpixel(uchar r, uchar g, uchar b);
--- fltk1.1-1.1.10.orig/Makefile
+++ fltk1.1-1.1.10/Makefile
@@ -110,8 +110,8 @@ makeinclude: configure configh.in makein
 	touch config.h
 	chmod +x fltk-config
 
-configure: configure.in
-	autoconf
+# configure: configure.in
+# 	autoconf
 
 portable-dist:
 	epm -v -s fltk.xpm fltk
--- fltk1.1-1.1.10.orig/configure
+++ fltk1.1-1.1.10/configure
@@ -1957,10 +1957,10 @@ if test x$enable_shared = xyes; then
             FLDSONAME="libfltk_forms.so.$FL_API_VERSION"
             GLDSONAME="libfltk_gl.so.$FL_API_VERSION"
             IMGDSONAME="libfltk_images.so.$FL_API_VERSION"
-            DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-soname,\$@ \$(LDLIBS) -shared -fPIC $DEBUGFLAG -o"
-	    if test "x$libdir" != "x/usr/lib"; then
-		    DSOLINK="-Wl,-rpath,$libdir"
-            fi
+            DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-soname,\$@ -shared -fPIC $DEBUGFLAG -o"
+#	    if test "x$libdir" != "x/usr/lib"; then
+#		    DSOLINK="-Wl,-rpath,$libdir"
+#           fi
 	    ;;
 	AIX*)
             DSONAME="libfltk_s.a"
@@ -7926,6 +7926,7 @@ _ACEOF
 fi
 
 
+SAVELIBS=$LIBS
 { echo "$as_me:$LINENO: checking for library containing dlsym" >&5
 echo $ECHO_N "checking for library containing dlsym... $ECHO_C" >&6; }
 if test "${ac_cv_search_dlsym+set}" = set; then
@@ -8145,6 +8146,7 @@ _ACEOF
 fi
 
 
+LIBS=$SAVELIBS
 
 AUDIOLIBS=""
 
@@ -8771,8 +8773,8 @@ echo "$as_me: WARNING: Cannot find syste
 else
     ZLIBINC=""
     ZLIB=""
-    LIBS="-lz $LIBS"
-    IMAGELIBS="-lz $IMAGELIBS"
+    # LIBS="-lz $LIBS"
+    # IMAGELIBS="-lz $IMAGELIBS"
     STATICIMAGELIBS="-lz $STATICIMAGELIBS"
     cat >>confdefs.h <<\_ACEOF
 #define HAVE_LIBZ 1
@@ -9521,6 +9523,7 @@ _ACEOF
 		break
 	    fi
 	done
+	LIBS=$SAVELIBS
     fi
 fi
 
@@ -11233,7 +11236,7 @@ echo "$as_me: error: Configure could not
 echo "$as_me: WARNING: Ignoring libraries \"$X_PRE_LIBS\" requested by configure." >&2;}
 	fi
 
-	LIBS="$LIBS -lXext -lX11 $X_EXTRA_LIBS"
+	LIBS="$LIBS -lX11 $X_EXTRA_LIBS"
 	CFLAGS="$CFLAGS $X_CFLAGS"
 	CXXFLAGS="$CXXFLAGS $X_CFLAGS"
 	LDFLAGS="$X_LIBS $LDFLAGS"
@@ -11794,12 +11797,12 @@ if test $ac_cv_header_GL_glu_h = yes; th
 #define HAVE_GL_GLU_H 1
 _ACEOF
 
-		if test x$ac_cv_lib_GL_glXMakeCurrent = xyes; then
-		    GLLIB="-lGLU $GLLIB"
-		fi
-		if test x$ac_cv_lib_MesaGL_glXMakeCurrent = xyes; then
-		    GLLIB="-lMesaGLU $GLLIB"
-		fi
+		# if test x$ac_cv_lib_GL_glXMakeCurrent = xyes; then
+		#     GLLIB="-lGLU $GLLIB"
+		# fi
+		# if test x$ac_cv_lib_MesaGL_glXMakeCurrent = xyes; then
+		#     GLLIB="-lMesaGLU $GLLIB"
+		# fi
 
 fi
 
@@ -12080,7 +12083,7 @@ if test "${ac_cv_lib_Xft_XftDrawCreate+s
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXft  $LIBS"
+LIBS="-lXft -lfontconfig $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -12140,7 +12143,7 @@ if test $ac_cv_lib_Xft_XftDrawCreate = y
 #define USE_XFT 1
 _ACEOF
 
-			LIBS="-lXft $LIBS"
+			LIBS="-lXft -lfontconfig $LIBS"
 fi
 
 fi
@@ -12658,7 +12661,7 @@ _ACEOF
 
 else
     cat >>confdefs.h <<_ACEOF
-#define FLTK_DOCDIR "$prefix/share/doc/fltk"
+#define FLTK_DOCDIR "$prefix/share/doc/fltk1.1-doc/HTML"
 _ACEOF
 
 fi
--- fltk1.1-1.1.10.orig/configure.in
+++ fltk1.1-1.1.10/configure.in
@@ -202,10 +202,10 @@ if test x$enable_shared = xyes; then
             FLDSONAME="libfltk_forms.so.$FL_API_VERSION"
             GLDSONAME="libfltk_gl.so.$FL_API_VERSION"
             IMGDSONAME="libfltk_images.so.$FL_API_VERSION"
-            DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-soname,\$@ \$(LDLIBS) -shared -fPIC $DEBUGFLAG -o"
-	    if test "x$libdir" != "x/usr/lib"; then
-		    DSOLINK="-Wl,-rpath,$libdir"
-            fi
+            DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-soname,\$@ -shared -fPIC $DEBUGFLAG -o"
+#	    if test "x$libdir" != "x/usr/lib"; then
+#		    DSOLINK="-Wl,-rpath,$libdir"
+#           fi
 	    ;;
 	AIX*)
             DSONAME="libfltk_s.a"
@@ -496,8 +496,10 @@ fi
 AC_CHECK_FUNC(strtoll, AC_DEFINE(HAVE_STRTOLL))
 
 dnl Check for dlopen/dlsym...
+SAVELIBS=$LIBS
 AC_SEARCH_LIBS(dlsym, dl, AC_DEFINE(HAVE_DLSYM))
 AC_CHECK_HEADER(dlfcn.h, AC_DEFINE(HAVE_DLFCN_H))
+LIBS=$SAVELIBS
 
 dnl Check for audio libraries...
 AUDIOLIBS=""
@@ -595,8 +597,8 @@ if test x$enable_localzlib = xyes -o x$s
 else
     ZLIBINC=""
     ZLIB=""
-    LIBS="-lz $LIBS"
-    IMAGELIBS="-lz $IMAGELIBS"
+    # LIBS="-lz $LIBS"
+    # IMAGELIBS="-lz $IMAGELIBS"
     STATICIMAGELIBS="-lz $STATICIMAGELIBS"
     AC_DEFINE(HAVE_LIBZ)
 fi
@@ -691,6 +693,7 @@ if test "x$enable_threads" = xyes; then
 		break
 	    fi
 	done
+	LIBS=$SAVELIBS
     fi
 fi
 
@@ -806,7 +809,7 @@ case $uname in
 	    AC_MSG_WARN(Ignoring libraries \"$X_PRE_LIBS\" requested by configure.)
 	fi
 
-	LIBS="$LIBS -lXext -lX11 $X_EXTRA_LIBS"
+	LIBS="$LIBS -lX11 $X_EXTRA_LIBS"
 	CFLAGS="$CFLAGS $X_CFLAGS"
 	CXXFLAGS="$CXXFLAGS $X_CFLAGS"
 	LDFLAGS="$X_LIBS $LDFLAGS"
@@ -831,12 +834,12 @@ case $uname in
 	    )
 	    AC_CHECK_HEADER(GL/glu.h,
         	AC_DEFINE(HAVE_GL_GLU_H)
-		if test x$ac_cv_lib_GL_glXMakeCurrent = xyes; then
-		    GLLIB="-lGLU $GLLIB"
-		fi
-		if test x$ac_cv_lib_MesaGL_glXMakeCurrent = xyes; then
-		    GLLIB="-lMesaGLU $GLLIB"
-		fi
+		# if test x$ac_cv_lib_GL_glXMakeCurrent = xyes; then
+		#     GLLIB="-lGLU $GLLIB"
+		# fi
+		# if test x$ac_cv_lib_MesaGL_glXMakeCurrent = xyes; then
+		#     GLLIB="-lMesaGLU $GLLIB"
+		# fi
 	    )
 
 	    if test x$ac_cv_lib_GL_glXMakeCurrent != xyes -a x$ac_cv_lib_MesaGL_glXMakeCurrent != xyes; then
@@ -874,7 +877,7 @@ case $uname in
 		AC_CHECK_HEADER(X11/Xft/Xft.h,
 		    AC_CHECK_LIB(Xft, XftDrawCreate,
 	        	AC_DEFINE(USE_XFT)
-			LIBS="-lXft $LIBS"))
+			LIBS="-lXft -lfontconfig $LIBS", [], -lfontconfig))
 	    fi
 	fi
 
@@ -1163,7 +1166,7 @@ dnl Define the FLTK documentation direct
 if test x$prefix = xNONE; then
     AC_DEFINE_UNQUOTED(FLTK_DOCDIR, "/usr/local/share/doc/fltk")
 else
-    AC_DEFINE_UNQUOTED(FLTK_DOCDIR, "$prefix/share/doc/fltk")
+    AC_DEFINE_UNQUOTED(FLTK_DOCDIR, "$prefix/share/doc/fltk1.1-doc/HTML")
 fi
 
 dnl Define the FLTK data directory...
--- fltk1.1-1.1.10.orig/documentation/Makefile
+++ fltk1.1-1.1.10/documentation/Makefile
@@ -232,9 +232,9 @@ depend:
 
 install: $(MANPAGES)
 	echo "Installing documentation files in $(DESTDIR)$(docdir)..."
-	-$(INSTALL_DIR) $(DESTDIR)$(docdir)
+	-$(INSTALL_DIR) $(DESTDIR)$(docdir)/HTML
 	for file in $(HTMLFILES) $(IMAGEFILES) index.html; do \
-		$(INSTALL_DATA) $$file $(DESTDIR)$(docdir); \
+		$(INSTALL_DATA) $$file $(DESTDIR)$(docdir)/HTML; \
 	done
 	echo "Installing man pages in $(DESTDIR)$(mandir)..."
 	-$(INSTALL_DIR) $(DESTDIR)$(mandir)/cat1
@@ -284,15 +284,22 @@ fltk.d/index.html: $(HTMLFILES) $(IMAGEF
 	-$(INSTALL_DIR) fltk.d
 	-$(HTMLDOC) --verbose --batch fltk.book -d fltk.d -t html
 
+DEB_DATE := $(shell cd .. && dpkg-parsechangelog -S Date)
+PDF_DATE := $(shell date -ud '$(DEB_DATE)' +D:%Y%m%d%H%M%SZ)
+
 fltk.ps: $(HTMLFILES) $(IMAGEFILES)
 	echo "Generating PostScript documentation..."
 	$(RM) fltk.ps
-	-$(HTMLDOC) --verbose --batch fltk.book $(MEDIA) -f fltk.ps
+	-$(HTMLDOC) --verbose --batch fltk.book $(MEDIA) -f fltk.ps && \
+	    sed -i 's/^\(%%CreationDate: \)D:.*/\1$(PDF_DATE)/' $@
 
 fltk.pdf: $(HTMLFILES) $(IMAGEFILES)
 	echo "Generating PDF documentation..."
 	$(RM) fltk.pdf
-	-$(HTMLDOC) --verbose --batch fltk.book $(MEDIA) -f fltk.pdf
+	-$(HTMLDOC) --verbose --batch fltk.book $(MEDIA) -f fltk.pdf && \
+	    MD5=`(echo $(DEB_DATE) && du -b $@) | md5sum | cut -c -32` && \
+	    sed -i -e '3s|\(/CreationDate(\)D:[^)]*|\1$(PDF_DATE)|' \
+	        -e "s|/ID\\[\\(<[0-9a-f]\\{32\\}>\\)\\1]|/ID[<$$MD5><$$MD5>]|" $@
 
 #
 # End of "$Id: Makefile 5663 2007-02-06 19:35:28Z mike $".
--- fltk1.1-1.1.10.orig/documentation/fluid.html
+++ fltk1.1-1.1.10/documentation/fluid.html
@@ -8,7 +8,7 @@
 <P>This chapter shows how to use the Fast Light User-Interface Designer
 (&quot;FLUID&quot;) to create your GUIs.</P>
 
-<P>Subchapters:
+<P>Subchapters:</P>
 <UL>
 <LI><A HREF="#what_is_fluid">What is FLUID</A></LI>
 <LI><A HREF="#fluid_under_linux">Running FLUID Under UNIX</A></LI>
@@ -18,7 +18,7 @@
 <LI><A HREF="#references">FLUID Reference</A></LI>
 <LI><A HREF="#I18N">Internationalization with FLUID</A></LI>
 <LI><A HREF="#limitations">Know limitations</A></LI>
-</UL></P>
+</UL>
 
 <H2><A NAME="what_is_fluid">What is FLUID?</A></H2>
 
--- fltk1.1-1.1.10.orig/fltk-config.in
+++ fltk1.1-1.1.10/fltk-config.in
@@ -217,26 +217,27 @@ else
     includes=
 fi
 
-if test "$libdir" != /usr/lib -a "$libdir" != /usr/lib32; then
-    libs=-L$libdir
-else
-    libs=
-fi
+# if test "$libdir" != /usr/lib -a "$libdir" != /usr/lib32; then
+#     libs=-L$libdir
+# else
+#     libs=
+# fi
+libs=
 
 # Calculate needed libraries
 LDSTATIC="$libdir/libfltk.a $LDLIBS"
-LDLIBS="-lfltk$SHAREDSUFFIX $LDLIBS"
+LDLIBS="-lfltk$SHAREDSUFFIX -lX11"
 
 if test x$use_forms = xyes; then
     LDLIBS="-lfltk_forms$SHAREDSUFFIX $LDLIBS"
     LDSTATIC="$libdir/libfltk_forms.a $LDSTATIC"
 fi
 if test x$use_gl = xyes; then
-    LDLIBS="-lfltk_gl$SHAREDSUFFIX @GLLIB@ $LDLIBS"
+    LDLIBS="-lfltk_gl$SHAREDSUFFIX $LDLIBS"
     LDSTATIC="$libdir/libfltk_gl.a @GLLIB@ $LDSTATIC"
 fi
 if test x$use_images = xyes; then
-    LDLIBS="-lfltk_images$SHAREDSUFFIX $IMAGELIBS $LDLIBS"
+    LDLIBS="-lfltk_images$SHAREDSUFFIX $LDLIBS"
     LDSTATIC="$libdir/libfltk_images.a $STATICIMAGELIBS $LDSTATIC"
 fi
 
@@ -270,8 +271,8 @@ if test -n "$compile"; then
 	    
     post=$prog
 
-    echo $CXX $ARCHFLAGS $includes $CXXFLAGS $debug -o $prog $compile $LDSTATIC
-    $CXX $ARCHFLAGS $includes $CXXFLAGS $debug -o $prog $compile $LDSTATIC
+    echo $CXX $ARCHFLAGS $includes $CXXFLAGS $debug -o $prog $compile $LDLIBS
+    $CXX $ARCHFLAGS $includes $CXXFLAGS $debug -o $prog $compile $LDLIBS
 
     # stop after compilation in case of errors
     err=$?
@@ -286,11 +287,11 @@ if test -n "$post" -a "$POSTBUILD" != ":
 fi
 
 if test "$echo_cflags" = "yes"; then
-    echo $includes $CFLAGS
+    echo "$includes $CFLAGS" | sed -e 's/ -[gO][^ ]*//g'
 fi
 
 if test "$echo_cxxflags" = "yes"; then
-    echo $includes $CXXFLAGS
+    echo "$includes $CXXFLAGS" | sed -e 's/ -[gO][^ ]*//g'
 fi
 
 if test "$echo_optim" = "yes"; then
@@ -318,25 +319,26 @@ if test "$echo_ldstaticflags" = "yes"; t
 fi
 
 if test "$echo_libs" = "yes"; then
-    echo $libdir/libfltk.a
+    echo -n $libdir/libfltk.a
 
     if test x$use_forms = xyes; then
-        echo $libdir/libfltk_forms.a
+        echo -n " $libdir/libfltk_forms.a"
     fi
 
     if test x$use_gl = xyes; then
-        echo $libdir/libfltk_gl.a
+        echo -n " $libdir/libfltk_gl.a"
     fi
 
     if test x$use_images = xyes; then
-        echo $libdir/libfltk_images.a
+        echo -n " $libdir/libfltk_images.a"
 
         for lib in fltk_jpeg fltk_png fltk_z; do
             if test -f $libdir/lib$lib.a; then
-                echo $libdir/lib$lib.a
+                echo -n " $libdir/lib$lib.a"
             fi
 	done
     fi
+    echo
 fi
 
 #
--- fltk1.1-1.1.10.orig/fluid/Fl_Function_Type.cxx
+++ fltk1.1-1.1.10/fluid/Fl_Function_Type.cxx
@@ -181,7 +181,7 @@ void Fl_Function_Type::open() {
   function_panel->show();
   const char* message = 0;
   for (;;) { // repeat as long as there are errors
-    if (message) fl_alert(message);
+    if (message) fl_alert("%s", message);
     for (;;) {
       Fl_Widget* w = Fl::readqueue();
       if (w == f_panel_cancel) goto BREAK2;
@@ -412,7 +412,7 @@ void Fl_Code_Type::open() {
   code_panel->show();
   const char* message = 0;
   for (;;) { // repeat as long as there are errors
-    if (message) fl_alert(message);
+    if (message) fl_alert("%s", message);
     for (;;) {
       Fl_Widget* w = Fl::readqueue();
       if (w == code_panel_cancel) goto BREAK2;
@@ -479,7 +479,7 @@ void Fl_CodeBlock_Type::open() {
   codeblock_panel->show();
   const char* message = 0;
   for (;;) { // repeat as long as there are errors
-    if (message) fl_alert(message);
+    if (message) fl_alert("%s", message);
     for (;;) {
       Fl_Widget* w = Fl::readqueue();
       if (w == codeblock_panel_cancel) goto BREAK2;
@@ -573,7 +573,7 @@ void Fl_Decl_Type::open() {
   decl_panel->show();
   const char* message = 0;
   for (;;) { // repeat as long as there are errors
-    if (message) fl_alert(message);
+    if (message) fl_alert("%s", message);
     for (;;) {
       Fl_Widget* w = Fl::readqueue();
       if (w == decl_panel_cancel) goto BREAK2;
@@ -710,7 +710,7 @@ void Fl_DeclBlock_Type::open() {
   declblock_panel->show();
   const char* message = 0;
   for (;;) { // repeat as long as there are errors
-    if (message) fl_alert(message);
+    if (message) fl_alert("%s", message);
     for (;;) {
       Fl_Widget* w = Fl::readqueue();
       if (w == declblock_panel_cancel) goto BREAK2;
@@ -833,7 +833,7 @@ void Fl_Comment_Type::open() {
   char itempath[256]; itempath[0] = 0;
   int last_selected_item = 0;
   for (;;) { // repeat as long as there are errors
-    if (message) fl_alert(message);
+    if (message) fl_alert("%s", message);
     for (;;) {
       Fl_Widget* w = Fl::readqueue();
       if (w == comment_panel_cancel) goto BREAK2;
@@ -1087,7 +1087,7 @@ void Fl_Class_Type::open() {
   char *na=0,*pr=0,*p=0; // name and prefix substrings
 
   for (;;) { // repeat as long as there are errors
-    if (message) fl_alert(message);
+    if (message) fl_alert("%s", message);
     for (;;) {
       Fl_Widget* w = Fl::readqueue();
       if (w == c_panel_cancel) goto BREAK2;
--- fltk1.1-1.1.10.orig/fluid/Fl_Type.h
+++ fltk1.1-1.1.10/fluid/Fl_Type.h
@@ -41,10 +41,12 @@
 
 void set_modflag(int mf);
 
+Fl_Widget *make_type_browser(int,int,int,int,const char *l=0);
+
 class Fl_Type {
 
   friend class Widget_Browser;
-  friend Fl_Widget *make_type_browser(int,int,int,int,const char *l=0);
+  friend Fl_Widget *make_type_browser(int,int,int,int,const char *l);
   friend class Fl_Window_Type;
   virtual void setlabel(const char *); // virtual part of label(char*)
 
--- fltk1.1-1.1.10.orig/fluid/Makefile
+++ fltk1.1-1.1.10/fluid/Makefile
@@ -64,7 +64,9 @@ fluid$(EXEEXT):		$(OBJECTS) $(LIBNAME) $
 fluid-shared$(EXEEXT):	$(OBJECTS) ../src/$(DSONAME) ../src/$(FLDSONAME) \
 			../src/$(IMGDSONAME)
 	echo Linking $@...
-	$(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) $(LINKSHARED) $(LDLIBS)
+	$(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) \
+	    -L../src -Wl,-rpath-link,../src -lfltk_images -lfltk_forms -lfltk \
+	    -lpng -lX11
 	$(POSTBUILD) $@ ../FL/mac.r
 
 clean:
--- fltk1.1-1.1.10.orig/fluid/file.cxx
+++ fltk1.1-1.1.10/fluid/file.cxx
@@ -159,7 +159,7 @@ void read_error(const char *format, ...)
   if (!fin) {
     char buffer[1024];
     vsnprintf(buffer, sizeof(buffer), format, args);
-    fl_message(buffer);
+    fl_message("%s", buffer);
   } else {
     fprintf(stderr, "%s:%d: ", fname, lineno);
     vfprintf(stderr, format, args);
--- fltk1.1-1.1.10.orig/fluid/fluid.desktop
+++ fltk1.1-1.1.10/fluid/fluid.desktop
@@ -2,7 +2,7 @@
 Name=FLUID
 Comment=FLTK GUI Designer
 TryExec=fluid
-Exec=cd %D && fluid %F
+Exec=perl -e 'if (@ARGV && @ARGV[0]=~/^(.*\/)//) { chdir($1) }; exec("fluid", @ARGV);' %F
 Icon=fluid
 Terminal=false
 Type=Application
--- fltk1.1-1.1.10.orig/makeinclude.in
+++ fltk1.1-1.1.10/makeinclude.in
@@ -34,7 +34,7 @@ includedir	= @includedir@
 libdir		= @libdir@
 mandir		= @mandir@
 srcdir		= @srcdir@
-docdir		= $(datadir)/doc/fltk
+docdir		= $(datadir)/doc/fltk1.1-doc
 VPATH		= @srcdir@
 
 # programs we use...
@@ -132,7 +132,7 @@ INSTALL_DESKTOP	= @INSTALL_DESKTOP@
 UNINSTALL_DESKTOP = @UNINSTALL_DESKTOP@
 
 # Be quiet when building...
-.SILENT:
+#.SILENT:
 
 # Build commands and filename extensions...
 .SUFFIXES:	.0 .1 .3 .6 .c .cxx .h .fl .man .o .z $(EXEEXT)
--- fltk1.1-1.1.10.orig/src/Fl_File_Chooser2.cxx
+++ fltk1.1-1.1.10/src/Fl_File_Chooser2.cxx
@@ -569,7 +569,7 @@ Fl_File_Chooser::fileNameCB()
       }
     } else {
       // File doesn't exist, so beep at and alert the user...
-      fl_alert(existing_file_label);
+      fl_alert("%s", existing_file_label);
     }
   }
   else if (Fl::event_key() != FL_Delete &&
@@ -757,7 +757,7 @@ Fl_File_Chooser::newdir()
 
 
   // Get a directory name from the user
-  if ((dir = fl_input(new_directory_label, NULL)) == NULL)
+  if ((dir = fl_input("%s", NULL, new_directory_label)) == NULL)
     return;
 
   // Make it relative to the current directory as needed...
@@ -928,7 +928,7 @@ Fl_File_Chooser::showChoiceCB()
   item = showChoice->text(showChoice->value());
 
   if (strcmp(item, custom_filter_label) == 0) {
-    if ((item = fl_input(custom_filter_label, pattern_)) != NULL) {
+    if ((item = fl_input("%s", pattern_, custom_filter_label)) != NULL) {
       strlcpy(pattern_, item, sizeof(pattern_));
 
       quote_pathname(temp, item, sizeof(temp));
--- fltk1.1-1.1.10.orig/src/Fl_PNG_Image.cxx
+++ fltk1.1-1.1.10/src/Fl_PNG_Image.cxx
@@ -66,6 +66,8 @@ Fl_PNG_Image::Fl_PNG_Image(const char *p
   png_structp	pp;			// PNG read pointer
   png_infop	info;			// PNG info pointers
   png_bytep	*rows;			// PNG row pointers
+  png_uint_32	width, height;
+  int		bit_depth, color_type, num_trans = 0;
 
 
   // Open the PNG file...
@@ -75,7 +77,7 @@ Fl_PNG_Image::Fl_PNG_Image(const char *p
   pp   = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
   info = png_create_info_struct(pp);
 
-  if (setjmp(pp->jmpbuf))
+  if (setjmp(png_jmpbuf(pp)))
   {
     Fl::warning("PNG file \"%s\" contains errors!\n", png);
     return;
@@ -87,27 +89,33 @@ Fl_PNG_Image::Fl_PNG_Image(const char *p
   // Get the image dimensions and convert to grayscale or RGB...
   png_read_info(pp, info);
 
-  if (info->color_type == PNG_COLOR_TYPE_PALETTE)
+  png_get_IHDR(pp, info, &width, &height, &bit_depth, &color_type,
+	       NULL /* interlace */, NULL /* compress */, NULL /* filter */);
+#ifdef PNG_tRNS_SUPPORTED
+  png_get_tRNS(pp, info, NULL /* trans */, &num_trans, NULL /* values */);
+#endif
+
+  if (color_type == PNG_COLOR_TYPE_PALETTE)
     png_set_expand(pp);
 
-  if (info->color_type & PNG_COLOR_MASK_COLOR)
+  if (color_type & PNG_COLOR_MASK_COLOR)
     channels = 3;
   else
     channels = 1;
 
-  if ((info->color_type & PNG_COLOR_MASK_ALPHA) || info->num_trans)
+  if ((color_type & PNG_COLOR_MASK_ALPHA) || num_trans)
     channels ++;
 
-  w((int)(info->width));
-  h((int)(info->height));
+  w((int)(width));
+  h((int)(height));
   d(channels);
 
-  if (info->bit_depth < 8)
+  if (bit_depth < 8)
   {
     png_set_packing(pp);
     png_set_expand(pp);
   }
-  else if (info->bit_depth == 16)
+  else if (bit_depth == 16)
     png_set_strip_16(pp);
 
 #  if defined(HAVE_PNG_GET_VALID) && defined(HAVE_PNG_SET_TRNS_TO_ALPHA)
--- fltk1.1-1.1.10.orig/src/Fl_x.cxx
+++ fltk1.1-1.1.10/src/Fl_x.cxx
@@ -290,6 +290,14 @@ Atom fl_XdndFinished;
 Atom fl_XdndURIList;
 
 
+/*
+  X defines 32-bit-entities to have a format value of max. 32,
+  although sizeof(atom) can be 8 (64 bits) on a 64-bit OS.
+  See also fl_open_display() for sizeof(atom) < 4.
+  Used for XChangeProperty (see STR #2419).
+*/
+static int atom_bits = 32;
+
 static void fd_callback(int,void *) {
   do_queued_events();
 }
@@ -343,6 +351,9 @@ void fl_open_display(Display* d) {
   //fl_XdndProxy        = XInternAtom(d, "XdndProxy",		0);
   fl_XdndEnter          = XInternAtom(d, "XdndEnter",		0);
   fl_XdndURIList        = XInternAtom(d, "text/uri-list",	0);
+  
+  if (sizeof(Atom) < 4)
+    atom_bits = sizeof(Atom) * 8;
 
   Fl::add_fd(ConnectionNumber(d), POLLIN, fd_callback);
 
@@ -638,7 +649,7 @@ int fl_handle(const XEvent& thisevent)
     if (e.target == TARGETS) {
       Atom a = XA_STRING;
       XChangeProperty(fl_display, e.requestor, e.property,
-		      XA_ATOM, sizeof(Atom)*8, 0, (unsigned char*)&a, 1);
+		      XA_ATOM, atom_bits, 0, (unsigned char*)&a, 1);
     } else if (/*e.target == XA_STRING &&*/ fl_selection_length[clipboard]) {
       XChangeProperty(fl_display, e.requestor, e.property,
 		      e.target, 8, 0,
--- fltk1.1-1.1.10.orig/src/Makefile
+++ fltk1.1-1.1.10/src/Makefile
@@ -192,6 +192,9 @@ CFILES = fl_call_main.c flstring.c scand
 
 include ../makeinclude
 
+CFLAGS   := $(CFLAGS:-fPIE=-fPIC)
+CXXFLAGS := $(CXXFLAGS:-fPIE=-fPIC)
+
 OBJECTS = $(CPPFILES:.cxx=.o) $(CFILES:.c=.o)
 GLOBJECTS = $(GLCPPFILES:.cxx=.o)
 FLOBJECTS = $(FLCPPFILES:.cxx=.o)
@@ -210,13 +213,13 @@ $(LIBNAME): $(OBJECTS)
 
 libfltk.so.1.1: $(OBJECTS)
 	echo $(DSOCOMMAND) $@ ...
-	$(DSOCOMMAND) $@ $(OBJECTS)
+	$(DSOCOMMAND) $@ $(OBJECTS) $(LDLIBS) -lpthread
 	$(RM) libfltk.so
 	$(LN) libfltk.so.1.1 libfltk.so
 
 libfltk.sl.1.1: $(OBJECTS)
 	echo $(DSOCOMMAND) $@ ...
-	$(DSOCOMMAND) $@ $(OBJECTS)
+	$(DSOCOMMAND) $@ $(OBJECTS) $(LDLIBS)
 	$(RM) libfltk.sl
 	$(LN) libfltk.sl.1.1 libfltk.sl
 
@@ -282,13 +285,13 @@ $(GLLIBNAME): $(GLOBJECTS)
 
 libfltk_gl.so.1.1: $(GLOBJECTS) libfltk.so.1.1
 	echo $(DSOCOMMAND) $@ ...
-	$(DSOCOMMAND) $@ $(GLOBJECTS) -L. -lfltk
+	$(DSOCOMMAND) $@ $(GLOBJECTS) -lGL -lX11 -ldl -L. -lfltk
 	$(RM) libfltk_gl.so
 	$(LN) libfltk_gl.so.1.1 libfltk_gl.so
 
 libfltk_gl.sl.1.1: $(GLOBJECTS) libfltk.sl.1.1
 	echo $(DSOCOMMAND) $@ ...
-	$(DSOCOMMAND) $@ $(GLOBJECTS) -L. -lfltk
+	$(DSOCOMMAND) $@ $(GLOBJECTS) -lGL -lX11 -ldl -L. -lfltk
 	$(RM) libfltk_gl.sl
 	$(LN) libfltk_gl.sl.1.1 libfltk_gl.sl
 
--- fltk1.1-1.1.10.orig/src/fl_draw.cxx
+++ fltk1.1-1.1.10/src/fl_draw.cxx
@@ -32,7 +32,6 @@
 // Expands all unprintable characters to ^X or \nnn notation
 // Aligns them against the inside of the box.
 
-#define min(a,b) ((a)<(b)?(a):(b))
 #include <FL/fl_draw.H>
 #include <FL/Fl_Image.H>
 
@@ -40,6 +39,7 @@
 #include <ctype.h>
 #include <math.h>
 
+#define min(a,b) ((a)<(b)?(a):(b))
 #define MAXBUF 1024
 
 char fl_draw_shortcut;	// set by fl_labeltypes.cxx
--- fltk1.1-1.1.10.orig/src/fl_font_xft.cxx
+++ fltk1.1-1.1.10/src/fl_font_xft.cxx
@@ -90,7 +90,7 @@ Fl_Fontdesc* fl_fonts = built_in_table;
 
 int fl_font_ = 0;
 int fl_size_ = 0;
-XFontStruct* fl_xfont = 0;
+Fl_XFont_On_Demand fl_xfont;
 void *fl_xftfont = 0;
 const char* fl_encoding_ = "iso8859-1";
 Fl_FontSize* fl_fontsize = 0;
@@ -120,6 +120,8 @@ void fl_font(int fnum, int size) {
   fl_fontsize = f;
 #if XFT_MAJOR < 2
   fl_xfont    = f->font->u.core.font;
+#else
+  fl_xfont    = NULL; // invalidate
 #endif // XFT_MAJOR < 2
   fl_xftfont = (void*)f->font;
 }
--- fltk1.1-1.1.10.orig/src/forms_compatability.cxx
+++ fltk1.1-1.1.10/src/forms_compatability.cxx
@@ -202,7 +202,7 @@ int fl_show_choice(
 }
 
 char *fl_show_simple_input(const char *str1, const char *defstr) {
-  const char *r = fl_input(str1, defstr);
+  const char *r = fl_input("%s", str1, defstr);
   return (char *)(r ? r : defstr);
 }
 
--- fltk1.1-1.1.10.orig/test/Makefile
+++ fltk1.1-1.1.10/test/Makefile
@@ -27,6 +27,16 @@
 
 include ../makeinclude
 
+# Streamline dependencies
+GLDLIBS       = -lGL
+IMAGELIBS     =
+LDLIBS        =
+LINKFLTK      = -L../src -Wl,-rpath-link,../src -lfltk
+LINKFLTKFORMS = -L../src -Wl,-rpath-link,../src -lfltk_forms -lfltk
+LINKFLTKGL    = -L../src -Wl,-rpath-link,../src -lfltk_gl -lfltk
+LINKFLTKIMG   = -L../src -Wl,-rpath-link,../src -lfltk_images -lfltk
+LINKSHARED    = -L../src -Wl,-rpath-link,../src -lfltk_images -lfltk_forms -lfltk
+
 CPPFILES =\
 	unittests.cxx \
 	adjuster.cxx \
@@ -294,6 +304,8 @@ colbrowser$(EXEEXT): colbrowser.o
 	$(POSTBUILD) $@ ../FL/mac.r
 
 color_chooser$(EXEEXT): color_chooser.o
+	echo Linking $@...
+	$(CXX) $(ARCHFLAGS) $(LDFLAGS) color_chooser.o -o $@ $(LINKFLTK) -lX11
 
 cursor$(EXEEXT): cursor.o
 
@@ -336,6 +348,8 @@ help$(EXEEXT): help.o $(IMGLIBNAME)
 iconize$(EXEEXT): iconize.o
 
 image$(EXEEXT): image.o
+	echo Linking $@...
+	$(CXX) $(ARCHFLAGS) $(LDFLAGS) image.o -o $@ $(LINKFLTK) -lX11
 
 inactive$(EXEEXT): inactive.o
 inactive.cxx:	inactive.fl ../fluid/fluid$(EXEEXT)
@@ -359,6 +373,8 @@ label$(EXEEXT): label.o
 line_style$(EXEEXT): line_style.o
 
 list_visuals$(EXEEXT): list_visuals.o
+	echo Linking $@...
+	$(CXX) $(ARCHFLAGS) $(LDFLAGS) list_visuals.o -o $@ $(LINKFLTK) -lX11
 
 mandelbrot$(EXEEXT): mandelbrot_ui.o mandelbrot.o
 	echo Linking $@...
@@ -408,7 +424,7 @@ subwindow$(EXEEXT): subwindow.o
 
 sudoku: sudoku.o
 	echo Linking $@...
-	$(CXX) $(ARCHFLAGS) $(LDFLAGS) sudoku.o -o $@ $(AUDIOLIBS) $(LINKFLTKIMG) $(LDLIBS)
+	$(CXX) $(ARCHFLAGS) $(LDFLAGS) sudoku.o -o $@ $(AUDIOLIBS) $(LINKFLTKIMG) -lX11
 	$(OSX_ONLY) $(INSTALL_BIN) sudoku$(EXEEXT) sudoku.app/Contents/MacOS
 	$(POSTBUILD) $@ ../FL/mac.r
 
@@ -423,6 +439,9 @@ tabs$(EXEEXT): tabs.o
 tabs.cxx:	tabs.fl ../fluid/fluid$(EXEEXT)
 
 threads$(EXEEXT): threads.o
+	echo Linking $@...
+	$(CXX) -I.. $(LDFLAGS) threads.o -o $@ $(LINKFLTK) -lpthread
+	$(POSTBUILD) $@ ../FL/mac.r
 # This ensures that we have this dependency even if threads are not
 # enabled in the current tree...
 threads.o:	threads.h
@@ -430,6 +449,8 @@ threads.o:	threads.h
 tile$(EXEEXT): tile.o
 
 tiled_image$(EXEEXT): tiled_image.o
+	echo Linking $@...
+	$(CXX) $(ARCHFLAGS) $(LDFLAGS) tiled_image.o -o $@ $(LINKFLTK) -lX11
 
 valuators$(EXEEXT): valuators.o
 valuators.cxx:	valuators.fl ../fluid/fluid$(EXEEXT)
@@ -456,7 +477,7 @@ cube$(EXEEXT): cube.o
 
 fractals$(EXEEXT): fractals.o fracviewer.o
 	echo Linking $@...
-	$(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ fractals.o fracviewer.o $(LINKFLTKGL) $(LINKFLTK) $(GLDLIBS)
+	$(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ fractals.o fracviewer.o $(LINKFLTKGL) $(LINKFLTK) -lGLU $(GLDLIBS)
 	$(POSTBUILD) $@ ../FL/mac.r
 
 fullscreen$(EXEEXT): fullscreen.o
@@ -466,7 +487,7 @@ fullscreen$(EXEEXT): fullscreen.o
 
 glpuzzle$(EXEEXT): glpuzzle.o
 	echo Linking $@...
-	$(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ glpuzzle.o $(LINKFLTKGL) $(LINKFLTK) $(GLDLIBS)
+	$(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ glpuzzle.o $(LINKFLTKGL) $(LINKFLTK) -lGLU $(GLDLIBS)
 	$(POSTBUILD) $@ ../FL/mac.r
 
 gl_overlay$(EXEEXT): gl_overlay.o