This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
dquote.c: Rmv extraneous #ifdef; add assertions
[perl5.git] / configure.com
index 088cabc..4296bf4 100644 (file)
@@ -66,8 +66,6 @@ $ dynamic_ext = ""
 $ nonxs_ext = ""
 $ nonxs_ext2 = ""
 $ vms_default_directory_name = F$ENVIRONMENT("DEFAULT")
-$ max_allowed_dir_depth = 3  ! e.g. [A.B.PERLxxx] not [A.B.C.PERLxxx]
-$! max_allowed_dir_depth = 2 ! e.g. [A.PERLxxx] not [A.B.PERLxxx]
 $!
 $! Sebastian Bazley's request: close the CONFIG handle with /NOLOG
 $! qualifier "just in case" (configure.com is re @ed in a bad state).
@@ -447,28 +445,27 @@ $     GOTO Beyond_manifest
 $   ENDIF
 $ ELSE
 $! MANIFEST. has been found and we have set def'ed there.
-$! Time to bail out before it's too late, i.e. too deep.
-$! Depth check is unnecessary on Alpha VMS V7.2++ (even for ODS-2).
-$   tmp = f$extract(1,3,f$edit(f$getsyi("VERSION"),"TRIM,COLLAPSE"))
-$   IF (tmp .GES. "7.2") .AND. (F$GETSYI("HW_MODEL") .GE. 1024) THEN GOTO Beyond_depth_check
-$! Depth check also unnecessary on ODS 5 (or later) file systems.
-$   tmp = F$INTEGER(F$GETDVI(F$ENVIRONMENT("DEFAULT"),"ACPTYPE") - "F11V")
-$   IF (tmp .GE. 5) THEN GOTO Beyond_depth_check
-$   IF (F$ELEMENT(max_allowed_dir_depth,".",F$ENVIRONMENT("DEFAULT")).nes.".")
-$   THEN
-$     TYPE SYS$INPUT:
-$     DECK
-%Config-E-VMS, ERROR:
- Sorry! It apears as though your perl build sub-directory is already too
- deep into the VMS file system. Please try moving stuff into a shallower 
- directory (or altering the "max_allowed_dir_depth" parameter).
-$     EOD
-$     echo4 "ABORTING..."
-$     SET DEFAULT 'vms_default_directory_name' !be kind rewind
-$     STOP
-$     EXIT !2 !$STATUS = "%X00000002" (error)
-$   ENDIF
-$Beyond_depth_check:
+$!
+$ 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
 $!
@@ -511,6 +508,9 @@ $       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)
@@ -927,7 +927,7 @@ $   config_symbols1 ="|installprivlib|installscript|installsitearch|installsitel
 $   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"
+$   config_symbols5 ="|buildmake|builder|usethreadupcalls|usekernelthreads|useshortenedsymbols|useversionedarchname|default_inc_excludes_dot"
 $!  
 $   open/read CONFIG 'config_sh'
 $   rd_conf_loop:
@@ -2057,6 +2057,8 @@ $     ENDIF
 $   ELSE
 $     usethreads = "undef"
 $   ENDIF
+$ ELSE
+$   usethreads = "undef"
 $ ENDIF
 $ IF F$TYPE(usethreadupcalls) .EQS. "" THEN usethreadupcalls = "undef"
 $ IF F$TYPE(usekernelthreads) .EQS. "" THEN usekernelthreads = "undef"
@@ -3017,6 +3019,27 @@ $ rp="What pager is used on your system? [''dflt'] "
 $ GOSUB myread
 $ pager = ans
 $!
+$ bool_dflt = "y"
+$ IF F$TYPE(default_inc_excludes_dot) .NES. ""
+$ THEN
+$   IF .not. default_inc_excludes_dot .or. default_inc_excludes_dot .eqs. "undef" THEN bool_dflt = "n"
+$ ENDIF
+$ echo ""
+$ echo "Historically Perl has provided a final fallback of the current working"
+$ echo "directory '.' when searching for a library. This, however, can lead to"
+$ echo "problems when a Perl program which loads optional modules is called from"
+$ echo "a shared directory. This can lead to executing unexpected code."
+$ echo ""
+$ rp = "Exclude '.' from @INC by default? [''bool_dflt'] "
+$ GOSUB myread
+$ default_inc_excludes_dot = ans
+$ IF default_inc_excludes_dot
+$ THEN
+$   default_inc_excludes_dot = "define"
+$ ELSE
+$   default_inc_excludes_dot = "undef"
+$ ENDIF
+$!
 $! update makefile here
 $! echo4 "Updating makefile..."
 $!
@@ -4215,7 +4238,42 @@ $ WS "}"
 $ CS
 $ tmp = "memchr"
 $ GOSUB inlibc
-$ d_memchr = tmp
+$!
+$! Check for memrchr
+$!
+$ OS
+$ WS "#if defined(__DECC) || defined(__DECCXX)"
+$ WS "#include <stdlib.h>"
+$ WS "#endif"
+$ WS "#include <string.h>"
+$ WS "int main()"
+$ WS "{"
+$ WS "char * place;"
+$ WS "place = (char *)memrchr(""foo"", 47, 3);"
+$ WS "exit(0);"
+$ WS "}"
+$ CS
+$ tmp = "memrchr"
+$ GOSUB inlibc
+$ d_memrchr = tmp
+$!
+$! Check for strnlen
+$!
+$ OS
+$ WS "#if defined(__DECC) || defined(__DECCXX)"
+$ WS "#include <stdlib.h>"
+$ WS "#endif"
+$ WS "#include <string.h>"
+$ WS "int main()"
+$ WS "{"
+$ WS "size_t len;"
+$ WS "len = strnlen(""foot"", 3);"
+$ WS "exit(0);"
+$ WS "}"
+$ CS
+$ tmp = "strnlen"
+$ GOSUB inlibc
+$ d_strnlen = tmp
 $!
 $! Check for strtoull
 $!
@@ -4377,7 +4435,6 @@ $ WS "}"
 $ CS
 $ tmp = "bzero"
 $ GOSUB inlibc
-$ d_bzero = tmp
 $!
 $! Check for bcopy
 $!
@@ -4396,7 +4453,6 @@ $ WS "}"
 $ CS
 $ tmp = "bcopy"
 $ GOSUB inlibc
-$ d_bcopy = tmp
 $!
 $! Check for mkstemp
 $!
@@ -5251,8 +5307,6 @@ $  endif
 $  d_setgrent = "define"
 $  d_ttyname_r = "define"
 $  ttyname_r_proto = "1"
-$  d_snprintf = "define"
-$  d_vsnprintf = "define"
 $!
 $! VMS V7.3-2 powered options
 $! We know that it is only available for V7.3-2 and later on 64 bit platforms.
@@ -5333,7 +5387,6 @@ $   ENDIF
 $   d_attribut="undef"
 $ ENDIF
 $!
-$ d_bcmp="define"
 $ d_getitimer="define"
 $ d_gettimeod="define"
 $ d_mmap="define"
@@ -5531,10 +5584,9 @@ $ IF use64bitint .OR. use64bitint .EQS. "define"
 $ THEN
 $   ivtype = "''i64type'"
 $   uvtype = "''u64type'"
-$ ELSE
-$   i64size="undef"
-$   u64size="undef"
 $ ENDIF
+$ i64size="8"
+$ u64size="8"
 $!
 $ doublemantbits = "52"
 $ IF uselongdouble .OR. uselongdouble .EQS. "define"
@@ -5548,7 +5600,6 @@ $!
 $ tmp = "''ivtype'"
 $ GOSUB type_size_check
 $ ivsize = tmp
-$ IF use64bitint .OR. use64bitint .EQS. "define" THEN i64size = tmp
 $ IF ivtype .eqs. "long"
 $ THEN longsize = tmp
 $ ELSE
@@ -5560,7 +5611,6 @@ $!
 $ tmp = "''uvtype'"
 $ GOSUB type_size_check
 $ uvsize = tmp
-$ IF use64bitint .OR. use64bitint .EQS. "define" THEN u64size = tmp
 $!
 $ tmp = "''i8type'"
 $ GOSUB type_size_check
@@ -5948,19 +5998,18 @@ $ WC "d_attribute_warn_unused_result='undef'"
 $ WC "d_prctl='undef'"
 $ WC "d_prctl_set_name='undef'"
 $ WC "d_printf_format_null='undef'"
