[comp.windows.x] Small bug in util/imake.includes/Imake.rules

casey@lll-crg.llnl.gov (Casey Leedom) (12/10/88)

  The imake rules file doesn't use the INSTBINFLAGS definition to install
programs.  This makes it impossible to do things like specify that you
want your binaries stripped as they are installed.

Casey

-----
*** util/imake.includes/Imake.rules-dist	Sun Oct 23 19:46:39 1988
--- util/imake.includes/Imake.rules	Fri Dec  9 11:38:04 1988
***************
*** 157,163 ****
   */
  #define	InstallProgram(program,dest)					@@\
  install:: program							@@\
! 	$(INSTALL) -c $(INSTALLFLAGS) program dest
  
  /*
   * Install a program specifying the flags to use
--- 157,163 ----
   */
  #define	InstallProgram(program,dest)					@@\
  install:: program							@@\
! 	$(INSTALL) -c $(INSTBINFLAGS) program dest
  
  /*
   * Install a program specifying the flags to use

casey@lll-crg.llnl.gov (Casey Leedom) (12/10/88)

  Opps!  A follow up to that last bug report.  If you make the fix I
indicated in Imake.rules, you also need to make the following fix to
xload's Imakefile.  Note that a similar fix is necessary for xperfmon's
Imakefile.

*** clients/xload/Imakefile-dist	Thu Oct 13 13:45:17 1988
--- clients/xload/Imakefile	Fri Dec  9 13:41:58 1988
***************
*** 3,8 ****
             SRCS = xload.c
             OBJS = xload.o
  
!    INSTALLFLAGS = $(INSTKMEMFLAGS)
  
  ComplexProgramTarget(xload)
--- 3,8 ----
             SRCS = xload.c
             OBJS = xload.o
  
!   INSTKMEMFLAGS = $(INSTKMEMFLAGS)
  
  ComplexProgramTarget(xload)

casey@lll-crg.llnl.gov (Casey Leedom) (12/10/88)

| From: jim@EXPO.LCS.MIT.EDU (Jim Fulton)
| 
| Don't forget that you'll probably also need to fix up the Imakefiles for
| xterm and xload (and any other setuid programs) that bash the
| INSTALLFLAGS.  Thats why I didn't do it for R3.

  Ack!!!  Jim is of course 100% right.  I had no idea there were so many
Imakefiles that munged INSTALLFLAGS.  That, together with the
imake.includes/README file which explicitly states that that's what
INSTALLFLAGS is for (YACORTFM (Yet Another Case Of RTFM)).

  I hereby hastily withdraw my fixes for util/imake.includes/Imake.rules
and clients/xload/Imakefile.  Instead I offer the following as a possible
suggestion (I'm trying it right now to see if it will do what I want):
make the default INSTALLFLAGS = INSTBINFLAGS.  This is accomplished with
the following simple change:

*** util/imake.includes/Imake.tmpl-dist	Sun Oct 23 19:37:17 1988
--- util/imake.includes/Imake.tmpl	Fri Dec  9 18:16:28 1988
***************
*** 403,408 ****
--- 403,409 ----
        LIBMANDIR = LibmanDir		/* man pages for library routines */
      XAPPLOADDIR = XAppLoadDir		/* application default resources */
  
+    INSTALLFLAGS = InstBinFlags		/* default is to install a binary */
     INSTBINFLAGS = InstBinFlags		/* install flags for programs */
     INSTUIDFLAGS = InstUidFlags		/* install flags for setuid programs */
     INSTLIBFLAGS = InstLibFlags		/* install flags for libraries */

  Any Imakefile that want's to install anything other than a binary
