disable the unrecognized nls flag
[AROS-Contrib.git] / arospdf / vms_make.com
blobd70caad765bec4fc04251724ac5093c9d9f8a9e4
1 $!========================================================================
2 $!
3 $! Main Xpdf compile script for VMS.
4 $!
5 $! Written by Patrick Moreau, Martin P.J. Zinser.
6 $!
7 $! Copyright 1996-2003 Glyph & Cog, LLC
8 $!
9 $!========================================================================
11 $! This procedure takes up to three (optional) parameters:
13 $! 1.) Configuration settings:
15 $!     a4             - Use european A4 as the default paper size.
17 $!     no_text_select - Disable text selection in Xpdf
19 $!     opi_support    - Compile Xpdf with support for the Open Prepress 
20 $!                      Interface (OPI)
22 $! 2.) Compiler detection:
24 $!     In case you want to override the automatic compiler detection
25 $!     specify either DECC or GCC as the second paramter,
26 $!     e.g. @vms_make "" GCC 
28 $! 3.) System Xpdf resource file
30 $!     The default for this is decw$system_defaults:xpdfrc.dat, since this
31 $!     is the standard place for systemwide Xdefaults files on OpenVMS. You
32 $!     may provide a different file in p3.
34 $! External libraries (like T1lib, Freetype, and XPM) are supported via the 
35 $! config file VMSLIB.DAT. Please check the sample file, which will be created
36 $! by this procedure upon first invocation, for the information you need to 
37 $! provide 
39 $! Sample invocation of the script:
40 $!                 @vms_make a4,opi_support "" 
42 $! In case of problems with the compile you may contact me at 
43 $! zinser@decus.de (preferred) or zinser@sysdev.deutsche-boerse.com (work). 
45 $!========================================================================
47 $ on error then goto err_exit
50 $! Just some general constants...
52 $ true  = 1
53 $ false = 0
54 $ xpdf_link :== link
55 $ tmpnam = "temp_" + f$getjpi("","pid")
56 $ tc = tmpnam + ".c"
58 $! Setup variables holding "config" information
60 $ aconf_in_file = "aconf_h.in#aconf.h_in#aconf.h.in"
61 $ name        = "Xpdf"
62 $ version     = "?.?"
63 $ mydefs        = "#"
64 $ xlibs         = "xt#xmu#motif"
65 $ cxxdefs       = ""
66 $ libdefs       = "\"
67 $ libincs       = ""
68 $ float         = ""
69 $ compress_def  = false
70 $ ft2def        = false
71 $ x11_save      = ""
72 $ p2 = f$edit(p2,"upcase,trim")
73 $ if f$edit(p3,"trim") .eqs. "" 
74 $ then 
75 $   resfil = "decw$system_defaults:xpdfrc.dat"
76 $ else
77 $   resfil = "'p3'"
78 $ endif
80 $ gosub proc_config
81 $ gosub check_version
83 $! Start building the option file
85 $ open/write optf xpdf.opt
86 $ open/write topt tmp.opt
87 $ write optf "Identification=""''name' ''version'"""
88 $ gosub check_create_vmslib
89 $ gosub check_xlib
91 $ if (f$getsyi("HW_MODEL").ge.1024) .and. - 
92      (f$locate("T1LIB",f$edit(libdefs,"UPCASE")) .lt. f$length(libdefs)) -
93      then float  = "/float=ieee_float"
94 $ incs = "sys$library:,[-],[],[-.goo]''libincs'"     
96 $ gosub check_compiler
97 $ close optf
98 $ close topt
100 $! aconf.h.in might be mapped in different ways, so go figure
102 $ i = 0
103 $FIND_ACONF:
104 $ fname = f$element(i,"#",aconf_in_file)
105 $ if fname .eqs. "#" then goto AMISS_ERR
106 $ if f$search(fname) .eqs. ""
107 $ then 
108 $   i = i + 1
109 $   goto find_aconf
110 $ endif
111 $ open/read/err=aconf_err aconf_in 'fname'
112 $ open/write aconf aconf.h
113 $ACONF_LOOP:
114 $ read/end_of_file=aconf_exit aconf_in line
115 $ work = f$edit(line, "compress,trim")
116 $ if f$extract(0,6,work) .nes. "#undef"
117 $ then
118 $   write aconf line
119 $ else
120 $   def = f$element(1," ",work)
121 $   if ((f$locate("\''def'\",f$edit(libdefs,"UPCASE")) .lt. f$length(libdefs)) -
122         .or. (f$locate("#''def'#",f$edit(mydefs,"UPCASE")) .lt. f$length(mydefs))) 
123 $   then
124 $     write aconf "#define ", def, " 1"
125 $   else
126 $     gosub check_config
127 $   endif
128 $ endif
130 $! Make sure old-style VMS is defined along with __VMS
132 $ if f$locate("define ACONF_H",line) .lt. f$length(line) 
133 $ then
134 $    write aconf "#define VMS 1"
135 $ endif
136 $ goto aconf_loop
137 $ACONF_EXIT:
138 $ close aconf_in
139 $ close aconf
140 $ write sys$output "Compiling in [.GOO]"
141 $ set default [.goo]
142 $ @vms_make
143 $ write sys$output "Compiling in [.XPDF]"
144 $ set default [-.xpdf]
145 $ @vms_make
146 $ set default [-]
147 $ gosub reset_env
148 $ dele/noconf/nolog tmp.opt;*
149 $ exit
150 $ACONF_ERR:
151 $ write sys$output "Input file ''fname' could not be opened"
152 $ goto err_exit
153 $AMISS_ERR:
154 $ write sys$output "No source for aconf.h found."
155 $ write sys$output "Tried any of ''aconf_in_file'"
156 $CXX_ERR:
157 $ write sys$output "C++ compiler required to build Xpdf"
158 $ goto err_exit
159 $FT2_ERR:
160 $ write sys$output "Can not find [.internal] sub-dir in Freetype 2 tree"
161 $ goto err_exit
162 $ERR_EXIT:
163 $ set message/facil/ident/sever/text
164 $ gosub reset_env
165 $ close/nolog aconf_in
166 $ close/nolog aconf
167 $ close/nolog optf
168 $ close/nolog tmpc
169 $ close/nolop topt
170 $ write sys$output "Exiting..."  
171 $ exit 2
172 $!------------------------------------------------------------------------------
174 $! Take care of driver file with information about external libraries
176 $CHECK_CREATE_VMSLIB:
178 $ if f$search("VMSLIB.DAT") .eqs. ""
179 $ then
180 $   type/out=vmslib.dat sys$input
182 ! This is a simple driver file with information used by vms_make.com to
183 ! check if external libraries (like t1lib and freetype) are available on
184 ! the system.
186 ! Layout of the file:
188 !    - Lines starting with ! are treated as comments
189 !    - Elements in a data line are separated by # signs
190 !    - The elements need to be listed in the following order
191 !      1.) Name of the Library (only used for informative messages 
192 !                               from vms_make.com)
193 !      2.) Location where the object library can be found
194 !      3.) Location where the include files for the library can be found
195 !      4.) Include file used to verify library location
196 !      5.) CPP define to pass to the build to indicate availability of 
197 !          the library
199 ! Example: The following  lines show how definitions  
200 !          might look like. They are site specific and the locations of the 
201 !          library and include files need almost certainly to be changed.
203 ! Location: All of the libaries can be found at the following addresses
205 !   T1LIB:     http://www.decus.de:8080/www/vms/sw/t1lib.htmlx
206 !   FREETYPE:  http://www.decus.de:8080/www/vms/sw/freetype2.htmlx
207 !   XPM:       http://www.decus.de:8080/www/vms/sw/xpm.htmlx
208 !   LIBPAPER:  http://www.decus.de:8080/www/vms/sw/libpaper.htmlx
210 !T1LIB    # pubbin:t1shr.exe        # public$root:[xtools.libs.t1lib.lib.t1lib] # t1lib.h    # HAVE_T1LIB_H
211 !FREETYPE # pubbin:freetype2shr.exe # public$root:[xtools.libs.ft2.include.freetype],public$root:[xtools.libs.ft2.include] # freetype.h # HAVE_FREETYPE_H\FREETYPE2
212 !XPM      # pubbin:libxpm.olb       # X11:                                      # xpm.h      # HAVE_X11_XPM_H
213 !LIBPAPER # pubbin:libpapershr.exe  # public$root:[util.libs.paper.lib]         # paper.h    # HAVE_PAPER_H
214 $   write sys$output "New driver file vmslib.dat created."
215 $   write sys$output "Please customize libary locations for your site"
216 $   write sys$output "and afterwards re-execute vms_make.com"
217 $   write sys$output "Exiting..."
218 $   close/nolog optf
219 $   exit
220 $ endif
222 $! Open data file with location of libraries
224 $ open/read/end=end_lib/err=err_lib libdata VMSLIB.DAT
225 $LIB_LOOP:
226 $ read/end=end_lib libdata libline
227 $ libline = f$edit(libline, "UNCOMMENT,COLLAPSE")
228 $ if libline .eqs. "" then goto LIB_LOOP ! Comment line
229 $ libname = f$edit(f$element(0,"#",libline),"UPCASE")
230 $ write sys$output "Processing ''libname' setup ..."
231 $ libloc  = f$element(1,"#",libline)
232 $ libsrc  = f$element(2,"#",libline)
233 $ testinc = f$element(3,"#",libline)
234 $ cppdef  = f$element(4,"#",libline)
235 $ old_cpp = f$locate("=1",cppdef)
236 $ if old_cpp.lt.f$length(cppdef) then cppdef = f$extract(0,old_cpp,cppdef)
237 $ if f$search("''libloc'").eqs. ""
238 $ then
239 $   write sys$output "Can not find library ''libloc' - Skipping ''libname'"
240 $   goto LIB_LOOP
241 $ endif
242 $ libsrc_elem = 0
243 $ libsrc_found = false
244 $LIBSRC_LOOP:
245 $ libsrcdir = f$element(libsrc_elem,",",libsrc)
246 $ if (libsrcdir .eqs. ",") then goto END_LIBSRC
247 $ if f$search("''libsrcdir'''testinc'") .nes. "" then libsrc_found = true
248 $ libsrc_elem = libsrc_elem + 1
249 $ goto LIBSRC_LOOP
250 $END_LIBSRC:
251 $ if .not. libsrc_found
252 $ then
253 $   write sys$output "Can not find includes at ''libsrc' - Skipping ''libname'"
254 $   goto LIB_LOOP
255 $ endif
256 $ libdefs = libdefs +  cppdef + "\"
257 $ libincs = libincs + "," + libsrc
258 $ lqual = "/lib"
259 $ libtype = f$edit(f$parse(libloc,,,"TYPE"),"UPCASE")
260 $ if f$locate("EXE",libtype) .lt. f$length(libtype) then lqual = "/share"
261 $ write optf libloc , lqual
262 $ write topt libloc , lqual
264 $! Nasty hack to get the freetype includes to work
266 $ if ((libname .eqs. "FREETYPE") .and. -
267       (f$locate("FREETYPE2",cppdef) .lt. f$length(cppdef)))
268 $ then
269 $   if ((f$search("freetype:freetype.h") .nes. "") .and. -
270         (f$search("freetype:[internal]ftobjs.h") .nes. ""))
271 $   then
272 $     write sys$output "Will use local definition of freetype logical"
273 $     ft2def = false
274 $   else
275 $     ft2elem = 0 
276 $FT2_LOOP:
277 $     ft2srcdir = f$element(ft2elem,",",libsrc)
278 $     if f$search("''ft2srcdir'''testinc'") .nes. ""
279 $     then
280 $        if f$search("''ft2srcdir'internal.dir") .nes. ""
281 $        then
282 $          ft2dev  = f$parse("''ft2srcdir'",,,"device","no_conceal")
283 $          ft2dir  = f$parse("''ft2srcdir'",,,"directory","no_conceal")
284 $          ft2conc = f$locate("][",ft2dir)
285 $          ft2len  = f$length(ft2dir)
286 $          if ft2conc .lt. ft2len
287 $          then
288 $             ft2dir = f$extract(0,ft2conc,ft2dir) + -
289                        f$extract(ft2conc+2,ft2len-2,ft2dir)
290 $          endif
291 $          ft2dir = ft2dir - "]" + ".]"
292 $          define freetype 'ft2dev''ft2dir','ft2srcdir'
293 $          ft2def = true
294 $        else
295 $          goto ft2_err
296 $        endif
297 $     else
298 $       ft2elem = ft2elem + 1
299 $       goto ft2_loop
300 $     endif
301 $   endif        
302 $ endif
304 $! Yet another special treatment for Xpm/X11
306 $ if (libname .eqs. "XPM")
307 $ then
308 $   my_x11 = f$parse("''libsrc'xpm.h",,,"device") + - 
309              f$parse("''libsrc'xpm.h",,,"directory")
310 $   x11_save = f$trnlnm("X11")
311 $   define x11 'my_x11',decw$include   
312 $ endif 
313 $ goto LIB_LOOP
314 $END_LIB:
315 $ close libdata
316 $ return
317 $!------------------------------------------------------------------------------
319 $! Take care of driver file with information about external libraries
321 $CHECK_CONFIG:
323 $ if (def .eqs. "SYSTEM_XPDFRC")
324 $ then
325 $   write aconf "#define SYSTEM_XPDFRC """, resfil, """" 
326 $ else
327 $   gosub check_cc_def
328 $ endif
329 $ return
330 $!------------------------------------------------------------------------------
332 $! Check if this is a define relating to the properties of the C/C++
333 $! compiler
335 $CHECK_CC_DEF:
336 $ if (def .eqs. "HAVE_DIRENT_H")
337 $ then
338 $   copy sys$input: 'tc
339 $   deck
340 #include <dirent.h>
341 int main(){
343 $   eod
344 $   gosub cc_prop_check
345 $   return
346 $ endif
347 $ if (def .eqs. "HAVE_SYS_NDIR_H")
348 $ then
349 $   copy sys$input: 'tc
350 $   deck
351 #include <sys/ndir.h>
352 int main(){
354 $   eod
355 $   gosub cc_prop_check
356 $   return
357 $ endif
358 $ if (def .eqs. "HAVE_SYS_DIR_H")
359 $ then
360 $   copy sys$input: 'tc
361 $   deck
362 #include <sys/dir.h>
363 int main(){
365 $   eod
366 $   gosub cc_prop_check
367 $   return
368 $ endif
369 $ if (def .eqs. "HAVE_NDIR_H")
370 $ then
371 $   copy sys$input: 'tc
372 $   deck
373 #include <ndir.h>
374 int main(){
376 $   eod
377 $   gosub cc_prop_check
378 $   return
379 $ endif
380 $ if (def .eqs. "HAVE_SYS_SELECT_H")
381 $ then
382 $   copy sys$input: 'tc
383 $   deck
384 #include <sys/select.h>
385 int main(){
387 $   eod
388 $   gosub cc_prop_check
389 $   return
390 $ endif
391 $ if (def .eqs. "HAVE_SYS_BSDTYPES_H")
392 $ then
393 $   copy sys$input: 'tc
394 $   deck
395 #include <sys/bsdtypes.h>
396 int main(){
398 $   eod
399 $   gosub cc_prop_check
400 $   return
401 $ endif
402 $ if (def .eqs. "HAVE_STRINGS_H")
403 $ then
404 $   copy sys$input: 'tc
405 $   deck
406 #include <strings.h>
407 int main(){
409 $   eod
410 $   gosub cc_prop_check
411 $   return
412 $ endif
413 $ if (def .eqs. "HAVE_POPEN")
414 $ then
415 $   copy sys$input: 'tc
416 $   deck
417 #include <stdio.h>
419 int main(){
420 FILE *pipe;
421  pipe = popen("DIR","r");
422  pclose(pipe);
424 $   eod
425 $   gosub cc_prop_check
426 $   return
427 $ endif
428 $ if (def .eqs. "HAVE_MKSTEMP")
429 $ then
430 $   copy sys$input: 'tc
431 $   deck
432 #include <stdlib.h>
434 int main(){
435   mkstemp("tempXXXXXX");
437 $   eod
438 $   gosub cc_prop_check
439 $   return
440 $ endif
441 $ if (def .eqs. "HAVE_FSEEKO")
442 $ then
443 $   copy sys$input: 'tc
444 $   deck
445 #define _LARGEFILE
446 #include <stdio.h>
448 int main(){
449 FILE *fp;
450   fp = fopen("temp.txt","r");
451   fseeko(fp,1,SEEK_SET);
452   fclose(fp);
454 $   eod
455 $   gosub cc_prop_check
456 $   return
457 $ endif
458 $ if (def .eqs. "_LARGE_FILES")
459 $ then
460 $   copy sys$input: 'tc
461 $   deck
462 #define _LARGEFILE
463 #include <stdio.h>
465 int main(){
466 FILE *fp;
467   fp = fopen("temp.txt","r");
468   fseeko(fp,1,SEEK_SET);
469   fclose(fp);
471 $   eod
472 $   gosub cc_prop_check
473 $   return
474 $ endif
475 $ if (def .eqs. "HAVE_XTAPPSETEXITFLAG")
476 $ then
477 $   copy sys$input: 'tc
478 $   deck
479 #include <X11/Intrinsic.h>
481 int main(){
482   XtAppContext  app_context;
483   app_context = XtCreateApplicationContext();
484   XtAppSetExitFlag(app_context);
485   return 0;
487 $   eod
488 $   gosub cc_prop_check
489 $   return
490 $ endif
491 $ write aconf "/* ", line, " */" 
492 $ return
493 $!------------------------------------------------------------------------------
495 $! Process config settings passed from the command line
496 $! (analog to Unix --enable-xxx)
498 $PROC_CONFIG: 
499 $ if (p1.nes."")
500 $ then
501 $   i = 0
502 $   qual_list = f$edit(p1,"upcase")
503 $DEF_LOOP:
504 $   qual = f$element(i,",",qual_list)
505 $   if qual .eqs. "," then goto FINISH_DEF
506 $   i = i + 1
507 $   if (qual .eqs. "A4")
508 $   then 
509 $     mydefs = mydefs + "A4_PAPER#"
510 $     goto def_loop
511 $   endif
512 $   if (qual .eqs. "NO_TEXT_SELECT")
513 $   then
514 $     mydefs = mydefs + "NO_TEXT_SELECT#" 
515 $     goto def_loop
516 $   endif
517 $   if (qual .eqs. "OPI_SUPPORT")
518 $   then
519 $     mydefs = mydefs + "OPI_SUPPORT#" 
520 $     goto def_loop
521 $   endif
522 $   if (qual .eqs. "COMPRESS")
523 $   then
524 $     compress_def = true 
525 $     goto def_loop
526 $   endif
527 $   write sys$output "Qualifier ''qual' not recognized, will be ignored"
528 $   goto def_loop
529 $ endif
530 $FINISH_DEF:
531 $ return
533 $!------------------------------------------------------------------------------
535 $! Look for the compiler used 
537 $CHECK_COMPILER:
538 $ its_decc = (f$search("SYS$SYSTEM:CXX$COMPILER.EXE") .nes. "")
539 $ its_gnuc = .not. its_decc .and. (f$trnlnm("gnu_cc") .nes. "")
541 $! Exit if no compiler available
543 $ if (.not. (its_decc .or. its_gnuc)) then goto CXX_ERR
545 $! Override if requested from the commandline
547 $ if (p2 .eqs. "DECC")
548 $ then
549 $   its_decc = true
550 $   its_gnuc = false 
551 $ endif
552 $ if (p1 .eqs. "GNUC")
553 $ then
554 $   its_decc = false
555 $   its_gnuc = true
556 $ endif
558 $ if its_decc
559 $ then
560 $   ccomp :== "cc/decc/prefix=all ''float'"
562 $! Take care of includes
564 $   cc_user    = f$trnlnm("DECC$USER_INCLUDE")
565 $   cc_system  = f$trnlnm("DECC$SYSTEM_INCLUDE")
566 $   cxx_user   = f$trnlnm("CXX$USER_INCLUDE")
567 $   cxx_system = f$trnlnm("CXX$SYSTEM_INCLUDE")
568 $   define decc$system_include  'incs'
569 $   define decc$user_include    'incs'
570 $   define cxx$user_include     'incs'
571 $   define cxx$system_include   'incs'
573 $! Check version of the C++ compiler
574 $! 
575 $   create vms_xpdf_cc_test.cc
576 $   cxx/lis=vms_xpdf_cc_test.lis/show=all vms_xpdf_cc_test.cc
577 $   open list vms_xpdf_cc_test.lis
578 $CXX_LIST:
579 $   read/end=close_cxx list line
580 $   start = f$locate("__DECCXX_VER",line)
581 $   if start .ne. f$length(line)
582 $   then
583 $     cxx_ver = f$extract(start+13,8,line)
584 $     if cxx_ver .gt. 60000000
585 $     then 
586 $       cxxdefs = "/warn=(disable=nosimpint)"
587 $       xpdf_link :== cxxlink
588 $     endif
589 $     goto close_cxx
590 $   endif
591 $   goto cxx_list
592 $CLOSE_CXX:
593 $   close list
594 $   delete/noconfirm vms_xpdf_cc_test.*;*
595 $   cxxcomp :== "cxx/prefix=all ''cxxdefs' ''float' /include=cxx$user_include"
596 $ endif
598 $ if its_gnuc
599 $ then
600 $   ccomp   :== "gcc/nocase/include=(''incs')"
601 $   cxxcomp :== "gcc/plusplus/nocase/include=(''incs')"
602 $   write optf "gnu_cc:[000000]gcclib.olb/lib"
603 $   write optf "sys$share:vaxcrtl.exe/share"
604 $ endif
605 $ return
606 $-------------------------------------------------------------------------------
607 $RESET_ENV:
608 $ delete/sym/glob cxxcomp
609 $ delete/sym/glob ccomp
610 $ delete/sym/glob xpdf_link
611 $ if (ft2def) then deassign freetype
612 $ if its_decc
613 $ then
614 $  if cc_user .eqs. ""
615 $  then
616 $    deass decc$user_include
617 $  else
618 $    define decc$user_include 'cc_user'
619 $  endif
620 $  if cc_system .eqs. ""
621 $  then
622 $    deass decc$system_include
623 $  else
624 $    define decc$system_include 'cc_system'
625 $  endif
626 $  if cxx_user .eqs. ""
627 $  then
628 $    deass cxx$user_include
629 $  else
630 $    define cxx$user_include 'cxx_user'
631 $  endif
632 $  if cxx_system .eqs. ""
633 $  then
634 $    deass cxx$system_include
635 $  else
636 $    define cxx$system_include 'cxx_system'
637 $  endif
638 $ endif
639 $ if (x11_save .nes. "") then define x11 'x11_save'
640 $ return
642 $!------------------------------------------------------------------------------
644 $! Check for properties of C/C++ compiler
646 $CC_PROP_CHECK:
647 $ cc_prop = true
648 $ set message/nofac/noident/nosever/notext
649 $ on error then continue
650 $ cc 'tmpnam'
651 $ if .not. ($status)  then cc_prop = false
652 $ on error then continue
653 $! The headers might lie about the capabilities of the RTL
654 $ link/opt=tmp.opt 'tmpnam'
655 $ if .not. ($status)  then cc_prop = false
656 $ set message/fac/ident/sever/text
657 $ on error then goto err_exit
658 $ delete/nolog 'tmpnam'.*;*
659 $ if cc_prop 
660 $ then
661 $   write sys$output "Checking for ''def'... yes"
662 $   write aconf "#define ''def' 1"
663 $   if (def .eqs. "HAVE_FSEEKO") .or. (def .eqs. "_LARGE_FILES") then - 
664       write aconf "#define _LARGEFILE"
665 $ else 
666 $   write sys$output "Checking for ''def'... no"
667 $   write aconf line
668 $ endif
669 $ return
670 $!------------------------------------------------------------------------------
672 $! Check Xlibs and write to options file
674 $CHECK_XLIB:
675 $ If F$Type (xlibs) .nes. "STRING" Then xlibs = ""
676 $ need_xt = f$locate("XT",f$edit(xlibs,"upcase")) .lt. f$length(xlibs)
677 $ need_xmu = f$locate("XMU",f$edit(xlibs,"upcase")) .lt. f$length(xlibs)
678 $ need_xm  = f$locate("MOTIF",f$edit(xlibs,"upcase")) .lt. f$length(xlibs)
679 $ On Error Then GoTo XUI
680 $ @sys$update:decw$get_image_version sys$share:decw$xlibshr.exe decw$version
681 $ if f$extract(4,3,decw$version).eqs."1.0"
682 $ then
683 $   if need_xt .or. need_xmu .or. need_xm 
684 $   then 
685 $      write optf "Sys$share:DECW$DWTLIBSHR.EXE/Share"
686 $      write topt "Sys$share:DECW$DWTLIBSHR.EXE/Share"
687 $   endif
688 $ endif
689 $ if f$extract(4,3,decw$version).eqs."1.1"
690 $ then
691 $   if need_xm  then write optf "sys$share:decw$xmlibshr.exe/share"
692 $   if need_xt  then write optf "sys$share:decw$xtshr.exe/share"
693 $   if nedd_xmu then write optf "sys$share:decw$xmulibshr.exe/share"
694 $   if need_xm  then write topt "sys$share:decw$xmlibshr.exe/share"
695 $   if need_xt  then write topt "sys$share:decw$xtshr.exe/share"
696 $   if nedd_xmu then write topt "sys$share:decw$xmulibshr.exe/share"
697 $ endif
698 $ if f$extract(4,3,decw$version).eqs."1.2"
699 $ then
700 $   if need_xm  then write optf "sys$share:decw$xmlibshr12.exe/share"
701 $   if need_xt  then write optf "sys$share:decw$xtlibshrr5.exe/share"
702 $   if need_xmu then write optf "sys$share:decw$xmulibshrr5.exe/share"
703 $   if need_xm  then write topt "sys$share:decw$xmlibshr12.exe/share"
704 $   if need_xt  then write topt "sys$share:decw$xtlibshrr5.exe/share"
705 $   if need_xmu then write topt "sys$share:decw$xmulibshrr5.exe/share"
706 $ endif
707 $ GoTo MAIN
708 $ XUI:
710 $ if need_xt .or. need_xmu 
711 $ then 
712 $   write optf "Sys$share:DECW$DWTLIBSHR.EXE/Share"
713 $   write topt "Sys$share:DECW$DWTLIBSHR.EXE/Share"
714 $ endif 
715 $ MAIN:
716 $ on error then goto err_exit
717 $ write optf "sys$share:decw$xlibshr.exe/share"
718 $ write topt "sys$share:decw$xlibshr.exe/share"
719 $ return
720 $!------------------------------------------------------------------------------
722 $! Check version of Xpdf to build
724 $CHECK_VERSION:
725 $ open/read in [.xpdf]config.h
726 $ check_string = "xpdfVersionNum"
727 $vloop:
728 $ read/end=vdone in rec
729 $ if (f$element(1," " ,rec) .nes. check_string) then goto vloop
730 $ start = f$locate(check_string,rec) + f$length(check_string)
731 $ len   = f$length(rec) - start 
732 $ version = f$edit(f$extract(start,len,rec),"COLLAPSE")
733 $vdone:
734 $ close in
735 $ return
736 $!------------------------------------------------------------------------------