summaryrefslogtreecommitdiff
path: root/configure.com
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2012-05-24 19:01:16 -0500
committerCraig A. Berry <craigberry@mac.com>2012-05-24 19:01:16 -0500
commit85fac3a953e8269e9239f75b4e9f1db6ad684ccb (patch)
tree04532ec0ced885daa32a2538df6961ab12978e0d /configure.com
parent2242159b1c96bb6b44fa49ed1fe33b2d81f3df78 (diff)
downloadperl-85fac3a953e8269e9239f75b4e9f1db6ad684ccb.tar.gz
Make configure.com ready for C++.
Building on Peter Prymmer's work from some years ago, this gets the configuration process on VMS up to speed on the native C++ compiler. Quite a bit of it involves tweaking the configuration probes to work under C++, plus a variety of other nits. TODO: This should probably be made to work as -Dcc=cxx rather than -Dusecxx as it does now, but it's still pretty experimental.
Diffstat (limited to 'configure.com')
-rw-r--r--configure.com170
1 files changed, 74 insertions, 96 deletions
diff --git a/configure.com b/configure.com
index 591e3b4ee7..6a5921bdf7 100644
--- a/configure.com
+++ b/configure.com
@@ -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
@@ -4858,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
@@ -5102,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 "{"
@@ -5304,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:
$!
@@ -5372,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>"
@@ -5431,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"
@@ -5792,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);"
@@ -5827,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
@@ -6391,7 +6374,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 +6411,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 +6921,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..."