Initial release of Maemo 5 port of gnuplot
[gnuplot] / config / buildvms.com
1 $ ! for batch operation, set default to the gnuplot directory
2 $ !
3 $ ! buildvms.com
4 $ ! Command file to compile/link gnuplot, gnuplot_x11, and make gnuplot.hlb
5 $ !
6 $ ! lph: modified for compatibility with VMS 4.x (which lacks 'if ... endif'),
7 $ ! but made the default DECC
8 $ !
9 $! set noon
10 $ ON ERROR THEN GOTO FINISH
11 $!
12 $! detect compiler - drd
13 $! if DECC is around, assume that, else gcc is preferred. Finally vaxc
14 $ its_decc = (f$search("SYS$SYSTEM:DECC$COMPILER.EXE") .nes. "")
15 $ its_gnuc = 0   ! comment out the next line to use VAXC if gcc is also present 
16 $ its_gnuc = .not.its_decc .and. (f$trnlnm("gnu_cc").nes."")
17 $ its_vaxc = .not. (its_decc .or. its_gnuc)
18 $ its_decw = (f$trnlnm("DECW$INCLUDE") .nes. "") 
19 $!
20 $! configure
21 $
22 $ pfix = "/prefix=all"
23 $ rtl  = "DECCRTL"
24 $   if .NOT. its_decc then pfix = "/nolist"
25 $   if .NOT. its_decc then rtl  = "VAXCRTL"
26 $!
27 $ x11 = ""
28 $ if its_decw then x11 = "X11,"
29 $! 
30 $!-----------------------------------------------------------------
31 $!-----------------------------------------------------------------
32 $! customize CFLAGS for version of VMS, CRTL, and C compiler.
33 $!-----------------------------------------------------------------
34 $ IF F$GETSYI("ARCH_TYPE") .EQ. 1
35 $ THEN
36 $!  these defines work for OpenVMS VAX v6.2 and DEC C v5.7
37 $ CFLAGS = "/define=(PROTOTYPES,HAVE_UNISTD_H,HAVE_GETCWD,"-
38  +"HAVE_SLEEP,''x11'NO_GIH,PIPES,DECCRTL)''pfix'"
39 $ ELSE
40 $!  these defines work for OpenVMS Alpha v6.2 and DEC C v5.3
41 $ CFLAGS = "/define=(PROTOTYPES,HAVE_LGAMMA,HAVE_ERF,HAVE_UNISTD_H,HAVE_GETCWD,"-
42  +"HAVE_SLEEP,''x11'NO_GIH,PIPES,DECCRTL)''pfix'"
43 $ ENDIF
44 $!
45 $!-----------------------------------------------------------------
46 $!
47 $! A generic starting point 
48 $!-----------------------------------------------------------------
49 $!
50 $!$ CFLAGS = "/NOWARN/NOOP/DEFINE=(''x11'NO_GIH,PIPES,''rtl')''pfix'"
51 $!
52 $! ----------------------------------------------------------------
53 $!
54 $! For  VMS 4.7 and VAX C v2.4  
55 $! ("Compiler abort - virtual memory limits exceeded" if attempt
56 $!  to include all applicable terminals, but otherwise builds OK.  
57 $!  Runtime problem: an exit handler error, also w/ gcc build;
58 $!  a VAXCRTL atexit bug?)
59 $!
60 $! Note: VAX uses  D_FLOAT, maximum exponent ca 10e +/- 38;
61 $!       will cause problems with some of the demos
62 $!
63 $!$ CFLAGS    = "/NOOP/DEFINE=(HAVE_GETCWD, HAVE_SLEEP, "-
64 $!               +"SHORT_TERMLIST, NO_GIH,PIPES, ''rtl')"
65 $!$!
66 $!
67 $!-----------------------------------------------------------------
68 $!
69 $! This will build with gcc v1.42 on VMS 4.7
70 $! (no virtual memory limit problem)
71 $!
72 $! gcc v1.42 string.h can prefix str routines w/ gnu_ (ifdef GCC_STRINGS)
73 $! but the routines in GCCLIB are not prefixed w/ gcc_  :-(
74 $! link with GCCLIB, then ignore the link warnings about multiple
75 $! definitions of STR... in C$STRINGS
76 $!
77 $! GCC v1.42 has a locale.h, but neither gcc nor VMS v4.7 VAXCRTL has 
78 $! the  setlocale function
79 $!           
80 $!
81 $! Note: _assert.c defines assert_gcc, if ndef NDEBUG, but
82 $!        cgm.trm undefines NDEBUG, so we always compile/link  _assert.c
83 $!
84 $!$ CFLAGS    = "/NOOP/DEFINE=(''x11', HAVE_GETCWD,"-
85 $!              +" HAVE_SLEEP, NO_GIH, PIPES, ''rtl')"
86 $!
87 $!-----------------------------------------------------------------
88 $!-----------------------------------------------------------------
89 $!
90 $ TERMFLAGS = "/INCLUDE=([],[.-term])"
91 $
92 $ EXTRALIB = ""
93 $ if its_gnuc then cc := GCC/NOCASE
94 $ if its_gnuc then EXTRALIB = ",[]_assert,GNU_CC:[000000]GCCLIB/LIB"
95
96 $
97 $ CFLAGS="''cflags'" + "''pfix'"
98 $ LINKOPT=""
99 $!
100 $ if .NOT. its_decc then -
101       LINKOPT=",sys$disk:[]linkopt.vms/opt"
102 $!
103 $!
104 $ if its_decw then DEFINE/NOLOG X11 DECW$INCLUDE
105 $ if its_decw then DEFINE/NOLOG SYS SYS$LIBRARY
106 $!
107 $ set verify
108 $ cc 'CFLAGS' alloc.c
109 $ cc 'CFLAGS' binary.c
110 $ cc 'CFLAGS' bitmap.c
111 $ cc 'CFLAGS' command.c
112 $ cc 'CFLAGS' contour.c
113 $ cc 'CFLAGS' datafile.c
114 $ cc 'CFLAGS' dynarray.c
115 $ cc 'CFLAGS' eval.c
116 $ cc 'CFLAGS' fit.c
117 $ cc 'CFLAGS' graph3d.c
118 $ cc 'CFLAGS' graphics.c
119 $ cc 'CFLAGS' help.c
120 $ cc 'CFLAGS' hidden3d.c
121 $ cc 'CFLAGS' history.c
122 $ cc 'CFLAGS' internal.c
123 $ cc 'CFLAGS' interpol.c
124 $ cc 'CFLAGS' matrix.c
125 $ cc 'cflags' misc.c
126 $ cc 'CFLAGS' parse.c
127 $ cc 'CFLAGS' plot.c
128 $ cc 'CFLAGS' plot2d.c
129 $ cc 'CFLAGS' plot3d.c
130 $ cc 'CFLAGS' save.c
131 $ cc 'CFLAGS' scanner.c
132 $ cc 'CFLAGS' set.c
133 $ cc 'CFLAGS' show.c
134 $ cc 'CFLAGS' specfun.c
135 $ cc 'CFLAGS' standard.c
136 $ cc 'CFLAGS' stdfn.c
137 $ cc 'CFLAGS' tables.c
138 $ cc 'cflags' 'TERMFLAGS' term.c
139 $ cc 'cflags' time.c
140 $ cc 'CFLAGS' unset.c
141 $ cc 'CFLAGS' util.c
142 $ cc 'CFLAGS' util3d.c
143 $ cc 'CFLAGS' variable.c
144 $ cc 'CFLAGS' vms.c
145 $ cc 'CFLAGS' version.c
146 $ if its_gnuc then cc 'CFLAGS' GNU_CC_INCLUDE:[000000]_assert.c
147 $!
148 $ link/exe=gnuplot.exe -
149 alloc.obj,binary.obj,bitmap.obj,command.obj,contour.obj,dynarray.obj,-
150 datafile.obj,eval.obj,fit.obj,graphics.obj,graph3d.obj,help.obj,hidden3d.obj,-
151 history.obj,internal.obj,interpol.obj,matrix.obj,misc.obj,parse.obj,plot.obj,-
152 plot2d.obj,plot3d.obj,save.obj,scanner.obj,set.obj,show.obj,specfun.obj,-
153 standard.obj,stdfn.obj,tables.obj,term.obj,time.obj,util.obj,util3d.obj,-
154 unset.obj,variable.obj,version.obj,vms.obj'extralib''LINKOPT'
155 $!
156 $ cc 'CFLAGS' bf_test.c
157 $ link /exe=bf_test bf_test,binary,alloc 'extralib''LINKOPT'
158 $ cd [-.demo]
159 $ run [-.src]bf_test.exe
160 $ cd [-.src]
161 $ if .NOT. its_decw  then goto do_docs 
162 $!
163 $ CC 'CFLAGS' GPLT_X11
164 $ CC 'CFLAGS' stdfn.c
165 $ LINK /exe=GNUPLOT_X11 gplt_x11 'extralib''LINKOPT',SYS$INPUT:/OPT
166 SYS$SHARE:DECW$XLIBSHR/SHARE
167 $!
168 $DO_DOCS:
169 $ SET DEF [-.DOCS]
170 $ if f$locate("ALL_TERM_DOC",CFLAGS).ne.f$length(CFLAGS) then -
171         copy /concatenate [-.term]*.trm []allterm.h
172 $ cc 'CFLAGS' /OBJ=doc2rnh.obj/include=([],[-],[-.term],[-.src]) doc2rnh.c 
173 $ cc 'CFLAGS' /OBJ=termdoc.obj/include=([],[-],[-.term],[-.src]) termdoc.c 
174 $ SET DEF [-.src]               ! LINKOPT is defined as being in []
175 $ link [-.docs]doc2rnh.obj,termdoc.obj /exe=[-.docs]doc2rnh 'extralib''LINKOPT'
176 $ doc2rnh := $sys$disk:[-.docs]doc2rnh
177 $ doc2rnh [-.docs]gnuplot.doc [-.docs]gnuplot.rnh
178 $ RUNOFF [-.docs]gnuplot.rnh
179 $ library/create/help sys$disk:[]gnuplot.hlb gnuplot.hlp
180 $!
181 $ if its_decw then -
182   write sys$output "%define GNUPLOT_X11 :== $Disk:[directory]GNUPLOT_X11"
183 $!
184 $FINISH:
185 $ set noverify
186 $ if its_decw then deassign x11
187 $ exit