-$ WC "d_bcmp='" + d_bcmp + "'"
-$ WC "d_bcopy='" + d_bcopy + "'"
 $ WC "d_bincompat3='undef'"
 $ WC "d_bsd='undef'"
 $ WC "d_bsdgetpgrp='undef'"
 $ WC "d_bsdsetpgrp='undef'"
 $ WC "d_builtin_choose_expr='undef'" ! GCC only
 $ WC "d_builtin_expect='undef'" ! GCC only
-$ WC "d_bzero='" + d_bzero + "'"
+$ WC "d_builtin_add_overflow='undef'" ! GCC only
+$ WC "d_builtin_mul_overflow='undef'" ! GCC only
+$ WC "d_builtin_sub_overflow='undef'" ! GCC only
 $ WC "d_casti32='define'"
 $ WC "d_castneg='define'"
 $ WC "d_cbrt='" + d_cbrt + "'"
-$ WC "d_charvspr='undef'"
 $ WC "d_chown='define'"
 $ WC "d_chroot='undef'"
 $ WC "d_chsize='undef'"
@@ -6148,6 +6197,7 @@ $ WC "d_llrintl='undef'"
 $ WC "d_llround='undef'"
 $ WC "d_llroundl='undef'"
 $ WC "d_llseek='undef'"
+$ WC "d_localeconv_l='undef'"
 $ WC "d_localtime64='undef'"
 $ WC "d_locconv='" + d_locconv + "'"
 $ WC "d_lc_monetary_2008='undef'"
@@ -6172,14 +6222,12 @@ $ WC "d_madvise='undef'"
 $ WC "d_malloc_size='undef'"
 $ WC "d_malloc_good_size='undef'"
 $ WC "d_mblen='" + d_mblen + "'"
+$ WC "d_mbrlen='undef'"
+$ WC "d_mbrtowc='undef'"
 $ WC "d_mbstowcs='" + d_mbstowcs + "'"
 $ WC "d_mbtowc='" + d_mbtowc + "'"
-$ WC "d_memchr='" + d_memchr + "'"
-$ WC "d_memcmp='define'"
-$ WC "d_memcpy='define'"
 $ WC "d_memmem='undef'"
-$ WC "d_memmove='define'"
-$ WC "d_memset='define'"
+$ WC "d_memrchr='" + d_memrchr + "'"
 $ WC "d_mkdir='define'"
 $ WC "d_mkdtemp='" + d_mkdtemp + "'"
 $ WC "d_mkfifo='undef'"
@@ -6226,6 +6274,11 @@ $ WC "d_oldarchlib='define'"
 $ WC "d_oldpthreads='" + d_oldpthreads + "'"
 $ WC "d_oldsock='undef'"
 $ WC "d_open3='define'"
+$ WC "d_openat='undef'"
+$ WC "d_unlinkat='undef'"
+$ WC "d_renameat='undef'"
+$ WC "d_linkat='undef'"
+$ WC "d_fchmodat='undef'"
 $ WC "d_pathconf='" + d_pathconf + "'"
 $ WC "d_pause='define'"
 $ WC "d_perl_otherlibdirs='undef'"
@@ -6263,9 +6316,6 @@ $ WC "d_rewinddir='define'"
 $ WC "d_rint='" + d_rint + "'"
 $ WC "d_rmdir='define'"
 $ WC "d_round='undef'"
-$ WC "d_safebcpy='undef'"
-$ WC "d_safemcpy='define'"
-$ WC "d_sanemcmp='define'"
 $ WC "d_sbrkproto='define'"
 $ WC "d_scalbn='undef'"
 $ WC "d_scalbnl='undef'"
@@ -6343,7 +6393,6 @@ $ WC "d_socket='" + d_socket + "'"
 $ WC "d_socklen_t='" + d_socklen_t + "'"
 $ WC "d_sockpair='" + d_sockpair + "'"
 $ WC "d_socks5_init='undef'"
-$ WC "d_sprintf_returns_strlen='define'"
 $ WC "d_sqrtl='define'"
 $ WC "d_sresgproto='undef'"
 $ WC "d_sresgproto='undef'"
