This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix the phrasing of the previous patch.
[perl5.git] / configure.com
index 9d59560..ea8870c 100644 (file)
@@ -926,7 +926,7 @@ $!  ...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|try_cxx|use64bitall|use64bitint|"
+$   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"
@@ -1394,14 +1394,11 @@ $ DELETE/NOLOG/NOCONFIRM gccvers.lis;
 $!
 $Cxx_initial_check:
 $!
-$! Do note that [vms]perl source files have a ways to go before they will 
-$! compile under CXX.
-$! In order to test Configure.com with CXX invoke it with "-Dtry_cxx" on
+$! In order to build with the HP C++ compiler, invoke configure.com with "-Dusecxx" on
 $! the command line.
 $!
-$ IF F$TYPE(try_cxx) .EQS. "" THEN try_cxx := n
-$ IF try_cxx .OR. try_cxx .EQS. "define"
-$!
+$ IF F$TYPE(usecxx) .EQS. "" THEN usecxx := n
+$ IF usecxx .OR. usecxx .EQS. "define"
 $ THEN
 $!
 $ echo "Checking for CXX..."
@@ -1442,7 +1439,7 @@ $   ! link && DEC C++ V1.1-001 on VMS VAX V5.5-2
 $   ! link && DEC C++ V5.6-013 on OpenVMS VAX V7.1
 $   IF tmp .eq. %X10000001
 $   THEN
-$     ld_try = "Link"
+$     ld_try = "Link/nodebug"
 $     vms_cc_available = vms_cc_available + "cxx "
 $     echo "CXX and LINK are available."
 $   ELSE
@@ -1482,7 +1479,12 @@ $ echo "Available compiler(s):"
 $ echo "( ''vms_cc_available')"
 $ IF .NOT.nocc 
 $ THEN
-$   dflt = "cc''vms_cc_dflt'"  !-> "cc" in case first compile went OK
+$   IF usecxx .OR. usecxx .EQS. "define"
+$   THEN
+$     dflt = "cxx"
+$   ELSE
+$     dflt = "cc''vms_cc_dflt'"  !-> "cc" in case first compile went OK
+$   ENDIF
 $ ELSE
 $   dflt = gcc_symbol
 $ ENDIF
@@ -1751,6 +1753,8 @@ $   echo "You are using CXX ''line'"
 $   cxxversion = line
 $   ccversion = line
 $   d_cplusplus = "define"
+$   echo4 "adding /NOANSI_ALIAS qualifier to ccflags."
+$   ccflags = ccflags + "/NOANSI_ALIAS"
 $   CALL Cxx_demangler_cleanup
 $ ELSE
 $   d_cplusplus = "undef"
@@ -3554,6 +3558,8 @@ $ WS "int main()"
 $ WS "{"
 $ WS "#ifdef __STDC__"
 $ WS "printf(""42\n"");"
+$ WS "#elif defined (__STD_ANSI)" ! for CXX
+$ WS "printf(""42\n"");"
 $ WS "#else"
 $ WS "printf(""1\n"");"
 $ WS "#endif"
@@ -3564,8 +3570,8 @@ $ GOSUB compile
 $ cpp_stuff=tmp
 $ IF F$INTEGER(tmp) .eq. 42
 $ THEN
-$   echo4 "Your C compiler and pre-processor defines the symbol:"
-$   echo4 "__STDC__"
+$   echo4 "Oh!  Smells like ANSI's been here."
+$   echo "We can catify or stringify, separately or together!"
 $ ENDIF
 $!
 $! Check for double size
@@ -4171,7 +4177,7 @@ $ WS "#include <string.h>"
 $ WS "int main()"
 $ WS "{"
 $ WS "char * place;"
-$ WS "place = memchr(""foo"", 47, 3);"
+$ WS "place = (char *)memchr(""foo"", 47, 3);"
 $ WS "exit(0);"
 $ WS "}"
 $ CS
@@ -4830,8 +4836,10 @@ $   WS "#endif"
 $   WS "#define _SOCKADDR_LEN"
 $   WS "#include <types.h>"
 $   WS "#include <socket.h>"
