Linux compilation of dtcm (Calendar), (Matthew Howkins)
authorPeter Howkins <flibble@users.sourceforge.net>
Wed, 11 Apr 2012 16:33:26 +0000 (17:33 +0100)
committerPeter Howkins <flibble@users.sourceforge.net>
Wed, 11 Apr 2012 16:33:26 +0000 (17:33 +0100)
27 files changed:
cde/programs/dtcm/dtcm/Imakefile
cde/programs/dtcm/dtcm/MonthPanel.c
cde/programs/dtcm/dtcm/calendarA.c
cde/programs/dtcm/dtcm/dayglance.c
cde/programs/dtcm/dtcm/find.c
cde/programs/dtcm/dtcm/format.c
cde/programs/dtcm/dtcm/monthglance.c
cde/programs/dtcm/dtcm/tempbr.c
cde/programs/dtcm/dtcm/weekglance.c
cde/programs/dtcm/dtcm/x_graphics.c
cde/programs/dtcm/dtcm/yearglance.c
cde/programs/dtcm/libDtCmP/getdate.y
cde/programs/dtcm/libDtCmP/timeops.c
cde/programs/dtcm/libDtCmP/util.c
cde/programs/dtcm/server/Imakefile
cde/programs/dtcm/server/garbage.c
cde/programs/dtcm/server/log.c
cde/programs/dtcm/server/parser.y
cde/programs/dtcm/server/reclotick.c
cde/programs/dtcm/server/recount.c
cde/programs/dtcm/server/relasttick.c
cde/programs/dtcm/server/renexttick.c
cde/programs/dtcm/server/repeat.c
cde/programs/dtcm/server/reprevtick.c
cde/programs/dtcm/server/reutil.c
cde/programs/dtcm/server/svcmain.c
cde/programs/dtcm/server/utility.c

index 4e36ab44a1cbf71b9eb02a1d43b958395c8c9a3e..bb2d86d10b245a7cd65eae18b880de81b3ca5241 100644 (file)
@@ -47,6 +47,12 @@ EXTRA_CCOPTIONS = -xstrconst -Xc -v
 EXTRA_LIBRARIES = $(FNS_EXTRA_LIBS)
 #endif
 
+XCOMM On Linux once you link against a C++ library the whole program 
+XCOMM has to be linked with the C++ linker
+#if defined(LinuxDistribution)
+CCLINK = $(CXX)
+#endif
+
 PROG1 = dtcm
 SRCS1 =        MonthPanel.c    RFCMIME.c       about.c \
        alarm.c         blist.c         browser.c \
index 2726b2943840537e4fcfdd2cc955ff1faf85c88f..d884f84178ac08f43df04bafa85f389ab4c2dccb 100644 (file)
@@ -69,6 +69,9 @@
 
 #define XOS_USE_XT_LOCKING
 #define X_INCLUDE_TIME_H
+#if defined(linux)
+#undef SVR4
+#endif
 #include <X11/Xos_r.h>
 
 /*
index 1e3551a98c959132dae616fa039b77a13392d3b3..b3f391b6fdf5d35f976274413bee30f73758f1cd 100644 (file)
@@ -131,6 +131,9 @@ static  char sccsid[] = "@(#)calendarA.c 1.196 95/04/12 Copyr 1991 Sun Microsyst
 #include "cmtt.h"
 #endif
 
+#if defined(linux)
+#undef SVR4
+#endif
 #include <X11/Xos.h>
 #include <errno.h>
 #ifdef X_NOT_STDC_ENV
index 65775eabc0521a2d8173292be7d09e7064fedc55..12aef5cef0fcc1435fa0bcbb053f7969ca18c1ac 100644 (file)
@@ -81,6 +81,9 @@ static char sccsid[] = "@(#)dayglance.c 1.76 95/04/24 Copyr 1991 Sun Microsystem
 
 #define XOS_USE_XT_LOCKING
 #define X_INCLUDE_TIME_H
+#if defined(linux)
+#undef SVR4
+#endif
 #include <X11/Xos_r.h>
 
 extern int debug;
index 7339c1f5ab397a8492e48315d39046d94df1df72..ecbf9232aabc6f9349d0770f8c753e48cab2a60b 100644 (file)
@@ -60,6 +60,9 @@
 
 #define XOS_USE_XT_LOCKING
 #define X_INCLUDE_TIME_H
+#if defined(linux)
+#undef SVR4
+#endif
 #include <X11/Xos_r.h>
 
 static void layout_labels(Widget, Widget, Widget, Widget);
index e92aa9d8b03c98defb18e2f74b18b1be658ea0dc..29f6e940c715b502036eb3bdd14a0746efc171f6 100644 (file)
@@ -69,6 +69,9 @@ static char sccsid[] = "@(#)format.c 1.27 95/01/19 Copyr 1991 Sun Microsystems,
 
 #define XOS_USE_XT_LOCKING
 #define X_INCLUDE_TIME_H
+#if defined(linux)
+#undef SVR4
+#endif
 #include <X11/Xos_r.h>
 
 /*
index 9f9a7c67a672437e31fde20d78d9359d540c6ee7..9d8e1fe066aa489b4c274e6f8fb29690b827422c 100644 (file)
@@ -101,6 +101,9 @@ static  char sccsid[] = "@(#)monthglance.c 1.82 95/07/27 Copyr 1994 Sun Microsys
 
 #define XOS_USE_XT_LOCKING
 #define X_INCLUDE_TIME_H
+#if defined(linux)
+#undef SVR4
+#endif
 #include <X11/Xos_r.h>
 
 static void    paint_day_entries(Tick, int, int, int, int,
index c9aa48d3284cc1760e67bff1826d5210c509e304..7b0759e45212f97b10cc121256547f61fb941c7e 100644 (file)
@@ -89,7 +89,11 @@ static  char sccsid[] = "@(#)tempbr.c 1.48 95/03/28 Copyr 1991 Sun Microsystems,
 static void tb_cancel_cb();
 static void tb_close_cb();
 static void tempbr_show_cb(Widget w, XtPointer data, XtPointer cbs);
+#if defined(linux)
+#include <string.h>
+#else
 extern char *strdup(const char *);
+#endif
 
 #ifdef FNS_DEMO
 /* This stuff is currently broken */