@@ -6366,15 +6415,14 @@ $ WC "d_faststdio='" + d_faststdio + "'"
 $ WC "d_statvfs='" + d_statvfs + "'"
 $ WC "d_strchr='define'"
 $ WC "d_strcoll='" + d_strcoll + "'"
-$ WC "d_strctcpy='define'"
-$ WC "d_strerrm='strerror((e),vaxc$errno)'"
-$ WC "d_strerror='define'"
 $ WC "d_strftime='define'"
 $ WC "d_strlcat='undef'"
 $ WC "d_strlcpy='undef'"
+$ WC "d_strnlen='" + d_strnlen + "'"
 $ WC "d_strtod='define'"
 $ WC "d_strtol='define'"
 $ WC "d_strtold='" + d_strtold + "'"
+$ WC "d_strtold_l='undef'"
 $ WC "d_strtoll='" + d_strtoll + "'"
 $ WC "d_strtoq='" + d_strtoq + "'"
 $ WC "d_strtoul='define'"
@@ -6394,6 +6442,7 @@ $ WC "d_tcsetpgrp='undef'"
 $ WC "d_telldir='define'"
 $ WC "d_telldirproto='define'"
 $ WC "d_tgamma='" + d_tgamma + "'"
+$ WC "d_thread_safe_nl_langinfo_l='undef'"
 $ WC "d_time='define'"
 $ WC "d_timegm='undef'"
 $ WC "d_times='define'"
@@ -6432,9 +6481,6 @@ $ WC "d_vms_shorten_long_symbols='" + d_vms_shorten_long_symbols + "'" ! VMS
 $ WC "d_void_closedir='define'"
 $ WC "d_voidsig='undef'"
 $ WC "d_voidtty='" + "'"
-$ WC "d_volatile='define'"
-$ WC "d_vprintf='define'"
-$ WC "d_vsnprintf='" + d_vsnprintf + "'"
 $ WC "d_wait4='" + d_wait4 + "'"
 $ WC "d_waitpid='define'"
 $ WC "d_wcscmp='define'"
@@ -6450,6 +6496,7 @@ $ WC "db_version_minor='" + "'"
 $ WC "db_version_patch='" + "'"
 $ WC "dbgprefix='" + dbgprefix + "'"
 $ WC "devtype='" + devtype + "'"
+$ WC "default_inc_excludes_dot='" + default_inc_excludes_dot + "'"
 $ WC "direntrytype='struct dirent'"
 $ WC "dlext='" + dlext + "'"
 $ WC "dlobj='" + dlobj + "'"
@@ -6502,7 +6549,6 @@ $ WC "i64type='" + i64type + "'"
 $ WC "i8size='" + i8size + "'"
 $ WC "i8type='" + i8type + "'"
 $ WC "i_arpainet='" + i_arpainet + "'"
-$ WC "i_assert='define'"
 $ WC "i_bfd='undef'"
 $ WC "i_bsdioctl='undef'"
 $ WC "i_crypt='undef'"
@@ -6513,7 +6559,6 @@ $ WC "i_dlfcn='undef'"
 $ WC "i_execinfo='undef'"
 $ WC "i_fcntl='" + i_fcntl + "'"
 $ WC "i_fenv='undef'"
-$ WC "i_float='define'"
 $ WC "i_fp='undef'"
 $ WC "i_fp_class='undef'"
 $ WC "i_gdbm='undef'"
@@ -6524,14 +6569,11 @@ $ WC "i_ieeefp='undef'"
 $ WC "i_inttypes='" + i_inttypes + "'"
 $ WC "i_langinfo='" + i_langinfo + "'"
 $ WC "i_libutil='" + i_libutil + "'"
-$ WC "i_limits='define'"
 $ WC "i_locale='" + i_locale + "'"
 $ WC "i_machcthr='undef'"
 $ WC "i_machcthreads='undef'"
 $ WC "i_malloc='undef'"
 $ WC "i_mallocmalloc='undef'"
-$ WC "i_math='define'"
-$ WC "i_memory='undef'"
 $ WC "i_mntent='undef'"
 $ WC "i_ndbm='undef'"
 $ WC "i_netdb='" + i_netdb + "'"
