This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add sin6_scope_id probe (LeoNerd)
[perl5.git] / Configure
index f4d9cfb..268964d 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -30,7 +30,7 @@
 
 # $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $
 #
-# Generated on Mon Mar 29 10:12:43 CEST 2010 [metaconfig 3.5 PL0]
+# Generated on Mon Dec 20 16:52:31 CET 2010 [metaconfig 3.5 PL0]
 # (with additional metaconfig patches by perlbug@perl.org)
 
 cat >c1$$ <<EOF
@@ -731,6 +731,8 @@ d_msg_peek=''
 d_msg_proxy=''
 d_oldsock=''
 d_scm_rights=''
+d_sin6_scope_id=''
+d_sockaddr_sa_len=''
 d_socket=''
 d_sockpair=''
 sockethdr=''
@@ -748,6 +750,8 @@ d_sresuproto=''
 d_statblks=''
 d_statfs_f_flags=''
 d_statfs_s=''
+d_static_inline=''
+perl_static_inline=''
 d_fstatvfs=''
 d_statvfs=''
 d_stdio_cnt_lval=''
@@ -1076,7 +1080,6 @@ version=''
 version_patchlevel_string=''
 perl5=''
 perladmin=''
-perlpath=''
 d_nv_preserves_uv=''
 d_nv_zero_is_allbits_zero=''
 i16size=''
@@ -1306,10 +1309,24 @@ fi
 
 groupstype=''
 i_whoami=''
+archname=''
+: Possible local include directories to search.
+: Set locincpth to "" in a hint file to defeat local include searches.
+locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
+locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
+:
+: no include file wanted by default
+inclwanted=''
+
+: Enable -DEBUGGING and -DDEBUGGING from the command line
+EBUGGING=''
+DEBUGGING=old
+
+: set usethreads on the Configure command line to enable threads.
+usereentrant='undef'
 : Trailing extension.  Override this in a hint file, if needed.
 : Extra object files, if any, needed on this platform.
 archobjs=''
-archname=''
 libnames=''
 : change the next line if compiling for Xenix/286 on Xenix/386
 xlibpth='/usr/lib/386 /lib/386'
@@ -1333,23 +1350,9 @@ plibpth=''
 libswanted=''
 : some systems want to use only the non-versioned libso:s
 ignore_versioned_solibs=''
-: set usethreads on the Configure command line to enable threads.
-usereentrant='undef'
 : full support for void wanted by default
 defvoidused=15
 
-: Possible local include directories to search.
-: Set locincpth to "" in a hint file to defeat local include searches.
-locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
-locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
-:
-: no include file wanted by default
-inclwanted=''
-
-: Enable -DEBUGGING and -DDEBUGGING from the command line
-EBUGGING=''
-DEBUGGING=old
-
 ccname=''
 ccversion=''
 perllibs=''
@@ -2371,6 +2374,7 @@ make
 more
 nm
 nroff
+perl
 pg
 test
 uname
@@ -4160,11 +4164,6 @@ else
        perl_patchlevel=0
        $echo "(You do not have patchlevel.h.  Eek.)"
 fi
-if $test -r $rsrc/.patch ; then
-       if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
-               perl_patchlevel=`cat $rsrc/.patch`
-       fi
-fi
 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
 version_patchlevel_string="version $patchlevel subversion $subversion"
 case "$perl_patchlevel" in
@@ -7672,7 +7671,7 @@ $echo $n ".$c"
 $grep fprintf libc.tmp > libc.ptf
 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
-xxx='[ADTSIW]'
+xxx='[ADTSIWi]'
 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx  *//p'";\
        eval $xscan;\
        $contains '^fprintf$' libc.list >/dev/null 2>&1; then
@@ -8916,106 +8915,6 @@ rp='Perl administrator e-mail address'
 . ./myread
 perladmin="$ans"
 