+$   WS "#include <string.h>"
 $   WS "int main() {"
 $   WS "struct sockaddr sa;"
+$   WS "memset((char *)&sa, 0, sizeof(sa));"
 $   WS "return (sa.sa_len);"
 $   WS "}"
 $   CS
@@ -4849,7 +4857,6 @@ $   d_sockaddr_sa_len="undef"
 $   echo "You do not have sa_len in the sockaddr struct."
 $ ENDIF
 $!
-$!
 $! Check for sin6_scope_id
 $!
 $ echo4 "Checking the availability of sin6_scope_id in the struct sockaddr_in6 ..."
@@ -4859,8 +4866,10 @@ $   OS
 $   WS "#include <types.h>"
 $   WS "#include <socket.h>"
 $   WS "#include <in.h>"
+$   WS "#include <string.h>"
 $   WS "int main() {"
 $   WS "struct sockaddr_in6 sin6;"
+$   WS "memset((char *)&sin6, 0, sizeof(sin6));"
 $   WS "return (sin6.sin6_scope_id);"
 $   WS "}"
 $   CS
@@ -5103,8 +5112,7 @@ $      usestdstat = "y"
 $      echo4 -
    "Looking for the realpath() function to indicate symbolic link support..."
 $      OS
-$!      WS "#include <stdlib.h>"
-$      WS "void exit(int foo);"
+$      WS "#include <stdlib.h>"
 $      WS "char *realpath(const char *file_name, char * resolved_name, ...);"
 $      WS "int main()"
 $      WS "{"
@@ -5305,51 +5313,52 @@ $ THEN
 $   d_attribut="define"
 $   vms_cc_type="gcc"
 $ ELSE
-$   vms_cc_type="cc"
+$   IF ccname .EQS. "CXX"
+$   THEN
+$      vms_cc_type="cxx"
+$   ELSE
+$      vms_cc_type="cc"
+$   ENDIF
 $   d_attribut="undef"
 $ ENDIF
 $!
