X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/aa86d596a3afb2111d0ea4b38f99238145ecb10f..6e64f32b089786e5be480ddf137d427c003b791b:/Configure diff --git a/Configure b/Configure index 0076d66..3ae16ca 100755 --- a/Configure +++ b/Configure @@ -28,7 +28,7 @@ # See Porting/pumpkin.pod for more information on metaconfig. # -# Generated on Tue Dec 21 14:30:17 CET 2010 [metaconfig 3.5 PL0] +# Generated on Sun Apr 1 12:00:35 CEST 2012 [metaconfig 3.5 PL0] # (with additional metaconfig patches by perlbug@perl.org) cat >c1$$ <. Versions 5.003_02 and later of $package allow -alternate IO mechanisms via the PerlIO abstraction layer, but the -stdio mechanism is still available if needed. The abstraction layer -can use AT&T's sfio (if you already have sfio installed) or regular stdio. -Using PerlIO with sfio may cause problems with some extension modules. - -If this doesn't make any sense to you, just accept the default '$dflt'. -EOM -rp='Use the PerlIO abstraction layer?' -. ./myread -case "$ans" in -y|Y) - val="$define" - ;; -*) - echo "Ok, doing things the stdio way." - val="$undef" - ;; -esac -set useperlio -eval $setvar - -case "$usesocks" in -$define|true|[yY]*) - case "$useperlio" in - $define|true|[yY]*) ;; - *) cat >&4 <&4 @@ -4201,13 +4139,8 @@ $define|true|[yY]*) dflt='y';; *) # Catch case where user specified ithreads or 5005threads but # forgot -Dusethreads (A.D. 4/2002) case "$useithreads$use5005threads" in - *$define*) - case "$useperlio" in - "$define") dflt='y' ;; - *) dflt='n' ;; - esac - ;; - *) dflt='n';; + *$define*) dflt='y';; + *) dflt='n';; esac ;; esac @@ -4309,16 +4242,6 @@ EOM useithreads="$usethreads" fi -if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then - cat >&4 <&4 - ;; -*) - echo "Perlio not selected, using stdio." >&4 - case "$archname" in - *-stdio*) echo "...and architecture name already has -stdio." >&4 - ;; - *) archname="$archname-stdio" - echo "...setting architecture name to $archname." >&4 - ;; - esac - ;; -esac if $test -f archname.cbu; then echo "Your platform has some specific hints for architecture name, using them..." . ./archname.cbu @@ -6847,6 +6777,7 @@ case "$usemymalloc" in 4) dflt='y' ;; *) dflt='n' ;; esac + if test "$useithreads" = "$define"; then dflt='n'; fi ;; esac rp="Do you wish to attempt to use the malloc that comes with $package?" @@ -8015,8 +7946,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 <try.c < #$i_stdlib I_STDLIB @@ -8033,22 +7965,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 <try.c <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 @@ -8326,7 +8290,7 @@ if "$useshrplib"; then solaris) xxx="-R $shrpdir" ;; - freebsd|netbsd|openbsd|interix|dragonfly) + freebsd|mirbsd|netbsd|openbsd|interix|dragonfly) xxx="-Wl,-R$shrpdir" ;; bsdos|linux|irix*|dec_osf|gnu*) @@ -9410,6 +9374,9 @@ EOCP ;; esac +: Check if we want perlio +useperlio="$define" + : Set the vendorbin variables case "$vendorprefix" in '') d_vendorbin="$undef" @@ -9897,7 +9864,7 @@ done case "$d_longdbl$uselongdouble" in "$define$define") - : again, add prefered functions to our list first + : again, add preferred functions to our list first xxx_ld_list="" for xxx_convert in $gconvert_ld_preference; do case $xxx_convert in @@ -10058,7 +10025,7 @@ eval $inlibc set pthread.h i_pthread eval $inhdr -: define a fucntion to check prototypes +: define a function to check prototypes $cat > protochk <&4 +$cat >try.c < +#include +#include +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 < @@ -11386,6 +11371,24 @@ set d_sin6_scope_id; eval $setvar $rm_try echo " " +echo "Checking the availability struct ipv6_mreq ..." >&4 +$cat >try.c < +#include +#include +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 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]'` @@ -15000,6 +15003,30 @@ set d_isascii eval $setvar $rm -f isascii* +: Look for isblank +echo " " +$cat >isblank.c <<'EOCP' +#include +#include +int main() { + int c = ' '; + if (isblank(c)) + exit(0); + else + exit(1); +} +EOCP +if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then + echo "isblank() found." >&4 + val="$define" +else + echo "isblank() NOT found." >&4 + val="$undef" +fi +set d_isblank +eval $setvar +$rm -f isblank* + : see if isfinite exists set isfinite d_isfinite eval $inlibc @@ -16118,23 +16145,24 @@ echo " " procselfexe='' val="$undef" case "$d_readlink" in -"$define") - if $issymlink /proc/self/exe ; then - $ls -l /proc/self/exe > reflect + "$define") + : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels + : more tidy to avoid an extra level of symlink + set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out + while test $# -gt 0; do + type=$1; try=$2 + shift; shift + if $issymlink $try; then + $ls -l $try > reflect if $contains /`basename $ls` reflect >/dev/null 2>&1; then - echo "You have Linux-like /proc/self/exe." - procselfexe='"/proc/self/exe"' - val="$define" - fi - fi - if $issymlink /proc/curproc/file ; then - $ls -l /proc/curproc/file > reflect - if $contains /`basename $ls` reflect >/dev/null 2>&1; then - echo "You have BSD-like /proc/curproc/file." - procselfexe='"/proc/curproc/file"' - val="$define" + echo "You have $type-like $try." + procselfexe='"'$try'"' + val="$define" + : This will break out of the loop + set X; shift fi - fi + fi + done ;; esac $rm -f reflect @@ -17364,17 +17392,10 @@ $define) *) dflt='n';; esac echo "$package can use the sfio library, but it is experimental." - case "$useperlio" in - "$undef") - echo "For sfio also the PerlIO abstraction layer is needed." - echo "Earlier you said you wouldn't want that." - ;; - esac rp="You seem to have sfio available, do you want to try using it?" . ./myread case "$ans" in - y|Y) echo "Ok, turning on both sfio and PerlIO, then." - useperlio="$define" + y|Y) echo "Ok, turning on sfio then." val="$define" ;; *) echo "Ok, avoiding sfio this time. I'll use stdio instead." @@ -18723,7 +18744,7 @@ EOM ;; esac -: Checking 32bit aligndness +: Checking 32bit alignedness $cat <&4 +$cat > try.c < +#include +#$i_stdlib I_STDLIB +#ifdef I_STDLIB +#include +#endif +int main() { + struct stat st; + printf("%d\n", (int)sizeof(st.st_ino)); + exit(0); +} +EOCP +set try +if eval $compile_ok; then + val=`$run ./try` + case "$val" in + '') st_ino_size=4 + $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4 + ;; + *) st_ino_size=$val + $echo "Your st_ino is $st_ino_size bytes long." + ;; + esac +else + st_ino_size=4 + $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4 +fi +$rm_try + +: Check if st_ino is signed +$echo " " +$echo "Checking the sign of st_ino..." >&4 +$cat > try.c < +#include +int main() { + struct stat foo; + foo.st_ino = -1; + if (foo.st_ino < 0) + printf("-1\n"); + else + printf("1\n"); +} +EOCP +set try +if eval $compile; then + val=`$run ./try` + case "$val" in + '') st_ino_sign=1 + $echo "(I can't execute the test program--guessing unsigned.)" >&4 + ;; + *) st_ino_sign=$val + case "$st_ino_sign" in + 1) $echo "Your st_ino is unsigned." ;; + -1) $echo "Your st_ino is signed." ;; + esac + ;; + esac +else + st_ino_sign=1 + $echo "(I can't compile the test program--guessing unsigned.)" >&4 +fi +$rm_try + : see what type of char stdio uses. echo " " echo '#include ' | $cppstdin $cppminus > stdioh @@ -21348,6 +21437,221 @@ case "$uidsign" in ;; esac +: Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program +echo " " +echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4 +$cat >try.c <<'EOM' +/* Intentionally a long probe as I'd like to sanity check that the exact + approach is going to work, as thinking it will work, but only having it + part working at runtime is worse than not having it. */ + +#include +#include +#include +#include +#include +#include +#include + +int +main(int argc, char **argv) { + char *buffer; + char *argv_leaf = strrchr(argv[0], '/'); + char *buffer_leaf; + size_t size = 0; + int mib[4]; + + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_PATHNAME; + mib[3] = -1; + + if (!argv_leaf) { + fprintf(stderr, "Can't locate / in '%s'\n", argv[0]); + return 1; + } + + if (sysctl(mib, 4, NULL, &size, NULL, 0)) { + perror("sysctl"); + return 2; + } + + if (size < strlen(argv_leaf) + 1) { + fprintf(stderr, "size %lu is too short for a path\n", + (unsigned long) size); + return 3; + } + + if (size > MAXPATHLEN * MAXPATHLEN) { + fprintf(stderr, "size %lu is too long for a path\n", + (unsigned long) size); + return 4; + } + + buffer = malloc(size); + if (!buffer) { + perror("malloc"); + return 5; + } + + if (sysctl(mib, 4, buffer, &size, NULL, 0)) { + perror("sysctl"); + return 6; + } + + if (strlen(buffer) + 1 != size) { + fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n", + (unsigned long)size, (unsigned long)strlen(buffer) + 1); + return 7; + } + + + if (*buffer != '/') { + fprintf(stderr, "Not an absolute path: '%s'\n", buffer); + return 8; + } + + if (strstr(buffer, "/./")) { + fprintf(stderr, "Contains /./: '%s'\n", buffer); + return 9; + } + + if (strstr(buffer, "/../")) { + fprintf(stderr, "Contains /../: '%s'\n", buffer); + return 10; + } + + buffer_leaf = strrchr(buffer, '/'); + if (strcmp(buffer_leaf, argv_leaf) != 0) { + fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer); + return 11; + } + + free(buffer); + + return 0; +} +EOM + +val=$undef +set try +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" + else + echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4 + val="$undef" + fi +else + echo "I'm unable to compile the test program." >&4 + echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4 + val="$undef" +fi +$rm_try +set usekernprocpathname +eval $setvar + +: Determine if we can use _NSGetExecutablePath to find executing program +echo " " +echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4 +$cat >try.c <<'EOM' +/* Intentionally a long probe as I'd like to sanity check that the exact + approach is going to work, as thinking it will work, but only having it + part working at runtime is worse than not having it. */ +#include +#include +#include +#include +#include + +int +main(int argc, char **argv) { + char buf[1]; + uint32_t size = sizeof(buf); + int result; + char *buffer; + char *tidied; + char *argv_leaf = strrchr(argv[0], '/'); + char *tidied_leaf; + + if (!argv_leaf) { + fprintf(stderr, "Can't locate / in '%s'\n", argv[0]); + return 1; + } + + _NSGetExecutablePath(buf, &size); + if (size > MAXPATHLEN * MAXPATHLEN) { + fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n", + (unsigned int) size); + return 2; + } + + buffer = malloc(size); + if (!buffer) { + perror("malloc"); + return 3; + } + + result = _NSGetExecutablePath(buffer, &size); + if (result != 0) { + fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n", + result, (unsigned int) size); + return 4; + } + + tidied = realpath(buffer, NULL); + if (!tidied) { + perror("realpath"); + return 5; + } + + free(buffer); + + if (*tidied != '/') { + fprintf(stderr, "Not an absolute path: '%s'\n", tidied); + return 6; + } + + if (strstr(tidied, "/./")) { + fprintf(stderr, "Contains /./: '%s'\n", tidied); + return 7; + } + + if (strstr(tidied, "/../")) { + fprintf(stderr, "Contains /../: '%s'\n", tidied); + return 8; + } + + tidied_leaf = strrchr(tidied, '/'); + if (strcmp(tidied_leaf, argv_leaf) != 0) { + fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied); + return 9; + } + + free(tidied); + + return 0; +} +EOM + +val=$undef +set try +if eval $compile; then + if $run ./try; then + echo "You can use _NSGetExecutablePath to find the executing program." >&4 + val="$define" + else + echo "Nope, _NSGetExecutablePath doesn't work here." >&4 + fi +else + echo "I'm unable to compile the test program." >&4 + echo "I'll assume no _NSGetExecutablePath here." >&4 +fi +$rm_try +set usensgetexecutablepath +eval $setvar + : Check if site customization support was requested case "$usesitecustomize" in $define|true|[Yy]*) @@ -21632,15 +21936,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 @@ -21777,6 +22082,35 @@ set i_termio; eval $setvar val=$val2; set i_sgtty; eval $setvar val=$val3; set i_termios; eval $setvar +: see if stdbool is available +: we want a real compile instead of Inhdr because some Solaris systems +: have stdbool.h, but it can only be used if the compiler indicates it +: is sufficiently c99-compliant. +echo " " +$cat >try.c < +#include +int func(bool x) +{ + return x ? 1 : 0; +} +int main(int argc, char **argv) +{ + return func(0); +} +EOCP +set try +if eval $compile; then + echo " found." >&4 + val="$define" +else + echo " NOT found." >&4 + val="$undef" +fi +$rm_try +set i_stdbool +eval $setvar + : see if stddef is available set stddef.h i_stddef eval $inhdr @@ -21919,6 +22253,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"; @@ -22100,7 +22453,7 @@ avail_ext="$*" case "$onlyextensions" in '') ;; *) keepextensions='' - echo "You have requested that only certains extensions be included..." >&4 + echo "You have requested that only certain extensions be included..." >&4 for i in $onlyextensions; do case " $avail_ext " in *" $i "*) @@ -22670,7 +23023,9 @@ d_inetaton='$d_inetaton' d_inetntop='$d_inetntop' d_inetpton='$d_inetpton' d_int64_t='$d_int64_t' +d_ipv6_mreq='$d_ipv6_mreq' d_isascii='$d_isascii' +d_isblank='$d_isblank' d_isfinite='$d_isfinite' d_isinf='$d_isinf' d_isnan='$d_isnan' @@ -22834,6 +23189,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' @@ -23064,6 +23420,7 @@ i_sgtty='$i_sgtty' i_shadow='$i_shadow' i_socks='$i_socks' i_stdarg='$i_stdarg' +i_stdbool='$i_stdbool' i_stddef='$i_stddef' i_stdlib='$i_stdlib' i_string='$i_string' @@ -23149,6 +23506,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' @@ -23360,6 +23718,8 @@ srand48_r_proto='$srand48_r_proto' srandom_r_proto='$srandom_r_proto' src='$src' ssizetype='$ssizetype' +st_ino_sign='$st_ino_sign' +st_ino_size='$st_ino_size' startperl='$startperl' startsh='$startsh' static_ext='$static_ext' @@ -23414,6 +23774,7 @@ usedl='$usedl' usedtrace='$usedtrace' usefaststdio='$usefaststdio' useithreads='$useithreads' +usekernprocpathname='$usekernprocpathname' uselargefiles='$uselargefiles' uselongdouble='$uselongdouble' usemallocwrap='$usemallocwrap' @@ -23421,6 +23782,7 @@ usemorebits='$usemorebits' usemultiplicity='$usemultiplicity' usemymalloc='$usemymalloc' usenm='$usenm' +usensgetexecutablepath='$usensgetexecutablepath' useopcode='$useopcode' useperlio='$useperlio' useposix='$useposix' @@ -23485,16 +23847,16 @@ if $test -f UU/config.sh; then $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \ config.sh config.sh UU/oldconfig.sh |\ $sort | $uniq -u >UU/oldsyms - set X `cat UU/oldsyms` + set X `$cat UU/oldsyms` shift case $# in 0) ;; *) - cat <>config.sh - for sym in `cat UU/oldsyms`; do + for sym in `$cat UU/oldsyms`; do echo " Propagating $hint variable "'$'"$sym..." eval 'tmp="$'"${sym}"'"' echo "$tmp" | \