--- config_office/set_soenv.in.orig.port	Wed Jan 23 18:07:28 2008
+++ config_office/set_soenv.in	Wed Apr 23 15:24:05 2008
@@ -380,7 +380,47 @@ elsif ( $platform =~ m/freebsd/ ) 
    }
       $INPATH         = $OUTPATH.$PROEXT;
       $GVERDIR        = $INPATH;
-} 
+}
+elsif ( $platform =~ m/openbsd/ )
+{     print "Setting OpenBSD specific values... ";
+      $outfile        = "OpenBSDEnv.Set";
+      $BIG_SVX        = "TRUE";
+      $COM            = "GCC";
+      $COMPATH        = '@COMPATH@';
+      if ( $platform =~ m/^i386/ )
+      {
+         $CPU            = "I";
+         $CPUNAME        = "INTEL";
+         $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386";
+         $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."client";
+         $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads";
+         $JREEXTRALIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."xawt";
+      }
+      elsif ( $platform =~ m/^x86_64/ )
+      {
+         $CPU            = "X";
+         $CPUNAME        = "X86_64";
+         $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64";
+         $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64".$ds."server";
+         $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64".$ds."native_threads";
+         $JREEXTRALIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64".$ds."xawt";
+      }
+      $CVER           = "C300";
+      $GUI            = "UNX";
+      $GUIBASE        = "unx";
+      $GUIENV         = "sal";
+      $GVER           = "VCL";
+      $OUTPATH        = "unxobsd";
+      $INPATH         = $OUTPATH.$PROEXT;
+      $GVERDIR        = $INPATH;
+      $OS             = "OPENBSD";
+      $PATH_SEPERATOR = $ps;
+      $XPVERSION      = "3";
+      $OSVERSION      = '@OSVERSION@';
+      if( @GCCVER@ >= 30401 ) {
+         $CVER        = "C341";
+      }
+}
 elsif ( $platform =~ m/linux-gnu/ ) 
 {
 # General Linux settings:
@@ -1095,7 +1135,7 @@ if ($platform =~ m/solaris/) 
                         $ps.$JRETHREADDIR.
                         $ps.'$SOLARVER'.$ds.'$INPATH'.$LIB;
 }
-elsif ($platform =~ m/linux-gnu|netbsd|osf1|freebsd|aix/)
+elsif ($platform =~ m/linux-gnu|netbsd|osf1|freebsd|aix|openbsd/)
 {  $LD_LIBRARY_PATH   = $cur_dir.
                         $ps.'$SOLARENV'.$ds.'$INPATH'.$LIB.
                         $ps.$JRELIBDIR.
@@ -1137,7 +1177,7 @@ if ($platform =~ m/solaris/) 
                         $L.$USR_DT.$LIB.
                         $L.$USR_OPENWIN.$LIB;
 }
-elsif ($platform =~ m/linux-gnu|netbsd|osf1|irix|freebsd|aix/)
+elsif ($platform =~ m/linux-gnu|netbsd|osf1|irix|freebsd|aix|openbsd/)
 {
    $SOLAREXTRALIB     = $L.$par_dir.$LIB64;
 }
@@ -1200,7 +1240,7 @@ if ($platform =~ m/cygwin|os2/)
 }
      
 # The general environment path.
-if ($platform =~ m/linux-gnu|netbsd|odf1|irix|freebsd|aix|solaris/)
+if ($platform =~ m/linux-gnu|netbsd|odf1|irix|freebsd|aix|solaris|openbsd/)
 {  $PATH              = $cur_dir.
                         $ps.'$SOLARVER'.$ds.'$INPATH'.$BIN.
                         $ps.'$SOLARENV'.$ds.'$OUTPATH'.$BIN.
@@ -1389,11 +1429,12 @@ if ($platform =~ m/solaris/) 
                         $L_STLPORT_LIB.
                         $L.$XLIB;
 }
