# 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 Fri May 21 07:59:07 CEST 2010 [metaconfig 3.5 PL0]
# (with additional metaconfig patches by perlbug@perl.org)
cat >c1$$ <<EOF
rm -f c1$$ c2$$
if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
- cat >&4 <<EOF
+ cat <<EOF
***
*** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
*** Configure that well. (Plan 9 is close to UNIX but not close enough.)
fi
if test ! -c /dev/null ; then
- cat >&4 <<EOF
+ cat <<EOF
***
*** I'm sorry, but /dev/null appears to be a file rather than a device.
*** Please consult your operating sytem's notes for making a device
cf_email=''
cf_by=''
cf_time=''
+charbits=''
+charsize=''
contains=''
cpp_stuff=''
cpplast=''
d_gettimeod=''
d_futimes=''
d_Gconvert=''
+d_getaddrinfo=''
d_getcwd=''
d_getespwnam=''
d_getfsstat=''
getlogin_r_proto=''
d_getmnt=''
d_getmntent=''
+d_getnameinfo=''
d_getnbyaddr=''
d_getnbyname=''
d_getnent=''
d_htonl=''
d_ilogbl=''
d_inetaton=''
+d_inetntop=''
+d_inetpton=''
d_int64_t=''
d_isascii=''
d_isfinite=''
d_pipe=''
d_poll=''
d_portable=''
+d_prctl=''
+d_prctl_set_name=''
d_procselfexe=''
procselfexe=''
d_old_pthread_create_joinable=''
d_wctomb=''
d_writev=''
dlext=''
+bin_ELF=''
cccdlflags=''
ccdlflags=''
dlsrc=''
incpath=''
mips_type=''
usrinc=''
+vaproto=''
d_vendorarch=''
installvendorarch=''
vendorarch=''
_egrep=$grep
;;
esac
+case "$less" in
+'') ;;
+*) if $less -R </dev/null >/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."
chdir($stem);
;@candidates = map {
[ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
+ ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
}
else {
;@candidates = ();
: DTrace support
dflt_dtrace='/usr/sbin/dtrace'
+$test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
+
cat <<EOM
Perl can be built to support DTrace on platforms that support it.
rp="Do you wish to use dynamic loading?"
. ./myread
usedl="$ans"
+bin_ELF="$undef"
case "$ans" in
y*) usedl="$define"
case "$dlsrc" in
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'
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
signal(SIGFPE, blech);
/* Don't let compiler optimize the test away. Store the number
- in a writable string for gcc to pass to sscanf under HP/UX.
+ in a writable string for gcc to pass to sscanf under HP-UX.
*/
sprintf(str, "2147483647");
sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
optimized the whole file away
*/
/* Store the number in a writable string for gcc to pass to
- sscanf under HP/UX.
+ sscanf under HP-UX.
*/
sprintf(str, "-123");
sscanf(str, "%lf", &f); /* f = -123.; */
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
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
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 <<EOCP
set poll d_poll
eval $inlibc
+: see if prctl exists
+set prctl d_prctl
+eval $inlibc
+
+: see if prctl supports PR_SET_NAME
+d_prctl_set_name=$undef
+case $d_prctl in
+ $define)
+ $cat >try.c <<EOM
+#include <sys/prctl.h>
+
+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
: set the base revision
baserev=5.0
+: 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
+'') echo "Checking how long a character is (in bits)..." >&4
+ $cat >try.c <<EOCP
+#include <stdio.h>
+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
;;
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
'')
./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
: 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
*)
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
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
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.
esac
;;
NDBM_File|ndbm_fil)
- case "$i_ndbm" in
+ case "$d_ndbm" in
$define)
case "$osname-$use64bitint" in
hpux-define)
$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
# Target system : $myuname
EOT
+: Add in command line options if available
$test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
+
$spitshell <<EOT >>config.sh
Author='$Author'
baserev='$baserev'
bash='$bash'
bin='$bin'
+bin_ELF='$bin_ELF'
binexp='$binexp'
bison='$bison'
byacc='$byacc'
cf_by='$cf_by'
cf_email='$cf_email'
cf_time='$cf_time'
+charbits='$charbits'
+charsize='$charsize'
chgrp='$chgrp'
chmod='$chmod'
chown='$chown'
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'
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'
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'
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'
uvtype='$uvtype'
uvuformat='$uvuformat'
uvxformat='$uvxformat'
+vaproto='$vaproto'
vendorarch='$vendorarch'
vendorarchexp='$vendorarchexp'
vendorbin='$vendorbin'
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