aboutsummaryrefslogtreecommitdiffstats
path: root/krozat/admin/acinclude.m4.in
diff options
context:
space:
mode:
Diffstat (limited to 'krozat/admin/acinclude.m4.in')
-rw-r--r--krozat/admin/acinclude.m4.in1134
1 files changed, 899 insertions, 235 deletions
diff --git a/krozat/admin/acinclude.m4.in b/krozat/admin/acinclude.m4.in
index ac6852d..625c6b2 100644
--- a/krozat/admin/acinclude.m4.in
+++ b/krozat/admin/acinclude.m4.in
@@ -33,10 +33,133 @@ dnl Forward compatibility macros (make autoconf 2.13 look like 2.50),
dnl thanks to Raja R Harinath.
dnl ------------------------------------------------------------------------
dnl
-ifdef([_AC_PATH_X_DIRECT],[],
- [AC_DEFUN([_AC_PATH_X_DIRECT],[AC_PATH_X_DIRECT])])
ifdef([_AC_PATH_X_XMKMF],[],
[AC_DEFUN([_AC_PATH_X_XMKMF],[AC_PATH_X_XMKMF])])
+ifdef([AC_OUTPUT_SUBDIRS],[],
+ [AC_DEFUN([AC_OUTPUT_SUBDIRS],[subdirs=$1; _AC_OUTPUT_SUBDIRS])])
+
+# KDE_PATH_X_DIRECT
+dnl Internal subroutine of AC_PATH_X.
+dnl Set ac_x_includes and/or ac_x_libraries.
+AC_DEFUN(KDE_PATH_X_DIRECT,
+[if test "$ac_x_includes" = NO; then
+ # Guess where to find include files, by looking for this one X11 .h file.
+ test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
+
+ # First, try using that file with no special directory specified.
+AC_TRY_CPP([#include <$x_direct_test_include>],
+[# We can compile using X headers with no special include directory.
+ac_x_includes=],
+[# Look for the header file in a standard set of common directories.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+ for ac_dir in \
+ /usr/X11/include \
+ /usr/X11R6/include \
+ /usr/X11R5/include \
+ /usr/X11R4/include \
+ \
+ /usr/include/X11 \
+ /usr/include/X11R6 \
+ /usr/include/X11R5 \
+ /usr/include/X11R4 \
+ \
+ /usr/local/X11/include \
+ /usr/local/X11R6/include \
+ /usr/local/X11R5/include \
+ /usr/local/X11R4/include \
+ \
+ /usr/local/include/X11 \
+ /usr/local/include/X11R6 \
+ /usr/local/include/X11R5 \
+ /usr/local/include/X11R4 \
+ \
+ /usr/X386/include \
+ /usr/x386/include \
+ /usr/XFree86/include/X11 \
+ \
+ /usr/include \
+ /usr/local/include \
+ /usr/unsupported/include \
+ /usr/athena/include \
+ /usr/local/x11r5/include \
+ /usr/lpp/Xamples/include \
+ \
+ /usr/openwin/include \
+ /usr/openwin/share/include \
+ ; \
+ do
+ if test -r "$ac_dir/$x_direct_test_include"; then
+ ac_x_includes=$ac_dir
+ break
+ fi
+ done])
+fi # $ac_x_includes = NO
+
+if test "$ac_x_libraries" = NO; then
+ # Check for the libraries.
+
+ test -z "$x_direct_test_library" && x_direct_test_library=Xt
+ test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
+
+ # See if we find them without any special options.
+ # Don't add to $LIBS permanently.
+ ac_save_LIBS="$LIBS"
+ LIBS="-l$x_direct_test_library $LIBS"
+AC_TRY_LINK(, [${x_direct_test_function}()],
+[LIBS="$ac_save_LIBS"
+# We can link X programs with no special library path.
+ac_x_libraries=],
+[LIBS="$ac_save_LIBS"
+# First see if replacing the include by lib works.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
+ /usr/X11/lib \
+ /usr/X11R6/lib \
+ /usr/X11R5/lib \
+ /usr/X11R4/lib \
+ \
+ /usr/lib/X11 \
+ /usr/lib/X11R6 \
+ /usr/lib/X11R5 \
+ /usr/lib/X11R4 \
+ \
+ /usr/local/X11/lib \
+ /usr/local/X11R6/lib \
+ /usr/local/X11R5/lib \
+ /usr/local/X11R4/lib \
+ \
+ /usr/local/lib/X11 \
+ /usr/local/lib/X11R6 \
+ /usr/local/lib/X11R5 \
+ /usr/local/lib/X11R4 \
+ \
+ /usr/X386/lib \
+ /usr/x386/lib \
+ /usr/XFree86/lib/X11 \
+ \
+ /usr/lib \
+ /usr/local/lib \
+ /usr/unsupported/lib \
+ /usr/athena/lib \
+ /usr/local/x11r5/lib \
+ /usr/lpp/Xamples/lib \
+ /lib/usr/lib/X11 \
+ \
+ /usr/openwin/lib \
+ /usr/openwin/share/lib \
+ ; \
+do
+dnl Don't even attempt the hair of trying to link an X program!
+ for ac_extension in a so sl; do
+ if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
+ ac_x_libraries=$ac_dir
+ break 2
+ fi
+ done
+done])
+fi # $ac_x_libraries = NO
+])
+
dnl ------------------------------------------------------------------------
dnl Find a file (or one of more files in a list of dirs)
@@ -138,6 +261,37 @@ configure.
])
])
+
+AC_DEFUN(KDE_CHECK_UIC_FLAG,
+[
+ AC_MSG_CHECKING([whether uic supports -$1 ])
+ kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
+ AC_CACHE_VAL(kde_cv_prog_uic_$kde_cache,
+ [
+ cat >conftest.ui <<EOT
+ <!DOCTYPE UI><UI version="3" stdsetdef="1"></UI>
+EOT
+ ac_uic_testrun="$UIC -$1 $2 conftest.ui >/dev/null"
+ if AC_TRY_EVAL(ac_uic_testrun); then
+ eval "kde_cv_prog_uic_$kde_cache=yes"
+ else
+ eval "kde_cv_prog_uic_$kde_cache=no"
+ fi
+ rm -f conftest*
+ ])
+
+ if eval "test \"`echo '$kde_cv_prog_uic_'$kde_cache`\" = yes"; then
+ AC_MSG_RESULT([yes])
+ :
+ $3
+ else
+ AC_MSG_RESULT([no])
+ :
+ $4
+ fi
+])
+
+
dnl ------------------------------------------------------------------------
dnl Find the meta object compiler and the ui compiler in the PATH,
dnl in $QTDIR/bin, and some more usual places
@@ -160,6 +314,16 @@ AC_DEFUN(AC_PATH_QT_MOC_UIC,
if test -z "$UIC" ; then
KDE_UIC_ERROR_MESSAGE
exit 1
+ elif test $kde_qtver = 3; then
+ KDE_CHECK_UIC_FLAG(L,[/nonexistant],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no)
+ KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no)
+
+ if test x$ac_uic_supports_libpath = xyes; then
+ UIC="$UIC -L \$(kde_widgetdir)"
+ fi
+ if test x$ac_uic_supports_nounload = xyes; then
+ UIC="$UIC -nounload"
+ fi
fi
else
UIC="echo uic not available: "
@@ -167,6 +331,13 @@ AC_DEFUN(AC_PATH_QT_MOC_UIC,
AC_SUBST(MOC)
AC_SUBST(UIC)
+
+ UIC_TR="i18n"
+ if test $kde_qtver = 3; then
+ UIC_TR="tr2i18n"
+ fi
+
+ AC_SUBST(UIC_TR)
])
AC_DEFUN(KDE_1_CHECK_PATHS,
@@ -236,6 +407,8 @@ AC_DEFUN(KDE_SET_PATHS,
kde_servicesdir=\"$kde_servicesdir\" \
kde_servicetypesdir=\"$kde_servicetypesdir\" \
kde_moduledir=\"$kde_moduledir\" \
+ kde_styledir=\"$kde_styledir\" \
+ kde_widgetdir=\"$kde_widgetdir\" \
kde_result=$1"
])
@@ -289,7 +462,17 @@ if test "$1" = "default"; then
kde_servicetypesdir='\${prefix}/share/servicetypes'
fi
if test -z "$kde_moduledir"; then
- kde_moduledir='\${exec_prefix}/lib/kde2'
+ if test "$kde_qtver" = "2"; then
+ kde_moduledir='\${libdir}/kde2'
+ else
+ kde_moduledir='\${libdir}/kde3'
+ fi
+ fi
+ if test -z "$kde_styledir"; then
+ kde_styledir='\${libdir}/kde3/plugins/styles'
+ fi
+ if test -z "$kde_widgetdir"; then
+ kde_widgetdir='\${libdir}/kde3/plugins/designer'
fi
KDE_SET_PATHS(defaults)
@@ -315,7 +498,8 @@ AC_DEFUN(KDE_CHECK_PATHS_FOR_COMPLETENESS,
test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
- test "$kde_have_all_paths" != "yes"; then
+ test -z "$kde_styledir" || test -z "kde_widgetdir"
+ test "x$kde_have_all_paths" != "xyes"; then
kde_have_all_paths=no
fi
])
@@ -330,7 +514,7 @@ Please check whether you installed KDE correctly.
AC_DEFUN(KDE_SUBST_PROGRAMS,
[
- kde_default_bindirs="/usr/bin /usr/local/bin /opt/local/bin /usr/X11R6/bin /opt/kde/bin /opt/kde2/bin /usr/kde/bin /usr/local/kde/bin"
+ kde_default_bindirs="/usr/bin /usr/local/bin /opt/local/bin /usr/X11R6/bin /opt/kde/bin /opt/kde3/bin /usr/kde/bin /usr/local/kde/bin"
if test -n "$KDEDIRS"; then
kde_save_IFS=$IFS
IFS=:
@@ -348,7 +532,7 @@ AC_DEFUN(KDE_SUBST_PROGRAMS,
KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
if test -n "$MEINPROC" && test ! "$MEINPROC" = "compiled"; then
- kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde2/share /opt/kde/share $prefix/share"
+ kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde3/share /opt/kde/share $prefix/share"
test -n "$KDEDIR" && kde_sharedirs="$KDEDIR/share $kde_sharedirs"
AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
if test "$KDE_XSL_STYLESHEET" = "NO"; then
@@ -407,6 +591,8 @@ if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
kde_have_all_paths=
+ kde_styledir=
+ kde_widgetdir=
KDE_SET_DEFAULT_PATHS($1)
eval "$kde_cv_all_paths"
KDE_CHECK_PATHS_FOR_COMPLETENESS
@@ -447,6 +633,8 @@ AC_SUBST(kde_templatesdir)
AC_SUBST(kde_servicesdir)
AC_SUBST(kde_servicetypesdir)
AC_SUBST(kde_moduledir)
+AC_SUBST(kde_styledir)
+AC_SUBST(kde_widgetdir)
if test "$kde_qtver" = 1; then
kde_minidir="$kde_icondir/mini"
else
@@ -550,8 +738,24 @@ dnl ------------------------------------------------------------------------
dnl
AC_DEFUN(K_PATH_X,
[
-AC_REQUIRE([AC_PROG_CPP])dnl
AC_REQUIRE([KDE_MISC_TESTS])dnl
+
+AC_ARG_ENABLE(
+ embedded,
+ [ --enable-embedded link to Qt-embedded, don't use X],
+ kde_use_qt_emb=$enableval,
+ kde_use_qt_emb=no
+)
+
+AC_ARG_ENABLE(
+ qtopia,
+ [ --enable-qtopia link to Qt-embedded, link to the Qtopia Environment],
+ kde_use_qt_emb_palm=$enableval,
+ kde_use_qt_emb_palm=no
+)
+
+if test "$kde_use_qt_emb" = "no"; then
+
AC_MSG_CHECKING(for X)
AC_LANG_SAVE
AC_LANG_C
@@ -572,7 +776,7 @@ fi
ac_x_libraries=$kde_x_libraries
ac_x_includes=$kde_x_includes
-_AC_PATH_X_DIRECT
+KDE_PATH_X_DIRECT
dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
dnl location. The correct location is /usr/lib32 or an undefined value
@@ -709,7 +913,7 @@ fi
AC_MSG_CHECKING(for Xinerama)
AC_ARG_WITH(xinerama,
- [ --with-xinerama enable support for Xinerama ],
+ [ --with-xinerama enable support for Xinerama ],
[
no_xinerama=no
], [
@@ -753,6 +957,35 @@ LDFLAGS="$kde_save_LDFLAGS"
CFLAGS="$kde_save_CFLAGS"
LIBS="$kde_save_LIBS"
+LIB_XEXT="-lXext"
+QTE_NORTTI=""
+
+else
+ dnl We're using QT Embedded
+ CXXFLAGS="$CXXFLAGS -fno-rtti -DQWS"
+ CFLAGS="$CFLAGS -DQWS"
+ LDFLAGS="$LDFLAGS -DQWS"
+ QTE_NORTTI="-fno-rtti -DQWS"
+ X_PRE_LIBS=""
+ LIB_X11=""
+ LIB_XEXT=""
+ LIBSM=""
+ X_INCLUDES=""
+ X_LDFLAGS=""
+ x_includes=""
+ x_libraries=""
+ AC_SUBST(X_PRE_LIBS)
+ AC_SUBST(LIB_X11)
+ AC_SUBST(LIBSM)
+ AC_SUBST(X_INCLUDES)
+ AC_SUBST(X_LDFLAGS)
+ AC_SUBST(x_includes)
+ AC_SUBST(x_libraries)
+fi
+AC_SUBST(QTE_NORTTI)
+AC_SUBST(LIB_XEXT)
+
+
AC_LANG_RESTORE
])
@@ -777,7 +1010,14 @@ cat >> conftest.$ac_ext <<EOF
#include <qiconview.h>
EOF
fi
+fi
+if test "$kde_qtver" = "3"; then
+cat >> conftest.$ac_ext <<EOF
+#include <qcursor.h>
+#include <qstylefactory.h>
+#include <private/qucomextra_p.h>
+EOF
fi
echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
@@ -790,6 +1030,7 @@ EOF
if test "$kde_qtver" = "2"; then
cat >> conftest.$ac_ext <<EOF
QStringList *t = new QStringList();
+ Q_UNUSED(t);
EOF
if test $kde_qtsubver -gt 0; then
cat >> conftest.$ac_ext <<EOF
@@ -797,10 +1038,15 @@ cat >> conftest.$ac_ext <<EOF
iv.setWordWrapIconText(false);
QString s;
s.setLatin1("Elvis is alive", 14);
- int magnolia = QEvent::Speech; /* new in 2.2 beta2 */
EOF
fi
fi
+if test "$kde_qtver" = "3"; then
+cat >> conftest.$ac_ext <<EOF
+ (void)QStyleFactory::create(QString::null);
+ QCursor c(Qt::WhatsThisCursor);
+EOF
+fi
cat >> conftest.$ac_ext <<EOF
return 0;
}
@@ -809,36 +1055,33 @@ EOF
AC_DEFUN(KDE_USE_QT,
[
-
if test -z "$1"; then
- kde_qtver=2
+ kde_qtver=3
kde_qtsubver=1
else
- kde_qtsubver=`echo "$1" | sed -e 's#[0-9]\+\.\([0-9]\+\).*#\1#'`
+ kde_qtsubver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
# following is the check if subversion isnīt found in passed argument
if test "$kde_qtsubver" = "$1"; then
kde_qtsubver=1
fi
- kde_qtver=`echo "$1" | sed -e 's#^\([0-9]\+\)\..*#\1#'`
+ kde_qtver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'`
if test "$kde_qtver" = "1"; then
kde_qtsubver=42
- else
- # this is the version number fallback to 2.1, unless major version is 1 or 2
- if test "$kde_qtver" != "2"; then
- kde_qtver=2
- kde_qtsubver=1
- fi
fi
fi
if test -z "$2"; then
- if test $kde_qtver = 2; then
+ if test "$kde_qtver" = "2"; then
if test $kde_qtsubver -gt 0; then
kde_qt_minversion=">= Qt 2.2.2"
else
kde_qt_minversion=">= Qt 2.0.2"
fi
- else
+ fi
+ if test "$kde_qtver" = "3"; then
+ kde_qt_minversion=">= Qt 3.0.3"
+ fi
+ if test "$kde_qtver" = "1"; then
kde_qt_minversion=">= 1.42 and < 2.0"
fi
else
@@ -846,22 +1089,30 @@ else
fi
if test -z "$3"; then
+ if test $kde_qtver = 3; then
+ kde_qt_verstring="QT_VERSION >= 303"
+ fi
if test $kde_qtver = 2; then
- if test $kde_qtsubver -gt 0; then
- kde_qt_verstring="QT_VERSION >= 222"
- else
- kde_qt_verstring="QT_VERSION >= 200"
- fi
- else
+ if test $kde_qtsubver -gt 0; then
+ kde_qt_verstring="QT_VERSION >= 222"
+ else
+ kde_qt_verstring="QT_VERSION >= 200"
+ fi
+ fi
+ if test $kde_qtver = 1; then
kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
- fi
+ fi
else
kde_qt_verstring=$3
fi
+if test $kde_qtver = 3; then
+ kde_qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt"
+fi
if test $kde_qtver = 2; then
kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
-else
+fi
+if test $kde_qtver = 1; then
kde_qt_dirs="$QTDIR /usr/lib/qt"
fi
])
@@ -882,7 +1133,11 @@ ac_libs_safe="$LIBS"
CXXFLAGS="$CXXFLAGS -I$qt_includes"
LDFLAGS="$LDFLAGS $X_LDFLAGS"
+if test "x$kde_use_qt_emb" != "xyes"; then
LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
+else
+LIBS="$LIBQT $LIBSOCKET"
+fi
LD_LIBRARY_PATH=
export LD_LIBRARY_PATH
LIBRARY_PATH=
@@ -936,86 +1191,117 @@ dnl ------------------------------------------------------------------------
AC_ARG_ENABLE(
mt,
- [ --enable-mt link to threaded Qt (experimental)],
+ [ --disable-mt link to non-threaded Qt (deprecated)],
kde_use_qt_mt=$enableval,
- kde_use_qt_mt=no
+ [
+ if test $kde_qtver = 3; then
+ kde_use_qt_mt=yes
+ else
+ kde_use_qt_mt=no
+ fi
+ ]
)
USING_QT_MT=""
dnl ------------------------------------------------------------------------
-dnl If we got --enable-qt-mt then adjust some vars for the host.
+dnl If we not get --disable-qt-mt then adjust some vars for the host.
dnl ------------------------------------------------------------------------
+KDE_MT_LDFLAGS=
+KDE_MT_LIBS=
if test "x$kde_use_qt_mt" = "xyes"; then
-
- case $host in
- *-*-linux-*)
- if test "x$GCC" = "xyes"; then
- CPPFLAGS="$CPPFLAGS -DQT_THREAD_SUPPORT -pthread"
- X_EXTRA_LIBS="$X_EXTRA_LIBS -pthread"
- else
- AC_MSG_WARN([Compiler is not gcc. MT support disabled.])
- fi
- ;;
- *)
- AC_MSG_WARN([MT not yet supported on $host - disabled.])
- ;;
- esac
-
+ KDE_CHECK_THREADING
+ if test "x$kde_use_threading" = "xyes"; then
+ CPPFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $CPPFLAGS"
+ KDE_MT_LDFLAGS="$USE_THREADS"
+ KDE_MT_LIBS="$LIBPTHREAD"
+ else
+ kde_use_qt_mt=no
+ fi
fi
+AC_SUBST(KDE_MT_LDFLAGS)
+AC_SUBST(KDE_MT_LIBS)
kde_qt_was_given=yes
dnl ------------------------------------------------------------------------
dnl If we haven't been told how to link to Qt, we work it out for ourselves.
dnl ------------------------------------------------------------------------
-
if test -z "$LIBQT_GLOB"; then
-
- LIBQT_GLOB="libqt.*"
-
+ if test "x$kde_use_qt_emb" = "xyes"; then
+ LIBQT_GLOB="libqte.*"
+ else
+ LIBQT_GLOB="libqt.*"
+ fi
fi
if test -z "$LIBQT"; then
+dnl ------------------------------------------------------------
+dnl If we got --enable-embedded then adjust the Qt library name.
+dnl ------------------------------------------------------------
+ if test "x$kde_use_qt_emb" = "xyes"; then
+ qtlib="qte"
+ else
+ qtlib="qt"
+ fi
+
+ kde_int_qt="-l$qtlib"
+else
+ kde_int_qt="$LIBQT"
+ kde_lib_qt_set=yes
+fi
- LIBQT="-lqt"
- kde_int_qt="-lqt"
+if test -z "$LIBQPE"; then
+dnl ------------------------------------------------------------
+dnl If we got --enable-palmtop then add -lqpe to the link line
+dnl ------------------------------------------------------------
+ if test "x$kde_use_qt_emb" = "xyes"; then
+ if test "x$kde_use_qt_emb_palm" = "xyes"; then
+ LIB_QPE="-lqpe"
+ else
+ LIB_QPE=""
+ fi
+ else
+ LIB_QPE=""
+ fi
+fi
dnl ------------------------------------------------------------------------
dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
dnl ------------------------------------------------------------------------
- if test "x$kde_use_qt_mt" = "xyes"; then
-
- case $host in
- *-*-linux-*)
- if test "x$GCC" = "xyes"; then
- LIBQT="-lqt-mt"
- kde_int_qt="-lqt-mt"
- LIBQT_GLOB="libqt-mt.*"
- USING_QT_MT="using -mt"
- fi
- ;;
- esac
+if test "x$kde_use_qt_mt" = "xyes"; then
+ if test -z "$LIBQT"; then
+ LIBQT="-l$qtlib-mt"
+ kde_int_qt="-l$qtlib-mt"
+ else
+ LIBQT="$qtlib-mt"
+ kde_int_qt="$qtlib-mt"
fi
-
- kde_qt_was_given=no
-
+ LIBQT_GLOB="lib$qtlib-mt.*"
+ USING_QT_MT="using -mt"
else
- kde_int_qt="$LIBQT"
+ LIBQT="-l$qtlib"
fi
-if test $kde_qtver = 2; then
+if test $kde_qtver != 1; then
AC_REQUIRE([AC_FIND_PNG])
AC_REQUIRE([AC_FIND_JPEG])
LIBQT="$LIBQT $LIBPNG $LIBJPEG"
fi
+if test $kde_qtver = 3; then
+ AC_REQUIRE([KDE_CHECK_LIBDL])
+ LIBQT="$LIBQT $LIBDL"
+fi
+
AC_MSG_CHECKING([for Qt])
+if test "x$kde_use_qt_emb" != "xyes"; then
LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
+fi
ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
qt_libraries=""
qt_includes=""
@@ -1052,7 +1338,7 @@ if test ! "$ac_qt_includes" = "NO"; then
qt_incdirs="$ac_qt_includes $qt_incdirs"
fi
-if test "$kde_qtver" = "2"; then
+if test "$kde_qtver" != "1"; then
kde_qt_header=qstyle.h
else
kde_qt_header=qglobal.h
@@ -1088,8 +1374,8 @@ ac_ldflags_safe="$LDFLAGS"
ac_libs_safe="$LIBS"
CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
-LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS"
-LIBS="$LIBS $LIBQT"
+LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
+LIBS="$LIBS $LIBQT $KDE_MT_LIBS"
KDE_PRINT_QT_PROGRAM
@@ -1109,6 +1395,7 @@ AC_LANG_RESTORE
if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
ac_cv_have_qt="have_qt=no"
ac_qt_notfound=""
+ missing_qt_mt=""
if test "$ac_qt_includes" = NO; then
if test "$ac_qt_libraries" = NO; then
ac_qt_notfound="(headers and libraries)";
@@ -1116,11 +1403,17 @@ if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
ac_qt_notfound="(headers)";
fi
else
- ac_qt_notfound="(libraries)";
+ if test "x$kde_use_qt_mt" = "xyes"; then
+ missing_qt_mt="
+Make sure that you have compiled Qt with thread support!"
+ ac_qt_notfound="(library $qtlib-mt)";
+ else
+ ac_qt_notfound="(library $qtlib)";
+ fi
fi
AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
-For more details about this problem, look at the end of config.log.])
+For more details about this problem, look at the end of config.log.$missing_qt_mt])
else
have_qt="yes"
fi
@@ -1147,7 +1440,7 @@ AC_SUBST(qt_libraries)
AC_SUBST(qt_includes)
if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
- QT_INCLUDES="";
+ QT_INCLUDES=""
else
QT_INCLUDES="-I$qt_includes"
all_includes="$QT_INCLUDES $all_includes"
@@ -1159,14 +1452,25 @@ else
QT_LDFLAGS="-L$qt_libraries"
all_libraries="$all_libraries $QT_LDFLAGS"
fi
+test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS"
AC_SUBST(QT_INCLUDES)
AC_SUBST(QT_LDFLAGS)
AC_PATH_QT_MOC_UIC
-LIB_QT="$kde_int_qt "'$(LIBPNG) $(LIBJPEG) -lXext $(LIB_X11) $(LIBSM)'
+KDE_CHECK_QT_JPEG
+
+if test "x$kde_use_qt_emb" != "xyes"; then
+LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBPNG) -lXext $(LIB_X11) $(LIBSM)'
+else
+LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBPNG)'
+fi
+test -z "$KDE_MT_LIBS" || LIB_QT="$LIB_QT $KDE_MT_LIBS"
+
AC_SUBST(LIB_QT)
+AC_SUBST(LIB_QPE)
+AC_SUBST(kde_qtver)
])
AC_DEFUN(AC_PATH_QT,
@@ -1223,11 +1527,11 @@ if test "${prefix}" != NONE; then
ac_kde_includes=$prefix/include
if test "${exec_prefix}" != NONE; then
- kde_libraries=${exec_prefix}/lib
- ac_kde_libraries=$exec_prefix/lib
+ kde_libraries=${libdir}
+ ac_kde_libraries=$libdir
else
- kde_libraries=${prefix}/lib
- ac_kde_libraries=$prefix/lib
+ kde_libraries=${prefix}/lib
+ ac_kde_libraries=$prefix/lib
fi
else
ac_kde_includes=
@@ -1249,7 +1553,7 @@ fi
if test -z "$1"; then
-kde_incdirs="/usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde2/include /opt/kde/include $x_includes $qt_includes"
+kde_incdirs="/usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde3/include /opt/kde/include $x_includes $qt_includes $includedir"
test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs"
kde_incdirs="$ac_kde_includes $kde_incdirs"
AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
@@ -1261,9 +1565,9 @@ in the prefix, you've chosen, are no KDE headers installed. This will fail.
So, check this please and use another prefix!])
fi
-kde_libdirs="/usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib /usr/X11R6/lib /usr/local/lib /opt/kde2/lib /opt/kde/lib /usr/X11R6/kde/lib"
+kde_libdirs="/usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib/kde3 /usr/lib /usr/X11R6/lib /usr/local/lib /opt/kde3/lib /opt/kde/lib /usr/X11R6/kde/lib"
test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib $KDEDIR $kde_libdirs"
-kde_libdirs="$ac_kde_libraries $kde_libdirs"
+kde_libdirs="$ac_kde_libraries $libdir $kde_libdirs"
AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
ac_kde_libraries="$kde_libdir"
@@ -1304,7 +1608,7 @@ if test "$have_kde" != "yes"; then
AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
fi
- kde_libraries="${ac_kde_exec_prefix}/lib"
+ kde_libraries="${libdir}"
kde_includes=${ac_kde_prefix}/include
else
@@ -1429,6 +1733,8 @@ int main() {
printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
printf("kde_moduledir=\\"/tmp/dummy\\"\n");
+ printf("kde_styledir=\\"/tmp/dummy\\"\n");
+ printf("kde_widgetdir=\\"/tmp/dummy\\"\n");
return 0;
}
EOF
@@ -1470,7 +1776,7 @@ AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
LDFLAGS=$kde_ldflags_safe
LIBS=$kde_libs_safe
- kde_cxxflags_safe="$CXXFLAGS"
+ CXXFLAGS=$kde_cxxflags_safe
])
AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
@@ -1497,10 +1803,10 @@ AC_DEFUN(KDE_CHECK_KIMGIO,
LIBS="$LIBS $all_libraries $LIBJPEG $LIBTIFF $LIBPNG $LIBQT -lm"
AC_CHECK_LIB(kimgio, kimgioRegister, [
LIBKIMGIO_EXISTS=yes],LIBKIMGIO_EXISTS=no)
- LIBS="$kde_save_LIBS"
- AC_LANG_RESTORE
+ LIBS="$kde_save_LIBS"
+ AC_LANG_RESTORE
else
- LIBKIMGIO_EXISTS=yes
+ LIBKIMGIO_EXISTS=yes
fi
if test "$LIBKIMGIO_EXISTS" = "yes"; then
@@ -1517,13 +1823,35 @@ AC_DEFUN(KDE_CREATE_LIBS_ALIASES,
AC_REQUIRE([KDE_CHECK_LIBDL])
AC_REQUIRE([K_PATH_X])
-if test $kde_qtver = 2; then
+if test $kde_qtver = 3; then
+ LIB_KDECORE='-lkdecore'
+ AC_SUBST(LIB_KDECORE)
+ LIB_KDEUI='-lkdeui'
+ AC_SUBST(LIB_KDEUI)
+ LIB_KIO='-lkio'
+ AC_SUBST(LIB_KIO)
+ LIB_SMB='-lsmb'
+ AC_SUBST(LIB_SMB)
+ LIB_KAB='-lkab'
+ AC_SUBST(LIB_KAB)
+ LIB_KHTML='-lkhtml'
+ AC_SUBST(LIB_KHTML)
+ LIB_KSPELL='-lkspell'
+ AC_SUBST(LIB_KSPELL)
+ LIB_KPARTS='-lkparts'
+ AC_SUBST(LIB_KPARTS)
+ LIB_KDEPRINT='-lkdeprint'
+ AC_SUBST(LIB_KDEPRINT)
+# these are for backward compatibility
+ LIB_KSYCOCA='-lkio'
+ AC_SUBST(LIB_KSYCOCA)
+ LIB_KFILE='-lkio'
+ AC_SUBST(LIB_KFILE)
+elif test $kde_qtver = 2; then
LIB_KDECORE='-lkdecore'
AC_SUBST(LIB_KDECORE)
LIB_KDEUI='-lkdeui'
AC_SUBST(LIB_KDEUI)
- LIB_KFORMULA='-lkformula'
- AC_SUBST(LIB_KFORMULA)
LIB_KIO='-lkio'
AC_SUBST(LIB_KIO)
LIB_KSYCOCA='-lksycoca'
@@ -1540,8 +1868,8 @@ if test $kde_qtver = 2; then
AC_SUBST(LIB_KSPELL)
LIB_KPARTS='-lkparts'
AC_SUBST(LIB_KPARTS)
- LIB_KWRITE='-lkwrite'
- AC_SUBST(LIB_KWRITE)
+ LIB_KDEPRINT='-lkdeprint'
+ AC_SUBST(LIB_KDEPRINT)
else
LIB_KDECORE='-lkdecore -lXext $(LIB_QT)'
AC_SUBST(LIB_KDECORE)
@@ -1776,7 +2104,11 @@ AC_DEFUN(AC_FIND_GIF,
[AC_MSG_CHECKING([for giflib])
AC_CACHE_VAL(ac_cv_lib_gif,
[ac_save_LIBS="$LIBS"
+if test "x$kde_use_qt_emb" != "xyes"; then
LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
+else
+LIBS="$all_libraries -lgif"
+fi
AC_TRY_LINK(dnl
[
#ifdef __cplusplus
@@ -1887,6 +2219,41 @@ fi
AC_SUBST(LIBJPEG)
])
+AC_DEFUN(KDE_CHECK_QT_JPEG,
+[
+AC_MSG_CHECKING([if Qt needs $LIBJPEG])
+AC_CACHE_VAL(kde_cv_qt_jpeg,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+ac_save_LIBS="$LIBS"
+LIBS="$all_libraries $USER_LDFLAGS $LIBQT"
+LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
+ac_save_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
+AC_TRY_LINK(
+[#include <qapplication.h>],
+ [
+ int argc;
+ char** argv;
+ QApplication app(argc, argv);],
+ eval "kde_cv_qt_jpeg=no",
+ eval "kde_cv_qt_jpeg=yes")
+LIBS="$ac_save_LIBS"
+CXXFLAGS="$ac_save_CXXFLAGS"
+AC_LANG_RESTORE
+])
+
+if eval "test ! \"`echo $kde_cv_qt_jpeg`\" = no"; then
+ AC_MSG_RESULT(yes)
+ LIBJPEG_QT='$(LIBJPEG)'
+else
+ AC_MSG_RESULT(no)
+ LIBJPEG_QT=
+fi
+
+])
+
AC_DEFUN(AC_FIND_ZLIB,
[
AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
@@ -1929,7 +2296,11 @@ AC_CACHE_VAL(kde_cv_libtiff_$1,
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
kde_save_LIBS="$LIBS"
+if test "x$kde_use_qt_emb" != "xyes"; then
LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
+else
+LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm"
+fi
kde_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
@@ -1984,7 +2355,11 @@ AC_MSG_CHECKING([for libpng])
AC_CACHE_VAL(ac_cv_lib_png,
[
kde_save_LIBS="$LIBS"
+if test "x$kde_use_qt_emb" != "xyes"; then
LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
+else
+LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm"
+fi
kde_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
AC_LANG_C
@@ -2050,19 +2425,17 @@ fi
AC_DEFUN(KDE_CHECK_COMPILER_FLAG,
[
-dnl AC_REQUIRE([AC_CHECK_COMPILERS]) <- breaks with autoconf 2.50
AC_MSG_CHECKING(whether $CXX supports -$1)
-kde_cache=`echo $1 | sed 'y%.=/+-%___p_%'`
+kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
[
-echo 'int main() { return 0; }' >conftest.cc
-eval "kde_cv_prog_cxx_$kde_cache=no"
-if test -z "`$CXX -$1 -c conftest.cc 2>&1`"; then
- if test -z "`$CXX -$1 -o conftest conftest.o 2>&1`"; then
- eval "kde_cv_prog_cxx_$kde_cache=yes"
- fi
-fi
-rm -f conftest*
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -$1"
+ AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], [])
+ CXXFLAGS="$save_CXXFLAGS"
+ AC_LANG_RESTORE
])
if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
AC_MSG_RESULT(yes)
@@ -2101,22 +2474,33 @@ AC_DEFUN(AC_REMOVE_FORBIDDEN,
dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
AC_DEFUN(AC_VALIDIFY_CXXFLAGS,
[dnl
+if test "x$kde_use_qt_emb" != "xyes"; then
AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
+else
+ AC_REMOVE_FORBIDDEN(CXX, [-rpath])
+ AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath])
+fi
])
AC_DEFUN(AC_CHECK_COMPILERS,
[
- AC_ARG_ENABLE(debug,[ --enable-debug enables debug symbols [default=no]],
+ AC_ARG_ENABLE(debug,[ --enable-debug[=ARG] enables debug symbols (yes|no|full) [default=no]],
[
- if test $enableval = "no"; dnl
- then
- kde_use_debug_code="no"
- kde_use_debug_define=yes
- else
- kde_use_debug_code="yes"
- kde_use_debug_define=no
- fi
+ case $enableval in
+ yes)
+ kde_use_debug_code="yes"
+ kde_use_debug_define=no
+ ;;
+ full)
+ kde_use_debug_code="full"
+ kde_use_debug_define=no
+ ;;
+ *)
+ kde_use_debug_code="no"
+ kde_use_debug_define=yes
+ ;;
+ esac
],
[kde_use_debug_code="no"
kde_use_debug_define=no
@@ -2134,6 +2518,20 @@ AC_DEFUN(AC_CHECK_COMPILERS,
fi
], [kde_use_strict_options="no"])
+ AC_ARG_ENABLE(warnings,[ --enable-warnings compiles with -Wall and similiar],
+ [
+ if test $enableval = "no"; then
+ kde_use_warnings="no"
+ else
+ kde_use_warnings="yes"
+ fi
+ ], [kde_use_warnings="no"])
+
+ dnl enable warnings for debug build
+ if test "$kde_use_debug_code" != "no"; then
+ kde_use_warnings=yes
+ fi
+
AC_ARG_ENABLE(profile,[ --enable-profile creates profiling infos [default=no]],
[kde_use_profiling=$enableval],
[kde_use_profiling="no"]
@@ -2144,14 +2542,15 @@ AC_DEFUN(AC_CHECK_COMPILERS,
AC_PROG_CC
+ AC_PROG_CPP
+
if test "$GCC" = "yes"; then
- if test "$kde_use_debug_code" = "yes"; then
- CFLAGS="-g -O2 $CFLAGS"
- case $host in
- *-*-linux-gnu)
- CFLAGS="-ansi -W -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
- ;;
- esac
+ if test "$kde_use_debug_code" != "no"; then
+ if test $kde_use_debug_code = "full"; then
+ CFLAGS="-g3 $CFLAGS"
+ else
+ CFLAGS="-g -O2 $CFLAGS"
+ fi
else
CFLAGS="-O2 $CFLAGS"
fi
@@ -2161,6 +2560,7 @@ AC_DEFUN(AC_CHECK_COMPILERS,
CFLAGS="-DNDEBUG $CFLAGS"
fi
+
case "$host" in
*-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
*-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
@@ -2174,34 +2574,33 @@ AC_DEFUN(AC_CHECK_COMPILERS,
AC_PROG_CXX
- if test "$GXX" = "yes"; then
- if test "$kde_use_debug_code" = "yes"; then
- CXXFLAGS="-g -O2 -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings $CXXFLAGS"
-
- KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
- KDE_CHECK_COMPILER_FLAG(Wnon-virtual-dtor,[CXXFLAGS="-Wnon-virtual-dtor $CXXFLAGS"])
- KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
-
- case $host in dnl
- *-*-linux-gnu)
- CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wbad-function-cast -Wcast-align -Wundef -Wconversion $CXXFLAGS"
- ;;
- esac
-
- if test "$kde_use_strict_options" = "yes"; then
- CXXFLAGS="-Wcast-qual -Wbad-function-cast -Wshadow -Wcast-align $CXXFLAGS"
+ if test "$GXX" = "yes" || test "$CXX" = "KCC"; then
+ if test "$kde_use_debug_code" != "no"; then
+ if test "$CXX" = "KCC"; then
+ CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings $CXXFLAGS"
+ else
+ if test "$kde_use_debug_code" = "full"; then
+ CXXFLAGS="-g3 $CXXFLAGS"
+ else
+ CXXFLAGS="-g -O2 $CXXFLAGS"
+ fi
fi
+ KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
- if test "$kde_very_strict" = "yes"; then
- CXXFLAGS="-Wold-style-cast -Wredundant-decls -Wconversion $CXXFLAGS"
- fi
+ dnl convenience compiler flags
+ KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""])
+ AC_SUBST(WOVERLOADED_VIRTUAL)
else
- CXXFLAGS="-O2 $CXXFLAGS"
+ if test "$CXX" = "KCC"; then
+ CXXFLAGS="+K3 $CXXFLAGS"
+ else
+ CXXFLAGS="-O2 $CXXFLAGS"
+ fi
fi
fi
if test "$kde_use_debug_define" = "yes"; then
- CXXFLAGS="-DNDEBUG $CXXFLAGS"
+ CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS"
fi
if test "$kde_use_profiling" = "yes"; then
@@ -2211,10 +2610,69 @@ AC_DEFUN(AC_CHECK_COMPILERS,
CXXFLAGS="-pg $CXXFLAGS"
])
fi
+
+ if test "$kde_use_warnings" = "yes"; then
+ if test "$GCC" = "yes"; then
+ case $host in
+ *-*-linux-gnu)
+ CFLAGS="-ansi -W -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
+ CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion $CXXFLAGS"
+ ;;
+ esac
+ CXXFLAGS="-Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings $CXXFLAGS"
+ KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"])
+ KDE_CHECK_COMPILER_FLAG(Wbad-function-cast,[CXXFLAGS="-Wbad-function-cast $CXXFLAGS"])
+ KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
+ KDE_CHECK_COMPILER_FLAG(Wnon-virtual-dtor,[CXXFLAGS="-Wnon-virtual-dtor $CXXFLAGS"])
+ fi
+ fi
+
+ if test "$GCC" = "yes" && test "$kde_use_strict_options" = "yes"; then
+ CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS"
+ fi
- KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
- KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
- KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS= )
+ if test "$GXX" = "yes"; then
+ KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
+ KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
+ KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS= )
+ fi
+ if test "$CXX" = "KCC"; then
+ dnl unfortunately we currently cannot disable exception support in KCC
+ dnl because doing so is binary incompatible and Qt by default links with exceptions :-(
+ dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"])
+ dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS= )
+
+ AC_ARG_ENABLE(pch,[ --enable-pch enables precompiled header support (currently only KCC) [default=no]],
+ [
+ kde_use_pch=$enableval
+ ],[kde_use_pch=no])
+
+ if test "$kde_use_pch" = "yes"; then
+ dnl TODO: support --pch-dir!
+ KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"])
+ dnl the below works (but the dir must exist), but it's
+ dnl useless for a whole package.
+ dnl The are precompiled headers for each source file, so when compiling
+ dnl from scratch, it doesn't make a difference, and they take up
+ dnl around ~5Mb _per_ sourcefile.
+ dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp,
+ dnl [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"])
+ fi
+ dnl this flag controls inlining. by default KCC inlines in optimisation mode
+ dnl all implementations that are defined inside the class {} declaration.
+ dnl because of templates-compatibility with broken gcc compilers, this
+ dnl can cause excessive inlining. This flag limits it to a sane level
+ KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"])
+ KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"])
+ KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"])
+ KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"])
+ dnl Some source files are shared between multiple executables
+ dnl (or libraries) and some of those need template instantiations.
+ dnl In that case KCC needs to compile those sources with
+ dnl --one_instantiation_per_object. To make it easy for us we compile
+ dnl _all_ objects with that flag (--one_per is a shorthand).
+ KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"])
+ fi
AC_SUBST(USE_EXCEPTIONS)
dnl obsolete macro - provided to keep things going
USE_RTTI=
@@ -2256,7 +2714,28 @@ AC_DEFUN(AC_CHECK_COMPILERS,
IFS=$kde_safe_IFS
fi
+ if test -n "$CFLAGS"; then
+ kde_safe_IFS=$IFS
+ IFS=" "
+ NOOPT_CFLAGS=""
+ for i in $CFLAGS; do
+ case $i in
+ -O*)
+ ;;
+ *)
+ NOOPT_CFLAGS="$NOOPT_CFLAGS $i"
+ ;;
+ esac
+ done
+ IFS=$kde_safe_IFS
+ fi
+
+ if test "x$kde_use_qt_emb" = "xyes"; then
+ NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS -fno-rtti -DQWS"
+ fi
+
AC_SUBST(NOOPT_CXXFLAGS)
+ AC_SUBST(NOOPT_CFLAGS)
KDE_CHECK_FINAL
@@ -2292,8 +2771,32 @@ AC_LIBTOOL_CXX
LIBTOOL_SHELL="/bin/sh ./libtool"
# LIBTOOL="$LIBTOOL --silent"
-KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_RPATH)"
+KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)"
AC_SUBST(KDE_PLUGIN)
+
+AC_ARG_ENABLE(objprelink, [ --enable-objprelink prelink apps using objprelink (experimental [only tested on linux/386])],
+ kde_use_objprelink=$enableval, kde_use_objprelink=no)
+ if test "x$kde_use_objprelink" = "xyes"; then
+
+ KDE_FIND_PATH(objprelink, OBJPRELINK, [], [kde_use_objprelink=no])
+
+ if test "x$kde_use_objprelink" = "xyes"; then
+ AC_MSG_CHECKING([Patching libtool to run objprelink.])
+ mv libtool libtool.orig
+ cat > libtool <<\EOF
+#! /bin/sh
+for n ; do case $n in
+ *.o) test -r $n && echo objprelink $n && objprelink $n ;;
+ *.lo) m=`basename $n .lo`".o" && test -r $m && echo objprelink $m && objprelink $m
+ m=".libs/$m" && test -r $m && echo objprelink $m && objprelink $m ;;
+esac; done
+EOF
+ cat >> libtool libtool.orig
+ rm libtool.orig
+ chmod a+x libtool
+ AC_MSG_RESULT(done)
+ fi
+ fi
])
AC_DEFUN(KDE_CHECK_TYPES,
@@ -2494,7 +2997,7 @@ AC_DEFUN(AM_LC_MESSAGES,
dnl From Jim Meyering.
dnl FIXME: migrate into libit.
-AC_DEFUN(AM_FUNC_OBSTACK,
+AC_DEFUN([AM_FUNC_OBSTACK],
[AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
[AC_TRY_LINK([#include "obstack.h"],
[struct obstack *mem;obstack_free(mem,(char *) 0)],
@@ -2510,7 +3013,7 @@ AC_DEFUN(AM_FUNC_OBSTACK,
dnl From Jim Meyering. Use this if you use the GNU error.[ch].
dnl FIXME: Migrate into libit
-AC_DEFUN(AM_FUNC_ERROR_AT_LINE,
+AC_DEFUN([AM_FUNC_ERROR_AT_LINE],
[AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
[AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
am_cv_lib_error_at_line=yes,
@@ -2607,7 +3110,11 @@ AC_DEFUN(AC_HAVE_XPM,
AC_LANG_C
ac_save_ldflags="$LDFLAGS"
ac_save_cflags="$CFLAGS"
- LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
+ if test "x$kde_use_qt_emb" != "xyes"; then
+ LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
+ else
+ LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET"
+ fi
CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
AC_TRY_LINK([#include <X11/xpm.h>],[],
@@ -2659,41 +3166,46 @@ AC_DEFUN(AC_HAVE_DPMS,
dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
AC_CACHE_VAL(ac_cv_have_dpms,
[
- AC_LANG_C
- ac_save_ldflags="$LDFLAGS"
- ac_save_cflags="$CFLAGS"
- ac_save_libs="$LIBS"
- LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
- CFLAGS="$CFLAGS $X_INCLUDES"
- test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
- AC_TRY_LINK([
- #include <X11/Xproto.h>
- #include <X11/X.h>
- #include <X11/Xlib.h>
- #include <X11/extensions/dpms.h>
- int foo_test_dpms()
- { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
- ac_cv_have_dpms="yes", [
- LDFLAGS="$ac_save_ldflags"
- CFLAGS="$ac_save_cflags"
- LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
- LIBS="$LIBS -lXdpms"
- CFLAGS="$CFLAGS $X_INCLUDES"
- test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
- AC_TRY_LINK([
- #include <X11/Xproto.h>
- #include <X11/X.h>
- #include <X11/Xlib.h>
- #include <X11/extensions/dpms.h>
- int foo_test_dpms()
- { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
- [
- ac_cv_have_dpms="-lXdpms"
- ],ac_cv_have_dpms="no")
- ])
- LDFLAGS="$ac_save_ldflags"
- CFLAGS="$ac_save_cflags"
- LIBS="$ac_save_libs"
+ if test "x$kde_use_qt_emb" = "xyes"; then
+ AC_MSG_RESULT(no)
+ ac_cv_have_dpms="no"
+ else
+ AC_LANG_C
+ ac_save_ldflags="$LDFLAGS"
+ ac_save_cflags="$CFLAGS"
+ ac_save_libs="$LIBS"
+ LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
+ CFLAGS="$CFLAGS $X_INCLUDES"
+ test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
+ AC_TRY_LINK([
+ #include <X11/Xproto.h>
+ #include <X11/X.h>
+ #include <X11/Xlib.h>
+ #include <X11/extensions/dpms.h>
+ int foo_test_dpms()
+ { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
+ ac_cv_have_dpms="yes", [
+ LDFLAGS="$ac_save_ldflags"
+ CFLAGS="$ac_save_cflags"
+ LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
+ LIBS="$LIBS -lXdpms"
+ CFLAGS="$CFLAGS $X_INCLUDES"
+ test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
+ AC_TRY_LINK([
+ #include <X11/Xproto.h>
+ #include <X11/X.h>
+ #include <X11/Xlib.h>
+ #include <X11/extensions/dpms.h>
+ int foo_test_dpms()
+ { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
+ [
+ ac_cv_have_dpms="-lXdpms"
+ ],ac_cv_have_dpms="no")
+ ])
+ LDFLAGS="$ac_save_ldflags"
+ CFLAGS="$ac_save_cflags"
+ LIBS="$ac_save_libs"
+ fi
])dnl
if test "$ac_cv_have_dpms" = no; then
@@ -2733,7 +3245,10 @@ AC_DEFUN(AC_HAVE_GL,
AC_ARG_WITH(gl, [ --without-gl disable 3D GL modes],
gl_test=$withval, gl_test="yes")
- if test "x$gl_test" = xno; then
+ if test "x$kde_use_qt_emb" = "xyes"; then
+ # GL and Qt Embedded is a no-go for now.
+ ac_cv_have_gl=no
+ elif test "x$gl_test" = xno; then
ac_cv_have_gl=no
else
AC_MSG_CHECKING(for GL)
@@ -2742,15 +3257,19 @@ AC_DEFUN(AC_HAVE_GL,
AC_LANG_C
ac_save_ldflags="$LDFLAGS"
ac_save_cflags="$CFLAGS"
- LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries -lMesaGL -lMesaGLU -lX11 -lXext -lm $LIBSOCKET"
+ LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries -lMesaGL -lMesaGLU"
+ test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
+ LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET"
CFLAGS="$CFLAGS $X_INCLUDES"
test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
AC_TRY_LINK([#include <GL/gl.h>
-#include <GL/glu.h>
+#include <GL/glu.h>
], [],
ac_cv_have_gl="mesa", ac_cv_have_gl="no")
if test "x$ac_cv_have_gl" = "xno"; then
- LDFLAGS="$ac_save_ldflags $X_LDFLAGS $GL_LDFLAGS $all_libraries -lGL -lGLU -lX11 -lXext -lm $LIBSOCKET"
+ LDFLAGS="$ac_save_ldflags $X_LDFLAGS $GL_LDFLAGS $all_libraries -lGL -lGLU"
+ test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
+ LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET"
CFLAGS="$ac_save_cflags $X_INCLUDES"
test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
AC_TRY_LINK([#include <GL/gl.h>
@@ -2817,7 +3336,7 @@ AC_DEFUN(KDE_PAM, [
AC_CACHE_VAL(ac_cv_path_pam,
[ use_pam=no
AC_CHECK_LIB(pam, pam_start,
- [ AC_CHECK_HEADER(security/pam_appl.h,
+ [ AC_CHECK_HEADER(security/pam_appl.h,
[ use_pam=yes
pam_service=kde ])
], , $LIBDL)
@@ -2939,6 +3458,18 @@ AC_DEFUN(KDE_PASSWDLIBS, [
PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
fi
+ dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but
+ dnl /etc/master.passwd holds the actual passwords. /etc/master.passwd requires
+ dnl root to read, so kcheckpass needs to be root (even when using pam, since pam
+ dnl may need to read /etc/master.passwd).
+ case $host in
+ *-*-freebsd*)
+ SETUIDFLAGS="-m 4755 -o root"
+ ;;
+ *)
+ ;;
+ esac
+
AC_SUBST(PASSWDLIBS)
])
@@ -3215,7 +3746,7 @@ AC_DEFUN(KDE_CHECK_PTHREAD_OPTION,
if test "$kde_use_kernthreads" = "yes"; then
ac_save_CXXFLAGS="$CXXFLAGS"
- ac_save_CFLAGS="$CXXFLAGS"
+ ac_save_CFLAGS="$CFLAGS"
CXXFLAGS="-I/usr/local/include/pthread/linuxthreads $CXXFLAGS"
CFLAGS="-I/usr/local/include/pthread/linuxthreads $CFLAGS"
AC_CHECK_HEADERS(pthread/linuxthreads/pthread.h)
@@ -3243,20 +3774,19 @@ AC_DEFUN(KDE_CHECK_PTHREAD_OPTION,
solaris*)
KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
- echo "Setting Solaris pthread compilation options"
;;
freebsd*)
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
- echo "Setting FreeBSD pthread compilation options"
;;
aix*)
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
LIBPTHREAD="$LIBPTHREAD -lc_r"
- echo "Setting AIX pthread compilation options"
;;
linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
- USE_THREADS="$USE_THREADS -DPIC -fPIC"
- echo "Setting Linux pthread compilation options"
+ if test "$CXX" = "KCC"; then
+ CXXFLAGS="$CXXFLAGS --thread_safe"
+ NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe"
+ fi
;;
*)
;;
@@ -3271,13 +3801,16 @@ AC_DEFUN(KDE_CHECK_THREADING,
AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
dnl default is yes if libpthread is found and no if no libpthread is available
if test -z "$LIBPTHREAD"; then
- kde_check_threading_default=no
+ if test -z "$USE_THREADS"; then
+ kde_check_threading_default=no
+ else
+ kde_check_threading_default=yes
+ fi
else
kde_check_threading_default=yes
fi
AC_ARG_ENABLE(threading, [ --disable-threading disables threading even if libpthread found ],
kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
-
if test "x$kde_use_threading" = "xyes"; then
AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
fi
@@ -3423,16 +3956,17 @@ else
KDE_TRY_LINK_PYTHON(m, -lm)
KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
KDE_TRY_LINK_PYTHON(tcl, -ltcl)
+ KDE_TRY_LINK_PYTHON(db2, -ldb2)
KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
+ KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm])
KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
[AC_MSG_WARN([it seems, Python depends on another library.
- Pleae use \"make LIBPYTHON='-lpython$version -lotherlib'\" to fix this
+ Pleae set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this
and contact the authors to let them know about this problem])
-
])
LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
@@ -3448,9 +3982,10 @@ fi
AC_DEFUN(KDE_CHECK_PYTHON,
[
- KDE_CHECK_PYTHON_INTERN("2.1", [KDE_CHECK_PYTHON_INTERN("2.0",
- [ KDE_CHECK_PYTHON_INTERN($1, $2) ])
- ])
+ KDE_CHECK_PYTHON_INTERN("2.2",
+ [KDE_CHECK_PYTHON_INTERN("2.1",
+ [KDE_CHECK_PYTHON_INTERN("2.0", [ KDE_CHECK_PYTHON_INTERN($1, $2) ])
+ ])])
])
AC_DEFUN(KDE_CHECK_STL_SGI,
@@ -3510,7 +4045,7 @@ AC_DEFUN(KDE_CHECK_STL,
KDE_CHECK_STL_HP
if test "$kde_cv_stl_type_hp" = "no"; then
- AC_MSG_ERROR("no known STL type found")
+ AC_MSG_ERROR("no known STL type found - did you forget to install libstdc++[-devel] ?")
fi
fi
@@ -3804,16 +4339,6 @@ AC_DEFUN(KDE_CHECK_HEADER,
AC_LANG_RESTORE
])
-AC_DEFUN(KDE_CHECK_QWSPRITEFIELD,
-[
- KDE_CHECK_HEADER(QwSpriteField.h, ,
- [
- AC_MSG_WARN([you don't have QwSpriteField.h somewhere. Please install
- QwSpriteField out of kdesupport.])
- $1
- ])
-])
-
AC_DEFUN(KDE_FAST_CONFIGURE,
[
dnl makes configure fast (needs perl)
@@ -3844,7 +4369,7 @@ AC_DEFUN(KDE_SET_PREFIX,
if test "x$prefix" = "xNONE"; then
prefix=$ac_default_prefix
- ac_configure_args="$ac_configure_args --prefix $prefix"
+ ac_configure_args="$ac_configure_args --prefix=$prefix"
fi
KDE_FAST_CONFIGURE
KDE_CONF_FILES
@@ -3939,6 +4464,7 @@ AC_CACHE_VAL(kde_cv_c_long_long,
foo = foo+1;
],
kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
+ AC_LANG_RESTORE
])
AC_MSG_RESULT($kde_cv_c_long_long)
if test "$kde_cv_c_long_long" = yes; then
@@ -3948,14 +4474,17 @@ fi
AC_DEFUN(KDE_CHECK_LIB,
[
+ kde_save_LDFLAGS="$LDFLAGS"
+ dnl AC_CHECK_LIB modifies LIBS, so save it here
kde_save_LIBS="$LIBS"
- LIBS="$LIBS $all_libraries"
+ LDFLAGS="$LDFLAGS $all_libraries"
case $host_os in
- aix*) LIBS="-brtl $LIBS"
- test "$GCC" = yes && LIBS="-Wl,$LIBS"
+ aix*) LDFLAGS="-brtl $LDFLAGS"
+ test "$GCC" = yes && LDFLAGS="-Wl,$LDFLAGS"
;;
esac
AC_CHECK_LIB($1, $2, $3, $4, $5)
+ LDFLAGS="$kde_save_LDFLAGS"
LIBS="$kde_save_LIBS"
])
@@ -4013,13 +4542,13 @@ AC_ARG_WITH(java,
)
dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
-if test "x$ac_java_dir" = xno; then
+if test "x$ac_java_dir" = "xno"; then
kde_cv_java_bindir=no
kde_cv_java_includedir=no
- kde_cv_java_libjvmdir=no
- kde_cv_java_libhpidir=no
+ kde_java_libjvmdir=no
+ kde_java_libhpidir=no
else
- if test "x$ac_java_dir" = x; then
+ if test "x$ac_java_dir" = "x"; then
dnl No option set -> look in $PATH
AC_CACHE_VAL(kde_cv_java_bindir,
[
@@ -4040,13 +4569,13 @@ else
fi
fi
-dnl Look for libjvm.so
-kde_cv_java_libjvmdir=`find $kde_cv_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
-dnl Look for libhpi.so and avoid green threads
-kde_cv_java_libhpidir=`find $kde_cv_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,'`
-
dnl At this point kde_cv_java_bindir and kde_cv_java_includedir are either set or "no"
-if test ! "x$kde_cv_java_bindir" = xno; then
+if test "x$kde_cv_java_bindir" != "xno"; then
+
+ dnl Look for libjvm.so
+ kde_java_libjvmdir=`find $kde_cv_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
+ dnl Look for libhpi.so and avoid green threads
+ kde_java_libhpidir=`find $kde_cv_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,'`
dnl Now check everything's fine under there
@@ -4062,11 +4591,11 @@ if test ! "x$kde_cv_java_bindir" = xno; then
if test ! -r "$kde_cv_java_includedir/jni.h"; then
AC_MSG_ERROR([jni.h not found under $kde_cv_java_includedir. Use --with-java or --without-java.])
fi
- if test ! -r "$kde_cv_java_libjvmdir/libjvm.so"; then
- AC_MSG_ERROR([libjvm.so not found under $kde_cv_java_libjvmdir. Use --without-java.])
+ if test ! -r "$kde_java_libjvmdir/libjvm.so"; then
+ AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.])
fi
- if test ! -r "$kde_cv_java_libhpidir/libhpi.so"; then
- AC_MSG_ERROR([libhpi.so not found under $kde_cv_java_libhpidir. Use --without-java.])
+ if test ! -r "$kde_java_libhpidir/libhpi.so"; then
+ AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.])
fi
jni_includes="-I$kde_cv_java_includedir"
@@ -4088,15 +4617,18 @@ if test ! "x$kde_cv_java_bindir" = xno; then
#ifndef JNI_VERSION_1_2
Syntax Error
#endif
- ],[
- ],[ AC_MSG_ERROR([Incorrect version of $kde_cv_java_includedir/jni.h.
+ ],[ kde_jni_works=yes ],
+ [ kde_jni_works=no ])
+
+ if test $kde_jni_works = no; then
+ AC_MSG_ERROR([Incorrect version of $kde_cv_java_includedir/jni.h.
You need to have Java Development Kit (JDK) version 1.2.
Use --with-java to specify another location.
Use --without-java to configure without java support.
Or download a newer JDK and try again.
See e.g. http://java.sun.com/products/jdk/1.2 ])
- ])
+ fi
CXXFLAGS="$ac_cxxflags_safe"
AC_LANG_RESTORE
@@ -4111,7 +4643,139 @@ Syntax Error
JAR=$kde_cv_java_bindir/jar
AC_SUBST(JAR)
AC_SUBST(jni_includes)
- JVMLIBS="-L$kde_cv_java_libjvmdir -ljvm -L$kde_cv_java_libhpidir -lhpi"
+ JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi"
AC_SUBST(JVMLIBS)
fi
])
+
+dnl this is a redefinition of autoconf 2.5x's AC_FOREACH.
+dnl When the argument list becomes big, as in KDE for AC_OUTPUT in
+dnl big packages, m4_foreach is dog-slow. So use our own version of
+dnl it. (matz@kde.org)
+m4_define([mm_foreach],
+[m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])])
+m4_define([mm_car], [[$1]])
+m4_define([mm_car2], [[$@]])
+m4_define([_mm_foreach],
+[m4_if(m4_quote($2), [], [],
+ [m4_define([$1], [mm_car($2)])$3[]_mm_foreach([$1],
+ mm_car2(m4_shift($2)),
+ [$3])])])
+m4_define([AC_FOREACH],
+[mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])])
+
+AC_DEFUN(KDE_NEED_FLEX,
+[
+kde_libs_safe=$LIBS
+LIBS="$LIBS $USER_LDFLAGS"
+AM_PROG_LEX
+LIBS=$kde_libs_safe
+if test -z "$LEXLIB"; then
+ AC_MSG_ERROR([You need to have flex installed.])
+fi
+AC_SUBST(LEXLIB)
+])
+
+AC_DEFUN(AC_PATH_QTOPIA,
+[
+ dnl TODO: use AC_CACHE_VAL
+
+ if test -z "$1"; then
+ qtopia_minver_maj=1
+ qtopia_minver_min=5
+ qtopia_minver_pat=0
+ else
+ qtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"`
+ qtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"`
+ qtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"`
+ fi
+
+ qtopia_minver="$qtopia_minver_maj$qtopia_minver_min$qtopia_minver_pat"
+ qtopia_minverstr="$qtopia_minver_maj.$qtopia_minver_min.$qtopia_minver_pat"
+
+ AC_REQUIRE([AC_PATH_QT])
+
+ AC_MSG_CHECKING([for Qtopia])
+
+ LIB_QTOPIA="-lqpe"
+ AC_SUBST(LIB_QTOPIA)
+
+ kde_qtopia_dirs="$QPEDIR /opt/Qtopia"
+
+ ac_qtopia_incdir=NO
+
+ AC_ARG_WITH(qtopia-dir,
+ [ --with-qtopia-dir=DIR where the root of Qtopia is installed ],
+ [ ac_qtopia_incdir="$withval"/include] )
+
+ qtopia_incdirs=""
+ for dir in $kde_qtopia_dirs; do
+ qtopia_incdirs="$qtopia_incdirs $dir/include"
+ done
+
+ if test ! "$ac_qtopia_incdir" = "NO"; then
+ qtopia_incdirs="$ac_qtopia_incdir $qtopia_incdirs"
+ fi
+
+ qtopia_incdir=""
+ AC_FIND_FILE(qpe/qpeapplication.h, $qtopia_incdirs, qtopia_incdir)
+ ac_qtopia_incdir="$qtopia_incdir"
+
+ if test -z "$qtopia_incdir"; then
+ AC_MSG_ERROR([Cannot find Qtopia headers. Please check your installation.])
+ fi
+
+ qtopia_ver_maj=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`;
+ qtopia_ver_min=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`;
+ qtopia_ver_pat=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`;
+
+ qtopia_ver="$qtopia_ver_maj$qtopia_ver_min$qtopia_ver_pat"
+ qtopia_verstr="$qtopia_ver_maj.$qtopia_ver_min.$qtopia_ver_pat"
+ if test "$qtopia_ver" -lt "$qtopia_minver"; then
+ AC_MSG_ERROR([found Qtopia version $qtopia_verstr but version $qtopia_minverstr
+is required.])
+ fi
+
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+
+ ac_cxxflags_safe="$CXXFLAGS"
+ ac_ldflags_safe="$LDFLAGS"
+ ac_libs_safe="$LIBS"
+
+ CXXFLAGS="$CXXFLAGS -I$qtopia_incdir $all_includes"
+ LDFLAGS="$LDFLAGS $QT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
+ LIBS="$LIBS $LIB_QTOPIA $LIBQT"
+
+ cat > conftest.$ac_ext <<EOF
+#include "confdefs.h"
+#include <qpe/qpeapplication.h>
+#include <qpe/version.h>
+
+int main( int argc, char **argv )
+{
+ QPEApplication app( argc, argv );
+ return 0;
+}
+EOF
+
+ if AC_TRY_EVAL(ac_link) && test -s conftest; then
+ rm -f conftest*
+ else
+ rm -f conftest*
+ AC_MSG_ERROR([Cannot link small Qtopia Application. For more details look at
+the end of config.log])
+ fi
+
+ CXXFLAGS="$ac_cxxflags_safe"
+ LDFLAGS="$ac_ldflags_safe"
+ LIBS="$ac_libs_safe"
+
+ AC_LANG_RESTORE
+
+ QTOPIA_INCLUDES="-I$qtopia_incdir"
+ AC_SUBST(QTOPIA_INCLUDES)
+
+ AC_MSG_RESULT([found version $qtopia_verstr with headers at $qtopia_incdir])
+])
+