-$! Dec C >= 5.2 and VMS ver >= 7.0
-$ IF (ccname .EQS. "DEC") .AND. -
-     (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_unsetenv="define" ! Fix me - Activating requires changing VMS code
-$   d_unsetenv="undef"   ! Change will be needed to allow GNV integration
-$   d_clearenv="undef"
-$   d_usleep="define"
-$   d_setitimer="define"
-$   d_sigaction="define"
-$   d_sigprocmask="define"
-$   d_truncate="define"
-$   d_wait4="define"
-$   d_index="define"
-$   pidtype="pid_t"
-$   sig_name1="ZERO HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE"
-$   sig_name2=" ALRM TERM USR1 USR2 NUM18 NUM19 CHLD CONT STOP TSTP TTIN TTOU DEBUG"
-$   IF (vms_ver .GES. "7.3")
-$   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_unsetenv="define" ! Fix me - Activating requires changing VMS code
+$ d_unsetenv="undef"   ! Change will be needed to allow GNV integration
+$ d_clearenv="undef"
+$ d_usleep="define"
+$ d_setitimer="define"
+$ d_sigaction="define"
+$ d_sigprocmask="define"
+$ d_truncate="define"
+$ d_wait4="define"
+$ d_index="define"
+$ pidtype="pid_t"
+$ sig_name1="ZERO HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE"
+$ sig_name2=" ALRM TERM USR1 USR2 NUM18 NUM19 CHLD CONT STOP TSTP TTIN TTOU DEBUG"
+$ IF (vms_ver .GES. "7.3")
+$ THEN
 $     sig_name2 = sig_name2 + " NUM27 WINCH"
-$   ENDIF
+$ ENDIF
 $!* signal.h defines SIGRTMIN as 33 and SIGRTMAX as 64, but there is no 
 $!* sigqueue function or other apparent means to do realtime signalling,
 $!* so let's not try to include the realtime range for now.
 $!* sig_name3=" NUM29 NUM30 NUM31 NUM32 RTMIN NUM34 NUM35 NUM36 NUM37 NUM38 NUM39 NUM40 NUM41 NUM42 NUM43"
 $!* sig_name4=" NUM44 NUM45 NUM46 NUM47 NUM48 NUM49 NUM50 NUM51 NUM52 NUM53 NUM54 NUM55 NUM56 NUM57 NUM58"
 $!* sig_name5=" NUM59 NUM60 NUM61 NUMT62 NUM63 RTMAX"
-$   sig_name = sig_name1 + sig_name2
-$   sig_num = ""
-$   sig_num_init = ""
-$   sig_name_init = ""
-$   sig_index = 0
+$ sig_name = sig_name1 + sig_name2
+$ sig_num = ""
+$ sig_num_init = ""
+$ sig_name_init = ""
+$ sig_index = 0
 $!
 $ PARSE_SIG_NAME_LOOP:
 $!
@@ -5373,40 +5382,7 @@ $   d_pathconf="define"
 $   d_fpathconf="define"
 $   d_sysconf="define"
 $   d_sigsetjmp="define"
-$ ELSE
-$   pidtype="unsigned int"
-$   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_unsetenv="undef"
-$   d_clearenv="undef"
-$   d_usleep="undef"
-$   d_setitimer="undef"
-$   d_sigaction="undef"
-$   d_sigprocmask="undef"
-$   d_truncate="undef"
-$   d_wait4="undef"
-$   d_index="undef"
-$   sig_name="ZERO HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM ABRT USR1 USR2"
-$   psnwc1="""ZERO"",""HUP"",""INT"",""QUIT"",""ILL"",""TRAP"",""IOT"",""EMT"",""FPE"",""KILL"",""BUS"",""SEGV"",""SYS"","
-$   psnwc2="""PIPE"",""ALRM"",""TERM"",""ABRT"",""USR1"",""USR2"",0"
-$   sig_name_init = psnwc1 + psnwc2
-$   sig_num="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 6 16 17"
-$   sig_num_init="0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,6,16,17,0"
-$   sig_size="19"
-$   sig_count="17
-$   uidtype="unsigned int"
-$   d_pathconf="undef"
-$   d_fpathconf="undef"
-$   d_sysconf="undef"
-$   d_sigsetjmp="undef"
-$ ENDIF
+$!
 $!: see if tzname[] exists
 $ OS
 $ WS "#include <stdio.h>"
@@ -5432,7 +5408,7 @@ $   d_phostname="undef"
 $ ENDIF
 $!
 $! Dec C alone
-$ IF ccname .EQS. "DEC"
+$ IF ccname .EQS. "DEC" .OR. ccname .EQS. "CXX"
 $ THEN
 $   d_mbstowcs="define"
 $   d_mbtowc="define"
@@ -5793,12 +5769,20 @@ $   OS
 $   WS "#include <stdio.h>"
 $   WS "#include <lib$routines.h>"
 $   WS "unsigned long code = 0;"
+$   WS "#define sys$sigprc SYS$SIGPRC"
+$   WS "#ifdef __cplusplus"
+$   WS "extern ""C"" {"
+$   WS "#endif"
+$   WS "    int sys$sigprc(unsigned int *,void *,unsigned int);"
+$   WS "#ifdef __cplusplus"
+$   WS "}"
+$   WS "#endif"
 $   WS "int handler(unsigned long *args) {"
 $   WS "    code = args[1];"
 $   WS "    return 1;"
 $   WS "}"
 $   WS "main() { "
-$   WS "    int iss, sys$sigprc();"
+$   WS "    int iss;"
 $   WS "    lib$establish(handler);"
 $   WS "    iss = sys$sigprc(0,0,0x1234);"
 $   WS "    iss =  ((iss&1)==1 && code == 0x1234);" 
@@ -5828,10 +5812,8 @@ $ IF ccname .EQS. "DEC"
 $ THEN
 $   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' ''ccflags'"
 $ ENDIF
 $ IF use_vmsdebug_perl
@@ -6094,6 +6076,10 @@ $ WC "d_inetaton='undef'"
 $ WC "d_inetntop='undef'"
 $ WC "d_inetpton='undef'"
 $ WC "d_int64_t='" + d_int64_t + "'"
+$ WC "d_ip_mreq='define'"
+$ WC "d_ip_mreq_source='undef'"
+$ WC "d_ipv6_mreq='define'"
+$ WC "d_ipv6_mreq_source='undef'"
 $ WC "d_isascii='define'"
 $ WC "d_isblank='undef'"
 $ WC "d_isfinite='undef'"
@@ -6238,6 +6224,7 @@ $ WC "d_sigprocmask='" + d_sigprocmask + "'"
 $ WC "d_sigsetjmp='" + d_sigsetjmp + "'"
 $ WC "d_sin6_scope_id='" + d_sin6_scope_id + "'"
 $ WC "d_sitearch='define'"
+$ WC "d_sockaddr_in6='define'"
 $ WC "d_sockaddr_sa_len='" + d_sockaddr_sa_len + "'"
 $ WC "d_sockatmark='undef'"
 $ WC "d_sockatmarkproto='undef'"
@@ -6272,7 +6259,6 @@ $ WC "d_strerror='define'"
 $ WC "d_strftime='define'"
 $ WC "d_strlcat='undef'"
 $ WC "d_strlcpy='undef'"
-$ WC "d_strptime='undef'"
 $ WC "d_strtod='define'"
 $ WC "d_strtol='define'"
 $ WC "d_strtold='" + d_strtold + "'"
@@ -6344,7 +6330,7 @@ $ WC "devtype='" + devtype + "'"
 $ WC "direntrytype='struct dirent'"
 $ WC "dlext='" + dlext + "'"
 $ WC "dlobj='" + dlobj + "'"
-$ WC "dlsrc='dl_vms.c'"
+$ WC "dlsrc='dl_vms.xs'"
 $ WC "doublesize='" + doublesize + "'"
 $ WC "drand01='" + drand01 + "'"
 $ WC "dtrace='" + "'"
@@ -6391,7 +6377,7 @@ $ WC "i_assert='define'"
 $ WC "i_crypt='undef'"
 $ WC "i_db='undef'"
 $ WC "i_dbm='undef'"
-$ WC "i_dirent='" + i_dirent + "'"
+$ WC "i_dirent='undef'"        ! we roll our own
 $ WC "i_dlfcn='undef'"
 $ WC "i_fcntl='" + i_fcntl + "'"
 $ WC "i_float='define'"
@@ -6428,7 +6414,7 @@ $ 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)
+$ IF ccname .EQS. "DEC" .AND. F$INTEGER(Dec_C_Version).GE.60400000
 $ THEN
 $   WC "i_stdbool='define'"
 $ ELSE
@@ -6938,17 +6924,12 @@ $ IF use_ieee_math THEN WC "#define USE_IEEE"
 $ IF d_herrno .EQS. "undef" THEN WC "#define NEED_AN_H_ERRNO"
 $ WC "#define HAS_ENVGETENV"
 $ WC "#define PERL_EXTERNAL_GLOB"
-$ IF F$ELEMENT(0, "-", archname) .EQS. "VMS_VAX" .AND. -
-     ccname .EQS. "DEC" .AND. -
-     ccversion .LE. 50390006
-$ THEN
-$! Alas this does not help to build Fcntl
-$!   WC "#define PERL_IGNORE_FPUSIG SIGFPE"
-$ ENDIF
 $ IF kill_by_sigprc .EQS. "define" then WC "#define KILL_BY_SIGPRC"
 $ IF unlink_all_versions .OR. unlink_all_versions .EQS. "define" THEN -
     WC "#define UNLINK_ALL_VERSIONS"
 $ IF d_sockaddr_sa_len .EQS. "define" then WC "#define _SOCKADDR_LEN 1"
+$ IF ccname .EQS. "CXX" then WC "#define NO_ENVIRON_ARRAY"
+$ IF ccname .EQS. "CXX" then WC "#define VMS" ! only has __VMS by default
 $ CLOSE CONFIG
 $!
 $ echo4 "Doing variable substitutions on .SH files..."