[asterisk-commits] branch group/autoconf_and_menuselect r22229 - /team/group/autoconf_and_menuse...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sun Apr 23 10:54:23 MST 2006


Author: dancho
Date: Sun Apr 23 12:54:23 2006
New Revision: 22229

URL: http://svn.digium.com/view/asterisk?rev=22229&view=rev
Log:
Added more robust check for KDE libraries

Modified:
    team/group/autoconf_and_menuselect/configure.ac

Modified: team/group/autoconf_and_menuselect/configure.ac
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/configure.ac?rev=22229&r1=22228&r2=22229&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/configure.ac (original)
+++ team/group/autoconf_and_menuselect/configure.ac Sun Apr 23 12:54:23 2006
@@ -435,26 +435,75 @@
 fi
 AC_SUBST([PBX_QT])
 
+
+
+
+AC_ARG_WITH([kde], AC_HELP_STRING([--with-kde=PATH],[use KDE files in PATH]),[
+case ${withval} in
+     n|no)
+     USE_KDE=no
+     KDE_MANDATORY="yes"
+     ;;
+     y|ye|yes)
+     ;;
+     *)
+     KDE_DIR="${withval}"
+     KDE_MANDATORY="yes"
+     ;;
+esac
+])
+
 PBX_KDE=0
-AC_PATH_TOOL(KDEINIT, kdeinit, No)
-if test ! x"${KDEINIT}" = xNo; then
-   KDEDIR=$(${DIRNAME} ${KDEINIT})
-   KDEDIR=$(${DIRNAME} ${KDEDIR})
-   KDE_INCLUDE="-I${KDEDIR}/include -I${KDEDIR}/include/kde -I${QTDIR}/include"
-   KDE_LIBS="-L${KDEDIR}/lib -L${QTDIR}/lib -lqt -lkdecore -lkdeui"
-
-   AC_CHECK_HEADER(
-	[${KDEDIR}/include/kdebug.h], 
+if test "${USE_KDE}" != "no"; then
+   echo -n "checking for crashHandler in -lkdecore..."
+   saved_ldflags="${LDFLAGS}"
+   LDFLAGS="-I${KDE_DIR}/include ${LDFLAGS} -L${KDE_DIR}/lib -lkdecore"
+	AC_LINK_IFELSE(
 	[
-	PBX_KDE=1
-   AC_DEFINE([HAVE_KDE], 1, [Define if your system has the KDE libraries.])
-   ])
-fi
-
-AC_SUBST(PBX_KDE)
-AC_SUBST(KDEDIR)
-AC_SUBST(KDE_INCLUDE)
-AC_SUBST(KDE_LIBS)
+		AC_LANG_PROGRAM(
+		[#include "kcrash.h"],
+		[KCrash::defaultCrashHandler(1);])
+	],
+	[ac_cv_lib_kde_crash="yes"],
+	[ac_cv_lib_kde_crash="no"])
+		
+	LDFLAGS="${saved_ldflags}"
+	
+	if test "${ac_cv_lib_kde_crash}" = "yes"; then
+		AC_MSG_RESULT(yes) 
+	else
+		AC_MSG_RESULT(no) 
+	fi
+	
+	if test "${ac_cv_lib_kde_crash}" = "yes"; then
+		KDE_LIBS="-lkdecore -lkdeui"
+		if test "${KDE_DIR}" != ""; then
+			KDE_LIBS="-L${KDE_DIR}/lib ${KDE_LIBS}"
+			KDE_INCLUDE="-I${KDE_DIR}/include"
+			AC_SUBST([KDE_INCLUDE])
+		fi
+		AC_SUBST([KDE_LIBS])
+		PBX_KDE=1
+		AC_DEFINE([HAVE_LIBKDE], 1, [Define if your system has the KDE library])
+   elif test ! -z "${KDE_MANDATORY}"; 
+   then
+      echo "***"
+      echo "*** The KDE installation on this system appears to be broken."
+      echo "*** Either correct the installation, or run configure"
+      echo "*** including --without-kde."
+      exit 1
+   fi
+fi
+AC_SUBST([PBX_KDE])
+
+if test x"${PBX_KDE}" = x1; then
+	AC_PATH_TOOL(KDEINIT, kdeinit, No)
+	if test ! x"${KDEINIT}" = xNo; then
+   	KDEDIR=$(${DIRNAME} ${KDEINIT})
+   	KDEDIR=$(${DIRNAME} ${KDEDIR})
+	fi
+	AC_SUBST([KDEDIR])
+fi
 
 AC_LANG_POP
 



More information about the asterisk-commits mailing list