1e1051a39Sopenharmony_ci$	! OpenSSL config: determine the architecture and run Configure
2e1051a39Sopenharmony_ci$	! Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
3e1051a39Sopenharmony_ci$	!
4e1051a39Sopenharmony_ci$	! Licensed under the Apache License 2.0 (the "License").  You may not use
5e1051a39Sopenharmony_ci$	! this file except in compliance with the License.  You can obtain a
6e1051a39Sopenharmony_ci$	! copy in the file LICENSE in the source distribution or at
7e1051a39Sopenharmony_ci$	! https://www.openssl.org/source/license.html
8e1051a39Sopenharmony_ci$	!
9e1051a39Sopenharmony_ci$	! Very simple for the moment, it will take the following arguments:
10e1051a39Sopenharmony_ci$	!
11e1051a39Sopenharmony_ci$	! -32 or 32	sets /POINTER_SIZE=32
12e1051a39Sopenharmony_ci$	! -64 or 64	sets /POINTER_SIZE=64
13e1051a39Sopenharmony_ci$	! -d		sets debugging
14e1051a39Sopenharmony_ci$	! -h		prints a usage and exits
15e1051a39Sopenharmony_ci$	! -t		test mode, doesn't run Configure
16e1051a39Sopenharmony_ci$
17e1051a39Sopenharmony_ci$	arch = f$edit( f$getsyi( "arch_name"), "lowercase")
18e1051a39Sopenharmony_ci$	pointer_size = ""
19e1051a39Sopenharmony_ci$	dryrun = 0
20e1051a39Sopenharmony_ci$	verbose = 0
21e1051a39Sopenharmony_ci$	here = F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"),,,"SYNTAX_ONLY") - "A.;"
22e1051a39Sopenharmony_ci$
23e1051a39Sopenharmony_ci$	collected_args = ""
24e1051a39Sopenharmony_ci$	P_index = 0
25e1051a39Sopenharmony_ci$	LOOP1:
26e1051a39Sopenharmony_ci$	    P_index = P_index + 1
27e1051a39Sopenharmony_ci$	    IF P_index .GT. 8 THEN GOTO ENDLOOP1
28e1051a39Sopenharmony_ci$	    P = F$EDIT(P1,"TRIM,LOWERCASE")
29e1051a39Sopenharmony_ci$	    IF P .EQS. "-h"
30e1051a39Sopenharmony_ci$           THEN
31e1051a39Sopenharmony_ci$               dryrun = 1
32e1051a39Sopenharmony_ci$               P = ""
33e1051a39Sopenharmony_ci$               TYPE SYS$INPUT
34e1051a39Sopenharmony_ci$               DECK
35e1051a39Sopenharmony_ciUsage: @config [options]
36e1051a39Sopenharmony_ci
37e1051a39Sopenharmony_ci  -32 or 32	Build with 32-bit pointer size.
38e1051a39Sopenharmony_ci  -64 or 64	Build with 64-bit pointer size.
39e1051a39Sopenharmony_ci  -d		Build with debugging.
40e1051a39Sopenharmony_ci  -t            Test mode, do not run the Configure perl script.
41e1051a39Sopenharmony_ci  -v            Verbose mode, show the exact Configure call that is being made.
42e1051a39Sopenharmony_ci  -h		This help.
43e1051a39Sopenharmony_ci
44e1051a39Sopenharmony_ciAny other text will be passed to the Configure perl script.
45e1051a39Sopenharmony_ciSee INSTALL.md for instructions.
46e1051a39Sopenharmony_ci
47e1051a39Sopenharmony_ci$               EOD
48e1051a39Sopenharmony_ci$           ENDIF
49e1051a39Sopenharmony_ci$	    IF P .EQS. "-t"
50e1051a39Sopenharmony_ci$	    THEN
51e1051a39Sopenharmony_ci$		dryrun = 1
52e1051a39Sopenharmony_ci$		verbose = 1
53e1051a39Sopenharmony_ci$		P = ""
54e1051a39Sopenharmony_ci$	    ENDIF
55e1051a39Sopenharmony_ci$	    IF P .EQS. "-v"
56e1051a39Sopenharmony_ci$	    THEN
57e1051a39Sopenharmony_ci$		verbose = 1
58e1051a39Sopenharmony_ci$		P = ""
59e1051a39Sopenharmony_ci$	    ENDIF
60e1051a39Sopenharmony_ci$	    IF P .EQS. "-32" .OR. P .EQS. "32"
61e1051a39Sopenharmony_ci$	    THEN
62e1051a39Sopenharmony_ci$		pointer_size = "-P32"
63e1051a39Sopenharmony_ci$		P = ""
64e1051a39Sopenharmony_ci$	    ENDIF
65e1051a39Sopenharmony_ci$	    IF P .EQS. "-64" .OR. P .EQS. "64"
66e1051a39Sopenharmony_ci$	    THEN
67e1051a39Sopenharmony_ci$		pointer_size = "-P64"
68e1051a39Sopenharmony_ci$		P = ""
69e1051a39Sopenharmony_ci$	    ENDIF
70e1051a39Sopenharmony_ci$	    IF P .EQS. "-d"
71e1051a39Sopenharmony_ci$	    THEN
72e1051a39Sopenharmony_ci$               collected_args = collected_args + " --debug"
73e1051a39Sopenharmony_ci$		P = ""
74e1051a39Sopenharmony_ci$	    ENDIF
75e1051a39Sopenharmony_ci$	    IF P .NES. "" THEN -
76e1051a39Sopenharmony_ci	       collected_args = collected_args + " """ + P1 + """"
77e1051a39Sopenharmony_ci$	    P1 = P2
78e1051a39Sopenharmony_ci$	    P2 = P3
79e1051a39Sopenharmony_ci$	    P3 = P4
80e1051a39Sopenharmony_ci$	    P4 = P5
81e1051a39Sopenharmony_ci$	    P5 = P6
82e1051a39Sopenharmony_ci$	    P6 = P7
83e1051a39Sopenharmony_ci$	    P7 = P8
84e1051a39Sopenharmony_ci$	    P8 = ""
85e1051a39Sopenharmony_ci$	    GOTO LOOP1
86e1051a39Sopenharmony_ci$	ENDLOOP1:
87e1051a39Sopenharmony_ci$
88e1051a39Sopenharmony_ci$	target = "vms-''arch'''pointer_size'"
89e1051a39Sopenharmony_ci$       IF verbose THEN -
90e1051a39Sopenharmony_ci           WRITE SYS$OUTPUT "PERL ''here'Configure ""''target'""",collected_args
91e1051a39Sopenharmony_ci$       IF .not. dryrun THEN -
92e1051a39Sopenharmony_ci           PERL 'here'Configure "''target'"'collected_args'
93e1051a39Sopenharmony_ci$       EXIT $STATUS
94