@@ -6547,17 +6589,14 @@ $ WC "i_rpcsvcdbm='undef'"
 $ WC "i_sgtty='undef'"
 $ WC "i_shadow='" + i_shadow + "'"
 $ WC "i_socks='" + i_socks + "'"
-$ WC "i_stdarg='define'"
 $ IF ccname .EQS. "DEC" .AND. F$INTEGER(Dec_C_Version).GE.60400000
 $ THEN
 $   WC "i_stdbool='define'"
 $ ELSE
 $   WC "i_stdbool='undef'"
 $ ENDIF
-$ WC "i_stddef='define'"
 $ WC "i_stdint='undef'"
 $ WC "i_stdlib='define'"
-$ WC "i_string='define'"
 $ WC "i_sunmath='undef'"
 $ WC "i_sysaccess='" + i_sysaccess + "'"
 $ WC "i_sysdir='undef'"
@@ -6594,10 +6633,8 @@ $ WC "i_time='define'"
 $ WC "i_unistd='" + i_unistd + "'"
 $ WC "i_ustat='undef'"
 $ WC "i_utime='" + i_utime + "'"
-$ WC "i_values='undef'"
-$ WC "i_varargs='undef'"
-$ WC "i_varhdr='stdarg.h'"
 $ WC "i_vfork='undef'"
+$ WC "i_wchar='undef'"
 $ WC "i_xlocale='undef'"
 $ WC "inc_version_list='0'"
 $ WC "inc_version_list_init='0'"
@@ -6849,7 +6886,6 @@ $ WC "uvuformat='" + uvuformat + "'"
 $ WC "uvxformat='" + uvxformat + "'"
 $ WC "uvXUformat='" + uvXUformat + "'"
 $ WC "vendorarch='" + "'"
-$ WC "vaproto='define'"
 $ WC "vendorarchexp='" + "'"
 $ WC "vendorbin='" + "'"
 $ WC "vendorbinexp='" + "'"
@@ -6927,7 +6963,6 @@ $ WC "d_setnetent_r='undef'"
 $ WC "d_setprotoent_r='undef'"
 $ WC "d_setpwent_r='undef'"
 $ WC "d_setservent_r='undef'"
-$ WC "d_snprintf='" + d_snprintf + "'"
 $ WC "d_srand48_r='undef'"
 $ WC "d_srandom_r='undef'"
 $ WC "d_strerror_l='undef'"
@@ -7407,7 +7442,6 @@ $ ENDIF
 $ WRITE CONFIG "$!"
 $ WRITE CONFIG "$! Symbols for Perl-based utility programs:"
 $ WRITE CONFIG "$!"
-$ WRITE CONFIG "$ c2ph       == """ + perl_setup_perl + " ''vms_prefix':[utils]c2ph.com"""
 $ WRITE CONFIG "$ corelist   == """ + perl_setup_perl + " ''vms_prefix':[utils]corelist.com"""
 $ WRITE CONFIG "$ cpan       == """ + perl_setup_perl + " ''vms_prefix':[utils]cpan.com"""
 $ WRITE CONFIG "$ enc2xs     == """ + perl_setup_perl + " ''vms_prefix':[utils]enc2xs.com"""
@@ -7430,7 +7464,6 @@ $ WRITE CONFIG "$ pod2usage  == """ + perl_setup_perl + " ''vms_prefix':[utils]p
 $ WRITE CONFIG "$ podchecker == """ + perl_setup_perl + " ''vms_prefix':[utils]podchecker.com"""
 $ WRITE CONFIG "$ podselect  == """ + perl_setup_perl + " ''vms_prefix':[utils]podselect.com"""
 $ WRITE CONFIG "$ prove      == """ + perl_setup_perl + " ''vms_prefix':[utils]prove.com"""
-$ WRITE CONFIG "$ pstruct    == """ + perl_setup_perl + " ''vms_prefix':[utils]pstruct.com"""
 $ WRITE CONFIG "$ ptar       == """ + perl_setup_perl + " ''vms_prefix':[utils]ptar.com"""
 $ WRITE CONFIG "$ ptardiff   == """ + perl_setup_perl + " ''vms_prefix':[utils]ptardiff.com"""
 $ WRITE CONFIG "$ ptargrep   == """ + perl_setup_perl + " ''vms_prefix':[utils]ptargrep.com"""