# 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=''
to=''
usecrosscompile=''
-hostperl=''
-hostgenerate=''
extern_C=''
mistrustnm=''
usedevel=''
d__fwalk=''
d_access=''
d_accessx=''
+d_acosh=''
d_aintl=''
d_alarm=''
asctime_r_proto=''
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_fd_macros=''
d_fd_set=''
d_fds_bits=''
+d_fegetround=''
d_fgetpos=''
d_finite=''
d_finitel=''
d_flockproto=''
d_fork=''
d_fp_class=''
+d_fp_classl=''
d_fpclass=''
+d_fp_classify=''
d_fpclassify=''
d_fpclassl=''
+d_fpgetround=''
d_fpos64_t=''
d_frexpl=''
d_fs_data_s=''
d_isascii=''
d_isblank=''
d_isfinite=''
+d_isfinitel=''
d_isinf=''
+d_isinfl=''
d_isnan=''
d_isnanl=''
+d_j0=''
+d_j0l=''
d_killpg=''
d_lchown=''
d_ldbl_dig=''
localtime_r_proto=''
d_locconv=''
d_lockf=''
+d_ldexpl=''
d_longdbl=''
+longdblkind=''
longdblsize=''
d_longlong=''
longlongsize=''
d_pthread_yield=''
d_sched_yield=''
sched_yield=''
+d_ptrdiff_t=''
d_qgcvt=''
d_random_r=''
random_r_proto=''
d_tmpnam_r=''
tmpnam_r_proto=''
d_truncate=''
+d_truncl=''
d_ttyname_r=''
ttyname_r_proto=''
d_tzname=''
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_fenv=''
i_float=''
i_fp=''
i_fp_class=''
d_pwpasswd=''
d_pwquota=''
i_pwd=''
+i_quadmath=''
i_shadow=''
i_socks=''
i_stdbool=''
i_stddef=''
+i_stdint=''
i_stdlib=''
i_string=''
strings=''
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=''
uselargefiles=''
uselongdouble=''
usemorebits=''
+usequadmath=''
usemultiplicity=''
nm_opt=''
nm_so_opt=''
;;
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
# The most common problem is -D_REENTRANT for threads.
# This heuristic catches that case, but gets false positives
# if -Dusethreads was not actually specified. Better to
- # bail out here with a useful message than fail
+ # bail out here with a useful message than fail
# mysteriously later. Should we perhaps just try to
# re-invoke Configure -Dcc=gcc config_args ?
if $test -f usethreads.cbu; then
- $cat >&4 <<EOM
+ $cat >&4 <<EOM
*** However, any setting of the C compiler flags (e.g. for thread support)
*** will be lost. It may be necessary for you to restart Configure and
echo "Cannot find myread, sorry. Aborting." >&2
exit 1
fi
- fi
+ fi
case "$ans" in
[yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
esac
$startsh
EOS
cat <<'EOSC' >>checkcc
-case "$cc" in
+case "$cc" in
'') ;;
-*) $rm -f try try.*
+*) $rm -f try try.*
$cat >try.c <<EOM
int main(int argc, char *argv[]) {
return 0;
if $test X"$despair" = Xyes; then
echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
fi
- $cat >&4 <<EOM
+ $cat >&4 <<EOM
You need to find a working C compiler.
Either (purchase and) install the C compiler supplied by your OS vendor,
or for a free C compiler try http://gcc.gnu.org/
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..."
: 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 ..
- test -d host || mkdir host
- cd host && rm -rf ./*
- ../Configure -des -Dusedevel -Dmksymlinks
- make miniperl
- make generate_uudmap
- hostperl=host/miniperl
- hostgenerate=host/generate_uudmap
- cd ..
- cd UU
+ 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'
+ usecrosscompile="$undef"
;;
esac
$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 -r $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 -r $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
set usemultiplicity
eval $setvar
+: Check if usequadmath is requested
+case "$usequadmath" in
+"$define"|true|[yY]*)
+ usequadmath="$define"
+ # if usequadmath enabled also enable uselongdouble
+ uselongdouble="$define"
+ ;;
+*) usequadmath="$undef" ;;
+esac
+
: Check if morebits is requested
case "$usemorebits" in
"$define"|true|[yY]*)
$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
+case "$usequadmath" in
+"$define") libswanted="$libswanted quadmath" ;;
+esac
libsfound=''
libsfiles=''
libsdirs=''
xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
$test -f "$xxx" && eval $libscheck
$test -f "$xxx" && libstyle=shared
+ xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
+ $test -f "$xxx" && eval $libscheck
+ $test -f "$xxx" && libstyle=shared
fi
if test ! -f "$xxx"; then
xxx=$thisdir/lib$thislib.$so
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;
# as that way the compiler can do the right implementation dependant
# thing. (NWC)
case "$gccversion" in
- ?*) set stack-protector -fstack-protector
+ ?*) set stack-protector-strong -fstack-protector-strong
eval $checkccflag
+ case "$dflt" in
+ *-fstack-protector-strong*) ;; # It got added.
+ *) # Try the plain/older -fstack-protector.
+ set stack-protector -fstack-protector
+ eval $checkccflag
+ ;;
+ esac
;;
esac
;;
esac
# See note above about -fstack-protector
case "$ccflags" in
+*-fstack-protector-strong*)
+ case "$dflt" in
+ *-fstack-protector-strong*) ;; # Don't add it again
+ *) dflt="$dflt -fstack-protector-strong" ;;
+ esac
+ ;;
*-fstack-protector*)
case "$dflt" in
*-fstack-protector*) ;; # Don't add it again
;;
esac
-: check for length of double
+: Check if we are using the GNU C library
echo " "
-case "$doublesize" in
-'')
- echo "Checking to see how big your double precision numbers are..." >&4
- $cat >try.c <<EOCP
+echo "Checking for GNU C Library..." >&4
+cat >try.c <<'EOCP'
+/* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
+ alone are insufficient to distinguish different versions, such as
+ 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
+ libc version 2.1.0. A. Dougherty, June 3, 2002.
+*/
#include <stdio.h>
-#$i_stdlib I_STDLIB
-#ifdef I_STDLIB
-#include <stdlib.h>
-#endif
-int main()
+int main(void)
{
- printf("%d\n", (int)sizeof(double));
- exit(0);
+#ifdef __GLIBC__
+# ifdef __GLIBC_MINOR__
+# if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
+# include <gnu/libc-version.h>
+ printf("%s\n", gnu_get_libc_version());
+# else
+ printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
+# endif
+# else
+ printf("%d\n", __GLIBC__);
+# endif
+ return 0;
+#else
+ return 1;
+#endif
}
EOCP
- set try
- if eval $compile_ok; then
- doublesize=`$run ./try`
- echo "Your double is $doublesize bytes long."
- else
- dflt='8'
- echo "(I can't seem to compile the test program. Guessing...)"
- rp="What is the size of a double precision number (in bytes)?"
- . ./myread
- doublesize="$ans"
- fi
- ;;
-esac
-$rm_try
-
-: check for long doubles
-echo " "
-echo "Checking to see if you have long double..." >&4
-echo 'int main() { long double x = 7.0; }' > try.c
set try
-if eval $compile; then
+if eval $compile_ok && $run ./try > glibc.ver; then
val="$define"
- echo "You have long double."
+ gnulibc_version=`$cat glibc.ver`
+ echo "You are using the GNU C Library version $gnulibc_version"
else
val="$undef"
- echo "You do not have long double."
+ gnulibc_version=''
+ echo "You are not using the GNU C Library"
fi
-$rm_try
-set d_longdbl
+$rm_try glibc.ver
+set d_gnulibc
eval $setvar
-: check for length of long double
-case "${d_longdbl}${longdblsize}" in
-$define)
- echo " "
- echo "Checking to see how big your long doubles are..." >&4
- $cat >try.c <<'EOCP'
-#include <stdio.h>
-int main()
-{
- printf("%d\n", sizeof(long double));
-}
-EOCP
- set try
- set try
- if eval $compile; then
- longdblsize=`$run ./try`
- echo "Your long doubles are $longdblsize bytes long."
- else
- dflt='8'
+: see if nm is to be used to determine whether a symbol is defined or not
+case "$usenm" in
+'')
+ dflt=''
+ case "$d_gnulibc" in
+ "$define")
echo " "
- echo "(I can't seem to compile the test program. Guessing...)" >&4
- rp="What is the size of a long double (in bytes)?"
- . ./myread
- longdblsize="$ans"
- fi
- if $test "X$doublesize" = "X$longdblsize"; then
- echo "That isn't any different from an ordinary double."
- echo "I'll keep your setting anyway, but you may see some"
- echo "harmless compilation warnings."
- fi
+ echo "nm probably won't work on the GNU C Library." >&4
+ dflt=n
+ ;;
+ esac
+ case "$dflt" in
+ '')
+ if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
+ echo " "
+ echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
+ echo "'nm' won't be sufficient on this system." >&4
+ dflt=n
+ fi
+ ;;
+ esac
+ case "$dflt" in
+ '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
+ if $test $dflt -gt 20; then
+ dflt=y
+ else
+ dflt=n
+ fi
+ ;;
+ esac
;;
-esac
-$rm_try
-
-: determine the architecture name
-echo " "
-if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
- tarch=`arch`"-$osname"
-elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
- if uname -m > tmparch 2>&1 ; then
- tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
- -e 's/$/'"-$osname/" tmparch`
- else
- tarch="$osname"
- fi
- $rm -f tmparch
-else
- tarch="$osname"
-fi
-case "$myarchname" in
-''|"$tarch") ;;
*)
- echo "(Your architecture name used to be $myarchname.)"
- archname=''
+ case "$usenm" in
+ true|$define) dflt=y;;
+ *) dflt=n;;
+ esac
;;
esac
-case "$targetarch" in
-'') ;;
-*) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
-esac
-myarchname="$tarch"
-case "$archname" in
-'') dflt="$tarch";;
-*) dflt="$archname";;
-esac
-rp='What is your architecture name'
-. ./myread
-archname="$ans"
+$cat <<EOM
-: optionally add API version to the architecture for versioned archlibs
-case "$useversionedarchname" in
-$define|true|[yY]*) dflt='y';;
-*) dflt='n';;
-esac
-rp='Add the Perl API version to your archname?'
+I can use $nm to extract the symbols from your C libraries. This
+is a time consuming task which may generate huge output on the disk (up
+to 3 megabytes) but that should make the symbols extraction faster. The
+alternative is to skip the 'nm' extraction part and to compile a small
+test program instead to determine whether each symbol is present. If
+you have a fast C compiler and/or if your 'nm' output cannot be parsed,
+this may be the best solution.
+
+You probably shouldn't let me use 'nm' if you are using the GNU C Library.
+
+EOM
+rp="Shall I use $nm to extract C symbols from the libraries?"
. ./myread
case "$ans" in
-y|Y) useversionedarchname="$define" ;;
-*) useversionedarchname="$undef" ;;
-esac
-case "$useversionedarchname" in
-$define)
- case "$archname" in
- *-$api_versionstring)
- echo "...and architecture name already has -$api_versionstring" >&4
- ;;
- *)
- archname="$archname-$api_versionstring"
- echo "...setting architecture name to $archname." >&4
- ;;
- esac
- ;;
+[Nn]*) usenm=false;;
+*) usenm=true;;
esac
-case "$usethreads" in
-$define)
- echo "Threads selected." >&4
- case "$archname" in
- *-thread*) echo "...and architecture name already has -thread." >&4
- ;;
- *) archname="$archname-thread"
- echo "...setting architecture name to $archname." >&4
- ;;
- esac
- ;;
+runnm=$usenm
+case "$reuseval" in
+true) runnm=false;;
esac
-case "$usemultiplicity" in
-$define)
- echo "Multiplicity selected." >&4
- case "$archname" in
- *-multi*) echo "...and architecture name already has -multi." >&4
- ;;
- *) archname="$archname-multi"
- echo "...setting architecture name to $archname." >&4
- ;;
- esac
- ;;
+
+: nm options which may be necessary
+case "$nm_opt" in
+'') if $test -f /mach_boot; then
+ nm_opt='' # Mach
+ elif $test -d /usr/ccs/lib; then
+ nm_opt='-p' # Solaris (and SunOS?)
+ elif $test -f /dgux; then
+ nm_opt='-p' # DG-UX
+ elif $test -f /lib64/rld; then
+ nm_opt='-p' # 64-bit Irix
+ else
+ nm_opt=''
+ fi;;
esac
-case "$use64bitint$use64bitall" in
-*"$define"*)
- case "$archname64" in
- '')
- echo "This architecture is naturally 64-bit, not changing architecture name." >&4
- ;;
- *)
- case "$use64bitint" in
- "$define") echo "64 bit integers selected." >&4 ;;
- esac
- case "$use64bitall" in
- "$define") echo "Maximal 64 bitness selected." >&4 ;;
- esac
- case "$archname" in
- *-$archname64*) echo "...and architecture name already has $archname64." >&4
- ;;
- *) archname="$archname-$archname64"
- echo "...setting architecture name to $archname." >&4
- ;;
- esac
+
+: nm options which may be necessary for shared libraries but illegal
+: for archive libraries. Thank you, Linux.
+case "$nm_so_opt" in
+'') case "$myuname" in
+ *linux*|gnu*)
+ if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
+ nm_so_opt='--dynamic'
+ fi
;;
esac
+ ;;
esac
-case "$uselongdouble" in
-$define)
- echo "Long doubles selected." >&4
- case "$longdblsize" in
- $doublesize)
- echo "...but long doubles are equal to doubles, not changing architecture name." >&4
+
+: Figure out where the libc is located
+case "$runnm" in
+true)
+: get list of predefined functions in a handy place
+echo " "
+case "$libc" in
+'') libc=unknown
+ case "$libs" in
+ *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
+ esac
+ ;;
+esac
+case "$libs" in
+'') ;;
+*) for thislib in $libs; do
+ case "$thislib" in
+ -lc|-lc_s)
+ : Handle C library specially below.
;;
- *)
- case "$archname" in
- *-ld*) echo "...and architecture name already has -ld." >&4
- ;;
- *) archname="$archname-ld"
- echo "...setting architecture name to $archname." >&4
- ;;
- esac
+ -l*)
+ thislib=`echo $thislib | $sed -e 's/^-l//'`
+ if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
+ :
+ elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
+ :
+ elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
+ :
+ elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
+ :
+ elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
+ :
+ elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
+ :
+ elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
+ :
+ else
+ try=''
+ fi
+ libnames="$libnames $try"
;;
+ *) libnames="$libnames $thislib" ;;
esac
+ done
;;
esac
-if $test -f archname.cbu; then
- echo "Your platform has some specific hints for architecture name, using them..."
- . ./archname.cbu
-fi
-
-: set the prefixit variable, to compute a suitable default value
-prefixit='case "$3" in
-""|none)
- case "$oldprefix" in
- "") eval "$1=\"\$$2\"";;
- *)
- case "$3" in
- "") eval "$1=";;
- none)
- eval "tp=\"\$$2\"";
- case "$tp" in
- ""|" ") eval "$1=\"\$$2\"";;
- *) eval "$1=";;
- esac;;
- esac;;
- esac;;
+xxx=normal
+case "$libc" in
+unknown)
+ set /lib/libc.$so
+ for xxx in $libpth; do
+ $test -r $1 || set $xxx/libc.$so
+ : The messy sed command sorts on library version numbers.
+ $test -r $1 || \
+ set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
+ tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
+ h
+ s/[0-9][0-9]*/0000&/g
+ s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
+ G
+ s/\n/ /' | \
+ $sort | $sed -e 's/^.* //'`
+ eval set \$$#
+ done
+ $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
+ $test -r $1 || set $sysroot/lib/libsys_s$_a
+ ;;
*)
- eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
- case "$tp" in
- --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
- /*-$oldprefix/*|\~*-$oldprefix/*)
- eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
- *) eval "$1=\"\$$2\"";;
- esac;;
-esac'
-
-: determine installation style
-: For now, try to deduce it from prefix unless it is already set.
-: Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
-case "$installstyle" in
-'') case "$prefix" in
- *perl*) dflt='lib';;
- *) dflt='lib/perl5' ;;
- esac
+ set blurfl
;;
-*) dflt="$installstyle" ;;
esac
-: Probably not worth prompting for this since we prompt for all
-: the directories individually, and the prompt would be too long and
-: confusing anyway.
-installstyle=$dflt
-
-: determine where public executables go
-echo " "
-set dflt bin bin
-eval $prefixit
-fn=d~
-rp='Pathname where the public executables will reside?'
-. ./getfile
-if $test "X$ansexp" != "X$binexp"; then
- installbin=''
+if $test -r "$1"; then
+ echo "Your (shared) C library seems to be in $1."
+ libc="$1"
+elif $test -r /lib/libc && $test -r /lib/clib; then
+ echo "Your C library seems to be in both /lib/clib and /lib/libc."
+ xxx=apollo
+ libc='/lib/clib /lib/libc'
+ if $test -r /lib/syslib; then
+ echo "(Your math library is in /lib/syslib.)"
+ libc="$libc /lib/syslib"
+ fi
+elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
+ echo "Your C library seems to be in $libc, as you said before."
+elif $test -r $incpath/usr/lib/libc$_a; then
+ libc=$incpath/usr/lib/libc$_a;
+ echo "Your C library seems to be in $libc. That's fine."
+elif $test -r /lib/libc$_a; then
+ libc=/lib/libc$_a;
+ echo "Your C library seems to be in $libc. You're normal."
+else
+ if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
+ :
+ elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
+ libnames="$libnames "`./loc clib blurfl/dyick $libpth`
+ elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
+ :
+ elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
+ :
+ elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
+ :
+ else
+ tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
+ fi
+ if $test -r "$tans"; then
+ echo "Your C library seems to be in $tans, of all places."
+ libc=$tans
+ else
+ libc='blurfl'
+ fi
fi
-prefixvar=bin
-: XXX Bug? -- ignores Configure -Dinstallprefix setting.
-: XXX If this is fixed, also fix the "start perl" hunk below, which relies on
-: this via initialinstalllocation
-. ./setprefixvar
+if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
+ dflt="$libc"
+ cat <<EOM
-case "$userelocatableinc" in
-$define|true|[yY]*) dflt='y' ;;
-*) dflt='n' ;;
-esac
-cat <<EOM
+If the guess above is wrong (which it might be if you're using a strange
+compiler, or your machine supports multiple models), you can override it here.
-Would you like to build Perl so that the installation is relocatable, so that
-library paths in @INC are determined relative to the path of the perl binary?
-This is not advised for system Perl installs, or if you need to run setid
-scripts or scripts under taint mode.
+EOM
+else
+ dflt=''
+ echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
+ cat >&4 <<EOM
+I can't seem to find your C library. I've looked in the following places:
-If this doesn't make any sense to you, just accept the default '$dflt'.
EOM
-rp='Use relocatable @INC?'
-. ./myread
-case "$ans" in
-y|Y) val="$define" ;;
-*) val="$undef" ;;
-esac
-set userelocatableinc
-eval $setvar
+ $sed 's/^/ /' libpath
+ cat <<EOM
-initialinstalllocation="$binexp"
-: Default prefix is now "up one level from where the binaries are"
-case "$userelocatableinc" in
-$define|true|[yY]*)
- bin=".../"
- binexp=".../"
- prefix=".../.."
- prefixexp=".../.."
- installprefixexp=".../.."
- ;;
-esac
-
-: determine where private library files go
-: Usual default is /usr/local/lib/perl5/$version.
-: Also allow things like /opt/perl/lib/$version, since
-: /opt/perl/lib/perl5... would be redundant.
-: The default "style" setting is made in installstyle.U
-case "$installstyle" in
-*lib/perl5*) set dflt privlib lib/$package/$version ;;
-*) set dflt privlib lib/$version ;;
-esac
-eval $prefixit
-$cat <<EOM
-
-There are some auxiliary files for $package that need to be put into a
-private library directory that is accessible by everyone.
+None of these seems to contain your C library. I need to get its name...
EOM
-fn=$binexp
-fn=d~+
-rp='Pathname where the private library files will reside?'
+fi
+fn=f
+rp='Where is your C library?'
. ./getfile
-prefixvar=privlib
-. ./setprefixvar
-
-: set the prefixup variable, to restore leading tilda escape
-prefixup='case "$prefixexp" in
-"$prefix") ;;
-*) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
-esac'
+libc="$ans"
-: determine where public architecture dependent libraries go
-set archlib archlib
-eval $prefixit
-: privlib default is /usr/local/lib/$package/$version
-: archlib default is /usr/local/lib/$package/$version/$archname
-: privlib may have an optional trailing /share.
-tdflt=`echo $privlib | $sed 's,/share$,,'`
-tdflt=$tdflt/$archname
-case "$archlib" in
-'') dflt=$tdflt
- ;;
-*) dflt="$archlib"
- ;;
-esac
-$cat <<EOM
+echo " "
+echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
+set X `cat libnames`
+shift
+xxx=files
+case $# in 1) xxx=file; esac
+echo "Extracting names from the following $xxx for later perusal:" >&4
+echo " "
+$sed 's/^/ /' libnames >&4
+echo " "
+$echo $n "This may take a while...$c" >&4
-$spackage contains architecture-dependent library files. If you are
-sharing libraries in a heterogeneous environment, you might store
-these files in a separate location. Otherwise, you can just include
-them with the rest of the public library files.
+for file in $*; do
+ case $file in
+ *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
+ *) $nm $nm_opt $file 2>/dev/null;;
+ esac
+done >libc.tmp
-EOM
-fn=$binexp
-fn=d+~
-rp='Where do you want to put the public architecture-dependent libraries?'
-. ./getfile
-prefixvar=archlib
-. ./setprefixvar
-if $test X"$archlib" = X"$privlib"; then
- d_archlib="$undef"
+$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='[ADTSIWi]'
+if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
+ eval $xscan;\
+ $contains '^fprintf$' libc.list >/dev/null 2>&1; then
+ eval $xrun
+elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
+ eval $xscan;\
+ $contains '^fprintf$' libc.list >/dev/null 2>&1; then
+ eval $xrun
+elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
+ eval $xscan;\
+ $contains '^fprintf$' libc.list >/dev/null 2>&1; then
+ eval $xrun
+elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
+ eval $xscan;\
+ $contains '^fprintf$' libc.list >/dev/null 2>&1; then
+ eval $xrun
+elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
+ eval $xscan;\
+ $contains '^fprintf$' libc.list >/dev/null 2>&1; then
+ eval $xrun
+elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
+ eval $xscan;\
+ $contains '^fprintf$' libc.list >/dev/null 2>&1; then
+ eval $xrun
+elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
+ -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
+ eval $xscan;\
+ $contains '^fprintf$' libc.list >/dev/null 2>&1; then
+ eval $xrun
+elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
+ eval $xscan;\
+ $contains '^fprintf$' libc.list >/dev/null 2>&1; then
+ eval $xrun
+elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
+ eval $xscan;\
+ $contains '^fprintf$' libc.list >/dev/null 2>&1; then
+ eval $xrun
+elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
+ eval $xscan;\
+ $contains '^fprintf$' libc.list >/dev/null 2>&1; then
+ eval $xrun
+elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
+ eval $xscan;\
+ $contains '^fprintf$' libc.list >/dev/null 2>&1; then
+ eval $xrun
+elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
+ eval $xscan;\
+ $contains '^fprintf$' libc.list >/dev/null 2>&1; then
+ eval $xrun
+elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
+ eval $xscan;\
+ $contains '^fprintf$' libc.list >/dev/null 2>&1; then
+ eval $xrun
+elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
+ eval $xscan;\
+ $contains '^fprintf$' libc.list >/dev/null 2>&1; then
+ eval $xrun
else
- d_archlib="$define"
-fi
-
-: see if setuid scripts can be secure
-$cat <<EOM
-
-Some kernels have a bug that prevents setuid #! scripts from being
-secure. Some sites have disabled setuid #! scripts because of this.
-
-First let's decide if your kernel supports secure setuid #! scripts.
-(If setuid #! scripts would be secure but have been disabled anyway,
-don't say that they are secure if asked.)
-
-EOM
-
-val="$undef"
-if $test -d /dev/fd; then
- echo "#!$ls" >reflect
- chmod +x,u+s reflect
- ./reflect >flect 2>&1
- if $contains "/dev/fd" flect >/dev/null; then
- echo "Congratulations, your kernel has secure setuid scripts!" >&4
- val="$define"
+ $nm -p $* 2>/dev/null >libc.tmp
+ $grep fprintf libc.tmp > libc.ptf
+ if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
+ eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
+ then
+ nm_opt='-p'
+ eval $xrun
else
- $cat <<EOM
-If you are not sure if they are secure, I can check but I'll need a
-username and password different from the one you are using right now.
-If you don't have such a username or don't want me to test, simply
-enter 'none'.
-
-EOM
- rp='Other username to test security of setuid scripts with?'
- dflt='none'
- . ./myread
- case "$ans" in
- n|none)
- case "$d_suidsafe" in
- '') echo "I'll assume setuid scripts are *not* secure." >&4
- dflt=n;;
- "$undef")
- echo "Well, the $hint value is *not* secure." >&4
- dflt=n;;
- *) echo "Well, the $hint value *is* secure." >&4
- dflt=y;;
- esac
- ;;
- *)
- $rm -f reflect flect
- echo "#!$ls" >reflect
- chmod +x,u+s reflect
- echo >flect
- chmod a+w flect
- echo '"su" will (probably) prompt you for '"$ans's password."
- su $ans -c './reflect >flect'
- if $contains "/dev/fd" flect >/dev/null; then
- echo "Okay, it looks like setuid scripts are secure." >&4
- dflt=y
+ echo " "
+ echo "$nm didn't seem to work right. Trying $ar instead..." >&4
+ com=''
+ if $ar t $libc > libc.tmp && \
+ $contains '^fprintf$' libc.tmp >/dev/null 2>&1
+ then
+ for thisname in $libnames $libc; do
+ $ar t $thisname >>libc.tmp
+ done
+ $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
+ echo "Ok." >&4
+ elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
+ for thisname in $libnames $libc; do
+ $ar tv $thisname >>libc.tmp
+ emximp -o tmp.imp $thisname \
+ 2>/dev/null && \
+ $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
+ < tmp.imp >>libc.tmp
+ $rm -f tmp.imp
+ done
+ $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
+ echo "Ok." >&4
+ else
+ echo "$ar didn't seem to work right." >&4
+ echo "Maybe this is a Cray...trying bld instead..." >&4
+ if bld t $libc | \
+ $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
+ $test -s libc.list
+ then
+ for thisname in $libnames; do
+ bld t $libnames | \
+ $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
+ $ar t $thisname >>libc.tmp
+ done
+ echo "Ok." >&4
else
- echo "I don't think setuid scripts are secure." >&4
- dflt=n
+ echo "That didn't work either. Giving up." >&4
+ exit 1
fi
- ;;
- esac
- rp='Does your kernel have *secure* setuid scripts?'
- . ./myread
- case "$ans" in
- [yY]*) val="$define";;
- *) val="$undef";;
- esac
+ fi
fi
-else
- echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
- echo "(That's for file descriptors, not floppy disks.)"
- val="$undef"
fi
-set d_suidsafe
-eval $setvar
-
-$rm -f reflect flect
+nm_extract="$com"
+case "$PASE" in
+define)
+ echo " "
+ echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
+ dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
+ ;;
+*) if $test -f /lib/syscalls.exp; then
+ echo " "
+ echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
+ $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
+ /lib/syscalls.exp >>libc.list
+ fi
+ ;;
+esac
+;;
+esac
+$rm -f libnames libpath
-: now see if they want to do setuid emulation
-if $test $patchlevel -lt 11; then
+: Check if we are using C++
echo " "
-val="$undef"
-case "$d_suidsafe" in
-"$define")
+echo "Checking for C++..." >&4
+$cat >try.c <<'EOCP'
+#include <stdio.h>
+int main(void)
+{
+#ifdef __cplusplus
+ return 0;
+#else
+ return 1;
+#endif
+}
+EOCP
+set try
+if eval $compile_ok && $run ./try; then
+ val="$define"
+ echo "You are using a C++ compiler."
+else
val="$undef"
- echo "No need to emulate SUID scripts since they are secure here." >&4
+ echo "You are not using a C++ compiler."
+fi
+$rm_try cplusplus$$
+set d_cplusplus
+eval $setvar
+
+: is a C symbol defined?
+csym='tlook=$1;
+case "$3" in
+-v) tf=libc.tmp; tdc="";;
+-a) tf=libc.tmp; tdc="[]";;
+*) tlook="^$1\$"; tf=libc.list; tdc="()";;
+esac;
+case "$d_cplusplus" in
+ $define) extern_C="extern \"C\"" ;;
+ *) extern_C="extern" ;;
+esac;
+tx=yes;
+case "$reuseval-$4" in
+true-) ;;
+true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
+esac;
+case "$tx" in
+yes)
+ tval=false;
+ if $test "$runnm" = true; then
+ 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() && 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() && 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;
;;
*)
- $cat <<EOM
-Some systems have disabled setuid scripts, especially systems where
-setuid scripts cannot be secure. On systems where setuid scripts have
-been disabled, the setuid/setgid bits on scripts are currently
-useless. It is possible for $package to detect those bits and emulate
-setuid/setgid in a secure fashion. This emulation will only work if
-setuid scripts have been disabled in your kernel.
-
-EOM
- case "$d_dosuid" in
- "$define") dflt=y ;;
- *) dflt=n ;;
- esac
- rp="Do you want to do setuid/setgid emulation?"
- . ./myread
- case "$ans" in
- [yY]*) val="$define";;
- *) val="$undef";;
- esac
+ case "$tval" in
+ $define) tval=true;;
+ *) tval=false;;
+ esac;
;;
-esac
-set d_dosuid
-eval $setvar
-else
- case "$d_dosuid" in
- "$define")
- cat >&4 <<EOH
-
-SUID emulation has been removed for 5.12
-Please re-run Configure without -Dd_dosuid
+esac;
+eval "$2=$tval"'
-EOH
- exit 1;
- ;;
- esac
- d_dosuid=undef
-fi
+: define an is-in-libc? function
+inlibc='echo " "; td=$define; tu=$undef;
+sym=$1; var=$2; eval "was=\$$2";
+tx=yes;
+case "$reuseval$was" in
+true) ;;
+true*) tx=no;;
+esac;
+case "$tx" in
+yes)
+ set $sym tres -f;
+ eval $csym;
+ case "$tres" in
+ true)
+ echo "$sym() found." >&4;
+ case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
+ *)
+ echo "$sym() NOT found." >&4;
+ case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
+ esac;;
+*)
+ case "$was" in
+ $define) echo "$sym() found." >&4;;
+ *) echo "$sym() NOT found." >&4;;
+ esac;;
+esac'
-: Find perl5.005 or later.
-echo "Looking for a previously installed perl5.005 or later... "
-case "$perl5" in
-'') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
- : Check if this perl is recent and can load a simple module
- if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
- perl5=$tdir/perl
- break;
- elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
- perl5=$tdir/perl5
- break;
- fi
- done
- ;;
-*) perl5="$perl5"
+: check for length of double
+echo " "
+case "$doublesize" in
+'')
+ echo "Checking to see how big your double precision numbers are..." >&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(double));
+ exit(0);
+}
+EOCP
+ set try
+ if eval $compile_ok; then
+ doublesize=`$run ./try`
+ echo "Your double is $doublesize bytes long."
+ else
+ dflt='8'
+ echo "(I can't seem to compile the test program. Guessing...)"
+ rp="What is the size of a double precision number (in bytes)?"
+ . ./myread
+ doublesize="$ans"
+ fi
;;
esac
-case "$perl5" in
-'') echo "None found. That's ok.";;
-*) echo "Using $perl5." ;;
-esac
-
-: Set the siteprefix variables
-$cat <<EOM
+$rm_try
-After $package is installed, you may wish to install various
-add-on modules and utilities. Typically, these add-ons will
-be installed under $prefix with the rest
-of this package. However, you may wish to install such add-ons
-elsewhere under a different prefix.
+: see if this is a float.h system
+set float.h i_float
+eval $inhdr
-If you do not wish to put everything under a single prefix, that's
-ok. You will be prompted for the individual locations; this siteprefix
-is only used to suggest the defaults.
+: check for long doubles
+echo " "
+echo "Checking to see if you have long double..." >&4
+echo 'int main() { long double x = 7.0; }' > try.c
+set try
+if eval $compile; then
+ val="$define"
+ echo "You have long double."
+else
+ val="$undef"
+ echo "You do not have long double."
+fi
+$rm_try
+set d_longdbl
+eval $setvar
-The default should be fine for most people.
+: see if ldexpl exists
+set ldexpl d_ldexpl
+eval $inlibc
-EOM
-fn=d~+
-rp='Installation prefix to use for add-on modules and utilities?'
-: XXX Here might be another good place for an installstyle setting.
-case "$siteprefix" in
-'') dflt=$prefix ;;
-*) dflt=$siteprefix ;;
-esac
-. ./getfile
-: XXX Prefixit unit does not yet support siteprefix and vendorprefix
-oldsiteprefix=''
-case "$siteprefix" in
-'') ;;
-*) case "$ans" in
- "$prefix") ;;
- *) oldsiteprefix="$prefix";;
- esac
- ;;
-esac
-siteprefix="$ans"
-siteprefixexp="$ansexp"
+: see if this is a quadmath.h system
+set quadmath.h i_quadmath
+eval $inhdr
-: determine where site specific libraries go.
-: Usual default is /usr/local/lib/perl5/site_perl/$version
-: The default "style" setting is made in installstyle.U
-: XXX No longer works with Prefixit stuff.
-prog=`echo $package | $sed 's/-*[0-9.]*$//'`
-case "$sitelib" in
-'') case "$installstyle" in
- *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
- *) dflt=$siteprefix/lib/site_$prog/$version ;;
- esac
- ;;
-*) dflt="$sitelib"
- ;;
-esac
-$cat <<EOM
-
-The installation process will create a directory for
-site-specific extensions and modules. Most users find it convenient
-to place all site-specific files in this directory rather than in the
-main distribution directory.
-
-EOM
-fn=d~+
-rp='Pathname for the site-specific library files?'
-. ./getfile
-prefixvar=sitelib
-. ./setprefixvar
-sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
-
-: Determine list of previous versions to include in @INC
-$cat > getverlist <<EOPL
-#!$perl5 -w
-use File::Basename;
-\$api_versionstring = "$api_versionstring";
-\$version = "$version";
-\$stem = "$sitelib_stem";
-\$archname = "$archname";
-EOPL
- $cat >> getverlist <<'EOPL'
-# The list found is store twice for each entry: the original name, and
-# the binary broken down version as pack "sss", so sorting is easy and
-# unambiguous. This will work for all versions that have a maximum of
-# three digit groups, separate by '.'s or '_'s. Names are extended with
-# ".0.0" to ensure at least three elements for the pack.
-# -- H.Merijn Brand (m)'06 23-10-2006
-
-# Can't have leading @ because metaconfig interprets it as a command!
-;@inc_version_list=();
-# XXX Redo to do opendir/readdir?
-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 = ();
-}
-
-($pversion, $aversion, $vsn5005) = map {
- pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
-foreach $d (@candidates) {
- if ($d->[1] lt $pversion) {
- if ($d->[1] ge $aversion) {
- unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
- }
- elsif ($d->[1] ge $vsn5005) {
- unshift(@inc_version_list, grep { -d } $d->[0]);
- }
- }
- else {
- # Skip newer version. I.e. don't look in
- # 5.7.0 if we're installing 5.6.1.
- }
-}
-
-if (@inc_version_list) {
- print join(' ', @inc_version_list);
-}
-else {
- # Blank space to preserve value for next Configure run.
- print " ";
+: check for length of long double
+case "${d_longdbl}${longdblsize}" in
+$define)
+ echo " "
+ echo "Checking to see how big your long doubles are..." >&4
+ $cat >try.c <<'EOCP'
+#include <stdio.h>
+int main()
+{
+ printf("%d\n", sizeof(long double));
}
-EOPL
-chmod +x getverlist
-case "$inc_version_list" in
-'') if test -x "$perl5$exe_ext"; then
- dflt=`$perl5 getverlist`
+EOCP
+ set try
+ set try
+ if eval $compile; then
+ longdblsize=`$run ./try`
+ echo "Your long doubles are $longdblsize bytes long."
else
- dflt='none'
+ dflt='8'
+ echo " "
+ echo "(I can't seem to compile the test program. Guessing...)" >&4
+ rp="What is the size of a long double (in bytes)?"
+ . ./myread
+ longdblsize="$ans"
+ fi
+ if $test "X$doublesize" = "X$longdblsize"; then
+ echo "That isn't any different from an ordinary double."
+ echo "I'll keep your setting anyway, but you may see some"
+ echo "harmless compilation warnings."
fi
- ;;
-$undef) dflt='none' ;;
-*) eval dflt=\"$inc_version_list\" ;;
-esac
-case "$dflt" in
-''|' ') dflt=none ;;
-esac
-case "$dflt" in
-5.005) dflt=none ;;
-esac
-$cat <<EOM
-
-In order to ease the process of upgrading, this version of perl
-can be configured to use modules built and installed with earlier
-versions of perl that were installed under $prefix. Specify here
-the list of earlier versions that this version of perl should check.
-If Configure detected no earlier versions of perl installed under
-$prefix, then the list will be empty. Answer 'none' to tell perl
-to not search earlier versions.
-
-The default should almost always be sensible, so if you're not sure,
-just accept the default.
-EOM
-
-rp='List of earlier versions to include in @INC?'
-. ./myread
-case "$ans" in
-[Nn]one|''|' '|$undef) inc_version_list=' ' ;;
-*) inc_version_list="$ans" ;;
-esac
-case "$inc_version_list" in
-''|' ')
- inc_version_list_init='0'
- d_inc_version_list="$undef"
- ;;
-*) inc_version_list_init=`echo $inc_version_list |
- $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
- d_inc_version_list="$define"
;;
esac
-$rm -f getverlist
-
-: see if malloc/malloc.h has to be included
-set malloc/malloc.h i_mallocmalloc
-eval $inhdr
+$rm_try
-: see if this is a malloc.h system
-: we want a real compile instead of Inhdr because some systems have a
-: malloc.h that just gives a compile error saying to use stdlib.h instead
-echo " "
-$cat >try.c <<EOCP
+$echo "Checking the kind of long doubles you have..." >&4
+case "$d_longdbl" in
+define)
+$cat <<EOP >try.c
+#$i_float I_FLOAT
+#$i_stdlib I_STDLIB
+#define LONGDBLSIZE $longdblsize
+#ifdef I_FLOAT
+#include <float.h>
+#endif
+#ifdef I_STDLIB
#include <stdlib.h>
-#include <malloc.h>
-#$i_mallocmalloc I_MALLOCMALLOC
-#ifdef I_MALLOCMALLOC
-# include <malloc/malloc.h>
#endif
-
-int main () { return 0; }
-EOCP
+#$usequadmath USE_QUADMATH
+#$i_quadmath I_QUADMATH
+#if defined(USE_QUADMATH) && defined(I_QUADMATH)
+#include <quadmath.h>
+static const __float128 d = -0.1Q;
+#else
+static const long double d = -0.1L;
+#endif
+#include <stdio.h>
+int main() {
+ unsigned const char* b = (unsigned const char*)(&d);
+#if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
+ if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
+ /* IEEE 754 128-bit little-endian */
+ printf("1\n");
+ exit(0);
+ }
+ if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
+ /* IEEE 128-bit big-endian, e.g. solaris sparc */
+ printf("2\n");
+ exit(0);
+ }
+#endif
+#if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
+ if (b[0] == 0xCD && b[9] == 0xBF && b[10] == 0x00) {
+ /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
+ * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
+ * Also known as "extended precision". */
+ printf("3\n");
+ exit(0);
+ }
+ if (b[0] == 0xBF && b[9] == 0xCD && b[10] == 0x00) {
+ /* is there ever big-endian 80-bit, really? */
+ printf("4\n");
+ exit(0);
+ }
+#endif
+#if LDBL_MANT_DIG == 106 && LONGDBLSIZE == 16
+ /* software "double double", the 106 is 53+53 */
+ if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
+ /* double double 128-bit little-endian,
+ * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
+ printf("5\n");
+ exit(0);
+ }
+ if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
+ /* double double 128-bit big-endian, e.g. PPC/Power and MIPS:
+ * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
+ printf("6\n");
+ exit(0);
+ }
+#endif
+ printf("-1\n"); /* unknown */
+ exit(0);
+}
+EOP
set try
if eval $compile; then
- echo "<malloc.h> found." >&4
- val="$define"
+ longdblkind=`$run ./try`
else
- echo "<malloc.h> NOT found." >&4
- val="$undef"
+ longdblkind=-1
fi
+;;
+*) longdblkind=0 ;;
+esac
+case "$longdblkind" in
+0) echo "Your long doubles are doubles." >&4 ;;
+1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
+2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
+3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
+*) echo "Cannot figure out your long double." >&4 ;;
+esac
$rm_try
-set i_malloc
-eval $setvar
-: check for length of pointer
+
+: determine the architecture name
echo " "
-case "$ptrsize" in
-'')
- echo "Checking to see how big your pointers are..." >&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(void *));
- exit(0);
-}
-EOCP
- set try
- if eval $compile_ok; then
- ptrsize=`$run ./try`
- echo "Your pointers are $ptrsize bytes long."
+if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
+ tarch=`arch`"-$osname"
+elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
+ if uname -m > tmparch 2>&1 ; then
+ tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
+ -e 's/$/'"-$osname/" tmparch`
else
- dflt='4'
- echo "(I can't seem to compile the test program. Guessing...)" >&4
- rp="What is the size of a pointer (in bytes)?"
- . ./myread
- ptrsize="$ans"
+ tarch="$osname"
fi
+ $rm -f tmparch
+else
+ tarch="$osname"
+fi
+case "$myarchname" in
+''|"$tarch") ;;
+*)
+ echo "(Your architecture name used to be $myarchname.)"
+ archname=''
;;
esac
-$rm_try
-case "$use64bitall" in
-"$define"|true|[yY]*)
- case "$ptrsize" in
- 4) cat <<EOM >&4
-
-*** You have chosen a maximally 64-bit build,
-*** but your pointers are only 4 bytes wide.
-*** Please rerun Configure without -Duse64bitall.
-EOM
- case "$d_quad" in
- define)
- cat <<EOM >&4
-*** Since you have quads, you could possibly try with -Duse64bitint.
-EOM
- ;;
- esac
- cat <<EOM >&4
-*** Cannot continue, aborting.
-
-EOM
-
- exit 1
- ;;
- esac
- ;;
+case "$targetarch" in
+'') ;;
+*) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
esac
+myarchname="$tarch"
+case "$archname" in
+'') dflt="$tarch";;
+*) dflt="$archname";;
+esac
+rp='What is your architecture name'
+. ./myread
+archname="$ans"
-
-: determine whether to use malloc wrapping
-echo " "
-case "$usemallocwrap" in
-[yY]*|true|$define) dflt='y' ;;
-[nN]*|false|$undef) dflt='n' ;;
-*) case "$usedevel" in
- [yY]*|true|$define) dflt='y' ;;
- *) dflt='n' ;;
- esac
- ;;
+: optionally add API version to the architecture for versioned archlibs
+case "$useversionedarchname" in
+$define|true|[yY]*) dflt='y';;
+*) dflt='n';;
esac
-rp="Do you wish to wrap malloc calls to protect against potential overflows?"
+rp='Add the Perl API version to your archname?'
. ./myread
-usemallocwrap="$ans"
case "$ans" in
-y*|true)
- usemallocwrap="$define" ;;
-*)
- usemallocwrap="$undef" ;;
+y|Y) useversionedarchname="$define" ;;
+*) useversionedarchname="$undef" ;;
+esac
+case "$useversionedarchname" in
+$define)
+ case "$archname" in
+ *-$api_versionstring)
+ echo "...and architecture name already has -$api_versionstring" >&4
+ ;;
+ *)
+ archname="$archname-$api_versionstring"
+ echo "...setting architecture name to $archname." >&4
+ ;;
+ esac
+ ;;
esac
-: determine which malloc to compile in
-echo " "
-case "$usemymalloc" in
-[yY]*|true|$define) dflt='y' ;;
-[nN]*|false|$undef) dflt='n' ;;
-*) case "$ptrsize" in
- 4) dflt='y' ;;
- *) dflt='n' ;;
- esac
- if test "$useithreads" = "$define"; then dflt='n'; fi
+case "$usethreads" in
+$define)
+ echo "Threads selected." >&4
+ case "$archname" in
+ *-thread*) echo "...and architecture name already has -thread." >&4
+ ;;
+ *) archname="$archname-thread"
+ echo "...setting architecture name to $archname." >&4
+ ;;
+ esac
;;
esac
-rp="Do you wish to attempt to use the malloc that comes with $package?"
-. ./myread
-usemymalloc="$ans"
-case "$ans" in
-y*|true)
- usemymalloc='y'
- mallocsrc='malloc.c'
- mallocobj="malloc$_o"
- d_mymalloc="$define"
- case "$libs" in
- *-lmalloc*)
- : Remove malloc from list of libraries to use
- echo "Removing unneeded -lmalloc from library list" >&4
- set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
- shift
- libs="$*"
- echo "libs = $libs" >&4
+case "$usemultiplicity" in
+$define)
+ echo "Multiplicity selected." >&4
+ case "$archname" in
+ *-multi*) echo "...and architecture name already has -multi." >&4
+ ;;
+ *) archname="$archname-multi"
+ echo "...setting architecture name to $archname." >&4
+ ;;
+ esac
+ ;;
+esac
+case "$use64bitint$use64bitall" in
+*"$define"*)
+ case "$archname64" in
+ '')
+ echo "This architecture is naturally 64-bit, not changing architecture name." >&4
+ ;;
+ *)
+ case "$use64bitint" in
+ "$define") echo "64 bit integers selected." >&4 ;;
+ esac
+ case "$use64bitall" in
+ "$define") echo "Maximal 64 bitness selected." >&4 ;;
+ esac
+ case "$archname" in
+ *-$archname64*) echo "...and architecture name already has $archname64." >&4
+ ;;
+ *) archname="$archname-$archname64"
+ echo "...setting architecture name to $archname." >&4
+ ;;
+ esac
+ ;;
+ esac
+esac
+case "$uselongdouble" in
+$define)
+ echo "Long doubles selected." >&4
+ case "$longdblsize" in
+ $doublesize)
+ echo "...but long doubles are equal to doubles, not changing architecture name." >&4
+ ;;
+ *)
+ case "$archname" in
+ *-ld*) echo "...and architecture name already has -ld." >&4
+ ;;
+ *) archname="$archname-ld"
+ echo "...setting architecture name to $archname." >&4
+ ;;
+ esac
;;
esac
;;
+esac
+if $test -f archname.cbu; then
+ echo "Your platform has some specific hints for architecture name, using them..."
+ . ./archname.cbu
+fi
+
+: set the prefixit variable, to compute a suitable default value
+prefixit='case "$3" in
+""|none)
+ case "$oldprefix" in
+ "") eval "$1=\"\$$2\"";;
+ *)
+ case "$3" in
+ "") eval "$1=";;
+ none)
+ eval "tp=\"\$$2\"";
+ case "$tp" in
+ ""|" ") eval "$1=\"\$$2\"";;
+ *) eval "$1=";;
+ esac;;
+ esac;;
+ esac;;
*)
- usemymalloc='n'
- mallocsrc=''
- mallocobj=''
- d_mymalloc="$undef"
+ eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
+ case "$tp" in
+ --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
+ /*-$oldprefix/*|\~*-$oldprefix/*)
+ eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
+ *) eval "$1=\"\$$2\"";;
+ esac;;
+esac'
+
+: determine installation style
+: For now, try to deduce it from prefix unless it is already set.
+: Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
+case "$installstyle" in
+'') case "$prefix" in
+ *perl*) dflt='lib';;
+ *) dflt='lib/perl5' ;;
+ esac
;;
+*) dflt="$installstyle" ;;
esac
+: Probably not worth prompting for this since we prompt for all
+: the directories individually, and the prompt would be too long and
+: confusing anyway.
+installstyle=$dflt
-: compute the return types of malloc and free
+: determine where public executables go
echo " "
-$cat >malloc.c <<END
-#$i_malloc I_MALLOC
-#$i_stdlib I_STDLIB
-#include <stdio.h>
-#include <sys/types.h>
-#ifdef I_MALLOC
-#include <malloc.h>
-#endif
-#ifdef I_STDLIB
-#include <stdlib.h>
-#endif
-#ifdef TRY_MALLOC
-void *malloc();
-#endif
-#ifdef TRY_FREE
-void free();
-#endif
-END
-case "$malloctype" in
-'')
- if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
- malloctype='void *'
- else
- malloctype='char *'
- fi
- ;;
+set dflt bin bin
+eval $prefixit
+fn=d~
+rp='Pathname where the public executables will reside?'
+. ./getfile
+if $test "X$ansexp" != "X$binexp"; then
+ installbin=''
+fi
+prefixvar=bin
+: XXX Bug? -- ignores Configure -Dinstallprefix setting.
+: XXX If this is fixed, also fix the "start perl" hunk below, which relies on
+: this via initialinstalllocation
+. ./setprefixvar
+
+case "$userelocatableinc" in
+$define|true|[yY]*) dflt='y' ;;
+*) dflt='n' ;;
esac
-echo "Your system wants malloc to return '$malloctype', it would seem." >&4
+cat <<EOM
-case "$freetype" in
-'')
- if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
- freetype='void'
- else
- freetype='int'
- fi
- ;;
+Would you like to build Perl so that the installation is relocatable, so that
+library paths in @INC are determined relative to the path of the perl binary?
+This is not advised for system Perl installs, or if you need to run setid
+scripts or scripts under taint mode.
+
+If this doesn't make any sense to you, just accept the default '$dflt'.
+EOM
+rp='Use relocatable @INC?'
+. ./myread
+case "$ans" in
+y|Y) val="$define" ;;
+*) val="$undef" ;;
esac
-echo "Your system uses $freetype free(), it would seem." >&4
-$rm -f malloc.[co]
-: determine where site specific architecture-dependent libraries go.
-: sitelib default is /usr/local/lib/perl5/site_perl/$version
-: sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
-: sitelib may have an optional trailing /share.
-case "$sitearch" in
-'') dflt=`echo $sitelib | $sed 's,/share$,,'`
- dflt="$dflt/$archname"
- ;;
-*) dflt="$sitearch"
- ;;
+set userelocatableinc
+eval $setvar
+
+initialinstalllocation="$binexp"
+: Default prefix is now "up one level from where the binaries are"
+case "$userelocatableinc" in
+$define|true|[yY]*)
+ bin=".../"
+ binexp=".../"
+ prefix=".../.."
+ prefixexp=".../.."
+ installprefixexp=".../.."
+ ;;
+esac
+
+: determine where private library files go
+: Usual default is /usr/local/lib/perl5/$version.
+: Also allow things like /opt/perl/lib/$version, since
+: /opt/perl/lib/perl5... would be redundant.
+: The default "style" setting is made in installstyle.U
+case "$installstyle" in
+*lib/perl5*) set dflt privlib lib/$package/$version ;;
+*) set dflt privlib lib/$version ;;
esac
-set sitearch sitearch none
eval $prefixit
$cat <<EOM
-The installation process will also create a directory for
-architecture-dependent site-specific extensions and modules.
+There are some auxiliary files for $package that need to be put into a
+private library directory that is accessible by everyone.
EOM
+fn=$binexp
fn=d~+
-rp='Pathname for the site-specific architecture-dependent library files?'
+rp='Pathname where the private library files will reside?'
. ./getfile
-prefixvar=sitearch
+prefixvar=privlib
. ./setprefixvar
-if $test X"$sitearch" = X"$sitelib"; then
- d_sitearch="$undef"
+
+: set the prefixup variable, to restore leading tilda escape
+prefixup='case "$prefixexp" in
+"$prefix") ;;
+*) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
+esac'
+
+: determine where public architecture dependent libraries go
+set archlib archlib
+eval $prefixit
+: privlib default is /usr/local/lib/$package/$version
+: archlib default is /usr/local/lib/$package/$version/$archname
+: privlib may have an optional trailing /share.
+tdflt=`echo $privlib | $sed 's,/share$,,'`
+tdflt=$tdflt/$archname
+case "$archlib" in
+'') dflt=$tdflt
+ ;;
+*) dflt="$archlib"
+ ;;
+esac
+$cat <<EOM
+
+$spackage contains architecture-dependent library files. If you are
+sharing libraries in a heterogeneous environment, you might store
+these files in a separate location. Otherwise, you can just include
+them with the rest of the public library files.
+
+EOM
+fn=$binexp
+fn=d+~
+rp='Where do you want to put the public architecture-dependent libraries?'
+. ./getfile
+prefixvar=archlib
+. ./setprefixvar
+if $test X"$archlib" = X"$privlib"; then
+ d_archlib="$undef"
else
- d_sitearch="$define"
+ d_archlib="$define"
fi
-: Set the vendorprefix variables
+: see if setuid scripts can be secure
$cat <<EOM
-The installation process will also create a directory for
-vendor-supplied add-ons. Vendors who supply perl with their system
-may find it convenient to place all vendor-supplied files in this
-directory rather than in the main distribution directory. This will
-ease upgrades between binary-compatible maintenance versions of perl.
+Some kernels have a bug that prevents setuid #! scripts from being
+secure. Some sites have disabled setuid #! scripts because of this.
-Of course you may also use these directories in whatever way you see
-fit. For example, you might use them to access modules shared over a
-company-wide network.
+First let's decide if your kernel supports secure setuid #! scripts.
+(If setuid #! scripts would be secure but have been disabled anyway,
+don't say that they are secure if asked.)
-The default answer should be fine for most people.
-This causes further questions about vendor add-ons to be skipped
-and no vendor-specific directories will be configured for perl.
+EOM
+
+val="$undef"
+if $test -d /dev/fd; then
+ echo "#!$ls" >reflect
+ chmod +x,u+s reflect
+ ./reflect >flect 2>&1
+ if $contains "/dev/fd" flect >/dev/null; then
+ echo "Congratulations, your kernel has secure setuid scripts!" >&4
+ val="$define"
+ else
+ $cat <<EOM
+If you are not sure if they are secure, I can check but I'll need a
+username and password different from the one you are using right now.
+If you don't have such a username or don't want me to test, simply
+enter 'none'.
EOM
-rp='Do you want to configure vendor-specific add-on directories?'
-case "$usevendorprefix" in
-define|true|[yY]*) dflt=y ;;
-*) : User may have set vendorprefix directly on Configure command line.
- case "$vendorprefix" in
- ''|' ') dflt=n ;;
- *) dflt=y ;;
- esac
+ rp='Other username to test security of setuid scripts with?'
+ dflt='none'
+ . ./myread
+ case "$ans" in
+ n|none)
+ case "$d_suidsafe" in
+ '') echo "I'll assume setuid scripts are *not* secure." >&4
+ dflt=n;;
+ "$undef")
+ echo "Well, the $hint value is *not* secure." >&4
+ dflt=n;;
+ *) echo "Well, the $hint value *is* secure." >&4
+ dflt=y;;
+ esac
+ ;;
+ *)
+ $rm -f reflect flect
+ echo "#!$ls" >reflect
+ chmod +x,u+s reflect
+ echo >flect
+ chmod a+w flect
+ echo '"su" will (probably) prompt you for '"$ans's password."
+ su $ans -c './reflect >flect'
+ if $contains "/dev/fd" flect >/dev/null; then
+ echo "Okay, it looks like setuid scripts are secure." >&4
+ dflt=y
+ else
+ echo "I don't think setuid scripts are secure." >&4
+ dflt=n
+ fi
+ ;;
+ esac
+ rp='Does your kernel have *secure* setuid scripts?'
+ . ./myread
+ case "$ans" in
+ [yY]*) val="$define";;
+ *) val="$undef";;
+ esac
+ fi
+else
+ echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
+ echo "(That's for file descriptors, not floppy disks.)"
+ val="$undef"
+fi
+set d_suidsafe
+eval $setvar
+
+$rm -f reflect flect
+
+: now see if they want to do setuid emulation
+if $test $patchlevel -lt 11; then
+echo " "
+val="$undef"
+case "$d_suidsafe" in
+"$define")
+ val="$undef"
+ echo "No need to emulate SUID scripts since they are secure here." >&4
;;
-esac
-. ./myread
-case "$ans" in
-[yY]*) fn=d~+
- rp='Installation prefix to use for vendor-supplied add-ons?'
- case "$vendorprefix" in
- '') dflt="$prefix" ;;
- *) dflt=$vendorprefix ;;
+*)
+ $cat <<EOM
+Some systems have disabled setuid scripts, especially systems where
+setuid scripts cannot be secure. On systems where setuid scripts have
+been disabled, the setuid/setgid bits on scripts are currently
+useless. It is possible for $package to detect those bits and emulate
+setuid/setgid in a secure fashion. This emulation will only work if
+setuid scripts have been disabled in your kernel.
+
+EOM
+ case "$d_dosuid" in
+ "$define") dflt=y ;;
+ *) dflt=n ;;
esac
- . ./getfile
- : XXX Prefixit unit does not yet support siteprefix and vendorprefix
- oldvendorprefix=''
- case "$vendorprefix" in
- '') ;;
- *) case "$ans" in
- "$prefix") ;;
- *) oldvendorprefix="$prefix";;
- esac
- ;;
+ rp="Do you want to do setuid/setgid emulation?"
+ . ./myread
+ case "$ans" in
+ [yY]*) val="$define";;
+ *) val="$undef";;
esac
- usevendorprefix="$define"
- vendorprefix="$ans"
- vendorprefixexp="$ansexp"
- ;;
-*) usevendorprefix="$undef"
- vendorprefix=''
- vendorprefixexp=''
;;
esac
+set d_dosuid
+eval $setvar
+else
+ case "$d_dosuid" in
+ "$define")
+ cat >&4 <<EOH
-: Set the vendorlib variables
-case "$vendorprefix" in
-'') d_vendorlib="$undef"
- vendorlib=''
- vendorlibexp=''
+SUID emulation has been removed for 5.12
+Please re-run Configure without -Dd_dosuid
+
+EOH
+ exit 1;
;;
-*) d_vendorlib="$define"
- : determine where vendor-supplied modules go.
- : Usual default is /usr/local/lib/perl5/vendor_perl/$version
- case "$vendorlib" in
- '')
- prog=`echo $package | $sed 's/-*[0-9.]*$//'`
- case "$installstyle" in
- *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
- *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
- esac
- ;;
- *) dflt="$vendorlib"
- ;;
- esac
- fn=d~+
- rp='Pathname for the vendor-supplied library files?'
- . ./getfile
- vendorlib="$ans"
- vendorlibexp="$ansexp"
+ esac
+ d_dosuid=undef
+fi
+
+: Find perl5.005 or later.
+echo "Looking for a previously installed perl5.005 or later... "
+case "$perl5" in
+'') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
+ : Check if this perl is recent and can load a simple module
+ if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
+ perl5=$tdir/perl
+ break;
+ elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
+ perl5=$tdir/perl5
+ break;
+ fi
+ done
+ ;;
+*) perl5="$perl5"
;;
esac
-vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
-prefixvar=vendorlib
-. ./installprefix
+case "$perl5" in
+'') echo "None found. That's ok.";;
+*) echo "Using $perl5." ;;
+esac
-: Set the vendorarch variables
-case "$vendorprefix" in
-'') d_vendorarch="$undef"
- vendorarch=''
- vendorarchexp=''
- ;;
-*) d_vendorarch="$define"
- : determine where vendor-supplied architecture-dependent libraries go.
- : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
- : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
- : vendorlib may have an optional trailing /share.
- case "$vendorarch" in
- '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
- dflt="$dflt/$archname"
- ;;
- *) dflt="$vendorarch" ;;
+: Set the siteprefix variables
+$cat <<EOM
+
+After $package is installed, you may wish to install various
+add-on modules and utilities. Typically, these add-ons will
+be installed under $prefix with the rest
+of this package. However, you may wish to install such add-ons
+elsewhere under a different prefix.
+
+If you do not wish to put everything under a single prefix, that's
+ok. You will be prompted for the individual locations; this siteprefix
+is only used to suggest the defaults.
+
+The default should be fine for most people.
+
+EOM
+fn=d~+
+rp='Installation prefix to use for add-on modules and utilities?'
+: XXX Here might be another good place for an installstyle setting.
+case "$siteprefix" in
+'') dflt=$prefix ;;
+*) dflt=$siteprefix ;;
+esac
+. ./getfile
+: XXX Prefixit unit does not yet support siteprefix and vendorprefix
+oldsiteprefix=''
+case "$siteprefix" in
+'') ;;
+*) case "$ans" in
+ "$prefix") ;;
+ *) oldsiteprefix="$prefix";;
esac
- fn=d~+
- rp='Pathname for vendor-supplied architecture-dependent files?'
- . ./getfile
- vendorarch="$ans"
- vendorarchexp="$ansexp"
;;
esac
-prefixvar=vendorarch
-. ./installprefix
-if $test X"$vendorarch" = X"$vendorlib"; then
- d_vendorarch="$undef"
-else
- d_vendorarch="$define"
-fi
+siteprefix="$ans"
+siteprefixexp="$ansexp"
-: Final catch-all directories to search
+: determine where site specific libraries go.
+: Usual default is /usr/local/lib/perl5/site_perl/$version
+: The default "style" setting is made in installstyle.U
+: XXX No longer works with Prefixit stuff.
+prog=`echo $package | $sed 's/-*[0-9.]*$//'`
+case "$sitelib" in
+'') case "$installstyle" in
+ *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
+ *) dflt=$siteprefix/lib/site_$prog/$version ;;
+ esac
+ ;;
+*) dflt="$sitelib"
+ ;;
+esac
$cat <<EOM
-Lastly, you can have perl look in other directories for extensions and
-modules in addition to those already specified.
-These directories will be searched after
- $sitearch
- $sitelib
+The installation process will create a directory for
+site-specific extensions and modules. Most users find it convenient
+to place all site-specific files in this directory rather than in the
+main distribution directory.
+
EOM
-test X"$vendorlib" != "X" && echo ' ' $vendorlib
-test X"$vendorarch" != "X" && echo ' ' $vendorarch
-echo ' '
-case "$otherlibdirs" in
-''|' ') dflt='none' ;;
-*) dflt="$otherlibdirs" ;;
+fn=d~+
+rp='Pathname for the site-specific library files?'
+. ./getfile
+prefixvar=sitelib
+. ./setprefixvar
+sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
+
+: Determine list of previous versions to include in @INC
+$cat > getverlist <<EOPL
+#!$perl5 -w
+use File::Basename;
+\$api_versionstring = "$api_versionstring";
+\$version = "$version";
+\$stem = "$sitelib_stem";
+\$archname = "$archname";
+EOPL
+ $cat >> getverlist <<'EOPL'
+# The list found is store twice for each entry: the original name, and
+# the binary broken down version as pack "sss", so sorting is easy and
+# unambiguous. This will work for all versions that have a maximum of
+# three digit groups, separate by '.'s or '_'s. Names are extended with
+# ".0.0" to ensure at least three elements for the pack.
+# -- H.Merijn Brand (m)'06 23-10-2006
+
+# Can't have leading @ because metaconfig interprets it as a command!
+;@inc_version_list=();
+# XXX Redo to do opendir/readdir?
+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 = ();
+}
+
+($pversion, $aversion, $vsn5005) = map {
+ pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
+foreach $d (@candidates) {
+ if ($d->[1] lt $pversion) {
+ if ($d->[1] ge $aversion) {
+ unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
+ }
+ elsif ($d->[1] ge $vsn5005) {
+ unshift(@inc_version_list, grep { -d } $d->[0]);
+ }
+ }
+ else {
+ # Skip newer version. I.e. don't look in
+ # 5.7.0 if we're installing 5.6.1.
+ }
+}
+
+if (@inc_version_list) {
+ print join(' ', @inc_version_list);
+}
+else {
+ # Blank space to preserve value for next Configure run.
+ print " ";
+}
+EOPL
+chmod +x getverlist
+case "$inc_version_list" in
+'') if test -x "$perl5$exe_ext"; then
+ dflt=`$perl5 getverlist`
+ else
+ dflt='none'
+ fi
+ ;;
+$undef) dflt='none' ;;
+*) eval dflt=\"$inc_version_list\" ;;
+esac
+case "$dflt" in
+''|' ') dflt=none ;;
+esac
+case "$dflt" in
+5.005) dflt=none ;;
esac
$cat <<EOM
-Enter a colon-separated set of extra paths to include in perl's @INC
-search path, or enter 'none' for no extra paths.
+In order to ease the process of upgrading, this version of perl
+can be configured to use modules built and installed with earlier
+versions of perl that were installed under $prefix. Specify here
+the list of earlier versions that this version of perl should check.
+If Configure detected no earlier versions of perl installed under
+$prefix, then the list will be empty. Answer 'none' to tell perl
+to not search earlier versions.
+
+The default should almost always be sensible, so if you're not sure,
+just accept the default.
EOM
-rp='Colon-separated list of additional directories for perl to search?'
+rp='List of earlier versions to include in @INC?'
. ./myread
case "$ans" in
-' '|''|none) otherlibdirs=' ' ;;
-*) otherlibdirs="$ans" ;;
+[Nn]one|''|' '|$undef) inc_version_list=' ' ;;
+*) inc_version_list="$ans" ;;
esac
-case "$otherlibdirs" in
-' ') val=$undef ;;
-*) val=$define ;;
+case "$inc_version_list" in
+''|' ')
+ inc_version_list_init='0'
+ d_inc_version_list="$undef"
+ ;;
+*) inc_version_list_init=`echo $inc_version_list |
+ $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
+ d_inc_version_list="$define"
+ ;;
esac
-set d_perl_otherlibdirs
-eval $setvar
+$rm -f getverlist
-: Cruising for prototypes
-echo " "
-echo "Checking out function prototypes..." >&4
-$cat >prototype.c <<EOCP
-#$i_stdlib I_STDLIB
-#ifdef I_STDLIB
+: see if malloc/malloc.h has to be included
+set malloc/malloc.h i_mallocmalloc
+eval $inhdr
+
+: see if this is a malloc.h system
+: we want a real compile instead of Inhdr because some systems have a
+: malloc.h that just gives a compile error saying to use stdlib.h instead
+echo " "
+$cat >try.c <<EOCP
#include <stdlib.h>
+#include <malloc.h>
+#$i_mallocmalloc I_MALLOCMALLOC
+#ifdef I_MALLOCMALLOC
+# include <malloc/malloc.h>
#endif
-int main(int argc, char *argv[]) {
- exit(0);}
+
+int main () { return 0; }
EOCP
-if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
- echo "Your C compiler appears to support function prototypes."
- val="$define"
+set try
+if eval $compile; then
+ echo "<malloc.h> found." >&4
+ val="$define"
else
- echo "Your C compiler doesn't seem to understand function prototypes."
- val="$undef"
+ echo "<malloc.h> NOT found." >&4
+ val="$undef"
fi
-set prototype
+$rm_try
+set i_malloc
eval $setvar
-$rm -f prototype*
-
-: Check if ansi2knr is required
-case "$prototype" in
-"$define") ;;
-*) ansi2knr='ansi2knr'
- echo " "
- cat <<EOM >&4
-
-$me: FATAL ERROR:
-This version of $package can only be compiled by a compiler that
-understands function prototypes. Unfortunately, your C compiler
- $cc $ccflags
-doesn't seem to understand them. Sorry about that.
-
-If GNU cc is available for your system, perhaps you could try that instead.
-
-Eventually, we hope to support building Perl with pre-ANSI compilers.
-If you would like to help in that effort, please contact <perlbug@perl.org>.
-Aborting Configure now.
-EOM
- exit 2
+: check for length of pointer
+echo " "
+case "$ptrsize" in
+'')
+ echo "Checking to see how big your pointers are..." >&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(void *));
+ exit(0);
+}
+EOCP
+ set try
+ if eval $compile_ok; then
+ ptrsize=`$run ./try`
+ echo "Your pointers are $ptrsize bytes long."
+ else
+ dflt='4'
+ echo "(I can't seem to compile the test program. Guessing...)" >&4
+ rp="What is the size of a pointer (in bytes)?"
+ . ./myread
+ ptrsize="$ans"
+ fi
;;
esac
+$rm_try
+case "$use64bitall" in
+"$define"|true|[yY]*)
+ case "$ptrsize" in
+ 4) cat <<EOM >&4
-: 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.
-DTrace is a diagnosis and performance analysis tool from Sun.
-
-If this doesn't make any sense to you, just accept the default '$dflt'.
+*** You have chosen a maximally 64-bit build,
+*** but your pointers are only 4 bytes wide.
+*** Please rerun Configure without -Duse64bitall.
EOM
-
-while $test 1 ; do
- case "$usedtrace" in
- $define|true|[yY]*)
- dflt='y'
- ;;
- ?*)
- dflt='y'
- dflt_dtrace=$usedtrace
- ;;
- *)
- dflt='n'
- ;;
- esac
-
- rp='Support DTrace if available?'
- . ./myread
- case "$ans" in
- y|Y) val="$define" ;;
- *) val="$undef" ;;
- esac
- set usedtrace
- eval $setvar
-
- test "X$usedtrace" != "X$define" && break
-
- echo " "
- rp='Where is the dtrace executable?'
- dflt=$dflt_dtrace
- . ./getfile
- val="$ans"
- set dtrace
- eval $setvar
-
- if $test -f $dtrace
- then
- if $dtrace -h -s ../perldtrace.d \
- -o perldtrace.tmp >/dev/null 2>&1 \
- && rm -f perldtrace.tmp
- then
- echo " "
- echo "Good: your $dtrace knows about the -h flag."
- else
- cat >&2 <<EOM
-
-*** $me: Fatal Error: $dtrace doesn't support -h flag
-***
-*** Your installed dtrace doesn't support the -h switch to compile a D
-*** program into a C header. Can't continue.
-
+ case "$d_quad" in
+ define)
+ cat <<EOM >&4
+*** Since you have quads, you could possibly try with -Duse64bitint.
EOM
- exit 1
- fi
- break;
- fi
-
- case "$fastread" in
- yes)
- cat >&2 <<EOM
-
-*** $me: Fatal Error: $dtrace not found.
-*** Can't continue.
+ ;;
+ esac
+ cat <<EOM >&4
+*** Cannot continue, aborting.
EOM
+
exit 1
;;
- *)
- echo "*** $dtrace was not found."
- echo " "
- ;;
esac
-done
-
-: See if we want extra modules installed
-echo " "
-case "$extras" in
-'') dflt='n';;
-*) dflt='y';;
+ ;;
esac
-cat <<EOM
-Perl can be built with extra modules or bundles of modules which
-will be fetched from the CPAN and installed alongside Perl.
-Notice that you will need access to the CPAN; either via the Internet,
-or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
-be asked later to configure the CPAN.pm module which will in turn do
-the installation of the rest of the extra modules or bundles.)
-
-Notice also that if the modules require any external software such as
-libraries and headers (the libz library and the zlib.h header for the
-Compress::Zlib module, for example) you MUST have any such software
-already installed, this configuration process will NOT install such
-things for you.
-If this doesn't make any sense to you, just accept the default '$dflt'.
-EOM
-rp='Install any extra modules (y or n)?'
+: determine whether to use malloc wrapping
+echo " "
+case "$usemallocwrap" in
+[yY]*|true|$define) dflt='y' ;;
+[nN]*|false|$undef) dflt='n' ;;
+*) case "$usedevel" in
+ [yY]*|true|$define) dflt='y' ;;
+ *) dflt='n' ;;
+ esac
+ ;;
+esac
+rp="Do you wish to wrap malloc calls to protect against potential overflows?"
. ./myread
+usemallocwrap="$ans"
case "$ans" in
-y|Y)
- cat <<EOM
-
-Please list any extra modules or bundles to be installed from CPAN,
-with spaces between the names. The names can be in any format the
-'install' command of CPAN.pm will understand. (Answer 'none',
-without the quotes, to install no extra modules or bundles.)
-EOM
- rp='Extras?'
- dflt="$extras"
- . ./myread
- extras="$ans"
+y*|true)
+ usemallocwrap="$define" ;;
+*)
+ usemallocwrap="$undef" ;;
esac
-case "$extras" in
-''|'none')
- val=''
- $rm -f ../extras.lst
- ;;
-*) echo "(Saving the list of extras for later...)"
- echo "$extras" > ../extras.lst
- val="'$extras'"
+
+: determine which malloc to compile in
+echo " "
+case "$usemymalloc" in
+[yY]*|true|$define) dflt='y' ;;
+[nN]*|false|$undef) dflt='n' ;;
+*) case "$ptrsize" in
+ 4) dflt='y' ;;
+ *) dflt='n' ;;
+ esac
+ if test "$useithreads" = "$define"; then dflt='n'; fi
;;
esac
-set extras
-eval $setvar
-echo " "
-
-: determine where html pages for programs go
-set html1dir html1dir none
-eval $prefixit
-$cat <<EOM
-
-If you wish to install html files for programs in $spackage, indicate
-the appropriate directory here. To skip installing html files,
-answer "none".
-EOM
-case "$html1dir" in
-''|none|$undef|' ') dflt=none ;;
-*) dflt=$html1dir ;;
+rp="Do you wish to attempt to use the malloc that comes with $package?"
+. ./myread
+usemymalloc="$ans"
+case "$ans" in
+y*|true)
+ usemymalloc='y'
+ mallocsrc='malloc.c'
+ mallocobj="malloc$_o"
+ d_mymalloc="$define"
+ case "$libs" in
+ *-lmalloc*)
+ : Remove malloc from list of libraries to use
+ echo "Removing unneeded -lmalloc from library list" >&4
+ set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
+ shift
+ libs="$*"
+ echo "libs = $libs" >&4
+ ;;
+ esac
+ ;;
+*)
+ usemymalloc='n'
+ mallocsrc=''
+ mallocobj=''
+ d_mymalloc="$undef"
+ ;;
esac
-fn=dn+~
-rp="Directory for the main $spackage html pages?"
-. ./getfile
-prefixvar=html1dir
-. ./setprefixvar
-: Use ' ' for none so value is preserved next time through Configure
-$test X"$html1dir" = "X" && html1dir=' '
-: determine where html pages for libraries and modules go
-set html3dir html3dir none
+: compute the return types of malloc and free
+echo " "
+$cat >malloc.c <<END
+#$i_malloc I_MALLOC
+#$i_stdlib I_STDLIB
+#include <stdio.h>
+#include <sys/types.h>
+#ifdef I_MALLOC
+#include <malloc.h>
+#endif
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+#ifdef TRY_MALLOC
+void *malloc();
+#endif
+#ifdef TRY_FREE
+void free();
+#endif
+END
+case "$malloctype" in
+'')
+ if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
+ malloctype='void *'
+ else
+ malloctype='char *'
+ fi
+ ;;
+esac
+echo "Your system wants malloc to return '$malloctype', it would seem." >&4
+
+case "$freetype" in
+'')
+ if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
+ freetype='void'
+ else
+ freetype='int'
+ fi
+ ;;
+esac
+echo "Your system uses $freetype free(), it would seem." >&4
+$rm -f malloc.[co]
+: determine where site specific architecture-dependent libraries go.
+: sitelib default is /usr/local/lib/perl5/site_perl/$version
+: sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
+: sitelib may have an optional trailing /share.
+case "$sitearch" in
+'') dflt=`echo $sitelib | $sed 's,/share$,,'`
+ dflt="$dflt/$archname"
+ ;;
+*) dflt="$sitearch"
+ ;;
+esac
+set sitearch sitearch none
eval $prefixit
$cat <<EOM
-If you wish to install html files for modules associated with $spackage,
-indicate the appropriate directory here. To skip installing html files,
-answer "none".
+The installation process will also create a directory for
+architecture-dependent site-specific extensions and modules.
+
EOM
-: There is no obvious default. If they have specified html1dir, then
-: try to key off that, possibly changing .../html1 into .../html3.
-case "$html3dir" in
-'') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
-*) dflt=$html3dir ;;
-esac
-fn=dn+~
-rp="Directory for the $spackage module html pages?"
+fn=d~+
+rp='Pathname for the site-specific architecture-dependent library files?'
. ./getfile
-prefixvar=html3dir
+prefixvar=sitearch
. ./setprefixvar
-: Use ' ' for none so value is preserved next time through Configure
-$test X"$html3dir" = "X" && html3dir=' '
-
-: determine whether to install perl also as /usr/bin/perl
-
-echo " "
-if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
- $cat <<EOM
-Many scripts expect perl to be installed as /usr/bin/perl.
+if $test X"$sitearch" = X"$sitelib"; then
+ d_sitearch="$undef"
+else
+ d_sitearch="$define"
+fi
-If you want to, I can install the perl you are about to compile
-as /usr/bin/perl (in addition to $bin/perl).
-EOM
- if test -f /usr/bin/perl; then
- $cat <<EOM
+: Set the vendorprefix variables
+$cat <<EOM
-However, please note that because you already have a /usr/bin/perl,
-overwriting that with a new Perl would very probably cause problems.
-Therefore I'm assuming you don't want to do that (unless you insist).
+The installation process will also create a directory for
+vendor-supplied add-ons. Vendors who supply perl with their system
+may find it convenient to place all vendor-supplied files in this
+directory rather than in the main distribution directory. This will
+ease upgrades between binary-compatible maintenance versions of perl.
-EOM
- case "$installusrbinperl" in
- "$define"|[yY]*) dflt='y';;
- *) dflt='n';;
- esac
- else
- $cat <<EOM
+Of course you may also use these directories in whatever way you see
+fit. For example, you might use them to access modules shared over a
+company-wide network.
-Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
+The default answer should be fine for most people.
+This causes further questions about vendor add-ons to be skipped
+and no vendor-specific directories will be configured for perl.
EOM
- case "$installusrbinperl" in
- "$undef"|[nN]*) dflt='n';;
- *) dflt='y';;
- esac
- fi
- rp="Do you want to install perl as /usr/bin/perl?"
- . ./myread
- case "$ans" in
- [yY]*) val="$define";;
- *) val="$undef" ;;
+rp='Do you want to configure vendor-specific add-on directories?'
+case "$usevendorprefix" in
+define|true|[yY]*) dflt=y ;;
+*) : User may have set vendorprefix directly on Configure command line.
+ case "$vendorprefix" in
+ ''|' ') dflt=n ;;
+ *) dflt=y ;;
esac
-else
- val="$undef"
-fi
-set installusrbinperl
-eval $setvar
-
-: Check if we are using the GNU C library
-echo " "
-echo "Checking for GNU C Library..." >&4
-cat >try.c <<'EOCP'
-/* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
- alone are insufficient to distinguish different versions, such as
- 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
- libc version 2.1.0. A. Dougherty, June 3, 2002.
-*/
-#include <stdio.h>
-int main(void)
-{
-#ifdef __GLIBC__
-# ifdef __GLIBC_MINOR__
-# if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
-# include <gnu/libc-version.h>
- printf("%s\n", gnu_get_libc_version());
-# else
- printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
-# endif
-# else
- printf("%d\n", __GLIBC__);
-# endif
- return 0;
-#else
- return 1;
-#endif
-}
-EOCP
-set try
-if eval $compile_ok && $run ./try > glibc.ver; then
- val="$define"
- gnulibc_version=`$cat glibc.ver`
- echo "You are using the GNU C Library version $gnulibc_version"
-else
- val="$undef"
- gnulibc_version=''
- echo "You are not using the GNU C Library"
-fi
-$rm_try glibc.ver
-set d_gnulibc
-eval $setvar
-
-: see if nm is to be used to determine whether a symbol is defined or not
-case "$usenm" in
-'')
- dflt=''
- case "$d_gnulibc" in
- "$define")
- echo " "
- echo "nm probably won't work on the GNU C Library." >&4
- dflt=n
+ ;;
+esac
+. ./myread
+case "$ans" in
+[yY]*) fn=d~+
+ rp='Installation prefix to use for vendor-supplied add-ons?'
+ case "$vendorprefix" in
+ '') dflt="$prefix" ;;
+ *) dflt=$vendorprefix ;;
+ esac
+ . ./getfile
+ : XXX Prefixit unit does not yet support siteprefix and vendorprefix
+ oldvendorprefix=''
+ case "$vendorprefix" in
+ '') ;;
+ *) case "$ans" in
+ "$prefix") ;;
+ *) oldvendorprefix="$prefix";;
+ esac
;;
esac
- case "$dflt" in
- '')
- if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
- echo " "
- echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
- echo "'nm' won't be sufficient on this system." >&4
- dflt=n
- fi
+ usevendorprefix="$define"
+ vendorprefix="$ans"
+ vendorprefixexp="$ansexp"
+ ;;
+*) usevendorprefix="$undef"
+ vendorprefix=''
+ vendorprefixexp=''
+ ;;
+esac
+
+: Set the vendorlib variables
+case "$vendorprefix" in
+'') d_vendorlib="$undef"
+ vendorlib=''
+ vendorlibexp=''
+ ;;
+*) d_vendorlib="$define"
+ : determine where vendor-supplied modules go.
+ : Usual default is /usr/local/lib/perl5/vendor_perl/$version
+ case "$vendorlib" in
+ '')
+ prog=`echo $package | $sed 's/-*[0-9.]*$//'`
+ case "$installstyle" in
+ *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
+ *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
+ esac
;;
- esac
- case "$dflt" in
- '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
- if $test $dflt -gt 20; then
- dflt=y
- else
- dflt=n
- fi
+ *) dflt="$vendorlib"
;;
esac
+ fn=d~+
+ rp='Pathname for the vendor-supplied library files?'
+ . ./getfile
+ vendorlib="$ans"
+ vendorlibexp="$ansexp"
;;
-*)
- case "$usenm" in
- true|$define) dflt=y;;
- *) dflt=n;;
+esac
+vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
+prefixvar=vendorlib
+. ./installprefix
+
+: Set the vendorarch variables
+case "$vendorprefix" in
+'') d_vendorarch="$undef"
+ vendorarch=''
+ vendorarchexp=''
+ ;;
+*) d_vendorarch="$define"
+ : determine where vendor-supplied architecture-dependent libraries go.
+ : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
+ : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
+ : vendorlib may have an optional trailing /share.
+ case "$vendorarch" in
+ '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
+ dflt="$dflt/$archname"
+ ;;
+ *) dflt="$vendorarch" ;;
esac
+ fn=d~+
+ rp='Pathname for vendor-supplied architecture-dependent files?'
+ . ./getfile
+ vendorarch="$ans"
+ vendorarchexp="$ansexp"
;;
esac
-$cat <<EOM
+prefixvar=vendorarch
+. ./installprefix
+if $test X"$vendorarch" = X"$vendorlib"; then
+ d_vendorarch="$undef"
+else
+ d_vendorarch="$define"
+fi
-I can use $nm to extract the symbols from your C libraries. This
-is a time consuming task which may generate huge output on the disk (up
-to 3 megabytes) but that should make the symbols extraction faster. The
-alternative is to skip the 'nm' extraction part and to compile a small
-test program instead to determine whether each symbol is present. If
-you have a fast C compiler and/or if your 'nm' output cannot be parsed,
-this may be the best solution.
+: Final catch-all directories to search
+$cat <<EOM
-You probably shouldn't let me use 'nm' if you are using the GNU C Library.
+Lastly, you can have perl look in other directories for extensions and
+modules in addition to those already specified.
+These directories will be searched after
+ $sitearch
+ $sitelib
+EOM
+test X"$vendorlib" != "X" && echo ' ' $vendorlib
+test X"$vendorarch" != "X" && echo ' ' $vendorarch
+echo ' '
+case "$otherlibdirs" in
+''|' ') dflt='none' ;;
+*) dflt="$otherlibdirs" ;;
+esac
+$cat <<EOM
+Enter a colon-separated set of extra paths to include in perl's @INC
+search path, or enter 'none' for no extra paths.
EOM
-rp="Shall I use $nm to extract C symbols from the libraries?"
+
+rp='Colon-separated list of additional directories for perl to search?'
. ./myread
case "$ans" in
-[Nn]*) usenm=false;;
-*) usenm=true;;
+' '|''|none) otherlibdirs=' ' ;;
+*) otherlibdirs="$ans" ;;
esac
-
-runnm=$usenm
-case "$reuseval" in
-true) runnm=false;;
+case "$otherlibdirs" in
+' ') val=$undef ;;
+*) val=$define ;;
esac
+set d_perl_otherlibdirs
+eval $setvar
-: nm options which may be necessary
-case "$nm_opt" in
-'') if $test -f /mach_boot; then
- nm_opt='' # Mach
- elif $test -d /usr/ccs/lib; then
- nm_opt='-p' # Solaris (and SunOS?)
- elif $test -f /dgux; then
- nm_opt='-p' # DG-UX
- elif $test -f /lib64/rld; then
- nm_opt='-p' # 64-bit Irix
- else
- nm_opt=''
- fi;;
-esac
+: Cruising for prototypes
+echo " "
+echo "Checking out function prototypes..." >&4
+$cat >prototype.c <<EOCP
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+int main(int argc, char *argv[]) {
+ exit(0);}
+EOCP
+if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
+ echo "Your C compiler appears to support function prototypes."
+ val="$define"
+else
+ echo "Your C compiler doesn't seem to understand function prototypes."
+ val="$undef"
+fi
+set prototype
+eval $setvar
+$rm -f prototype*
-: nm options which may be necessary for shared libraries but illegal
-: for archive libraries. Thank you, Linux.
-case "$nm_so_opt" in
-'') case "$myuname" in
- *linux*|gnu*)
- if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
- nm_so_opt='--dynamic'
- fi
- ;;
- esac
- ;;
-esac
+: Check if ansi2knr is required
+case "$prototype" in
+"$define") ;;
+*) ansi2knr='ansi2knr'
+ echo " "
+ cat <<EOM >&4
-: Figure out where the libc is located
-case "$runnm" in
-true)
-: get list of predefined functions in a handy place
-echo " "
-case "$libc" in
-'') libc=unknown
- case "$libs" in
- *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
- esac
+$me: FATAL ERROR:
+This version of $package can only be compiled by a compiler that
+understands function prototypes. Unfortunately, your C compiler
+ $cc $ccflags
+doesn't seem to understand them. Sorry about that.
+
+If GNU cc is available for your system, perhaps you could try that instead.
+
+Eventually, we hope to support building Perl with pre-ANSI compilers.
+If you would like to help in that effort, please contact <perlbug@perl.org>.
+
+Aborting Configure now.
+EOM
+ exit 2
;;
esac
-case "$libs" in
-'') ;;
-*) for thislib in $libs; do
- case "$thislib" in
- -lc|-lc_s)
- : Handle C library specially below.
+
+: 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.
+DTrace is a diagnosis and performance analysis tool from Sun.
+
+If this doesn't make any sense to you, just accept the default '$dflt'.
+EOM
+
+while $test 1 ; do
+ case "$usedtrace" in
+ $define|true|[yY]*)
+ dflt='y'
;;
- -l*)
- thislib=`echo $thislib | $sed -e 's/^-l//'`
- if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
- :
- elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
- :
- elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
- :
- elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
- :
- elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
- :
- elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
- :
- elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
- :
- else
- try=''
- fi
- libnames="$libnames $try"
+ ?*)
+ dflt='y'
+ dflt_dtrace=$usedtrace
+ ;;
+ *)
+ dflt='n'
;;
- *) libnames="$libnames $thislib" ;;
esac
- done
- ;;
-esac
-xxx=normal
-case "$libc" in
-unknown)
- set /lib/libc.$so
- for xxx in $libpth; do
- $test -r $1 || set $xxx/libc.$so
- : The messy sed command sorts on library version numbers.
- $test -r $1 || \
- set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
- tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
- h
- s/[0-9][0-9]*/0000&/g
- s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
- G
- s/\n/ /' | \
- $sort | $sed -e 's/^.* //'`
- eval set \$$#
- done
- $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
- $test -r $1 || set $sysroot/lib/libsys_s$_a
- ;;
-*)
- set blurfl
- ;;
-esac
-if $test -r "$1"; then
- echo "Your (shared) C library seems to be in $1."
- libc="$1"
-elif $test -r /lib/libc && $test -r /lib/clib; then
- echo "Your C library seems to be in both /lib/clib and /lib/libc."
- xxx=apollo
- libc='/lib/clib /lib/libc'
- if $test -r /lib/syslib; then
- echo "(Your math library is in /lib/syslib.)"
- libc="$libc /lib/syslib"
- fi
-elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
- echo "Your C library seems to be in $libc, as you said before."
-elif $test -r $incpath/usr/lib/libc$_a; then
- libc=$incpath/usr/lib/libc$_a;
- echo "Your C library seems to be in $libc. That's fine."
-elif $test -r /lib/libc$_a; then
- libc=/lib/libc$_a;
- echo "Your C library seems to be in $libc. You're normal."
-else
- if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
- :
- elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
- libnames="$libnames "`./loc clib blurfl/dyick $libpth`
- elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
- :
- elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
- :
- elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
- :
- else
- tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
- fi
- if $test -r "$tans"; then
- echo "Your C library seems to be in $tans, of all places."
- libc=$tans
- else
- libc='blurfl'
- fi
-fi
-if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
- dflt="$libc"
- cat <<EOM
-If the guess above is wrong (which it might be if you're using a strange
-compiler, or your machine supports multiple models), you can override it here.
+ rp='Support DTrace if available?'
+ . ./myread
+ case "$ans" in
+ y|Y) val="$define" ;;
+ *) val="$undef" ;;
+ esac
+ set usedtrace
+ eval $setvar
-EOM
-else
- dflt=''
- echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
- cat >&4 <<EOM
-I can't seem to find your C library. I've looked in the following places:
+ test "X$usedtrace" != "X$define" && break
+
+ echo " "
+ rp='Where is the dtrace executable?'
+ dflt=$dflt_dtrace
+ . ./getfile
+ val="$ans"
+ set dtrace
+ eval $setvar
+
+ if $test -f $dtrace
+ then
+ if $dtrace -h -s ../perldtrace.d \
+ -o perldtrace.tmp >/dev/null 2>&1 \
+ && rm -f perldtrace.tmp
+ then
+ echo " "
+ echo "Good: your $dtrace knows about the -h flag."
+ else
+ cat >&2 <<EOM
+
+*** $me: Fatal Error: $dtrace doesn't support -h flag
+***
+*** Your installed dtrace doesn't support the -h switch to compile a D
+*** program into a C header. Can't continue.
EOM
- $sed 's/^/ /' libpath
- cat <<EOM
+ exit 1
+ fi
+ break;
+ fi
-None of these seems to contain your C library. I need to get its name...
+ case "$fastread" in
+ yes)
+ cat >&2 <<EOM
+
+*** $me: Fatal Error: $dtrace not found.
+*** Can't continue.
EOM
-fi
-fn=f
-rp='Where is your C library?'
-. ./getfile
-libc="$ans"
+ exit 1
+ ;;
+ *)
+ echo "*** $dtrace was not found."
+ echo " "
+ ;;
+ esac
+done
+: See if we want extra modules installed
echo " "
-echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
-set X `cat libnames`
-shift
-xxx=files
-case $# in 1) xxx=file; esac
-echo "Extracting names from the following $xxx for later perusal:" >&4
-echo " "
-$sed 's/^/ /' libnames >&4
+case "$extras" in
+'') dflt='n';;
+*) dflt='y';;
+esac
+cat <<EOM
+Perl can be built with extra modules or bundles of modules which
+will be fetched from the CPAN and installed alongside Perl.
+
+Notice that you will need access to the CPAN; either via the Internet,
+or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
+be asked later to configure the CPAN.pm module which will in turn do
+the installation of the rest of the extra modules or bundles.)
+
+Notice also that if the modules require any external software such as
+libraries and headers (the libz library and the zlib.h header for the
+Compress::Zlib module, for example) you MUST have any such software
+already installed, this configuration process will NOT install such
+things for you.
+
+If this doesn't make any sense to you, just accept the default '$dflt'.
+EOM
+rp='Install any extra modules (y or n)?'
+. ./myread
+case "$ans" in
+y|Y)
+ cat <<EOM
+
+Please list any extra modules or bundles to be installed from CPAN,
+with spaces between the names. The names can be in any format the
+'install' command of CPAN.pm will understand. (Answer 'none',
+without the quotes, to install no extra modules or bundles.)
+EOM
+ rp='Extras?'
+ dflt="$extras"
+ . ./myread
+ extras="$ans"
+esac
+case "$extras" in
+''|'none')
+ val=''
+ $rm -f ../extras.lst
+ ;;
+*) echo "(Saving the list of extras for later...)"
+ echo "$extras" > ../extras.lst
+ val="'$extras'"
+ ;;
+esac
+set extras
+eval $setvar
echo " "
-$echo $n "This may take a while...$c" >&4
-for file in $*; do
- case $file in
- *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
- *) $nm $nm_opt $file 2>/dev/null;;
- esac
-done >libc.tmp
+: determine where html pages for programs go
+set html1dir html1dir none
+eval $prefixit
+$cat <<EOM
-$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='[ADTSIWi]'
-if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
- eval $xscan;\
- $contains '^fprintf$' libc.list >/dev/null 2>&1; then
- eval $xrun
-elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
- eval $xscan;\
- $contains '^fprintf$' libc.list >/dev/null 2>&1; then
- eval $xrun
-elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
- eval $xscan;\
- $contains '^fprintf$' libc.list >/dev/null 2>&1; then
- eval $xrun
-elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
- eval $xscan;\
- $contains '^fprintf$' libc.list >/dev/null 2>&1; then
- eval $xrun
-elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
- eval $xscan;\
- $contains '^fprintf$' libc.list >/dev/null 2>&1; then
- eval $xrun
-elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
- eval $xscan;\
- $contains '^fprintf$' libc.list >/dev/null 2>&1; then
- eval $xrun
-elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
- -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
- eval $xscan;\
- $contains '^fprintf$' libc.list >/dev/null 2>&1; then
- eval $xrun
-elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
- eval $xscan;\
- $contains '^fprintf$' libc.list >/dev/null 2>&1; then
- eval $xrun
-elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
- eval $xscan;\
- $contains '^fprintf$' libc.list >/dev/null 2>&1; then
- eval $xrun
-elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
- eval $xscan;\
- $contains '^fprintf$' libc.list >/dev/null 2>&1; then
- eval $xrun
-elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
- eval $xscan;\
- $contains '^fprintf$' libc.list >/dev/null 2>&1; then
- eval $xrun
-elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
- eval $xscan;\
- $contains '^fprintf$' libc.list >/dev/null 2>&1; then
- eval $xrun
-elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
- eval $xscan;\
- $contains '^fprintf$' libc.list >/dev/null 2>&1; then
- eval $xrun
-elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
- eval $xscan;\
- $contains '^fprintf$' libc.list >/dev/null 2>&1; then
- eval $xrun
-else
- $nm -p $* 2>/dev/null >libc.tmp
- $grep fprintf libc.tmp > libc.ptf
- if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
- eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
- then
- nm_opt='-p'
- eval $xrun
- else
- echo " "
- echo "$nm didn't seem to work right. Trying $ar instead..." >&4
- com=''
- if $ar t $libc > libc.tmp && \
- $contains '^fprintf$' libc.tmp >/dev/null 2>&1
- then
- for thisname in $libnames $libc; do
- $ar t $thisname >>libc.tmp
- done
- $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
- echo "Ok." >&4
- elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
- for thisname in $libnames $libc; do
- $ar tv $thisname >>libc.tmp
- emximp -o tmp.imp $thisname \
- 2>/dev/null && \
- $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
- < tmp.imp >>libc.tmp
- $rm -f tmp.imp
- done
- $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
- echo "Ok." >&4
- else
- echo "$ar didn't seem to work right." >&4
- echo "Maybe this is a Cray...trying bld instead..." >&4
- if bld t $libc | \
- $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
- $test -s libc.list
- then
- for thisname in $libnames; do
- bld t $libnames | \
- $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
- $ar t $thisname >>libc.tmp
- done
- echo "Ok." >&4
- else
- echo "That didn't work either. Giving up." >&4
- exit 1
- fi
- fi
- fi
-fi
-nm_extract="$com"
-case "$PASE" in
-define)
- echo " "
- echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
- dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
- ;;
-*) if $test -f /lib/syscalls.exp; then
- echo " "
- echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
- $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
- /lib/syscalls.exp >>libc.list
- fi
- ;;
+If you wish to install html files for programs in $spackage, indicate
+the appropriate directory here. To skip installing html files,
+answer "none".
+EOM
+case "$html1dir" in
+''|none|$undef|' ') dflt=none ;;
+*) dflt=$html1dir ;;
esac
-;;
+fn=dn+~
+rp="Directory for the main $spackage html pages?"
+. ./getfile
+prefixvar=html1dir
+. ./setprefixvar
+: Use ' ' for none so value is preserved next time through Configure
+$test X"$html1dir" = "X" && html1dir=' '
+
+: determine where html pages for libraries and modules go
+set html3dir html3dir none
+eval $prefixit
+$cat <<EOM
+
+If you wish to install html files for modules associated with $spackage,
+indicate the appropriate directory here. To skip installing html files,
+answer "none".
+EOM
+: There is no obvious default. If they have specified html1dir, then
+: try to key off that, possibly changing .../html1 into .../html3.
+case "$html3dir" in
+'') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
+*) dflt=$html3dir ;;
esac
-$rm -f libnames libpath
+fn=dn+~
+rp="Directory for the $spackage module html pages?"
+. ./getfile
+prefixvar=html3dir
+. ./setprefixvar
+: Use ' ' for none so value is preserved next time through Configure
+$test X"$html3dir" = "X" && html3dir=' '
-: Check if we are using C++
-echo " "
-echo "Checking for C++..." >&4
-$cat >try.c <<'EOCP'
-#include <stdio.h>
-int main(void)
-{
-#ifdef __cplusplus
- return 0;
-#else
- return 1;
-#endif
-}
-EOCP
-set try
-if eval $compile_ok && $run ./try; then
- val="$define"
- echo "You are using a C++ compiler."
-else
- val="$undef"
- echo "You are not using a C++ compiler."
-fi
-$rm_try cplusplus$$
-set d_cplusplus
-eval $setvar
+: determine whether to install perl also as /usr/bin/perl
-: is a C symbol defined?
-csym='tlook=$1;
-case "$3" in
--v) tf=libc.tmp; tdc="";;
--a) tf=libc.tmp; tdc="[]";;
-*) tlook="^$1\$"; tf=libc.list; tdc="()";;
-esac;
-case "$d_cplusplus" in
- $define) extern_C="extern \"C\"" ;;
- *) extern_C="extern" ;;
-esac;
-tx=yes;
-case "$reuseval-$4" in
-true-) ;;
-true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
-esac;
-case "$tx" in
-yes)
- tval=false;
- if $test "$runnm" = true; then
- 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;
- $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;
- $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
- $rm_try;
- fi;
- ;;
-*)
- case "$tval" in
- $define) tval=true;;
- *) tval=false;;
- esac;
- ;;
-esac;
-eval "$2=$tval"'
+echo " "
+if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
+ $cat <<EOM
+Many scripts expect perl to be installed as /usr/bin/perl.
-: define an is-in-libc? function
-inlibc='echo " "; td=$define; tu=$undef;
-sym=$1; var=$2; eval "was=\$$2";
-tx=yes;
-case "$reuseval$was" in
-true) ;;
-true*) tx=no;;
-esac;
-case "$tx" in
-yes)
- set $sym tres -f;
- eval $csym;
- case "$tres" in
- true)
- echo "$sym() found." >&4;
- case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
- *)
- echo "$sym() NOT found." >&4;
- case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
- esac;;
-*)
- case "$was" in
- $define) echo "$sym() found." >&4;;
- *) echo "$sym() NOT found." >&4;;
- esac;;
-esac'
+If you want to, I can install the perl you are about to compile
+as /usr/bin/perl (in addition to $bin/perl).
+EOM
+ if test -f /usr/bin/perl; then
+ $cat <<EOM
+
+However, please note that because you already have a /usr/bin/perl,
+overwriting that with a new Perl would very probably cause problems.
+Therefore I'm assuming you don't want to do that (unless you insist).
+
+EOM
+ case "$installusrbinperl" in
+ "$define"|[yY]*) dflt='y';;
+ *) dflt='n';;
+ esac
+ else
+ $cat <<EOM
+
+Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
+
+EOM
+ case "$installusrbinperl" in
+ "$undef"|[nN]*) dflt='n';;
+ *) dflt='y';;
+ esac
+ fi
+ rp="Do you want to install perl as /usr/bin/perl?"
+ . ./myread
+ case "$ans" in
+ [yY]*) val="$define";;
+ *) val="$undef" ;;
+ esac
+else
+ val="$undef"
+fi
+set installusrbinperl
+eval $setvar
: see if dlopen exists
xxx_runnm="$runnm"
'') 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
esac
case "$ldflags" in
+ *-fstack-protector-strong*)
+ case "$dflt" in
+ *-fstack-protector-strong*) ;; # Don't add it again
+ *) dflt="$dflt -fstack-protector-strong" ;;
+ esac
+ ;;
*-fstack-protector*)
case "$dflt" in
*-fstack-protector*) ;; # Don't add it again
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]*|'')
set accessx d_accessx
eval $inlibc
+: see if acosh exists
+set acosh d_acosh
+eval $inlibc
+
: see if aintl exists
set aintl d_aintl
eval $inlibc
set limits.h i_limits
eval $inhdr
-: see if this is a float.h system
-set float.h i_float
-eval $inhdr
-
: See if number of significant digits in a double precision number is known
echo " "
$cat >dbl_dig.c <<EOM
#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! */
}
fi
$rm_try
+: see if fegetround exists
+set fegetround d_fegetround
+eval $inlibc
+
: see if fgetpos exists
set fgetpos d_fgetpos
eval $inlibc
set fp_class d_fp_class
eval $inlibc
+: see if this is a math.h system
+set math.h i_math
+eval $inhdr
+
+: check for fpclassify
+echo "Checking to see if you have fpclassify..." >&4
+$cat >try.c <<EOCP
+#$i_math I_MATH
+#ifdef I_MATH
+#include <math.h>
+#endif
+int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
+EOCP
+set try
+if eval $compile; then
+ val="$define"
+ echo "You have fpclassify."
+else
+ val="$undef"
+ echo "You do not have fpclassify."
+fi
+$rm_try
+set d_fpclassify
+eval $setvar
+
+: see if fp_classify exists
+set fp_classify d_fp_classify
+eval $inlibc
+
+: see if fp_classl exists
+set fp_classl d_fp_classl
+eval $inlibc
+
: see if pathconf exists
set pathconf d_pathconf
eval $inlibc
set fpclass d_fpclass
eval $inlibc
-: see if fpclassify exists
-set fpclassify d_fpclassify
-eval $inlibc
-
: see if fpclassl exists
set fpclassl d_fpclassl
eval $inlibc
+: see if fpgetround exists
+set fpgetround d_fpgetround
+eval $inlibc
+
: check for fpos64_t
echo " "
echo "Checking to see if you have fpos64_t..." >&4
eval $setvar
$rm -f isblank*
-: see if isfinite exists
-set isfinite d_isfinite
-eval $inlibc
+: check for isfinite
+echo "Checking to see if you have isfinite..." >&4
+$cat >try.c <<EOCP
+#$i_math I_MATH
+#ifdef I_MATH
+#include <math.h>
+#endif
+int main() { return isfinite(0.0); }
+EOCP
+set try
+if eval $compile; then
+ val="$define"
+ echo "You have isfinite."
+else
+ val="$undef"
+ echo "You do not have isfinite."
+fi
+$rm_try
+set d_isfinite
+eval $setvar
-: see if isinf exists
-set isinf d_isinf
+: see if isfinitel exists
+set isfinitel d_isfinitel
eval $inlibc
-: see if isnan exists
-set isnan d_isnan
+: check for isinf
+echo "Checking to see if you have isinf..." >&4
+$cat >try.c <<EOCP
+#$i_math I_MATH
+#ifdef I_MATH
+#include <math.h>
+#endif
+int main() { return isinf(0.0); }
+EOCP
+set try
+if eval $compile; then
+ val="$define"
+ echo "You have isinf."
+else
+ val="$undef"
+ echo "You do not have isinf."
+fi
+$rm_try
+set d_isinf
+eval $setvar
+
+: see if isinfl exists
+set isinfl d_isinfl
eval $inlibc
+: check for isnan
+echo "Checking to see if you have isnan..." >&4
+$cat >try.c <<EOCP
+#$i_math I_MATH
+#ifdef I_MATH
+#include <math.h>
+#endif
+int main() { return isnan(0.0); }
+EOCP
+set try
+if eval $compile; then
+ val="$define"
+ echo "You have isnan."
+else
+ val="$undef"
+ echo "You do not have isnan."
+fi
+$rm_try
+set d_isnan
+eval $setvar
+
: see if isnanl exists
set isnanl d_isnanl
eval $inlibc
+: see if j0 exists
+set j0 d_j0
+eval $inlibc
+
+: see if j0l exists
+set j0l d_j0l
+eval $inlibc
+
: see if killpg exists
set killpg d_killpg
eval $inlibc
$echo "lchown() found." >&4
val="$define"
else
- $echo "lchown() NOT found." >&4
- val="$undef"
+ $echo "lchown() NOT found." >&4
+ val="$undef"
+fi
+set d_lchown
+eval $setvar
+
+: See if number of significant digits in a double precision number is known
+echo " "
+$cat >ldbl_dig.c <<EOM
+#$i_limits I_LIMITS
+#$i_float I_FLOAT
+#ifdef I_LIMITS
+#include <limits.h>
+#endif
+#ifdef I_FLOAT
+#include <float.h>
+#endif
+#ifdef LDBL_DIG
+printf("Contains LDBL_DIG");
+#endif
+EOM
+$cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
+if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
+ echo "LDBL_DIG found." >&4
+ val="$define"
+else
+ echo "LDBL_DIG NOT found." >&4
+ val="$undef"
+fi
+$rm -f ldbl_dig.?
+set d_ldbl_dig
+eval $setvar
+
+: check to see if math.h defines _LIB_VERSION
+d_libm_lib_version="$undef"
+case $i_math in
+ $define)
+ echo " "
+ echo "Checking to see if your libm supports _LIB_VERSION..." >&4
+ $cat >try.c <<EOCP
+#include <unistd.h>
+#include <math.h>
+int main (int argc, char *argv[])
+{
+ printf ("%d\n", _LIB_VERSION);
+ return (0);
+ } /* main */
+EOCP
+ set try
+ if eval $compile; then
+ foo=`$run ./try`
+ echo "Yes, it does ($foo)" >&4
+ d_libm_lib_version="$define"
+ else
+ echo "No, it does not (probably harmless)" >&4
+ fi
+ $rm_try
+ ;;
+
+ esac
+
+: check for fpclassify
+echo " "
+echo "Checking to see if you have fpclassify..." >&4
+$cat >try.c <<EOCP
+#$i_math I_MATH
+#ifdef I_MATH
+#include <math.h>
+#endif
+int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
+EOCP
+set try
+if eval $compile; then
+ val="$define"
+ echo "You have fpclassify."
+else
+ val="$undef"
+ echo "You do not have fpclassify."
+fi
+$rm_try
+set d_fpclassify
+eval $setvar
+
+: check for isfinite
+echo " "
+echo "Checking to see if you have isfinite..." >&4
+$cat >try.c <<EOCP
+#$i_math I_MATH
+#ifdef I_MATH
+#include <math.h>
+#endif
+int main() { return isfinite(0.0); }
+EOCP
+set try
+if eval $compile; then
+ val="$define"
+ echo "You have isfinite."
+else
+ val="$undef"
+ echo "You do not have isfinite."
+fi
+$rm_try
+set d_isfinite
+eval $setvar
+
+: check for isinf
+echo " "
+echo "Checking to see if you have isinf..." >&4
+$cat >try.c <<EOCP
+#$i_math I_MATH
+#ifdef I_MATH
+#include <math.h>
+#endif
+int main() { return isinf(0.0); }
+EOCP
+set try
+if eval $compile; then
+ val="$define"
+ echo "You have isinf."
+else
+ val="$undef"
+ echo "You do not have isinf."
fi
-set d_lchown
+$rm_try
+set d_isinf
eval $setvar
-: See if number of significant digits in a double precision number is known
+: check for isnan
echo " "
-$cat >ldbl_dig.c <<EOM
-#$i_limits I_LIMITS
-#$i_float I_FLOAT
-#ifdef I_LIMITS
-#include <limits.h>
-#endif
-#ifdef I_FLOAT
-#include <float.h>
-#endif
-#ifdef LDBL_DIG
-printf("Contains LDBL_DIG");
+echo "Checking to see if you have isnan..." >&4
+$cat >try.c <<EOCP
+#$i_math I_MATH
+#ifdef I_MATH
+#include <math.h>
#endif
-EOM
-$cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
-if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
- echo "LDBL_DIG found." >&4
+int main() { return isnan(0.0); }
+EOCP
+set try
+if eval $compile; then
val="$define"
+ echo "You have isnan."
else
- echo "LDBL_DIG NOT found." >&4
val="$undef"
+ echo "You do not have isnan."
fi
-$rm -f ldbl_dig.?
-set d_ldbl_dig
+$rm_try
+set d_isnan
eval $setvar
-: see if this is a math.h system
-set math.h i_math
+: see if this is a quadmath.h system
+set quadmath.h i_quadmath
eval $inhdr
-: check to see if math.h defines _LIB_VERSION
-d_libm_lib_version="$undef"
-case $i_math in
- $define)
- echo " "
- echo "Checking to see if your libm supports _LIB_VERSION..." >&4
- $cat >try.c <<EOCP
-#include <unistd.h>
-#include <math.h>
-int main (int argc, char *argv[])
-{
- printf ("%d\n", _LIB_VERSION);
- return (0);
- } /* main */
-EOCP
- set try
- if eval $compile; then
- foo=`$run ./try`
- echo "Yes, it does ($foo)" >&4
- d_libm_lib_version="$define"
- else
- echo "No, it does not (probably harmless)" >&4
- fi
- $rm_try
- ;;
-
- esac
-
: see if link exists
set link d_link
eval $inlibc
set scalbnl d_scalbnl
eval $inlibc
+: see if truncl exists
+set truncl d_truncl
+eval $inlibc
+
: see if modfl exists
set modfl d_modfl
eval $inlibc
message="$message sqrtl"
fi
if $test "$d_modfl" != "$define"; then
- if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
- echo "You have both aintl and copysignl, so I can emulate modfl."
+ if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
+ echo "You have both truncl and copysignl, so I can emulate modfl."
else
- message="$message modfl"
+ if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
+ echo "You have both aintl and copysignl, so I can emulate modfl."
+ else
+ message="$message modfl"
+ fi
fi
fi
if $test "$d_frexpl" != "$define"; then
message="$message frexpl"
fi
fi
+ if $test "$d_ldexpl" != "$define"; then
+ message="$message ldexpl"
+ fi
if $test "$message" != ""; then
$cat <<EOM >&4
;;
esac
+case "$usequadmath:$i_quadmath" in
+define:define)
+ nvtype="__float128"
+ nvsize=16
+ case "$libs" in
+ *quadmath*) ;;
+ *) $cat <<EOM >&4
+
+*** You requested the use of the quadmath library, but you
+*** do not seem to have the quadmath library installed.
+*** Cannot continue, aborting.
+EOM
+ exit 1
+ ;;
+ esac
+ ;;
+define:*) $cat <<EOM >&4
+
+*** You requested the use of the quadmath library, but you
+*** do not seem to have the required header, <quadmath.h>.
+EOM
+ case "$gccversion" in
+ [23].*|4.[0-5]*)
+ $cat <<EOM >&4
+*** Your gcc looks a bit old:
+*** $gccversion
+EOM
+ ;;
+ '')
+ $cat <<EOM >&4
+*** You are not running a gcc.
+EOM
+ ;;
+ esac
+ $cat <<EOM >&4
+*** For the quadmath library you need at least gcc 4.6.
+*** Cannot continue, aborting.
+EOM
+ exit 1
+ ;;
+esac
+
$echo "(IV will be "$ivtype", $ivsize bytes)"
$echo "(UV will be "$uvtype", $uvsize bytes)"
$echo "(NV will be "$nvtype", $nvsize bytes)"
case $d_prctl in
$define)
$cat >try.c <<EOM
+#ifdef __ANDROID__
+#include <unistd.h>
+#endif
#include <sys/prctl.h>
int main (int argc, char *argv[])
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
fi
fi
-if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
+if $test X"$usequadmath" = X"$define"; then
+ nveformat='"Qe"'
+ nvfformat='"Qf"'
+ nvgformat='"Qg"'
+ nvEUformat='"QE"'
+ nvFUformat='"QF"'
+ nvGUformat='"QG"'
+else
+ if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
nveformat="$sPRIeldbl"
nvfformat="$sPRIfldbl"
nvgformat="$sPRIgldbl"
nvEUformat="$sPRIEUldbl"
nvFUformat="$sPRIFUldbl"
nvGUformat="$sPRIGUldbl"
-else
+ else
nveformat='"e"'
nvfformat='"f"'
nvgformat='"g"'
nvEUformat='"E"'
nvFUformat='"F"'
nvGUformat='"G"'
+ fi
fi
case "$ivdformat" in
*) 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 size_t sizetype 'unsigned int' stdio.h sys/types.h
eval $typedef_ask
-: check for type of arguments to gethostbyaddr.
+: check for type of arguments to gethostbyaddr.
if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
case "$d_gethbyaddr" in
$define)
Checking to see what type of arguments are accepted by gethostbyaddr().
EOM
hdrs="$define sys/types.h
- $d_socket sys/socket.h
- $i_niin netinet/in.h
+ $d_socket sys/socket.h
+ $i_niin netinet/in.h
$i_netdb netdb.h
$i_unistd unistd.h"
: The first arg can 'char *' or 'void *'
netdb_hlen_type="$sizetype"
;;
esac
- # Remove the "const" if needed. -- but then we'll have a
+ # Remove the "const" if needed. -- but then we'll have a
# prototype clash!
# netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
fi
-: check for type of argument to gethostbyname.
+: check for type of argument to gethostbyname.
if test "X$netdb_name_type" = X ; then
case "$d_gethbyname" in
$define)
Checking to see what type of argument is accepted by gethostbyname().
EOM
hdrs="$define sys/types.h
- $d_socket sys/socket.h
- $i_niin netinet/in.h
+ $d_socket sys/socket.h
+ $i_niin netinet/in.h
$i_netdb netdb.h
$i_unistd unistd.h"
for xxx in "const char *" "char *"; do
esac
fi
-: check for type of 1st argument to getnetbyaddr.
+: check for type of 1st argument to getnetbyaddr.
if test "X$netdb_net_type" = X ; then
case "$d_getnbyaddr" in
$define)
Checking to see what type of 1st argument is accepted by getnetbyaddr().
EOM
hdrs="$define sys/types.h
- $d_socket sys/socket.h
- $i_niin netinet/in.h
+ $d_socket sys/socket.h
+ $i_niin netinet/in.h
$i_netdb netdb.h
$i_unistd unistd.h"
for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
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 fenv.h system
+set fenv.h i_fenv
+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"
set stddef.h i_stddef
eval $inhdr
+: see if stdint is available
+set stdint.h i_stdint
+eval $inhdr
+
: see if sys/access.h is available
set sys/access.h i_sysaccess
eval $inhdr
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__fwalk='$d__fwalk'
d_access='$d_access'
d_accessx='$d_accessx'
+d_acosh='$d_acosh'
d_aintl='$d_aintl'
d_alarm='$d_alarm'
d_archlib='$d_archlib'
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_fd_macros='$d_fd_macros'
d_fd_set='$d_fd_set'
d_fds_bits='$d_fds_bits'
+d_fegetround='$d_fegetround'
d_fgetpos='$d_fgetpos'
d_finite='$d_finite'
d_finitel='$d_finitel'
d_flockproto='$d_flockproto'
d_fork='$d_fork'
d_fp_class='$d_fp_class'
+d_fp_classify='$d_fp_classify'
+d_fp_classl='$d_fp_classl'
d_fpathconf='$d_fpathconf'
d_fpclass='$d_fpclass'
d_fpclassify='$d_fpclassify'
d_fpclassl='$d_fpclassl'
+d_fpgetround='$d_fpgetround'
d_fpos64_t='$d_fpos64_t'
d_frexpl='$d_frexpl'
d_fs_data_s='$d_fs_data_s'
d_isascii='$d_isascii'
d_isblank='$d_isblank'
d_isfinite='$d_isfinite'
+d_isfinitel='$d_isfinitel'
d_isinf='$d_isinf'
+d_isinfl='$d_isinfl'
d_isnan='$d_isnan'
d_isnanl='$d_isnanl'
+d_j0='$d_j0'
+d_j0l='$d_j0l'
d_killpg='$d_killpg'
d_lchown='$d_lchown'
d_ldbl_dig='$d_ldbl_dig'
+d_ldexpl='$d_ldexpl'
d_libm_lib_version='$d_libm_lib_version'
d_libname_unique='$d_libname_unique'
d_link='$d_link'
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_tm_tm_zone='$d_tm_tm_zone'
d_tmpnam_r='$d_tmpnam_r'
d_truncate='$d_truncate'
+d_truncl='$d_truncl'
d_ttyname_r='$d_ttyname_r'
d_tzname='$d_tzname'
d_u32align='$d_u32align'
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'
html3direxp='$html3direxp'
-hostgenerate='$hostgenerate'
-hostperl='$hostperl'
i16size='$i16size'
i16type='$i16type'
i32size='$i32size'
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_fenv='$i_fenv'
i_float='$i_float'
i_fp='$i_fp'
i_fp_class='$i_fp_class'
i_prot='$i_prot'
i_pthread='$i_pthread'
i_pwd='$i_pwd'
+i_quadmath='$i_quadmath'
i_rpcsvcdbm='$i_rpcsvcdbm'
i_sgtty='$i_sgtty'
i_shadow='$i_shadow'
i_stdarg='$i_stdarg'
i_stdbool='$i_stdbool'
i_stddef='$i_stddef'
+i_stdint='$i_stdint'
i_stdlib='$i_stdlib'
i_string='$i_string'
i_sunmath='$i_sunmath'
localtime_r_proto='$localtime_r_proto'
locincpth='$locincpth'
loclibpth='$loclibpth'
+longdblkind='$longdblkind'
longdblsize='$longdblsize'
longlongsize='$longlongsize'
longsize='$longsize'
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'
useopcode='$useopcode'
useperlio='$useperlio'
useposix='$useposix'
+usequadmath='$usequadmath'
usereentrant='$usereentrant'
userelocatableinc='$userelocatableinc'
useshrplib='$useshrplib'
esac
fi
+: preserve RCS keywords in files with variable substitution, grrr
+Id='$Id'
+
: Finish up by extracting the .SH files
case "$alldone" in
exit)