From 4d48253234d5b869c55df2edee42b87f08cb04fa Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Sat, 8 Mar 2014 23:43:17 -0700 Subject: [PATCH] linux depend: stop using makedepend, use gcc instead gcc can generate dependencies, so use that instead of building and depending on the rather delicate and archaic 'makedepend'. This fix removes makedepend from being built or used on linux, and instead uses gcc to generate dependency data in .depend files. I think pretty much every platform that uses gcc should do this. I am not sure if other compilers (intel, clang) can do this though. --- cde/config/Imakefile | 5 ++++ cde/config/cf/linux.cf | 55 +++++++++++++++++++++++++++++++++--------- 2 files changed, 49 insertions(+), 11 deletions(-) diff --git a/cde/config/Imakefile b/cde/config/Imakefile index 26b3dd05..e363dd9b 100644 --- a/cde/config/Imakefile +++ b/cde/config/Imakefile @@ -5,7 +5,12 @@ XCOMM $XConsortium: Imakefile /main/6 1996/09/28 16:04:42 rws $ #undef BootstrapCleanSubdirs #define BootstrapCleanSubdirs BOOTSTRAPSUBDIRS="$(BOOTSTRAPSUBDIRS)" +#if defined(LinuxArchitecture) +BOOTSTRAPSUBDIRS = imake +#else BOOTSTRAPSUBDIRS = imake makedepend +#endif + SUBDIRS = cf $(BOOTSTRAPSUBDIRS) util MakeSubdirs($(SUBDIRS)) diff --git a/cde/config/cf/linux.cf b/cde/config/cf/linux.cf index c217dbdd..a77e7ece 100644 --- a/cde/config/cf/linux.cf +++ b/cde/config/cf/linux.cf @@ -76,6 +76,17 @@ XCOMM binutils: (LinuxBinUtilsMajorVersion) #define HasPutenv YES #define HasShm YES #define HasSockets YES + +#define HasMakefileSafeInclude YES +#define DependFileName .depend +#define DependCmd $(CC) -E -MM -MG + +#ifdef IncludeMakefile +# undef IncludeMakefile +#endif + +#define IncludeMakefile(file) -include file + #if (LinuxDistribution == LinuxRedHat) # define HasZlib YES #endif @@ -190,8 +201,6 @@ TIRPCLIB = # define HasPlugin YES # define VendorHasX11R6_3libXext YES /* XC or XFree86 3.3.1 */ # endif -/* add this to void screenfuls of warnings from makedepend */ -# define DependFlags -I/usr/include/i386-linux-gnu #endif /* i386Architecture */ #ifdef AMD64Architecture @@ -204,8 +213,6 @@ TIRPCLIB = # define HasPlugin YES # define VendorHasX11R6_3libXext YES /* XC or XFree86 3.3.1 */ # endif -/* add this to void screenfuls of warnings from makedepend */ -# define DependFlags -I/usr/include/x86_64-linux-gnu #endif /* AMD64Architecture */ #ifdef PpcArchitecture @@ -224,13 +231,6 @@ TIRPCLIB = # define StandardCppDefines -traditional #endif /* Mc68020Architecture */ -#ifdef HasGcc2 -CXXDEPENDINCLUDE = $(shell CppCmd -x c++ -Wp,-v < /dev/null \ - 2>&1 | sed -n 's/ \(.*[cg]++.*\)/-I\1/p') -#define CplusplusDependIncludes $(CXXDEPENDINCLUDE) -#endif -#define DependDefines -D_SYS_RESOURCE_H -D_SYS_UTSNAME_H - #define StandardDefines -Dlinux LinuxMachineDefines LinuxSourceDefines #define ConnectionFlags -DUNIXCONN -DTCPCONN @@ -260,6 +260,39 @@ XCOMM This is needed for CDE currently #define ArchitectureDefines -DLINUX_ARCHITECTURE +XCOMM different dependancy handling +#ifndef DependDependency +#define DependDependency() /**/ +#endif + +#ifdef DependTarget +# undef DependTarget +#endif + +#define DependTarget() @@@@\ +DependDependency() @@@@\ + @@@@\ +depend:: DependFileName @@@@\ + @@@@\ +DependFileName:: @@@@\ + -RunProgram(DEPEND,$(DEPENDFLAGS) $(ALLDEFINES) $(DEPEND_DEFINES) $(SRCS)) > $@ + +#ifdef DependTarget3 +# undef DependTarget3 +#endif + +#define DependTarget3(srcs1,srcs2,srcs3) @@@@\ +DependDependency() @@@@\ + @@@@\ +depend:: DependFileName @@@@\ + @@@@\ +DependFileName:: @@@@\ + -RunProgram(DEPEND,$(DEPENDFLAGS) $(ALLDEFINES) $(DEPEND_DEFINES) srcs1) > $@ @@@@\ + -RunProgram(DEPEND,$(DEPENDFLAGS) $(ALLDEFINES) $(DEPEND_DEFINES) srcs2) >> $@ @@@@\ + -RunProgram(DEPEND,$(DEPENDFLAGS) $(ALLDEFINES) $(DEPEND_DEFINES) srcs3) >> $@ + + + #define TtClientLibs $(TTLIB) $(TIRPCLIB) $(XTOOLLIB) $(XLIB) #define TtClientDepLibs $(DEPTTLIB) $(DEPXTOOLLIB) $(DEPXLIB) -- 2.25.1