3 $! I've taken the original build_vms.com, supplied by Nico Baggus, if
4 $! memory serves me correctly, and made some modifications.
6 $! SSL support is based on logicals, or lack thereof. If SSL$INCLUDE
7 $! is defined, then it assumed that hp's SSL product has been installed.
8 $! If OPENSSL is defined, but SSL$INCLUDE isn't, then the OpenSSL defined
9 $! via the defines.com procedure will be used. If neither logical is
10 $! defined, then SSL support will not be compiled/linked in.
12 $! If CURL_BUILD_NOSSL is defined to anything, then no SSL support will
13 $! be built in. This way you can build without SSL support on systems
14 $! that have it without the "automatic" build/link "features".
16 $! If CURL_BUILD_NOHPSSL is defined to anything, it will override the
17 $! SSL$INCLUDE check. This way you can build against OpenSSL, even if
18 $! you have hp SSL installed.
22 $! P1 - LISTING will create .lis files during the C compile
23 $! DEBUG will compile and link with debug
27 $! 2-DEC-2003, MSK, the "original" version. <marty@barra.com>
28 $! It works for me. Your mileage may vary.
29 $! 13-JAN-2004, MSK, moved this procedure to the [.packages.vms] directory
30 $! and updated it to do hardware dependant builds.
31 $! 29-JAN-2004, MSK, moved logical defines into defines.com
32 $! 6-FEB-2004, MSK, put in various SSL support bits
33 $! 9-MAR-2004, MSK, the config-vms.h* files are now copied to the lib and
34 $! src directories as config.h.
36 $ on control_y then goto Common_Exit
37 $ origdir = f$environment("DEFAULT")
38 $ proc = f$environment("PROCEDURE")
39 $ thisdir = f$parse( proc,,,"DEVICE") + f$parse( proc,,,"DIRECTORY")
41 $! Verbose output message stuff. Define symbol to "write sys$output" or "!".
42 $! vo_c - verbose output for compile
44 $! vo_o - object check
46 $ vo_c = "write sys$output"
47 $ vo_l = "write sys$output"
50 $ defines = thisdir + "defines.com"
51 $ if f$search( defines) .eqs. ""
53 $ write sys$output "%CURL-F-DEFFNF, cannot find defines.com procedure"
57 $ cc_qual = "/define=HAVE_CONFIG_H=1/OBJ=OBJDIR:"
59 $ if p1 .eqs. "LISTING" then cc_qual = cc_qual + "/LIST/MACHINE"
62 $ cc_qual = cc_qual + "/LIST/MACHINE/DEBUG/NOOPT"
63 $ link_qual = "/DEBUG"
65 $ msg_qual = "/OBJ=OBJDIR:"
69 $ if f$trnlnm( "CURL_BUILD_NOSSL") .eqs. ""
71 $ if f$trnlnm( "OPENSSL") .nes. ""
74 $ if ( f$trnlnm( "SSL$INCLUDE") .nes. "") .and. -
75 ( f$trnlnm( "CURL_BUILD_NOHPSSL") .eqs. "")
81 $! Put the right main config file in the two source directories for the build.
83 $ if ( openssl .eq. 1) .or. ( hpssl .eq. 1)
85 $ 'vo_c' "%CURL-I-BLDSSL, building with SSL support"
86 $ source_h = "CONFIG-VMS.H_WITH_SSL"
88 $ 'vo_c' "%CURL-I-BLDNOSSL, building without SSL support"
89 $ source_h = "CONFIG-VMS.H_WITHOUT_SSL"
92 $! Only do the copy if the source and destination files are different.
93 $! Put this block into Set NoOn mode so that if the diff command triggers
94 $! an error while error message reporting is turned off, then it won't
95 $! just exit the command procedure mysteriously.
98 $ set message/nof/noi/nos/not
99 $ diff/out=nla0: 'source_h' [--.SRC]CONFIG.H
101 $ set message/f/i/s/t
102 $ if ( status .ne. %X006C8009) ! if status is not "no diff"
104 $ copy 'source_h' [--.SRC]CONFIG.H
105 $ purge/nolog [--.SRC]CONFIG.H
107 $ set message/nof/noi/nos/not
108 $ diff/out=nla0: 'source_h' [--.LIB]CONFIG.H
110 $ set message/f/i/s/t
111 $ if ( status .ne. %X006C8009) ! if status is not "no diff"
113 $ copy 'source_h' [--.LIB]CONFIG.H
114 $ purge/nolog [--.LIB]CONFIG.H
116 $ on control_y then goto Common_Exit
118 $ call build "[--.lib]" "*.c" "objdir:curllib.olb"
119 $ call build "[--.src]" "*.c" "objdir:curlsrc.olb"
120 $ call build "[--.src]" "*.msg" "objdir:curlsrc.olb"
121 $ if ( openssl .eq. 1) .and. ( hpssl .eq. 0)
123 $ 'vo_l' "%CURL-I-LINK_OSSL, linking with OpenSSL"
124 $ link 'link_qual'/exe=exedir:curl.exe -
125 objdir:curlsrc/lib/include=(main,curlmsg),-
126 objdir:curllib/lib, libssl/lib, libcrypto/lib
128 $ if ( openssl .eq. 1) .and. ( hpssl .eq. 1)
130 $ 'vo_l' "%CURL-I-LINK_HPSSL, linking with hp SSL option"
131 $ optfile = "[]hpssl_" + f$getsyi("ARCH_NAME") + ".opt/opt"
132 $ link 'link_qual'/exe=exedir:curl.exe -
133 objdir:curlsrc/lib/include=(main,curlmsg),-
134 objdir:curllib/lib, 'optfile'
136 $ if ( openssl .eq. 0) .and. ( hpssl .eq. 0)
138 $ 'vo_l' "%CURL-I-LINK_NOSSL, linking without SSL support"
139 $ link 'link_qual'/exe=exedir:curl.exe -
140 objdir:curlsrc/lib/include=(main,curlmsg),-
146 $! Subroutine to build everything with a filetype passed in via P2 in
147 $! the directory passed in via P1 and put it in the object library named
151 $ on control_y then exit 2
155 $ reset = f$search("reset")
156 $ if f$search( p3) .eqs. ""
158 $ LIB/CREATE/OBJECT 'p3'
160 $ reset = f$search("reset",1)
162 $ file = f$search(search,1)
163 $ if file .eqs. "" then goto EndLoop
164 $ objfile = f$parse("objdir:.OBJ;",file)
165 $ obj = f$search( objfile, 2)
168 $ if (f$cvtime(f$file(file,"rdt")) .gts. f$cvtime(f$file(obj,"rdt")))
170 $ call compile 'file'
171 $ if .not. $status then exit $status
172 $ lib/object 'p3' 'objfile'
174 $ 'vo_o' "%CURL-I-OBJUTD, ", objfile, " is up to date"
177 $ 'vo_o' "%CURL-I-OBJDNE, ", file, " does not exist"
178 $ call compile 'file'
179 $ if .not. $status then exit $status
180 $ lib/object 'p3' 'objfile'
186 $ endsubroutine ! Build
188 $! Based on the file TYPE, do the right compile command.
189 $! Only C and MSG supported.
192 $ on control_y then exit 2
195 $ qual = p2+p3+p4+p5+p6+p7+p8
196 $ typ = f$parse(file,,,"TYPE") - "."
197 $ cmd_c = "CC "+cc_qual
198 $ cmd_msg = "MESSAGE "+msg_qual
202 $ ENDSUBROUTINE ! Compile
205 $ set default 'origdir'