From 1e3b6741180925814bccb6566f41d218f0c15014 Mon Sep 17 00:00:00 2001 From: Peter Howkins Date: Thu, 22 Mar 2012 16:00:56 +0000 Subject: [PATCH 1/4] Do not include a couple of missing files under linux. --- cde/lib/DtTerm/TermPrim/TermPrimGetPty-svr4.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cde/lib/DtTerm/TermPrim/TermPrimGetPty-svr4.c b/cde/lib/DtTerm/TermPrim/TermPrimGetPty-svr4.c index 1964b5909..453bf3647 100644 --- a/cde/lib/DtTerm/TermPrim/TermPrimGetPty-svr4.c +++ b/cde/lib/DtTerm/TermPrim/TermPrimGetPty-svr4.c @@ -43,8 +43,10 @@ static char rcs_id[] = "$XConsortium: TermPrimGetPty-svr4.c /main/1 1996/04/21 1 #include "TermPrimDebug.h" #include "TermHeader.h" #include +#if !defined(linux) #include #include +#endif #include #ifdef USE_STREAMS_BUFMOD #include From cc949fccd206eff9a6d0e1f1e7e2fcd1abe0a955 Mon Sep 17 00:00:00 2001 From: Peter Howkins Date: Thu, 22 Mar 2012 17:05:45 +0000 Subject: [PATCH 2/4] Exceptionally hacky linux fix. gnu gencat is returning != 0 even when it's succeeding. --- cde/programs/localized/util/merge.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cde/programs/localized/util/merge.c b/cde/programs/localized/util/merge.c index 8a31625a3..7e247d62b 100644 --- a/cde/programs/localized/util/merge.c +++ b/cde/programs/localized/util/merge.c @@ -247,7 +247,13 @@ void cat_open () sprintf(line,"/usr/bin/gencat ./.dt_pfile.cat %s",pfile); #endif if ( system(line) != 0 ) + { + /* Utter Linux HACK, it seems the return value of GNU gencat is != 0 + even on success */ +#if !defined(linux) fatal("primary .tmsg file would not gencat\n",0,9); +#endif + } } catfile[0] = catopen("./.dt_pfile.cat",0); @@ -260,7 +266,14 @@ void cat_open () sprintf(line,"/usr/bin/gencat ./.dt_dfile.cat %s",dfile); #endif if ( system(line) != 0 ) + { + /* Utter Linux HACK, it seems the return value of GNU gencat is != 0 + even on success */ +#if !defined(linux) fatal("default .tmsg file would not gencat\n",0,9); +#endif + } + } catfile[1] = catopen("./.dt_dfile.cat",0); From d2f85af5e57a527cfbe4f60a4e8d6e8a8c2b73db Mon Sep 17 00:00:00 2001 From: Peter Howkins Date: Fri, 23 Mar 2012 13:49:24 +0000 Subject: [PATCH 3/4] Don't try to define abs() on linux, stdlib will handle it. --- cde/programs/dticon/constants.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cde/programs/dticon/constants.h b/cde/programs/dticon/constants.h index a2972ed37..9b4be16c8 100644 --- a/cde/programs/dticon/constants.h +++ b/cde/programs/dticon/constants.h @@ -97,8 +97,10 @@ typedef struct { #define min(a, b) ((a < b) ? a : b) #define max(a, b) ((a > b) ? a : b) #ifndef abs +#if !defined(linux) #define abs(a) (((a) < 0) ? -(a) : (a)) #endif +#endif #define mag(a,b) ((a-b) < 0 ? (b-a) : (a-b)) #define DARK 0 From d929f4cf5fbbb3c73850a25b3fcf5d9dc636c89f Mon Sep 17 00:00:00 2001 From: Peter Howkins Date: Fri, 23 Mar 2012 13:49:49 +0000 Subject: [PATCH 4/4] Link with C++ linker --- cde/programs/dticon/Imakefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cde/programs/dticon/Imakefile b/cde/programs/dticon/Imakefile index 1f147e843..898a1357f 100644 --- a/cde/programs/dticon/Imakefile +++ b/cde/programs/dticon/Imakefile @@ -53,6 +53,11 @@ SYS_LIBRARIES = -lm -ldl -lgen EXTRA_DEFINES = #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 = dtIconShell.c event.c fileIO.c \ fileIODialog.c globals.c graphics.c \