index 1d3a49d5238f222ce399ade1ca8cb9d8d5ea71dc..2e398e90bda027e81cf14c3ada472560234217ae 100644 (file)
@@ -77,6 +77,9 @@
 
 #define XOS_USE_XT_LOCKING
 #define X_INCLUDE_TIME_H
+#if defined(linux)
+#undef SVR4
+#endif
 #include <X11/Xos_r.h>
 
 static int week_xytoclock(Week *w, int x, int y);
index b7e1c84957ad1a5ffc8905f713b9225f49cd4812..d65b9883c968771902d0887f43ae285228d4375e 100644 (file)
@@ -66,6 +66,9 @@
 
 #define XOS_USE_XT_LOCKING
 #define X_INCLUDE_TIME_H
+#if defined(linux)
+#undef SVR4
+#endif
 #include <X11/Xos_r.h>
 
 /*
index ac0f457ef69b7c9dc3bdab4c457eb650e8354693..066e28fa556dbb6d31b28d5dfb16d324d1f94d7c 100644 (file)
@@ -88,6 +88,9 @@ static char sccsid[] = "@(#)yearglance.c 1.37 95/07/27 Copyr 1991 Sun Microsyste
 
 #define XOS_USE_XT_LOCKING
 #define X_INCLUDE_TIME_H
+#if defined(linux)
+#undef SVR4
+#endif
 #include <X11/Xos_r.h>
 
 /* if positioning of months in year view changes this must change too!
index 1faecc7a8da04a88f09df19c5642f665d8077d37..35a1aa32cba9d66d33b44473d5b597fb3177395e 100644 (file)
@@ -73,76 +73,76 @@ extern long timezone;
 timedate:              /* empty */
        | timedate item;
 
-item:  tspec =
+item:  tspec
                {timeflag++;}
-       | zone =
+       | zone
                {zoneflag++;}
-       | dtspec =
+       | dtspec
                {dateflag++;}
-       | dyspec =
+       | dyspec
                {dayflag++;}
-       | rspec =
+       | rspec
                {relflag++;}
        | nspec;
 
-nspec: NUMBER =
+nspec: NUMBER
                {if (timeflag && dateflag && !relflag) year = $1;
                else {timeflag++;hh = $1/100;mm = $1%100;ss = 0;merid = 24;}};
 
-tspec: NUMBER MERIDIAN =
+tspec: NUMBER MERIDIAN
                {hh = $1; mm = 0; ss = 0; merid = $2;}
-       | NUMBER ':' NUMBER =
+       | NUMBER ':' NUMBER
                {hh = $1; mm = $3; merid = 24;}
-       | NUMBER ':' NUMBER MERIDIAN =
+       | NUMBER ':' NUMBER MERIDIAN
                {hh = $1; mm = $3; merid = $4;}
-       | NUMBER ':' NUMBER ':' NUMBER =
+       | NUMBER ':' NUMBER ':' NUMBER
                {hh = $1; mm = $3; ss = $5; merid = 24;}
-       | NUMBER ':' NUMBER ':' NUMBER MERIDIAN =
+       | NUMBER ':' NUMBER ':' NUMBER MERIDIAN
                {hh = $1; mm = $3; ss = $5; merid = $6;};
 
