diff -urN ooo_SRX645_m57_src.orig/config_office/set_soenv.in ooo_SRX645_m57_src/config_office/set_soenv.in
--- ooo_SRX645_m57_src.orig/config_office/set_soenv.in	Sun Jul 10 12:55:36 2005
+++ ooo_SRX645_m57_src/config_office/set_soenv.in	Sun Jul 10 13:31:01 2005
@@ -1461,12 +1461,11 @@
 # There may be a better way to do this, like splitting unxmacxp into two, but
 # hopefully this hack will work for now...
 
-if ($platform eq "$Macosx")
+if ($platform eq "$Macosx")
 {
     my $macosxCdefs="";
     
-    if( ! -e "/usr/bin/osascript" ) {
-        # no command line applescript.  Chances are we're on a Darwin system
+    if( ! -x "/usr/bin/sw_vers" ) {
         
         ToFile( "BUILD_OS_DARWIN", "TRUE", "e");
 
@@ -1498,121 +1497,26 @@
         $macosxCdefs.=" -DBUILD_OS_APPLEOSX";
         ToFile("BUILD_OS_APPLEOSX", "TRUE", "e");
         
-        my $majorScript = <<EOF;
-on Num32ToHex(num)
-	if num < 0 then
-		set num to (2 ^ 32) + num
-	end if
-	set out to ""
-	repeat with idx from 7 to 0 by -1
-		set bas to (16 ^ idx) as integer
-		if num >= bas then
-			set mult to ((num - (num mod bas)) / bas) as integer
-			set out to out & character mult of "123456789ABCDEF"
-			set num to (num - bas * mult)
-		else
-			set out to out & "0"
-		end if
-	end repeat
-	return out
-end Num32ToHex
-
-tell application "Finder"
-	system attribute "sysv"
-end tell
-
-Num32ToHex(result)
-return (text 5 through 6 of result)
-EOF
-        open BLECH, ">/tmp/os$$";
-        print BLECH $majorScript;
-        close BLECH;
-        
-        open OSXMAJ, "/usr/bin/osascript </tmp/os$$|";
-        
-        my $tmp=<OSXMAJ>;
-        chomp $tmp;
-        $macosxCdefs.=" -DBUILD_OS_MAJOR=" . $tmp;
-        ToFile("BUILD_OS_MAJOR", $tmp, "e");
-        close OSXMAJ;
-        unlink "/tmp/os$$";
-        
-        my $minorScript = <<EOF;
-on Num32ToHex(num)
-	if num < 0 then
-		set num to (2 ^ 32) + num
-	end if
-	set out to ""
-	repeat with idx from 7 to 0 by -1
-		set bas to (16 ^ idx) as integer
-		if num >= bas then
-			set mult to ((num - (num mod bas)) / bas) as integer
-			set out to out & character mult of "123456789ABCDEF"
-			set num to (num - bas * mult)
-		else
-			set out to out & "0"
-		end if
-	end repeat
-	return out
-end Num32ToHex
-
-tell application "Finder"
-	system attribute "sysv"
-end tell
-
-Num32ToHex(result)
-return (text 7 through 7 of result)
-EOF
-        
-        open BLECH, ">/tmp/os$$";
-        print BLECH $minorScript;
-        close BLECH;
-        
-        open OSXMIN, "/usr/bin/osascript </tmp/os$$|";
-        $tmp=<OSXMIN>;
-        chomp $tmp;
-        $macosxCdefs.=" -DBUILD_OS_MINOR=" . $tmp;
-        ToFile("BUILD_OS_MINOR", $tmp, "e");
-        close OSXMIN;
-        unlink "/tmp/os$$";
-        
-        my $revScript = <<EOF;
-on Num32ToHex(num)
-	if num < 0 then
-		set num to (2 ^ 32) + num
-	end if
-	set out to ""
-	repeat with idx from 7 to 0 by -1
-		set bas to (16 ^ idx) as integer
-		if num >= bas then
-			set mult to ((num - (num mod bas)) / bas) as integer
-			set out to out & character mult of "123456789ABCDEF"
-			set num to (num - bas * mult)
-		else
-			set out to out & "0"
-		end if
-	end repeat
-	return out
-end Num32ToHex
-
-tell application "Finder"
-	system attribute "sysv"
-end tell
-
-Num32ToHex(result)
-return (text 8 through 8 of result)
-EOF
-        open BLECH, ">/tmp/os$$";
-        print BLECH $revScript;
-        close BLECH;
-                
-        open OSXREV, "/usr/bin/osascript </tmp/os$$|";
-        $tmp=<OSXREV>;
-        chomp $tmp;
-        $macosxCdefs.=" -DBUILD_OS_REV=" . $tmp;
-        ToFile("BUILD_OS_REV", $tmp, "e");
-        close OSXREV;
-        unlink "/tmp/os$$";
+        open OSXVER, "/usr/bin/sw_vers -productVersion |";
+        while (<OSXVER>) {
+            if (/^\s*(\d+?)\.(\d+?)(\.(\d+?))*\s*$/) {
+                ToFile("BUILD_OS_MAJOR", $1, "e");
+                $macosxCdefs.=" -DBUILD_OS_MAJOR=" . $1;
+
+                ToFile("BUILD_OS_MINOR", $2, "e");
+                $macosxCdefs.=" -DBUILD_OS_MINOR=" . $2;
+
+                if($3 ne "") {
+                    ToFile("BUILD_OS_REV", $4, "e");
+                    $macosxCdefs.=" -DBUILD_OS_REV=" . $4;
+                } else {
+                    ToFile("BUILD_OS_REV", 0, "e");
+                    $macosxCdefs.=" -DBUILD_OS_REV=0";
+                }
+                last;
+            }
+        }
+        close(OSXVER);
     }
     
     if ( $GUIBASE eq "aqua" ) {
