This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove the Rhapsody port.
[perl5.git] / Configure
index 0d712ee..a3bd51c 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -28,7 +28,7 @@
 # See Porting/pumpkin.pod for more information on metaconfig.
 #
 
-# Generated on Fri Jan 27 15:48:54 CET 2012 [metaconfig 3.5 PL0]
+# Generated on Mon Dec 24 10:05:48 CET 2012 [metaconfig 3.5 PL0]
 # (with additional metaconfig patches by perlbug@perl.org)
 
 cat >c1$$ <<EOF
@@ -723,6 +723,10 @@ d_snprintf=''
 d_vsnprintf=''
 d_sockatmark=''
 d_sockatmarkproto=''
+d_ip_mreq=''
+d_ip_mreq_source=''
+d_ipv6_mreq=''
+d_ipv6_mreq_source=''
 d_msg_ctrunc=''
 d_msg_dontroute=''
 d_msg_oob=''
@@ -731,6 +735,7 @@ d_msg_proxy=''
 d_oldsock=''
 d_scm_rights=''
 d_sin6_scope_id=''
+d_sockaddr_in6=''
 d_sockaddr_sa_len=''
 d_socket=''
 d_sockpair=''
@@ -841,6 +846,7 @@ cccdlflags=''
 ccdlflags=''
 dlsrc=''
 ld=''
+ld_can_script=''
 lddlflags=''
 usedl=''
 doublesize=''
@@ -7943,8 +7949,9 @@ Some systems use ld to create libraries that can be dynamically loaded,
 while other systems (such as those using ELF) use $cc.
 
 EOM
-       case "$ld" in
-       '')     $cat >try.c <<EOM
+
+: Determine if this is ELF
+       $cat >try.c <<EOM
 /* Test for whether ELF binaries are produced */
 #include <fcntl.h>
 #$i_stdlib I_STDLIB
@@ -7961,22 +7968,26 @@ int main() {
        if(i == -1)
                exit(1); /* fail */
        if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
-               exit(0); /* succeed (yes, it's ELF) */
+               exit(0); /* succeed (yes, it is ELF) */
        else
                exit(1); /* fail */
 }
 EOM
-               if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
+       if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
+               bin_ELF="$define"
+       fi
+       $rm_try
+
+       case "$ld" in
+       '')     if $test $bin_ELF = "$define"; then
                        cat <<EOM
 You appear to have ELF support.  I'll use $cc to build dynamic libraries.
 EOM
                        dflt="$cc"
-                       bin_ELF="$define"
                else
                        echo "I'll use ld to build dynamic libraries."
                        dflt='ld'
                fi
-               $rm_try
                ;;
        *)      dflt="$ld"
                ;;
@@ -7997,7 +8008,6 @@ use no flags, say "none".
 EOM
     case "$lddlflags" in
     '') case "$osname" in
-                       beos) dflt='-nostart' ;;
                        haiku) dflt='-shared' ;;
                        hpux) dflt='-b';
                              case "$gccversion" in
@@ -8083,6 +8093,34 @@ EOM
     ;;
 esac
 
+ld_can_script="$undef"
+case "$bin_ELF$usedl" in
+$define$define)
+    # Abuse try.h and a.out names for neat cleanup
+    $cat >try.c <<EOM
+void foo() {}
+void bar() {}
+EOM
+    $cat >try.h <<EOM
+LIBTEST_42 {
+ global:
+  foo;
+ local: *;
+ };
+EOM
+    if $cc $cccdlflags $ccdlflags $ccflags \
+           $ldflags $lddlflags -o a.out try.c \
+           -Wl,--version-script=try.h >/dev/null 2>&1 \
+       &&  $test -s a.out ; then
+       echo "ld supports scripting" >&4
+       ld_can_script="$define"
+    else
+       echo "ld does not support scripting" >&4
+    fi
+    $rm_try
+    ;;
+esac
+
 : Do we want a shared libperl?
 also=''
 case "$usedl" in
@@ -8092,7 +8130,7 @@ $undef)
        ;;
 *)     case "$useshrplib" in
        '')     case "$osname" in
-               svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|haiku|cygwin*)
+               svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
                        dflt=y
                        also='Building a shared libperl is required for dynamic loading to work on your system.'
                        ;;
@@ -8263,9 +8301,6 @@ if "$useshrplib"; then
        next)
                # next doesn't like the default...
                ;;
-       beos)
-               # beos doesn't like the default, either.
-               ;;
        haiku)
                # Haiku doesn't like the default, either.
                ;;
@@ -11299,6 +11334,24 @@ set d_sockaddr_sa_len; eval $setvar
 $rm_try
 
 echo " "
+echo "Checking the availability struct sockaddr_in6 ..." >&4
+$cat >try.c <<EOF
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+int main() {
+struct sockaddr_in6 sin6;
+return (sin6.sin6_family);
+}
+EOF
+val="$undef"
+set try; if eval $compile; then
+       val="$define"
+fi
+set d_sockaddr_in6; eval $setvar
+$rm_try
+
+echo " "
 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
 $cat >try.c <<EOF
 #include <sys/types.h>
@@ -11317,6 +11370,78 @@ set d_sin6_scope_id; eval $setvar
 $rm_try
 
 echo " "
+echo "Checking the availability struct ip_mreq ..." >&4
+$cat >try.c <<EOF
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+int main() {
+struct ip_mreq mreq;
+return (mreq.imr_multiaddr.s_addr);
+}
+EOF
+val="$undef"
+set try; if eval $compile; then
+       val="$define"
+fi
+set d_ip_mreq; eval $setvar
+$rm_try
+
+echo " "
+echo "Checking the availability struct ip_mreq_source ..." >&4
+$cat >try.c <<EOF
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+int main() {
+struct ip_mreq_source mreq;
+return (mreq.imr_multiaddr.s_addr);
+}
+EOF
+val="$undef"
+set try; if eval $compile; then
+       val="$define"
+fi
+set d_ip_mreq_source; eval $setvar
+$rm_try
+
+echo " "
+echo "Checking the availability struct ipv6_mreq ..." >&4
+$cat >try.c <<EOF
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+int main() {
+struct ipv6_mreq mreq;
+return (mreq.ipv6mr_interface);
+}
+EOF
+val="$undef"
+set try; if eval $compile; then
+       val="$define"
+fi
+set d_ipv6_mreq; eval $setvar
+$rm_try
+
+echo " "
+echo "Checking the availability struct ipv6_mreq_source ..." >&4
+$cat >try.c <<EOF
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+int main() {
+struct ipv6_mreq_source mreq;
+return (mreq.imr_multiaddr.s_addr);
+}
+EOF
+val="$undef"
+set try; if eval $compile; then
+       val="$define"
+fi
+set d_ipv6_mreq_source; eval $setvar
+$rm_try
+
+echo " "
 echo "Checking the availability of certain socket constants..." >&4
 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
        enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
@@ -14939,9 +15064,9 @@ $cat >isblank.c <<'EOCP'
 int main() {
        int c = ' ';
        if (isblank(c))
-               exit(0);
+               return 0 ;
        else
-               exit(1);
+               return 1 ;
 }
 EOCP
 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
@@ -18583,7 +18708,7 @@ eval $setvar
 
 : Check if is a multiplatform env
 case "$osname" in
-next|rhapsody|darwin) multiarch="$define" ;;
+next|darwin) multiarch="$define" ;;
 esac
 case "$multiarch" in
 ''|[nN]*) multiarch="$undef" ;;
@@ -18893,11 +19018,10 @@ Revision='$Revision'
 
 : check for alignment requirements
 echo " "
-case "$usecrosscompile$multiarch" in
+case "$usecrosscompile" in
 *$define*)
        $cat <<EOM
-You seem to be either cross-compiling or doing a multiarchitecture build,
-skipping the memory alignment check.
+You seem to be cross-compiling.  Skipping the memory alignment check.
 
 EOM
        case "$alignbytes" in
@@ -18935,6 +19059,17 @@ EOCP
                        dflt='8'
                        echo "(I can't seem to compile the test program...)"
                fi
+               case "$multiarch" in
+               *$define*)
+                       : The usual safe value is 8, but Darwin with -Duselongdouble
+                       : needs 16.  Hence, we will take 8 as a minimum, but allow
+                       : Configure to pick a larger value if needed.
+                       if $test "$dflt" -lt 8; then
+                           dflt='8'
+                               echo "Setting alignment to 8 for multiarch support.">&4
+                       fi
+                       ;;
+               esac
                ;;
        *) dflt="$alignbytes"
                ;;
@@ -19294,9 +19429,9 @@ echo "Checking to see how many bits your $randfunc() function produces..." >&4
 #endif
 int main()
 {
-       register int i;
-       register unsigned long tmp;
-       register unsigned long max = 0L;
+       int i;
+       unsigned long tmp;
+       unsigned long max = 0L;
 
        for (i = 1000; i; i--) {
                tmp = (unsigned long) $randfunc();
@@ -20333,9 +20468,9 @@ case "$pager" in
        esac
        ;;
 *)     dflt="$pager"
-       fn="f/($pager)"
        ;;
 esac
+fn="f/($dflt)"
 echo " "
 rp='What pager is used on your system?'
 . ./getfile
@@ -21463,7 +21598,7 @@ EOM
 
 val=$undef
 set try
-if eval $compile_ok; then
+if eval $compile; then
        if $run ./try; then
                echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
                val="$define"
@@ -21565,7 +21700,7 @@ EOM
 
 val=$undef
 set try
-if eval $compile_ok; then
+if eval $compile; then
        if $run ./try; then
                echo "You can use _NSGetExecutablePath to find the executing program." >&4
                val="$define"
@@ -21864,15 +21999,16 @@ $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $r
 EOSH
 chmod +x Cppsym.try
 $eunicefix Cppsym.try
-./Cppsym < Cppsym.know > Cppsym.true
+./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
 : Add in any linux cpp "predefined macros":
 case "$osname::$gccversion" in
   *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
     tHdrH=_tmpHdr
     rm -f $tHdrH'.h' $tHdrH
     touch $tHdrH'.h'
+    # Filter out macro arguments, such as Linux's __INT8_C(c)
     if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
-       sed 's/#define[\ \  ]*//;s/[\ \     ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
+       sed -e 's/#define[\ \  ]*//;s/[\ \     ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
        if [ -s $tHdrH'_cppsym.real' ]; then
          cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
        fi
@@ -22180,6 +22316,25 @@ find_extensions='
                    fi;
                fi;
            else
+               echo " $known_extensions $nonxs_extensions" > $$.tmp;
+               if $contains " $this_ext " $$.tmp; then
+                   echo >&4;
+                   echo "Duplicate directories detected for extension $xxx" >&4;
+                   echo "Configure cannot correctly recover from this - shall I abort?" >&4;
+                   case "$knowitall" in
+                   "") dflt=y;;
+                   *) dflt=n;;
+                   esac;
+                   . ../UU/myread;
+                   case "$ans" in
+                   n*|N*) ;;
+                   *) echo >&4;
+                      echo "Ok.  Stopping Configure." >&4;
+                      echo "Please remove the duplicate directory (eg using git clean) and then re-run Configure" >&4;
+                       exit 1;;
+                   esac;
+                   echo "Ok.  You will need to correct config.sh before running make." >&4;
+               fi;
                $ls -1 $xxx > $$.tmp;
                if   $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
                    known_extensions="$known_extensions $this_ext";
@@ -22293,12 +22448,7 @@ for xxx in $known_extensions ; do
                ;;
        Socket|socket)
                case "$d_socket" in
-               true|$define|y)
-                   case "$osname" in
-                   beos) ;; # not unless BONE
-                   *) avail_ext="$avail_ext $xxx" ;;
-                   esac
-                   ;;
+               true|$define|y) avail_ext="$avail_ext $xxx" ;;
                esac
                ;;
        Sys/Syslog|sys/syslog)
@@ -22931,6 +23081,10 @@ d_inetaton='$d_inetaton'
 d_inetntop='$d_inetntop'
 d_inetpton='$d_inetpton'
 d_int64_t='$d_int64_t'
+d_ip_mreq='$d_ip_mreq'
+d_ip_mreq_source='$d_ip_mreq_source'
+d_ipv6_mreq='$d_ipv6_mreq'
+d_ipv6_mreq_source='$d_ipv6_mreq_source'
 d_isascii='$d_isascii'
 d_isblank='$d_isblank'
 d_isfinite='$d_isfinite'
@@ -23096,6 +23250,7 @@ d_sigsetjmp='$d_sigsetjmp'
 d_sin6_scope_id='$d_sin6_scope_id'
 d_sitearch='$d_sitearch'
 d_snprintf='$d_snprintf'
+d_sockaddr_in6='$d_sockaddr_in6'
 d_sockaddr_sa_len='$d_sockaddr_sa_len'
 d_sockatmark='$d_sockatmark'
 d_sockatmarkproto='$d_sockatmarkproto'
@@ -23412,6 +23567,7 @@ ivtype='$ivtype'
 known_extensions='$known_extensions'
 ksh='$ksh'
 ld='$ld'
+ld_can_script='$ld_can_script'
 lddlflags='$lddlflags'
 ldflags='$ldflags'
 ldflags_uselargefiles='$ldflags_uselargefiles'