--- kde-20010207/kdesupport/audiofile/sfcommands/Makefile.am:1.1.1.1	Tue Dec  5 16:01:54 2000
+++ kde-20010207/kdesupport/audiofile/sfcommands/Makefile.am	Wed Dec  6 08:49:02 2000
@@ -9,8 +9,5 @@
 sfinfo_SOURCES = sfinfo.c printinfo.c
 
 LDADD = $(top_builddir)/libaudiofile/libaudiofile.la
-if BUILD_STATIC_LIBS
-LDFLAGS=-static
-endif
 
 DEPENDENCIES = $(top_builddir)/libaudiofile/libaudiofile.la
--- kde-20010207/kdesupport/audiofile/test/Makefile.am:1.1.1.1	Tue Dec  5 16:01:54 2000
+++ kde-20010207/kdesupport/audiofile/test/Makefile.am	Wed Dec  6 08:49:02 2000
@@ -53,9 +53,6 @@
 linuxtest_SOURCES = linuxtest.c
 
 LDADD = $(top_builddir)/libaudiofile/libaudiofile.la
-if BUILD_STATIC_LIBS
-LDFLAGS=-static
-endif
 LIBS=
 
 DEPENDENCIES = $(top_builddir)/libaudiofile/libaudiofile.la
--- kde-20010207/kdesupport/admin/ltmain.sh.orig	Fri Feb  9 15:54:16 2001
+++ kde-20010207/kdesupport/admin/ltmain.sh	Fri Feb  9 15:57:59 2001
@@ -2854,6 +2854,8 @@
 	     test -n "$hardcode_libdirs"; then
 	    libdir="$hardcode_libdirs"
 	    eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+	  else
+	    dep_rpath="${wl}-bnolibpath"
 	  fi
 	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
 	    # We should set the runpath_var.
@@ -3260,6 +3262,8 @@
 	 test -n "$hardcode_libdirs"; then
 	libdir="$hardcode_libdirs"
 	eval rpath=\" $hardcode_libdir_flag_spec\"
+      else
+        dep_rpath=" ${wl}-bnolibpath"
       fi
       compile_rpath="$rpath"
 
@@ -3296,6 +3300,8 @@
 	 test -n "$hardcode_libdirs"; then
 	libdir="$hardcode_libdirs"
 	eval rpath=\" $hardcode_libdir_flag_spec\"
+      else
+        dep_rpath=" ${wl}-bnolibpath"
       fi
       finalize_rpath="$rpath"
 
@@ -3488,7 +3494,9 @@
       # AIX runtime linking requires linking programs with -Wl,-brtl and libs with -Wl,-G
       case "$host" in
         *-*-aix4*) compile_command="$compile_command $wl-brtl"
-                   finalize_command="$finalize_command $wl-brtl" ;;
+                   compile_command=`$echo "X$compile_command" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"`
+                   finalize_command="$finalize_command $wl-brtl"
+                   finalize_command=`$echo "X$finalize_command" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"` ;;
       esac
 
       if test $need_relink = no || test "$build_libtool_libs" != yes; then
@@ -4369,10 +4377,18 @@
 	      esac
 	    fi
 	    libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
-	    if test -n "$libdir" && test ! -f "$libfile"; then
-	      $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
-	      finalize=no
-	    fi
+            # Make sure we look in the destination dir as well as the final dir
+            if test -z "$DESTDIR"; then
+	      if test -n "$libdir" && test ! -f "$libfile"; then
+		$echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
+		finalize=no
+	      fi
+            else
+              if test -n "$libdir" && test ! -f "$libfile" && test -n "$DESTDIR/$libdir" && test ! -f "$DESTDIR/$libfile"; then
+                $echo "$modename: warning: \`$lib' has not been installed in \`$libdir' or \`\$DESTDIR/$libdir'" 1>&2
+                finalize=no
+              fi
+            fi
 	  done
 
 	  relink_command=
@@ -4397,6 +4413,8 @@
 	      outputname="$tmpdir/$file"
 	      # Replace the output file specification.
 	      relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+              # Make sure we look in the destination dir as well as the final dir
+              test -z "$DESTDIR" || relink_command=`$echo "X$relink_command" | $Xsed -e 's%-L'"$libdir"'%-L'"$libdir"' -L'"$DESTDIR/$libdir"'%g'`
 
 	      $show "$relink_command"
 	      if $run eval "$relink_command"; then :
--- kde-20010207/kdesupport/audiofile/ltmain.sh.orig	Fri Feb  9 15:59:27 2001
+++ kde-20010207/kdesupport/audiofile/ltmain.sh	Fri Feb  9 15:59:35 2001
@@ -2854,6 +2854,8 @@
 	     test -n "$hardcode_libdirs"; then
 	    libdir="$hardcode_libdirs"
 	    eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+	  else
+	    dep_rpath="${wl}-bnolibpath"
 	  fi
 	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
 	    # We should set the runpath_var.
@@ -3260,6 +3262,8 @@
 	 test -n "$hardcode_libdirs"; then
 	libdir="$hardcode_libdirs"
 	eval rpath=\" $hardcode_libdir_flag_spec\"
+      else
+        dep_rpath=" ${wl}-bnolibpath"
       fi
       compile_rpath="$rpath"
 
@@ -3296,6 +3300,8 @@
 	 test -n "$hardcode_libdirs"; then
 	libdir="$hardcode_libdirs"
 	eval rpath=\" $hardcode_libdir_flag_spec\"
+      else
+        dep_rpath=" ${wl}-bnolibpath"
       fi
       finalize_rpath="$rpath"
 
@@ -3488,7 +3494,9 @@
       # AIX runtime linking requires linking programs with -Wl,-brtl and libs with -Wl,-G
       case "$host" in
         *-*-aix4*) compile_command="$compile_command $wl-brtl"
-                   finalize_command="$finalize_command $wl-brtl" ;;
+                   compile_command=`$echo "X$compile_command" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"`
+                   finalize_command="$finalize_command $wl-brtl"
+                   finalize_command=`$echo "X$finalize_command" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"` ;;
       esac
 
       if test $need_relink = no || test "$build_libtool_libs" != yes; then
@@ -4369,10 +4377,18 @@
 	      esac
 	    fi
 	    libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
-	    if test -n "$libdir" && test ! -f "$libfile"; then
-	      $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
-	      finalize=no
-	    fi
+            # Make sure we look in the destination dir as well as the final dir
+            if test -z "$DESTDIR"; then
+	      if test -n "$libdir" && test ! -f "$libfile"; then
+		$echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
+		finalize=no
+	      fi
+            else
+              if test -n "$libdir" && test ! -f "$libfile" && test -n "$DESTDIR/$libdir" && test ! -f "$DESTDIR/$libfile"; then
+                $echo "$modename: warning: \`$lib' has not been installed in \`$libdir' or \`\$DESTDIR/$libdir'" 1>&2
+                finalize=no
+              fi
+            fi
 	  done
 
 	  relink_command=
@@ -4397,6 +4413,8 @@
 	      outputname="$tmpdir/$file"
 	      # Replace the output file specification.
 	      relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+              # Make sure we look in the destination dir as well as the final dir
+              test -z "$DESTDIR" || relink_command=`$echo "X$relink_command" | $Xsed -e 's%-L'"$libdir"'%-L'"$libdir"' -L'"$DESTDIR/$libdir"'%g'`
 
 	      $show "$relink_command"
 	      if $run eval "$relink_command"; then :