-: determine whether to only install version-specific parts.
-echo " "
-$cat <<EOM
-Do you want to install only the version-specific parts of the perl
-distribution?  Usually you do *not* want to do this.
-EOM
-case "$versiononly" in
-"$define"|[Yy]*|true) dflt='y' ;;
-*) dflt='n';
-esac
-rp="Do you want to install only the version-specific parts of perl?"
-. ./myread
-case "$ans" in
-[yY]*) val="$define";;
-*)     val="$undef" ;;
-esac
-set versiononly
-eval $setvar
-
-case "$versiononly" in
-"$define") inc_version_list=''
-           inc_version_list_init=0
-           ;;
-esac
-
-: figure out how to guarantee perl startup
-: XXX Note that this currently takes advantage of the bug that binexp ignores
-:     the Configure -Dinstallprefix setting, which in turn means that under
-:     relocatable @INC, initialinstalllocation is what binexp started as.
-case "$startperl" in
-'')
-       case "$sharpbang" in
-       *!)
-               $cat <<EOH
-
-I can use the #! construct to start perl on your system. This will
-make startup of perl scripts faster, but may cause problems if you
-want to share those scripts and perl is not in a standard place
-($initialinstalllocation/perl) on all your platforms. The alternative
-is to force a shell by starting the script with a single ':' character.
-
-EOH
-               case "$versiononly" in
-               "$define")      dflt="$initialinstalllocation/perl$version";;
-               *)              dflt="$initialinstalllocation/perl";;
-               esac
-               rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
-               . ./myread
-               case "$ans" in
-               none)   startperl=": # use perl";;
-               *)      startperl="#!$ans"
-                       if $test 30 -lt `echo "$ans" | wc -c`; then
-                               $cat >&4 <<EOM
-
-WARNING:  Some systems limit the #! command to 32 characters.
-If you experience difficulty running Perl scripts with #!, try
-installing Perl in a directory with a shorter pathname.
-
-EOM
-                       fi ;;
-               esac
-               ;;
-       *) startperl=": # use perl"
-               ;;
-       esac
-       ;;
-esac
-echo "I'll use $startperl to start perl scripts."
-
-: figure best path for perl in scripts
-case "$perlpath" in
-'')
-       case "$versiononly" in
-       "$define")      perlpath="$initialinstalllocation/perl$version";;
-       *)              perlpath="$initialinstalllocation/perl";;
-       esac
-       case "$startperl" in
-       *!*) ;;
-       *)
-               $cat <<EOH
-
-I will use the "eval 'exec'" idiom to start Perl on your system.
-I can use the full path of your Perl binary for this purpose, but
-doing so may cause problems if you want to share those scripts and
-Perl is not always in a standard place ($initialinstalllocation/perl).
-
-EOH
-               dflt="$initialinstalllocation/perl"
-               rp="What path shall I use in \"eval 'exec'\"?"
-               . ./myread
-               perlpath="$ans"
-               ;;
-       esac
-       ;;
-esac
-case "$startperl" in
-*!*)   ;;
-*)     echo "I'll use $perlpath in \"eval 'exec'\"" ;;
-esac
-
 : determine where public executable scripts go
 set scriptdir scriptdir
 eval $prefixit
@@ -9137,6 +9036,75 @@ rp='Pathname where add-on public executable scripts should be installed?'
 prefixvar=sitescript
 . ./setprefixvar
 
+: determine whether to only install version-specific parts.
+echo " "
+$cat <<EOM
+Do you want to install only the version-specific parts of the perl
+distribution?  Usually you do *not* want to do this.
+EOM
+case "$versiononly" in
+"$define"|[Yy]*|true) dflt='y' ;;
+*) dflt='n';
+esac
+rp="Do you want to install only the version-specific parts of perl?"
+. ./myread
+case "$ans" in
+[yY]*) val="$define";;
+*)     val="$undef" ;;
+esac
+set versiononly
+eval $setvar
+
+case "$versiononly" in
+"$define") inc_version_list=''
+           inc_version_list_init=0
+           ;;
+esac
+
+: figure out how to guarantee perl startup
+: XXX Note that this currently takes advantage of the bug that binexp ignores
+:     the Configure -Dinstallprefix setting, which in turn means that under
+:     relocatable @INC, initialinstalllocation is what binexp started as.
+case "$startperl" in
+'')
+       case "$sharpbang" in
+       *!)
+               $cat <<EOH
+
+I can use the #! construct to start perl on your system. This will
+make startup of perl scripts faster, but may cause problems if you
+want to share those scripts and perl is not in a standard place
+($initialinstalllocation/perl) on all your platforms. The alternative
+is to force a shell by starting the script with a single ':' character.
+
+EOH
+               case "$versiononly" in
+               "$define")      dflt="$initialinstalllocation/perl$version";;
+               *)              dflt="$initialinstalllocation/perl";;
+               esac
+               rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
+               . ./myread
+               case "$ans" in
+               none)   startperl=": # use perl";;
+               *)      startperl="#!$ans"
+                       if $test 30 -lt `echo "$ans" | wc -c`; then
+                               $cat >&4 <<EOM
+
+WARNING:  Some systems limit the #! command to 32 characters.
+If you experience difficulty running Perl scripts with #!, try
+installing Perl in a directory with a shorter pathname.
+
+EOM
+                       fi ;;
+               esac
+               ;;
+       *) startperl=": # use perl"
+               ;;
+       esac
+       ;;
+esac
+echo "I'll use $startperl to start perl scripts."
+
 : Check if faststdio is requested and available
 case "$usefaststdio" in
 $define|true|[yY]*|'')
@@ -11353,6 +11321,41 @@ eval $inlibc
 
 
 echo " "
+echo "Checking the availability sa_len in the sock struct ..." >&4
+$cat >try.c <<EOF
+#include <sys/types.h>
+#include <sys/socket.h>
+int main() {
+struct sockaddr sa;
+return (sa.sa_len);
+}
+EOF
+val="$undef"
+set try; if eval $compile; then
+       val="$define"
+fi
+set d_sockaddr_sa_len; 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>
+#include <sys/socket.h>
+#include <netinet/in.h>
+int main() {
+struct sockaddr_in6 sin6;
+return (sin6.sin6_scope_id);
+}
+EOF
+val="$undef"
+set try; if eval $compile; then
+       val="$define"
+fi
+set d_sin6_scope_id; 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]'`
@@ -17874,6 +17877,112 @@ case "$d_statfs_f_flags" in
 *)              echo "No, it doesn't." ;;
 esac
 
+: see what flavor, if any, of static inline is supported
+echo " "
+echo "Checking to see if your system supports static inline..."
+$cat > try.c <<'EOCP'
+#include <stdlib.h>
+extern int f_via_a(int x);
+extern int f_via_b(int x);
+int main(int argc, char **argv)
+{
+    int y;
+
+    y = f_via_a(0);
+#ifdef USE_B
+    y = f_via_b(0);
+#endif
+    if (y == 42) {
+        return EXIT_SUCCESS;
+    }
+    else {
+        return EXIT_FAILURE;
+    }
+}
+EOCP
+$cat > a.c <<'EOCP'
+static INLINE int f(int x) {
+    int y;
+    y = x + 42;
+    return y;
+}
+
+int f_via_a(int x)
+{
+    return f(x);
+}
+EOCP
+$cat > b.c <<'EOCP'
+extern int f(int x);
+
+int f_via_b(int x)
+{
+    return f(x);
+}
+EOCP
+
+# Respect a hint (or previous) value for perl_static_inline, if there is one.
+case "$perl_static_inline" in
+'')    # Check the various possibilities, and break out on success.
+       # For gcc, prefer __inline__, which will still permit 
+       # cflags.SH to add in -ansi.
+       case "$gccversion" in
+               '') xxx="inline __inline__ __inline _inline";;
+               *)  xxx="__inline__ inline __inline _inline";;
+       esac
+       for inline in $xxx; do
+               set try -DINLINE=$inline a.c
+               if eval $compile && $run ./try; then
+                       # Now make sure there is no external linkage of static
+                       # functions
+                       set try -DINLINE=$inline -DUSE_B a.c b.c
+                       if eval $compile && $run ./try; then
+                               $echo "Your compiler supports static $inline, " >&4
+                               $echo "but it also creates an external definition," >&4
+                               $echo "so I won't use it." >&4
+                               val=$undef
+                       else
+                               $echo "Your compiler supports static $inline." >&4
+                               val=$define
+                               perl_static_inline="static $inline";
+                               break;
+                       fi
+               else
+                       $echo "Your compiler does NOT support static $inline." >&4
+                       val="$undef"
+               fi
+       done
+       ;;
+*inline*) # Some variant of inline exists.
+       echo "Keeping your $hint value of $perl_static_inline."
+       val=$define
+       ;;
+static)  # No inline capabilities
+       echo "Keeping your $hint value of $perl_static_inline."
+       val=$undef
+       ;;
+*)  # Unrecognized previous value -- blindly trust the supplied
+       # value and hope it makes sense.  Use old value for
+       # d_static_inline, if there is one.
+       echo "Keeping your $hint value of $perl_static_inline."
+       case "$d_static_inline" in
+               '') val=$define ;;
+               *)  val=$d_static_inline ;;
+       esac
+       ;;
+esac
+# Fallback to plain 'static' if nothing worked.
+case "$perl_static_inline" in
+'')
+       perl_static_inline="static"
+       val=$undef
+       ;;
+esac
+set d_static_inline
+eval $setvar
+$rm -f a.[co] b.[co]
+$rm_try
+
 : Check stream access
 $cat >&4 <<EOM
 Checking how to access stdio streams by file descriptor number...
