forked from Perl/perl5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.com
7714 lines (7686 loc) · 219 KB
/
configure.com
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
$! OpenVMS configuration procedure for Perl -- do not attempt to run under DOS
$ sav_ver = 'F$VERIFY(0)'
$ on control_y then goto clean_up
$! SET VERIFY
$!
$! For example, if you unpacked perl into: [USER.PERL-5n...] then you will
$! want to cd into the tree and execute Configure:
$!
$! $ SET DEFAULT [USER.PERL5_xxx]
$! $ @Configure
$!
$! or
$!
$! $ SET DEFAULT [USER.PERL5_xxx]
$! $ @Configure "-des"
$!
$! That's it. If you get into a bind trying to build perl on VMS then
$! definitely read through the README.VMS file.
$! Beyond that send email to [email protected]
$!
$! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$!
$! send suggestions to:
$! Dan Sugalski <[email protected]>
$! Thank you!!!!
$!
$! Adapted and converted from Larry Wall & Andy Dougherty's
$! "Configure generated by metaconfig 3.0 PL60." by Peter Prymmer
$! (a Bourne sh[ell] script for configuring the installation of perl
$! on non-VMS systems) in the perl5.002|3 epoch (spring/summer 1996)
$! with much valuable help from Charles Bailey &
$! the whole VMSPerl crew.
$! Extended and messed about with by Dan Sugalski
$!
$! VMS-isms we will need:
$ echo = "write sys$output "
$ cat = "type"
$ delete := delete ! local symbol overrides globals with qualifiers
$ gcc_symbol = "gcc"
$ ld = "Link/nodebug"
$ ans = ""
$ macros = ""
$ extra_flags = ""
$ user_c_flags = ""
$ use_ieee_math = "y"
$ be_case_sensitive = "n"
$ shorten_long_symbols = "y"
$ unlink_all_versions = "n"
$ builder = "MMK"
$ use_vmsdebug_perl = "n"
$ use64bitall = "n"
$ use64bitint = "y"
$ uselongdouble = "n"
$ uselargefiles = "y"
$ usestdstat = "n"
$ usesitecustomize = "n"
$ C_Compiler_Replace = "CC="
$ thread_upcalls = "MTU="
$ thread_kernel = "MTK="
$ use_two_pot_malloc = "N"
$ use_pack_malloc = "N"
$ use_debugmalloc = "N"
$ ccflags = ""
$ static_ext = ""
$ dynamic_ext = ""
$ nonxs_ext = ""
$ nonxs_ext2 = ""
$ vms_default_directory_name = F$ENVIRONMENT("DEFAULT")
$!
$! Sebastian Bazley's request: close the CONFIG handle with /NOLOG
$! qualifier "just in case" (configure.com is re @ed in a bad state).
$! This construct was tested to be not a problem as far back as
$! VMS V5.5-2, hopefully earlier versions are OK as well.
$!
$ CLOSE/NOLOG CONFIG
$!
$! Now keep track of open files
$!
$ vms_filcnt = F$GETJPI ("","FILCNT")
$!
$!: compute my invocation name
$ me = F$ENVIRONMENT("PROCEDURE")
$!
$! Many null statements (begin with colon ':') in the Bourne shell version of
$! this script serve as comments/placeholders. I have retained some of the ones
$! that will help you compare this .COM file to the sh version - as well as
$! leave placeholders for future improvements to this .COM file.
$! sfn = VMS "skipped for now"
$!
$!: Proper PATH separator !sfn
$!: Proper PATH setting !sfn
$!: Sanity checks !sfn "Say '@''$me''"
$!: On HP-UX, large Configure scripts may exercise a bug in /bin/sh !sfn
$!: Configure runs within the UU subdirectory !->after find MANIFEST
$! <big long list of default values (mostly null)>
$!: We must find out about Eunice early !(?)
$!: list of known cpp symbols, sorted alphabetically !sfn
$! al = al + "..."
$!: default library list !sfn
$! <no hints files in use (yet?)>
$!: Extra object files, if any, needed on this platform. !sfn
$!: Possible local include directories to search. !sfn
$!: Set locincpth to "" in a hint file to defeat local include searches. !sfn
$!locincpth="/usr/local/include /opt/local/include /usr/gnu/include" !sfn
$!locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
$!: no include file wanted by default !sfn
$!inclwanted='' !sfn
$!: Possible local library directories to search. !sfn
$!loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib" !sfn
$!loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib" !sfn
$!: general looking path for locating libraries !sfn
$!glibpth="/lib/pa1.1 /usr/shlib /usr/lib/large /lib /usr/lib" !sfn
$!glibpth="$glibpth $xlibpth /lib/large /usr/lib/small /lib/small" !sfn
$!glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/shlib" !sfn
$!: Private path used by Configure to find libraries. Its value !sfn
$!: is prepended to libpth. This variable takes care of special !sfn
$!: machines, like the mips. Usually, it should be empty. !sfn
$!plibpth='' !sfn
$!: List of libraries we want. !sfn
$!libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl' !sfn
$!libswanted="$libswanted ld sun m c cposix posix ndir dir crypt" !sfn
$!libswanted="$libswanted ucb bsd BSD PW x" !sfn
$!: We probably want to search /usr/shlib before most other libraries. !sfn
$!: This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist. !sfn
$!glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'` !sfn
$!glibpth="/usr/shlib $glibpth" !sfn
$!: Do not use vfork unless overridden by a hint file. !sfn
$!usevfork=false !sfn
$!: script used to extract .SH files with variable substitutions !sfn
$!: produce awk script to parse command line options !sfn
$!sfn (assume no sed awk) see below
$!: process the command line options
$!
$!: set up default values
$ fastread=""
$ reuseval="false"
$ maniskip = "false"
$ IF F$TYPE(config_sh) .EQS. "" THEN config_sh=""
$ alldone=""
$ error=""
$ silent=""
$ extractsh=""
$ override=""
$ knowitall=""
$ ccname="DECC"
$ Dec_C_Version = ""
$ cxxversion = ""
$ use_threads = "F"
$ use_ithreads = "N"
$!
$!: option parsing
$ config_args = ""
$ IF (P1 .NES. "")
$ THEN !one or more switches was thrown
$ i = 1
$ bang = 0
$Param_loop:
$ IF (P'i'.NES."")
$ THEN
$ bang = bang + 1
$ config_args = config_args + F$FAO(" !AS",P'i')
$ ENDIF
$ i = i + 1
$ IF (i.LT.9) THEN GOTO Param_loop !DCL allows P1..P8
$!
$ i = 1
$Opt_loop:
$ IF (F$EXTRACT(0,1,P'i') .EQS. "-") THEN P'i' = P'i' - "-"
$ IF (F$EXTRACT(0,1,P'i') .EQS. "/") THEN P'i' = P'i' - "/"
$Remove_quotation_mark:
$ P'i' = P'i' - """"
$ IF F$LOCATE("""",P'i') .LT. F$LENGTH(P'i') THEN GOTO Remove_quotation_mark
$ gotopt = "f" !"alse"
$ gotshortopt = "f" !"alse"
$ IF (F$EXTRACT(0,1,P'i') .EQS. "d")
$ THEN
$ fastread = "yes"
$ gotopt = "t" !"rue"
$ P'i' = P'i' - "d"
$ gotshortopt = "t" !"rue"
$ ENDIF
$ IF (F$EXTRACT(0,1,P'i') .EQS. "e")
$ THEN
$ alldone = "cont"
$ gotopt = "t"
$ P'i' = P'i' - "e"
$ gotshortopt = "t"
$ ENDIF
$ IF (F$EXTRACT(0,1,P'i') .EQS. "f") ! "-f"
$ THEN
$ P'i' = P'i' - "f"
$ config_sh = P'i'
$ IF (F$SEARCH(config_sh).NES."")
$ THEN
$ test_config_sh = F$FILE_ATTRIBUTES(config_sh,"PRO")
$ IF (F$LOCATE("R",test_config_sh).NE.F$LENGTH(test_config_sh))
$ THEN
$ config_dflt = "y"
$ CONTINUE !at this point check UIC && if test allows...
$ !to be continued ?
$ ELSE
$ echo "''me': cannot read config file ''config_sh'."
$ error="true"
$ ENDIF
$ ELSE
$ echo "''me': cannot read config file ''config_sh'."
$ error="true"
$ ENDIF
$ gotopt = "t"
$ ENDIF
$ IF (F$EXTRACT(0,1,P'i') .EQS. "h") ! "-h"
$ THEN
$ error = "true"
$ gotopt = "t"
$ P'i' = P'i' - "h"
$ gotshortopt = "t"
$ ENDIF
$ IF (F$EXTRACT(0,1,P'i') .EQS. "m") ! "-m"
$ THEN
$ maniskip = "true"
$ gotopt = "t"
$ P'i' = P'i' - "m"
$ gotshortopt = "t"
$ ENDIF
$ IF (F$EXTRACT(0,1,P'i') .EQS. "r") ! "-r"
$ THEN
$ reuseval = "true"
$ gotopt = "t"
$ P'i' = P'i' - "r"
$ gotshortopt = "t"
$ ENDIF
$ IF (F$EXTRACT(0,1,P'i') .EQS. "s") ! "-s"
$ THEN
$ silent = "true"
$ gotopt = "t"
$ P'i' = P'i' - "s"
$ gotshortopt = "t"
$ ENDIF
$ IF (F$EXTRACT(0,1,P'i') .EQS. "E") ! "-E"
$ THEN
$ alldone = "exit"
$ gotopt = "t"
$ ENDIF
$ IF (F$EXTRACT(0,1,P'i') .EQS. "K") ! "-K"
$ THEN
$ knowitall = "true"
$ gotopt = "t"
$ P'i' = P'i' - "K"
$ gotshortopt = "t"
$ ENDIF
$ IF (F$EXTRACT(0,1,P'i') .EQS. "O") ! "-O"
$ THEN
$ override = "true"
$ gotopt = "t"
$ P'i' = P'i' - "O"
$ gotshortopt = "t"
$ ENDIF
$ IF (F$EXTRACT(0,1,P'i') .EQS. "S") ! "-S"
$ THEN
$ extractsh = "true" !VMS? Yes with munchconfig
$ gotopt = "t"
$ P'i' = P'i' - "S"
$ gotshortopt = "t"
$ ENDIF
$ IF (F$EXTRACT(0,1,P'i') .EQS. "D") ! "-D"
$ THEN
$ P'i' = P'i' - "D"
$ IF (F$LOCATE("=",P'i') .EQ. F$LENGTH(P'i'))
$ THEN
$ tmp = P'i' + "=""define"""
$ 'tmp'
$ DELETE/SYMBOL tmp
$ ELSE
$ IF (F$LOCATE("=",P'i') .EQ. (F$LENGTH(P'i') - 1))
$ THEN
$ me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
$ echo "''me': use ""-Usymbol=val"" not ""-Dsymbol=""."
$ echo "''me': ignoring -D",P'i'
$ ELSE
$ tmp = F$EXTRACT(0,F$LOCATE("=",P'i'),P'i')
$ tmp = tmp + "=""" + F$EXTRACT(F$LOCATE("=",P'i')+1,F$LENGTH(P'i'),P'i') + """"
$ 'tmp'
$ DELETE/SYMBOL tmp
$ ENDIF
$ ENDIF
$ gotopt = "t"
$ ENDIF
$ IF (F$EXTRACT(0,1,P'i') .EQS. "U") ! "-U"
$ THEN
$ P'i' = P'i' - "U"
$ IF (F$LOCATE("=",P'i') .EQ. F$LENGTH(P'i'))
$ THEN
$ tmp = P'i' + "="""""
$ 'tmp'
$ DELETE/SYMBOL tmp
$ ELSE
$ IF (F$LOCATE("=",P'i') .LT. (F$LENGTH(P'i') - 1))
$ THEN
$ me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
$ echo "''me': use ""-Dsymbol=val"" not ""-Usymbol=val""."
$ echo "''me': ignoring -U",P'i'
$ ELSE
$ tmp = P'i' + "=""undef"""
$ 'tmp'
$ DELETE/SYMBOL tmp
$ ENDIF
$ ENDIF
$ gotopt = "t"
$ ENDIF
$ IF (F$EXTRACT(0,1,P'i') .EQS. "V")
$ THEN
$ me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
$ echo "''me' generated by an unknown version of EDT."
$ STOP
$ EXIT
$ ENDIF
$ IF .NOT.gotopt
$ THEN
$ echo "''me': unknown option ",P'i'
$ error = "true"
$ ENDIF
$ IF (F$LENGTH(P'i').GT.0).AND.(gotshortopt) THEN i = i - 1 !clustered switch
$ i = i + 1
$ IF (i .LT. (bang + 1)) THEN GOTO Opt_loop
$!
$ ENDIF ! (P1 .NES. "")
$ config_args = F$EDIT(config_args,"TRIM")
$!
$ IF (error)
$ THEN
$ me = F$PARSE(me,,,"DIRECTORY")+ F$PARSE(me,,,"NAME")
$ echo "Usage: @''me' [-dehmr""EKOSV""] [-fconfig.sh] [""-Dsymbol""] [""-Dsymbol=value""]"
$ echo " [-Usymbol] [-Usymbol=]"
$ TYPE SYS$INPUT:
$ DECK
"-d" : use defaults for all answers.
"-e" : go on without questioning past the production of config.sh. *
"-f" : specify an alternate default configuration file.
"-h" : print this help message and exit (with an error status).
"-m" : skip the MANIFEST check to see that all files are present
"-r" : reuse C symbols value if possible (skips costly nm extraction).*
"-s" : silent mode, only echoes questions and essential information.
-"D" : define symbol to have some value: *
-"Dsymbol" symbol gets the value 'define'
-"Dsymbol=some value" symbol is set to "some value"
-E : stop at the end of questions, after having produced config.sh. *
-K : do not use unless you know what you are doing.
-O : let -D and -U override definitions from loaded configuration file. *
-S : perform variable substitutions on all .SH files (can mix with -f) *
-"U" : undefine symbol: *
-"Usymbol" symbol gets the value 'undef'
-"Usymbol=" symbol gets completely empty
-V : print version number and exit (with a zero status).
$ EOD
$ echo "%Config-I-VMS, lower case switches must be enclosed"
$ echo "-Config-I-VMS, in double quotation marks, e.g.:"
$ echo "-Config-I-VMS, @Configure ""-des"""
$ echo "-Config-I-VMS, * indicates switch may not be fully implemented for VMS."
$ SET DEFAULT 'vms_default_directory_name' !be kind rewind
$ STOP
$ EXIT 3 ! $STATUS = "%X00000003" (informational)
$ ENDIF
$!
$ GOTO Check_silence
$!
$Shut_up:
$ IF F$Mode() .eqs. "BATCH"
$ THEN
$ x = F$GETQUI("CANCEL_OPERATION") ! clear the deck
$ x = "THIS_JOB"
$ bproc_queue = f$getqui("DISPLAY_QUEUE","QUEUE_NAME","*",x)
$ bproc_entry = f$getqui("DISPLAY_JOB","ENTRY_NUMBER",,x)
$ bproc_name = f$getqui("DISPLAY_JOB","JOB_NAME",,x)
$ bproc_log_spec = f$getqui("DISPLAY_JOB","LOG_SPECIFICATION",,x)
$ STDOUT = F$PARSE(bproc_name, bproc_log_spec, ".LOG")
$ WRITE SYS$OUTPUT "Writing output of entry ''bproc_entry' in queue ''bproc_queue' to a new version of: "
$ WRITE SYS$OUTPUT STDOUT
$ DELETE_/SYMBOL x
$ DELETE_/SYMBOL bproc_queue
$ DELETE_/SYMBOL bproc_entry
$ DELETE_/SYMBOL bproc_name
$ DELETE_/SYMBOL bproc_log_spec
$ ELSE
$ STDOUT = F$TRNLNM("SYS$OUTPUT")
$ ENDIF
$ DEFINE SYS$OUTPUT "_NLA0:"
$ echo4 = "write STDOUT "
$ cat4 = "TYPE/OUTPUT=''STDOUT'"
$ open/write/share=read STDOUT 'STDOUT'
$ RETURN
$!
$Check_silence:
$ IF (silent)
$ THEN
$ GOSUB Shut_up
$ ELSE
$ echo4 = "write SYS$OUTPUT "
$ cat4 = "TYPE"
$ ENDIF
$!
$!: run the defines and the undefines, if any, but leave the file out there...
$! Unfortunately Configure.COM in DCL is not yet set up to do this -
$! maybe someday
$!
$!: set package name
$ package = "perl5"
$ packageup = F$EDIT((package - "5"),"UPCASE")
$!
$!: Eunice requires " " instead of "", can you believe it
$ echo ""
$!: Here we go...
$ echo "Beginning of configuration questions for ''package'."
$ echo ""
$!
$!: Some greps do not return status, grrr.
$ contains = "SEARCH"
$!
$!: first determine how to suppress newline on echo command !cant DCL is record oriented
$! echo "Checking ''echo' to see how to suppress newlines..."
$! echo "giving up..."
$! echo "The star should be here-->*"
$!
$!: Now test for existence of everything in MANIFEST
$ echo ""
$ echo4 "First let's make sure your kit is complete. Checking..."
$ manifestfound = ""
$ miss_list = ""
$! Here I assume we are in the [foo.PERLxxx...] tree
$! because the search routine simply does set def [-] if necessary.
$ file_2_find = "MANIFEST" !I hope this one is not in [foo.PERL5xxx.VMS...]
$Research_manifest:
$ manifestfound = F$SEARCH(file_2_find)
$ IF (manifestfound .EQS. "")
$ THEN
$ IF F$PARSE(F$ENVIRONMENT("DEFAULT"),,,"DIRECTORY",).NES."[000000]"
$ THEN
$ SET DEFAULT [-]
$ GOTO Research_manifest
$ ELSE
$ echo ""
$ echo "There is no MANIFEST file. I hope your kit is complete !"
$ miss_list = ""
$ GOTO Beyond_manifest
$ ENDIF
$ ELSE
$! MANIFEST. has been found and we have set def'ed there.
$!
$ escape_extended_chars: subroutine
$ string = 'p1' ! It's the name of the symbol
$ chars_to_escape = p2
$ sindex = 0
$ slength = f$length(string)
$ loop_over_chars:
$ if sindex .eq. slength then goto end_loop_over_chars
$ char = f$extract(sindex, 1, string)
$ if f$locate(char, chars_to_escape) .lt. f$length(chars_to_escape)
$ then
$ string = f$extract(0, sindex, string) + "^" + f$extract(sindex, slength, string)
$ slength = slength + 1 ! we've increased overall length by 1
$ sindex = sindex + 1 ! don't check the char we just escaped again
$ endif
$ sindex = sindex + 1
$ goto loop_over_chars
$ end_loop_over_chars:
$ 'p1' == string
$!
$ endsubroutine
$!
$! after finding MANIFEST let's create (but not yet enter) the UU subdirectory
$!
$ IF (manifestfound .NES. "")
$ THEN
$ IF ( F$SEARCH("UU.DIR").EQS."" )
$ THEN
$ CREATE/DIRECTORY [.UU]
$ ELSE
$ IF ( F$SEARCH("[.UU.CXX_REPOSITORY]*.*").NES."" )
$ THEN
$ DELETE/NOLOG/NOCONFIRM [.UU.CXX_REPOSITORY]*.*;*
$ SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) [.UU]CXX_REPOSITORY.DIR
$ ENDIF
$ IF ( F$SEARCH("[.UU]*.*").NES."" ) THEN DELETE/NOLOG/NOCONFIRM [.UU]*.*;*
$ ENDIF
$!: Configure runs within the UU subdirectory
$ SET DEFAULT [.UU]
$!
$! a little redundancy never hurt anybody?
$ file_2_find = "[-]" + file_2_find
$ manifestfound = F$SEARCH(file_2_find)
$!
$ OPEN/WRITE MISSING MISSING.
$!change to "FALSE" if you wish to skip the manifest search
$!(which after all is rather slow in DCL :-)
$ IF (maniskip)
$ THEN
$ echo "Skipping MANIFEST check as requested"
$ ELSE
$!
$ OPEN/READ CONFIG 'manifestfound'
$Read_loop_manifest:
$ READ/END_OF_FILE = Done_manifest CONFIG line
$! This algorithm turns "foo/bar/baz.c" into "[.foo.bar]baz.c"
$! [email protected] 10-JUN-1996 20:31:46
$! 2-MAR-1998 15:46:11 Improved to turn "foo/bar/baz.c.buz"
$! into "[.foo.bar]baz.c_buz as happens with vmstar and unzip
$ line = F$EDIT(line,"TRIM, COMPRESS")
$ file_2_find = F$EXTRACT(0,F$LOCATE(" ",line),line)
$ IF F$LOCATE("/",file_2_find) .NE. F$LENGTH(file_2_find)
$ THEN
$ escaped_fname == file_2_find
$ call escape_extended_chars escaped_fname "~!#&\'`()+@{},;[]%^=\"
$ file_2_find = escaped_fname
$Re_strip_line_manifest:
$ loca = F$LOCATE("/",file_2_find)
$ ante = F$EXTRACT(0,loca,file_2_find)
$ post = F$EXTRACT(loca,F$LENGTH(file_2_find),file_2_find)
$ test_this = ante + "." + (post - "/")
$ IF F$LOCATE("/",test_this) .NE. F$LENGTH(test_this)
$ THEN
$ file_2_find = ante + "." + (post - "/")
$ GOTO Re_strip_line_manifest
$ ELSE
$ file_2_find = ante + "]" + (post - "/")
$ ENDIF
$ file_2_find = "[-."+file_2_find
$ ELSE
$ file_2_find = "[-]" + file_2_find
$ ENDIF
$!
$ tmp = F$PARSE(file_2_find + ";",,,,"SYNTAX_ONLY")
$ IF F$SEARCH(tmp) .NES. "" THEN file_2_find = tmp
$ dirname = F$EXTRACT(0,F$LOCATE("]",file_2_find),file_2_find) + "]"
$ file_2_find = file_2_find - dirname
$!
$! may not need double dot check on ODS-5 volumes
$ found = F$SEARCH(dirname + file_2_find)
$ IF found .NES. "" THEN GOTO Read_loop_manifest
$!
$ dots = 0
$Dot_loop:
$ dot_ele = F$ELEMENT(dots,".",file_2_find)
$ IF dot_ele .EQS. "." THEN GOTO Eo_dot_loop
$ IF dots .eq. 0
$ THEN basename = f$extract(0,f$locate(".",file_2_find),file_2_find) + "."
$ ELSE basename = basename + dot_ele + "_"
$ ENDIF
$ dots = dots + 1
$ GOTO dot_loop
$Eo_dot_loop:
$ IF (((f$length(file_2_find)+1) .eq. f$length(basename)) .and. -
(f$extract(f$length(basename)-1,1,basename) .eqs. "_")) THEN -
basename = f$extract(0,f$length(basename)-1,basename)
$ file_2_find = dirname + basename
$!
$ found = F$SEARCH(file_2_find)
$ IF (found .EQS. "" .AND. dots .GT. 2)
$ THEN
$! 17-DEC-1999 Improved to turn "[.foo.bar]baz.c_buz" into
$! "[.foo.bar]baz_c.buz" to cover unzipped archives and put
$! "[.foo.bar]baz.c_buz,baz_c.buz" into missing list if neither is found.
$ dotloc = f$locate(".",basename)
$ basename[dotloc,1] := "_"
$ dot_ele = F$ELEMENT(dots - 1,"_",f$extract(dotloc,f$length(basename),basename))
$ basename = -
f$extract(0,f$length(basename)-(f$length(dot_ele)+1),basename) -
+ "." + dot_ele
$ found = F$SEARCH(dirname + basename)
$ file_2_find = file_2_find + "," + basename
$ ENDIF
$ tildeloc = f$locate("~",basename)
$ IF (found .EQS. "" .AND. tildeloc .LT. f$length(basename))
$ THEN
$ basename[tildeloc,1] := "_"
$ found = F$SEARCH(dirname + basename)
$ file_2_find = file_2_find + "," + basename
$ ENDIF
$ IF (found .EQS. "")
$ THEN
$ WRITE MISSING file_2_find
$ IF ((F$LENGTH(miss_list)+F$LENGTH(file_2_find)).LT.250)
$ THEN
$ miss_list = miss_list + "," + file_2_find
$ ENDIF
$ ENDIF
$ GOTO Read_loop_manifest
$Done_manifest:
$ CLOSE CONFIG
$ ENDIF !"TRUE"
$ CLOSE MISSING
$ ENDIF ! (manifestfound .NES. "")
$Beyond_manifest:
$ IF (miss_list .NES. "")
$ THEN
$ echo "Some of the files not found include:"
$ cat4 MISSING.
$ ENDIF
$ IF ((miss_list .NES. "").OR.(manifestfound .EQS. ""))
$ THEN
$ TYPE SYS$INPUT:
$ DECK
THIS PACKAGE SEEMS TO BE INCOMPLETE.
You have the option of continuing the configuration process, despite the
distinct possibility that your kit is damaged, by typing 'y'es. If you
do, don't blame me if something goes wrong. I advise you to type 'n'o
and contact the author ([email protected])
$ EOD
$ READ SYS$COMMAND/PROMPT="Continue? [n] " ans
$ IF ans
$ THEN
$ echo4 "Continuing..."
$ ELSE
$ echo4 "ABORTING..."
$ GOTO Clean_up
$ ENDIF
$ ELSE
$ echo4 "Looks good..."
$ DELETE/NOLOG/NOCONFIRM MISSING.;
$ ENDIF ! (miss_list .NES. "")
$ ENDIF ! (manifestfound .EQS. "") ELSE
$!
$! after finding MANIFEST (see above)
$!: Configure runs within the UU subdirectory
$!
$!: compute the number of columns on the terminal for proper question formatting
$ IF F$MODE() .EQS. "BATCH"
$! else it winds up being 512 in batch
$ THEN COLUMNS = 80
$ ELSE COLUMNS = F$GETDVI("SYS$OUTPUT","DEVBUFSIZ")
$ ENDIF
$! "-des" sets SYS$OUTPUT to NL: with a DEVBUFSIZ too large (512 again)
$ IF COLUMNS .GT. 210 THEN COLUMNS = 80
$! not sure if this would actually be needed - it hopefully will not hurt
$ IF COLUMNS .LT. 40 THEN COLUMNS = 40
$!
$!: set up the echo used in my read !sfn
$!: now set up to do reads with possible shell escape and default assignment !sfn
$ GOTO Beyond_myread
$!
$! The sub_rp splitting is intended to handle long symbols such as the dflt for
$! extensions.
$!
$myread:
$ ans = ""
$ len_rp = F$LENGTH(rp)
$ If (.NOT. silent) Then echo ""
$ IF len_rp .GT. 210
$ THEN
$ i_rp = 0
$ rp_loop:
$ sub_rp = F$EXTRACT(i_rp,COLUMNS,rp)
$ i_rp = i_rp + COLUMNS
$ if i_rp .LT. len_rp THEN echo4 "''sub_rp'"
$ IF i_rp .LT. len_rp THEN GOTO rp_loop
$ ELSE
$ sub_rp = rp
$ ENDIF
$ if (fastread)
$ then
$ echo4 "''sub_rp'"
$ else
$ READ SYS$COMMAND/PROMPT="''sub_rp'" ans
$ endif
$ IF (ans .EQS. "&-d")
$ THEN
$ echo4 "(OK, I will run with -d after this question.)"
$ echo ""
$ deferred_fastread =1
$ goto myread
$ ENDIF
$ IF (ans .EQS. "&-s")
$ THEN
$ echo4 "(OK, I will run with -s after this question.)"
$ echo ""
$ deferred_silent = 1
$ goto myread
$ ENDIF
$ if (bool_dflt .nes. "")
$ then
$ if (ans .eqs. "") then ans = bool_dflt
$ ans = f$extract(0,1,f$edit(ans,"collapse,upcase"))
$ if (ans .eqs. "Y" .or. ans .eqs. "1" .or. ans .eqs. "T")
$ then
$ ans = "Y"
$ else
$ if (ans .eqs. "N" .or. ans .eqs. "0" .or. ans .eqs. "F")
$ then
$ ans = "N"
$ else
$ echo4 "Input not understood please answer 'Yes' or 'No'"
$ goto myread
$ endif
$ endif
$ bool_dflt = ""
$ else
$ ans = f$edit(ans,"trim,compress")
$ if (ans .eqs. "") then ans = dflt
$ if (f$edit(ans,"upcase") .eqs. "NONE") then ans = ""
$ endif
$ if f$type(deferred_silent) .nes. ""
$ then
$ silent := true
$ GOSUB Shut_up
$ delete/symbol deferred_silent
$ ENDIF
$ if f$type(deferred_fastread) .nes. ""
$ then
$ fastread = 1
$ delete/symbol deferred_fastread
$ endif
$ RETURN
$!
$Beyond_myread:
$!
$!: create .config dir to save info across Configure sessions
$ IF ( F$SEARCH("[-]CONFIG.DIR").EQS."" )
$ THEN
$ CREATE/DIRECTORY [-.CONFIG]
$ OPEN/WRITE CONFIG [-.CONFIG]README.
$ WRITE CONFIG -
"This directory created by Configure to save information that should"
$ WRITE CONFIG -
"persist across sessions."
$ WRITE CONFIG ""
$ WRITE CONFIG -
"You may safely delete it if you wish."
$ CLOSE CONFIG
$ ENDIF
$!
$ IF F$TYPE(usedevel) .EQS. "" THEN usedevel = "undef"
$ patchlevel_h = F$SEARCH("[-]patchlevel.h")
$ IF (patchlevel_h.NES."")
$ THEN
$ SEARCH 'patchlevel_h' "define","PERL_VERSION","epoch"/match=and/out=[]ver.out
$ IF .NOT. usedevel .AND. usedevel .NES. "define"
$ THEN
$ OPEN/READ CONFIG []ver.out
$ READ CONFIG line
$ CLOSE CONFIG
$ tmp = F$EDIT(line,"TRIM,COMPRESS")
$ xpatchlevel = F$INTEGER(F$ELEMENT(2," ",tmp))
$ line = xpatchlevel / 2
$ tmp = xpatchlevel - ( line * 2 )
$ IF tmp .NE. 0
$ THEN
$ echo4 "patchlevel is " + F$STRING(xpatchlevel)
$ cat4 SYS$INPUT:
$ DECK
*** WHOA THERE!!! ***
This is an UNSTABLE DEVELOPMENT release.
(The patchlevel, is odd--as opposed to even,
and that signifies a development release. If you want a
maintenance release, you want an even-numbered release.)
Do ***NOT*** install this into production use.
Data corruption and crashes are possible.
It is most seriously suggested that you do not continue any further
unless you want to help in developing and debugging Perl.
$ EOD
$ bool_dflt="n"
$ rp="Do you really want to continue? [''bool_dflt'] "
$ fastread_save = fastread
$ fastread := FALSE
$ GOSUB myread
$ fastread = fastread_save
$ delete/symbol fastread_save
$ IF ans
$ THEN
$ echo4 "Okay, continuing."
$ ELSE
$ echo4 "Okay, bye."
$ DELETE/NOLOG/NOCONFIRM []ver.out;
$ GOTO Clean_up
$ ENDIF
$ ENDIF
$ DELETE/SYMBOL line
$ DELETE/SYMBOL tmp
$ ENDIF
$ DELETE/NOLOG/NOCONFIRM []ver.out;
$ ENDIF
$!: general instructions
$ needman = "true"
$ firsttime = "true"
$ user = F$EDIT(F$GETJPI("","USERNAME"),"TRIM,COLLAPSE")
$ IF .NOT.(F$SEARCH("[-.CONFIG]INSTRUCT.").EQS."")
$ THEN
$ messages = F$ENVIRONMENT("MESSAGE")
$ SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT
$ contains /NOOUTPUT [-.CONFIG]INSTRUCT. 'user'
$ IF .NOT.($status.EQ.%X08D78053)
$ THEN
$ firsttime=""
$ bool_dflt = "n"
$ rp = "Would you like to see the instructions? [''bool_dflt'] "
$ GOSUB myread
$ if .NOT.ans THEN needman=""
$ ENDIF
$ SET MESSAGE 'messages'
$ ENDIF
$ if (fastread.AND.silent.AND.(alldone.eqs."cont")) THEN needman=""
$!
$ IF (needman)
$ THEN
$ TYPE SYS$INPUT:
$ DECK
This installation shell script will examine your system and ask you questions
to determine how the perl5 package should be installed. If you get
stuck on a question, you may use a ^C or ^Y shell escape to STOP this
process, edit something, then restart this process as you just did.
Many of the questions will have default answers in square
brackets; typing carriage return will give you the default.
$ EOD
$ if (fastread)
$ then
$ echo4 ""
$ else
$ READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
$ endif
$ TYPE SYS$INPUT:
$ DECK
In a hurry? You may run '@Configure "-d"'. This will bypass nearly all
the questions and use the computed defaults (or the previous answers provided
there was already a config.sh file). Type '@Configure "-h"' for a list of
options.
$ EOD
$ if (fastread)
$ then
$ echo4 ""
$ else
$ READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
$ endif
$ TYPE SYS$INPUT:
$ DECK
Much effort has been expended to ensure that this shell script will
run on any VMS system. If despite that it blows up on yours, your
best bet is to edit Configure.com and @ it again. Whatever problems
you have with Configure.com, let me ([email protected]) know how I blew
it.
$ EOD
$!This installation script affects things in two ways:
$!
$!1) it may do direct variable substitutions on some of the files included
$! in this kit.
$!2) it builds a config.h file for inclusion in C programs. You may edit
$! any of these files as the need arises after running this script.
$!
$!If you make a mistake on a question, there is no easy way to back up to it
$!currently.
$!
$ if (fastread)
$ then
$ echo4 ""
$ else
$ READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
$ endif
$ IF (F$SEARCH("[-.CONFIG]INSTRUCT.").EQS."")
$ THEN
$ OPEN/WRITE CONFIG [-.CONFIG]INSTRUCT.
$ WRITE CONFIG user
$ CLOSE CONFIG
$ ENDIF
$ ENDIF !(needman .EQS. "true")
$!
$!: see if sh knows # comments !sfn
$!: figure out how to guarantee sh startup !sfn
$!: find out where common programs are !sfn
$!loclist="awk/cat/comm/cp/echo/expr/find/grep/ln/ls/mkdir/rm/sed/sort/touch/tr/uniq"
$!trylist="byacc/cpp/csh/date/egrep/less/line/more/nroff/perl/pg/sendmail/test/uname"
$! echo "I don't know where '$file' is, and my life depends on it."
$! echo "Go find a public domain implementation or fix your PATH setting!"
$! echo ""
$! echo "Don't worry if any of the following aren't found..."
$!: determine whether symbolic links are supported !sfn !jem- further down
$!: see whether [:lower:] and [:upper:] are supported character classes !sfn
$!: set up the translation script tr, must be called with ./tr of course !sfn
$!
$!: Try to determine whether config.sh was made on this system
$!: Get old answers from old config file if Configure was run on the
$!: same system, otherwise use the hints.
$ config_sh_es = "''config_sh'/[-]config.sh/"
$ i = 0
$ max = 3
$Config_sh_look:
$ config_sh = F$ELEMENT(i,"/",config_sh_es)
$ i = i + 1
$ IF (config_sh.NES."/").AND.(config_sh.NES."")
$ THEN
$ configshfound = F$SEARCH(config_sh)
$ IF (configshfound.NES."") THEN GOTO Config_sh_found
$ ENDIF
$ IF (i.LT.max) THEN GOTO Config_sh_look
$ osname = F$EDIT(F$GETSYI("NODE_SWTYPE"),"COLLAPSE")
$ IF (configshfound.EQS."")
$ THEN
$ config_sh = "[-]config.sh" ! the fallback default
$ GOTO Beyond_config_sh
$ ENDIF
$Config_sh_found:
$ IF F$TYPE(osname) .EQS. "" THEN osname = F$EDIT(F$GETSYI("NODE_SWTYPE"),"COLLAPSE")
$ bool_dflt = "n"
$ IF F$TYPE(config_dflt) .NES. "" THEN bool_dflt = config_dflt
$ rp = "Shall I use ''config_sh' for default answers? [''bool_dflt'] "
$ GOSUB myread
$ IF ans
$ THEN
$ echo ""
$ echo "Fetching default answers from ''config_sh'..."
$!
$! we do our own parsing of the shell-script stuff
$! ...and only accept symbols if they're in the | delimited list below
$!
$ config_symbols0 ="|archlib|archlibexp|bin|binexp|builddir|cf_email|config_sh|installarchlib|installbin|installman1dir|installman3dir|"
$ config_symbols1 ="|installprivlib|installscript|installsitearch|installsitelib|most|oldarchlib|oldarchlibexp|osname|pager|perl_symbol|perl_verb|"
$ config_symbols2 ="|prefix|privlib|privlibexp|scriptdir|sitearch|sitearchexp|sitebin|sitelib|sitelib_stem|sitelibexp|usecxx|use64bitall|use64bitint|"
$ config_symbols3 ="|usecasesensitive|usedefaulttypes|usedevel|useieee|useithreads|uselongdouble|usemultiplicity|usemymalloc|usedebugging_perl|"
$ config_symbols4 ="|usesecurelog|usethreads|usevmsdebug|usefaststdio|usemallocwrap|unlink_all_versions|uselargefiles|usesitecustomize|"
$ config_symbols5 ="|buildmake|builder|usethreadupcalls|usekernelthreads|useshortenedsymbols|useversionedarchname|default_inc_excludes_dot"
$!
$ open/read CONFIG 'config_sh'
$ rd_conf_loop:
$ read/end=erd_conf_loop CONFIG line
$ line = f$edit(line,"trim")
$ if line .eqs. "" .or. f$extract(0,1,line) .eqs. "#" then goto rd_conf_loop
$ sym = f$element(0,"=",line)
$ if sym .eqs. "=" then goto rd_conf_loop
$ dsym = "|"+sym+"|"
$ k = 0
$ rd_ck_loop:
$ syms = config_symbols'k'
$ j = f$locate(dsym, syms)
$ if j .lt. f$length(syms) then goto erd_ck_loop
$ k = k + 1
$ if k .lt. 6 then goto rd_ck_loop
$ goto rd_conf_loop
$ erd_ck_loop:
$ val = f$element(1,"=",line)
$ val = f$extract(1,f$length(val)-2,val)
$ write sys$output "''sym' = ""''val'"""
$ 'sym' = "''val'"
$ goto rd_conf_loop
$ erd_conf_loop:
$ close CONFIG
$ delete/symbol config_symbols0
$ delete/symbol config_symbols1
$ delete/symbol config_symbols2
$ delete/symbol config_symbols3
$ delete/symbol config_symbols4
$ delete/symbol config_symbols5
$ delete/symbol sym
$ delete/symbol val
$ delete/symbol dsym
$ if f$type(usedebugging_perl) .nes. ""
$ then
$ DEBUGGING = usedebugging_perl
$ delete/symbol usedebugging_perl
$ endif
$!
$ ENDIF
$ if f$type(config_dflt) .nes. "" then DELETE/SYMBOL config_dflt
$!
$!we actually do not have "hints/" for VMS
$! TYPE SYS$INPUT:
$! DECK
$!
$!First time through, eh? I have some defaults handy for the following systems:
$!
$! EOD
$! echo " ","VMS_AXP"
$! echo " ","VMS_IA64"
$! : Now look for a hint file osname_osvers, unless one has been
$! : specified already.
$! TYPE SYS$INPUT:
$!
$!You may give one or more space-separated answers, or "none" if appropriate.
$!If your OS version has no hints, DO NOT give a wrong version -- say "none".
$!
$! READ SYS$COMMAND/PROMPT="Which of these apply, if any? " ans
$!
$Beyond_config_sh:
$!
$!: Restore computed paths !sfn
$!
$! %Config-I-VMS, a necessary error trap (could be PC running VCL)
$!
$ IF (osname .NES. "VMS")
$ THEN
$ echo4 "Hmm.. I wonder what ''osname' is (?)"
$ TYPE SYS$INPUT: