X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/d94216564938cd42af43fa553fe0ab9651fe48c9..356123f1446a9063580d27c9464d5319412a5a71:/Configure?ds=sidebyside diff --git a/Configure b/Configure index 47ca217..d9911f9 100755 --- a/Configure +++ b/Configure @@ -16,16 +16,19 @@ # The dist package (which contains metaconfig) is available via SVN: # svn co https://svn.sourceforge.net/svnroot/dist/trunk/dist # +# Though this script was generated by metaconfig from metaunits, it is +# OK to send patches against Configure itself. It's up to the Configure +# pumpkin to backport the patch to the metaunits if it is accepted. +# For more information on patching Configure, see pod/perlhack.pod +# +# The metaunits are also available from the public git repository: +# http://perl5.git.perl.org/metaconfig.git/ or +# $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig # -# Though this script was generated by metaconfig, it is OK to send -# patches against it. It's up to the Configure pumpkin to backport -# the patch to the metaunits if it is accepted. # See Porting/pumpkin.pod for more information on metaconfig. # -# $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $ -# -# Generated on Tue Feb 10 17:34:27 CET 2009 [metaconfig 3.5 PL0] +# Generated on Mon Feb 14 23:00:18 CET 2011 [metaconfig 3.5 PL0] # (with additional metaconfig patches by perlbug@perl.org) cat >c1$$ <&4 <&4 </dev/null; then + echo "Substituting less -R for less." + less="$less -R" + _less=$less + fi + ;; +esac case "$ln" in ln) echo "Substituting cp for ln." @@ -4136,11 +4163,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 @@ -6525,6 +6547,7 @@ if (-d $stem) { chdir($stem); ;@candidates = map { [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*"); + ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates; } else { ;@candidates = (); @@ -7129,6 +7152,8 @@ esac : DTrace support dflt_dtrace='/usr/sbin/dtrace' +$test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace' + cat < libc.ptf xscan='eval "libc.list"; $echo $n ".$c" >&4' xrun='eval "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 @@ -7921,6 +7946,7 @@ esac rp="Do you wish to use dynamic loading?" . ./myread usedl="$ans" +bin_ELF="$undef" case "$ans" in y*) usedl="$define" case "$dlsrc" in @@ -8017,6 +8043,7 @@ 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' @@ -8185,6 +8212,13 @@ esac case "$useshrplib" in true) + case "$userelocatableinc" in + true|define) + echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4 + echo "See INSTALL for an explanation why that won't work." >&4 + exit 4 + ;; + esac case "$libperl" in '') # Figure out a good name for libperl.so. Since it gets stored in @@ -8292,7 +8326,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*) @@ -9863,7 +9897,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 @@ -10024,7 +10058,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 +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 < +#include +#include +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]'` @@ -13394,6 +13463,10 @@ eval $ndbm_hdr_protochk set gdbm_ndbm gdbm-ndbm.h eval $ndbm_hdr_protochk +: see if getaddrinfo exists +set getaddrinfo d_getaddrinfo +eval $inlibc + : see if getcwd exists set getcwd d_getcwd eval $inlibc @@ -13943,6 +14016,10 @@ eval $inlibc set getmntent d_getmntent eval $inlibc +: see if getnameinfo exists +set getnameinfo d_getnameinfo +eval $inlibc + : see if getnetbyaddr exists set getnetbyaddr d_getnbyaddr eval $inlibc @@ -14886,6 +14963,14 @@ set d_index; eval $setvar set inet_aton d_inetaton eval $inlibc +: see if inet_ntop exists +set inet_ntop d_inetntop +eval $inlibc + +: see if inet_pton exists +set inet_pton d_inetpton +eval $inlibc + : Look for isascii echo " " $cat >isascii.c <try.c < + +int main (int argc, char *argv[]) +{ + return (prctl (PR_SET_NAME, "Test")); + } /* main */ +EOM + set try + if eval $compile_ok && $run ./try; then + echo "Your prctl (PR_SET_NAME, ...) works" + d_prctl_set_name=$define + fi + $rm_try + ;; + esac + : see if readlink exists set readlink d_readlink eval $inlibc @@ -17797,6 +17907,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 +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 <&4 + $cat >try.c < +int main () +{ + int n; + unsigned char c; + for (c = 1, n = 0; c; c <<= 1, n++) ; + printf ("%d\n", n); + return (0); + } +EOCP + set try + if eval $compile_ok; then + dflt=`$run ./try` + else + dflt='8' + echo "(I can't seem to compile the test program. Guessing...)" + fi + ;; +*) + dflt="$charbits" + ;; +esac +rp="What is the length of a character (in bits)?" +. ./myread +charbits="$ans" +$rm_try +case "$charbits" in +8) ;; +*) cat >&4 << EOM +Your system has an unsigned character size of $charbits bits, which +is rather unusual (normally it is 8 bits). Perl likely will not work +correctly on your system, with subtle bugs in various places. +EOM + rp='Do you really want to continue?' + dflt='n' + . ./myread + case "$ans" in + [yY]) echo >&4 "Okay, continuing." ;; + *) exit 1 ;; + esac +esac + : how do we concatenate cpp tokens here? echo " " echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4 @@ -21092,6 +21358,21 @@ case "$usesitecustomize" in ;; esac +: see if prototypes support variable argument declarations +echo " " +case "$prototype$i_stdarg" in +$define$define) + echo "It appears we'll be able to prototype varargs functions." >&4 + val="$define" + ;; +*) + echo "Too bad... We won't be using prototyped varargs functions..." >&4 + val="$undef" + ;; +esac +set vaproto +eval $setvar + : determine compiler compiler case "$yacc" in '') @@ -21354,11 +21635,11 @@ $eunicefix Cppsym.try ./Cppsym < Cppsym.know > Cppsym.true : Add in any linux cpp "predefined macros": case "$osname::$gccversion" in - *linux*::*.*) + *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*) tHdrH=_tmpHdr rm -f $tHdrH'.h' $tHdrH touch $tHdrH'.h' - if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then + if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then sed 's/#define[\ \ ]*//;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 @@ -21614,6 +21895,8 @@ nonxs_extensions='' : Function to recursively find available extensions, ignoring DynaLoader : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness +: In 5.10.1 and later, extensions are stored in directories +: like File-Glob instead of the older File/Glob/. find_extensions=' for xxx in *; do case "$xxx" in @@ -21621,13 +21904,7 @@ find_extensions=' *) this_ext=`echo $xxx | $sed -e s/-/\\\//g`; leaf=`echo $xxx | $sed -e s/.*-//`; - if $test -d File-Glob; then - if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then - known_extensions="$known_extensions $this_ext"; - elif $test -d $xxx; then - nonxs_extensions="$nonxs_extensions $this_ext"; - fi - else + if $test -d File; then if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then known_extensions="$known_extensions $1$this_ext"; elif $test -f $xxx/Makefile.PL; then @@ -21641,11 +21918,29 @@ find_extensions=' shift; fi; fi; + else + $ls -1 $xxx > $$.tmp; + if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then + known_extensions="$known_extensions $this_ext"; + elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then + known_extensions="$known_extensions $this_ext"; + elif $test -d $xxx; then + nonxs_extensions="$nonxs_extensions $this_ext"; + fi; + $rm -f $$.tmp; fi ;; esac; done' tdir=`pwd` +cd "$rsrc/cpan" +set X +shift +eval $find_extensions +cd "$rsrc/dist" +set X +shift +eval $find_extensions cd "$rsrc/ext" set X shift @@ -21662,10 +21957,10 @@ else fi set X $known_extensions shift -known_extensions="$*" +known_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '` set X $nonxs_extensions shift -nonxs_extensions="$*" +nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '` cd "$tdir" : Now see which are supported on this system. @@ -21694,7 +21989,7 @@ for xxx in $known_extensions ; do esac ;; NDBM_File|ndbm_fil) - case "$i_ndbm" in + case "$d_ndbm" in $define) case "$osname-$use64bitint" in hpux-define) @@ -21805,7 +22100,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 "*) @@ -21975,7 +22270,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 @@ -22097,7 +22392,9 @@ $startsh # Target system : $myuname EOT +: Add in command line options if available $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh + $spitshell <>config.sh Author='$Author' @@ -22133,6 +22430,7 @@ awk='$awk' baserev='$baserev' bash='$bash' bin='$bin' +bin_ELF='$bin_ELF' binexp='$binexp' bison='$bison' byacc='$byacc' @@ -22151,6 +22449,8 @@ ccversion='$ccversion' cf_by='$cf_by' cf_email='$cf_email' cf_time='$cf_time' +charbits='$charbits' +charsize='$charsize' chgrp='$chgrp' chmod='$chmod' chown='$chown' @@ -22299,6 +22599,7 @@ d_ftime='$d_ftime' d_futimes='$d_futimes' d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes' d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes' +d_getaddrinfo='$d_getaddrinfo' d_getcwd='$d_getcwd' d_getespwnam='$d_getespwnam' d_getfsstat='$d_getfsstat' @@ -22320,6 +22621,7 @@ d_getlogin='$d_getlogin' d_getlogin_r='$d_getlogin_r' d_getmnt='$d_getmnt' d_getmntent='$d_getmntent' +d_getnameinfo='$d_getnameinfo' d_getnbyaddr='$d_getnbyaddr' d_getnbyname='$d_getnbyname' d_getnent='$d_getnent' @@ -22365,6 +22667,8 @@ d_ilogbl='$d_ilogbl' d_inc_version_list='$d_inc_version_list' d_index='$d_index' d_inetaton='$d_inetaton' +d_inetntop='$d_inetntop' +d_inetpton='$d_inetpton' d_int64_t='$d_int64_t' d_isascii='$d_isascii' d_isfinite='$d_isfinite' @@ -22440,6 +22744,8 @@ d_phostname='$d_phostname' d_pipe='$d_pipe' d_poll='$d_poll' d_portable='$d_portable' +d_prctl='$d_prctl' +d_prctl_set_name='$d_prctl_set_name' d_printf_format_null='$d_printf_format_null' d_procselfexe='$d_procselfexe' d_pseudofork='$d_pseudofork' @@ -22525,8 +22831,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' @@ -22542,6 +22850,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' @@ -22938,6 +23247,7 @@ path_sep='$path_sep' perl5='$perl5' perl='$perl' perl_patchlevel='$perl_patchlevel' +perl_static_inline='$perl_static_inline' perladmin='$perladmin' perllibs='$perllibs' perlpath='$perlpath' @@ -23131,6 +23441,7 @@ uvsize='$uvsize' uvtype='$uvtype' uvuformat='$uvuformat' uvxformat='$uvxformat' +vaproto='$vaproto' vendorarch='$vendorarch' vendorarchexp='$vendorarchexp' vendorbin='$vendorbin' @@ -23162,9 +23473,6 @@ zcat='$zcat' zip='$zip' EOT -: Add in command line options if available -$test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh - : add special variables $test -f $src/patchlevel.h && \ awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh