$NetBSD: patch-aa,v 1.1 2000/02/02 13:47:43 scw Exp $

--- configure.orig	Sun Nov 14 17:01:51 1999
+++ configure	Wed Feb  2 12:51:57 2000
@@ -3818,7 +3818,8 @@
     
 
 
-
+# Use NetBSD package system libtool (start)
+if false; then
 
 kde_save_cc=$CC
 kde_save_cflags="$CFLAGS"
@@ -3921,6 +3922,10 @@
 CC=$kde_save_cc
 CFLAGS="$kde_save_cflags"
 
+fi
+# Use NetBSD package system libtool (end)
+
+
 echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
 echo "configure:3926: checking whether NLS is requested" >&5
         # Check whether --enable-nls or --disable-nls was given.
@@ -4254,7 +4259,7 @@
   fi
   
 else
-  ac_use_path_checking="default"
+  ac_use_path_checking=""
   
 fi
 
@@ -4269,7 +4274,9 @@
 if eval "test \"`echo '$''{'kde_cv_all_paths'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  
+
+if test "$ac_use_path_checking" = "default"; then
+
   if test -z "$kde_htmldir"; then
     kde_htmldir='\$(prefix)/share/doc/HTML'
   fi
@@ -4330,6 +4337,124 @@
 	kde_servicetypesdir=\"$kde_servicetypesdir\" \
 	kde_result=defaults"
 
+else
+
+echo "$ac_t""compiling" 1>&6
+
+
+    echo $ac_n "checking for KDE headers installed""... $ac_c" 1>&6
+echo "configure:4346: checking for KDE headers installed" >&5
+    ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+cat > conftest.$ac_ext <<EOF
+#include <stdio.h>
+#include "confdefs.h"
+#include <kapp.h>
+
+int main() {
+    printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
+    printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
+    printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
+    printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
+    printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
+    printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
+    printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
+    printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
+    printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
+    printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
+    printf("kde_wallpaperdir=\\"%s\\"\n", 
+	KApplication::kde_wallpaperdir().data());
+    printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
+    printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
+    printf("kde_servicesdir=\\"%s\\"\n", "dummy");
+    printf("kde_servicetypesdir=\\"%s\\"\n", "dummy");
+    return 0;
+    }
+EOF
+
+ac_compile='${CXX-g++} -c $CXXFLAGS $all_includes $CPPFLAGS conftest.$ac_ext'
+if { (eval echo configure:4410: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo "$ac_t""yes" 1>&6
+else
+  { echo "configure: error: your system is not able to compile a small KDE application!
+Check, if you installed the KDE header files correctly." 1>&2; exit 1; }
+fi
+
+
+KDE_TEST_RPATH=
+
+if test -n "$USE_RPATH"; then
+
+  if test -n "$kde_libraries"; then
+    KDE_TEST_RPATH="-rpath $kde_libraries"
+  fi
+
+  if test -n "$qt_libraries"; then
+    KDE_TEST_RPATH="$KDE_TEST_RPATH -rpath $qt_libraries"
+  fi
+
+  if test -n "$x_libraries"; then
+    KDE_TEST_RPATH="$KDE_TEST_RPATH -rpath $x_libraries"
+  fi
+
+  KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
+fi
+
+echo $ac_n "checking for KDE libraries installed""... $ac_c" 1>&6
+echo "configure:4438: checking for KDE libraries installed" >&5
+ac_link='/bin/sh $LIBTOOL --silent --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -lkdecore $LIBQT $KDE_TEST_RPATH 1>&5'
+
+if { (eval echo configure:4441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 
+  echo "$ac_t""yes" 1>&6
+else
+  { echo "configure: error: your system fails at linking a small KDE application!
+Check, if your compiler is installed correctly and if you have used the
+same compiler to compile Qt and kdelibs as you did use now" 1>&2; exit 1; }
+fi
+
+if eval `KDEDIR= ./conftest 2>&5`; then
+  kde_result=done
+else
+  kde_result=problems
+fi
+
+KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
+kde_have_all_paths=yes
+ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+
+if test "$kde_have_all_paths" = "yes"; then
+kde_cv_all_paths="kde_have_all_paths=\"yes\" \
+	kde_htmldir=\"$kde_htmldir\" \
+	kde_appsdir=\"$kde_appsdir\" \
+	kde_icondir=\"$kde_icondir\" \
+	kde_sounddir=\"$kde_sounddir\" \
+	kde_datadir=\"$kde_datadir\" \
+	kde_locale=\"$kde_locale\" \
+	kde_cgidir=\"$kde_cgidir\" \
+	kde_confdir=\"$kde_confdir\" \
+	kde_mimedir=\"$kde_mimedir\" \
+	kde_toolbardir=\"$kde_toolbardir\" \
+	kde_wallpaperdir=\"$kde_wallpaperdir\" \
+	kde_bindir=\"$kde_bindir\" \
+	kde_partsdir=\"$kde_partsdir\" \
+	kde_servicesdir=\"$kde_servicesdir\" \
+	kde_servicetypesdir=\"$kde_servicetypesdir\" \
+	kde_result=$kde_result"
+fi
+rm -fr conftest*
+
+fi
 
 fi
 
@@ -4342,8 +4467,7 @@
    test -z "$kde_cgidir"  || test -z "$kde_confdir" ||
    test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
    test -z "$kde_wallpaperdir" || test -z "$kde_bindir" ||
-   test -z "$kde_servicesdir" ||
-   test -z "$kde_servicetypesdir" || test "$kde_have_all_paths" != "yes"; then
+   test "$kde_have_all_paths" != "yes"; then
   kde_have_all_paths=no
   { echo "configure: error: configure could not run a little KDE program to test the environment. 
 Since it had compiled and linked before, it must be a strange problem on your system.