ADDED Makefile Index: Makefile ================================================================== --- /dev/null +++ Makefile @@ -0,0 +1,7 @@ +# This is more to help me remember all the steps than for building :) + +iup-module : + cd iup;CSC_OPTIONS='-IC:/mylibs/iup/include -LC:/mylibs/iup/' chicken-install -D no-library-checks + +canvas-draw-module : + cd canvas-draw/chicken;CSC_OPTIONS='-IC:/mylibs/iup/include -LC:/mylibs/iup/' chicken-install -D no-library-checks Index: canvas-draw/chicken/canvas-draw.setup ================================================================== --- canvas-draw/chicken/canvas-draw.setup +++ canvas-draw/chicken/canvas-draw.setup @@ -1,6 +1,20 @@ -(if (find-library "cd" "cdCreateCanvas") +;; -*- 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 [ "cd" "cdCreateCanvas" ] ) (begin (compile -s -O2 -d1 "canvas-draw-base.scm" -j canvas-draw-base "-lcd") (compile -c -O2 -d1 "canvas-draw-base.scm" -j canvas-draw-base -unit canvas-draw-base) (compile -s -O2 -d0 "canvas-draw-base.import.scm") @@ -31,11 +45,11 @@ '("canvas-draw-play.so" "canvas-draw-play.o" "canvas-draw-play.import.so" "canvas-draw-types.scm") '((version 1.0.0) (static "canvas-draw-play.o") (static-options "-lcd"))) - (if (find-library "iupcd" "cdContextIup") + (if (check-libraries [ "iupcd" "cdContextIup" ] ) (begin (compile -s -O2 -d1 "canvas-draw-iup.scm" -j canvas-draw-iup "-liupcd") (compile -c -O2 -d1 "canvas-draw-iup.scm" -j canvas-draw-iup -unit canvas-draw-iup) (compile -s -O2 -d0 "canvas-draw-iup.import.scm") @@ -46,11 +60,11 @@ (static "canvas-draw-iup.o") (static-options "-liupcd")))) (warning "CD IUP driver not found, some bindings cannot be compiled")) (cond - [(find-library "cdx11" "cdContextNativeWindow") + [#f ;; (check-libraries [ "cdx11" "cdContextNativeWindow" ] ) (compile -s -O2 -d1 "canvas-draw-native.scm" -j canvas-draw-native "-lcdx11 -lcdcontextplus") (compile -c -O2 -d1 "canvas-draw-native.scm" -j canvas-draw-native -unit canvas-draw-native) (compile -s -O2 -d0 "canvas-draw-native.import.scm") (install-extension @@ -57,11 +71,11 @@ 'canvas-draw-native '("canvas-draw-native.so" "canvas-draw-native.o" "canvas-draw-native.import.so") '((version 1.0.0) (static "canvas-draw-native.o") (static-options "-lcdx11 -lcdcontextplus")))] - [(find-library "cd" "cdContextNativeWindow") + [#f ;; (check-libraries [ "cd" "cdContextNativeWindow" ] ) (compile -s -O2 -d1 "canvas-draw-native.scm" -j canvas-draw-native "-lcd -lcdcontextplus") (compile -c -O2 -d1 "canvas-draw-native.scm" -j canvas-draw-native -unit canvas-draw-native) (compile -s -O2 -d0 "canvas-draw-native.import.scm") (install-extension @@ -71,11 +85,11 @@ (static "canvas-draw-native.o") (static-options "-lcd -lcdcontextplus")))] [else (warning "CD native window driver not found, some bindings cannot be compiled")]) - (if (find-library "cdgl" "cdContextGL") + (if (check-libraries [ "cdgl" "cdContextGL" ] ) (begin (compile -s -O2 -d1 "canvas-draw-gl.scm" -j canvas-draw-gl "-lcdgl") (compile -c -O2 -d1 "canvas-draw-gl.scm" -j canvas-draw-gl -unit canvas-draw-gl) (compile -s -O2 -d0 "canvas-draw-gl.import.scm") @@ -86,11 +100,11 @@ (static "canvas-draw-gl.o") (static-options "-lcdgl")))) (warning "CD OpenGL driver not found, some bindings cannot be compiled")) (cond - [(find-library "cdx11" "cdContextClipboard") + [#f ;; (check-libraries [ "cdx11" "cdContextClipboard" ] ) (compile -s -O2 -d1 "canvas-draw-clipboard.scm" -j canvas-draw-clipboard "-lcdx11") (compile -c -O2 -d1 "canvas-draw-clipboard.scm" -j canvas-draw-clipboard -unit canvas-draw-clipboard) (compile -s -O2 -d0 "canvas-draw-clipboard.import.scm") (install-extension @@ -97,11 +111,11 @@ 'canvas-draw-clipboard '("canvas-draw-clipboard.so" "canvas-draw-clipboard.o" "canvas-draw-clipboard.import.so") '((version 1.0.0) (static "canvas-draw-clipboard.o") (static-options "-lcdx11")))] - [(find-library "cd" "cdContextClipboard") + [(check-libraries [ "cd" "cdContextClipboard" ] ) (compile -s -O2 -d1 "canvas-draw-clipboard.scm" -j canvas-draw-clipboard "-lcd") (compile -c -O2 -d1 "canvas-draw-clipboard.scm" -j canvas-draw-clipboard -unit canvas-draw-clipboard) (compile -s -O2 -d0 "canvas-draw-clipboard.import.scm") (install-extension @@ -112,11 +126,11 @@ (static-options "-lcd")))] [else (warning "CD clipboard driver not found, some bindings cannot be compiled")]) (cond - [(find-library "cdx11" "cdContextPrinter") + [#f ;; (check-libraries [ "cdx11" "cdContextPrinter" ] ) (compile -s -O2 -d1 "canvas-draw-printer.scm" -j canvas-draw-printer "-lcdx11") (compile -c -O2 -d1 "canvas-draw-printer.scm" -j canvas-draw-printer -unit canvas-draw-printer) (compile -s -O2 -d0 "canvas-draw-printer.import.scm") (install-extension @@ -123,11 +137,11 @@ 'canvas-draw-printer '("canvas-draw-printer.so" "canvas-draw-printer.o" "canvas-draw-printer.import.so") '((version 1.0.0) (static "canvas-draw-printer.o") (static-options "-lcdx11")))] - [(find-library "cd" "cdContextPrinter") + [(check-libraries [ "cd" "cdContextPrinter" ] ) (compile -s -O2 -d1 "canvas-draw-printer.scm" -j canvas-draw-printer "-lcd") (compile -c -O2 -d1 "canvas-draw-printer.scm" -j canvas-draw-printer -unit canvas-draw-printer) (compile -s -O2 -d0 "canvas-draw-printer.import.scm") (install-extension @@ -137,11 +151,11 @@ (static "canvas-draw-printer.o") (static-options "-lcd")))] [else (warning "CD printer driver not found, some bindings cannot be compiled")]) - (if (find-library "cd" "cdContextPicture") + (if (check-libraries [ "cd" "cdContextPicture" ] ) (begin (compile -s -O2 -d1 "canvas-draw-picture.scm" -j canvas-draw-picture "-lcd") (compile -c -O2 -d1 "canvas-draw-picture.scm" -j canvas-draw-picture -unit canvas-draw-picture) (compile -s -O2 -d0 "canvas-draw-picture.import.scm") @@ -152,11 +166,11 @@ (static "canvas-draw-picture.o") (static-options "-lcd")))) (warning "CD picture driver not found, some bindings cannot be compiled")) (cond - [(find-library "cdx11" "cdContextImage") + [#f ;; (check-libraries [ "cdx11" "cdContextImage" ] ) (compile -s -O2 -d1 "canvas-draw-server.scm" -j canvas-draw-server "-lcdx11") (compile -c -O2 -d1 "canvas-draw-server.scm" -j canvas-draw-server -unit canvas-draw-server) (compile -s -O2 -d0 "canvas-draw-server.import.scm") (install-extension @@ -163,11 +177,11 @@ 'canvas-draw-server '("canvas-draw-server.so" "canvas-draw-server.o" "canvas-draw-server.import.so") '((version 1.0.0) (static "canvas-draw-server.o") (static-options "-lcdx11")))] - [(find-library "cd" "cdContextImage") + [(check-libraries [ "cd" "cdContextImage" ] ) (compile -s -O2 -d1 "canvas-draw-server.scm" -j canvas-draw-server "-lcd") (compile -c -O2 -d1 "canvas-draw-server.scm" -j canvas-draw-server -unit canvas-draw-server) (compile -s -O2 -d0 "canvas-draw-server.import.scm") (install-extension @@ -177,11 +191,11 @@ (static "canvas-draw-server.o") (static-options "-lcd")))] [else (warning "CD server image driver not found, some bindings cannot be compiled")]) - (if (find-library "cd" "cdContextImageRGB") + (if (check-libraries [ "cd" "cdContextImageRGB" ] ) (begin (compile -s -O2 -d1 "canvas-draw-client.scm" -j canvas-draw-client "-lcd") (compile -c -O2 -d1 "canvas-draw-client.scm" -j canvas-draw-client -unit canvas-draw-client) (compile -s -O2 -d0 "canvas-draw-client.import.scm") @@ -191,11 +205,11 @@ '((version 1.0.0) (static "canvas-draw-client.o") (static-options "-lcd")))) (warning "CD client image driver not found, some bindings cannot be compiled")) - (if (find-library "cdpdf" "cdContextPDF") + (if (check-libraries [ "cdpdf" "cdContextPDF" ] ) (begin (compile -s -O2 -d1 "canvas-draw-pdf.scm" -j canvas-draw-pdf "-lcdpdf") (compile -c -O2 -d1 "canvas-draw-pdf.scm" -j canvas-draw-pdf -unit canvas-draw-pdf) (compile -s -O2 -d0 "canvas-draw-pdf.import.scm") @@ -205,11 +219,11 @@ '((version 1.0.0) (static "canvas-draw-pdf.o") (static-options "-lcdpdf")))) (warning "CD PDF driver not found, some bindings cannot be compiled")) - (if (find-library "cd" "cdContextPS") + (if (check-libraries [ "cd" "cdContextPS" ] ) (begin (compile -s -O2 -d1 "canvas-draw-ps.scm" -j canvas-draw-ps "-lcd") (compile -c -O2 -d1 "canvas-draw-ps.scm" -j canvas-draw-ps -unit canvas-draw-ps) (compile -s -O2 -d0 "canvas-draw-ps.import.scm") @@ -219,11 +233,11 @@ '((version 1.0.0) (static "canvas-draw-ps.o") (static-options "-lcd")))) (warning "CD PostScript driver not found, some bindings cannot be compiled")) - (if (find-library "cd" "cdContextSVG") + (if (check-libraries [ "cd" "cdContextSVG" ] ) (begin (compile -s -O2 -d1 "canvas-draw-svg.scm" -j canvas-draw-svg "-lcd") (compile -c -O2 -d1 "canvas-draw-svg.scm" -j canvas-draw-svg -unit canvas-draw-svg) (compile -s -O2 -d0 "canvas-draw-svg.import.scm") @@ -233,11 +247,11 @@ '((version 1.0.0) (static "canvas-draw-svg.o") (static-options "-lcd")))) (warning "CD SVG driver not found, some bindings cannot be compiled")) - (if (find-library "cd" "cdContextMetafile") + (if (check-libraries [ "cd" "cdContextMetafile" ] ) (begin (compile -s -O2 -d1 "canvas-draw-metafile.scm" -j canvas-draw-metafile "-lcd") (compile -c -O2 -d1 "canvas-draw-metafile.scm" -j canvas-draw-metafile -unit canvas-draw-metafile) (compile -s -O2 -d0 "canvas-draw-metafile.import.scm") @@ -247,11 +261,11 @@ '((version 1.0.0) (static "canvas-draw-metafile.o") (static-options "-lcd")))) (warning "CD metafile driver not found, some bindings cannot be compiled")) - (if (find-library "cd" "cdContextDebug") + (if (check-libraries [ "cd" "cdContextDebug" ] ) (begin (compile -s -O2 -d1 "canvas-draw-debug.scm" -j canvas-draw-debug "-lcd") (compile -c -O2 -d1 "canvas-draw-debug.scm" -j canvas-draw-debug -unit canvas-draw-debug) (compile -s -O2 -d0 "canvas-draw-debug.import.scm") @@ -261,11 +275,11 @@ '((version 1.0.0) (static "canvas-draw-debug.o") (static-options "-lcd")))) (warning "CD debug driver not found, some bindings cannot be compiled")) - (if (find-library "cd" "cdContextCGM") + (if (check-libraries [ "cd" "cdContextCGM" ] ) (begin (compile -s -O2 -d1 "canvas-draw-cgm.scm" -j canvas-draw-cgm "-lcd") (compile -c -O2 -d1 "canvas-draw-cgm.scm" -j canvas-draw-cgm -unit canvas-draw-cgm) (compile -s -O2 -d0 "canvas-draw-cgm.import.scm") @@ -275,11 +289,11 @@ '((version 1.0.0) (static "canvas-draw-cgm.o") (static-options "-lcd")))) (warning "CD CGM driver not found, some bindings cannot be compiled")) - (if (find-library "cd" "cdContextDGN") + (if (check-libraries [ "cd" "cdContextDGN" ] ) (begin (compile -s -O2 -d1 "canvas-draw-dgn.scm" -j canvas-draw-dgn "-lcd") (compile -c -O2 -d1 "canvas-draw-dgn.scm" -j canvas-draw-dgn -unit canvas-draw-dgn) (compile -s -O2 -d0 "canvas-draw-dgn.import.scm") @@ -289,11 +303,11 @@ '((version 1.0.0) (static "canvas-draw-dgn.o") (static-options "-lcd")))) (warning "CD DGN driver not found, some bindings cannot be compiled")) - (if (find-library "cd" "cdContextDXF") + (if (check-libraries [ "cd" "cdContextDXF" ] ) (begin (compile -s -O2 -d1 "canvas-draw-dxf.scm" -j canvas-draw-dxf "-lcd") (compile -c -O2 -d1 "canvas-draw-dxf.scm" -j canvas-draw-dxf -unit canvas-draw-dxf) (compile -s -O2 -d0 "canvas-draw-dxf.import.scm") @@ -303,11 +317,11 @@ '((version 1.0.0) (static "canvas-draw-dxf.o") (static-options "-lcd")))) (warning "CD DXF driver not found, some bindings cannot be compiled")) - (if (find-library "cd" "cdContextEMF") + (if (check-libraries [ "cd" "cdContextEMF" ] ) (begin (compile -s -O2 -d1 "canvas-draw-emf.scm" -j canvas-draw-emf "-lcd") (compile -c -O2 -d1 "canvas-draw-emf.scm" -j canvas-draw-emf -unit canvas-draw-emf) (compile -s -O2 -d0 "canvas-draw-emf.import.scm") @@ -317,11 +331,11 @@ '((version 1.0.0) (static "canvas-draw-emf.o") (static-options "-lcd")))) (warning "CD EMF driver not found, some bindings cannot be compiled")) - (if (find-library "cd" "cdContextWMF") + (if (check-libraries [ "cd" "cdContextWMF"] ) (begin (compile -s -O2 -d1 "canvas-draw-wmf.scm" -j canvas-draw-wmf "-lcd") (compile -c -O2 -d1 "canvas-draw-wmf.scm" -j canvas-draw-wmf -unit canvas-draw-wmf) (compile -s -O2 -d0 "canvas-draw-wmf.import.scm")