summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeon Brocard <acme@astray.com>2007-10-01 18:41:51 +0000
committerLeon Brocard <acme@astray.com>2007-10-01 18:41:51 +0000
commitc4bc743ab1f86fbe5ca995c9ce238d4ffce477dc (patch)
treecf4ce270420a411cad6098d92d32075d75903301
parentfaa7dc9f4d3a618b0ad8b3c95edd54e24c6976e7 (diff)
downloadperl-c4bc743ab1f86fbe5ca995c9ce238d4ffce477dc.tar.gz
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) git-svn-id: http://perl5005.googlecode.com/svn/trunk@14 e77bdc90-ac31-0410-a84a-cbf48518d05f
-rw-r--r--Changes12
-rwxr-xr-xConfigure52
2 files changed, 50 insertions, 14 deletions
diff --git a/Changes b/Changes
index 4efb8f2f1a..af2712c40f 100644
--- a/Changes
+++ b/Changes
@@ -80,6 +80,18 @@ Version 5.005_04 Fourth maintenance release of 5.005
____________________________________________________________________________
+[ ] 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
diff --git a/Configure b/Configure
index 1f48a50d1f..b958aca722 100755
--- a/Configure
+++ b/Configure
@@ -4203,14 +4203,48 @@ do set $yyy; var=$2; eval "was=\$$2";
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
@@ -4267,7 +4301,7 @@ void free();
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 *'
@@ -4383,16 +4417,6 @@ fi
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