____________________________________________________________________________
+[ ] By: acme on 2007/09/01 19:31:20
+ Log: For newer FreeBSDs the return type of malloc() and free()
+ is being guessed wrong because the 5.005 configure doesn't
+ check that if the malloc.h exists that it doesn't simply do
+ "#error ..." as it does in a number of more recent OS -
+ I've copied in the test from the blead Configure and
+ jiggled a few things around and all is hunk-dory - with
+ this everything compiles and tests fine on
+ FreeBSD 6.2-RELEASE-p4 (Thanks to Jonathan Stowe)
+ Branch: maint-5.005/perl
+ ! Configure
+____________________________________________________________________________
[ ] By: acme on 2007/06/10 16:14:49
Log: Fix line endings on Windows files
Branch: maint-5.005/perl
set $yyy; shift; shift; yyy=$@;
done'
-: see if this is a malloc.h system
-set malloc.h i_malloc
-eval $inhdr
+
+: define a shorthand compile call
+compile='
+mc_file=$1;
+shift;
+$cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
+: define a shorthand compile call for compilations that should be ok.
+compile_ok='
+mc_file=$1;
+shift;
+$cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
+
+rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
: see if stdlib is available
set stdlib.h i_stdlib
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
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+#include <malloc.h>
+int main () { return 0; }
+EOCP
+set try
+if eval $compile; then
+ echo "<malloc.h> found." >&4
+ val="$define"
+else
+ echo "<malloc.h> NOT found." >&4
+ val="$undef"
+fi
+$rm_try
+set i_malloc
+eval $setvar
+
: determine which malloc to compile in
echo " "
case "$usemymalloc" in
END
case "$malloctype" in
'')
- if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
+ if $cc $ccflags -c -DTRY_MALLOC malloc.c ; then
malloctype='void *'
else
malloctype='char *'
set installusrbinperl
eval $setvar
-: define a shorthand compile call
-compile='
-mc_file=$1;
-shift;
-$cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
-: define a shorthand compile call for compilations that should be ok.
-compile_ok='
-mc_file=$1;
-shift;
-$cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
echo " "
echo "Checking for GNU C Library..." >&4