@@ -18605,8 +18714,8 @@ $signal_t bletch(int s) { exit(4); }
 #endif
 int main() {
 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
-    U8 buf[8];
-    U32 *up;
+    volatile U8 buf[8];
+    volatile U32 *up;
     int i;
 
     if (sizeof(U32) != 4) {
@@ -18862,39 +18971,9 @@ esac
 : set the base revision
 baserev=5.0
 
-: check for length of character
-echo " "
-case "$charsize" in
-'')
-       echo "Checking to see how big your characters are (hey, you never know)..." >&4
-       $cat >try.c <<EOCP
-#include <stdio.h>
-#$i_stdlib I_STDLIB
-#ifdef I_STDLIB
-#include <stdlib.h>
-#endif
-int main()
-{
-    printf("%d\n", (int)sizeof(char));
-    exit(0);
-}
-EOCP
-       set try
-       if eval $compile_ok; then
-               dflt=`$run ./try`
-       else
-               dflt='1'
-               echo "(I can't seem to compile the test program.  Guessing...)"
-       fi
-       ;;
-*)
-       dflt="$charsize"
-       ;;
-esac
-rp="What is the size of a character (in bytes)?"
-. ./myread
-charsize="$ans"
-$rm_try
+: length of character in bytes. Is always 1, otherwise it isnt C
+: This used to be a test using sizeof
+charsize=1
 
 : Check for the number of bits in a character
 case "$charbits" in
@@ -21973,13 +22052,6 @@ for xxx in $known_extensions ; do
                $define) avail_ext="$avail_ext $xxx" ;;
                esac
                ;;
-       XS/APItest/KeywordRPN|xs/apitest/keywordrpn)
-               # This is just for testing.  Skip it unless we have dynamic loading.
-
-               case "$usedl" in
-               $define) avail_ext="$avail_ext $xxx" ;;
-               esac
-               ;;
        XS/Typemap|xs/typemap)
                # This is just for testing.  Skip it unless we have dynamic loading.
                case "$usedl" in
@@ -22168,7 +22240,7 @@ esac
 # the appropriate Makefile.PL.
 case " $static_ext " in
        *" Encode "*) # Add the subextensions of Encode
-       cd "$rsrc/ext"
+       cd "$rsrc/cpan"
        for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
                static_ext="$static_ext Encode/$xxx"
        done
@@ -22729,8 +22801,10 @@ d_sigaction='$d_sigaction'
 d_signbit='$d_signbit'
 d_sigprocmask='$d_sigprocmask'
 d_sigsetjmp='$d_sigsetjmp'
+d_sin6_scope_id='$d_sin6_scope_id'
 d_sitearch='$d_sitearch'
 d_snprintf='$d_snprintf'
+d_sockaddr_sa_len='$d_sockaddr_sa_len'
 d_sockatmark='$d_sockatmark'
 d_sockatmarkproto='$d_sockatmarkproto'
 d_socket='$d_socket'
@@ -22746,6 +22820,7 @@ d_sresuproto='$d_sresuproto'
 d_statblks='$d_statblks'
 d_statfs_f_flags='$d_statfs_f_flags'
 d_statfs_s='$d_statfs_s'
+d_static_inline='$d_static_inline'
 d_statvfs='$d_statvfs'
 d_stdio_cnt_lval='$d_stdio_cnt_lval'
 d_stdio_ptr_lval='$d_stdio_ptr_lval'
@@ -23142,9 +23217,9 @@ path_sep='$path_sep'
 perl5='$perl5'
 perl='$perl'
 perl_patchlevel='$perl_patchlevel'
+perl_static_inline='$perl_static_inline'
 perladmin='$perladmin'
 perllibs='$perllibs'
-perlpath='$perlpath'
 pg='$pg'
 phostname='$phostname'
 pidtype='$pidtype'