[Kst] kdeextragear-2/kst

Andrew Walker arwalker at sumusltd.com
Wed Oct 27 22:24:14 CEST 2004


CVS commit by arwalker: 

Build KCalendarSystem if necessary.


  M +43 -0     configure.in.in   1.32
  M +6 -3      kst/Makefile.am   1.154


--- kdeextragear-2/kst/configure.in.in  #1.31:1.32
@@ -118,4 +118,47 @@
 KST_CHECK_MDI
 
+AC_DEFUN([KST_CHECK_CALENDARSYSTEM],
+[
+  AC_MSG_CHECKING(whether to use kcalendarsystem lib from kdelibs)
+  AC_CACHE_VAL(ac_cv_calendarsystem_setup,
+  [
+    AC_LANG_SAVE
+    AC_LANG_CPLUSPLUS
+    save_CXXFLAGS="$CXXFLAGS"
+    CXXFLAGS="$KDE_INCLUDES"
+
+    AC_TRY_LINK([
+      #include <kdeversion.h>
+    ],
+    [
+      #if KDE_VERSION < ((3<<16) | (2<<8) | (0))
+         KDE_choke me
+      #endif
+    ],
+      ac_cv_calendarsystem_setup=yes,
+      ac_cv_calendarsystem_setup=no
+    )
+    CXXFLAGS="$save_CXXFLAGS"
+    AC_LANG_RESTORE
+   ])
+
+  AM_CONDITIONAL(include_libkstkcalendarsystem, test "$ac_cv_calendarsystem_setup" = "no")
+  if test "$ac_cv_calendarsystem_setup" = "yes"; then
+    LIB_KCALENDARSYSTEM="-lkcalendarsystem"
+    KCALENDARSYSTEM_INCLUDES=""
+    AC_MSG_RESULT(yes)
+  else
+    LIB_KCALENDARSYSTEM='$(top_builddir)/kst/kst/libkstkcalendarsystem/libkstkcalendarsystem.la'
+    KCALENDARSYSTEM_INCLUDES='-I$(top_srcdir)/kst/kst/libkstkcalendarsystem'
+    CXXFLAGS="$CXXFLAGS -DCOMPAT_KCALENDARSYSTEM"
+    AC_MSG_RESULT(no)
+  fi
+
+  AC_SUBST(LIB_KCALENDARSYSTEM)
+  AC_SUBST(KCALENDARSYSTEM_INCLUDES)
+])
+
+KST_CHECK_CALENDARSYSTEM
+
 AC_DEFUN([KST_CHECK_JSE],
 [

--- kdeextragear-2/kst/kst/Makefile.am  #1.153:1.154
@@ -6,9 +6,12 @@
 KMDI_SUBDIR=libkstkmdi
 endif
+if include_libkstkcalendarsystem
+KCALENDARSYSTEM_SUBDIR=libkstkcalendarsystem
+endif
 if include_linux
 PROCPS_COPY=sysinfo.c psversion.c
 endif
 
-SUBDIRS=$(KMDI_SUBDIR) . datasources extensions
+SUBDIRS=$(KMDI_SUBDIR) $(KCALENDARSYSTEM_SUBDIR) . datasources extensions
 
 bin_PROGRAMS = kst d2asc
@@ -26,5 +29,5 @@
 
 libkst_la_LDFLAGS = -version-info 1:0:0 -no-undefined $(all_libraries)
-libkst_la_LIBADD = $(LIB_KPARTS) $(LIB_KMDI)
+libkst_la_LIBADD = $(LIB_KPARTS) $(LIB_KMDI) $(LIB_KCALENDARSYSTEM)
 
 d2asc_LDFLAGS = $(all_libraries) $(KDE_RPATH)
@@ -201,5 +204,5 @@
 
 # set the include path for X, qt and KDE
-INCLUDES= $(KMDI_INCLUDES) $(all_includes)
+INCLUDES= $(KMDI_INCLUDES) $(KCALENDARSYSTEM_INCLUDES) $(all_includes)
 
 rcdir = $(kde_datadir)/kst





More information about the Kst mailing list