-zone:  ZONE =
+zone:  ZONE
                {ourzone = $1; daylightsavings = STANDARD;}
-       | DAYZONE =
+       | DAYZONE
                {ourzone = $1; daylightsavings = DAYLIGHT;};
 
-dyspec:        DAY =
+dyspec:        DAY
                {dayord = 1; dayreq = $1;}
-       | DAY ',' =
+       | DAY ','
                {dayord = 1; dayreq = $1;}
-       | NUMBER DAY =
+       | NUMBER DAY
                {dayord = $1; dayreq = $2;};
 
-dtspec:        NUMBER '/' NUMBER =
+dtspec:        NUMBER '/' NUMBER
                {month = $1; day = $3; noyear = 1;}
-       | NUMBER '/' NUMBER '/' NUMBER =
+       | NUMBER '/' NUMBER '/' NUMBER
                {month = $1; day = $3; year = $5;}
-       | NUMBER '-' NUMBER =
+       | NUMBER '-' NUMBER
                {month = $1; day = $3; noyear = 1;}
-       | NUMBER '-' NUMBER '-' NUMBER =
+       | NUMBER '-' NUMBER '-' NUMBER
                {month = $1; day = $3; year = $5;}
-       | MONTH NUMBER =
+       | MONTH NUMBER
                {month = $1; day = $2; noyear = 1;}
-       | MONTH NUMBER ',' NUMBER =
+       | MONTH NUMBER ',' NUMBER
                {month = $1; day = $2; year = $4;}
-       | NUMBER MONTH =
+       | NUMBER MONTH
                {month = $2; day = $1; noyear = 1;}
-       | NUMBER MONTH NUMBER =
+       | NUMBER MONTH NUMBER
                {month = $2; day = $1; year = $3;};
 
 
-rspec: NUMBER UNIT =
+rspec: NUMBER UNIT
                {relsec +=  60L * $1 * $2;}
-       | NUMBER MUNIT =
+       | NUMBER MUNIT
                {relmonth += $1 * $2;}
-       | NUMBER SUNIT =
+       | NUMBER SUNIT
                {relsec += $1;}
-       | UNIT =
+       | UNIT
                {relsec +=  60L * $1;}
-       | MUNIT =
+       | MUNIT
                {relmonth += $1;}
-       | SUNIT =
+       | SUNIT
                {relsec++;}
-       | rspec AGO =
+       | rspec AGO
                {relsec = -relsec; relmonth = -relmonth;};
 %%
 
index c87fd05fec825b8c4f0972ea7c85c8006be64581..f0cdbbd7dbaef182398841fdae4ade1cb2479491 100644 (file)
@@ -58,7 +58,13 @@ static char sccsid[] = "@(#)timeops.c 1.13 95/05/02 Copyr 1991 Sun Microsystems,
 
 #define XOS_USE_NO_LOCKING
 #define X_INCLUDE_TIME_H
+#if defined(linux)
+#undef SVR4
+#endif
 #include <X11/Xos_r.h>
+#if defined(linux)
+#define SVR4
+#endif
 
 #include <sys/param.h>
 #include <sys/time.h>
index 57a21630b75d474b28fc1eabe308cb89e8a6e912..69ad7482d9c5fa4d30df51073f4c21d46a611c28 100644 (file)
@@ -72,6 +72,9 @@
 #define X_INCLUDE_STRING_H
 #define X_INCLUDE_TIME_H
 #define XOS_USE_NO_LOCKING
+#if defined(linux)
+#undef SVR4
+#endif
 #include <X11/Xos_r.h>
 
 #include <errno.h>
index f3158cea473fad2b7fb710185d95cadd280e1d57..78c30061796d7f94f5047224f898d980cef78473 100644 (file)
@@ -49,6 +49,12 @@ EXTRA_CCOPTIONS = -xstrconst -Xc -v
 EXTRA_LIBRARIES = -lsocket -lnsl -lintl
 #endif
 
+XCOMM On Linux once you link against a C++ library the whole program 
+XCOMM has to be linked with the C++ linker
+#if defined(LinuxDistribution)
+CCLINK = $(CXX)
+#endif
+
 SRCS = \
        parser.y        access.c        callback.c \
        cmscalendar.c   cmsconvert.c    cmsentry.c \
index a071213b881ab5f64dfe54efe16b2f33d2cbc8f3..c2a2aa3cf7d6c83863bf8216fddea3bbf909d59b 100644 (file)
@@ -35,6 +35,9 @@
 #include       <stdlib.h>
 #define XOS_USE_NO_LOCKING
 #define X_INCLUDE_TIME_H
+#if defined(linux)
+#undef SVR4
+#endif
 #include <X11/Xos_r.h>
 #include       "log.h"
 #include       "rtable4.h"
