* straighten the calendar service define / switch /configure
authorWilfried Göesgens <willi@citadel.org>
Sat, 6 Oct 2007 15:44:44 +0000 (15:44 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sat, 6 Oct 2007 15:44:44 +0000 (15:44 +0000)
webcit/calendar_view.c
webcit/configure.ac
webcit/webcit.h

index 83dc117caa26d983bee2fe28856692c785234498..9726c5fdcd3eab7e6cf98f5eb929960bc14e2310 100644 (file)
@@ -9,23 +9,7 @@
 #include "webcit.h"
 #include "webserver.h"
 
-#ifndef WEBCIT_WITH_CALENDAR_SERVICE
-
-/**\brief stub for non-libical builds */
-void do_calendar_view(void) {
-       wprintf("<center><i>");
-       wprintf(_("The calendar view is not available."));
-       wprintf("</i></center><br />\n");
-}
-
-/**\brief stub for non-libical builds */
-void do_tasks_view(void) {     
-       wprintf("<center><I>");
-       wprintf(_("The tasks view is not available."));
-       wprintf("</i></center><br />\n");
-}
-
-#else  /* WEBCIT_WITH_CALENDAR_SERVICE */
+#ifdef WEBCIT_WITH_CALENDAR_SERVICE
 
 /****************************************************************************/
 
@@ -1155,6 +1139,23 @@ void do_tasks_view(void) {
 
 }
 
+#else  /* WEBCIT_WITH_CALENDAR_SERVICE */
+
+/**\brief stub for non-libical builds */
+void do_calendar_view(void) {
+       wprintf("<center><i>");
+       wprintf(_("The calendar view is not available."));
+       wprintf("</i></center><br />\n");
+}
+
+/**\brief stub for non-libical builds */
+void do_tasks_view(void) {     
+       wprintf("<center><I>");
+       wprintf(_("The tasks view is not available."));
+       wprintf("</i></center><br />\n");
+}
+
+
 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
 
 /** @} */
index f0f968738e79d9120e140a32288d5ab5748d23b8..ed90932f87eb56e77153d64a8261d68b4c3a98ea 100644 (file)
@@ -108,6 +108,7 @@ AC_TYPE_SIGNAL
 dnl AC_FUNC_VPRINTF
 AC_REPLACE_FUNCS(snprintf)
 
+webcit_with_calendar_service=no
 dnl Checks for the libical calendaring library.
 if test "x$with_libical" != xno ; then
         AC_CHECK_HEADERS(ical.h,
@@ -138,11 +139,14 @@ main() {
                [
                        LIBS="-lical $LIBS"
                        AC_DEFINE(HAVE_LIBICAL,[],[whether we have libical available])
+                       webcit_with_calendar_service=yes
                ]
        )
 fi
 
-
+if test "$webcit_with_calendar_service" == "yes"; then
+                       AC_DEFINE(WEBCIT_WITH_CALENDAR_SERVICE,[],[whether we can do with calendar.])
+fi
 
 dnl Checks for the zlib compression library.
 if test "x$with_zlib" != xno ; then
index 5e24e49726c496794adfa4b5789b41cb11935364..b778d7cfe949f7437370f87bd1bd9ce08ca0a340 100644 (file)
@@ -67,13 +67,6 @@ extern locale_t wc_locales[];
 #include <zlib.h>
 #endif
 
-#ifdef HAVE_ICAL_H
-#ifdef HAVE_LIBICAL
-#define WEBCIT_WITH_CALENDAR_SERVICE 1
-#endif
-#endif
-
-
 
 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
 /* Work around PACKAGE/VERSION defs that are (not supposed to be?) in ical.h */