should already be munging INSTALLFLAGS, so this should get us into
trouble.  You'll of course see a retraction from me if I'm wrong ... :-(

Casey

casey@lll-crg.llnl.gov (Casey Leedom) (12/14/88)

  As per my earier posting, I tried making INSTBINFLAGS be the default
INSTALLFLAGS.  There were a few Imakefiles which used the default install
flags even though they were installing non-executables, but over all, the
number of changes is still very small:

	%%% util/imake.include/Imake.tmpl:
	%%%
	%%% Added InstNonExecFlags (INSTNONEXFLAGS) and InstScriptFlags
	%%% (INSTSCRIPTFLAGS).  Made InstBinFlags be the default
	%%% INSTALLFLAGS.

*** util/imake.includes/Imake.tmpl-dist	Sun Oct 23 19:37:17 1988
--- util/imake.includes/Imake.tmpl	Sat Dec 10 17:38:12 1988
***************
*** 333,338 ****
--- 333,344 ----
  #ifndef XAppLoadDir
  #define XAppLoadDir $(LIBDIR)/app-defaults
  #endif
+ #ifndef InstNonExecFlags
+ #define InstNonExecFlags
+ #endif
+ #ifndef InstScriptFlags
+ #define InstScriptFlags -m 0755
+ #endif
  #ifndef InstBinFlags
  #define InstBinFlags -m 0755
  #endif
***************
*** 403,408 ****
--- 409,417 ----
        LIBMANDIR = LibmanDir		/* man pages for library routines */
      XAPPLOADDIR = XAppLoadDir		/* application default resources */
  
+    INSTALLFLAGS = InstBinFlags		/* default is to install a binary */
+  INSTNONEXFLAGS = InstNonExecFlags	/* install flags for non executables */
+ INSTSCRIPTFLAGS = InstScriptFlags	/* install flags for scripts */
     INSTBINFLAGS = InstBinFlags		/* install flags for programs */
     INSTUIDFLAGS = InstUidFlags		/* install flags for setuid programs */
     INSTLIBFLAGS = InstLibFlags		/* install flags for libraries */

	%%% util/imake.includes/Imake.rules:
	%%%
	%%% Changed InstallNonExec macro to use INSTNONEXFLAGS,
	%%% InstallScript macro to use INSTSCRIPTFLAGS.

*** util/imake.includes/Imake.rules-dist	Sun Oct 23 19:46:39 1988
--- util/imake.includes/Imake.rules	Sat Dec 10 15:56:05 1988
***************
*** 150,156 ****
   */
  #define	InstallNonExec(file,dest)					@@\
  install:: file								@@\
! 	$(INSTALL) -c $(INSTALLFLAGS) file dest
  
  /*
   * Install a program
--- 150,156 ----
   */
  #define	InstallNonExec(file,dest)					@@\
  install:: file								@@\
! 	$(INSTALL) -c $(INSTNONEXFLAGS) file dest
  
  /*
   * Install a program
***************
*** 171,177 ****
   */
  #define	InstallScript(program,dest)					@@\
  install:: program.script						@@\
! 	$(INSTALL) -c $(INSTALLFLAGS) program.script dest/program
  
  
  /*
--- 171,177 ----
   */
  #define	InstallScript(program,dest)					@@\
  install:: program.script						@@\
! 	$(INSTALL) -c $(INSTSCRIPTFLAGS) program.script dest/program
  
  
  /*

	%%% X11/bitmaps/Imakefile:
	%%%
	%%% Added ``INSTALLFLAGS = $(INSTNONEXFLAGS)

*** X11/bitmaps/Imakefile-dist	Sun Oct 23 18:49:48 1988
--- X11/bitmaps/Imakefile	Sat Dec 10 15:40:28 1988
***************
*** 41,46 ****
--- 41,48 ----
  	xlogo32 \
  	xlogo64 
  
+ INSTALLFLAGS = $(INSTNONEXFLAGS)
+ 
  all::
  
  MakeDirectories(install,$(INCDIR)/bitmaps)

	%%% fonts/bdf/*/Imakefile:
	%%%
	%%% Added ``INSTALLFLAGS = $(INSTNONEXFLAGS)

*** fonts/bdf/100dpi/Imakefile-dist	Mon Oct 24 18:40:54 1988
--- fonts/bdf/100dpi/Imakefile	Sat Dec 10 15:41:38 1988
***************
*** 13,19 ****
  	charI14.snf charI18.snf charI24.snf charR08.snf charR10.snf \
  	charR12.snf charR14.snf charR18.snf charR24.snf
  
! FONTINSTDIR = $(FONTDIR)/100dpi
  
  MakeFonts()
  
--- 13,20 ----
  	charI14.snf charI18.snf charI24.snf charR08.snf charR10.snf \
  	charR12.snf charR14.snf charR18.snf charR24.snf
  
! INSTALLFLAGS = $(INSTNONEXFLAGS)
!  FONTINSTDIR = $(FONTDIR)/100dpi
  
  MakeFonts()
  
*** fonts/bdf/75dpi/Imakefile-dist	Mon Oct 24 18:41:00 1988
--- fonts/bdf/75dpi/Imakefile	Sat Dec 10 15:41:38 1988
***************
*** 53,59 ****
  	charI14.snf charI18.snf charI24.snf charR08.snf charR10.snf \
  	charR12.snf charR14.snf charR18.snf charR24.snf
  
! FONTINSTDIR = $(FONTDIR)/75dpi
  
  MakeFonts()
  
--- 53,60 ----
  	charI14.snf charI18.snf charI24.snf charR08.snf charR10.snf \
  	charR12.snf charR14.snf charR18.snf charR24.snf
  
! INSTALLFLAGS = $(INSTNONEXFLAGS)
!  FONTINSTDIR = $(FONTDIR)/75dpi
  
  MakeFonts()
  
*** fonts/bdf/misc/Imakefile-dist	Sun Oct 23 19:25:38 1988
--- fonts/bdf/misc/Imakefile	Sat Dec 10 15:41:38 1988
***************
*** 1,6 ****
  SRCS = 6x10.bdf 6x12.bdf 6x13.bdf 8x13.bdf 8x13B.bdf 9x15.bdf cursor.bdf 
  OBJS = 6x10.snf 6x12.snf 6x13.snf 8x13.snf 8x13B.snf 9x15.snf cursor.snf 
! FONTINSTDIR = $(FONTDIR)/misc
  
  MakeFonts()
  
--- 1,8 ----
  SRCS = 6x10.bdf 6x12.bdf 6x13.bdf 8x13.bdf 8x13B.bdf 9x15.bdf cursor.bdf 
  OBJS = 6x10.snf 6x12.snf 6x13.snf 8x13.snf 8x13B.snf 9x15.snf cursor.snf 
! 
! INSTALLFLAGS = $(INSTNONEXFLAGS)
!  FONTINSTDIR = $(FONTDIR)/misc
  
  MakeFonts()
  
	%%% clients/bitmap/Imakefile:
	%%%
	%%% Install bmtoa and atobm using INSTBINFLAGS.

*** clients/bitmap/Imakefile-dist	Thu Oct 13 10:23:49 1988
--- clients/bitmap/Imakefile	Sat Dec 10 15:19:59 1988
***************
*** 9,16 ****
  ComplexProgramTarget_1(bitmap,$(XMULIB) $(XLIB),-lm)
  SingleProgramTarget(bmtoa,$(OBJS2),$(XMULIB),)
  SingleProgramTarget(atobm,$(OBJS3),,)
! InstallProgramWithFlags(bmtoa,$(BINDIR),)
! InstallProgramWithFlags(atobm,$(BINDIR),)
  /*
  ComplexProgramTarget_2(bmtoa,$(XMULIB),)
  ComplexProgramTarget_3(atobm,,)
--- 9,16 ----
  ComplexProgramTarget_1(bitmap,$(XMULIB) $(XLIB),-lm)
  SingleProgramTarget(bmtoa,$(OBJS2),$(XMULIB),)
  SingleProgramTarget(atobm,$(OBJS3),,)
! InstallProgram(bmtoa,$(BINDIR))
! InstallProgram(atobm,$(BINDIR))
  /*
  ComplexProgramTarget_2(bmtoa,$(XMULIB),)
  ComplexProgramTarget_3(atobm,,)

	%%% clients/xinit/Imakefile:
	%%%
	%%% Install startx with INSTSCRIPTFLAGS.

*** clients/xinit/Imakefile-dist	Sun Oct 23 13:59:11 1988
--- clients/xinit/Imakefile	Sat Dec 10 17:38:23 1988
***************
*** 12,18 ****
  /* MakeScriptFromCpp(xserverrc, -DXINITDIR=$(XINITDIR)) */
  
  
! InstallProgram(startx,$(BINDIR))
  
  #if InstallxinitConfig
  MakeDirectories(install $(XINITDIR))
--- 12,18 ----
  /* MakeScriptFromCpp(xserverrc, -DXINITDIR=$(XINITDIR)) */
  
  
! InstallProgramWithFlags(startx,$(BINDIR),$(INSTSCRIPTFLAGS))
  
  #if InstallxinitConfig
  MakeDirectories(install $(XINITDIR))