$! Ask if they want to build with 64-bit support
$ IF (archname.eqs."VMS_AXP").and.("''f$extract(1,3, f$getsyi(""version""))'".ges."7.1")
$ THEN
-$ dflt = use64bitint
+$ dflt = "n"
+$ IF F$TYPE(use64bitint) .NES. ""
+$ THEN
+$ IF use64bitint .OR. use64bitint .eqs. "define" THEN dflt = "y"
+$ ENDIF
$ echo ""
$ echo "You can have native 64-bit long integers."
$ echo ""
$ THEN use64bitint="Y"
$ ELSE use64bitint="N"
$ ENDIF
-$ IF (use64bitint)
+$!
+$ dflt = "n"
+$ IF F$TYPE(use64bitall) .NES. ""
+$ THEN
+$ IF use64bitall .OR. use64bitall .eqs. "define" THEN dflt = "y"
+$ ENDIF
+$ echo ""
+$ echo "You may also choose to try maximal 64-bitness. It means using as much"
+$ echo "64-bitness as possible on the platform. This in turn means even more"
+$ echo "binary incompatibilities. On the other hand, your platform may not"
+$ echo "have any more 64-bitness available than what you already have chosen."
+$ echo ""
+$ echo "If this does not make any sense to you, just accept the default ''dflt'."
+$ rp = "Try to use maximal 64-bit support, if available? [''dflt'] "
+$ GOSUB myread
+$ IF ans .EQS. "" THEN ans = dflt
+$ IF ans
+$ THEN use64bitall="Y"
+$ ELSE use64bitall="N"
+$ ENDIF
+$ IF use64bitall .AND. .NOT. use64bitint
$ THEN
-$ dflt = use64bitall
-$ echo ""
-$ echo "Since you chose 64-bitness you may want to try maximal 64-bitness."
-$ echo "What you have chosen is minimal 64-bitness which means just enough"
-$ echo "to get 64-bit integers. The maximal means using as much 64-bitness"
-$ echo "as is possible on the platform. This in turn means even more binary"
-$ echo "incompatibilities. On the other hand, your platform may not have"
-$ echo "any more maximal 64-bitness than what you already have chosen."
$ echo ""
-$ echo "If this does not make any sense to you, just accept the default ''dflt'."
-$ rp = "Try to use full 64-bit support, if available? [''dflt'] "
-$ GOSUB myread
-$ IF ans .EQS. "" THEN ans = dflt
-$ IF ans
-$ THEN use64bitall="Y"
-$ ELSE use64bitall="N"
-$ ENDIF
+$ echo "Since you have chosen a maximally 64-bit build, I'm also turning on"
+$ echo "the use of 64-bit integers."
+$ use64bitint="Y"
$ ENDIF
$ ENDIF ! AXP && >= 7.1
$!
$ GOSUB myread
$ IF ans .eqs. "" THEN ans = "''dflt'"
$ use_ieee_math = "''ans'"
+$ ELSE
+$ be_case_sensitive = "n"
+$ use_ieee_math = "n"
$ ENDIF
$! CC Flags
$ echo ""
$ THEN
$ dflt = dflt - "Socket" ! optional on VMS
$ ENDIF
-$ IF .NOT. use_ithreads THEN dflt = dflt - "threads"
+$ IF .NOT. use_ithreads
+$ THEN
+$ dflt = dflt - "threads/shared"
+$ dflt = dflt - "threads"
+$ ENDIF
$ dflt = F$EDIT(dflt,"TRIM,COMPRESS")
$!
$! Ask for their default list of extensions to build
$ uselongdouble = "define"
$ alignbytes="16"
$ usemorebits = "define"
+$ ivdformat="""Ld"""
+$ uvuformat="""Lu"""
+$ uvoformat="""Lo"""
+$ uvxformat="""Lx"""
+$ uvXUformat="""LX"""
$ ELSE
$ use64bitint = "undef"
$ uselargefiles = "undef"
$ uselongdouble = "undef"
$ usemorebits = "undef"
+$ ivdformat="""ld"""
+$ uvuformat="""lu"""
+$ uvoformat="""lo"""
+$ uvxformat="""lx"""
+$ uvXUformat="""lX"""
+$ ENDIF
+$ IF uselongdouble .OR. uselongdouble .EQS. "define"
+$ THEN
+$ nveformat="""Le"""
+$ nvfformat="""Lf"""
+$ nvgformat="""Lg"""
+$ ELSE
+$ nveformat="""e"""
+$ nvfformat="""f"""
+$ nvgformat="""g"""
$ ENDIF
$ IF use64bitall .OR. use64bitall .EQS. "define"
$ THEN
$ d_PRIu64 = "define"
$ d_PRIo64 = "define"
$ d_PRIx64 = "define"
+$ d_PRIXU64 = "define"
$ sPRId64 = """Ld"""
$ sPRIEUldbl = """LE"""
$ sPRIFUldbl = """LF"""
$ THEN
$ echo4 "OK, found random()."
$ ELSE
-$ drand01="(((float)rand())/((float)RAND_MAX))"
+$ drand01="(((float)rand())*MY_INV_RAND_MAX)"
$ randseedtype = "unsigned"
$ seedfunc = "srand"
$ echo4 "Yick, looks like I have to use rand()."
(F$INTEGER(Dec_C_Version).GE.50200000) .AND. (vms_ver .GES. "7.0")
$ THEN
$ d_bcmp="define"
+$ d_getitimer="define"
$ d_gettimeod="define"
+$ d_mmap="define"
+$ d_mprotect="define"
+$ d_munmap="define"
+$ d_msync="define"
+$ d_ualarm="define"
$ d_uname="define"
+$ d_usleep="define"
+$ d_setitimer="define"
$ d_sigaction="define"
$ d_sigprocmask="define"
$ d_truncate="define"
$ d_sigsetjmp="define"
$ ELSE
$ pidtype="unsigned int"
-$ d_gettimeod="undef"
$ d_bcmp="undef"
+$ d_getitimer="undef"
+$ d_gettimeod="undef"
+$ d_mmap="undef"
+$ d_mprotect="undef"
+$ d_munmap="undef"
+$ d_msync="undef"
+$ d_ualarm="undef"
$ d_uname="undef"
+$ d_usleep="undef"
+$ d_setitimer="undef"
$ d_sigaction="undef"
$ d_sigprocmask="undef"
$ d_truncate="undef"
$ ENDIF
$ DELETE/SYMBOL tmp
$!
-$ ivdformat="""ld"""
-$ uvuformat="""lu"""
-$ uvoformat="""lo"""
-$ uvxformat="""lx"""
-$ uvXUformat="""lX"""
-$! uselongdouble?
-$ nveformat="""e"""
-$ nvfformat="""f"""
-$ nvgformat="""g"""
-$!
$! Finally the composite ones. All config
$!
$ myuname="''osname' ''myname' ''osvers' ''F$EDIT(hwname, "TRIM")'"
$!
$ IF ccname .EQS. "DEC"
$ THEN
-$ ccflags="/Include=[]/Standard=Relaxed_ANSI/Prefix=All/Obj=''obj_ext'/NoList''ccflags'"
+$ ccflags="/Include=[]/Standard=Relaxed_ANSI/Prefix=All/Obj=''obj_ext' ''ccflags'"
$ ENDIF
$ i_dirent = "undef"
$ IF ccname .EQS. "CXX"
$ THEN
$ i_dirent = "define"
-$ ccflags="/Include=[]/Standard=ANSI/Prefix=All/Obj=''obj_ext'/NoList''ccflags'"
+$ ccflags="/Include=[]/Standard=ANSI/Prefix=All/Obj=''obj_ext' ''ccflags'"
$ ENDIF
$ IF use_vmsdebug_perl
$ THEN
-$ optimize="/Debug/NoOpt"
+$ optimize="/List/Debug/NoOpt"
$ ldflags="/Debug/Trace/Map"
$ dbgprefix = "DBG"
$ ELSE
-$ optimize= ""
+$ optimize= "/NoList"
$ ldflags="/NoTrace/NoMap"
$ dbgprefix = ""
$ ENDIF
$ WC "cppminus='" + cppminus + "'"
$ WC "cpprun='" + cpprun + "'"
$ WC "cppstdin='" + cppstdin + "'"
-$ WC "d_Gconvert='my_gconvert(x,n,t,b)'"
+$ IF use64bitint .OR. use64bitint .EQS. "define"
+$ THEN
+$! gcvt() does not work for > 16 decimal places; fallback to sprintf
+$ WC "d_Gconvert='sprintf((b),""%.*" + (nvgformat-"""") + ",(n),(x))'"
+$ ELSE
+$ WC "d_Gconvert='my_gconvert(x,n,t,b)'"
+$ ENDIF
$ WC "d_PRIEldbl='" + d_PRIEUldbl + "'"
$ WC "d_PRIFldbl='" + d_PRIFUldbl + "'"
$ WC "d_PRIGldbl='" + d_PRIGUldbl + "'"
-$ WC "d_PRIX64='" + d_PRIXU64 + "'"
+$ WC "d_PRIXU64='" + d_PRIXU64 + "'"
$ WC "d_PRId64='" + d_PRId64 + "'"
$ WC "d_PRIeldbl='" + d_PRIeldbl + "'"
$ WC "d_PRIfldbl='" + d_PRIfldbl + "'"
$ WC "d_gethent='" + d_gethent + "'"
$ WC "d_gethname='" + d_gethname + "'"
$ WC "d_gethostprotos='" + d_gethostprotos + "'"
-$ WC "d_getitimer='undef'"
+$ WC "d_getitimer='" + d_getitimer + "'"
$ WC "d_getlogin='define'"
$ WC "d_getmnt='undef'"
$ WC "d_getmntent='undef'"
$ WC "d_mkstemp='" + d_mkstemp + "'"
$ WC "d_mkstemps='" + d_mkstemps + "'"
$ WC "d_mktime='" + d_mktime + "'"
-$ WC "d_mmap='undef'"
+$ WC "d_mmap='" + d_mmap + "'"
$ WC "d_modfl='" + d_modfl + "'"
$ WC "d_modfl_pow32_bug='undef'"
-$ WC "d_mprotect='undef'"
+$ WC "d_mprotect='" + d_mprotect + "'"
$ WC "d_msg='undef'"
$ WC "d_msg_ctrunc='undef'"
$ WC "d_msg_dontroute='undef'"
$ WC "d_msg_peek='undef'"
$ WC "d_msg_proxy='undef'"
$ WC "d_msghdr_s='undef'"
-$ WC "d_msync='undef'"
-$ WC "d_munmap='undef'"
+$ WC "d_msync='" + d_msync + "'"
+$ WC "d_munmap='" + d_munmap + "'"
$ WC "d_mymalloc='" + d_mymalloc + "'"
$ WC "d_nice='define'"
$ WC "d_nl_langinfo='" + d_nl_langinfo + "'"
$ WC "d_setgrent='undef'"
$ WC "d_setgrps='undef'"
$ WC "d_sethent='" + d_sethent + "'"
-$ WC "d_setitimer='undef'"
+$ WC "d_setitimer='" + d_setitimer + "'"
$ WC "d_setlinebuf='undef'"
$ WC "d_setlocale='" + d_setlocale + "'"
$ WC "d_setnent='" + d_setnent + "'"
$ WC "d_truncate='" + d_truncate + "'"
$ WC "d_tzname='" + d_tzname + "'"
$ WC "d_u32align='define'"
-$ WC "d_ualarm='undef'"
+$ WC "d_ualarm='" + d_ualarm + "'"
$ WC "d_umask='define'"
$ WC "d_uname='" + d_uname + "'"
$ WC "d_union_semun='undef'"
$ WC "d_unlink_all_versions='undef'"
$ WC "d_unordered='undef'"
-$ WC "d_usleep='undef'"
-$ WC "d_usleepproto='undef'"
+$ WC "d_usleep='" + d_usleep + "'"
+$ WC "d_usleepproto='" + d_usleep + "'"
$ WC "d_ustat='undef'"
$ WC "d_vendorarch='undef'"
$ WC "d_vendorlib='undef'"
$ WC "malloctype='void *'"
$ WC "man1ext='rno'"
$ WC "man3ext='rno'"
-$ WC "mmaptype=' " + "'"
+$ WC "mmaptype='void *'"
$ WC "modetype='unsigned int'"
$ WC "multiarch='undef'"
$ WC "mydomain='" + mydomain + "'"