-elsif ($platform =~ m/linux-gnu|netbasd|osf1|irix|aix|freebsd/)
+elsif ($platform =~ m/linux-gnu|netbasd|osf1|irix|aix|freebsd|openbsd/)
 {  $SOLARLIB          = $L.$par_dir.$LIB.
                         $L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB.
                         $L.'$SOLARVER'.$ds.'$INPATH'.$LIB.
                         $L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB.
+			$L.$USR_LOCAL.$LIB.
                         $L.'$JAVA_HOME'.$LIB64.
                         $L.$JRELIBDIR.
                         $L.$JRETOOLKITDIR.
@@ -1417,7 +1458,19 @@ elsif ($platform =~ m/darwin/) 
     }
 
 }
-
+elsif ($platform =~ m/openbsd/)
+{  $SOLARLIB          = $L.$par_dir.$LIB.
+                        $L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB.
+                        $L.'$SOLARVER'.$ds.'$INPATH'.$LIB.
+                        $L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB.
+                        $L.$USR_LOCAL.$LIB.
+                        $L.'$JAVA_HOME'.$LIB64.
+                        $L.$JRELIBDIR.
+                        $L.$JRETOOLKITDIR.
+                        $L.$JRETHREADDIR.
+                        $L_STLPORT_LIB.
+                        $L.$XLIB;
+}
 if ($SYSTEM_MOZILLA eq "YES")
 {
        $SOLARLIB .= $L."@MOZ_LIB@"
@@ -1432,10 +1485,10 @@ $SOLARINC             = $I.$cur_dir.
                         $I.'$SOLARENV'.$INC.
                         $I.'$SRC_ROOT'.$ds."res";
 
-if ($platform =~ m/solaris|linux-gnu|osf1|freebsd|netbsd|irix/)
+if ($platform =~ m/solaris|linux-gnu|osf1|freebsd|netbsd|irix|openbsd/)
 {
 $SOLARINC	     .= $STLPORT_stlport;
-if ($platform =~ m/linux|freebsd|netbsd/)
+if ($platform =~ m/linux|freebsd|netbsd|openbsd/)
 {
 # This simply adds an include path, so even cases that break the FHS work
 $SOLARINC            .= $STLPORT_inc_stlport;
@@ -1457,9 +1510,15 @@ if ($platform =~ m/linux-gnu/)
 }
 
 
-   	$SOLARINC      .= $I.'$SOLARENV'.$INC.$ds."Xp31".
-                     $I.'$JAVA_HOME'.$INCLUDE;
+	$SOLARINC      .= $I.'$SOLARENV'.$INC.$ds."Xp31";
 
+	# pickup system jpeg over java jpeg
+	if ($platform =~ m/openbsd/)
+	{  $SOLARINC  .= $I.$USR_LOCAL.$INCLUDE;
+	}
+
+        $SOLARINC      .= $I.'$JAVA_HOME'.$INCLUDE;
+
 	#include system dependent Java include directory
 	if (!($JDK eq "gcj"))
 	{
@@ -1481,13 +1540,16 @@ if ($platform =~ m/linux-gnu/)
    		elsif ($platform =~ m/irix/)
    		{  $SOLARINC   .=$I.'$JAVA_HOME'.$INCLUDE.$ds."irix";
    		}
+		elsif ($platform =~ m/openbsd/)
+		{  $SOLARINC   .=$I.'$JAVA_HOME'.$INCLUDE.$ds."openbsd";
+		}
 
    		#java threads include path
 
    		$SOLARINC .=$I.'$JAVA_HOME'.$INCLUDE.$ds."native_threads".$ds."include";
 	}
     #The tail, if needed
-    if ($platform =~ m/linux-gnu|freebsd|netbsd/)
+    if ($platform =~ m/linux-gnu|freebsd|netbsd|openbsd/)
     {  $SOLARINC  .= $I.$XINC;
     }
     elsif ($platform =~ m/osf1/)
