# See Porting/pumpkin.pod for more information on metaconfig.
#
-# Generated on Wed Jan 22 12:03:46 CET 2014 [metaconfig 3.5 PL0]
+# Generated using [metaconfig 3.5 PL0]
# (with additional metaconfig patches by perlbug@perl.org)
cat >c1$$ <<EOF
: Proper separator for the PATH environment variable
p_=:
: On OS/2 this directory should exist if this is not floppy only system ":-]"
-if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
+if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' 2>&1 ) 2>&1 >/dev/null ; then
if test -n "$OS2_SHELL"; then
p_=\;
PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
cppccsymbols=''
cppsymbols=''
from=''
+hostgenerate=''
+hostosname=''
+hostperl=''
run=''
targetarch=''
targetdir=''
+targetenv=''
targethost=''
targetmkdir=''
targetport=''
d_attribute_unused=''
d_attribute_warn_unused_result=''
d_printf_format_null=''
+d_backtrace=''
d_bcmp=''
d_bcopy=''
d_builtin_choose_expr=''
d_difftime=''
d_dir_dd_fd=''
d_dirfd=''
+d_dladdr=''
d_dlerror=''
d_dlopen=''
d_dlsymun=''
d_pthread_yield=''
d_sched_yield=''
sched_yield=''
+d_ptrdiff_t=''
d_qgcvt=''
d_random_r=''
random_r_proto=''
d_vprintf=''
d_wait4=''
d_waitpid=''
+d_wcscmp=''
d_wcstombs=''
+d_wcsxfrm=''
d_wctomb=''
d_writev=''
dlext=''
lddlflags=''
usedl=''
doublesize=''
-bootstrap_charset=''
ebcdic=''
fflushNULL=''
fflushall=''
installhtml3dir=''
i_arpainet=''
i_assert=''
+i_bfd=''
i_crypt=''
db_hashtype=''
db_prefixtype=''
direntrytype=''
i_dirent=''
i_dlfcn=''
+i_execinfo=''
i_fcntl=''
i_float=''
i_fp=''
sSCNfldbl=''
lseeksize=''
lseektype=''
-mad=''
-madlyh=''
-madlyobj=''
-madlysrc=''
make_set_make=''
d_mymalloc=''
freetype=''
selectminbits=''
selecttype=''
sh=''
+targetsh=''
sig_count=''
sig_name=''
sig_name_init=''
archname64=''
use64bitall=''
use64bitint=''
+usecbacktrace=''
dtrace=''
usedtrace=''
usefaststdio=''
;;
esac
+: When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
+: default both to the same thing, cross-compilers can then set targetsh differently if they like
+targetsh=$sh
+
: see if sh knows # comments
if `$sh -c '#' >/dev/null 2>&1`; then
shsharp=true
esac
case "$less" in
'') ;;
-*) if $less -R </dev/null >/dev/null; then
+*) if $less -R </dev/null >/dev/null 2>&1; then
echo "Substituting less -R for less."
less="$less -R"
_less=$less
if $test "X$targethost" = "X"; then
targethost=""
fi
+if $test "X$targetenv" = "X"; then
+ targetenv=""
+fi
case "$usecrosscompile" in
$define|true|[yY]*)
$echo "Cross-compiling..."
case "$croak" in
y) echo "Cannot continue, aborting." >&4; exit 1 ;;
esac
+ : compile a host miniperl and generate_uudmap, unless we got passed them
+ if $test "X$hostperl" = X; then
+ echo "Building host miniperl and generate_uudmap binaries" >&4
+ before_host=`pwd`
+ cd ..
+ cd $src
+ src=`pwd`
+ rm -rf $src/host
+ mkdir $src/host
+ cd $src/host
+ $src/Configure -des -Dusedevel -Dmksymlinks
+ $make miniperl
+ case "$hostgenerate" in
+ '') $make generate_uudmap
+ hostgenerate=$src/host/generate_uudmap
+ ;;
+ "$undef") hostgenerate=''
+ ;;
+ esac
+ hostperl=$src/host/miniperl
+ cd $before_host
+ fi
+ hostosname=`$hostperl -le 'print $^O'`
+ ;;
+*)
+ usecrosscompile="$undef"
+ ;;
+esac
+
+: Define -Dtargethost=somecomputer to run compiled tests on another machine
+case "$targethost" in
+ '') echo "Checking for cross-compile" >&4
+ case "$usecrosscompile$multiarch" in
+ *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
+ if [ -f Makefile ]; then
+ echo " "
+ echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
+ else
+ echo "Configure done."
+ fi
+ exit 0
+ ;;
+ *) echo "No targethost for running compiler tests against defined, running locally" >&4
+ run=''
+ to=:
+ from=:
+ ;;
+ esac
+ ;;
+ *) echo "Using targethost $targethost." >&4
case "$src" in
/*) run=$src/Cross/run
targetmkdir=$src/Cross/mkdir
ssh|rsh)
cat >$run <<EOF
#!/bin/sh
+env=''
case "\$1" in
-cwd)
shift
shift
;;
esac
+case "\$1" in
+-env)
+ shift
+ env=\$1
+ shift
+ ;;
+esac
case "\$cwd" in
'') cwd=$targetdir ;;
esac
exe=\$1
shift
$to \$exe
-$targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
+$targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
EOF
;;
+ adb)
+ $touch $run
+ ;;
*) echo "Unknown targetrun '$targetrun'" >&4
exit 1
;;
case "\$f" in
/*)
$targetmkdir \`dirname \$f\`
- $targetto -P $targetport $q \$f $targetuser@$targethost:\$f || exit 1
+ $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
;;
*)
$targetmkdir $targetdir/\`dirname \$f\`
- $targetto -P $targetport $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
+ $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
;;
esac
done
*) run=''
to=:
from=:
- usecrosscompile='undef'
+ usecrosscompile="$undef"
targetarch=''
;;
esac
$test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
$test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
$test -f /bin/mips && /bin/mips && osname=mips
- $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
- $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
$test -d /usr/apollo/bin && osname=apollo
$test -f /etc/saf/_sactab && osname=svr4
$test -d /usr/include/minix && osname=minix
*) osname=mips ;;
esac;;
[23]100) osname=mips ;;
- next*) osname=next ;;
i386*)
tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
case "$3" in
*) osvers="$3" ;;
esac
+ $test -f /system/lib/libandroid.so && osname=linux-android
;;
MiNT) osname=mint
;;
*) osname=newsos ;;
esac
;;
- next*) osname=next ;;
nonstop-ux) osname=nonstopux ;;
openbsd) osname=openbsd
osvers="$3"
case "$targetarch" in
'') ;;
*) hostarch=$osname
- osname=`echo $targetarch|sed 's,^[^-]*-,,'`
- osvers=''
+ case "$targetarch" in
+ nto*|*-nto-*)
+ # Will load qnx.sh, which should change osname to nto
+ osname=qnx
+ osvers=''
+ ;;
+ *linux-android*)
+ # Catch arm-linux-androideabi, mipsel-linux-android,
+ # and i686-linux-android
+ osname=linux-android
+ osvers=''
+ ;;
+ *linux*)
+ # Something like arm-linux-gnueabihf is really just
+ # plain linux.
+ osname=linux
+ osvers=''
+ ;;
+ *solaris*|*sunos*)
+ osname=solaris
+ # XXX perhaps we should just assume
+ # osvers to be 2, or maybe take the value
+ # from targetarch. Using $run before the
+ # hints are run is somewhat icky.
+ set X `$run $uname -a 2>/dev/null`
+ shift
+ case "$3" in
+ 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
+ *) osvers="$3" ;;
+ esac
+ ;;
+ *)
+ osname=`echo $targetarch|sed 's,^[^-]*-,,'`
+ osvers=''
+ ;;
+ esac
;;
esac
$rm -f try try.*
esac
+# gcc 4.9 by default does some optimizations that break perl.
+# see ticket 121505.
+#
+# The -fwrapv disables those optimizations (and probably others,) so
+# for gcc 4.9 (and later, since the optimizations probably won't go
+# away), add -fwrapv unless the user requests -fno-wrapv, which
+# disables -fwrapv, or if the user requests -fsanitize=undefined,
+# which turns the overflows -fwrapv ignores into runtime errors.
+case "$gccversion" in
+4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
+ case "$ccflags" in
+ *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
+ *) ccflags="$ccflags -fwrapv" ;;
+ esac
+esac
+
: What should the include directory be ?
: Use sysroot if set, so findhdr looks in the right place.
echo " "
case "$usesocks" in
"$define") libswanted="$libswanted socks5 socks5_sh" ;;
esac
+case "$usecbacktrace" in
+"$define") libswanted="$libswanted bfd" ;;
+esac
libsfound=''
libsfiles=''
libsdirs=''
checkccflag='check=$1; flag=$2; callback=$3;
echo " ";
echo "Checking if your compiler accepts $flag" 2>&1;
-[ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot"
+[ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
echo "int main(void) { return 0; }" > gcctest.c;
if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
echo "Yes, it does." 2>&1;
if $contains $tlook $tf >/dev/null 2>&1; then
tval=true;
elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
- echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
+ echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) return(0); else return(1); }"> try.c;
$cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
$test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
$rm_try;
fi;
else
- echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
+ echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) return(0); else return(1); }"> try.c;
$cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
$rm_try;
fi;
'') case "$gccversion" in
'') case "$osname" in
hpux) dflt='+z' ;;
- next) dflt='none' ;;
irix*) dflt='-KPIC' ;;
svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
sunos) dflt='-pic' ;;
esac
;;
*linux*|irix*|gnu*) dflt="-shared $optimize" ;;
- next) dflt='none' ;;
solaris) # See [perl #66604].
# On Solaris 11, gcc -m64 on amd64
# appears not to understand -G. gcc versions at
case "$ccdlflags" in
'') case "$osname" in
*linux*|hpux|gnu*) dflt='-Wl,-E' ;;
- next|sunos) dflt='none' ;;
- *) dflt='none' ;;
+ sunos) dflt='none' ;;
+ *) dflt='none' ;;
esac ;;
' ') dflt='none' ;;
*) dflt="$ccdlflags" ;;
dflt=y
also='Building a shared libperl is required for dynamic loading to work on your system.'
;;
- next*)
- case "$osvers" in
- 4*) dflt=y
- also='Building a shared libperl is needed for MAB support.'
- ;;
- *) dflt=n
- ;;
- esac
- ;;
*) dflt=n
;;
esac
# I'd prefer to keep the os-specific stuff here to a minimum, and
# rely on figuring it out from the naming of libc.
case "${osname}${osvers}" in
- next4*)
- dflt=libperl.5.$so
- # XXX How handle the --version stuff for MAB?
- ;;
*linux*|gnu*) # ld won't link with a bare -lperl otherwise.
dflt=libperl.$so
;;
bsdos|linux|irix*|dec_osf|gnu*)
xxx="-Wl,-rpath,$shrpdir"
;;
- next)
- # next doesn't like the default...
- ;;
haiku)
# Haiku doesn't like the default, either.
;;
: see if we have to deal with yellow pages, now NIS.
if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
- if $test -f /usr/etc/nibindd; then
- echo " "
- echo "I'm fairly confident you're on a NeXT."
- echo " "
- rp='Do you get the hosts file via NetInfo?'
- dflt=y
- case "$hostcat" in
- nidump*) ;;
- '') ;;
- *) dflt=n;;
- esac
- . ./myread
- case "$ans" in
- y*) hostcat='nidump hosts .';;
- *) case "$hostcat" in
- nidump*) hostcat='';;
- esac
- ;;
- esac
- fi
case "$hostcat" in
nidump*) ;;
*)
prefixvar=sitescript
. ./setprefixvar
+: see if backtrace exists
+set backtrace d_backtrace
+eval $inlibc
+
+: add flags if using c backtrace
+case "$usecbacktrace" in
+ "") usecbacktrace=$undef ;;
+ [yY]*|true|$define)
+ case "$d_backtrace" in
+ [yY]*|true|$define)
+ case " $ccflags " in
+ *" -DUSE_C_BACKTRACE "*) ;; # Already there.
+ *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
+ esac
+ ;;
+ *)
+ echo "This system does not support backtrace" >&4
+ usecbacktrace=$undef
+ ;;
+ esac
+ ;;
+ esac
+
: Check if faststdio is requested and available
case "$usefaststdio" in
$define|true|[yY]*|'')
#endif
#if defined(I_DIRENT)
#include <dirent.h>
-#if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
-#include <sys/dir.h>
-#endif
#else
#ifdef I_SYS_NDIR
#include <sys/ndir.h>
eval $setvar
$rm -f dirfd*
+: see if dladdr exists
+set dladdr d_dladdr
+eval $inlibc
+
: see if dlerror exists
xxx_runnm="$runnm"
runnm=false
int pu[2];
char buf[1];
char string[100];
-
- pipe(pd); /* Down: child -> parent */
- pipe(pu); /* Up: parent -> child */
+ int ret;
+
+ ret = pipe(pd); /* Down: child -> parent */
+ if (ret != 0)
+ exit(3);
+ ret = pipe(pu); /* Up: parent -> child */
+ if (ret != 0)
+ exit(3);
if (0 != fork()) {
- int ret;
close(pd[1]); /* Parent reads from pd[0] */
close(pu[0]); /* Parent writes (blocking) to pu[1] */
#ifdef F_SETFL
if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
exit(2);
sprintf(string, "%d\n", ret);
- write(2, string, strlen(string));
+ ret = write(2, string, strlen(string));
+ if (ret != strlen(string))
+ exit(3);
alarm(0);
#ifdef EAGAIN
if (errno == EAGAIN) {
printf("EWOULDBLOCK\n");
#endif
ok:
- write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
+ ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
+ if (ret != 1)
+ exit(3);
sleep(2); /* Give it time to close our pipe */
alarm(5);
ret = read(pd[0], buf, 1); /* Should read EOF */
alarm(0);
sprintf(string, "%d\n", ret);
- write(4, string, strlen(string));
+ ret = write(4, string, strlen(string));
+ if (ret != strlen(string))
+ exit(3);
exit(0);
}
close(pd[0]); /* We write to pd[1] */
close(pu[1]); /* We read from pu[0] */
- read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
+ ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
+ if (ret != 1)
+ exit(3);
close(pd[1]); /* Pipe pd is now fully closed! */
exit(0); /* Bye bye, thank you for playing! */
}
esac
$rm_try
+: check for ptrdiff_t
+echo " "
+echo "Checking to see if you have ptrdiff_t..." >&4
+$cat >try.c <<EOCP
+#include <stddef.h>
+int main() { ptrdiff_t x = 7; }
+EOCP
+set try
+if eval $compile; then
+ val="$define"
+ echo "You have ptrdiff_t."
+else
+ val="$undef"
+ echo "You do not have ptrdiff_t."
+fi
+$rm_try
+set d_ptrdiff_t
+eval $setvar
+
: see if random_r exists
set random_r d_random_r
eval $inlibc
h_shm=false
val="$undef"
set shmctl d_shmctl
- evat $setvar
+ eval $setvar
set shmget d_shmget
- evat $setvar
+ eval $setvar
set shmat d_shmat
- evat $setvar
+ eval $setvar
set shmdt d_shmdt
- evat $setvar
+ eval $setvar
;;
esac
;;
: Check if is a multiplatform env
case "$osname" in
-next|darwin) multiarch="$define" ;;
+darwin) multiarch="$define" ;;
esac
case "$multiarch" in
''|[nN]*) multiarch="$undef" ;;
#endif
#if defined(I_DIRENT)
#include <dirent.h>
-#if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
-#include <sys/dir.h>
-#endif
#else
#ifdef I_SYS_NDIR
#include <sys/ndir.h>
set waitpid d_waitpid
eval $inlibc
+: look for wcscmp
+echo " "
+$cat >try.c <<'EOCP'
+#include <stdio.h>
+#include <wchar.h>
+int main ()
+{
+ wchar_t *s = L" ";
+ return (wcscmp (s, s) ? 1 : 0);
+ }
+EOCP
+set try
+val="$undef"
+if eval $compile; then
+ `$run ./try`
+ case "$?" in
+ 0) echo "A working wcscmp() found." >&4
+ val="$define" ;;
+ *) echo "wcscmp() found, but it doesn't work" >&4
+ ;;
+ esac
+else
+ echo "wcscmp() NOT found." >&4
+ fi
+set d_wcscmp
+eval $setvar
+$rm_try
+
: see if wcstombs exists
set wcstombs d_wcstombs
eval $inlibc
+: look for wcsxfrm
+echo " "
+$cat >try.c <<'EOCP'
+#include <errno.h>
+#include <wchar.h>
+int main ()
+{
+ wchar_t dst[4], *src = L" ";
+ errno = 0;
+ return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
+ }
+EOCP
+set try
+val="$undef"
+if eval $compile; then
+ `$run ./try`
+ case "$?" in
+ 0) echo "A working wcsxfrm() found." >&4
+ val="$define" ;;
+ *) echo "wcsxfrm() found, but it doesn't work" >&4
+ ;;
+ esac
+else
+ echo "wcsxfrm() NOT found." >&4
+ fi
+set d_wcsxfrm
+eval $setvar
+$rm_try
+
: see if wctomb exists
set wctomb d_wctomb
eval $inlibc
set writev d_writev
eval $inlibc
-: preserve RCS keywords in files with variable substitution, grrr
-Date='$Date'
-Id='$Id'
-Log='$Log'
-RCSfile='$RCSfile'
-Revision='$Revision'
-
: check for alignment requirements
echo " "
case "$alignbytes" in
: set the base revision
baserev=5.0
-: Determine if this is an EBCDIC system
-echo " "
-echo "Determining whether or not we are on an EBCDIC system..." >&4
-$cat >try.c <<'EOM'
-int main()
-{
- if ('M'==0xd4) return 0;
- return 1;
-}
-EOM
-
-case "$BOOTSTRAP_CHARSET" in
- Y|y|define) bootstrap_charset=$define ;;
- *) bootstrap_charset=$undef ;;
-esac
-
-val=$undef
-set try
-if eval $compile_ok; then
- if $run ./try; then
- echo "You seem to speak EBCDIC." >&4
- val="$define"
- else
- echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
- fi
-else
- echo "I'm unable to compile the test program." >&4
- echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
-fi
-$rm_try
-set ebcdic
-eval $setvar
-
: length of character in bytes. Is always 1, otherwise it is not C
: This used to be a test using sizeof
charsize=1
#include <db.h>
#ifndef DB_VERSION_MAJOR
-u_int32_t hash_cb (ptr, size)
-const void *ptr;
-size_t size;
+u_int32_t hash_cb (const void* ptr, size_t size)
{
}
HASHINFO info;
#include <db.h>
#ifndef DB_VERSION_MAJOR
-size_t prefix_cb (key1, key2)
-const DBT *key1;
-const DBT *key2;
+size_t prefix_cb (const DBT *key1, const DBT *key2)
{
}
BTREEINFO info;
randbits=48
randseedtype=U32
+: Determine if this is an EBCDIC system
+echo " "
+echo "Determining whether or not we are on an EBCDIC system..." >&4
+$cat >try.c <<'EOM'
+int main()
+{
+ if ('M'==0xd4) return 0;
+ return 1;
+}
+EOM
+
+val=$undef
+set try
+if eval $compile_ok; then
+ if $run ./try; then
+ echo "You seem to speak EBCDIC." >&4
+ val="$define"
+ else
+ echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
+ fi
+else
+ echo "I'm unable to compile the test program." >&4
+ echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
+fi
+$rm_try
+set ebcdic
+eval $setvar
+
: Check how to flush
echo " "
$cat >&4 <<EOM
# Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
if $test "X$targethost" != X; then
$to tryp.c
- $run ./tryp \< tryp.c 2>/dev/null > tryp.out
+ $to tryp
+ $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
else
- $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
+ $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
fi
if cmp tryp.c tryp.out >/dev/null 2>&1; then
$cat >&4 <<EOM
$rm -f tryp.out
if $test "X$targethost" != X; then
$to tryp.c
- $run ./tryp \< tryp.c 2>/dev/null > tryp.out
+ $to tryp
+ $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
else
- $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
+ $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
fi
if cmp tryp.c tryp.out >/dev/null 2>&1; then
$cat >&4 <<EOM
*) groupstype="$gidtype";;
esac
-: MAD = Misc Attribute Definition
-
-if $test $patchlevel -lt 9; then
-: MAD is not available in 5.8.x or earlier.
- ans=n;
-else
- case "$mad" in
- $define|true|[yY]*) dflt='y' ;;
- *) dflt='n' ;;
- esac
- cat <<EOM
-
-Would you like to build with Misc Attribute Decoration? This is development
-work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
-overhead on the interpreter.
-
-If this doesn't make any sense to you, just accept the default '$dflt'.
-EOM
- rp='Build Perl with MAD?'
- . ./myread
-fi
-case "$ans" in
-y|Y) val="$define"
- madlyh='madly.h madly.act madly.tab'
- madlysrc='madly.c'
- madlyobj="madly$_o" ;;
-*) val="$undef"
- madlyh=''
- madlysrc=''
- madlyobj='' ;;
-esac
-set mad
-eval $setvar
-
: check whether make sets MAKE
echo " "
echo "Checking if your $make program sets \$(MAKE)..." >&4
set assert.h i_assert
eval $inhdr
+: see if this is a bfd.h system
+set bfd.h i_bfd
+eval $inhdr
+
+: see if this is an execinfo.h system
+set execinfo.h i_execinfo
+eval $inhdr
+
: see if this is a fp.h system
set fp.h i_fp
eval $inhdr
echo " "
$echo "Guessing which symbols your C compiler and preprocessor define..." >&4
$cat <<'EOSH' > Cppsym.know
-a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
-AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
-alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
-ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
-BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
-BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
-bull c cadmus clipper CMU COFF COMPILER_VERSION
-concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
-CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
-Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
-FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
-GLIBC GLIBC_MINOR
-GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
-H3050R H3050RX hbullx20 hcx host_mips
-hp200 hp300 hp700 HP700 hp800 hp9000
-hp9000s200 hp9000s300 hp9000s400 hp9000s500
-hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
-i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
-IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
-INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
-LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
-LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
-LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
-LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
-M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
-M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
-M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
-MATH_HAS_NO_SIDE_EFFECTS
-mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
-mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
-mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
-MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
-mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
-NetBSD news1500 news1700 news1800 news1900 news3700
-news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
-ns32016 ns32332 ns32k nsc32000
+a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
+AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
+AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
+arch_pwr ardent ARM ARM32 atarist att386 att3b
+BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
+BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
+byteorder byte_order
+c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
+convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
+DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
+ELF encore EPI EXTENSIONS
+FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
+GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
+GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
+H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
+hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
+hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
+i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
+iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
+INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
+ksr1
+LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
+LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
+LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
+luna88k Lynx
+M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
+MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
+mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
+merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
+MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
+MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
+M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
+M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
+n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
+news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
+ns32000 ns32016 ns32332 ns32k nsc32000
OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
-pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
-pc532 pdp11 PGC PIC plexus PORTAR posix
-POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
-POSIX_C_SOURCE POSIX_SOURCE POWER
-PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
-riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
-SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
-sony sony_news sonyrisc sparc sparclite spectrum
-stardent stdc STDC_EXT stratos sun sun3 sun386
-Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
-SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
-SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
-sysV68 sysV88 Tek4132 Tek4300 titan
-TM3200 TM5400 TM5600
-tower tower32 tower32_200 tower32_600 tower32_700
+PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
+plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
+POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
+QK_USER QNX
+R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
+S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
+SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
+sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
+stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
+SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
+SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
+SYSV4 SYSV5 sysV68 sysV88
+Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
+TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
tower32_800 tower32_850 tss
-u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
-ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
-unix UNIX95 UNIX99 unixpc unos
-USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
-USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
-USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
-USGr4 USGr4_2
-Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
-XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
-XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
-z8000
+u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
+UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
+USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
+USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
+USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
+USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
+uxpm uxps
+vax venix VMESA vms
+x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
+XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
+z8000 zarch
EOSH
# Maybe put other stuff here too.
-cat <<EOSH >>Cppsym.know
+./tr '-' '_' <<EOSH >>Cppsym.know
$osname
EOSH
./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
if $test \$# -gt 0; then
echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
if $test -s Cppsym.got; then
- $rm -f Cppsym.got
- exit 0
+ $rm -f Cppsym.got
+ exit 0
fi
$rm -f Cppsym.got
exit 1
$eunicefix ccsym
./ccsym > ccsym1.raw
if $test -s ccsym1.raw; then
- $sort ccsym1.raw | $uniq >ccsym.raw
+ $sort ccsym1.raw | $uniq >ccsym.raw
else
- mv ccsym1.raw ccsym.raw
+ mv ccsym1.raw ccsym.raw
fi
$awk '/\=/ { print $0; next }
echo " "
echo "However, your C preprocessor defines the following symbols:"
$cat Cppsym.true
- ccsymbols=''
+ ccsymbols=''
cppsymbols=`$cat Cppsym.true`
- cppsymbols=`echo $cppsymbols`
+ cppsymbols=`echo $cppsymbols`
cppccsymbols="$cppsymbols"
else
if $test -s ccsym.com; then
echo "Your C compiler ${also}defines the following cpp symbols:"
$sed -e 's/\(..*\)=1/\1/' ccsym.own
$sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
- ccsymbols=`$cat ccsym.own`
- ccsymbols=`echo $ccsymbols`
+ ccsymbols=`$cat ccsym.own`
+ ccsymbols=`echo $ccsymbols`
$test "$silent" || sleep 1
fi
fi
+: add -D_FORTIFY_SOURCE if feasible and not already there
+case "$gccversion" in
+4.*) case "$optimize$ccflags" in
+ *-O*) case "$ccflags$cppsymbols" in
+ *_FORTIFY_SOURCE=*) # Don't add it again.
+ echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
+ ;;
+ *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
+ ccflags="$ccflags -D_FORTIFY_SOURCE=2"
+ ;;
+ esac
+ ;;
+ *) echo "You have gcc 4.* but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
+ ;;
+ esac
+ ;;
+*) echo "You seem not to have gcc 4.*, not adding -D_FORTIFY_SOURCE." >&4
+ ;;
+esac
+
: see if this is a termio system
val="$undef"
val2="$undef"
Scalar/List/Utils) this_ext="List/Util" ;;
PathTools) this_ext="Cwd" ;;
esac;
- echo " $xs_extensions $nonxs_extensions" > $$.tmp;
- if $contains " $this_ext " $$.tmp; then
+ echo " $xs_extensions $nonxs_extensions" > $tdir/$$.tmp;
+ if $contains " $this_ext " $tdir/$$.tmp; then
echo >&4;
echo "Duplicate directories detected for extension $xxx" >&4;
echo "Configure cannot correctly recover from this - shall I abort?" >&4;
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
+ $ls -1 $xxx > $tdir/$$.tmp;
+ if $contains "\.xs$" $tdir/$$.tmp > /dev/null 2>&1; then
xs_extensions="$xs_extensions $this_ext";
- elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
+ elif $contains "\.c$" $tdir/$$.tmp > /dev/null 2>&1; then
xs_extensions="$xs_extensions $this_ext";
elif $test -d $xxx; then
nonxs_extensions="$nonxs_extensions $this_ext";
fi;
- $rm -f $$.tmp;
+ $rm -f $tdir/$$.tmp;
;;
esac;
done'
bin_ELF='$bin_ELF'
binexp='$binexp'
bison='$bison'
-bootstrap_charset='$bootstrap_charset'
byacc='$byacc'
byteorder='$byteorder'
c='$c'
d_attribute_pure='$d_attribute_pure'
d_attribute_unused='$d_attribute_unused'
d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
+d_backtrace='$d_backtrace'
d_bcmp='$d_bcmp'
d_bcopy='$d_bcopy'
d_bsd='$d_bsd'
d_dir_dd_fd='$d_dir_dd_fd'
d_dirfd='$d_dirfd'
d_dirnamlen='$d_dirnamlen'
+d_dladdr='$d_dladdr'
d_dlerror='$d_dlerror'
d_dlopen='$d_dlopen'
d_dlsymun='$d_dlsymun'
d_pthread_atfork='$d_pthread_atfork'
d_pthread_attr_setscope='$d_pthread_attr_setscope'
d_pthread_yield='$d_pthread_yield'
+d_ptrdiff_t='$d_ptrdiff_t'
d_pwage='$d_pwage'
d_pwchange='$d_pwchange'
d_pwclass='$d_pwclass'
d_vsnprintf='$d_vsnprintf'
d_wait4='$d_wait4'
d_waitpid='$d_waitpid'
+d_wcscmp='$d_wcscmp'
d_wcstombs='$d_wcstombs'
+d_wcsxfrm='$d_wcsxfrm'
d_wctomb='$d_wctomb'
d_writev='$d_writev'
d_xenix='$d_xenix'
h_sysfile='$h_sysfile'
hint='$hint'
hostcat='$hostcat'
+hostgenerate='$hostgenerate'
+hostosname='$hostosname'
+hostperl='$hostperl'
html1dir='$html1dir'
html1direxp='$html1direxp'
html3dir='$html3dir'
i8type='$i8type'
i_arpainet='$i_arpainet'
i_assert='$i_assert'
+i_bfd='$i_bfd'
i_bsdioctl='$i_bsdioctl'
i_crypt='$i_crypt'
i_db='$i_db'
i_dbm='$i_dbm'
i_dirent='$i_dirent'
i_dlfcn='$i_dlfcn'
+i_execinfo='$i_execinfo'
i_fcntl='$i_fcntl'
i_float='$i_float'
i_fp='$i_fp'
ls='$ls'
lseeksize='$lseeksize'
lseektype='$lseektype'
-mad='$mad'
-madlyh='$madlyh'
-madlyobj='$madlyobj'
-madlysrc='$madlysrc'
mail='$mail'
mailx='$mailx'
make='$make'
tar='$tar'
targetarch='$targetarch'
targetdir='$targetdir'
+targetenv='$targetenv'
targethost='$targethost'
targetmkdir='$targetmkdir'
targetport='$targetport'
+targetsh='$targetsh'
tbl='$tbl'
tee='$tee'
test='$test'
use5005threads='$use5005threads'
use64bitall='$use64bitall'
use64bitint='$use64bitint'
+usecbacktrace='$usecbacktrace'
usecrosscompile='$usecrosscompile'
usedevel='$usedevel'
usedl='$usedl'
esac
fi
+: preserve RCS keywords in files with variable substitution, grrr
+Id='$Id'
+
: Finish up by extracting the .SH files
case "$alldone" in
exit)