--- ltmain.sh.orig	Thu Sep 25 20:22:11 1997
+++ ltmain.sh	Tue Feb  2 05:43:17 1999
@@ -710,6 +710,16 @@
 	versuffix="$current.$revision"
 	;;
 
+      freebsd)
+	version_vars="$version_vars major versuffix"
+	major="$current"
+	if [ $PORTOBJFORMAT = elf ]; then
+	versuffix="$current";
+	else
+	versuffix="$current.$revision";
+	fi
+	;;
+
       *)
 	echo "$progname: unknown library version type \`$version_type'" 1>&2
 	echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
--- ltconfig.orig	Thu Sep 25 20:22:04 1997
+++ ltconfig	Tue Feb  2 05:45:00 1999
@@ -640,7 +640,7 @@
     ;;
 
   # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
-  freebsd3*)
+  freebsd*)
     archive_cmds='$CC -shared -o $lib$libobjs$deplibs'
     hardcode_direct=yes
     hardcode_minusL=yes
@@ -766,10 +766,21 @@
   soname_spec='$libname.so.$major'
   ;;
 
-freebsd2* | freebsd3*)
+freebsd2*)
   version_type=sunos
   library_names_spec='$libname.so.$versuffix $libname.so'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd*)
+  version_type=freebsd
+  library_names_spec='$libname.so.$versuffix $libname.so'
+  if [ $PORTOBJFORMAT = elf ]; then
+  finish_cmds='PATH="\$PATH:/sbin" OBJFORMAT="$PORTOBJFORMAT" ldconfig -m $libdir'
+  else
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  fi
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
