_10+ under OS/2
Chip Salzenberg [Fri, 6 Dec 1996 06:56:00 +0000 (18:56 +1200)]
(this is the same change as commit ed7f835f9a39da0c76fb197dc1746d7bd89b9537, but as applied)

malloc.c
os2/diff.configure

index 6ebe919..6f22da6 100644 (file)
--- a/malloc.c
+++ b/malloc.c
@@ -161,7 +161,7 @@ static u_int start_slack;
 
 #endif /* TWO_POT_OPTIMIZE */
 
-#ifdef PERL_EMERGENCY_SBRK
+#if defined(PERL_EMERGENCY_SBRK) && defined(PERL_CORE)
 
 #ifndef BIG_SIZE
 #  define BIG_SIZE (1<<16)             /* 64K */
@@ -214,9 +214,9 @@ emergency_sbrk(size)
     return (char *)-1;                 /* poor guy... */
 }
 
-#else /* !PERL_EMERGENCY_SBRK */
+#else /* !(defined(TWO_POT_OPTIMIZE) && defined(PERL_CORE)) */
 #  define emergency_sbrk(size) -1
-#endif /* !PERL_EMERGENCY_SBRK */
+#endif /* !(defined(TWO_POT_OPTIMIZE) && defined(PERL_CORE)) */
 
 /*
  * nextf[i] is the pointer to the next free block of size 2^(i+3).  The
@@ -753,10 +753,10 @@ dump_mstats(s)
 #   endif
 
 #   ifdef PERL_SBRK_VIA_MALLOC
-#      ifdef HIDEMYMALLOC
+#      if defined(HIDEMYMALLOC) || defined(EMBEDMYMALLOC)
 #         undef malloc
 #      else
-#         include "Error: -DPERL_SBRK_VIA_MALLOC requires -DHIDEMYMALLOC"
+#         include "Error: -DPERL_SBRK_VIA_MALLOC needs -D(HIDE|EMBED)MYMALLOC"
 #      endif
 
 /* it may seem schizophrenic to use perl's malloc and let it call system */
index cf2ec67..d19bf4a 100644 (file)
  case "$libs" in
  '') ;;
  *)  for thislib in $libs; do
-@@ -3401,12 +3409,14 @@
-                       :
-               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$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
-@@ -3457,11 +3467,11 @@
-       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;
-+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.a; then
--      libc=/lib/libc.a;
-+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
 @@ -3583,6 +3593,10 @@
        eval $xscan;\
        $contains '^fprintf$' libc.list >/dev/null 2>&1; then
                echo "Your vsprintf() returns (int)." >&4
                val2="$undef"
        else
-@@ -5876,7 +5900,7 @@
-               cryptlib=-lcrypt
-       fi
-       if $test -z "$cryptlib"; then
--              cryptlib=`./loc libcrypt.a "" $libpth`
-+              cryptlib=`./loc libcrypt$lib_ext "" $libpth`
-       else
-               cryptlib=-lcrypt
-       fi
 @@ -6148,7 +6172,7 @@
  EOCP
  : check sys/file.h first to get FREAD on Sun
        d_mymalloc="$define"
        case "$libs" in
        *-lmalloc*)
-@@ -7286,10 +7310,10 @@
-               : 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
-+              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"
-@@ -7302,7 +7326,7 @@
-                                       d_oldsock="$define"
-                               fi
-                       else
--                              echo "or even in libnet.a, which is peculiar." >&4
-+                              echo "or even in libnet$lib_ext, which is peculiar." >&4
-                               d_socket="$undef"
-                               d_oldsock="$undef"
-                       fi
 @@ -7867,7 +7891,7 @@
        printf("%d\n", (char *)&try.bar - (char *)&try.foo);
  }
                dflt=`try`
        else
                dflt='?'
-@@ -8364,18 +8388,18 @@
- $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 &&
-+$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."
-+      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 &&
-+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"
-+              ranlib="$ar ts"
- else
-       case "$ranlib" in
-       :) ranlib='';;
 @@ -8447,7 +8471,7 @@
        '') $echo $n ".$c"
                if $cc $ccflags \