IUP

Check-in [69013350a3]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Simplified build logic, combined libraries
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk | v1.1.0
Files: files | file ages | folders
SHA1: 69013350a3bb7207c49193f55796b248152b6550
User & Date: murphy 2011-12-25 01:11:45.540
Context
2011-12-25
01:15
Updated CHICKEN release information file check-in: 4e555d1e45 user: murphy tags: trunk
01:11
Simplified build logic, combined libraries check-in: 69013350a3 user: murphy tags: trunk, v1.1.0
2011-04-22
11:41
Added CHICKEN release information file check-in: 9d81ebb344 user: murphy tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to chicken/iup-base.scm.
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
(require-library
	lolevel data-structures extras srfi-1 srfi-13 srfi-42 irregex posix)

(module iup-base
	(ihandle->pointer pointer->ihandle ihandle-list->pointer-vector ihandle?
	 istatus->integer integer->istatus
	 iname->string string->iname
	 thread-watchdog iup-version load/led
	 attribute attribute-set! attribute-reset!
	 handle-name handle-name-set! handle-ref
	 main-loop main-loop-step main-loop-level main-loop-exit main-loop-flush
	 callback callback-set!
	 make-constructor-procedure optional-args
	 create destroy! map-peer! unmap-peer!
	 class-name class-type save-attributes!
	 parent parent-dialog sibling
	 child-add! child-remove! child-move!
	 child-ref child-pos child-count
	 :children children
	 refresh redraw
	 child-x/y->pos
	 show hide
	 dialog
	 fill hbox vbox zbox cbox sbox
	 radio normalizer split
	 image/palette image/rgb image/rgba image/file image-save
	 current-focus focus-next focus-previous
	 menu menu-item menu-separator
	 clipboard timer send-url)
	(import
		scheme chicken foreign
		lolevel data-structures extras srfi-1 srfi-13 srfi-42 irregex
		(only posix setenv))

;; {{{ Data types

(foreign-declare
	"#include <callback.h>\n"
	"#include <locale.h>\n"
	"#include <iup.h>\n"
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<









1






























2
3
4
5
6
7
8


;; -*- mode: Scheme; tab-width: 2; -*- ;;































;; {{{ Data types

(foreign-declare
	"#include <callback.h>\n"
	"#include <locale.h>\n"
	"#include <iup.h>\n"
698
699
700
701
702
703
704
705
706
         (close)))
      (callback-set! watchdog 'action-cb chicken-yield)
      (attribute-set! watchdog 'time 500)
      (attribute-set! watchdog 'run #t)
      watchdog)))

;; }}}

)







<
<
666
667
668
669
670
671
672


         (close)))
      (callback-set! watchdog 'action-cb chicken-yield)
      (attribute-set! watchdog 'time 500)
      (attribute-set! watchdog 'run #t)
      watchdog)))

;; }}}


Changes to chicken/iup-controls.scm.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
(require-library iup-base)

(module iup-controls
	(canvas
	 frame tabs
	 label button toggle
	 spin spinbox valuator
	 textbox listbox treebox
	 progress-bar
	 matrix cells
	 color-bar color-browser
	 dial)
	(import
		scheme chicken foreign
		iup-base)

;; {{{ Data types

(foreign-declare
	"#include <iup.h>\n"
	"#include <iupcontrols.h>\n")
	
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<








1













2
3
4
5
6
7
8

;; -*- mode: Scheme; tab-width: 2; -*- ;;














;; {{{ Data types

(foreign-declare
	"#include <iup.h>\n"
	"#include <iupcontrols.h>\n")
	
120
121
122
123
124
125
126
127
128

(let ([status (foreign-value "IupControlsOpen()" istatus)])
	(case status
		[(#t ignore) (void)]
		[else        (error 'iup "failed to initialize library (~s)" status)]))

;; }}}

)







<
<
106
107
108
109
110
111
112



(let ([status (foreign-value "IupControlsOpen()" istatus)])
	(case status
		[(#t ignore) (void)]
		[else        (error 'iup "failed to initialize library (~s)" status)]))

;; }}}


Changes to chicken/iup-dialogs.scm.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
(require-library iup-base)

(module iup-dialogs
	(file-dialog message-dialog color-dialog font-dialog)
	(import
		scheme chicken foreign
		iup-base)

;; {{{ Data types

(foreign-declare
	"#include <iup.h>\n")
	
(include "iup-types.scm")
<
|
<
<
<
<
<








1





2
3
4
5
6
7
8

;; -*- mode: Scheme; tab-width: 2; -*- ;;






;; {{{ Data types

(foreign-declare
	"#include <iup.h>\n")
	
(include "iup-types.scm")
30
31
32
33
34
35
36
37
38
  	(foreign-lambda nonnull-ihandle "IupColorDlg")))

(define font-dialog
  (make-constructor-procedure
  	(foreign-lambda nonnull-ihandle "IupFontDlg")))

;; }}}

)







<
<
24
25
26
27
28
29
30


  	(foreign-lambda nonnull-ihandle "IupColorDlg")))

(define font-dialog
  (make-constructor-procedure
  	(foreign-lambda nonnull-ihandle "IupFontDlg")))

;; }}}


Changes to chicken/iup-dynamic.scm.


1
2
3
4
5
6
7


(module iup-dynamic
	(iup-available? iup-dynamic-require)
	(import scheme chicken)

(define (iup-dynamic-require sym)
	(eval `(begin (require-extension iup) ,sym)))

>
>







1
2
3
4
5
6
7
8
9
;; -*- mode: Scheme; tab-width: 2; -*- ;;

(module iup-dynamic
	(iup-available? iup-dynamic-require)
	(import scheme chicken)

(define (iup-dynamic-require sym)
	(eval `(begin (require-extension iup) ,sym)))

Changes to chicken/iup-glcanvas.scm.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
(require-library iup-base)

(module iup-glcanvas
	(glcanvas
	 call-with-glcanvas glcanvas-is-current?
	 glcanvas-palette-set! glcanvas-font-set!)
	(import
		scheme chicken foreign
		iup-base)

;; {{{ Data types

(foreign-declare
	"#include <iup.h>\n"
	"#include <iupgl.h>\n")
	
<
|
<
<
<
<
<
<
<








1







2
3
4
5
6
7
8

;; -*- mode: Scheme; tab-width: 2; -*- ;;








;; {{{ Data types

(foreign-declare
	"#include <iup.h>\n"
	"#include <iupgl.h>\n")
	
56
57
58
59
60
61
62
63
64
;; }}}

;; {{{ Library setup

(foreign-code "IupGLCanvasOpen();")

;; }}}

)







<
<
48
49
50
51
52
53
54


;; }}}

;; {{{ Library setup

(foreign-code "IupGLCanvasOpen();")

;; }}}


Changes to chicken/iup-pplot.scm.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
(require-library iup-base)

(module iup-pplot
	(pplot
	 call-with-pplot pplot-add!
	 pplot-x/y->pixel-x/y
	 pplot-paint-to)
	(import
		scheme chicken foreign
		iup-base)

;; {{{ Data types

(foreign-declare
	"#include <iup.h>\n"
	"#include <iup_pplot.h>\n")
	
<
|
<
<
<
<
<
<
<
<








1








2
3
4
5
6
7
8

;; -*- mode: Scheme; tab-width: 2; -*- ;;









;; {{{ Data types

(foreign-declare
	"#include <iup.h>\n"
	"#include <iup_pplot.h>\n")
	
69
70
71
72
73
74
75
76
77
;; }}}

;; {{{ Library setup

(foreign-code "IupPPlotOpen();")

;; }}}

)







<
<
60
61
62
63
64
65
66


;; }}}

;; {{{ Library setup

(foreign-code "IupPPlotOpen();")

;; }}}


Changes to chicken/iup-types.scm.


1
2
3
4
5
6
7


(define-foreign-type ihandle (c-pointer "Ihandle")
	(ihandle->pointer #f)
	(pointer->ihandle #f))

(define-foreign-type ihandle-list nonnull-pointer-vector
	ihandle-list->pointer-vector)

>
>







1
2
3
4
5
6
7
8
9
;; -*- mode: Scheme; tab-width: 2; -*- ;;

(define-foreign-type ihandle (c-pointer "Ihandle")
	(ihandle->pointer #f)
	(pointer->ihandle #f))

(define-foreign-type ihandle-list nonnull-pointer-vector
	ihandle-list->pointer-vector)

Changes to chicken/iup-web.scm.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
(require-library iup-base)

(module iup-web
	(web-browser)
	(import
		scheme chicken foreign
		iup-base)

;; {{{ Data types

(foreign-declare
	"#include <iup.h>\n"
	"#include <iupweb.h>\n")
	
<
|
<
<
<
<
<








1





2
3
4
5
6
7
8

;; -*- mode: Scheme; tab-width: 2; -*- ;;






;; {{{ Data types

(foreign-declare
	"#include <iup.h>\n"
	"#include <iupweb.h>\n")
	
25
26
27
28
29
30
31
32
33
;; }}}

;; {{{ Library setup

(foreign-code "IupWebBrowserOpen();")

;; }}}

)







<
<
19
20
21
22
23
24
25


;; }}}

;; {{{ Library setup

(foreign-code "IupWebBrowserOpen();")

;; }}}


Changes to chicken/iup.scm.


1


























































































2
3
4
5
6
7
8


(require-library iup-base iup-controls iup-dialogs)



























































































(module iup
	()
	(import scheme chicken)
	(reexport
		(except iup-base
			ihandle->pointer pointer->ihandle ihandle-list->blob
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







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
;; -*- mode: Scheme; tab-width: 2; -*- ;;

(require-library
  lolevel data-structures extras srfi-1 srfi-13 srfi-42 irregex posix)

(module iup-base
	(ihandle->pointer pointer->ihandle ihandle-list->pointer-vector ihandle?
	 istatus->integer integer->istatus
	 iname->string string->iname
	 thread-watchdog iup-version load/led
	 attribute attribute-set! attribute-reset!
	 handle-name handle-name-set! handle-ref
	 main-loop main-loop-step main-loop-level main-loop-exit main-loop-flush
	 callback callback-set!
	 make-constructor-procedure optional-args
	 create destroy! map-peer! unmap-peer!
	 class-name class-type save-attributes!
	 parent parent-dialog sibling
	 child-add! child-remove! child-move!
	 child-ref child-pos child-count
	 :children children
	 refresh redraw
	 child-x/y->pos
	 show hide
	 dialog
	 fill hbox vbox zbox cbox sbox
	 radio normalizer split
	 image/palette image/rgb image/rgba image/file image-save
	 current-focus focus-next focus-previous
	 menu menu-item menu-separator
	 clipboard timer send-url)
	(import
		scheme chicken foreign
		lolevel data-structures extras srfi-1 srfi-13 srfi-42 irregex
		(only posix setenv))
	(include "iup-base.scm"))

(module iup-controls
	(canvas
	 frame tabs
	 label button toggle
	 spin spinbox valuator
	 textbox listbox treebox
	 progress-bar
	 matrix cells
	 color-bar color-browser
	 dial)
	(import
		scheme chicken foreign
		iup-base)
	(include "iup-controls.scm"))

(module iup-dialogs
	(file-dialog message-dialog color-dialog font-dialog)
	(import
		scheme chicken foreign
		iup-base)
	(include "iup-dialogs.scm"))

(cond-expand
 [disable-iup-glcanvas]
 [else
	(module iup-glcanvas
		(glcanvas
		 call-with-glcanvas glcanvas-is-current?
		 glcanvas-palette-set! glcanvas-font-set!)
		(import
		  scheme chicken foreign
			iup-base)
		(include "iup-glcanvas.scm"))])

(cond-expand
 [disable-iup-pplot]
 [else
	(module iup-pplot
		(pplot
		 call-with-pplot pplot-add!
		 pplot-x/y->pixel-x/y
		 pplot-paint-to)
		(import
		  scheme chicken foreign
			iup-base)
		(include "iup-pplot.scm"))])

(cond-expand
 [disable-iup-web]
 [else
	(module iup-web
		(web-browser)
		(import
		  scheme chicken foreign
			iup-base)
		(include "iup-web.scm"))])

(module iup
	()
	(import scheme chicken)
	(reexport
		(except iup-base
			ihandle->pointer pointer->ihandle ihandle-list->blob
Changes to chicken/iup.setup.
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
;; -*- mode: Scheme; tab-width: 2; -*- ;;




(cond-expand
 [no-library-checks
	(define-syntax check-libraries
		(syntax-rules ()
			[(check-libraries [lib fun] ...)
			 #t]))]
 [else
	(define-syntax check-libraries
		(syntax-rules ()
			[(check-libraries [lib fun] ...)
			 (and (find-library lib fun) ...)]))])

(if (check-libraries
		  ["callback" "alloc_trampoline_r"]
			["iup" "IupOpen"]
			["iupim" "IupLoadImage"]
			["iupimglib" "IupImageLibOpen"])
	(begin
		(compile -s -O2 -d1 "iup-base.scm" -j iup-base "-lcallback -liup -liupim -liupimglib")

		(compile -c -O2 -d1 "iup-base.scm" -j iup-base -unit iup-base)
		(compile -s -O2 -d0 "iup-base.import.scm")
		
		(install-extension

		 'iup-base
		 '("iup-base.so" "iup-base.o" "iup-base.import.so" "iup-types.scm")
		 '((version 1.0.3)
			 (static "iup-base.o")
			 (static-options "-lcallback -liup -liupim -liupimglib")))
		
		(compile -s -O2 -d1 "iup-controls.scm" -j iup-controls "-liup -liupcontrols")
		(compile -c -O2 -d1 "iup-controls.scm" -j iup-controls -unit iup-controls)

		(compile -s -O2 -d0 "iup-controls.import.scm")
		
		(install-extension
		 'iup-controls


		 '("iup-controls.so" "iup-controls.o" "iup-controls.import.so")
		 '((version 1.0.3)
			 (static "iup-controls.o")
			 (static-options "-liup -liupcontrols")))
		
		(compile -s -O2 -d1 "iup-dialogs.scm" -j iup-dialogs "-liup")
		(compile -c -O2 -d1 "iup-dialogs.scm" -j iup-dialogs -unit iup-dialogs)

		(compile -s -O2 -d0 "iup-dialogs.import.scm")
		
		(install-extension
		 'iup-dialogs
		 '("iup-dialogs.so" "iup-dialogs.o" "iup-dialogs.import.so")
		 '((version 1.0.3)
			 (static "iup-dialogs.o")
			 (static-options "-liup")))
		

		(if (check-libraries ["iupgl" "IupGLCanvasOpen"])
			(begin
				(compile -s -O2 -d1 "iup-glcanvas.scm" -j iup-glcanvas "-liup -liupgl")
				(compile -c -O2 -d1 "iup-glcanvas.scm" -j iup-glcanvas -unit iup-glcanvas)
				(compile -s -O2 -d0 "iup-glcanvas.import.scm")
				

				(install-extension


				 'iup-glcanvas




				 '("iup-glcanvas.so" "iup-glcanvas.o" "iup-glcanvas.import.so")
				 '((version 1.0.3)



					 (static "iup-glcanvas.o")


					 (static-options "-liup -liupgl"))))
			(warning "IUP GLCanvas not found, some bindings cannot be compiled"))
		
		(if (check-libraries ["iup_pplot" "IupPPlotOpen"])
			(begin
				(compile -s -O2 -d1 "iup-pplot.scm" -j iup-pplot "-liup -liup_pplot")
				(compile -c -O2 -d1 "iup-pplot.scm" -j iup-pplot -unit iup-pplot)
				(compile -s -O2 -d0 "iup-pplot.import.scm")
				
				(install-extension
				 'iup-pplot
				 '("iup-pplot.so" "iup-pplot.o" "iup-pplot.import.so")
				 '((version 1.0.3)
					 (static "iup-pplot.o")
					 (static-options "-liup -liup_pplot"))))
			(warning "IUP PPlot not found, some bindings cannot be compiled"))


		(if (check-libraries ["iupweb" "IupWebBrowserOpen"])
			(begin
				(compile -s -O2 -d1 "iup-web.scm" -j iup-web "-liup -liupweb")
				(compile -c -O2 -d1 "iup-web.scm" -j iup-web -unit iup-web)
				(compile -s -O2 -d0 "iup-web.import.scm")
				
				(install-extension
				 'iup-web

				 '("iup-web.so" "iup-web.o" "iup-web.import.so")
				 '((version 1.0.3)
					 (static "iup-web.o")
					 (static-options "-liup -liupweb"))))
			(warning "IUP Web not found, some bindings cannot be compiled"))
		
		(compile -s -O2 -d1 "iup.scm" -j iup)
		(compile -c -O2 -d1 "iup.scm" -j iup -unit iup)
		(compile -s -O2 -d0 "iup.import.scm")
		
		(install-extension
		 'iup
		 '("iup.so" "iup.o" "iup.import.so")
		 '((version 1.0.3)
			 (static "iup.o"))))
	(warning "IUP or ffcall not found, none of the bindings can be compiled"))


(compile -s -O2 -d1 "iup-dynamic.scm" -j iup-dynamic)
(compile -c -O2 -d1 "iup-dynamic.scm" -j iup-dynamic -unit iup-dynamic)
(compile -s -O2 -d0 "iup-dynamic.import.scm")

(install-extension
 'iup-dynamic
 '("iup-dynamic.so" "iup-dynamic.o" "iup-dynamic.import.so")
 '((version 1.0.3)
   (static "iup-dynamic.o")))

>
>
>
>
|
<
<
|
<
|
|
<
<
<
<
|
|
<
|
<
<
|
<
>
|
|
|
<
>
|
|
<
<
<
|
<
<
>
|
|
|
|
>
>
|
|
|
<
|
<
<
>
|
|
<
|
<
|
<
<
|
>
<
<
<
<
<
|
>
|
>
>
|
>
>
>
>
|
|
>
>
>
|
>
>
|
<
|
<
<
|
|
|
|
<
<
|
<
|
<
<

>
|
|
<
<
|
|
<
|
>
|
|
|
<
<
|
<
<
|
|
|
|
|
|
|
<
>








|

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
;; -*- mode: Scheme; tab-width: 2; -*- ;;

(define modules
	`(-j iup
		-j iup-base -j iup-controls -j iup-dialogs
		,@(cond-expand


			 [disable-iup-glcanvas

				'()]
			 [else




				'(-j iup-glcanvas)])
		,@(cond-expand

			 [disable-iup-pplot


				'()]

			 [else
				'(-j iup-pplot)])
		,@(cond-expand
			 [disable-iup-web

				'()]
			 [else
				'(-j iup-web)])))






(define import-libraries
	`("iup.import.so"
		"iup-base.import.scm" "iup-controls.import.scm" "iup-dialogs.import.scm"
		,@(cond-expand
			 [disable-iup-glcanvas
				'()]
			 [else
				'("iup-glcanvas.import.scm")])
		,@(cond-expand
			 [disable-iup-pplot

				'()]


			 [else
				'("iup-pplot.import.scm")])
		,@(cond-expand

			 [disable-iup-web

				'()]


			 [else
				'("iup-web.import.scm")])))






(define native-libraries
	`("-lcallback"
		"-liup" "-liupim" "-liupimglib" "-liupcontrols"
		,@(cond-expand
			 [disable-iup-glcanvas
				'()]
			 [else
				'("-liupgl")])
		,@(cond-expand
			 [disable-iup-pplot
				'()]
			 [else
				'("-liup_pplot")])
		,@(cond-expand
			 [disable-iup-web
				'()]
			 [else
				'("-liupweb")])))




(compile -s -O2 -d1 "iup.scm" ,@modules ,@native-libraries)
(compile -c -O2 -d1 "iup.scm" -unit iup)
(compile -s -O2 -d0 "iup.import.scm")
(compile -s -O2 -d0 "iup-base.import.scm")


(compile -s -O2 -d0 "iup-controls.import.scm")

(compile -s -O2 -d0 "iup-dialogs.import.scm")



(cond-expand
 [disable-iup-glcanvas]
 [else


	(compile -s -O2 -d0 "iup-glcanvas.import.scm")])
(cond-expand

 [disable-iup-pplot]
 [else
	(compile -s -O2 -d0 "iup-pplot.import.scm")])
(cond-expand
 [disable-iup-web]


 [else


	(compile -s -O2 -d0 "iup-web.import.scm")])

(install-extension
 'iup
 `("iup.so" "iup.o" "iup-types.scm" ,@import-libraries)
 `((version 1.1.0)
	 (static "iup-base.o")

	 (static-options ,(string-intersperse native-libraries))))

(compile -s -O2 -d1 "iup-dynamic.scm" -j iup-dynamic)
(compile -c -O2 -d1 "iup-dynamic.scm" -j iup-dynamic -unit iup-dynamic)
(compile -s -O2 -d0 "iup-dynamic.import.scm")

(install-extension
 'iup-dynamic
 '("iup-dynamic.so" "iup-dynamic.o" "iup-dynamic.import.so")
 '((version 1.1.0)
   (static "iup-dynamic.o")))