1 $ ! for batch operation, set default to the gnuplot directory
4 $ ! Command file to compile/link gnuplot, gnuplot_x11, and make gnuplot.hlb
6 $ ! lph: modified for compatibility with VMS 4.x (which lacks 'if ... endif'),
7 $ ! but made the default DECC
10 $ ON ERROR THEN GOTO FINISH
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. "")
22 $ pfix = "/prefix=all"
24 $ if .NOT. its_decc then pfix = "/nolist"
25 $ if .NOT. its_decc then rtl = "VAXCRTL"
28 $ if its_decw then x11 = "X11,"
30 $!-----------------------------------------------------------------
31 $!-----------------------------------------------------------------
32 $! customize CFLAGS for version of VMS, CRTL, and C compiler.
33 $!-----------------------------------------------------------------
34 $ IF F$GETSYI("ARCH_TYPE") .EQ. 1
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'"
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'"
45 $!-----------------------------------------------------------------
47 $! A generic starting point
48 $!-----------------------------------------------------------------
50 $!$ CFLAGS = "/NOWARN/NOOP/DEFINE=(''x11'NO_GIH,PIPES,''rtl')''pfix'"
52 $! ----------------------------------------------------------------
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?)
60 $! Note: VAX uses D_FLOAT, maximum exponent ca 10e +/- 38;
61 $! will cause problems with some of the demos
63 $!$ CFLAGS = "/NOOP/DEFINE=(HAVE_GETCWD, HAVE_SLEEP, "-
64 $! +"SHORT_TERMLIST, NO_GIH,PIPES, ''rtl')"
67 $!-----------------------------------------------------------------
69 $! This will build with gcc v1.42 on VMS 4.7
70 $! (no virtual memory limit problem)
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
77 $! GCC v1.42 has a locale.h, but neither gcc nor VMS v4.7 VAXCRTL has
78 $! the setlocale function
81 $! Note: _assert.c defines assert_gcc, if ndef NDEBUG, but
82 $! cgm.trm undefines NDEBUG, so we always compile/link _assert.c
84 $!$ CFLAGS = "/NOOP/DEFINE=(''x11', HAVE_GETCWD,"-
85 $! +" HAVE_SLEEP, NO_GIH, PIPES, ''rtl')"
87 $!-----------------------------------------------------------------
88 $!-----------------------------------------------------------------
90 $ TERMFLAGS = "/INCLUDE=([],[.-term])"
93 $ if its_gnuc then cc := GCC/NOCASE
94 $ if its_gnuc then EXTRALIB = ",[]_assert,GNU_CC:[000000]GCCLIB/LIB"
97 $ CFLAGS="''cflags'" + "''pfix'"
100 $ if .NOT. its_decc then -
101 LINKOPT=",sys$disk:[]linkopt.vms/opt"
104 $ if its_decw then DEFINE/NOLOG X11 DECW$INCLUDE
105 $ if its_decw then DEFINE/NOLOG SYS SYS$LIBRARY
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
117 $ cc 'CFLAGS' graph3d.c
118 $ cc 'CFLAGS' graphics.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
126 $ cc 'CFLAGS' parse.c
128 $ cc 'CFLAGS' plot2d.c
129 $ cc 'CFLAGS' plot3d.c
131 $ cc 'CFLAGS' scanner.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
140 $ cc 'CFLAGS' unset.c
142 $ cc 'CFLAGS' util3d.c
143 $ cc 'CFLAGS' variable.c
145 $ cc 'CFLAGS' version.c
146 $ if its_gnuc then cc 'CFLAGS' GNU_CC_INCLUDE:[000000]_assert.c
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'
156 $ cc 'CFLAGS' bf_test.c
157 $ link /exe=bf_test bf_test,binary,alloc 'extralib''LINKOPT'
159 $ run [-.src]bf_test.exe
161 $ if .NOT. its_decw then goto do_docs
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
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
182 write sys$output "%define GNUPLOT_X11 :== $Disk:[directory]GNUPLOT_X11"
186 $ if its_decw then deassign x11