[comp.sys.hp] Messy 'imake' output with HPUX 7.0

garyb@abekrd.UUCP (Gary Bartlett) (06/07/90)

We are  using  the MIT  X11R4  distribution  with  fixes  to  fix-11  on an
HP9000/300 network running HPUX 7.0.

Since upgrading from HPUX 6.5 and  recompiling the X  distribution,  it has
been  noticed  that  the  'imake'  program  now  produces   Makefiles  with
extraneous 'cpp' control sequences, eg:

++++++++++++++++
# Makefile generated by imake - do not edit!
# $XConsortium: imake.c,v 1.51 89/12/12 12:37:30 jim Exp $
#
# The cpp used on this machine replaces all newlines and multiple tabs and
# spaces in a macro expansion with a single space.  Imake tries to compensate
# for this, but is not always successful.
#

###########################################################################
# Makefile generated from "Imake.tmpl" and <Imakefile>
# $XConsortium: Imake.tmpl,v 1.77 89/12/18 17:01:37 jim Exp $
#
# Platform-specific parameters may be set in the appropriate .cf
# configuration files.  Site-wide parameters may be set in the file
# site.def.  Full rebuilds are recommended if any parameters are changed.
#
# If your C preprocessor doesn't define any unique symbols, you'll need
# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
# "make Makefile", "make Makefiles", or "make World").
#
# If you absolutely can't get imake to work, you'll need to set the
# variables at the top of each Makefile as well as the dependencies at the
# bottom (makedepend will do this automatically).
#

# 59

# 66

# 73

# 87

# 94

# 101

# 108

+++++++++++

etc.

These line numbers  correspond to '#endif' lines in the Imake.tmpl,  hp.cf,
Project.tmpl,  etc  files.  This  must be a new  feature  of the  HPUX  7.0
/lib/cpp.  Looking  through  the  imake.c  source  shows  that the only cpp
control  sequences  removed  are  '#line  n  "...'  and '# n  "...',  which
explains why the above sequences are passed on.

Can anyone tell me the safest way to have these lines removed.  Is it OK to
change  the  '# n  "...'  case  to '#  n...'  in  imake.c  or is  this  not
recommended?  Is it too dangerous to call  /lib/cpp with the -P argument to
strip the cpp control sequences?

Advice or fixes gratefully accepted.

Thanks,
Gary Bartlett

-- 
Gary C. Bartlett               NET: garyb@abekrd.co.uk
Abekas Video Systems Ltd.     UUCP: ...!uunet!mcsun!ukc!pyrltd!abekrd!garyb
12 Portman Rd,   Reading,    PHONE: +44 734 585421
Berkshire.       RG3 1EA.      FAX: +44 734 567904
United Kingdom.              TELEX: 847579

shankar@hpclscu.HP.COM (Shankar Unni) (06/12/90)

> # 101
> # 108
> These line numbers  correspond to '#endif' lines in the Imake.tmpl,  hp.cf,
> Project.tmpl,  etc  files.  This  must be a new  feature  of the  HPUX  7.0
> /lib/cpp.  Looking  through  the  imake.c  source  shows  that the only cpp
> control  sequences  removed  are  '#line  n  "...'  and '# n  "...',  which
> explains why the above sequences are passed on.

These are not extraneous lines. What cpp does is that it no longer puts out
the filename if it has not changed since the last "# n". Makes the C
compiler's scanning a lot faster.

Yeah, you can either run cpp -P from within "imake", or add the *extra*
pattern "# n$".  (I.e. the syntax will be either '# n "filename"' or '# n')
-----
Shankar Unni                                   E-Mail: 
Hewlett-Packard California Language Lab.     Internet: shankar@hpda.hp.com