Mailing List Archive

Patch for Perl Configure against Andy's last patch 5.001m+
Unfortunately, Andy did not incorporate second set of patches that I
sent him in his 001m+ patch. Below is the relevant patch for Configure
(I do not know dist :-().

It fixes missing $ldflags, and introduces configurable extensions for
archives and objects, additional types of archives handled (plus
coupla other useful guys and workarounds for bugs).

Additional variables do not deserve interactive setting, only from hints.

Ilya

*** Configure.orig Thu Jun 22 08:03:48 1995
--- Configure Wed Sep 27 23:33:26 1995
***************
*** 541,546 ****
--- 541,553 ----
defvoidused=''
voidflags=''
CONFIG=''
+ archobjs=''
+ obj_ext='o'
+ lib_ext='a'
+ exe_ext=
+ ar='ar'
+ plibext=
+ path_sep=$p_

define='define'
undef='undef'
***************
*** 1334,1340 ****
say=offhand
for file in $trylist; do
xxx=`./loc $file $file $pth`
! eval $file=$xxx
eval _$file=$xxx
case "$xxx" in
/*)
--- 1341,1349 ----
say=offhand
for file in $trylist; do
xxx=`./loc $file $file $pth`
! if test "X$file" != "X$xxx" ; then
! eval $file=$xxx
! fi
eval _$file=$xxx
case "$xxx" in
/*)
***************
*** 2120,2126 ****
exit(0);
}
EOM
! if $cc -o gccvers gccvers.c >/dev/null 2>&1; then
gccversion=`./gccvers`
case "$gccversion" in
'') echo "You are not using GNU cc." ;;
--- 2129,2135 ----
exit(0);
}
EOM
! if $cc -o gccvers gccvers.c $ldflags >/dev/null 2>&1; then
gccversion=`./gccvers`
case "$gccversion" in
'') echo "You are not using GNU cc." ;;
***************
*** 2938,2943 ****
--- 2947,2958 ----
*"-l$thislib "*);;
*) dflt="$dflt -l$thislib";;
esac
+ elif xxx=`./loc $thislib.lib X $libpth`; $test -f "$xxx"; then
+ echo "Found -l$thislib."
+ case " $dflt " in
+ *"-l$thislib "*);;
+ *) dflt="$dflt -l$thislib";;
+ esac
else
echo "No -l$thislib."
fi
***************
*** 3051,3062 ****
:
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 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
--- 3066,3079 ----
:
elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
:
! elif try=`./loc lib$thislib.$lib_ext 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 $thislib.$lib_ext X $libpth`; $test -f "$try"; then
+ :
elif try=`./loc Slib$thislib.a X $xlibpth`; $test -f "$try"; then
:
else
***************
*** 3105,3115 ****
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
--- 3122,3132 ----
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.$lib_ext; then
! libc=$incpath/usr/lib/libc.$lib_ext;
echo "Your C library seems to be in $libc. That's fine."
! elif $test -r /lib/libc.$lib_ext; then
! libc=/lib/libc.$lib_ext;
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
***************
*** 3218,3223 ****
--- 3235,3244 ----
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
else
nm -p $* 2>/dev/null >libc.tmp
$grep fprintf libc.tmp > libc.ptf
***************
*** 3228,3250 ****
eval $xrun
else
echo " "
! echo "nm didn't seem to work right. Trying ar instead..." >&4
com=''
! if ar t $libc > libc.tmp; then
for thisname in $libnames; do
! ar t $thisname >>libc.tmp
done
! $sed -e 's/\.o$//' < 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
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
--- 3249,3272 ----
eval $xrun
else
echo " "
! echo "nm didn't seem to work right. Trying $ar instead..." >&4
com=''
! if test "X$osname" = "Xos2"; then ar_opt=tv ; else ar_opt=t ;fi
! if $ar $ar_opt $libc > libc.tmp; then
for thisname in $libnames; do
! $ar $ar_opt $thisname >>libc.tmp
done
! $sed -e 's/\.o$//' -e 's/^ \+//' < libc.tmp | grep -v "^IMPORT#" > 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
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
***************
*** 3816,3822 ****
printf("%d\n", sizeof(int));
}
EOCP
! if $cc $ccflags try.c -o try >/dev/null 2>&1 ; then
dflt=`./try`
else
dflt='4'
--- 3838,3844 ----
printf("%d\n", sizeof(int));
}
EOCP
! if $cc $ccflags $ldflags try.c -o try >/dev/null 2>&1 ; then
dflt=`./try`
else
dflt='4'
***************
*** 3898,3904 ****
exit(result);
}
EOCP
! if $cc -o try $ccflags try.c >/dev/null 2>&1; then
./try
yyy=$?
else
--- 3920,3926 ----
exit(result);
}
EOCP
! if $cc -o try $ccflags try.c $ldflags >/dev/null 2>&1; then
./try
yyy=$?
else
***************
*** 3979,3985 ****

}
EOCP
! if $cc -o try $ccflags try.c >/dev/null 2>&1; then
./try
castflags=$?
else
--- 4001,4007 ----

}
EOCP
! if $cc -o try $ccflags try.c $ldflags >/dev/null 2>&1; then
./try
castflags=$?
else
***************
*** 4018,4024 ****
exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
}
EOF
! if $cc $ccflags vprintf.c -o vprintf >/dev/null 2>&1 && ./vprintf; then
echo "Your vsprintf() returns (int)." >&4
val2="$undef"
else
--- 4040,4046 ----
exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
}
EOF
! if $cc $ccflags vprintf.c $ldflags -o vprintf >/dev/null 2>&1 && ./vprintf; then
echo "Your vsprintf() returns (int)." >&4
val2="$undef"
else
***************
*** 4088,4094 ****
cryptlib=-lcrypt
fi
if $test -z "$cryptlib"; then
! cryptlib=`./loc libcrypt.a "" $libpth`
else
cryptlib=-lcrypt
fi
--- 4110,4116 ----
cryptlib=-lcrypt
fi
if $test -z "$cryptlib"; then
! cryptlib=`./loc libcrypt.$lib_ext "" $libpth`
else
cryptlib=-lcrypt
fi
***************
*** 4584,4590 ****
}
EOM
if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
! $ld $lddlflags -o dyna.$dlext dyna.o > /dev/null 2>&1 &&
$cc $ccflags $ldflags $cccdlflags $ccdlflags fred.c -o fred $libs > /dev/null 2>&1; then
xxx=`./fred`
case $xxx in
--- 4606,4612 ----
}
EOM
if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
! $ld $lddlflags -o dyna.$dlext dyna.$obj_ext > /dev/null 2>&1 &&
$cc $ccflags $ldflags $cccdlflags $ccdlflags fred.c -o fred $libs > /dev/null 2>&1; then
xxx=`./fred`
case $xxx in
***************
*** 5055,5061 ****
y*|true)
usemymalloc='y'
mallocsrc='malloc.c'
! mallocobj='malloc.o'
d_mymalloc="$define"
case "$libs" in
*-lmalloc*)
--- 5077,5083 ----
y*|true)
usemymalloc='y'
mallocsrc='malloc.c'
! mallocobj="malloc.$obj_ext"
d_mymalloc="$define"
case "$libs" in
*-lmalloc*)
***************
*** 5143,5149 ****
EOCP
: check sys/file.h first to get FREAD on Sun
if $test `./findhdr sys/file.h` && \
! $cc $cppflags "-DI_SYS_FILE" open3.c -o open3 >/dev/null 2>&1 ; then
h_sysfile=true;
echo "<sys/file.h> defines the O_* constants..." >&4
if ./open3; then
--- 5165,5171 ----
EOCP
: check sys/file.h first to get FREAD on Sun
if $test `./findhdr sys/file.h` && \
! $cc $cppflags $ldflags "-DI_SYS_FILE" open3.c -o open3 >/dev/null 2>&1 ; then
h_sysfile=true;
echo "<sys/file.h> defines the O_* constants..." >&4
if ./open3; then
***************
*** 5154,5160 ****
val="$undef"
fi
elif $test `./findhdr fcntl.h` && \
! $cc "-DI_FCNTL" open3.c -o open3 >/dev/null 2>&1 ; then
h_fcntl=true;
echo "<fcntl.h> defines the O_* constants..." >&4
if ./open3; then
--- 5176,5182 ----
val="$undef"
fi
elif $test `./findhdr fcntl.h` && \
! $cc "-DI_FCNTL" $ldflags open3.c -o open3 >/dev/null 2>&1 ; then
h_fcntl=true;
echo "<fcntl.h> defines the O_* constants..." >&4
if ./open3; then
***************
*** 5587,5596 ****
: we will have to assume that it supports the 4.2 BSD interface
d_oldsock="$undef"
else
! echo "You don't have Berkeley networking in libc.a..." >&4
! if test -f /usr/lib/libnet.a; then
! ( (nm $nm_opt /usr/lib/libnet.a | eval $nm_extract) || \
! ar t /usr/lib/libnet.a) 2>/dev/null >> libc.list
if $contains socket libc.list >/dev/null 2>&1; then
echo "...but the Wollongong group seems to have hacked it in." >&4
socketlib="-lnet"
--- 5609,5618 ----
: we will have to assume that it supports the 4.2 BSD interface
d_oldsock="$undef"
else
! echo "You don't have Berkeley networking in libc.$lib_ext..." >&4
! if test -f /usr/lib/libnet.$lib_ext; then
! ( (nm $nm_opt /usr/lib/libnet.$lib_ext | eval $nm_extract) || \
! $ar t /usr/lib/libnet.$lib_ext) 2>/dev/null >> libc.list
if $contains socket libc.list >/dev/null 2>&1; then
echo "...but the Wollongong group seems to have hacked it in." >&4
socketlib="-lnet"
***************
*** 5603,5609 ****
d_oldsock="$define"
fi
else
! echo "or even in libnet.a, which is peculiar." >&4
d_socket="$undef"
d_oldsock="$undef"
fi
--- 5625,5631 ----
d_oldsock="$define"
fi
else
! echo "or even in libnet.$lib_ext, which is peculiar." >&4
d_socket="$undef"
d_oldsock="$undef"
fi
***************
*** 6284,6290 ****
printf("%d\n", (char *)&try.bar - (char *)&try.foo);
}
EOCP
! if $cc $ccflags try.c -o try >/dev/null 2>&1; then
dflt=`./try`
else
dflt='8'
--- 6306,6312 ----
printf("%d\n", (char *)&try.bar - (char *)&try.foo);
}
EOCP
! if $cc $ccflags $ldflags try.c -o try >/dev/null 2>&1; then
dflt=`./try`
else
dflt='8'
***************
*** 6362,6368 ****
printf("\n");
}
EOCP
! if $cc $ccflags try.c -o try >/dev/null 2>&1 ; then
dflt=`./try`
case "$dflt" in
????|????????) echo "(The test program ran ok.)";;
--- 6384,6390 ----
printf("\n");
}
EOCP
! if $cc $ccflags $ldflags try.c -o try >/dev/null 2>&1 ; then
dflt=`./try`
case "$dflt" in
????|????????) echo "(The test program ran ok.)";;
***************
*** 7081,7087 ****
printf("%d\n",i);
}
EOCP
! if $cc try.c -o try >/dev/null 2>&1 ; then
dflt=`try`
else
dflt='?'
--- 7103,7109 ----
printf("%d\n",i);
}
EOCP
! if $cc $ldflags try.c -o try >/dev/null 2>&1 ; then
dflt=`try`
else
dflt='?'
***************
*** 7108,7125 ****
$cc $ccflags -c bar1.c >/dev/null 2>&1
$cc $ccflags -c bar2.c >/dev/null 2>&1
$cc $ccflags -c foo.c >/dev/null 2>&1
! ar rc bar.a bar2.o bar1.o >/dev/null 2>&1
! if $cc $ccflags $ldflags -o foobar foo.o bar.a $libs > /dev/null 2>&1 &&
./foobar >/dev/null 2>&1; then
! echo "ar appears to generate random libraries itself."
orderlib=false
ranlib=":"
! elif ar ts bar.a >/dev/null 2>&1 &&
! $cc $ccflags $ldflags -o foobar foo.o bar.a $libs > /dev/null 2>&1 &&
./foobar >/dev/null 2>&1; then
echo "a table of contents needs to be added with 'ar ts'."
orderlib=false
! ranlib="ar ts"
else
case "$ranlib" in
:) ranlib='';;
--- 7130,7147 ----
$cc $ccflags -c bar1.c >/dev/null 2>&1
$cc $ccflags -c bar2.c >/dev/null 2>&1
$cc $ccflags -c foo.c >/dev/null 2>&1
! $ar rc bar.$lib_ext bar2.$obj_ext bar1.$obj_ext >/dev/null 2>&1
! if $cc $ccflags $ldflags -o foobar foo.$obj_ext bar.$lib_ext $libs > /dev/null 2>&1 &&
./foobar >/dev/null 2>&1; then
! echo "$ar appears to generate random libraries itself."
orderlib=false
ranlib=":"
! elif $ar ts bar.$lib_ext >/dev/null 2>&1 &&
! $cc $ccflags $ldflags -o foobar foo.$obj_ext bar.$lib_ext $libs > /dev/null 2>&1 &&
./foobar >/dev/null 2>&1; then
echo "a table of contents needs to be added with 'ar ts'."
orderlib=false
! ranlib="$ar ts"
else
case "$ranlib" in
:) ranlib='';;
***************
*** 7244,7250 ****
'') $echo $n ".$c"
if $cc $ccflags \
$i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone \
! try.c -o try >/dev/null 2>&1 ; then
set X $i_time $i_systime $i_systimek $sysselect $s_timeval
shift
flags="$*"
--- 7266,7272 ----
'') $echo $n ".$c"
if $cc $ccflags \
$i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone \
! try.c -o try $ldflags >/dev/null 2>&1 ; then
set X $i_time $i_systime $i_systimek $sysselect $s_timeval
shift
flags="$*"
***************
*** 7313,7319 ****
#endif
}
EOCP
! if $cc $ccflags -DTRYBITS fd_set.c -o fd_set >fd_set.out 2>&1 ; then
d_fds_bits="$define"
d_fd_set="$define"
echo "Well, your system knows about the normal fd_set typedef..." >&4
--- 7335,7341 ----
#endif
}
EOCP
! if $cc $ccflags $ldflags -DTRYBITS fd_set.c -o fd_set >fd_set.out 2>&1 ; then
d_fds_bits="$define"
d_fd_set="$define"
echo "Well, your system knows about the normal fd_set typedef..." >&4
***************
*** 7330,7336 ****
$cat <<'EOM'
Hmm, your compiler has some difficulty with fd_set. Checking further...
EOM
! if $cc $ccflags fd_set.c -o fd_set >fd_set.out 2>&1 ; then
d_fds_bits="$undef"
d_fd_set="$define"
echo "Well, your system has some sort of fd_set available..." >&4
--- 7352,7358 ----
$cat <<'EOM'
Hmm, your compiler has some difficulty with fd_set. Checking further...
EOM
! if $cc $ccflags $ldflags fd_set.c -o fd_set >fd_set.out 2>&1 ; then
d_fds_bits="$undef"
d_fd_set="$define"
echo "Well, your system has some sort of fd_set available..." >&4
***************
*** 7907,7913 ****
else
echo "false"
fi
! $rm -f varargs.o
EOP
chmod +x varargs

--- 7929,7935 ----
else
echo "false"
fi
! $rm -f varargs.$obj_ext
EOP
chmod +x varargs

***************
*** 8050,8060 ****
echo " "
echo "Stripping down executable paths..." >&4
for file in $loclist $trylist; do
! eval $file="\$file"
done
;;
esac

: create config.sh file
echo " "
echo "Creating config.sh..." >&4
--- 8072,8085 ----
echo " "
echo "Stripping down executable paths..." >&4
for file in $loclist $trylist; do
! if test X$file != Xln -o X$osname != Xos2; then eval $file="\$file"; fi
done
;;
esac

+ # Setup libraries for linking miniperl (if not set already)
+ : ${cldlibs="$libs $cryptlib"}
+
: create config.sh file
echo " "
echo "Creating config.sh..." >&4
***************
*** 8109,8114 ****
--- 8134,8140 ----
chmod='$chmod'
chown='$chown'
clocktype='$clocktype'
+ cldlibs='$cldlibs'
comm='$comm'
compress='$compress'
contains='$contains'
***************
*** 8302,8307 ****
--- 8328,8334 ----
expr='$expr'
extensions='$extensions'
find='$find'
+ firstmakefile='$firstmakefile'
flex='$flex'
fpostype='$fpostype'
freetype='$freetype'
***************
*** 8504,8509 ****
--- 8531,8543 ----
voidflags='$voidflags'
xlibpth='$xlibpth'
zcat='$zcat'
+ archobjs='$archobjs'
+ obj_ext='$obj_ext'
+ lib_ext='$lib_ext'
+ exe_ext='$exe_ext'
+ ar='$ar'
+ plibext='$plibext'
+ path_sep='$path_sep'
EOT

: add special variables
Re: Patch for Perl Configure against Andy's last patch 5.001m+ [ In reply to ]
Ilya Zakharevich writes:
>
> Unfortunately, Andy did not incorporate second set of patches that I
> sent him in his 001m+ patch. Below is the relevant patch for Configure
> (I do not know dist :-().
>
> It fixes missing $ldflags, and introduces configurable extensions for
> archives and objects, additional types of archives handled (plus
> coupla other useful guys and workarounds for bugs).
>
> Additional variables do not deserve interactive setting, only from hints.
>
> Ilya
>

Of course I sent a wrong file, zillions of apologies :-(.

diff -cr ..\perl5os2.patch\perl5.001m.andy/Configure ./Configure
*** ../perl5os2.patch/perl5.001m.andy/Configure Mon Oct 09 21:40:50 1995
--- ./Configure Wed Sep 27 23:58:42 1995
***************
*** 554,559 ****
--- 554,566 ----
defvoidused=''
voidflags=''
CONFIG=''
+ archobjs=''
+ obj_ext='o'
+ lib_ext='a'
+ exe_ext=
+ ar='ar'
+ plibext=
+ path_sep=$p_

define='define'
undef='undef'
***************
*** 1356,1362 ****
say=offhand
for file in $trylist; do
xxx=`./loc $file $file $pth`
! eval $file=$xxx
eval _$file=$xxx
case "$xxx" in
/*)
--- 1363,1371 ----
say=offhand
for file in $trylist; do
xxx=`./loc $file $file $pth`
! if test "X$file" != "X$xxx" ; then
! eval $file=$xxx
! fi
eval _$file=$xxx
case "$xxx" in
/*)
***************
*** 2149,2155 ****
exit(0);
}
EOM
! if $cc -o gccvers gccvers.c >/dev/null 2>&1; then
gccversion=`./gccvers`
case "$gccversion" in
'') echo "You are not using GNU cc." ;;
--- 2158,2164 ----
exit(0);
}
EOM
! if $cc -o gccvers gccvers.c $ldflags >/dev/null 2>&1; then
gccversion=`./gccvers`
case "$gccversion" in
'') echo "You are not using GNU cc." ;;
***************
*** 3844,3849 ****
--- 3853,3864 ----
*"-l$thislib "*);;
*) dflt="$dflt -l$thislib";;
esac
+ elif xxx=`./loc $thislib.lib X $libpth`; $test -f "$xxx"; then
+ echo "Found -l$thislib."
+ case " $dflt " in
+ *"-l$thislib "*);;
+ *) dflt="$dflt -l$thislib";;
+ esac
else
echo "No -l$thislib."
fi
***************
*** 3957,3968 ****
:
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 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
--- 3972,3985 ----
:
elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
:
! elif try=`./loc lib$thislib.$lib_ext 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 $thislib.$lib_ext X $libpth`; $test -f "$try"; then
+ :
elif try=`./loc Slib$thislib.a X $xlibpth`; $test -f "$try"; then
:
else
***************
*** 4011,4021 ****
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
--- 4028,4038 ----
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.$lib_ext; then
! libc=$incpath/usr/lib/libc.$lib_ext;
echo "Your C library seems to be in $libc. That's fine."
! elif $test -r /lib/libc.$lib_ext; then
! libc=/lib/libc.$lib_ext;
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
***************
*** 4128,4133 ****
--- 4145,4154 ----
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
else
nm -p $* 2>/dev/null >libc.tmp
$grep fprintf libc.tmp > libc.ptf
***************
*** 4138,4160 ****
eval $xrun
else
echo " "
! echo "nm didn't seem to work right. Trying ar instead..." >&4
com=''
! if ar t $libc > libc.tmp; then
for thisname in $libnames; do
! ar t $thisname >>libc.tmp
done
! $sed -e 's/\.o$//' < 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
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
--- 4159,4182 ----
eval $xrun
else
echo " "
! echo "nm didn't seem to work right. Trying $ar instead..." >&4
com=''
! if test "X$osname" = "Xos2"; then ar_opt=tv ; else ar_opt=t ;fi
! if $ar $ar_opt $libc > libc.tmp; then
for thisname in $libnames; do
! $ar $ar_opt $thisname >>libc.tmp
done
! $sed -e 's/\.o$//' -e 's/^ \+//' < libc.tmp | grep -v "^IMPORT#" > 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
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
***************
*** 4500,4506 ****
exit(0);
}
EOCP
! if $cc $ccflags try.c -o try >/dev/null 2>&1 && ./try > /dev/null; then
intsize=`./try`
else
dflt='4'
--- 4522,4528 ----
exit(0);
}
EOCP
! if $cc $ccflags $ldflags try.c -o try >/dev/null 2>&1 && ./try > /dev/null; then
intsize=`./try`
else
dflt='4'
***************
*** 4579,4585 ****
exit(result);
}
EOCP
! if $cc -o try $ccflags try.c >/dev/null 2>&1; then
./try
yyy=$?
else
--- 4601,4607 ----
exit(result);
}
EOCP
! if $cc -o try $ccflags try.c $ldflags >/dev/null 2>&1; then
./try
yyy=$?
else
***************
*** 4660,4666 ****

}
EOCP
! if $cc -o try $ccflags try.c >/dev/null 2>&1; then
./try
castflags=$?
else
--- 4682,4688 ----

}
EOCP
! if $cc -o try $ccflags try.c $ldflags >/dev/null 2>&1; then
./try
castflags=$?
else
***************
*** 4699,4705 ****
exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
}
EOF
! if $cc $ccflags vprintf.c -o vprintf >/dev/null 2>&1 && ./vprintf; then
echo "Your vsprintf() returns (int)." >&4
val2="$undef"
else
--- 4721,4727 ----
exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
}
EOF
! if $cc $ccflags vprintf.c $ldflags -o vprintf >/dev/null 2>&1 && ./vprintf; then
echo "Your vsprintf() returns (int)." >&4
val2="$undef"
else
***************
*** 4769,4775 ****
cryptlib=-lcrypt
fi
if $test -z "$cryptlib"; then
! cryptlib=`./loc libcrypt.a "" $libpth`
else
cryptlib=-lcrypt
fi
--- 4791,4797 ----
cryptlib=-lcrypt
fi
if $test -z "$cryptlib"; then
! cryptlib=`./loc libcrypt.$lib_ext "" $libpth`
else
cryptlib=-lcrypt
fi
***************
*** 5276,5282 ****
}
EOM
if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
! $ld $lddlflags -o dyna.$dlext dyna.o > /dev/null 2>&1 &&
$cc $ccflags $ldflags $cccdlflags $ccdlflags fred.c -o fred $libs > /dev/null 2>&1; then
xxx=`./fred`
case $xxx in
--- 5298,5304 ----
}
EOM
if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
! $ld $lddlflags -o dyna.$dlext dyna.$obj_ext > /dev/null 2>&1 &&
$cc $ccflags $ldflags $cccdlflags $ccdlflags fred.c -o fred $libs > /dev/null 2>&1; then
xxx=`./fred`
case $xxx in
***************
*** 5704,5710 ****
y*|true)
usemymalloc='y'
mallocsrc='malloc.c'
! mallocobj='malloc.o'
d_mymalloc="$define"
case "$libs" in
*-lmalloc*)
--- 5726,5732 ----
y*|true)
usemymalloc='y'
mallocsrc='malloc.c'
! mallocobj="malloc.$obj_ext"
d_mymalloc="$define"
case "$libs" in
*-lmalloc*)
***************
*** 5792,5798 ****
EOCP
: check sys/file.h first to get FREAD on Sun
if $test `./findhdr sys/file.h` && \
! $cc $cppflags "-DI_SYS_FILE" open3.c -o open3 >/dev/null 2>&1 ; then
h_sysfile=true;
echo "<sys/file.h> defines the O_* constants..." >&4
if ./open3; then
--- 5814,5820 ----
EOCP
: check sys/file.h first to get FREAD on Sun
if $test `./findhdr sys/file.h` && \
! $cc $cppflags $ldflags "-DI_SYS_FILE" open3.c -o open3 >/dev/null 2>&1 ; then
h_sysfile=true;
echo "<sys/file.h> defines the O_* constants..." >&4
if ./open3; then
***************
*** 5803,5809 ****
val="$undef"
fi
elif $test `./findhdr fcntl.h` && \
! $cc "-DI_FCNTL" open3.c -o open3 >/dev/null 2>&1 ; then
h_fcntl=true;
echo "<fcntl.h> defines the O_* constants..." >&4
if ./open3; then
--- 5825,5831 ----
val="$undef"
fi
elif $test `./findhdr fcntl.h` && \
! $cc "-DI_FCNTL" $ldflags open3.c -o open3 >/dev/null 2>&1 ; then
h_fcntl=true;
echo "<fcntl.h> defines the O_* constants..." >&4
if ./open3; then
***************
*** 6185,6194 ****
: we will have to assume that it supports the 4.2 BSD interface
d_oldsock="$undef"
else
! echo "You don't have Berkeley networking in libc.a..." >&4
! if test -f /usr/lib/libnet.a; then
! ( (nm $nm_opt /usr/lib/libnet.a | eval $nm_extract) || \
! ar t /usr/lib/libnet.a) 2>/dev/null >> libc.list
if $contains socket libc.list >/dev/null 2>&1; then
echo "...but the Wollongong group seems to have hacked it in." >&4
socketlib="-lnet"
--- 6207,6216 ----
: we will have to assume that it supports the 4.2 BSD interface
d_oldsock="$undef"
else
! echo "You don't have Berkeley networking in libc.$lib_ext..." >&4
! if test -f /usr/lib/libnet.$lib_ext; then
! ( (nm $nm_opt /usr/lib/libnet.$lib_ext | eval $nm_extract) || \
! $ar t /usr/lib/libnet.$lib_ext) 2>/dev/null >> libc.list
if $contains socket libc.list >/dev/null 2>&1; then
echo "...but the Wollongong group seems to have hacked it in." >&4
socketlib="-lnet"
***************
*** 6201,6207 ****
d_oldsock="$define"
fi
else
! echo "or even in libnet.a, which is peculiar." >&4
d_socket="$undef"
d_oldsock="$undef"
fi
--- 6223,6229 ----
d_oldsock="$define"
fi
else
! echo "or even in libnet.$lib_ext, which is peculiar." >&4
d_socket="$undef"
d_oldsock="$undef"
fi
***************
*** 6724,6730 ****
printf("%d\n", (char *)&try.bar - (char *)&try.foo);
}
EOCP
! if $cc $ccflags try.c -o try >/dev/null 2>&1; then
dflt=`./try`
else
dflt='8'
--- 6746,6752 ----
printf("%d\n", (char *)&try.bar - (char *)&try.foo);
}
EOCP
! if $cc $ccflags $ldflags try.c -o try >/dev/null 2>&1; then
dflt=`./try`
else
dflt='8'
***************
*** 6772,6778 ****
}
EOCP
xxx_prompt=y
! if $cc $ccflags try.c -o try >/dev/null 2>&1 && ./try > /dev/null; then
dflt=`./try`
case "$dflt" in
[1-4][1-4][1-4][1-4]|12345678|87654321)
--- 6794,6800 ----
}
EOCP
xxx_prompt=y
! if $cc $ccflags $ldflags try.c -o try >/dev/null 2>&1 && ./try > /dev/null; then
dflt=`./try`
case "$dflt" in
[1-4][1-4][1-4][1-4]|12345678|87654321)
***************
*** 7349,7355 ****
printf("%d\n",i);
}
EOCP
! if $cc try.c -o try >/dev/null 2>&1 ; then
dflt=`try`
else
dflt='?'
--- 7371,7377 ----
printf("%d\n",i);
}
EOCP
! if $cc $ldflags try.c -o try >/dev/null 2>&1 ; then
dflt=`try`
else
dflt='?'
***************
*** 7376,7393 ****
$cc $ccflags -c bar1.c >/dev/null 2>&1
$cc $ccflags -c bar2.c >/dev/null 2>&1
$cc $ccflags -c foo.c >/dev/null 2>&1
! ar rc bar.a bar2.o bar1.o >/dev/null 2>&1
! if $cc $ccflags $ldflags -o foobar foo.o bar.a $libs > /dev/null 2>&1 &&
./foobar >/dev/null 2>&1; then
! echo "ar appears to generate random libraries itself."
orderlib=false
ranlib=":"
! elif ar ts bar.a >/dev/null 2>&1 &&
! $cc $ccflags $ldflags -o foobar foo.o bar.a $libs > /dev/null 2>&1 &&
./foobar >/dev/null 2>&1; then
echo "a table of contents needs to be added with 'ar ts'."
orderlib=false
! ranlib="ar ts"
else
case "$ranlib" in
:) ranlib='';;
--- 7398,7415 ----
$cc $ccflags -c bar1.c >/dev/null 2>&1
$cc $ccflags -c bar2.c >/dev/null 2>&1
$cc $ccflags -c foo.c >/dev/null 2>&1
! $ar rc bar.$lib_ext bar2.$obj_ext bar1.$obj_ext >/dev/null 2>&1
! if $cc $ccflags $ldflags -o foobar foo.$obj_ext bar.$lib_ext $libs > /dev/null 2>&1 &&
./foobar >/dev/null 2>&1; then
! echo "$ar appears to generate random libraries itself."
orderlib=false
ranlib=":"
! elif $ar ts bar.$lib_ext >/dev/null 2>&1 &&
! $cc $ccflags $ldflags -o foobar foo.$obj_ext bar.$lib_ext $libs > /dev/null 2>&1 &&
./foobar >/dev/null 2>&1; then
echo "a table of contents needs to be added with 'ar ts'."
orderlib=false
! ranlib="$ar ts"
else
case "$ranlib" in
:) ranlib='';;
***************
*** 7459,7465 ****
'') $echo $n ".$c"
if $cc $ccflags \
$i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone \
! try.c -o try >/dev/null 2>&1 ; then
set X $i_time $i_systime $i_systimek $sysselect $s_timeval
shift
flags="$*"
--- 7481,7487 ----
'') $echo $n ".$c"
if $cc $ccflags \
$i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone \
! try.c -o try $ldflags >/dev/null 2>&1 ; then
set X $i_time $i_systime $i_systimek $sysselect $s_timeval
shift
flags="$*"
***************
*** 7528,7534 ****
#endif
}
EOCP
! if $cc $ccflags -DTRYBITS fd_set.c -o fd_set >fd_set.out 2>&1 ; then
d_fds_bits="$define"
d_fd_set="$define"
echo "Well, your system knows about the normal fd_set typedef..." >&4
--- 7550,7556 ----
#endif
}
EOCP
! if $cc $ccflags $ldflags -DTRYBITS fd_set.c -o fd_set >fd_set.out 2>&1 ; then
d_fds_bits="$define"
d_fd_set="$define"
echo "Well, your system knows about the normal fd_set typedef..." >&4
***************
*** 7545,7551 ****
$cat <<'EOM'
Hmm, your compiler has some difficulty with fd_set. Checking further...
EOM
! if $cc $ccflags fd_set.c -o fd_set >fd_set.out 2>&1 ; then
d_fds_bits="$undef"
d_fd_set="$define"
echo "Well, your system has some sort of fd_set available..." >&4
--- 7567,7573 ----
$cat <<'EOM'
Hmm, your compiler has some difficulty with fd_set. Checking further...
EOM
! if $cc $ccflags $ldflags fd_set.c -o fd_set >fd_set.out 2>&1 ; then
d_fds_bits="$undef"
d_fd_set="$define"
echo "Well, your system has some sort of fd_set available..." >&4
***************
*** 8129,8135 ****
else
echo "false"
fi
! $rm -f varargs.o
EOP
chmod +x varargs

--- 8151,8157 ----
else
echo "false"
fi
! $rm -f varargs.$obj_ext
EOP
chmod +x varargs

***************
*** 8272,8282 ****
echo " "
echo "Stripping down executable paths..." >&4
for file in $loclist $trylist; do
! eval $file="\$file"
done
;;
esac

: create config.sh file
echo " "
echo "Creating config.sh..." >&4
--- 8294,8307 ----
echo " "
echo "Stripping down executable paths..." >&4
for file in $loclist $trylist; do
! if test X$file != Xln -o X$osname != Xos2; then eval $file="\$file"; fi
done
;;
esac

+ # Setup libraries for linking miniperl (if not set already)
+ : ${cldlibs="$libs $cryptlib"}
+
: create config.sh file
echo " "
echo "Creating config.sh..." >&4
***************
*** 8332,8337 ****
--- 8357,8363 ----
chmod='$chmod'
chown='$chown'
clocktype='$clocktype'
+ cldlibs='$cldlibs'
comm='$comm'
compress='$compress'
contains='$contains'
***************
*** 8525,8530 ****
--- 8551,8557 ----
expr='$expr'
extensions='$extensions'
find='$find'
+ firstmakefile='$firstmakefile'
flex='$flex'
fpostype='$fpostype'
freetype='$freetype'
***************
*** 8731,8736 ****
--- 8758,8770 ----
voidflags='$voidflags'
xlibpth='$xlibpth'
zcat='$zcat'
+ archobjs='$archobjs'
+ obj_ext='$obj_ext'
+ lib_ext='$lib_ext'
+ exe_ext='$exe_ext'
+ ar='$ar'
+ plibext='$plibext'
+ path_sep='$path_sep'
EOT

: add special variables
Re: Patch for Perl Configure against Andy's last patch 5.001m+ [ In reply to ]
On Tue, 10 Oct 1995, Ilya Zakharevich wrote:

> Unfortunately, Andy did not incorporate second set of patches that I
> sent him in his 001m+ patch. Below is the relevant patch for Configure
> (I do not know dist :-().

And that's the basic problem. It means someone's got to retrofit all
this into metaconfig units. Yes, we're all busy, I know.

> It fixes missing $ldflags, and introduces configurable extensions for
> archives and objects, additional types of archives handled (plus
> coupla other useful guys and workarounds for bugs).

Using $ldflags in the cc.U unit seems to introduce a circular dependency
into metaconfig's units. Currently, the ccflags.U unit (which also
defines ldflags) depends on cc.U, so ccflags.U comes _after_ cc.U.
Hence, we can't use $ldflags in cc.U since we don't know what they are yet.

I'm sure there's a way around this; I just haven't thought of it yet.

All the other "useful guys" need full units with appropriate defaults
(How does $ar_opt get set, for example)?

I appreciate that it takes a lot of effort to generate and maintain these
patches. It would be nice to integrate them all back into metaconfig,
but that'll take some time, I'm afraid.

Andy Dougherty doughera@lafcol.lafayette.edu
Dept. of Physics
Lafayette College, Easton PA 18042
Re: Patch for Perl Configure against Andy's last patch 5.001m+ [ In reply to ]
Andy Dougherty writes:
>
> On Tue, 10 Oct 1995, Ilya Zakharevich wrote:
>
> > Unfortunately, Andy did not incorporate second set of patches that I
> > sent him in his 001m+ patch. Below is the relevant patch for Configure
> > (I do not know dist :-().
>
> And that's the basic problem. It means someone's got to retrofit all
> this into metaconfig units. Yes, we're all busy, I know.
>

No, Andy, you missed one point that I repeated in most of my postings:
changes to Configure are _independent_ of the changes to the build
tools.

It is nice to be able to use Configure on OS/2, but this can wait:
anyone may easily change the small portion of config.sh that may
differ between different OS/2 machines (and which may distributed
separately from main perl archive).

It is much more important that the build tools work, so you may
compile extensions, apply patches and recompile, and run tests.

Thus any unit of build tools has a small preamble which sets the used
variables from config.sh that may be absent if the current Configure
is used.

When the newer Configure comes out, I will send a patch that deletes
this "junk".

The only doubtful place in patches is how I set the above "junk":

: ${ar='ar'}

I do not know sh too much to know portability of this
construction. Patches were checked on Solaris 2.4 with and without
Configure changes.

> Using $ldflags in the cc.U unit seems to introduce a circular dependency
> into metaconfig's units. Currently, the ccflags.U unit (which also
> defines ldflags) depends on cc.U, so ccflags.U comes _after_ cc.U.
> Hence, we can't use $ldflags in cc.U since we don't know what they are yet.
>
> I'm sure there's a way around this; I just haven't thought of it yet.
>

I will think about it too.

> All the other "useful guys" need full units with appropriate defaults
> (How does $ar_opt get set, for example)?
>

Oh-oh, I missed this one. My idea was that the should be one unit
which will set all them (archobjs='' obj_ext='o' lib_ext='a' exe_ext=
ar='ar' plibext= path_sep=$p_, and now ar_opt='t') non-interactively,
and the only change may come from hint files.

Ilya
Re: Patch for Perl Configure against Andy's last patch 5.001m+ [ In reply to ]
> From: Raphael Manfredi <ram@hptnos02.grenoble.hp.com>
>
> Let me say here publicly that Andy's job in this respect has been
> *remarkable*. Not only has he been maintaining Perl's Configure, he
> also has provided me with all the units in a "ready-to-integrate" form,
> along with a detailed explanation of the changes. Congratulations!

Seconded.

Tim.
Re: Patch for Perl Configure against Andy's last patch 5.001m+ [ In reply to ]
Quoting Andy Dougherty:
:I appreciate that it takes a lot of effort to generate and maintain these
:patches. It would be nice to integrate them all back into metaconfig,
:but that'll take some time, I'm afraid.

I occasionally go and fix the right metaconfig unit when I can guess
which one it is from the patch and when I don't believe it will have side
effects (like typo patches, better messages, test extensions, etc...).

I usually don't retrofit complex changes or new variables unless the
appropriate *.U files are given, so that I can metalint them to find
problems.

Let me say here publicly that Andy's job in this respect has been
*remarkable*. Not only has he been maintaining Perl's Configure, he
also has provided me with all the units in a "ready-to-integrate" form,
along with a detailed explanation of the changes. Congratulations!

This explains why his changes have made it into dist-3.0 (the package
containing metaconfig) so quickly. I believe the whole community benefits
from this, since metaconfig is also used in other packages than Perl,
although perl5 is probably the biggest client in terms of units used
and platforms where it is ported to.

Finally, having most of the changes retrofitted into the corresponding
units means you can follow on dist-3.0 evolution and enhancements "for free".
Metaconfig is a living package. And, if you allow me this very personal
comment, its internals are much cleaner than autoconf's. This is to be
credited to Larry Wall, who designed the original Unit concept. I'm
merely following on his brilliant ideas.

Raphael
Re: Patch for Perl Configure against Andy's last patch 5.001m+ [ In reply to ]
Raphael Manfredi writes:
> Metaconfig is a living package. And, if you allow me this very personal
> comment, its internals are much cleaner than autoconf's. This is to be
> credited to Larry Wall, who designed the original Unit concept. I'm
> merely following on his brilliant ideas.
>
> Raphael
>

If it is so living:
a) any chance to put the options to Configure in the header of
config.sh?
b) any chance to allow
# This variable denot your mother's maiden name
to be inserted before
mmn='MMN'
in the generated Configure?

Not that I've ever seen dist...

Ilya
Re: Patch for Perl Configure against Andy's last patch 5.001m+ [ In reply to ]
ilya> Not that I've ever seen dist...

Another goodie of CPAN: dist is now in authors/Raphael_Manfredi which
is really authors/id/RAM.


andreas