index de5cfa38a5397477150261a9e807fe263768d177..9b44ecb29c14b4fe474f359e010e74c0e600d7fb 100644 (file)
@@ -39,6 +39,9 @@
 #include <sys/file.h>
 #define XOS_USE_NO_LOCKING
 #define X_INCLUDE_TIME_H
+#if defined(linux)
+#undef SVR4
+#endif
 #include <X11/Xos_r.h>
 #include "cm.h"
 #include "rtable4.h"
index b49a02cbd56a64ef563a88436bb11e35cf9db769..f07bd698cc7aa374933ac862710759bfb2df2a2b 100644 (file)
@@ -12,7 +12,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#if defined(sun) && defined(_XOPEN_SOURCE)
+#if (defined(sun) && defined(_XOPEN_SOURCE)) || defined(linux)
 #include <time.h>
 #endif
 #include "csa.h"
index 8d37ce6b02de01f52ba561e1505d49b0a445bc7a..5733241a4644460c6fc6536605df3081ca3f0f0a 100644 (file)
@@ -30,6 +30,9 @@
 
 #define XOS_USE_NO_LOCKING
 #define X_INCLUDE_TIME_H
+#if defined(linux)
+#undef SVR4
+#endif
 #include <X11/Xos_r.h>
 
 #include <stdlib.h>
index 638f84ad647db4eb180e596f5e9ab15f6f2d622f..1f3d0c2cadd3eb0bbf4eb18d911917d889d89f31 100644 (file)
@@ -30,6 +30,9 @@
 
 #define XOS_USE_NO_LOCKING
 #define X_INCLUDE_TIME_H
+#if defined(linux)
+#undef SVR4
+#endif
 #include <X11/Xos_r.h>
 
 #include <EUSCompat.h>
index cbd9c1bacb7b8dcf10a19045fd7f2fd3b8ef5ef3..6109f12f091fe183509943590833561c0f6f2765 100644 (file)
@@ -30,6 +30,9 @@
 
 #define XOS_USE_NO_LOCKING
 #define X_INCLUDE_TIME_H
+#if defined(linux)
+#undef SVR4
+#endif
 #include <X11/Xos_r.h>
 
 #include <stdlib.h>
index 5cbe0d40e83d29dc6dd8604e9b8d7b9dcf4d0a5b..7dbf6904159e3059e4c19f275cd50495e93c5f75 100644 (file)
@@ -31,6 +31,9 @@
 
 #define XOS_USE_NO_LOCKING
 #define X_INCLUDE_TIME_H
+#if defined(linux)
+#undef SVR4
+#endif
 #include <X11/Xos_r.h>
 
 #include "rerule.h"
index 0f93c441316baff4e0dbee2c9018263ebc2bf666..89fa9e4c5aae6c1a3b41cc1b4a247cd9eb5c085f 100644 (file)
@@ -32,6 +32,9 @@
 #include <stdio.h>
 #define XOS_USE_NO_LOCKING
 #define X_INCLUDE_TIME_H
+#if defined(linux)
+#undef SVR4
+#endif
 #include <X11/Xos_r.h>
 #include "csa.h"
 #include "rtable4.h"
index 1b47c70db714803b5ecb7898198c14a79129e43b..3316a03b57e37caa0c80ef05087317b7443f621e 100644 (file)
@@ -30,6 +30,9 @@
 
 #define XOS_USE_NO_LOCKING
 #define X_INCLUDE_TIME_H
+#if defined(linux)
+#undef SVR4
+#endif
 #include <X11/Xos_r.h>
 
 #include "rerule.h"
index 289fec7ec056c75d24af709209a2f42e8c9108f0..bb4f7ed6dbc8a024e2ec207403ae7e8e2951a4bb 100644 (file)
@@ -37,6 +37,9 @@
 
 #define XOS_USE_NO_LOCKING
 #define X_INCLUDE_TIME_H
+#if defined(linux)
+#undef SVR4
+#endif
 #include <X11/Xos_r.h>
 
 extern int monthdays[12];
index 08785f84d63d371c4c251caeb9068b811ca861b4..62230ad5b7b5f5add64bb7f304aa0d5fbf641b70 100644 (file)
  *  (c) Copyright 1993, 1994 Sun Microsystems, Inc.
  */
 
+#if defined(linux)
+#define _POSIX_C_SOURCE 2
+#endif
+
 #include <EUSCompat.h>
 #include <stdio.h>
 #include <errno.h>
index c0ae66e3d3572e88df155a43ee4b76c57d51422e..1e8e018070b209bf708d1ccbc00fe2da6af0e115 100644 (file)
@@ -41,7 +41,9 @@
 #include "utility.h"
 #include "lutil.h"
 
+#if !defined(linux)
 extern char * strdup(const char *);
+#endif
 
 /*
  * calendar_name@host[.domain] -> calendar_name