Changeset 30534 in project


Ignore:
Timestamp:
03/07/14 14:58:04 (7 years ago)
Author:
felix winkelmann
Message:

g2 1.4: make support for FIG optional

Location:
release/4/g2
Files:
2 edited
3 copied

Legend:

Unmodified
Added
Removed
  • release/4/g2/tags/1.4/g2.scm

    r30525 r30534  
    2222(import chicken scheme foreign)
    2323(use easyffi)
    24  
     24
    2525#>
    2626#include <g2.h>
    2727#include <g2_PS.h>
    28 #include <g2_FIG.h>
    29 <#
     28<#
     29
     30#+have-fig
     31(foreign-declare "#include <g2_FIG.h>")
    3032
    3133#>?
     
    114116void g2_filled_para_3(int id, int n, double *points);
    115117void g2_filled_para_5(int id, int n, double *points);
    116 
    117 
    118 int g2_open_FIG(const char *file_name);
    119118<#
    120119
     
    134133                 int icon_width, int icon_height);
    135134<#
     135
     136#+have-fig
     137#>?
     138int g2_open_FIG(const char *file_name);
     139<#
     140
     141(cond-expand
     142  ((not have-fig)
     143   (define (stub loc)
     144     (lambda _
     145       (error loc "This procedure requires FIG support in libg2")))
     146   (define g2:open-fig (stub 'g2:open-FIG)))
     147  (else))
    136148
    137149(cond-expand
  • release/4/g2/tags/1.4/g2.setup

    r30525 r30534  
    44(define has-x11 (test-compile "int main(){ return 0; }" ldflags: "-L/usr/X11R6/lib -lX11"))
    55(define has-gd (test-compile "int main(){ return 0; }" ldflags: "-lgd"))
     6(define has-fig (test-compile "#include <g2_FIG.h>\nint main(){ return 0; }" ldflags: "-lg2"))
    67
    78(print "X11: " (if has-x11 "yes" "no"))
    89(print "gd: " (if has-gd "yes" "no"))
     10(print "FIG: " (if has-fig "yes" "no"))
    911
    1012(run (csc g2.scm -J -s -O2 -d0 -lg2 -X easyffi
     13          ,@(if has-fig '(-feature have-fig) '())
    1114          ,@(if has-x11 '(-feature have-x11 -C -DHAVE_X11 -L -L/usr/X11R6/lib -lX11) '())
    1215          ,@(if has-gd '(-feature have-gd -C -DHAVE_GD -lgd) '()) ) )
    1316
    1417(run (csc g2.import.scm -s -O2 -d0 -lg2 -X easyffi
     18          ,@(if has-fig '(-feature have-fig) '())
    1519          ,@(if has-x11 '(-feature have-x11 -C -DHAVE_X11 -L -L/usr/X11R6/lib -lX11) '())
    1620          ,@(if has-gd '(-feature have-gd -C -DHAVE_GD -lgd) '()) ) )
  • release/4/g2/trunk/g2.scm

    r30525 r30534  
    2222(import chicken scheme foreign)
    2323(use easyffi)
    24  
     24
    2525#>
    2626#include <g2.h>
    2727#include <g2_PS.h>
    28 #include <g2_FIG.h>
    29 <#
     28<#
     29
     30#+have-fig
     31(foreign-declare "#include <g2_FIG.h>")
    3032
    3133#>?
     
    114116void g2_filled_para_3(int id, int n, double *points);
    115117void g2_filled_para_5(int id, int n, double *points);
    116 
    117 
    118 int g2_open_FIG(const char *file_name);
    119118<#
    120119
     
    134133                 int icon_width, int icon_height);
    135134<#
     135
     136#+have-fig
     137#>?
     138int g2_open_FIG(const char *file_name);
     139<#
     140
     141(cond-expand
     142  ((not have-fig)
     143   (define (stub loc)
     144     (lambda _
     145       (error loc "This procedure requires FIG support in libg2")))
     146   (define g2:open-fig (stub 'g2:open-FIG)))
     147  (else))
    136148
    137149(cond-expand
  • release/4/g2/trunk/g2.setup

    r30525 r30534  
    44(define has-x11 (test-compile "int main(){ return 0; }" ldflags: "-L/usr/X11R6/lib -lX11"))
    55(define has-gd (test-compile "int main(){ return 0; }" ldflags: "-lgd"))
     6(define has-fig (test-compile "#include <g2_FIG.h>\nint main(){ return 0; }" ldflags: "-lg2"))
    67
    78(print "X11: " (if has-x11 "yes" "no"))
    89(print "gd: " (if has-gd "yes" "no"))
     10(print "FIG: " (if has-fig "yes" "no"))
    911
    1012(run (csc g2.scm -J -s -O2 -d0 -lg2 -X easyffi
     13          ,@(if has-fig '(-feature have-fig) '())
    1114          ,@(if has-x11 '(-feature have-x11 -C -DHAVE_X11 -L -L/usr/X11R6/lib -lX11) '())
    1215          ,@(if has-gd '(-feature have-gd -C -DHAVE_GD -lgd) '()) ) )
    1316
    1417(run (csc g2.import.scm -s -O2 -d0 -lg2 -X easyffi
     18          ,@(if has-fig '(-feature have-fig) '())
    1519          ,@(if has-x11 '(-feature have-x11 -C -DHAVE_X11 -L -L/usr/X11R6/lib -lX11) '())
    1620          ,@(if has-gd '(-feature have-gd -C -DHAVE_GD -lgd) '()) ) )
Note: See TracChangeset for help on using the changeset viewer.