diff --git a/cde/Makefile b/cde/Makefile index 46168ce49..76a998ff6 100644 --- a/cde/Makefile +++ b/cde/Makefile @@ -131,7 +131,7 @@ Makefile.boot: imake.proto $(DEPENDSRC)/Makefile.proto depend.bootstrap $(IMAKES imake.proto: cd $(IMAKESRC) && $(MAKE) $(FLAGS) - $(RM) $(DEPENDSRC)/Makefile.proto + $(RM) $(DEPENDSRC)/Makefile.proto $(DEPENDSRC)/.depend $(DEPENDSRC)/Makefile.proto: $(IMAKE_CMD) -s $(DEPENDSRC)/Makefile.proto -f $(DEPENDSRC)/Imakefile -DTOPDIR=$(DEPENDTOP) -DCURDIR=$(DEPENDSRC) diff --git a/cde/config/cf/FreeBSD.cf b/cde/config/cf/FreeBSD.cf index 7a2bb7b50..34528bb1f 100644 --- a/cde/config/cf/FreeBSD.cf +++ b/cde/config/cf/FreeBSD.cf @@ -73,11 +73,8 @@ USE_GCC = UseGcc # define HasGcc2 YES #endif -/* Use installed X11 includes/libs on FreeBSD 11+ */ -#if (OSMajorVersion >= 11) +/* Use installed X11 includes/libs */ #define UseInstalledX11 YES -#endif - /* For DtHelp TIFF processing routines. */ #ifdef AMD64Architecture @@ -179,14 +176,31 @@ USE_GCC = UseGcc #endif #endif -/* The GCC strength-reduce bug is fixed for FreeBSD 2.1.5 and later */ +/* Suppress warnings dependant from compiler versions */ #ifndef DefaultGcc2i386Opt -#if OSMajorVersion > 2 || (OSMajorVersion == 2 && OSMinorVersion > 1) || (OSMajorVersion == 2 && OSMinorVersion == 1 && OSTeenyVersion >= 5) -#define DefaultGcc2i386Opt -O2 -fno-strict-aliasing -Wno-write-strings \ - -Wno-unused-result -#endif +# if defined(__clang__) && defined(__clang_major__) && defined(__clang_minor__) +# if (__clang_major__ > 3) || \ + (__clang_major__ == 3 && __clang_minor__ >= 4) +# define DefaultGcc2i386Opt -O2 -fno-strict-aliasing -Wno-write-strings \ + -Wno-unused-result +# else +# define DefaultGcc2i386Opt -O2 -fno-strict-aliasing -Wno-write-strings \ + -Wno-unused-result +# endif +# elif defined(__GNUC__) && defined(__GNUC_MINOR__) +# if (__GNUC__ > 4) || \ + (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) +# define DefaultGcc2i386Opt -O2 -fno-strict-aliasing -Wno-write-strings \ + -Wno-unused-result -Wno-deprecated +# else +# define DefaultGcc2i386Opt -O2 -fno-strict-aliasing -Wno-write-strings +# endif +# else +# define DefaultGcc2i386Opt -O2 -fno-strict-aliasing +# endif #endif + #ifndef OptimizedCDebugFlags # if defined(i386Architecture) || defined(AMD64Architecture) # define OptimizedCDebugFlags DefaultGcc2i386Opt @@ -210,6 +224,11 @@ ICONVSYSLIB != if test -f /usr/local/include/iconv.h; then echo -liconv; else ec #define StandardDefines -DCSRG_BASED #define StandardIncludes -I/usr/local/include + +#ifndef TopMotifInclude +#define TopMotifInclude /usr/local/include +#endif + #define BuildLibPathVar LD_LIBRARY_PATH #define DefaultUserPath /bin:/usr/bin:/usr/local/bin:$(BINDIR) diff --git a/cde/config/cf/Motif.rules b/cde/config/cf/Motif.rules index 8968f198b..24ee12adf 100644 --- a/cde/config/cf/Motif.rules +++ b/cde/config/cf/Motif.rules @@ -653,7 +653,7 @@ clean:: @@\ /* Search the Motif ProjectRoot too if it is different. */ #ifdef MotifProjectRoot -# define MUsrLibDirPath Concat(XUsrLibDirPath,:$(MPROJECTROOT)/lib) +# define MUsrLibDirPath Concat($(MPROJECTROOT)/lib,:XUsrLibDirPath) #else # define MUsrLibDirPath XUsrLibDirPath #endif diff --git a/cde/config/cf/Motif.tmpl b/cde/config/cf/Motif.tmpl index dc053ab8f..f3d612652 100644 --- a/cde/config/cf/Motif.tmpl +++ b/cde/config/cf/Motif.tmpl @@ -73,7 +73,7 @@ XCOMM $TOG: Motif.tmpl /main/6 1999/05/19 17:00:05 mgreess $ #endif #ifndef MTop -# if ImportMotif +# if ImportMotif || UseInstalledMotif # define MTop $(TOP)/imports/motif # else # define MTop $(TOP) diff --git a/cde/config/cf/NetBSD.cf b/cde/config/cf/NetBSD.cf index 1379dfa13..b5861ea4a 100644 --- a/cde/config/cf/NetBSD.cf +++ b/cde/config/cf/NetBSD.cf @@ -106,6 +106,8 @@ XCOMM operating system: OSName #define GccGasOption -DGCCUSESGAS #define AsmDefines -DUSE_GAS +/* Use installed X11 includes/libs */ +#define UseInstalledX11 YES #ifdef i386Architecture # ifndef OptimizedCDebugFlags diff --git a/cde/config/cf/OpenBSD.cf b/cde/config/cf/OpenBSD.cf index 825141883..c9e30dce6 100644 --- a/cde/config/cf/OpenBSD.cf +++ b/cde/config/cf/OpenBSD.cf @@ -148,10 +148,8 @@ XCOMM operating system: OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVe # endif #endif -/* Use installed versions of Xm and X11 */ -#if OSMajorVersion >= 6 +/* Use installed X11 includes/libs */ # define UseInstalledX11 YES -#endif /* * Compiler Features @@ -1050,8 +1048,13 @@ CXXDEPENDINCLUDE != CcCmd -v -x c++ /dev/null -fsyntax-only \ # endif #endif +/* Suppress warnings dependant from compiler versions */ #if !defined(GccWarningOptions) -# define GccWarningOptions -Wpointer-arith -Wno-unused -Wno-write-strings -Wno-switch -Wno-unused-result +# if (defined __clang__) +# define GccWarningOptions -Wpointer-arith -Wno-unused -Wno-write-strings -Wno-switch -Wno-unused-result +# else +# define GccWarningOptions -Wpointer-arith -Wno-unused -Wno-write-strings -Wno-switch +# endif #endif #define TtClientLibs $(TTLIB) $(XTOOLLIB) $(XLIB) diff --git a/cde/config/cf/site.def b/cde/config/cf/site.def index 3b8bb82f5..eb7f34384 100644 --- a/cde/config/cf/site.def +++ b/cde/config/cf/site.def @@ -21,9 +21,11 @@ XCOMM site: $TOG: site.def /main/23 1998/03/19 18:43:26 mgreess $ /* CDE uses a .C suffix for C++ source, not the default .cxx */ # define CCsuf C -/* We will import x11 and Motif. */ +/* We will import x11. */ # define ImportX11 YES -# define ImportMotif YES + +/* We will use installed Motif. */ +# define UseInstalledMotif YES # ifndef TopLevelProject # define TopLevelProject cde diff --git a/cde/config/cf/sun.cf b/cde/config/cf/sun.cf index 86f21f39e..05dc2cc17 100644 --- a/cde/config/cf/sun.cf +++ b/cde/config/cf/sun.cf @@ -376,7 +376,10 @@ man_keywords:: @@\ #define DependDefines -D__BUILTIN_VA_ARG_INCR #endif -#define LdPreLib -L/usr/X11/lib -L$(BUILDLIBDIR) +/* Use installed X11 includes/libs */ +#define UseInstalledX11 YES + +#define LdPreLib -L$(BUILDLIBDIR) #define PamUnixDefines -DPAM_NIS #define TtLargePICTable YES #define DtSvcDefines -DMULTIBYTE -DNO_REGCOMP @@ -406,7 +409,7 @@ man_keywords:: @@\ #define TtClientExtraLibs ExtraLibraries -ldl -lintl #ifndef TopMotifInclude -# define TopMotifInclude /usr/X11/include +# define TopMotifInclude $(MPROJECTROOT)/include #endif #define ShlibExportListOpt(filename) -M filename diff --git a/cde/config/imake/Makefile.ini b/cde/config/imake/Makefile.ini index f05a17de3..e57026c3f 100644 --- a/cde/config/imake/Makefile.ini +++ b/cde/config/imake/Makefile.ini @@ -11,7 +11,7 @@ BOOTSTRAPCFLAGS = CC = cc CDEBUGFLAGS = -O -INCLUDES = -I../../include -I/usr/local/include/X11 -I/usr/include/X11 -I/usr/X11R6/include/X11 -I../../imports/x11/include/X11 +INCLUDES = -I../../include -I/usr/local/include/X11 -I/usr/include/X11 -I/usr/X11R6/include/X11 -I/usr/X11R7/include/X11 CFLAGS = $(BOOTSTRAPCFLAGS) $(CDEBUGFLAGS) $(INCLUDES) SHELL = /bin/sh RM = rm -f @@ -47,7 +47,7 @@ relink: clean: $(RM) ccimake imake.o imake $(RM_CMD) \#* - $(RM) -r Makefile.proto Makefile Makefile.dep bootstrap + $(RM) -r Makefile.proto Makefile Makefile.dep bootstrap .depend depend: diff --git a/cde/programs/dtmail/dtmail/FindDialog.C b/cde/programs/dtmail/dtmail/FindDialog.C index 2ade10b5a..1275d82e3 100644 --- a/cde/programs/dtmail/dtmail/FindDialog.C +++ b/cde/programs/dtmail/dtmail/FindDialog.C @@ -734,7 +734,7 @@ FindDialog::compareMessage(DtMailMessageHandle handle) // See if string 'toFind' is anyware in string 'str'. // A case-insensitive version of strstr(). // -static const char * +const char * FindDialog::strcasestr(const char *str, const char *toFind) { const char *result = NULL; // Default to not found. diff --git a/cde/programs/nsgmls/Imakefile b/cde/programs/nsgmls/Imakefile index c10844668..5d3527648 100644 --- a/cde/programs/nsgmls/Imakefile +++ b/cde/programs/nsgmls/Imakefile @@ -62,6 +62,12 @@ M4 = /bin/m4 #if defined(LinuxArchitecture) || defined(BSDArchitecture) +#if defined(__llvm__) +NOIMPLTEMPLATES = +#else +NOIMPLTEMPLATES = -fno-implicit-templates +#endif + /* * put cpp directives here rather than in CXXDEFINES because * for some reason the CXXDEFINES aren't passed to the link phase @@ -69,12 +75,12 @@ M4 = /bin/m4 */ CXXOPTIONS = \ -DSP_VOLATILE=volatile -DSP_CONST=const -DSP_ANSI_CLASS_INST \ - -DSP_HAVE_LOCALE -DSP_MULTI_BYTE -DSP_MANUAL_INST -fno-implicit-templates + -DSP_HAVE_LOCALE -DSP_MULTI_BYTE -DSP_MANUAL_INST $(NOIMPLTEMPLATES) /* * Flags passed into compile step when doing manual template instantiation. */ -CXXTEMPLATEFLAGS = -fno-implicit-templates +CXXTEMPLATEFLAGS = $(NOIMPLTEMPLATES) M4 = /usr/bin/m4