$OpenBSD: patch-configure,v 1.10 2006/01/08 12:57:04 alek Exp $
--- configure.orig	Fri Oct 18 20:44:46 2002
+++ configure	Fri Nov 29 16:28:19 2002
@@ -5441,9 +5441,14 @@ fi
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   
-		# NetBSD/SPARC needs -fPIC, -fpic will not do.
-		SHLIB_CFLAGS="-fPIC"
-		SHLIB_LD="ld -Bshareable -x"
+		# OpenBSD/SPARC[64] needs -fPIC, -fpic will not do.
+		case `machine` in
+		sparc|sparc64)
+			SHLIB_CFLAGS="-fPIC";;
+		*)
+			SHLIB_CFLAGS="-fpic";;
+		esac
+		SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}"
 		SHLIB_LD_LIBS=""
 		SHLIB_SUFFIX=".so"
 		DL_OBJS="tclLoadDl.o"
@@ -5465,11 +5470,11 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&
   egrep "yes" >/dev/null 2>&1; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
-		    SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so'
+		    SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.${LIBtcl83_VERSION}'
 else
   rm -rf conftest*
   echo "$ac_t""no" 1>&6
-		    SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0'
+		    SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.${LIBtcl83_VERSION}'
 		
 fi
 rm -f conftest*
@@ -6292,7 +6297,7 @@ else
     esac
     TCL_SHLIB_CFLAGS=""
     eval "TCL_LIB_FILE=libtcl${TCL_UNSHARED_LIB_SUFFIX}"
-    MAKE_LIB="\${STLIB_LD} \$@ \${OBJS}"
+    MAKE_LIB="\${STLIB_LD} \${TCL_LIB_FILE} \${OBJS}; \${RANLIB} \${TCL_LIB_FILE}"
 fi
 
 # tclConfig.sh needs a version of the _LIB_SUFFIX that has been eval'ed
@@ -6359,7 +6364,7 @@ eval "TCL_STUB_LIB_FILE=libtclstub${TCL_
 # Replace DBGX with TCL_DBGX
 eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
 
-MAKE_STUB_LIB="\${STLIB_LD} \$@ \${STUB_LIB_OBJS}"
+MAKE_STUB_LIB="\${STLIB_LD} \${TCL_STUB_LIB_FILE} \${STUB_LIB_OBJS}; \${RANLIB} \${TCL_STUB_LIB_FILE}"
 
 if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
     TCL_STUB_LIB_FLAG="-ltclstub${TCL_VERSION}\${TCL_DBGX}"
