Compiling ghostscript v 9.21

I ran configure, and then make, using the SCO 6.0.0 cc compiler.

-bash-3.2# make                                                                 
UX:make: ERROR: bad character | (octal 174), line 277 (bu40)UX:make: ERROR: Mess
age not found!!                                                                 
.                                                                               

Is this error in the Makefile, as line 277 of it appears to be correct,

272  # Choose shared or compiled in libjbig2dec and source location         
273  # JBIG2_LIB=jbig2dec                                                   
274  JBIG2_LIB=jbig2dec                                                     
275  SHARE_JBIG2=0                                                          
276  JBIG2SRCDIR=./jbig2dec                                                 
277  JBIG2_CFLAGS=-DHAVE_STDINT_H=1                                         
278                                                                         
279  # uncomment the following three lines and one of the last two to       

Unless the comment lines in the Makefile are discarded.

Hmmmmm.......well jgt, with your enormous contribution to this forum you would have already tried the obvious so this is probably just 'second opinion' rather than a solution.

Octal 174 is the pipe '|' character in most ascii sets, hex 7C, dec 124.

Try using a suitable (hex) editor to find any instances of 7C in the file and whether it finds one on line 277.

Make a backup copy of the file and then delete line 277 and retype it in manually to ensure any hidden/unprintable characters are removed. Do you get the same error? If a hidden character has been removed I would at least expect a different error even if it still doesn't work.

Any make/compiler that reports wrong line numbers by omitting comment lines is about as much use as a chocolate teapot so my opinion is that the error line number would be correct (unless it's inserting some other source file and including the line count in that).

If you look at the code (you didn't post the whole file) do you reckon that the '-' after the '=' is correct? I guess that it's just creating a switch option on a command line.

Hi jgt,
Assuming the line numbers are correct, one might guess that there is a <vertical-bar> character (AKA pipe symbol) followed by a <backspace> on line 277 and those two characters are being replaced by whatever character follows them (making the <vertical-bar> invisible when you print the line to a non-hardcopy device).

Hi hicksd8,
In a makefile, the CFLAGS macro is a list of command line options to be fed to the C compiler. Presumably, JBIG2_CFLAGS is a macro in this makefile that will be assigned to CFLAGS or used in addition to it when the target being built is JBIG2. (And the C compiler command line option -DHAVE_STDINT_H=1 initializes the C macro HAVE_STDINT_H to have the value 1).

1 Like

@Don.....Thanks for the clarification. I thought that if you specify CFLAGS without a leading '-' that the system would insert one automatically on the compiler command line. Therefore, actually supplying a '-' at the start of CFLAGS would put two ('--<whatever>') on the compiler command line. Anyway, got it!

I put another hour or so into it. I changed the PATH so that gcc 2.95 was ahead of the SCO cc, and used gnu make instead of SCO and that eliminated the error with the |. However, a new problem appeared. It seems that the new version of Ghostscript requires a version of gcc newer than 2.95.