--- ltmain.sh.orig	Mon Oct  5 16:36:28 1998
+++ ltmain.sh	Tue Feb  2 21:14:55 1999
@@ -941,6 +941,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	Tue Feb  2 21:13:48 1999
+++ ltconfig	Tue Feb  2 21:17:32 1999
@@ -730,7 +730,7 @@
     ;;
 
   # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
-  freebsd3*)
+  freebsd*)
     archive_cmds='$CC -shared -o $lib$libobjs$deplibs'
     hardcode_libdir_flag_spec='-R$libdir'
     hardcode_direct=yes
@@ -1044,10 +1044,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
   ;;
 
