/* * * Imake.rules -- new rules and overrides for old rules * */ #if defined(SunArchitecture) /* Sun users: change this to 0 if you are NOT building under OpenWindows */ #define FixOpenWindows 0 /* * * Early version of OpenWindows has several things broken in its imake setup. * We attempt to fix enough of it so that our software can be built using * the OpenWindows libraries * */ #if FixOpenWindows /* most problems appear to have been corrected as of Solaris 5.6 */ #if OSMajorVersion < 5 || (OSMajorVersion == 5 && OSMinorVersion < 6) /* * * the configuration directory is specified incorrectly in OpenWindows * */ #ifdef ConfigDir #undef ConfigDir #endif #define ConfigDir $(OPENWINHOME)/lib/config CONFIGDIR = ConfigDir /* * * OpenWindows seems to hardwire UseInstalled to True, * resulting in an annoying warning * */ #ifdef UseInstalled IMAKE_CMD = $(IMAKE) -I$(IRULESRC) $(IMAKE_DEFINES) #endif /* * * The makedepend program supplied by OpenWindows is broken: * it does not appear to recognize "#if defined(SYSV) ..." * We just skip the make depend part of the build -- users probably * don't need it anyway * */ DEPEND = /bin/true /* * * For Solaris, we add the -R option to the link in order to find the * shared libraries without the LD_LIBRARY environment variable * Note that this construct probably is not portable -- we assume * the right sort of Sun make. * */ #ifdef SVR4 LDOPTIONS += -R$(USRLIBDIR) #endif /* * The OpenWindows version of Install ends up installing the first * file twice for each directory!!! */ #ifdef InstallProgramWithFlags #undef InstallProgramWithFlags #endif /* InstallProgramWithFlags */ #define InstallProgramWithFlags(program,dest,flags) @@\ install:: program @@\ MakeDir($(DESTDIR)dest) @@\ $(INSTALL) -c $(INSTPGMFLAGS) flags program $(DESTDIR)dest #ifdef InstallNonExecFile #undef InstallNonExecFile #endif /* InstallNonExecFile */ #define InstallNonExecFile(file,dest) @@\ install:: file @@\ MakeDir($(DESTDIR)dest) @@\ $(INSTALL) -c $(INSTDATFLAGS) file $(DESTDIR)dest /* * OpenWindows specifies bsdinst as the install command but does * not include this script in its installation */ #if SystemV || SystemV4 #ifdef InstallCmd #undef InstallCmd #endif #define InstallCmd $(TOP)/scripts/bsdinst INSTALL = InstallCmd #endif #endif /* add your own horror stories here! */ #endif /* OpenWindows fixes */ #else /* non-Sun architecture should never use OpenWindows ... */ #define FixOpenWindows 0 #endif /* SunArchitecture */ #if defined(AlphaArchitecture) /* Dec Alpha users: change this to 1 if you are having trouble building, and please let us know what happens! */ #define FixAlphaCC 0 /* On the Alpha under 4.0, the -std1 switch (full ANSI) once caused problems in a few places (such as GtermP.h). If you have trouble building, try using -std0 below */ #if FixAlphaCC #if (OSMajorVersion > 3) #if LocCcCmd == cc #ifdef DefaultCCOptions #undef DefaultCCOptions #endif #define DefaultCCOptions -std0 #endif #endif #endif /* AlphaCC fixes */ #endif /* AlphaArchitecture */ /* On SGI IRIX 5.2 machines, there is a bug in the handling of X resources that crashes SAOtng. For these machines, we need to preprocess the GUI specification to make it smaller. If you are running 5.2 on the SGI, change the following directive to have a value of 1. */ #define CrunchGUI 0 /* This fixes a bug in bsdinst where it can't install non-exec files (0444) because it has no write permission to overwrite these files */ INSTDATFLAGS = ${INSTLIBFLAGS} /* we want to strip the installed executables, since there are so many */ INSTPGMFLAGS = InstPgmFlags /* * NormalLibraryTarget - rules to create a library in another directory */ #ifdef NormalLibraryTarget #undef NormalLibraryTarget #endif #define NormalLibraryTarget(libname,objlist) @@\ AllTarget(Concat3($(LLIBDIR)/,lib,libname.a)) @@\ @@\ Concat3($(LLIBDIR)/,lib,libname.a): objlist @@\ $(RM) $@ @@\ $(AR) $@ objlist @@\ RanLibrary($@) #ifndef InstallLink #define InstallLink(dir,tofile,fromfile) \ cd dir; $(RM) tofile;$(LN) fromfile tofile #endif /* * CleanScript - generate rules to remove a script file */ #ifndef CleanScript #define CleanScript(file) @@\ clean:: @@\ $(RM) file.script #endif /* CleanScript */ /* * PurifyProgramTarget - generate rules to purify a program * (Loosely taken from the X11R6 Imake.rule of the same name) */ #ifdef PurifyProgramTarget #undef PurifyProgramTarget #endif #define PurifyProgramTarget(program,deplist,linklist) @@\ program.pure: deplist @@\ RemoveTargetProgram($@) @@\ purify -optimize-save-o7=no $(PURIFYOPTIONS) $(CC) -o $@ $(LDOPTIONS) linklist $(EXTRA_LOAD_FLAGS) @@\ @@\ clean clean.pure:: @@\ $(RM) program.pure /* * * For SAO use only -- tricks to get the X libraries to link statically, * so we can build more portable binaries. Comes into play when we run * something like "make sol2imake" or "make linuximake" at the top level. * * Should work for most standard X setups that use gcc ... but no guarantees! * */ #ifdef SAOSTATIC /* * Solaris: just make the X libraries static */ #if defined(SunArchitecture) #if (HasGcc || HasGcc2) XAWLIB = -Xlinker -B -Xlinker static -lXaw EXTRA_LOAD_FLAGS = -Xlinker -B -Xlinker dynamic -ldl IMAKE_DEFINES = "-DSAOSTATIC" #else XAWLIB = -B static -lXaw EXTRA_LOAD_FLAGS = -B dynamic -ldl IMAKE_DEFINES = "-DSAOSTATIC" #endif #endif /* * Linux: make all X libraries static (fix glibc/non-glibc problem as well) */ #if defined(LinuxArchitecture) #if (HasGcc || HasGcc2) EXTRA_LOAD_FLAGS = -static IMAKE_DEFINES = "-DSAOSTATIC" #endif #endif #endif