# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Thu May 14 12:19:05 EDT 1998 [metaconfig 3.0 PL70]
+# Generated on Wed Jul 1 12:16:14 EDT 1998 [metaconfig 3.0 PL70]
+# (with additional metaconfig patches by doughera@lafayette.edu)
cat >/tmp/c1$$ <<EOF
ARGGGHHHH!!!!!
;;
esac
+: if needed set CDPATH to a harmless value that is not chatty
+: avoid bash 2.02 problems with empty CDPATH.
+case "$CDPATH" in
+'') ;;
+*) case "$SHELL" in
+ *bash*) CDPATH='.' ;;
+ *) CDPATH='' ;;
+ esac
+ ;;
+esac
: Configure runs within the UU subdirectory
test -d UU || mkdir UU
-CDPATH=''
cd UU && rm -f ./*
dynamic_ext=''
extensions=''
known_extensions=''
+nonxs_ext=''
static_ext=''
useopcode=''
useposix=''
d_memset=''
d_mkdir=''
d_mkfifo=''
-d_mkstemp=''
d_mktime=''
d_msg=''
d_msgctl=''
d_semctl=''
d_semget=''
d_semop=''
-d_union_semun=''
-d_semctl_semun=''
-d_semctl_semid_ds=''
d_setegid=''
d_seteuid=''
d_setgrps=''
d_truncate=''
d_tzname=''
d_umask=''
+d_semctl_semid_ds=''
+d_semctl_semun=''
+d_union_semun=''
d_vfork=''
usevfork=''
d_voidsig=''
package=''
spackage=''
pager=''
+apiversion=''
patchlevel=''
subversion=''
+version=''
perladmin=''
perlpath=''
pidtype=''
: default library list
libswanted=''
-: full support for void wanted by default
-defvoidused=15
-
: Possible local include directories to search.
: Set locincpth to "" in a hint file to defeat local include searches.
locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
: Extra object files, if any, needed on this platform.
archobjs=''
groupstype=''
+: full support for void wanted by default
+defvoidused=15
+
: set useposix=false in your hint file to disable the POSIX extension.
useposix=true
: set useopcode=false in your hint file to disable the Opcode extension.
$me: Fatal Error: I can't find a Bourne Shell anywhere.
Usually it's in /bin/sh. How did you even get this far?
-Please contact me (Andy Dougherty) at doughera@lafcol.lafayette.edu and
+Please contact me (Andy Dougherty) at doughera@lafayette.edu and
we'll try to straighten this all out.
EOM
exit 1
fi
rm -f try
+
+: Save command line options in file UU/cmdline.opt for later use in
+: generating config.sh.
+cat > cmdline.opt <<EOSH
+# Configure command line arguments.
+config_arg0='$0'
+config_args='$*'
+config_argc=$#
+EOSH
+argn=1
+for arg in "$@"; do
+ cat >>cmdline.opt <<EOSH
+config_arg$argn='$arg'
+EOSH
+ argn=`expr $argn + 1`
+done
+
: produce awk script to parse command line options
cat >options.awk <<'EOF'
BEGIN {
You have the option of continuing the configuration process, despite the
distinct possibility that your kit is damaged, by typing 'y'es. If you
do, don't blame me if something goes wrong. I advise you to type 'n'o
-and contact the author (doughera@lafcol.lafayette.edu).
+and contact the author (doughera@lafayette.edu).
EOM
echo $n "Continue? [n] $c" >&4
Unix system. If despite that it blows up on yours, your best bet is to edit
Configure and run it again. If you can't run Configure for some reason,
you'll have to generate a config.sh file by hand. Whatever problems you
-have, let me (doughera@lafcol.lafayette.edu) know how I blew it.
+have, let me (doughera@lafayette.edu) know how I blew it.
This installation script affects things in two ways:
(cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
dflt=''
: Half the following guesses are probably wrong... If you have better
- : tests or hints, please send them to doughera@lafcol.lafayette.edu
+ : tests or hints, please send them to doughera@lafayette.edu
: The metaconfig authors would also appreciate a copy...
$test -f /irix && osname=irix
$test -f /xenix && osname=sco_xenix
osvers="$3" ;;
genix) osname=genix ;;
hp*) osname=hpux
- case "$3" in
- *.08.*) osvers=9 ;;
- *.09.*) osvers=9 ;;
- *.10.*) osvers=10 ;;
- *.11.*) osvers=11 ;;
- *.12.*) osvers=12 ;;
- *) osvers="$3" ;;
- esac
+ osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
;;
irix*) osname=irix
case "$3" in
esac;;
esac'
+: set the base revision
+baserev=5.0
+
+: get the patchlevel
+echo " "
+echo "Getting the current patchlevel..." >&4
+if $test -r $rsrc/patchlevel.h;then
+ patchlevel=`awk '/define[ ]+PATCHLEVEL/ {print $3}' $rsrc/patchlevel.h`
+ subversion=`awk '/define[ ]+SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
+else
+ patchlevel=0
+ subversion=0
+fi
+$echo $n "(You have $package" $c
+case "$package" in
+"*$baserev") ;;
+*) $echo $n " $baserev" $c ;;
+esac
+$echo $n " patchlevel $patchlevel" $c
+test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
+echo ".)"
+
+if test 0 -eq "$subversion"; then
+ version=`LC_ALL=C; export LC_ALL; \
+ echo $baserev $patchlevel | \
+ $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
+else
+ version=`LC_ALL=C; export LC_ALL; \
+ echo $baserev $patchlevel $subversion | \
+ $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
+fi
+: Figure out perl API version. Perhaps this should be in patchlevel.h
+if test "$subversion" -lt 50; then
+ apiversion=`LC_ALL=C; export LC_ALL; \
+ echo $baserev $patchlevel | \
+ $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
+else
+ apiversion="$version"
+fi
+
: determine where private library files go
-: Usual default is /usr/local/lib/perl5. Also allow things like
-: /opt/perl/lib, since /opt/perl/lib/perl5 would be redundant.
+: Usual default is /usr/local/lib/perl5/$version/share.
+: Also allow things like /opt/perl/lib/$version/share, since
+: /opt/perl/lib/perl5... would be redundant.
case "$prefix" in
-*perl*) set dflt privlib lib ;;
-*) set dflt privlib lib/$package ;;
+*perl*) set dflt privlib lib/$version/share ;;
+*) set dflt privlib lib/$package/$version/share ;;
esac
eval $prefixit
$cat <<EOM
installprivlib="$privlibexp"
fi
-: set the base revision
-baserev=5.0
-
-: get the patchlevel
-echo " "
-echo "Getting the current patchlevel..." >&4
-if $test -r $rsrc/patchlevel.h;then
- patchlevel=`awk '/define[ ]+PATCHLEVEL/ {print $3}' $rsrc/patchlevel.h`
- subversion=`awk '/define[ ]+SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
-else
- patchlevel=0
- subversion=0
-fi
-$echo $n "(You have $package" $c
-case "$package" in
-"*$baserev") ;;
-*) $echo $n " $baserev" $c ;;
-esac
-$echo $n " patchlevel $patchlevel" $c
-test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
-echo ".)"
-
: set the prefixup variable, to restore leading tilda escape
prefixup='case "$prefixexp" in
"$prefix") ;;
: determine where public architecture dependent libraries go
set archlib archlib
eval $prefixit
+: privlib default is /usr/local/lib/$package/$version/share
+: archlib default is /usr/local/lib/$package/$version/$archname
+tdflt=`echo $privlib | $sed 's,/share$,,'`
+tdflt=$tdflt/$archname
case "$archlib" in
-'')
- case "$privlib" in
- '') dflt=`./loc . "." $prefixexp/lib /usr/local/lib /usr/lib /lib`
- set dflt
- eval $prefixup
- ;;
- *) if test 0 -eq "$subversion"; then
- version=`LC_ALL=C; export LC_ALL; \
- echo $baserev $patchlevel | \
- $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
- else
- version=`LC_ALL=C; export LC_ALL; \
- echo $baserev $patchlevel $subversion | \
- $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
- fi
- dflt="$privlib/$archname/$version"
+'') dflt=$tdflt
;;
- esac
- ;;
-*)
- dflt="$archlib"
+*) dflt="$archlib"
;;
esac
cat <<EOM
esac
$rm -f try try.* core
+: determine filename position in cpp output
+echo " "
+echo "Computing filename position in cpp output for #include directives..." >&4
+echo '#include <stdio.h>' > foo.c
+$cat >fieldn <<EOF
+$startsh
+$cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
+$grep '^[ ]*#.*stdio\.h' | \
+while read cline; do
+ pos=1
+ set \$cline
+ while $test \$# -gt 0; do
+ if $test -r \`echo \$1 | $tr -d '"'\`; then
+ echo "\$pos"
+ exit 0
+ fi
+ shift
+ pos=\`expr \$pos + 1\`
+ done
+done
+EOF
+chmod +x fieldn
+fieldn=`./fieldn`
+$rm -f foo.c fieldn
+case $fieldn in
+'') pos='???';;
+1) pos=first;;
+2) pos=second;;
+3) pos=third;;
+*) pos="${fieldn}th";;
+esac
+echo "Your cpp writes the filename in the $pos field of the line."
+
+: locate header file
+$cat >findhdr <<EOF
+$startsh
+wanted=\$1
+name=''
+if test -f $usrinc/\$wanted; then
+ echo "$usrinc/\$wanted"
+ exit 0
+fi
+awkprg='{ print \$$fieldn }'
+echo "#include <\$wanted>" > foo\$\$.c
+$cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
+$grep "^[ ]*#.*\$wanted" | \
+while read cline; do
+ name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
+ case "\$name" in
+ */\$wanted) echo "\$name"; exit 0;;
+ *) name='';;
+ esac;
+done;
+$rm -f foo\$\$.c;
+case "\$name" in
+'') exit 1;;
+esac
+EOF
+chmod +x findhdr
+
+: define an alternate in-header-list? function
+inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
+cont=true; xxf="echo \"<\$1> found.\" >&4";
+case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
+*) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
+esac;
+case $# in 4) instead=instead;; *) instead="at last";; esac;
+while $test "$cont"; do
+ xxx=`./findhdr $1`
+ var=$2; eval "was=\$$2";
+ if $test "$xxx" && $test -r "$xxx";
+ then eval $xxf;
+ eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
+ cont="";
+ else eval $xxnf;
+ eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
+ set $yyy; shift; shift; yyy=$@;
+ case $# in 0) cont="";;
+ 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
+ xxnf="echo \"and I did not find <\$1> either.\" >&4";;
+ *) xxf="echo \"but I found <\$1\> instead.\" >&4";
+ xxnf="echo \"there is no <\$1>, ...\" >&4";;
+ esac;
+done;
+while $test "$yyy";
+do set $yyy; var=$2; eval "was=\$$2";
+ eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
+ set $yyy; shift; shift; yyy=$@;
+done'
+
+: see if this is a malloc.h system
+set malloc.h i_malloc
+eval $inhdr
+
+: see if stdlib is available
+set stdlib.h i_stdlib
+eval $inhdr
+
+: determine which malloc to compile in
+echo " "
+case "$usemymalloc" in
+''|y*|true) dflt='y' ;;
+n*|false) dflt='n' ;;
+*) dflt="$usemymalloc" ;;
+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
+ ;;
+ esac
+ ;;
+*)
+ usemymalloc='n'
+ mallocsrc=''
+ mallocobj=''
+ d_mymalloc="$undef"
+ ;;
+esac
+
+: 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]
: Cruising for prototypes
echo " "
echo "Checking out function prototypes..." >&4
echo " "
echo "Checking for GNU C Library..." >&4
cat >gnulibc.c <<EOM
+#include <stdio.h>
int
main()
{
- return __libc_main();
+#ifdef __GLIBC__
+ exit(0);
+#else
+ exit(1);
+#endif
}
EOM
set gnulibc
-if eval $compile && \
- ./gnulibc | $contains '^GNU C Library'; then
+if eval $compile_ok && ./gnulibc; then
val="$define"
echo "You are using the GNU C Library"
else
else
echo "That didn't work either. Giving up." >&4
exit 1
- fi
- fi
- fi
-fi
-nm_extract="$com"
-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$/\1/p' /lib/syscalls.exp >>libc.list
-fi
-;;
-esac
-$rm -f libnames libpath
-
-: determine filename position in cpp output
-echo " "
-echo "Computing filename position in cpp output for #include directives..." >&4
-echo '#include <stdio.h>' > foo.c
-$cat >fieldn <<EOF
-$startsh
-$cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
-$grep '^[ ]*#.*stdio\.h' | \
-while read cline; do
- pos=1
- set \$cline
- while $test \$# -gt 0; do
- if $test -r \`echo \$1 | $tr -d '"'\`; then
- echo "\$pos"
- exit 0
+ fi
fi
- shift
- pos=\`expr \$pos + 1\`
- done
-done
-EOF
-chmod +x fieldn
-fieldn=`./fieldn`
-$rm -f foo.c fieldn
-case $fieldn in
-'') pos='???';;
-1) pos=first;;
-2) pos=second;;
-3) pos=third;;
-*) pos="${fieldn}th";;
-esac
-echo "Your cpp writes the filename in the $pos field of the line."
-
-: locate header file
-$cat >findhdr <<EOF
-$startsh
-wanted=\$1
-name=''
-if test -f $usrinc/\$wanted; then
- echo "$usrinc/\$wanted"
- exit 0
+ fi
fi
-awkprg='{ print \$$fieldn }'
-echo "#include <\$wanted>" > foo\$\$.c
-$cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
-$grep "^[ ]*#.*\$wanted" | \
-while read cline; do
- name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
- case "\$name" in
- */\$wanted) echo "\$name"; exit 0;;
- *) name='';;
- esac;
-done;
-$rm -f foo\$\$.c;
-case "\$name" in
-'') exit 1;;
+nm_extract="$com"
+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$/\1/p' /lib/syscalls.exp >>libc.list
+fi
+;;
esac
-EOF
-chmod +x findhdr
-
-: define an alternate in-header-list? function
-inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
-cont=true; xxf="echo \"<\$1> found.\" >&4";
-case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
-*) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
-esac;
-case $# in 4) instead=instead;; *) instead="at last";; esac;
-while $test "$cont"; do
- xxx=`./findhdr $1`
- var=$2; eval "was=\$$2";
- if $test "$xxx" && $test -r "$xxx";
- then eval $xxf;
- eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
- cont="";
- else eval $xxnf;
- eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
- set $yyy; shift; shift; yyy=$@;
- case $# in 0) cont="";;
- 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
- xxnf="echo \"and I did not find <\$1> either.\" >&4";;
- *) xxf="echo \"but I found <\$1\> instead.\" >&4";
- xxnf="echo \"there is no <\$1>, ...\" >&4";;
- esac;
-done;
-while $test "$yyy";
-do set $yyy; var=$2; eval "was=\$$2";
- eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
- set $yyy; shift; shift; yyy=$@;
-done'
+$rm -f libnames libpath
: see if dld is available
set dld.h i_dld
*) dflt='-fpic' ;;
esac ;;
esac ;;
+ ' ') dflt='none' ;;
*) dflt="$cccdlflags" ;;
esac
rp="Any special flags to pass to $cc -c to compile shared library modules?"
*) dflt="$lddlflags" ;;
esac
-: Try to guess additional flags to pick up local libraries.
-for thisflag in $ldflags; do
- case "$thisflag" in
- -L*)
- case " $dflt " in
- *" $thisflag "*) ;;
- *) dflt="$dflt $thisflag" ;;
+ : Try to guess additional flags to pick up local libraries.
+ for thisflag in $ldflags; do
+ case "$thisflag" in
+ -L*)
+ case " $dflt " in
+ *" $thisflag "*) ;;
+ *) dflt="$dflt $thisflag" ;;
+ esac
+ ;;
esac
- ;;
- esac
-done
+ done
-case "$dflt" in
-'') dflt='none' ;;
-esac
+ case "$dflt" in
+ ''|' ') dflt='none' ;;
+ esac
rp="Any special flags to pass to $ld to create a dynamically loaded library?"
. ./myread
sunos) dflt='none' ;;
*) dflt='none' ;;
esac ;;
+ ' ') dflt='none' ;;
*) dflt="$ccdlflags" ;;
esac
rp="Any special flags to pass to $cc to use dynamic loading?"
*) $cat >&4 <<EOM
WARNING: Use of the shrpdir variable for the installation location of
the shared $libperl is not supported. It was never documented and
-will not work in this version. Let me (doughera@lafcol.lafayette.edu)
+will not work in this version. Let me (doughera@lafayette.edu)
know of any problems this may cause.
EOM
fi
: determine where site specific libraries go.
-set sitelib sitelib
-eval $prefixit
-case "$sitelib" in
-'')
- prog=`echo $package | $sed 's/-*[0-9.]*$//'`
- dflt="$privlib/site_$prog" ;;
-*) dflt="$sitelib" ;;
+: Usual default is /usr/local/lib/perl5/site_perl/$apiversion/share
+prog=`echo $package | $sed 's/-*[0-9.]*$//'`
+case "$prefix" in
+*perl*) set dflt sitelib lib/site_$prog/$apiversion/share ;;
+*) set dflt sitelib lib/$package/site_$prog/$apiversion/share ;;
esac
+eval $prefixit
$cat <<EOM
The installation process will also create a directory for
fi
: determine where site specific architecture-dependent libraries go.
-xxx=`echo $sitelib/$archname | sed 's!^$prefix!!'`
-: xxx is usuually lib/site_perl/archname.
+: sitelib default is /usr/local/lib/perl5/site_perl/$apiversion/share
+: sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
+tdflt=`echo $sitelib | $sed 's,/share$,,'`
+tdflt="$tdflt/$archname"
set sitearch sitearch none
eval $prefixit
case "$sitearch" in
-'') dflt="$sitelib/$archname" ;;
+'') dflt="$tdflt" ;;
*) dflt="$sitearch" ;;
esac
$cat <<EOM
$xxx i32;
double f, g;
int result = 0;
+ char str[16];
signal(SIGFPE, blech);
- /* Don't let compiler optimize the test away */
- sscanf("2147483647", "%lf", &f); /* f = (double) 0x7fffffff; */
+ /* Don't let compiler optimize the test away. Store the number
+ in a writable string for gcc to pass to sscanf under HP/UX.
+ */
+ sprintf(str, "2147483647");
+ sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
g = 10 * f;
i32 = ($xxx) g;
unsigned int aint;
unsigned short ashort;
int result = 0;
+ char str[16];
+
/* Frustrate gcc-2.7.2's optimizer which failed this test with
a direct f = -123. assignment. gcc-2.8.0 reportedly
optimized the whole file away
*/
- sscanf("-123.", "%lf", &f); /* f = -123.; */
+ /* Store the number in a writable string for gcc to pass to
+ sscanf under HP/UX.
+ */
+ sprintf(str, "-123");
+ sscanf(str, "%lf", &f); /* f = -123.; */
signal(SIGFPE, blech);
along = (unsigned long)f;
result |= 1;
if (ashort != (unsigned short)-123)
result |= 1;
- sscanf("1073741824.", "%lf", &f); /* f = (double)0x40000000; */
+ sprintf(str, "1073741824.");
+ sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
f = f + f;
along = 0;
along = (unsigned long)f;
if (result)
exit(result);
signal(SIGFPE, blech_in_list);
- sscanf("123.", "%lf", &f); /* f = 123.; */
+ sprintf(str, "123.");
+ sscanf(str, "%lf", &f); /* f = 123.; */
along = dummy_long((unsigned long)f);
aint = dummy_int((unsigned int)f);
ashort = dummy_short((unsigned short)f);
set mkfifo d_mkfifo
eval $inlibc
-: see if mkstemp exists
-set mkstemp d_mkstemp
-eval $inlibc
-
: see if mktime exists
set mktime d_mktime
eval $inlibc
set d_msg
eval $setvar
-: see if this is a malloc.h system
-set malloc.h i_malloc
-eval $inhdr
-
-: see if stdlib is available
-set stdlib.h i_stdlib
-eval $inhdr
-
-: determine which malloc to compile in
-echo " "
-case "$usemymalloc" in
-''|y*|true) dflt='y' ;;
-n*|false) dflt='n' ;;
-*) dflt="$usemymalloc" ;;
-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
- ;;
- esac
- ;;
-*)
- usemymalloc='n'
- mallocsrc=''
- mallocobj=''
- d_mymalloc="$undef"
- ;;
-esac
-
-: 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]
: see if nice exists
set nice d_nice
eval $inlibc
set d_sem
eval $setvar
-: see how to do semctl IPC_STAT
-case "$h_sem$d_sem$d_semctl" in
-true$define$define)
- : see whether sys/sem.h defines union semun
- $cat > try.c <<'END'
+: see whether sys/sem.h defines union semun
+echo " "
+$cat > try.c <<'END'
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
int main () { union semun semun; semun.buf = 0; }
END
- if $cc $ccflags -o try try.c > /dev/null 2>&1; then
- echo "You have union semun in <sys/sem.h>." >&4
- val="$define"
- else
- echo "You do not have union semun in <sys/sem.h>." >&4
- val="$undef"
- fi
- $rm -f try try.c
- set d_union_semun
- eval $setvar
+set try
+if eval $compile; then
+ echo "You have union semun in <sys/sem.h>." >&4
+ val="$define"
+else
+ echo "You do not have union semun in <sys/sem.h>." >&4
+ val="$undef"
+fi
+$rm -f try try.c
+set d_union_semun
+eval $setvar
+: see how to do semctl IPC_STAT
+case "$d_sem" in
+$define)
: see whether semctl IPC_STAT can use union semun
+ echo " "
$cat > try.c <<END
#include <sys/types.h>
#include <sys/ipc.h>
#endif
#$d_union_semun HAS_UNION_SEMUN
int main() {
- union semun
+ union semun
#ifndef HAS_UNION_SEMUN
- {
- int val;
- struct semid_ds *buf;
- unsigned short *array;
- }
+ {
+ int val;
+ struct semid_ds *buf;
+ unsigned short *array;
+ }
#endif
arg;
- int sem, st;
-
-#if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && \
- defined(S_IRWXO) && defined(IPC_CREAT)
- sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
- if (sem > -1) {
- struct semid_ds argbuf;
- arg.buf = &argbuf;
-# ifdef IPC_STAT
- st = semctl(sem, 0, IPC_STAT, arg);
- if (st == 0)
- printf("semun\n");
- else
-# endif /* IPC_STAT */
- printf("semctl IPC_STAT failed: errno = %d\n", errno);
-# ifdef IPC_RMID
- if (semctl(sem, 0, IPC_RMID, arg) != 0)
-# endif /* IPC_RMID */
- printf("semctl IPC_RMID failed: errno = %d\n", errno);
- } else
+ int sem, st;
+
+#if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
+ sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
+ if (sem > -1) {
+ struct semid_ds argbuf;
+ arg.buf = &argbuf;
+# ifdef IPC_STAT
+ st = semctl(sem, 0, IPC_STAT, arg);
+ if (st == 0)
+ printf("semun\n");
+ else
+# endif /* IPC_STAT */
+ printf("semctl IPC_STAT failed: errno = %d\n", errno);
+# ifdef IPC_RMID
+ if (semctl(sem, 0, IPC_RMID, arg) != 0)
+# endif /* IPC_RMID */
+ printf("semctl IPC_RMID failed: errno = %d\n", errno);
+ } else
#endif /* IPC_PRIVATE && ... */
- printf("semget failed: errno = %d\n", errno);
-
+ printf("semget failed: errno = %d\n", errno);
return 0;
}
END
val="$undef"
- if $cc $ccflags -o try try.c > /dev/null 2>&1; then
- d_semctl_semun=`./try`
- case "$d_semctl_semun" in
+ set try
+ if eval $compile; then
+ xxx=`./try`
+ case "$xxx" in
semun) val="$define" ;;
esac
fi
set d_semctl_semun
eval $setvar
case "$d_semctl_semun" in
- $define|true)
+ $define)
echo "You can use union semun for semctl IPC_STAT." >&4
+ also='also'
;;
*) echo "You cannot use union semun for semctl IPC_STAT." >&4
+ also=''
;;
esac
: see whether semctl IPC_STAT can use struct semid_ds pointer
-
$cat > try.c <<'END'
#include <sys/types.h>
#include <sys/ipc.h>
extern int errno;
#endif
int main() {
- struct semid_ds arg;
- int sem, st;
-
-#if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && \
- defined(S_IRWXO) && defined(IPC_CREAT)
- sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
- if (sem > -1) {
-# ifdef IPC_STAT
- st = semctl(sem, 0, IPC_STAT, &arg);
- if (st == 0)
- printf("semid_ds\n");
- else
-# endif /* IPC_STAT */
- printf("semctl IPC_STAT failed: errno = %d\n", errno);
-# ifdef IPC_RMID
- if (semctl(sem, 0, IPC_RMID, &arg) != 0)
-# endif /* IPC_RMID */
- printf("semctl IPC_RMID failed: errno = %d\n", errno);
- } else
+ struct semid_ds arg;
+ int sem, st;
+
+#if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
+ sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
+ if (sem > -1) {
+# ifdef IPC_STAT
+ st = semctl(sem, 0, IPC_STAT, &arg);
+ if (st == 0)
+ printf("semid_ds\n");
+ else
+# endif /* IPC_STAT */
+ printf("semctl IPC_STAT failed: errno = %d\n", errno);
+# ifdef IPC_RMID
+ if (semctl(sem, 0, IPC_RMID, &arg) != 0)
+# endif /* IPC_RMID */
+ printf("semctl IPC_RMID failed: errno = %d\n", errno);
+ } else
#endif /* IPC_PRIVATE && ... */
- printf("semget failed: errno = %d\n", errno);
+ printf("semget failed: errno = %d\n", errno);
- return 0;
+ return 0;
}
END
val="$undef"
- if $cc $ccflags -o try try.c > /dev/null 2>&1; then
- d_semctl_semid_ds=`./try`
- case "$d_semctl_semid_ds" in
+ set try
+ if eval $compile; then
+ xxx=`./try`
+ case "$xxx" in
semid_ds) val="$define" ;;
esac
fi
set d_semctl_semid_ds
eval $setvar
case "$d_semctl_semid_ds" in
- $define|true)
- echo "You can use struct semid_ds * for semctl IPC_STAT." >&4
+ $define)
+ echo "You can $also use struct semid_ds * for semctl IPC_STAT." >&4
;;
*) echo "You cannot use struct semid_ds * for semctl IPC_STAT." >&4
;;
;;
*) val="$undef"
- set d_union_semun
- eval $setvar
+ # We do not have the full sem*(2) library, so assume we can not
+ # use either.
set d_semctl_semun
eval $setvar
set sys/ndir.h i_sysndir
eval $inhdr
+: see if sys/types.h has to be included
+set sys/types.h i_systypes
+eval $inhdr
+
: see if closedir exists
set closedir d_closedir
eval $inlibc
#$i_dirent I_DIRENT /**/
#$i_sysdir I_SYS_DIR /**/
#$i_sysndir I_SYS_NDIR /**/
+#$i_systypes I_SYS_TYPES /**/
+#if defined(I_SYS_TYPES)
+#include <sys/types.h>
+#endif
#if defined(I_DIRENT)
#include <dirent.h>
#if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
: check for void type
echo " "
echo "Checking to see how well your C compiler groks the void type..." >&4
-echo " "
-$cat >&4 <<EOM
- Support flag bits are:
- 1: basic void declarations.
- 2: arrays of pointers to functions returning void.
- 4: operations between pointers to and addresses of void functions.
- 8: generic void pointers.
-EOM
-echo " "
case "$voidflags" in
'')
$cat >try.c <<'EOCP'
EOCP
if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
voidflags=$defvoidused
- echo "It appears to support void to the level $package wants ($defvoidused)."
+ echo "Good. It appears to support void to the level $package wants.">&4
if $contains warning .out >/dev/null 2>&1; then
echo "However, you might get some warnings that look like this:"
$cat .out
esac
case "$voidflags" in
"$defvoidused") ;;
-*)
+*) $cat >&4 <<'EOM'
+ Support flag bits are:
+ 1: basic void declarations.
+ 2: arrays of pointers to functions returning void.
+ 4: operations between pointers to and addresses of void functions.
+ 8: generic void pointers.
+EOM
dflt="$voidflags";
rp="Your void support flags add up to what?"
. ./myread
set sys/stat.h i_sysstat
eval $inhdr
-: see if sys/types.h has to be included
-set sys/types.h i_systypes
-eval $inhdr
-
: see if this is a sys/un.h system
set sys/un.h i_sysun
eval $inhdr
: If we are using the old config.sh, known_extensions may contain
: old or inaccurate or duplicate values.
known_extensions=''
+nonxs_extensions=''
: We do not use find because it might not be available.
: We do not just use MANIFEST because the user may have dropped
: some additional extensions into the source tree and expect them
DynaLoader) ;;
*) if $test -f $xxx/$xxx.xs; then
known_extensions="$known_extensions $xxx"
+ elif $test -f $xxx/Makefile.PL; then
+ nonxs_extensions="$nonxs_extensions $xxx"
else
if $test -d $xxx; then
+ # Look for nested extensions, eg. Devel/Dprof.
cd $xxx
for yyy in * ; do
if $test -f $yyy/$yyy.xs; then
known_extensions="$known_extensions $xxx/$yyy"
+ elif $test -f $yyy/Makefile.PL; then
+ nonxs_extensions="$nonxs_extensions $xxx/$yyy"
fi
done
cd ..
;;
esac
done
+set X $nonxs_extensions
+shift
+nonxs_extensions="$*"
set X $known_extensions
shift
known_extensions="$*"
shift
avail_ext="$*"
+: Now see which nonxs extensions are supported on this system.
+: For now assume all are.
+nonxs_ext=''
+for xxx in $nonxs_extensions ; do
+ case "$xxx" in
+ *) nonxs_ext="$nonxs_ext $xxx"
+ ;;
+ esac
+done
+
+set X $nonxs_ext
+shift
+nonxs_ext="$*"
+
case $usedl in
$define)
$cat <<EOM
esac
;;
esac
+ : Exclude those that are not xs extensions
case "$dflt" in
'') dflt=none;;
esac
;;
esac
-set X $dynamic_ext $static_ext
+set X $dynamic_ext $static_ext $nonxs_ext
shift
extensions="$*"
alignbytes='$alignbytes'
ansi2knr='$ansi2knr'
aphostname='$aphostname'
+apiversion='$apiversion'
ar='$ar'
archlib='$archlib'
archlibexp='$archlibexp'
d_memset='$d_memset'
d_mkdir='$d_mkdir'
d_mkfifo='$d_mkfifo'
-d_mkstemp='$d_mkstemp'
d_mktime='$d_mktime'
d_msg='$d_msg'
d_msgctl='$d_msgctl'
d_select='$d_select'
d_sem='$d_sem'
d_semctl='$d_semctl'
+d_semctl_semid_ds='$d_semctl_semid_ds'
+d_semctl_semun='$d_semctl_semun'
d_semget='$d_semget'
d_semop='$d_semop'
-d_union_semun='$d_union_semun'
-d_semctl_semun='$d_semctl_semun'
-d_semctl_semid_ds='$d_semctl_semid_ds'
d_setegid='$d_setegid'
d_seteuid='$d_seteuid'
d_setgrps='$d_setgrps'
d_tzname='$d_tzname'
d_umask='$d_umask'
d_uname='$d_uname'
+d_union_semun='$d_union_semun'
d_vfork='$d_vfork'
d_void_closedir='$d_void_closedir'
d_voidsig='$d_voidsig'
nm='$nm'
nm_opt='$nm_opt'
nm_so_opt='$nm_so_opt'
+nonxs_ext='$nonxs_ext'
nroff='$nroff'
o_nonblock='$o_nonblock'
obj_ext='$obj_ext'
usevfork='$usevfork'
usrinc='$usrinc'
uuname='$uuname'
+version='$version'
vi='$vi'
voidflags='$voidflags'
xlibpth='$xlibpth'
zip='$zip'
EOT
+: Add in command line options if available
+$test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
+
: add special variables
$test -f $src/patchlevel.h && \
awk '/^#define/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh