From 40087b44775662f016d74b2429cd1ebedaccf79a Mon Sep 17 00:00:00 2001 From: cehardin Date: Sun, 8 Aug 2004 01:08:55 +0000 Subject: [PATCH] GSPrinting changes git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@19839 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 32 + Headers/AppKit/NSPrinter.h | 139 +- .../GSPageLayout.gorm/objects.gorm | Bin 32961 -> 33137 bytes Printing/GNUmakefile | 10 +- Printing/GSLPR/GSLPRPrincipalClass.h | 29 +- Printing/GSLPR/GSLPRPrincipalClass.m | 30 +- Printing/GSLPR/GSLPRPrintInfo.h | 2 +- Printing/GSLPR/GSLPRPrintInfo.m | 40 - Printing/GSLPR/GSLPRPrintOperation.h | 2 +- Printing/GSLPR/GSLPRPrinter.h | 4 +- Printing/GSLPR/GSLPRPrinter.m | 1004 +++-------- Source/NSPrintInfo.m | 32 +- Source/NSPrinter.m | 1500 ++++++++++++----- config.make.in | 6 + configure | 1425 +++++++++++----- configure.ac | 55 + 16 files changed, 2640 insertions(+), 1670 deletions(-) diff --git a/ChangeLog b/ChangeLog index 40bdff7e6..b2636d093 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,35 @@ +2004-08-08 00:43 Chad Hardin + + * config.make.in: Added CUPS specific make variables. + * configure: Regenerated. + * configure.ac: Added code to detect the presence of + cups for the new GSCUPS printing backend bundle. + Detects cups but the GSCUPS bundle is not ready yet + so it does not actually try to build anything related + to cups. + * Headers/AppKit/NSPrinter.h: + * Source/NSPrinter.m: + * Printing/GSLPR/GSLPRPrinter.m: + NSPrinter no longer assumes it is PPD specific. However, + it does include a catagory named PPDParsing, which the + backend printing bundles can call to have a PPD file parsed + and placed into NSPrinter's tables. All the PPD parsing code + was taken out of GSLPRPrinter.m. Also, a lot of code format + cleanup was done. + * Printing/GSLPR/GSLPRPrintInfo.m: + * Source/AppKit/NSPrintInfo.m: Moved initWithDictionary: code + out of GSLPR's GSLPRPrintInfo implementation into here. + * Printing/GSLPR/GSLPRPrincipalClass.h: Correct copyright. + * Printing/GSLPR/GSLPRPrincipalClass.m: Correct copyright. + * Printing/GSLPR/GSLPRPrintInfo.h: Fixed reference to NSPrintInfo. + * Printing/GSLPR/GSLPRPrintOperation.h: Fixed referece to + NSPrintOperation. + * Printing/GSLPR/GSLPRPrinter.h: Fixed reference to NSPrinter. + * Panels/English.lproj/GSPageLayout.gorm/objects.gorm: Increased the + size of the panel's title and made it bold. + * Printing/GNUmakefile: Added code to optionally build the (upcoming) + GSCUPS printing backend bundle. Currently it's disabled. + 2004-08-07 13:18 Alexander Malmberg * Source/NSTextView.m (-mouseDown:): Remove -containsAttachments diff --git a/Headers/AppKit/NSPrinter.h b/Headers/AppKit/NSPrinter.h index 98f3045e4..9c8bda343 100644 --- a/Headers/AppKit/NSPrinter.h +++ b/Headers/AppKit/NSPrinter.h @@ -1,15 +1,15 @@ /* NSPrinter.h - Class representing a printer's or printer model's capabilities. + Class representing a printer's capabilities. - Copyright (C) 1996, 1997,2004 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 2004 Free Software Foundation, Inc. Authors: Simon Frankau Date: June 1997 Modified for Printing Backend Support Author: Chad Hardin - Date: June 2004 + Date: July 2004 This file is part of the GNUstep GUI Library. @@ -49,7 +49,6 @@ typedef enum _NSPrinterTableStatus { @interface NSPrinter : NSObject { NSString *_printerHost, *_printerName, *_printerNote, *_printerType; - int _cacheAcceptsBinary, _cacheOutputOrder; //The way openstep handled NSPrinter was odd, it had a concept of "real" //printers and @@ -67,68 +66,89 @@ typedef enum _NSPrinterTableStatus { //to put a lot of generic code in ths class that would have otherwise had //to have been handles by each bundle. See +printerWithType: in NSPrinter.m //BOOL _isRealPrinter; - - NSMutableDictionary *_PPD; - NSMutableDictionary *_PPDOptionTranslation; - NSMutableDictionary *_PPDArgumentTranslation; - NSMutableDictionary *_PPDOrderDependency; - NSMutableDictionary *_PPDUIConstraints; + + NSMutableDictionary *_tables; //maps the tables, which are + //NSMutableDictionaries, to their names + //(such as PPD, PPDOptionTranslation, etc) } // // Finding an NSPrinter // -+ (NSPrinter *)printerWithName:(NSString *)name; -+ (NSPrinter *)printerWithType:(NSString *)type; -+ (NSArray *)printerNames; -+ (NSArray *)printerTypes; ++ (NSPrinter*) printerWithName: (NSString*) name; + ++ (NSPrinter*) printerWithType: (NSString*) type; + ++ (NSArray*) printerNames; + ++ (NSArray*) printerTypes; // // Printer Attributes // -- (NSString *)host; -- (NSString *)name; -- (NSString *)note; -- (NSString *)type; +- (NSString*) host; + +- (NSString*) name; + +- (NSString*) note; + +- (NSString*) type; // // Retrieving Specific Information // -- (BOOL)acceptsBinary; -- (NSRect)imageRectForPaper:(NSString *)paperName; -- (NSSize)pageSizeForPaper:(NSString *)paperName; -- (BOOL)isColor; -- (BOOL)isFontAvailable:(NSString *)fontName; -- (int)languageLevel; -- (BOOL)isOutputStackInReverseOrder; +- (BOOL) acceptsBinary; + +- (NSRect) imageRectForPaper: (NSString*) paperName; + +- (NSSize) pageSizeForPaper: (NSString*) paperName; + +- (BOOL) isColor; + +- (BOOL) isFontAvailable: (NSString*) fontName; + +- (int) languageLevel; + +- (BOOL) isOutputStackInReverseOrder; + // // Querying the NSPrinter Tables // -- (BOOL)booleanForKey:(NSString *)key - inTable:(NSString *)table; -- (NSDictionary *)deviceDescription; -- (float)floatForKey:(NSString *)key - inTable:(NSString *)table; -- (int)intForKey:(NSString *)key - inTable:(NSString *)table; -- (NSRect)rectForKey:(NSString *)key - inTable:(NSString *)table; -- (NSSize)sizeForKey:(NSString *)key - inTable:(NSString *)table; -- (NSString *)stringForKey:(NSString *)key - inTable:(NSString *)table; -- (NSArray *)stringListForKey:(NSString *)key - inTable:(NSString *)table; -- (NSPrinterTableStatus)statusForTable:(NSString *)table; -- (BOOL)isKey:(NSString *)key - inTable:(NSString *)table; +- (BOOL) booleanForKey: (NSString*) key + inTable: (NSString*) table; + +- (NSDictionary*) deviceDescription; + +- (float) floatForKey: (NSString*) key + inTable: (NSString*) table; + +- (int) intForKey: (NSString*) key + inTable: (NSString*) table; + +- (NSRect) rectForKey: (NSString*) key + inTable: (NSString*) table; + +- (NSSize) sizeForKey: (NSString*) key + inTable: (NSString*) table; + +- (NSString*) stringForKey: (NSString*) key + inTable: (NSString*) table; + +- (NSArray*) stringListForKey: (NSString*) key + inTable: (NSString*) table; + +- (NSPrinterTableStatus) statusForTable: (NSString*) table; + +- (BOOL) isKey: (NSString*) key + inTable: (NSString*) table; // // NSCoding protocol // -- (void)encodeWithCoder: (NSCoder *)aCoder; -- initWithCoder: (NSCoder *)aDecoder; +- (void) encodeWithCoder: (NSCoder*) aCoder; + +- initWithCoder: (NSCoder*) aDecoder; @end @@ -141,20 +161,23 @@ typedef enum _NSPrinterTableStatus { // // Initialisation method used by backend bundles // --(id) initWithName:(NSString *)name - withType:(NSString *)type - withHost:(NSString *)host - withNote:(NSString *)note; +-(id) initWithName: (NSString*) name + withType: (NSString*) type + withHost: (NSString*) host + withNote: (NSString*) note; --(id) addValue:(NSString *)value - andValueTranslation:(NSString *)valueTranslation -andOptionTranslation:(NSString *)optionTranslation - forKey:(NSString *)key; - - --(id) addString: (NSString*) string - forKey: (NSString*) key - inTable: (NSMutableDictionary*) table; @end + + +// +// Have the NSPrinter parse a PPD and put it into its +// tables. Used by the printing backend bundles. +// +@interface NSPrinter (PPDParsing) + +-(BOOL) parsePPDAtPath: (NSString*) ppdPath; + +@end + #endif // _GNUstep_H_NSPrinter diff --git a/Panels/English.lproj/GSPageLayout.gorm/objects.gorm b/Panels/English.lproj/GSPageLayout.gorm/objects.gorm index ce1560fcd022c946f119435239cef6f9ce190541..f7fefddc5e34441212048fb904cd2af99e78c3f8 100644 GIT binary patch literal 33137 zcmcg#37j28(Vy>+)a4O8(9FVB6yD#K`WYe%Y5W%oXUXq2q+})7G<74pv z55#9s#0#US+%OLi@xmym;Q3S(Q9r~B6-4p#K9H~eT|M)rXXYJwkR-oM>h<(gS65Y6 zRd?6)tY}|9IF##e>Kxdz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%93l=6M%<;-`iV0FC<%k@g(Q)l?xuKZCcbt<(f^#d3>C@C@o${%fbovr*a zWqG9>7o_9=qeGIEKUVX~`^q23teh{2_Xkx4o?8HPXbTjKgHDe zY2{C4{`%*)H2;H#;&1vX$wbcJOQ96b9EW>-P@@F&e`4R8=)$l%t{6qdtn-uPI4EGC^e-Lwzt!AW220n1H z1pHvb<1XbN!aN*h;(P^Sev%gQZk!qAA8OveS^0BWZ8-`6DhsP8X*IF@GUd-Rd~Q+x ze6EKhGh2v*^K)R;@N6(VZ&m(b%yV{x{_Hwh*+EDMhdotM!&ew?cPRgG=H~1s_R;vD z6~t=lb%f!xM)^lFW{v`e`nKE3Cn}Y;iyYjJGQ93q{?W|KS;vRs?3jPN@=rANxJ~&daVs2b({)_mjX&HFlqWgBK z@|WZ8*6{8W+}#o0y%KkK>e5f;(w$HAN@hRRl}VO-TH)lpui2f>g6OQAh68?^7Dy7p zChBDIjIPY-%5TQq)8SnU1fV&*%i`|L@NNYhx>j=N{4mGa)qtRtURA!?C3Xa1i1(6BKNEb`Yd&UE*b&$glu_A99&5ov=~kYl z{B^j)EJgWdd)G0HC5{z+vSdl?ffgoS%2(V|&Jx8&5`Fta1*qv><)5uF&QDgp*@tze z@X#^Q52h=>jbvf6E@4A8vT$xDg9ALnlW}tW*yPDH;s-ioX$$ak=53sTw}Fas&i?@f Cy^UZ1 diff --git a/Printing/GNUmakefile b/Printing/GNUmakefile index 9a3ef422b..2b33e0105 100644 --- a/Printing/GNUmakefile +++ b/Printing/GNUmakefile @@ -28,12 +28,20 @@ include $(GNUSTEP_MAKEFILES)/common.make +GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../gui.make + +include ../config.make +include ../Version + # # The list of subproject directories # SUBPROJECTS = \ -GSLPR +GSLPR +ifeq ($(BUILD_GSCUPS), YES) +#SUBPROJECTS += GSCUPS +endif include $(GNUSTEP_MAKEFILES)/aggregate.make diff --git a/Printing/GSLPR/GSLPRPrincipalClass.h b/Printing/GSLPR/GSLPRPrincipalClass.h index cc6618117..041ffd3f6 100644 --- a/Printing/GSLPR/GSLPRPrincipalClass.h +++ b/Printing/GSLPR/GSLPRPrincipalClass.h @@ -1,26 +1,29 @@ -/* - Project: GSLPR +/** GSLPRPrincipalClass - Copyright (C) 2004 Free Software Foundation + Principal class for the GSLPR Bundle. + + Copyright (C) 2004 Free Software Foundation, Inc. Author: Chad Hardin + Date: June 2004 + + This file is part of the GNUstep GUI Library. - Created: 2004-06-12 19:40:40 +0000 by Chad Hardin - - This application is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - - This application is distributed in the hope that it will be useful, + + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. - You should have received a copy of the GNU General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. -*/ + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ #ifndef _GSLPRPRINCIPALCLASS_H_ #define _GSLPRPRINCIPALCLASS_H_ diff --git a/Printing/GSLPR/GSLPRPrincipalClass.m b/Printing/GSLPR/GSLPRPrincipalClass.m index 2a1fb71f0..5d5a780ff 100644 --- a/Printing/GSLPR/GSLPRPrincipalClass.m +++ b/Printing/GSLPR/GSLPRPrincipalClass.m @@ -1,26 +1,30 @@ -/* - Project: GSLPR +/* + GSLPRPrincipalClass.m - Copyright (C) 2004 Free Software Foundation + Principal class for the GSLPR Bundle + + Copyright (C) 2004 Free Software Foundation, Inc. Author: Chad Hardin + Date: June 2004 + + This file is part of the GNUstep GUI Library. - Created: 2004-06-12 19:40:40 +0000 by Chad Hardin - - This application is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - - This application is distributed in the hope that it will be useful, + + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. - You should have received a copy of the GNU General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. -*/ + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ #include #include "GSLPRPrincipalClass.h" diff --git a/Printing/GSLPR/GSLPRPrintInfo.h b/Printing/GSLPR/GSLPRPrintInfo.h index f6e80ad17..1be088474 100644 --- a/Printing/GSLPR/GSLPRPrintInfo.h +++ b/Printing/GSLPR/GSLPRPrintInfo.h @@ -1,4 +1,4 @@ -/** NSPrintInfo +/** GSLPRPrintInfo Stores information used in printing. diff --git a/Printing/GSLPR/GSLPRPrintInfo.m b/Printing/GSLPR/GSLPRPrintInfo.m index 58132421e..0132f28de 100644 --- a/Printing/GSLPR/GSLPRPrintInfo.m +++ b/Printing/GSLPR/GSLPRPrintInfo.m @@ -119,46 +119,6 @@ } - - - --(id) initWithDictionary:(NSDictionary *)aDict -{ - NSPrinter *printer; - NSString *pageSize; - NSSize size; - NSMutableDictionary *dict; - - NSDebugMLLog(@"GPrinting", @""); - self = [super initWithDictionary: nil]; - - printer = [GSLPRPrintInfo defaultPrinter]; - [self setPrinter: printer]; - - - /* Set up other defaults from the printer object */ - pageSize = [printer stringForKey: @"DefaultPageSize" - inTable: @"PPD"]; - - /* FIXME: Need to check for AutoSelect and probably a million other things... */ - if (pageSize == nil) - pageSize = @"A4"; - - [self setPaperName: pageSize]; - - /* Set default margins. FIXME: Probably should check ImageableArea */ - [self setRightMargin: 36]; - - [self setLeftMargin: 36]; - - [self setTopMargin: 72]; - - [self setBottomMargin: 72]; - - return self; -} - - @end diff --git a/Printing/GSLPR/GSLPRPrintOperation.h b/Printing/GSLPR/GSLPRPrintOperation.h index 12449f239..ba97769bd 100644 --- a/Printing/GSLPR/GSLPRPrintOperation.h +++ b/Printing/GSLPR/GSLPRPrintOperation.h @@ -1,4 +1,4 @@ -/** NSPrintOperation +/** GSLPRPrintOperation Controls generation of EPS, PDF or PS print jobs. diff --git a/Printing/GSLPR/GSLPRPrinter.h b/Printing/GSLPR/GSLPRPrinter.h index 9f07725ad..7bfac72c4 100644 --- a/Printing/GSLPR/GSLPRPrinter.h +++ b/Printing/GSLPR/GSLPRPrinter.h @@ -1,5 +1,5 @@ /* - NSPrinter.h + GSLPRPrinter.h Class representing a printer's or printer model's capabilities. @@ -40,8 +40,6 @@ { } - - @end #endif // _GNUstep_H_GSLPRPrinter diff --git a/Printing/GSLPR/GSLPRPrinter.m b/Printing/GSLPR/GSLPRPrinter.m index 2515ff732..92aec14c4 100644 --- a/Printing/GSLPR/GSLPRPrinter.m +++ b/Printing/GSLPR/GSLPRPrinter.m @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -60,181 +61,17 @@ #include "GSLPRPrinter.h" #include "GNUstepGUI/GSPrinting.h" -// The maximum level of nesting of *Include directives -#define MAX_PPD_INCLUDES 4 - -// A macro to skip whitespace over lines -#define skipSpace(x) [x scanCharactersFromSet:\ - [NSCharacterSet whitespaceAndNewlineCharacterSet]\ - intoString:NULL] - -static NSString *NSPrinter_PATH = @"PostScript/PPD"; -static NSString *NSPrinter_INDEXFILE = @"Printers"; - -// -// Class variables: -// -static NSDictionary *printerIndexDict = nil; //The list of printers from NSPrinter_INDEXFILE -static NSMutableDictionary *printerObjNameDict = nil; //Printer objects mapped to names +@interface GSLPRPrinter (Private) -// An array to cache the available printer types -static NSArray *printerTypesAvailable = nil; - -// -// Class variables used during scanning: -// - -// Character sets used in scanning. -static NSCharacterSet *newlineSet = nil; -static NSCharacterSet *keyEndSet = nil; -static NSCharacterSet *optKeyEndSet = nil; -static NSCharacterSet *valueEndSet = nil; -// Array of Repeated Keywords (Appendix B of the PostScript Printer -// Description File Format Specification). -static NSArray *repKeys = nil; -// Array to collect the values of symbol values in. -static NSMutableDictionary *PPDSymbolValues; -// File name of the file being processed -static NSString *PPDFileName; - -#ifndef LIB_FOUNDATION_LIBRARY - -static void __NSRetainNothing(void *table, const void *anObject) -{ -} - -static void __NSReleaseNothing(void *table, void *anObject) -{ -} - -static NSString* __NSDescribeObjects(void *table, const void *anObject) -{ - return [(NSObject*)anObject description]; -} - -static const NSMapTableValueCallBacks NSNonRetainedObjectMapValueCallBacks = { - (void (*)(NSMapTable *, const void *))__NSRetainNothing, - (void (*)(NSMapTable *, void *))__NSReleaseNothing, - (NSString *(*)(NSMapTable *, const void *))__NSDescribeObjects -}; - -#endif /* LIB_FOUNDATION_LIBRARY */ - - -// Convert a character to a value between 0 and 15 -static int gethex(unichar character) -{ - switch (character) - { - case '0': return 0; - case '1': return 1; - case '2': return 2; - case '3': return 3; - case '4': return 4; - case '5': return 5; - case '6': return 6; - case '7': return 7; - case '8': return 8; - case '9': return 9; - case 'A': return 10; - case 'B': return 11; - case 'C': return 12; - case 'D': return 13; - case 'E': return 14; - case 'F': return 15; - case 'a': return 10; - case 'b': return 11; - case 'c': return 12; - case 'd': return 13; - case 'e': return 14; - case 'f': return 15; - } - [NSException - raise:NSPPDParseException - format:@"Badly formatted hexadeximal substring in PPD printer file."]; - // NOT REACHED - return 0; /* Quiet compiler warnings */ -} - -// Function to convert hexadecimal substrings -static NSString *interpretQuotedValue(NSString *qString) -{ - NSScanner *scanner; - NSCharacterSet *emptySet; - NSString *value = nil; - NSString *part; - int stringLength; - int location; - NSRange range; - - // Don't bother unless there's something to convert - range = [qString rangeOfString:@"<"]; - if(!range.length) - return qString; - - scanner = [NSScanner scannerWithString:qString]; - emptySet = [NSCharacterSet characterSetWithCharactersInString:@""]; - [scanner setCharactersToBeSkipped:emptySet]; - if(![scanner scanUpToString:@"<" intoString:&value]) - value = [NSString string]; - stringLength = [qString length]; - - while (![scanner isAtEnd]) { - [scanner scanString:@"<" intoString:NULL]; - skipSpace(scanner); - while (![scanner scanString:@">" intoString:NULL]) - { - location = [scanner scanLocation]; - if (location+2 > stringLength) - { - [NSException - raise:NSPPDParseException - format:@"Badly formatted hexadecimal substring in PPD printer file."]; - // NOT REACHED - } - value = [value stringByAppendingFormat:@"%c", - 16 * gethex([qString characterAtIndex:location]) - + gethex([qString characterAtIndex:location+1])]; - [scanner setScanLocation:location+2]; - skipSpace(scanner); - } - if([scanner scanUpToString:@"<" intoString:&part]) - { - value = [value stringByAppendingString:part]; - } - } - return value; -} - -static NSString *getFile(NSString *name, NSString *type) -{ - return [NSBundle pathForLibraryResource: name - ofType: type - inDirectory: NSPrinter_PATH]; -} - - -@interface GSLPRPrinter (private) -+ loadPrinterIndexFile; --(id)initWithPPD:(NSString *)PPDstring - withName:(NSString *)name - withType:(NSString *)type - withHost:(NSString *)host - withNote:(NSString *)note - fromFile:(NSString *)file; - -- loadPPD:(NSString *)PPDstring - inclusionNum:(int)includeNum; - -- addPPDKeyword:(NSString *)mainKeyword - withScanner:(NSScanner *)PPDdata; - -- addPPDUIConstraint:(NSScanner *)constraint; - -- addPPDOrderDependency:(NSScanner *)dependency; ++(NSDictionary*) printersDictionary; +-(id) initWithName: (NSString*) name + withType: (NSString*) type + withHost: (NSString*) host + withNote: (NSString*) note + withPPDPath: (NSString*) ppdPath; @end @@ -243,7 +80,7 @@ static NSString *getFile(NSString *name, NSString *type) // // Class methods // -+ (void)initialize ++(void) initialize { NSDebugMLLog(@"GSPrinting", @""); if (self == [GSLPRPrinter class]) @@ -253,7 +90,8 @@ static NSString *getFile(NSString *name, NSString *type) } } -+ (id) allocWithZone: (NSZone*)zone + ++(id) allocWithZone: (NSZone*) zone { NSDebugMLLog(@"GSPrinting", @""); return NSAllocateObject(self, 0, zone); @@ -262,61 +100,36 @@ static NSString *getFile(NSString *name, NSString *type) // // Finding an NSPrinter // -+ (NSPrinter *)printerWithName:(NSString *)name ++ (NSPrinter*) printerWithName: (NSString*) name { - NSString *path; - NSArray *printerInfo; - NSPrinter *printer; - /* Contents of printerInfo array: - * [0]: NSString of the printer's type - * [1]: NSString of the printer's host - * [2]: NSString of the printer's note - */ - - NSDebugMLLog(@"GSPrinting", @""); - // Make sure the printer names dictionary etc. exists - if (!printerIndexDict) - [self loadPrinterIndexFile]; - - if( name == nil ) - return nil; - - printer = [printerObjNameDict objectForKey: name]; - // If the NSPrinter object for the printer already exists, return it - if (printer) - return printer; - - // Otherwise, try to find the information in the printerIndexDict - printerInfo = [printerIndexDict objectForKey: name]; - // Make sure you can find the printer name in the dictionary - if (!printerInfo) + NSDictionary* printersDict; + NSDictionary* printerEntry; + NSString* ppdContents; + NSPrinter* printer; + + printersDict = [self printersDictionary]; + + printerEntry = [printersDict objectForKey: name]; + + if( printerEntry == nil) { [NSException raise: NSGenericException - format: @"Could not find printer named %@", name]; - // NOT REACHED + format: @"(GSLPR) Could not find printer named %@", name]; + return nil; } - // Create it - path = getFile([printerInfo objectAtIndex:0], @"ppd"); - // If not found - if (path == nil || [path length] == 0) - { - [NSException raise: NSGenericException - format: @"Could not find PPD file %@.ppd", - [printerInfo objectAtIndex:0]]; - // NOT REACHED - } - + + ppdContents = [NSString stringWithContentsOfFile: + [printerEntry objectForKey: @"PPDPath"]]; + + NSDebugMLLog(@"GSPrinting", @"Creating NSPrinter with Printer Entry: %@", + [printerEntry description]); + printer = [(GSLPRPrinter*)[self alloc] - initWithPPD: [NSString stringWithContentsOfFile:path] - withName: name - withType: [printerInfo objectAtIndex:0] - withHost: [printerInfo objectAtIndex:1] - withNote: [printerInfo objectAtIndex:2] - fromFile: [printerInfo objectAtIndex:0]]; - - // Once created, set it in the dict for later use, this also retains it - [printerObjNameDict setObject: printer - forKey: name]; + initWithName: name + withType: [printerEntry objectForKey: @"Type"] + withHost: [printerEntry objectForKey: @"Host"] + withNote: [printerEntry objectForKey: @"Note"] + withPPDPath: [printerEntry objectForKey: @"PPDPath"]]; return [printer autorelease]; } @@ -325,573 +138,266 @@ static NSString *getFile(NSString *name, NSString *type) + (NSArray *)printerNames { NSDebugMLLog(@"GSPrinting", @""); - if(!printerIndexDict) - [self loadPrinterIndexFile]; - - return [printerIndexDict allKeys]; + + return [[self printersDictionary] allKeys]; } - -// -// Instance methods -// - - -// -// Private Methods -// - -// -// Allocate the printer name to PPD filename index dictionary -// -+ loadPrinterIndexFile +-(BOOL) acceptsBinary { - NSString *path; - - NSDebugMLLog(@"GSPrinting", @""); - printerObjNameDict = [NSMutableDictionary dictionary]; + // FIXME: I'm not sure if acceptsBinary is the same as BCP protocol? + NSString *result; + NSScanner *protocols; - // Load the index file - path = [NSBundle pathForLibraryResource: NSPrinter_INDEXFILE - ofType: nil - inDirectory: @"PostScript"]; - - // If not found - if (path == nil || [path length] == 0) + result = [self stringForKey: @"Protocols" + inTable: @"PPD"]; + if (!result) + return NO; + + protocols = [NSScanner scannerWithString: result]; + + while( ![protocols isAtEnd] ) { - NSLog(@"Could not find index of printers, file %@", NSPrinter_INDEXFILE); - printerIndexDict = [NSDictionary dictionaryWithObject: - [NSArray arrayWithObjects: @"Apple_LaserWriter_II_NTX", - @"localhost", @"A Note", nil] - forKey: @"Unknown"]; + [protocols scanUpToCharactersFromSet: [NSCharacterSet whitespaceCharacterSet] + intoString: &result]; + + if ( [result isEqual:@"BCP"] ) + return YES; } + + return NO; +} + + +-(NSRect) imageRectForPaper: (NSString*) paperName +{ + NSString *key; + + key = [NSString stringWithFormat: @"ImageableArea/%@", paperName]; + + return [self rectForKey: key + inTable: @"PPD"]; +} + + +-(NSSize) pageSizeForPaper: (NSString*) paperName +{ + NSString *key; + + key = [NSString stringWithFormat: @"PaperDimension/%@", paperName]; + + return [self sizeForKey: key + inTable: @"PPD"]; +} + + +-(BOOL) isColor +{ + return [self booleanForKey: @"ColorDevice" + inTable: @"PPD"]; +} + + +-(BOOL) isFontAvailable: (NSString*) fontName +{ + NSString *key; + + key = [NSString stringWithFormat: @"Font/%@", fontName]; + return [self isKey: key + inTable: @"PPD"]; +} + + +-(int) languageLevel +{ + return [self intForKey: @"LanguageLevel" + inTable: @"PPD"]; +} + + +-(BOOL) isOutputStackInReverseOrder +{ + // FIXME: Is this what is needed? I'm not sure how this is worked out. + NSString *result; + + result = [self stringForKey: @"DefaultOutputOrder" + inTable: @"PPD"]; + + if (!result) + return NO; + + if ( [result caseInsensitiveCompare: @"REVERSE"] == NSOrderedSame) + return YES; else - { - printerIndexDict = [NSDictionary dictionaryWithContentsOfFile:path]; - } - RETAIN(printerObjNameDict); - RETAIN(printerIndexDict); - - return self; + return NO; } -// -// Initialisation method -// -// To keep loading of PPDs relatively fast, not much checking is done on it. --(id)initWithPPD:(NSString *)PPDstring - withName:(NSString *)name - withType:(NSString *)type - withHost:(NSString *)host - withNote:(NSString *)note - fromFile:(NSString *)file + +-(NSDictionary*) deviceDescription { - NSAutoreleasePool *subpool; - NSEnumerator *objEnum; - NSMutableArray *valArray; - - self = [super initWithName: name - withType: type - withHost: host - withNote: note]; - - NSDebugMLLog(@"GSPrinting", @""); + NSMutableDictionary *result; - // Create a temporary autorelease pool, as many temporary objects are used - subpool = [[NSAutoreleasePool alloc] init]; - // Create character sets used during scanning - newlineSet = [NSCharacterSet characterSetWithCharactersInString:@"\n\r"]; - keyEndSet = [NSCharacterSet characterSetWithCharactersInString:@"\n\r\t: "]; - optKeyEndSet = [NSCharacterSet characterSetWithCharactersInString:@"\n\r:/"]; - valueEndSet = [NSCharacterSet characterSetWithCharactersInString:@"\n\r/"]; - // Allowed repeated keys, used during scanning. - repKeys = [NSArray arrayWithObjects:@"Emulators", - @"Extensions", - @"FaxSupport", - //@"Include", (handled separately) - @"Message", - @"PrinterError", - @"Product", - @"Protocols", - @"PSVersion", - @"Source", - @"Status", - //@"UIConstraints", (handled separately) - // Even though this is not mentioned in the list of repeated keywords, - // it's often repeated anyway, so I'm putting it here. - @"InkName", - nil]; - // Set the file name to use - PPDFileName = file; - // NB: There are some structure keywords (such as OpenUI/CloseUI) that may - // be repeated, but as yet are not used. Since they are structure keywords, - // they'll probably need special processing anyway, and so aren't - // added to this list. - // Create dictionary for temporary storage of symbol values - PPDSymbolValues = [NSMutableDictionary dictionary]; - // And scan the PPD itself - [self loadPPD:PPDstring inclusionNum:0]; - // Search the PPD dictionary for symbolvalues, and substitute them. - objEnum = [_PPD objectEnumerator]; - while ((valArray = [objEnum nextObject])) + + result = [NSMutableDictionary dictionary]; + + if( [self isKey: @"DefaultResolution" + inTable:@"PPD"]) { - NSString *oldValue; - NSString *newValue; - int i, max; - max = [valArray count]; - for(i=0 ; i < max ; i++ ) - { - oldValue = [valArray objectAtIndex:i]; - if ([oldValue isKindOfClass:[NSString class]] - && ![oldValue isEqual:@""] - && [[oldValue substringToIndex:1] isEqual:@"^"]) - { - newValue = [PPDSymbolValues - objectForKey:[oldValue substringFromIndex:1]]; - if (!newValue) - { - [NSException raise: NSPPDParseException - format:@"Unknown symbol value, ^%@ in PPD file %@.ppd", - oldValue, PPDFileName]; - // NOT REACHED - } - [valArray replaceObjectAtIndex:i withObject:newValue]; - } - } + int dpi = [self intForKey: @"DefaultResolution" + inTable: @"PPD"]; + + [result setObject: [NSNumber numberWithInt: dpi] + forKey: NSDeviceResolution]; } -#if 0 - // DISABLED: Though the following keywords *should* be present, there seems - // to be few problems is they are omitted. Many of the .ppd files I have - // don't have *LanguageEncoding, for example. - - // Make sure all the required keys are present - objEnum = [[NSArray arrayWithObjects:@"NickName", - @"ModelName", - @"PCFileName", - @"Product", - @"PSVersion", - @"FileVersion", - @"FormatVersion", - @"LanguageEncoding", - @"LanguageVersion", - @"PageSize", - @"PageRegion", - @"ImageableArea", - @"PaperDimension", - @"PPD-Adobe", - nil] objectEnumerator]; - - while (checkVal = [objEnum nextObject]) + if( [self isKey: @"ColorDevice" + inTable: @"PPD"]) { - if (![self isKey:checkVal inTable:@"PPD"]) - { - [NSException raise:NSPPDParseException - format:@"Required keyword *%@ not found in PPD file %@.ppd", - checkVal, PPDFileName]; - // NOT REACHED - } - } -#endif + BOOL color = [self booleanForKey: @"ColorDevice" + inTable: @"PPD"]; - // Release the local autoreleasePool - RELEASE(subpool); - return self; -} - -- loadPPD:(NSString *)PPDstring - inclusionNum:(int)includeNum -{ - NSScanner *PPDdata; - NSString *keyword; - - // Set up the scanner - Appending a newline means that it should be - // able to process the last line correctly - PPDdata = [NSScanner scannerWithString: - [PPDstring stringByAppendingString:@"\n"]]; - - [PPDdata setCharactersToBeSkipped:[NSCharacterSet whitespaceCharacterSet]]; - - // Main processing starts here... - while (1) // Check it is not at end only after skipping the blanks - { - // Get to the start of a new keyword, skipping blank lines - skipSpace(PPDdata); - - if ([PPDdata isAtEnd]) - break; - - // All new entries should starts '*' - if (![PPDdata scanString:@"*" intoString:NULL]) - { - [NSException raise:NSPPDParseException - format:@"Line not starting * in PPD file %@.ppd", - PPDFileName]; - // NOT REACHED - } - // Skip lines starting '*%', '*End', '*SymbolLength', or '*SymbolEnd' - if ([PPDdata scanString:@"%" intoString:NULL] - || [PPDdata scanString:@"End" intoString:NULL] - || [PPDdata scanString:@"SymbolLength" intoString:NULL] - || [PPDdata scanString:@"SymbolEnd" intoString:NULL]) - { - [PPDdata scanUpToCharactersFromSet:newlineSet intoString:NULL]; - continue; - } - - // Read main keyword, up to a colon, space or newline - [PPDdata scanUpToCharactersFromSet:keyEndSet intoString:&keyword]; - - // Loop if there is no value section - if ([PPDdata scanCharactersFromSet:newlineSet intoString:NULL]) - continue; - - // Add the line to the relevant table - if ([keyword isEqual:@"OrderDependency"]) + // FIXME: Should NSDeviceWhiteColorSpace be NSDeviceBlackColorSpace? + // FIXME #2: Are they calibrated? + // Basically I'm not sure which color spaces should be used... + if( color == YES ) { - [self addPPDOrderDependency:PPDdata]; + [result setObject: NSDeviceCMYKColorSpace + forKey: NSDeviceColorSpaceName]; } - else if ([keyword isEqual:@"UIConstraints"]) + else { - [self addPPDUIConstraint:PPDdata]; - } - else if ([keyword isEqual:@"Include"]) - { - NSString *fileName; - NSString *path; - [PPDdata scanString:@":" - intoString:NULL]; - - // Find the filename between two "s" - [PPDdata scanString:@"\"" - intoString:NULL]; - - [PPDdata scanUpToString:@"\"" - intoString:&fileName]; - - [PPDdata scanString:@"\"" - intoString:NULL]; - - // Load the file - path = getFile(fileName, nil); - // If not found - if (path == nil || [path length] == 0) - { - [NSException raise:NSPPDIncludeNotFoundException - format:@"Could not find included PPD file %@", - fileName]; - // NOT REACHED - } - includeNum++; - - if (includeNum > MAX_PPD_INCLUDES) - { - [NSException raise:NSPPDIncludeStackOverflowException - format:@"Too many *Includes in PPD"]; - // NOT REACHED - } - - [self loadPPD:[NSString stringWithContentsOfFile:path] - inclusionNum:includeNum]; - } - else if ([keyword isEqual:@"SymbolValue"]) - { - NSString *symbolName; - NSString *symbolVal; - if (![PPDdata scanString:@"^" intoString:NULL]) - { - [NSException raise:NSPPDParseException - format:@"Badly formatted *SymbolValue in PPD file %@.ppd", - PPDFileName]; - // NOT REACHED - } - [PPDdata scanUpToString:@":" - intoString:&symbolName]; - - [PPDdata scanString:@":" - intoString:NULL]; - - [PPDdata scanString:@"\"" - intoString:NULL]; - - [PPDdata scanUpToString:@"\"" - intoString:&symbolVal]; - - if (!symbolVal) - symbolVal = @""; - - [PPDdata scanString:@"\"" - intoString:NULL]; - - [PPDSymbolValues setObject:symbolVal - forKey:symbolName]; - - } - else - { - [self addPPDKeyword:keyword - withScanner:PPDdata]; - } - } - return self; -} - -- addPPDKeyword:(NSString *)mainKeyword - withScanner:(NSScanner *)PPDdata -{ - NSString *optionKeyword = nil; - NSString *optionTranslation = nil; - NSString *value = nil; - NSString *valueTranslation = nil; - // Scan off any optionKeyword - [PPDdata scanUpToCharactersFromSet:optKeyEndSet intoString:&optionKeyword]; - if ([PPDdata scanCharactersFromSet:newlineSet intoString:NULL]) - { - [NSException raise:NSPPDParseException - format:@"Keyword has optional keyword but no value in PPD file %@.ppd", - PPDFileName]; - // NOT REACHED - } - if ([PPDdata scanString:@"/" intoString:NULL]) - { - // Option keyword translation exists - scan it - [PPDdata scanUpToString:@":" intoString:&optionTranslation]; - } - [PPDdata scanString:@":" intoString:NULL]; - // Read the value part - // Values starting with a " are read until the second ", ignoring \n etc. - - if ([PPDdata scanString:@"\"" intoString:NULL]) - { - [PPDdata scanUpToString:@"\"" - intoString:&value]; - - if (!value) - value = @""; - - [PPDdata scanString:@"\"" - intoString:NULL]; - - // It is a QuotedValue if it's in quotes, and there is no option - // key, or the main key is a *JCL keyword - if (!optionKeyword || [[mainKeyword substringToIndex:3] - isEqualToString:@"JCL"]) - { - value = interpretQuotedValue(value); + [result setObject: NSDeviceWhiteColorSpace + forKey: NSDeviceColorSpaceName]; } } - else + + if( [self isKey: @"DefaultBitsPerPixel" + inTable: @"PPD"] ) { - // Otherwise, scan up to the end of line or '/' - [PPDdata scanUpToCharactersFromSet:valueEndSet - intoString:&value]; + int bits = [self intForKey: @"DefaultBitsPerPixel" + inTable: @"PPD"]; + + [result setObject: [NSNumber numberWithInt: bits] + forKey: NSDeviceBitsPerSample]; } - // If there is a value translation, scan it - if ([PPDdata scanString:@"/" intoString:NULL]) + + if( [self isKey: @"DefaultPageSize" + inTable: @"PPD"] ) { - [PPDdata scanUpToCharactersFromSet:newlineSet - intoString:&valueTranslation]; - } - // The translations also have to have any hex substrings interpreted - if (optionTranslation) - optionTranslation = interpretQuotedValue(optionTranslation); - - if (valueTranslation) - valueTranslation = interpretQuotedValue(valueTranslation); - - // The keyword (or keyword/option pair, if there's a option), should only - // only have one value, unless it's one of the optionless keywords which - // allow multiple instances. - // If a keyword is read twice, 'first instance is correct', according to - // the standard. - // Finally, add the strings to the tables - if (optionKeyword) - { - NSString *mainAndOptionKeyword=[mainKeyword - stringByAppendingFormat:@"/%@", - optionKeyword]; - - if ([self isKey:mainAndOptionKeyword inTable:@"PPD"]) - return self; - - [self addValue:value - andValueTranslation:valueTranslation - andOptionTranslation:optionTranslation - forKey:mainAndOptionKeyword]; - - // Deal with the oddities of stringForKey:inTable: - // If this method is used to find a keyword with options, using - // just the keyword it should return an empty string - // stringListForKey:inTable:, however, should return the list of - // option keywords. - // This is done by making the first item in the array an empty - // string, which will be skipped by stringListForKey:, if necessary - if (![_PPD objectForKey:mainKeyword]) - { - [self addString:@"" - forKey:mainKeyword - inTable:_PPD]; - - [self addString:@"" - forKey:mainKeyword - inTable:_PPDOptionTranslation]; - - [self addString:@"" - forKey:mainKeyword - inTable:_PPDArgumentTranslation]; - - } - - [self addValue:optionKeyword - andValueTranslation:optionKeyword - andOptionTranslation:optionKeyword - forKey:mainKeyword]; - } - else - { - if ([self isKey:mainKeyword inTable:@"PPD"] && - ![repKeys containsObject:mainKeyword]) + NSString* defaultPageSize = [self stringForKey: @"DefaultPageSize" + inTable: @"PPD"]; + + if( defaultPageSize ) { - return self; + NSSize paperSize = [self pageSizeForPaper: defaultPageSize]; + + [result setObject: [NSValue valueWithSize:paperSize] + forKey: NSDeviceSize]; } - - [self addValue:value - andValueTranslation:valueTranslation - andOptionTranslation:optionTranslation - forKey:mainKeyword]; } - return self; -} -- addPPDUIConstraint:(NSScanner *)constraint -{ - NSString *mainKey1 = nil; - NSString *optionKey1 = nil; - NSString *mainKey2 = nil; - NSString *optionKey2 = nil; - // UIConstraint should have no option keyword - if (![constraint scanString:@":" intoString:NULL]) - { - [NSException raise:NSPPDParseException - format:@"UIConstraints has option keyword in PPDFileName %@.ppd", - PPDFileName]; - // NOT REACHED - } - - // Skip the '*' - [constraint scanString:@"*" - intoString:NULL]; - - // Scan the bits. Stuff not starting with * must be an optionKeyword - [constraint scanUpToCharactersFromSet:[NSCharacterSet whitespaceCharacterSet] - intoString:&mainKey1]; - if (![constraint scanString:@"*" intoString:NULL]) - { - [constraint scanUpToCharactersFromSet: - [NSCharacterSet whitespaceCharacterSet] - intoString:&optionKey1]; - - [constraint scanString:@"*" - intoString:NULL]; - - } - - [constraint scanUpToCharactersFromSet: - [NSCharacterSet whitespaceAndNewlineCharacterSet] - intoString:&mainKey2]; - - if (![constraint scanCharactersFromSet:newlineSet intoString:NULL]) - { - [constraint scanUpToCharactersFromSet: - [NSCharacterSet whitespaceAndNewlineCharacterSet] - intoString:&optionKey2]; - } - else - { - optionKey2 = @""; - } - // Add to table - if (optionKey1) - mainKey1 = [mainKey1 stringByAppendingFormat:@"/%@", optionKey1]; - - [self addString:mainKey2 - forKey:mainKey1 - inTable:_PPDUIConstraints]; - - [self addString:optionKey2 - forKey:mainKey1 - inTable:_PPDUIConstraints]; - - return self; -} + [result setObject: [NSNumber numberWithBool:NO] + forKey: NSDeviceIsScreen]; -- addPPDOrderDependency:(NSScanner *)dependency -{ - NSString *realValue = nil; - NSString *section = nil; - NSString *keyword = nil; - NSString *optionKeyword = nil; - // Order dependency should have no option keyword - if (![dependency scanString:@":" intoString:NULL]) - { - [NSException raise:NSPPDParseException - format:@"OrderDependency has option keyword in PPD file %@.ppd", - PPDFileName]; - // NOT REACHED - } - [dependency scanUpToCharactersFromSet:[NSCharacterSet whitespaceCharacterSet] - intoString:&realValue]; - - [dependency scanUpToCharactersFromSet:[NSCharacterSet whitespaceCharacterSet] - intoString:§ion]; - - [dependency scanString:@"*" - intoString:NULL]; - - [dependency scanUpToCharactersFromSet: - [NSCharacterSet whitespaceAndNewlineCharacterSet] - intoString:&keyword]; - - if (![dependency scanCharactersFromSet:newlineSet intoString:NULL]) - { - // Optional keyword exists - [dependency scanUpToCharactersFromSet: - [NSCharacterSet whitespaceAndNewlineCharacterSet] - intoString:&optionKeyword]; - } - // Go to next line of PPD file - [dependency scanCharactersFromSet:newlineSet - intoString:NULL]; - - // Add to table - if (optionKeyword) - keyword = [keyword stringByAppendingFormat:@"/%s", optionKeyword]; - - [self addString:realValue - forKey:keyword - inTable:_PPDOrderDependency]; - - [self addString:section - forKey:keyword - inTable:_PPDOrderDependency]; - - return self; -} + [result setObject: [NSNumber numberWithBool:YES] + forKey: NSDeviceIsPrinter]; + NSDebugMLLog(@"GSPrinting", @"Device Description: %@", [result description]); + return result; +} -(id) initWithCoder: (NSCoder*) coder { - self = [super initWithCoder: coder]; - return self; + return [super initWithCoder: coder]; } + -(void) encodeWithCoder: (NSCoder*) coder { [super encodeWithCoder: coder]; } - + +@end + + + + + +@implementation GSLPRPrinter (Private) +// +// Load the printer setup from NSUserDefaults +// ++ (NSDictionary*) printersDictionary +{ + NSUserDefaults* defaults; + NSDictionary *printers; + + defaults = [NSUserDefaults standardUserDefaults]; + + printers = [defaults objectForKey: @"GSLPRPrinters"]; + + if( !printers ) //Not set, make a default printer because we are nice. + { + NSString *ppdPath; + NSMutableDictionary *printerEntry; + + printers = [NSMutableDictionary dictionary]; + printerEntry = [NSMutableDictionary dictionary]; + + ppdPath = [NSBundle pathForLibraryResource: @"Apple_LaserWriter_II_NTX" + ofType: @"ppd" + inDirectory: @"PostScript/PPD"]; + + [printerEntry setObject: ppdPath + forKey: @"PPDPath"]; + + [printerEntry setObject: @"localhost" + forKey: @"Host"]; + + [printerEntry setObject: @"Automatically Generated" + forKey: @"Note"]; + + [printerEntry setObject: @"Unknown" + forKey: @"Type"]; + + [(NSMutableDictionary*)printers setObject: printerEntry + forKey: @"Unnamed"]; + + NSLog(@"Creating a default printer since one is not \ +in the User Defaults (GSLPRPrinters). Description: %@", + [printerEntry description]); + } + + return printers; +} + + + + +// +// Initialisation method +// +// To keep loading of PPDs relatively fast, not much checking is done on it. +-(id) initWithName: (NSString*) name + withType: (NSString*) type + withHost: (NSString*) host + withNote: (NSString*) note + withPPDPath: (NSString*) ppdPath +{ + NSDebugMLLog(@"GSPrinting", @""); + + self = [super initWithName: name + withType: type + withHost: host + withNote: note]; + + [self parsePPDAtPath: ppdPath]; + + return self; +} + + @end diff --git a/Source/NSPrintInfo.m b/Source/NSPrintInfo.m index 9fc43617b..3c61b9f62 100644 --- a/Source/NSPrintInfo.m +++ b/Source/NSPrintInfo.m @@ -150,7 +150,10 @@ static NSPrintInfo *sharedPrintInfo = nil; // - (id)initWithDictionary:(NSDictionary *)aDict { - [super init]; + NSPrinter *printer; + NSString *pageSize; + + self = [super init]; _info = [[NSMutableDictionary alloc] init]; @@ -166,6 +169,31 @@ static NSPrintInfo *sharedPrintInfo = nil; [self setVerticallyCentered: YES]; [self setOrientation: NSPortraitOrientation]; + + printer = [NSPrintInfo defaultPrinter]; + [self setPrinter: printer]; + + + /* Set up other defaults from the printer object */ + pageSize = [printer stringForKey: @"DefaultPageSize" + inTable: @"PPD"]; + + /* FIXME: Need to check for AutoSelect and probably a million other things... */ + if (pageSize == nil) + pageSize = @"A4"; + + [self setPaperName: pageSize]; + + /* Set default margins. FIXME: Probably should check ImageableArea */ + [self setRightMargin: 36]; + + [self setLeftMargin: 36]; + + [self setTopMargin: 72]; + + [self setBottomMargin: 72]; + + if( aDict != nil ) { @@ -174,7 +202,6 @@ static NSPrintInfo *sharedPrintInfo = nil; if([[_info objectForKey: NSPrintPrinter] isKindOfClass: [NSString class]]) { NSString *printerName; - NSPrinter *printer; printerName = [_info objectForKey: NSPrintPrinter]; printer = [NSPrinter printerWithName: printerName]; @@ -188,6 +215,7 @@ static NSPrintInfo *sharedPrintInfo = nil; return self; } + - (void) dealloc { RELEASE(_info); diff --git a/Source/NSPrinter.m b/Source/NSPrinter.m index 5d0799200..e2077804e 100644 --- a/Source/NSPrinter.m +++ b/Source/NSPrinter.m @@ -1,6 +1,6 @@ /** NSPrinter - Class representing a printer's or printer model's capabilities. + Class representing a printer's capabilities. Copyright (C) 1996, 1997, 2004 Free Software Foundation, Inc. @@ -8,7 +8,7 @@ Date: June 1997 Modified for Printing Backend Support Author: Chad Hardin - Date: June 2004 + Date: July 2004 This file is part of the GNUstep GUI Library. @@ -30,17 +30,10 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ -/* NB: - * There are a few FIXMEs in the functionality left. - * Parsing of the PPDs is somewhat suboptimal. - * (I think it's best to leave optimisation until more of GNUstep is done). - * The *OpenUI, *CloseUI, *OpenGroup and *CloseGroup are not processed. - * (This is not required in the OpenStep standard, but could be useful). - */ - #include "config.h" #include #include +#include #include #include #include @@ -50,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -60,6 +54,59 @@ #include "AppKit/NSPrinter.h" #include "GNUstepGUI/GSPrinting.h" +// +// Class variables: +// + +// +// Class variables used during scanning: +// + +// Character sets used in scanning. +static NSCharacterSet* newlineSet = nil; +static NSCharacterSet* keyEndSet = nil; +static NSCharacterSet* optKeyEndSet = nil; +static NSCharacterSet* valueEndSet = nil; + +//Class variable to cache NSPrinters, without this they +//are created (and PPDs are parsed) ALL the time +static NSMutableDictionary* printerCache; + + +// +// Private methods used for PPD Parsing +// +@interface NSPrinter (PPDParsingPrivate) + +-(void) loadPPDAtPath: (NSString*) PPDstring + symbolValues: (NSMutableDictionary*) ppdSymbolValues + inclusionSet: (NSMutableSet*) includeSet; + +-(void) addPPDKeyword: (NSString*) mainKeyword + withScanner: (NSScanner*) PPDdata + withPPDPath: (NSString*) ppdPath; + +-(void) addPPDUIConstraint: (NSScanner*) constraint + withPPDPath: (NSString*) ppdPath; + +-(void) addPPDOrderDependency: (NSScanner*) dependency + withPPDPath: (NSString*) ppdPath; + +-(id) addString: (NSString*) string + forKey: (NSString*) key + inTable: (NSString*) table; + +-(void) addValue: (NSString*) value + andValueTranslation: (NSString*) valueTranslation + andOptionTranslation: (NSString*) optionTranslation + forKey: (NSString*) key; + +-(NSString*) interpretQuotedValue: (NSString*) qString; + +-(int) gethex: (unichar) character; + +@end + @implementation NSPrinter @@ -67,19 +114,20 @@ // // Class methods // -+ (void)initialize ++(void) initialize { if (self == [NSPrinter class]) { // Initial version [self setVersion:1]; } + printerCache = RETAIN( [NSMutableDictionary dictionary] ); } /** Load the appropriate bundle for the Printer (eg: GSLPRPrinter, GSCUPSPrinter). */ -+ (id) allocWithZone: (NSZone*) zone ++(id) allocWithZone: (NSZone*) zone { Class principalClass; @@ -94,17 +142,71 @@ // // Finding an NSPrinter -// -+ (NSPrinter *)printerWithName:(NSString *)name +// ++(NSPrinter*) printerWithName: (NSString*) name { - Class principalClass; + NSEnumerator *keyEnum; + NSString *key; + NSPrinter *printer; - principalClass = [[GSPrinting printingBundle] principalClass]; + + //First, the cache has to be managed. + //Take into account any deleted printers. + keyEnum = [[printerCache allKeys] objectEnumerator]; + while( (key = [keyEnum nextObject]) ) + { + NSEnumerator *namesEnum; + NSString *string; + BOOL stillValid = NO; - if( principalClass == nil ) - return nil; + namesEnum = [[self printerNames] objectEnumerator]; + while( (string = [namesEnum nextObject]) ) + { + if( [string isEqualToString: key] ) + { + stillValid = YES; + break; + } + } + + if( stillValid == NO ) + { + NSDebugMLLog(@"GSPrinting", @"Printer named %@ removed from cache", + name); + } + } + + printer = [printerCache objectForKey: name]; + + if( printer ) + { + NSDebugMLLog(@"GSPrinting", @"Printer named %@ found in cache", + name); + return printer; + } + else + { + Class principalClass; + + NSDebugMLLog(@"GSPrinting", @"Printer named %@ not found in cache", + name); + + principalClass = [[GSPrinting printingBundle] principalClass]; + + if( principalClass == nil ) + return nil; - return [[principalClass printerClass] printerWithName: name]; + printer = [[principalClass printerClass] printerWithName: name]; + + if( printer ) + { + [printerCache setObject: printer + forKey: name]; + NSDebugMLLog(@"GSPrinting", @"Printer named %@ added to cache", + name); + } + return printer; + } } // @@ -125,7 +227,7 @@ // little use in creating a NSPrinter for a printer that is not // available for use in the first place, I am open for commments // on this, of course. -+ (NSPrinter *)printerWithType:(NSString *)type ++(NSPrinter*) printerWithType: (NSString*) type { NSEnumerator *printerNamesEnum; NSString *printerName; @@ -146,7 +248,8 @@ return nil; } -+ (NSArray *)printerNames + ++(NSArray*) printerNames { Class principalClass; @@ -158,8 +261,9 @@ return [[principalClass printerClass] printerNames]; } -// See note at +(NSPrinter *)printerWithType:(NSString *)type -+ (NSArray *)printerTypes + +// See note at +(NSPrinter*) printerWithType:(NSString*) type ++(NSArray*) printerTypes { NSMutableSet *printerTypes; NSEnumerator *printerNamesEnum; @@ -183,42 +287,27 @@ // // Instance methods // -// -// Deallocation of instance variables -// -- (void)dealloc -{ - RELEASE(_printerHost); - RELEASE(_printerName); - RELEASE(_printerNote); - RELEASE(_printerType); - RELEASE(_PPD); - RELEASE(_PPDOptionTranslation); - RELEASE(_PPDArgumentTranslation); - RELEASE(_PPDOrderDependency); - RELEASE(_PPDUIConstraints); - [super dealloc]; -} + // // Printer Attributes // -- (NSString *)host +-(NSString*) host { return _printerHost; } -- (NSString *)name +-(NSString*) name { return _printerName; } -- (NSString *)note +-(NSString*) note { return _printerNote; } -- (NSString *)type +-(NSString*) type { return _printerType; } @@ -226,428 +315,253 @@ // // Retrieving Specific Information // -- (BOOL)acceptsBinary +-(BOOL) acceptsBinary { - // FIXME: I'm not sure if acceptsBinary is the same as BCP protocol? - NSString *result; - NSScanner *protocols; - NSCharacterSet *whitespace; - - if (_cacheAcceptsBinary != -1) - return _cacheAcceptsBinary; - result = [self stringForKey:@"Protocols" inTable:@"PPD"]; - if (!result) - { - _cacheAcceptsBinary = NO; - return NO; - } - protocols = [NSScanner scannerWithString:result]; - whitespace = [NSCharacterSet whitespaceCharacterSet]; - while(![protocols isAtEnd]) - { - [protocols scanUpToCharactersFromSet:whitespace intoString:&result]; - if ([result isEqual:@"BCP"]) - { - _cacheAcceptsBinary = YES; - return YES; - } - } - _cacheAcceptsBinary = NO; - return NO; + [self subclassResponsibility: _cmd]; + return NO; } -- (NSRect)imageRectForPaper:(NSString *)paperName +-(NSRect) imageRectForPaper: (NSString*) paperName { - return [self rectForKey:[NSString - stringWithFormat:@"ImageableArea/%@", paperName] - inTable:@"PPD"]; + [self subclassResponsibility: _cmd]; + return NSZeroRect; } -- (NSSize)pageSizeForPaper:(NSString *)paperName +-(NSSize) pageSizeForPaper: (NSString*) paperName { - return [self sizeForKey:[NSString - stringWithFormat:@"PaperDimension/%@", paperName] - inTable:@"PPD"]; + [self subclassResponsibility: _cmd]; + return NSZeroSize; } -- (BOOL)isColor +-(BOOL) isColor { - return [self booleanForKey:@"ColorDevice" inTable:@"PPD"]; + [self subclassResponsibility: _cmd]; + return NO; } -- (BOOL)isFontAvailable:(NSString *)fontName +-(BOOL) isFontAvailable: (NSString*) fontName { - return [self isKey:[NSString stringWithFormat:@"Font/%@", fontName] - inTable:@"PPD"]; + [self subclassResponsibility: _cmd]; + return NO; } -- (int)languageLevel +-(int) languageLevel { - return [self intForKey:@"LanguageLevel" inTable:@"PPD"]; + [self subclassResponsibility: _cmd]; + return 0; } -- (BOOL)isOutputStackInReverseOrder +-(BOOL) isOutputStackInReverseOrder { - // FIXME: Is this what is needed? I'm not sure how this is worked out. - NSString *result; - if (_cacheOutputOrder != -1) - return _cacheOutputOrder; - result = [self stringForKey:@"DefaultOutputOrder" inTable:@"PPD"]; - if (!result) - { - _cacheOutputOrder = NO; - return NO; - } - if ([result isEqual:@"Reverse"]) - { - _cacheOutputOrder = YES; - return YES; - } - _cacheOutputOrder = NO; + [self subclassResponsibility: _cmd]; return NO; } // // Querying the NSPrinter Tables // - -/* - * Caching of converted values: - * To speed up retrieving non-string values, once they are read and converted - * they are then cached. Since these use the converted value of a string in - * whatever table they are in, this assumes there is only one string - * associated with the key, and so stringListForKey will not be used. The - * second place in the array attached for the key is therefore used to cache - * the information, and generally assumptions are made which are Bad Things, - * but it seems quicker and simpler than other ways and shouldn't go wrong in - * normal use (?). - */ - -- (BOOL)booleanForKey:(NSString *)key - inTable:(NSString *)table +-(BOOL) booleanForKey: (NSString*) key + inTable: (NSString*) table { - NSMutableArray *result; - result = (NSMutableArray *)[self stringListForKey:key inTable:table]; - if (!result) + NSString *result; + result = [self stringForKey: key + inTable: table]; + + if (!result) //raise exception? return NO; - if ([result count] == 2) - { - // Retrieve cached result - return [(NSNumber *)[result objectAtIndex:1] boolValue]; - } - if ([[result objectAtIndex:0] isEqual:@"True"]) - { - // Cache result - [result addObject:[NSNumber numberWithBool:YES]]; - return YES; - } - // Cache result - [result addObject:[NSNumber numberWithBool:NO]]; - return NO; -} - -- (NSDictionary *)deviceDescription -{ - /* FIXME: This is all rather dodgy - I don't have detailed information. - * I think I'll wait until NSWindow's deviceDescription is - * implemented, and then use that, since I'm not sure as to what sort - * of objects the values should be, and it would be nice to get the - * deviceDescriptions methods to match in the way they work. - */ - NSDictionary *result; - int dpi = [self intForKey:@"DefaultResolution" inTable:@"PPD"]; - BOOL color = [self booleanForKey:@"ColorDevice" inTable:@"PPD"]; - NSString *colorSpaceName; - int bits = [self intForKey:@"DefaultBitsPerPixel" inTable:@"PPD"]; - NSSize paperSize = [self pageSizeForPaper: - [self stringForKey:@"DefaultPageSize" - inTable:@"PPD"]]; - // Guess 300 dpi - if (!dpi) - dpi = 300; - // FIXME: Should NSDeviceWhiteColorSpace be NSDeviceBlackColorSpace? - // FIXME #2: Are they calibrated? - // Basically I'm not sure which color spaces should be used... - if (color) - colorSpaceName = NSDeviceCMYKColorSpace; + + if ([result caseInsensitiveCompare: @"TRUE"] == NSOrderedSame) + return YES; else - colorSpaceName = NSDeviceWhiteColorSpace; - if (!bits) // Either not found, or 'None' - bits=1; - // If the paper size wasn't found, try Letter - if (!(paperSize.width && paperSize.height)) - paperSize = NSMakeSize(612,792); - // Create the dictionary... - result = [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithInt:dpi], NSDeviceResolution, - colorSpaceName, NSDeviceColorSpaceName, - [NSNumber numberWithInt:bits], NSDeviceBitsPerSample, - [NSNumber numberWithBool:NO], NSDeviceIsScreen, - [NSNumber numberWithBool:YES], NSDeviceIsPrinter, - [NSValue valueWithSize:paperSize], NSDeviceSize, - nil]; - return result; + return NO; } -- (float)floatForKey:(NSString *)key - inTable:(NSString *)table + +-(NSDictionary*) deviceDescription { - NSMutableArray *result; - float number; - result = (NSMutableArray *)[self stringListForKey:key inTable:table]; - if (!result) + [self subclassResponsibility: _cmd]; + return nil; +} + + +-(float) floatForKey: (NSString*) key + inTable: (NSString*) table +{ + NSString *result; + + result = [self stringForKey: key + inTable: table]; + + if (!result) //raise exception? return 0.0; - if ([result count] == 2) - { - // Retrieve cached result - return [(NSNumber *)[result objectAtIndex:1] floatValue]; - } - number = [(NSString *)[result objectAtIndex:0] floatValue]; - // Cache result - [result addObject:[NSNumber numberWithFloat:number]]; - // And return it - return number; + + return [result floatValue]; } -- (int)intForKey:(NSString *)key - inTable:(NSString *)table + +-(int) intForKey: (NSString*) key + inTable: (NSString*) table { - NSMutableArray *result; - int number; - result = (NSMutableArray *)[self stringListForKey:key inTable:table]; - if (!result) + NSString *result; + + result = [self stringForKey: key + inTable: table]; + + if (!result) //raise exception? return 0; - if ([result count] == 2) - { - // Retrieve cached result - return [(NSNumber *)[result objectAtIndex:1] intValue]; - } - number = [(NSString *)[result objectAtIndex:0] intValue]; - // Cache result - [result addObject:[NSNumber numberWithInt:number]]; - // And return it - return number; + + return [result intValue]; } -- (NSRect)rectForKey:(NSString *)key - inTable:(NSString *)table + +-(NSRect) rectForKey: (NSString*) key + inTable: (NSString*) table { - NSMutableArray *result; + NSString *result; NSScanner *bits; float x1, y1, x2, y2; - NSRect rectangle; - result = (NSMutableArray *)[self stringListForKey:key inTable:table]; - if (!result) + + result = [self stringForKey: key + inTable: table]; + + if (!result) //raise exception? return NSZeroRect; - if ([result count] == 2) + + bits = [NSScanner scannerWithString: result]; + if ([bits scanFloat: &x1] && + [bits scanFloat: &y1] && + [bits scanFloat: &x2] && + [bits scanFloat: &y2]) { - // Retrieve cached result - return [(NSValue *)[result objectAtIndex:1] rectValue]; - } - bits = [NSScanner scannerWithString:[result objectAtIndex:0]]; - if ([bits scanFloat:&x1] && - [bits scanFloat:&y1] && - [bits scanFloat:&x2] && - [bits scanFloat:&y2]) - { - rectangle = NSMakeRect(x1, y1, x2-x1, y2-y1); - // Cache result - [result addObject:[NSValue valueWithRect:rectangle]]; - // And return it - return rectangle; + return NSMakeRect(x1, y1, x2-x1, y2-y1); } return NSZeroRect; } -- (NSSize)sizeForKey:(NSString *)key - inTable:(NSString *)table +-(NSSize) sizeForKey: (NSString*) key + inTable: (NSString*) table { - NSMutableArray *result; + NSString *result; NSScanner *bits; float x, y; - NSSize size; - result = (NSMutableArray *)[self stringListForKey:key inTable:table]; - if (!result) + + result = [self stringForKey: key + inTable: table]; + + if (!result) //raise exception? return NSZeroSize; - if ([result count] == 2) + + bits = [NSScanner scannerWithString: result]; + if ([bits scanFloat: &x] && + [bits scanFloat: &y]) { - // Retrieve cached result - return [(NSValue *)[result objectAtIndex:1] sizeValue]; - } - bits = [NSScanner scannerWithString:[result objectAtIndex:0]]; - if ([bits scanFloat:&x] && - [bits scanFloat:&y]) - { - size = NSMakeSize(x,y); - // Cache result - [result addObject:[NSValue valueWithSize:size]]; - // And return it - return size; + return NSMakeSize(x,y); } return NSZeroSize; } -- (NSString *)stringForKey:(NSString *)key - inTable:(NSString *)table -{ - NSMutableDictionary *checkMe = nil; - NSMutableArray *result; - // Select correct table - if ([table isEqual:@"PPD"]) - checkMe = _PPD; - else if ([table isEqual:@"PPDOptionTranslation"]) - checkMe = _PPDOptionTranslation; - else if ([table isEqual:@"PPDArgumentTranslation"]) - checkMe = _PPDArgumentTranslation; - else if ([table isEqual:@"PPDOrderDependency"]) - checkMe = _PPDOrderDependency; - else if ([table isEqual:@"PPDUIConstraints"]) - checkMe = _PPDUIConstraints; - else - { - [NSException raise:NSGenericException - format:@"Could not find PPD table %@", table]; - // NOT REACHED - } - // And check it - result = [checkMe objectForKey:key]; - if (!result) - // Not found +-(NSString*) stringForKey: (NSString*) key + inTable: (NSString*) table +{ + NSArray *results; + + results = [self stringListForKey: key + inTable: table]; + + if( results == nil) return nil; - return [result objectAtIndex:0]; + + return [results objectAtIndex: 0]; } -- (NSArray *)stringListForKey:(NSString *)key - inTable:(NSString *)table + + + +-(NSArray*) stringListForKey: (NSString*) key + inTable: (NSString*) table { - NSMutableDictionary *checkMe = nil; + NSDictionary *tableObj; NSMutableArray *result; - // Select correct Table - if ([table isEqual:@"PPD"]) - checkMe = _PPD; - else if ([table isEqual:@"PPDOptionTranslation"]) - checkMe = _PPDOptionTranslation; - else if ([table isEqual:@"PPDArgumentTranslation"]) - checkMe = _PPDArgumentTranslation; - else if ([table isEqual:@"PPDOrderDependency"]) - checkMe = _PPDOrderDependency; - else if ([table isEqual:@"PPDUIConstraints"]) - checkMe = _PPDUIConstraints; - else + tableObj = [_tables objectForKey: table ]; + + if( tableObj == nil ) { - [NSException raise:NSGenericException - format:@"Could not find PPD table %@", table]; - // NOT REACHED + [NSException raise: NSGenericException + format: @"Could not find table %@", table]; + return nil; } - // And check it - result = [checkMe objectForKey:key]; - if (!result) - // Not found - return nil; + + result = [tableObj objectForKey: key]; if ([[result objectAtIndex:0] isEqual:@""]) { - NSMutableArray *oldResult = result; + NSMutableArray *origResult = result; result = [NSMutableArray array]; - [result addObjectsFromArray:oldResult]; - [result removeObjectAtIndex:0]; + [result addObjectsFromArray: origResult]; + [result removeObjectAtIndex: 0]; } return result; } -- (NSPrinterTableStatus)statusForTable:(NSString *)table + +-(NSPrinterTableStatus) statusForTable: (NSString*) table { - NSMutableDictionary *checkMe; + NSMutableDictionary *tableObj; + // Select correct table - if ([table isEqual:@"PPD"]) - checkMe = _PPD; - else if ([table isEqual:@"PPDOptionTranslation"]) - checkMe = _PPDOptionTranslation; - else if ([table isEqual:@"PPDArgumentTranslation"]) - checkMe = _PPDArgumentTranslation; - else if ([table isEqual:@"PPDOrderDependency"]) - checkMe = _PPDOrderDependency; - else if ([table isEqual:@"PPDUIConstraints"]) - checkMe = _PPDUIConstraints; + tableObj = [_tables objectForKey: table]; + + if( tableObj == nil ) + return NSPrinterTableNotFound; else - return NSPrinterTableNotFound; - if (checkMe) - return NSPrinterTableOK; - // Shouldn't happen! - return NSPrinterTableError; + return NSPrinterTableOK; + + //the third option, NSPrinterTableError, I just don't know... } -- (BOOL)isKey:(NSString *)key - inTable:(NSString *)table + +-(BOOL) isKey: (NSString*) key + inTable: (NSString*) table { - NSMutableDictionary *checkMe = nil; - NSMutableArray *result; + NSMutableDictionary *tableObj; // Select correct table - if ([table isEqual:@"PPD"]) - checkMe = _PPD; - else if ([table isEqual:@"PPDOptionTranslation"]) - checkMe = _PPDOptionTranslation; - else if ([table isEqual:@"PPDArgumentTranslation"]) - checkMe = _PPDArgumentTranslation; - else if ([table isEqual:@"PPDOrderDependency"]) - checkMe = _PPDOrderDependency; - else if ([table isEqual:@"PPDUIConstraints"]) - checkMe = _PPDUIConstraints; - else + tableObj = [_tables objectForKey: table]; + + if( tableObj == nil ) { - [NSException raise:NSGenericException - format:@"Could not find PPD table %@", table]; - // NOT REACHED + [NSException raise: NSGenericException + format: @"Could not find table %@", table]; + return NO; } + // And check it - result = [checkMe objectForKey:key]; - if (!result) - // Not found + if ( [tableObj objectForKey: key] == nil) return NO; - return YES; + else + return YES; } // // NSCoding protocol // - (void) encodeWithCoder: (NSCoder*)aCoder -{ - // [super encodeWithCoder:aCoder]; - +{ [aCoder encodeObject: _printerHost]; [aCoder encodeObject: _printerName]; [aCoder encodeObject: _printerNote]; [aCoder encodeObject: _printerType]; - - [aCoder encodeValueOfObjCType: @encode(int) at: &_cacheAcceptsBinary]; - [aCoder encodeValueOfObjCType: @encode(int) at: &_cacheOutputOrder]; - - [aCoder encodeObject: _PPD]; - [aCoder encodeObject: _PPDOptionTranslation]; - [aCoder encodeObject: _PPDArgumentTranslation]; - [aCoder encodeObject: _PPDOrderDependency]; - [aCoder encodeObject: _PPDUIConstraints]; + [aCoder encodeObject: _tables]; } - (id) initWithCoder: (NSCoder*)aDecoder -{ - // self = [super initWithCoder:aDecoder]; - - [aDecoder decodeValueOfObjCType: @encode(id) at: &_printerHost]; - [aDecoder decodeValueOfObjCType: @encode(id) at: &_printerName]; - [aDecoder decodeValueOfObjCType: @encode(id) at: &_printerNote]; - [aDecoder decodeValueOfObjCType: @encode(id) at: &_printerType]; - - [aDecoder decodeValueOfObjCType: @encode(int) at: &_cacheAcceptsBinary]; - [aDecoder decodeValueOfObjCType: @encode(int) at: &_cacheOutputOrder]; - - [aDecoder decodeValueOfObjCType: @encode(id) at: &_PPD]; - [aDecoder decodeValueOfObjCType: @encode(id) at: &_PPDOptionTranslation]; - [aDecoder decodeValueOfObjCType: @encode(id) at: &_PPDArgumentTranslation]; - [aDecoder decodeValueOfObjCType: @encode(id) at: &_PPDOrderDependency]; - [aDecoder decodeValueOfObjCType: @encode(id) at: &_PPDUIConstraints]; +{ + _printerHost = [aDecoder decodeObject]; + _printerName = [aDecoder decodeObject]; + _printerNote = [aDecoder decodeObject]; + _printerType = [aDecoder decodeObject]; + _tables = [aDecoder decodeObject]; return self; } @@ -665,10 +579,10 @@ // // Initialisation method used by backend bundles // --(id) initWithName:(NSString *)name - withType:(NSString *)type - withHost:(NSString *)host - withNote:(NSString *)note +-(id) initWithName: (NSString*) name + withType: (NSString*) type + withHost: (NSString*) host + withNote: (NSString*) note { self = [super init]; @@ -677,53 +591,831 @@ ASSIGN(_printerType, type); ASSIGN(_printerHost, host); ASSIGN(_printerNote, note); - _cacheAcceptsBinary = _cacheOutputOrder = -1; - _PPD = RETAIN([NSMutableDictionary dictionary]); - _PPDOptionTranslation = RETAIN([NSMutableDictionary dictionary]); - _PPDArgumentTranslation = RETAIN([NSMutableDictionary dictionary]); - _PPDOrderDependency = RETAIN([NSMutableDictionary dictionary]); - _PPDUIConstraints = RETAIN([NSMutableDictionary dictionary]); + _tables = RETAIN( [NSMutableDictionary dictionary] ); + return self; } +// +// Deallocation of instance variables +// +-(void) dealloc +{ + RELEASE(_printerHost); + RELEASE(_printerName); + RELEASE(_printerNote); + RELEASE(_printerType); + RELEASE(_tables); + [super dealloc]; +} + +@end + + + +@implementation NSPrinter (PPDParsing) + +-(BOOL) parsePPDAtPath: (NSString*) ppdPath +{ + NSAutoreleasePool* subpool; + NSMutableDictionary* ppdSymbolValues; + NSEnumerator* objEnum; + NSMutableArray* valArray; + + //make sure the class variables for scanning are created + if( !newlineSet) + { + newlineSet = [NSCharacterSet characterSetWithCharactersInString: @"\n\r"]; + RETAIN( newlineSet ); + } + + if( !keyEndSet ) + { + keyEndSet = [NSCharacterSet characterSetWithCharactersInString: @"\n\r\t: "]; + RETAIN( keyEndSet ); + } + + if( !optKeyEndSet ) + { + optKeyEndSet = [NSCharacterSet characterSetWithCharactersInString: @"\n\r:/"]; + RETAIN( optKeyEndSet ); + } + + if( !valueEndSet ) + { + valueEndSet = [NSCharacterSet characterSetWithCharactersInString: @"\n\r/"]; + RETAIN( valueEndSet ); + } + + + + [_tables setObject: [NSMutableDictionary dictionary] + forKey: @"PPD"]; + + [_tables setObject: [NSMutableDictionary dictionary] + forKey: @"PPDOptionTranslation"]; + + [_tables setObject: [NSMutableDictionary dictionary] + forKey: @"PPDArgumentTranslation"]; + + [_tables setObject: [NSMutableDictionary dictionary] + forKey: @"PPDOrderDependency"]; + + [_tables setObject: [NSMutableDictionary dictionary] + forKey: @"PPDUIConstraints"]; + + + // Create a temporary autorelease pool, as many temporary objects are used + subpool = [[NSAutoreleasePool alloc] init]; + + + // NB: There are some structure keywords (such as OpenUI/CloseUI) that may + // be repeated, but as yet are not used. Since they are structure keywords, + // they'll probably need special processing anyway, and so aren't + // added to this list. + + // Create dictionary for temporary storage of symbol values + ppdSymbolValues = [NSMutableDictionary dictionary]; + + //The inclusion set keeps track of what PPD files have been *Include(d). + //If one comes up twice recursion has occurred and we stop it. + // And scan the PPD itself + [self loadPPDAtPath: ppdPath + symbolValues: ppdSymbolValues + inclusionSet: [NSMutableSet setWithCapacity:10]]; + + // Search the PPD dictionary for symbolvalues and substitute them. + objEnum = [[_tables objectForKey: @"PPD"] objectEnumerator]; + while( (valArray = [objEnum nextObject]) ) + { + NSString *oldValue; + NSString *newValue; + int i, max; + + max = [valArray count]; + for( i=0 ; i < max ; i++ ) + { + oldValue = [valArray objectAtIndex: i]; + if( [oldValue isKindOfClass: [NSString class]] + && ![oldValue isEqual: @""] + && [[oldValue substringToIndex: 1] isEqual: @"^"]) + { + newValue = [ppdSymbolValues + objectForKey: [oldValue substringFromIndex: 1]]; + + if( !newValue ) + { + [NSException raise: NSPPDParseException + format: @"Unknown symbol value, ^%@ in PPD file %@.ppd", + oldValue, ppdPath]; + } + + [valArray replaceObjectAtIndex: i + withObject: newValue]; + } + } + } + + + + // Make sure all the required keys are present + //Too many PPDs don't pass the test.... + /* + objEnum = [[NSArray arrayWithObjects: @"NickName", + @"ModelName", + @"PCFileName", + @"Product", + @"PSVersion", + @"FileVersion", + @"FormatVersion", + @"LanguageEncoding", + @"LanguageVersion", + @"PageSize", + @"PageRegion", + @"ImageableArea", + @"PaperDimension", + @"PPD-Adobe", + nil] objectEnumerator]; + + while( (checkVal = [objEnum nextObject]) ) + { + if( ![self isKey: checkVal + inTable: @"PPD"] ) + { + [NSException raise:NSPPDParseException + format:@"Required keyword *%@ not found in PPD file %@.ppd", + checkVal, PPDPath]; + } + } + */ + + // Release the local autoreleasePool + RELEASE( subpool ); + + +//Sometimes it's good to see the tables... +/* + NSDebugMLLog(@"GSPrinting", @"\n\nPPD: %@\n\n", + [[_tables objectForKey: @"PPD"] description]); + + NSDebugMLLog(@"GSPrinting", @"\n\nPPDOptionTranslation: %@\n\n", + [[_tables objectForKey: @"PPDOptionTranslation"] description]); + + NSDebugMLLog(@"GSPrinting", @"\n\nPPDArgumentTranslation: %@\n\n", + [[_tables objectForKey: @"PPDArgumentTranslation"] description]); + + NSDebugMLLog(@"GSPrinting", @"\n\nPPDOrderDependency: %@\n\n", + [[_tables objectForKey: @"PPDOrderDependency"] description]); + + NSDebugMLLog(@"GSPrinting", @"\n\nPPDUIConstraints: %@\n\n", + [[_tables objectForKey: @"PPDUIConstraints"] description]); +*/ + + + return YES; +} + +@end + + + + + +@implementation NSPrinter (PPDParsingPrivate) + + +-(void) loadPPDAtPath: (NSString*) ppdPath + symbolValues: (NSMutableDictionary*) ppdSymbolValues + inclusionSet: (NSMutableSet*) inclusionSet +{ + NSString* ppdString; + NSScanner* ppdData; + NSString* keyword; + + + + //See if this ppd has been processed before + if( [inclusionSet member: ppdPath] ) + { + //this ppd has been done already! + [NSException raise: NSPPDIncludeStackOverflowException + format: @"Recursive *Includes! PPD *Include stack: %@", + [[inclusionSet allObjects] description] ]; + } + + [inclusionSet addObject: ppdPath]; + + ppdString = [NSString stringWithContentsOfFile: ppdPath]; + + // Set up the scanner - Appending a newline means that it should be + // able to process the last line correctly + ppdData = [NSScanner scannerWithString: + [ppdString stringByAppendingString: @"\n"]]; + + [ppdData setCharactersToBeSkipped: [NSCharacterSet whitespaceCharacterSet]]; + + // Main processing starts here... + while( YES ) //Only check for the end after accounting for whitespace + { + // Get to the start of a new keyword, skipping blank lines + [ppdData scanCharactersFromSet: + [NSCharacterSet whitespaceAndNewlineCharacterSet] + intoString: NULL]; + + //this could be the end... + if( [ppdData isAtEnd] ) + break; + + // All new entries should starts '*' + if( ![ppdData scanString: @"*" + intoString: NULL] ) + { + [NSException raise: NSPPDParseException + format: @"Line not starting with * in PPD file %@", + ppdPath]; + } + + // Skip lines starting '*%', '*End', '*SymbolLength', or '*SymbolEnd' + if ( [ppdData scanString: @"%" + intoString: NULL] + || [ppdData scanString: @"End" //if we get this there is problem, yes? + intoString: NULL] + || [ppdData scanString: @"SymbolLength" + intoString: NULL] + || [ppdData scanString: @"SymbolEnd" //if we get this there is problem, yes? + intoString: NULL]) + { + [ppdData scanUpToCharactersFromSet: newlineSet + intoString: NULL]; + continue; + } + + // Read main keyword, up to a colon, space or newline + [ppdData scanUpToCharactersFromSet: keyEndSet + intoString: &keyword]; + + // Loop if there is no value section, these keywords are ignored + if( [ppdData scanCharactersFromSet: newlineSet + intoString: NULL] ) + { + continue; + } + + // Add the line to the relevant table + if( [keyword isEqual: @"OrderDependency"] ) + { + [self addPPDOrderDependency: ppdData + withPPDPath: ppdPath]; + } + else if( [keyword isEqual: @"UIConstraints"] ) + { + [self addPPDUIConstraint: ppdData + withPPDPath: ppdPath]; + } + else if( [keyword isEqual: @"Include"] ) + { + NSFileManager *fileManager; + NSString *fileName = nil; + NSString *path = nil; + + fileManager = [NSFileManager defaultManager]; + + [ppdData scanString: @":" + intoString: NULL]; + + // Find the filename between two "s" + [ppdData scanString: @"\"" /*"*/ + intoString: NULL]; + + [ppdData scanUpToString: @"\"" /*"*/ + intoString: &fileName]; + + [ppdData scanString: @"\"" /*"*/ + intoString: NULL]; + + //the fileName could be an absolute path or just a filename. + if( [fileManager fileExistsAtPath: fileName] ) + { + //it was absolute, we are done + path = fileName; + } + //it was not absolute. Check to see if it exists in the + //directory of this ppd + else if( [fileManager fileExistsAtPath: + [[ppdPath stringByDeletingLastPathComponent] + stringByAppendingPathComponent: fileName] ] ) + { + path = [[ppdPath stringByDeletingLastPathComponent] + stringByAppendingPathComponent: fileName]; + } + else //could not find the *Include fileName + { + [NSException raise: NSPPDIncludeNotFoundException + format: @"Could not find *Included PPD file %@", path]; + } + + [self loadPPDAtPath: path + symbolValues: ppdSymbolValues + inclusionSet: inclusionSet]; + } + else if ([keyword isEqual: @"SymbolValue"]) + { + NSString *symbolName; + NSString *symbolVal; + + if( ![ppdData scanString: @"^" + intoString: NULL]) + { + [NSException raise: NSPPDParseException + format:@"Badly formatted *SymbolValue in PPD file %@", + ppdPath]; + } + + [ppdData scanUpToString: @":" + intoString: &symbolName]; + + + [ppdData scanString: @":" + intoString: NULL]; + + [ppdData scanString: @"\"" /*"*/ + intoString: NULL]; + + [ppdData scanUpToString: @"\"" /*"*/ + intoString: &symbolVal]; + + if ( !symbolVal ) + symbolVal = @""; + + [ppdData scanString: @"\"" /*"*/ + intoString: NULL]; + + [ppdSymbolValues setObject: symbolVal + forKey: symbolName]; + } + else + { + [self addPPDKeyword: keyword + withScanner: ppdData + withPPDPath: ppdPath]; + } + } +} + + +-(void) addPPDKeyword: (NSString*) mainKeyword + withScanner: (NSScanner*) ppdData + withPPDPath: (NSString*) ppdPath +{ + NSArray *repKeys; + NSString* optionKeyword = nil; + NSString* optionTranslation = nil; + NSString* value = nil; + NSString* valueTranslation = nil; + + // Array of Repeated Keywords (Appendix B of the PostScript Printer + // Description File Format Specification). + repKeys = [NSArray arrayWithObjects:@"Emulators", + @"Extensions", + @"FaxSupport", + //@"Include", (handled separately) + @"Message", + @"PrinterError", + @"Product", + @"Protocols", + @"PSVersion", + @"Source", + @"Status", + //@"UIConstraints", (handled separately) + // Even though this is not mentioned in the list of repeated keywords, + // it's often repeated anyway, so I'm putting it here. + @"InkName", + nil]; + + + // Scan off any optionKeyword + [ppdData scanUpToCharactersFromSet: optKeyEndSet + intoString: &optionKeyword]; + + if( [ppdData scanCharactersFromSet: newlineSet + intoString: NULL]) + { + [NSException raise: NSPPDParseException + format: @"Keyword has optional keyword but no value in PPD file %@", + ppdPath]; + } + + if( [ppdData scanString: @"/" + intoString: NULL] ) + { + // Option keyword translation exists - scan it + [ppdData scanUpToString: @":" + intoString: &optionTranslation]; + } + + [ppdData scanString: @":" + intoString: NULL]; + + // Read the value part + // Values starting with a " are read until the second ", ignoring \n etc. + + if( [ppdData scanString: @"\"" /*"*/ + intoString: NULL] ) + { + [ppdData scanUpToString: @"\"" /*"*/ + intoString: &value]; + + if ( !value ) + value = @""; + + [ppdData scanString: @"\"" /*"*/ + intoString: NULL]; + + // It is a QuotedValue if it's in quotes, and there is no option + // key, or the main key is a *JCL keyword + if ( !optionKeyword || [[mainKeyword substringToIndex:3] + isEqualToString: @"JCL"]) + { + value = [self interpretQuotedValue: value]; + } + } + else + { + // Otherwise, scan up to the end of line or '/' + [ppdData scanUpToCharactersFromSet: valueEndSet + intoString: &value]; + } + // If there is a value translation, scan it + if( [ppdData scanString: @"/" + intoString: NULL] ) + { + [ppdData scanUpToCharactersFromSet: newlineSet + intoString: &valueTranslation]; + } + + // The translations also have to have any hex substrings interpreted + if (optionTranslation) + optionTranslation = [self interpretQuotedValue: optionTranslation]; + + if (valueTranslation) + valueTranslation = [self interpretQuotedValue: valueTranslation]; + + // The keyword (or keyword/option pair, if there's a option), should only + // only have one value, unless it's one of the optionless keywords which + // allow multiple instances. + // If a keyword is read twice, 'first instance is correct', according to + // the standard. + // Finally, add the strings to the tables + if( optionKeyword ) + { + NSString *mainAndOptionKeyword; + + mainAndOptionKeyword=[mainKeyword stringByAppendingFormat: @"/%@", + optionKeyword]; + + if( [self isKey: mainAndOptionKeyword + inTable: @"PPD"] ) + { + return; + } + + [self addValue: value + andValueTranslation: valueTranslation + andOptionTranslation: optionTranslation + forKey: mainAndOptionKeyword]; + + // Deal with the oddities of stringForKey:inTable: + // If this method is used to find a keyword with options, using + // just the keyword it should return an empty string + // stringListForKey:inTable:, however, should return the list of + // option keywords. + // This is done by making the first item in the array an empty + // string, which will be skipped by stringListForKey:, if necessary + if( ![[_tables objectForKey: @"PPD"] objectForKey: mainKeyword] ) + { + [self addString: @"" + forKey: mainKeyword + inTable: @"PPD"]; + + [self addString: @"" + forKey: mainKeyword + inTable: @"PPDOptionTranslation"]; + + [self addString: @"" + forKey: mainKeyword + inTable: @"PPDArgumentTranslation"]; + + } + + [self addValue: optionKeyword + andValueTranslation: optionKeyword + andOptionTranslation: optionKeyword + forKey: mainKeyword]; + } + else + { + if( [self isKey: mainKeyword + inTable: @"PPD"] && + ![repKeys containsObject: mainKeyword] ) + { + return; + } + + [self addValue: value + andValueTranslation: valueTranslation + andOptionTranslation: optionTranslation + forKey: mainKeyword]; + } +} + + +-(void) addPPDUIConstraint: (NSScanner*) constraint + withPPDPath: (NSString*) ppdPath +{ + NSString* mainKey1 = nil; + NSString* optionKey1 = nil; + NSString* mainKey2 = nil; + NSString* optionKey2 = nil; + + // UIConstraint should have no option keyword + if( ![constraint scanString: @":" + intoString: NULL] ) + { + [NSException raise:NSPPDParseException + format:@"UIConstraints has option keyword in PPD File %@", + ppdPath]; + } + + // Skip the '*' + [constraint scanString: @"*" + intoString: NULL]; + + // Scan the bits. Stuff not starting with * must be an optionKeyword + [constraint scanUpToCharactersFromSet: [NSCharacterSet whitespaceCharacterSet] + intoString: &mainKey1]; + + if( ![constraint scanString: @"*" + intoString: NULL] ) + { + [constraint scanUpToCharactersFromSet: [NSCharacterSet whitespaceCharacterSet] + intoString: &optionKey1]; + + [constraint scanString: @"*" + intoString: NULL]; + + } + + [constraint scanUpToCharactersFromSet: + [NSCharacterSet whitespaceAndNewlineCharacterSet] + intoString: &mainKey2]; + + if( ![constraint scanCharactersFromSet: newlineSet + intoString: NULL]) + { + [constraint scanUpToCharactersFromSet: + [NSCharacterSet whitespaceAndNewlineCharacterSet] + intoString: &optionKey2]; + } + else + { + optionKey2 = @""; + } + + // Add to table + if( optionKey1 ) + mainKey1 = [mainKey1 stringByAppendingFormat: @"/%@", optionKey1]; + + [self addString: mainKey2 + forKey: mainKey1 + inTable: @"PPDUIConstraints"]; + + [self addString: optionKey2 + forKey: mainKey1 + inTable: @"PPDUIConstraints"]; + +} + + + +-(void) addPPDOrderDependency: (NSScanner*) dependency + withPPDPath: (NSString*) ppdPath +{ + NSString *realValue = nil; + NSString *section = nil; + NSString *keyword = nil; + NSString *optionKeyword = nil; + + // Order dependency should have no option keyword + if( ![dependency scanString: @":" + intoString: NULL]) + { + [NSException raise: NSPPDParseException + format:@"OrderDependency has option keyword in PPD file %@", + ppdPath]; + } + + [dependency scanUpToCharactersFromSet: [NSCharacterSet whitespaceCharacterSet] + intoString: &realValue]; + + [dependency scanUpToCharactersFromSet: [NSCharacterSet whitespaceCharacterSet] + intoString: §ion]; + + [dependency scanString: @"*" + intoString: NULL]; + + [dependency scanUpToCharactersFromSet: + [NSCharacterSet whitespaceAndNewlineCharacterSet] + intoString: &keyword]; + + if( ![dependency scanCharactersFromSet: newlineSet + intoString: NULL]) + { + // Optional keyword exists + [dependency scanUpToCharactersFromSet: + [NSCharacterSet whitespaceAndNewlineCharacterSet] + intoString: &optionKeyword]; + } + + // Go to next line of PPD file + [dependency scanCharactersFromSet: newlineSet + intoString: NULL]; + + // Add to table + if(optionKeyword) + keyword = [keyword stringByAppendingFormat: @"/%@", optionKeyword]; + + [self addString: realValue + forKey: keyword + inTable: @"PPDOrderDependency"]; + + [self addString: section + forKey: keyword + inTable: @"PPDOrderDependency"]; + +} // // Adds the various values to the relevant tables, for the given key // -- addValue:(NSString *)value - andValueTranslation:(NSString *)valueTranslation -andOptionTranslation:(NSString *)optionTranslation - forKey:(NSString *)key +-(void) addValue: (NSString*) value + andValueTranslation: (NSString*) valueTranslation + andOptionTranslation: (NSString*) optionTranslation + forKey: (NSString*) key { - [self addString:value forKey:key inTable:_PPD]; - if (valueTranslation) - [self addString:valueTranslation forKey:key - inTable:_PPDArgumentTranslation]; - if (optionTranslation) - [self addString:optionTranslation forKey:key - inTable:_PPDOptionTranslation]; + [self addString: value + forKey: key + inTable: @"PPD"]; + + if(valueTranslation) + { + [self addString: valueTranslation + forKey: key + inTable: @"PPDArgumentTranslation"]; + } + + if(optionTranslation) + { + [self addString: optionTranslation + forKey: key + inTable: @"PPDOptionTranslation"]; + } +} + + + +// +// Adds the string to the array of strings. +// Or creates the array if it does not exist and adds the string +// +-(id) addString: (NSString*) string + forKey: (NSString*) key + inTable: (NSString*) table +{ + NSMutableDictionary *tableObj; + NSMutableArray *array; + + tableObj = [_tables objectForKey: table]; + + if( tableObj == nil ) + NSDebugMLLog( @"GSPrinting", @"Could not find table %@!", table); + + array = (NSMutableArray*)[tableObj objectForKey:key]; + + if( array == nil ) //it does not exist, create it + { + array = [NSMutableArray array]; + [tableObj setObject: array + forKey: key]; + } + + [array addObject: string]; + return self; } -// -// Adds the string to the array of strings -// -- addString:(NSString *)string - forKey:(NSString *)key - inTable:(NSMutableDictionary *)table + + +// Function to convert hexadecimal substrings +-(NSString*) interpretQuotedValue: (NSString*) qString { - NSMutableArray *array; - array = (NSMutableArray *)[table objectForKey:key]; - if (array) - // Add string to existing array - [array addObject:string]; - else - // Create the array if it does not exist - [table setObject:[NSMutableArray arrayWithObject:string] forKey:key]; - return self; + NSScanner *scanner; + NSCharacterSet *emptySet; + NSString *value = nil; + NSString *part; + int stringLength; + int location; + NSRange range; + + // Don't bother unless there's something to convert + range = [qString rangeOfString: @"<"]; + if( !range.length ) + return qString; + + scanner = [NSScanner scannerWithString: qString]; + emptySet = [NSCharacterSet characterSetWithCharactersInString: @""]; + [scanner setCharactersToBeSkipped: emptySet]; + + if( ![scanner scanUpToString: @"<" + intoString: &value] ) + { + value = [NSString string]; + } + + stringLength = [qString length]; + + while ( ![scanner isAtEnd] ) + { + [scanner scanString: @"<" + intoString: NULL]; + + [scanner scanCharactersFromSet: [NSCharacterSet whitespaceAndNewlineCharacterSet] + intoString: NULL]; + + while( ![scanner scanString: @">" + intoString: NULL]) + { + location = [scanner scanLocation]; + if( location+2 > stringLength ) + { + [NSException raise: NSPPDParseException + format: @"Badly formatted hexadecimal substring in \ + PPD printer file."]; + // NOT REACHED + } + value = [value stringByAppendingFormat: @"%c", + 16 * [self gethex: [qString characterAtIndex: location]] + + [self gethex: [qString characterAtIndex: location+1]]]; + + [scanner setScanLocation: location+2]; + + [scanner scanCharactersFromSet: [NSCharacterSet whitespaceAndNewlineCharacterSet] + intoString: NULL]; + } + + if([scanner scanUpToString:@"<" intoString:&part]) + { + value = [value stringByAppendingString: part]; + } + } + return value; +} + +// Convert a character to a value between 0 and 15 +-(int) gethex: (unichar) character +{ + switch (character) + { + case '0': return 0; + case '1': return 1; + case '2': return 2; + case '3': return 3; + case '4': return 4; + case '5': return 5; + case '6': return 6; + case '7': return 7; + case '8': return 8; + case '9': return 9; + case 'A': return 10; + case 'B': return 11; + case 'C': return 12; + case 'D': return 13; + case 'E': return 14; + case 'F': return 15; + case 'a': return 10; + case 'b': return 11; + case 'c': return 12; + case 'd': return 13; + case 'e': return 14; + case 'f': return 15; + } + [NSException + raise:NSPPDParseException + format:@"Badly formatted hexadeximal substring in PPD printer file."]; + + return 0; /* Quiet compiler warnings */ } @end diff --git a/config.make.in b/config.make.in index 7b7513455..1e08b3ddd 100644 --- a/config.make.in +++ b/config.make.in @@ -7,3 +7,9 @@ ADDITIONAL_LIB_DIRS += @ADDITIONAL_LIB_DIRS@ ADDITIONAL_DEPENDS = @LIBS@ BUILD_GSND=@BUILD_GSND@ + +GSCUPS_CFLAGS = @GSCUPS_CFLAGS@ +GSCUPS_LDFLAGS = @GSCUPS_LDFLAGS@ +GSCUPS_LIBS = @GSCUPS_LIBS@ +GSCUPS_DATADIR = @GSCUPS_DATADIR@ +BUILD_GSCUPS = @BUILD_GSCUPS@ diff --git a/configure b/configure index fbba41ad2..a09944d14 100755 --- a/configure +++ b/configure @@ -1,9 +1,8 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.57. +# Generated by GNU Autoconf 2.59. # -# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. +# Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## @@ -20,9 +19,10 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi +DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false @@ -41,7 +41,7 @@ for as_var in \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var @@ -218,16 +218,17 @@ rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else + test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS @@ -308,7 +309,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP BUILD_GSND GNUSTEP_GUI_VERSION GNUSTEP_GUI_MAJOR_VERSION GNUSTEP_GUI_MINOR_VERSION GNUSTEP_GUI_SUBMINOR_VERSION ADDITIONAL_LIB_DIRS ADDITIONAL_INCLUDE_DIRS LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP BUILD_GSND have_cups GSCUPS_CFLAGS GSCUPS_LDFLAGS GSCUPS_LIBS GSCUPS_DATADIR BUILD_GSCUPS GNUSTEP_GUI_VERSION GNUSTEP_GUI_MAJOR_VERSION GNUSTEP_GUI_MINOR_VERSION GNUSTEP_GUI_SUBMINOR_VERSION ADDITIONAL_LIB_DIRS ADDITIONAL_INCLUDE_DIRS LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -667,7 +668,7 @@ done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir + localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in @@ -707,10 +708,10 @@ if test -z "$srcdir"; then # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } @@ -802,9 +803,9 @@ _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -852,6 +853,7 @@ Optional Features: --disable-png Disable PNG support --disable-ungif Disable libungif-based GIF support --disable-gsnd Disable gsnd server + --disable-cups Disable cups printing support Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -911,12 +913,45 @@ case $srcdir in ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. @@ -927,13 +962,13 @@ ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then + test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi - cd $ac_popdir + cd "$ac_popdir" done fi @@ -941,8 +976,7 @@ test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -Free Software Foundation, Inc. +Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -954,7 +988,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.57. Invocation command line was +generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -1031,19 +1065,19 @@ do 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. + ac_must_keep_next=false # Got value, back to normal. else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. @@ -1077,12 +1111,12 @@ _ASBOX case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } @@ -1111,7 +1145,7 @@ _ASBOX for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi @@ -1130,7 +1164,7 @@ _ASBOX echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core core.* *.core && + rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 @@ -1210,7 +1244,7 @@ fi # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" @@ -1227,13 +1261,13 @@ echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. @@ -1756,7 +1790,6 @@ ac_compiler=`set X $ac_compile; echo $2` (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -1776,8 +1809,8 @@ ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:$LINENO: checking for C compiler default output" >&5 -echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 @@ -1797,23 +1830,23 @@ do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; + ;; conftest.$ac_ext ) - # This is the source file. - ;; + # This is the source file. + ;; [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; + # We found the default executable, but exeext='' is most + # certainly right. + break;; *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext - break;; + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; * ) - break;; + break;; esac done else @@ -1887,8 +1920,8 @@ for ac_file in conftest.exe conftest conftest.*; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; + export ac_cv_exeext + break;; * ) break;; esac done @@ -1913,7 +1946,6 @@ if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -1964,7 +1996,6 @@ if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -1984,11 +2015,20 @@ main () _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2001,7 +2041,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi @@ -2017,7 +2057,6 @@ if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2034,11 +2073,20 @@ main () _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2051,7 +2099,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 @@ -2078,7 +2126,6 @@ else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2106,6 +2153,16 @@ static char *f (char * (*g) (char **, int), char **p, ...) va_end (v); return s; } + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; @@ -2132,11 +2189,20 @@ do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2149,7 +2215,7 @@ else sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -f conftest.$ac_objext +rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC @@ -2177,19 +2243,27 @@ cat >conftest.$ac_ext <<_ACEOF _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ - ''\ - '#include ' \ + '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ @@ -2197,14 +2271,13 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include $ac_declaration +#include int main () { @@ -2215,11 +2288,20 @@ exit (42); _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2232,9 +2314,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 continue fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2251,11 +2332,20 @@ exit (42); _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2267,7 +2357,7 @@ else sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then @@ -2281,7 +2371,7 @@ else sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2317,7 +2407,6 @@ do # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2328,7 +2417,7 @@ cat >>conftest.$ac_ext <<_ACEOF #else # include #endif - Syntax error + Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 @@ -2340,6 +2429,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2360,7 +2450,6 @@ rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2378,6 +2467,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2424,7 +2514,6 @@ do # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2435,7 +2524,7 @@ cat >>conftest.$ac_ext <<_ACEOF #else # include #endif - Syntax error + Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 @@ -2447,6 +2536,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2467,7 +2557,6 @@ rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2485,6 +2574,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2527,6 +2617,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for X" >&5 echo $ECHO_N "checking for X... $ECHO_C" >&6 +ac_path_x_has_been_run=yes # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -2561,8 +2652,8 @@ _ACEOF # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl; do if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && - test -f $ac_im_libdir/libX11.$ac_extension; then - ac_im_usrlibdir=$ac_im_libdir; break + test -f $ac_im_libdir/libX11.$ac_extension; then + ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are @@ -2619,10 +2710,9 @@ ac_x_header_dirs=' /usr/openwin/share/include' if test "$ac_x_includes" = no; then - # Guess where to find include files, by looking for Intrinsic.h. + # Guess where to find include files, by looking for a specified header file. # First, try using that file with no special directory specified. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2640,6 +2730,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2670,7 +2761,6 @@ if test "$ac_x_libraries" = no; then ac_save_LIBS=$LIBS LIBS="-lXt $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2687,11 +2777,20 @@ XtMalloc (0) _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2716,7 +2815,8 @@ do done done fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then @@ -2725,7 +2825,7 @@ if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then else # Record where we found X for the cache. ac_cv_have_x="have_x=yes \ - ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" + ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" fi fi @@ -2744,8 +2844,12 @@ else # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes \ ac_x_includes=$x_includes ac_x_libraries=$x_libraries" - echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 -echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6 + # It might be that x_includes is empty (headers are found in the + # standard search path. Then output the corresponding message + ac_out_x_includes=$x_includes + test "x$x_includes" = x && ac_out_x_includes="in standard search path" + echo "$as_me:$LINENO: result: libraries $x_libraries, headers $ac_out_x_includes" >&5 +echo "${ECHO_T}libraries $x_libraries, headers $ac_out_x_includes" >&6 fi # Added for checking the existence of ungif. Note that # -gui uses the API of the underlying window system ONLY IF @@ -3112,7 +3216,6 @@ if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3132,11 +3235,20 @@ main () _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3149,7 +3261,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi @@ -3165,7 +3277,6 @@ if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3182,11 +3293,20 @@ main () _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3199,7 +3319,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 @@ -3226,7 +3346,6 @@ else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3254,6 +3373,16 @@ static char *f (char * (*g) (char **, int), char **p, ...) va_end (v); return s; } + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; @@ -3280,11 +3409,20 @@ do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3297,7 +3435,7 @@ else sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -f conftest.$ac_objext +rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC @@ -3325,19 +3463,27 @@ cat >conftest.$ac_ext <<_ACEOF _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ - ''\ - '#include ' \ + '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ @@ -3345,14 +3491,13 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include $ac_declaration +#include int main () { @@ -3363,11 +3508,20 @@ exit (42); _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3380,9 +3534,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 continue fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3399,11 +3552,20 @@ exit (42); _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3415,7 +3577,7 @@ else sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then @@ -3429,7 +3591,7 @@ else sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3464,7 +3626,6 @@ do # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3475,7 +3636,7 @@ cat >>conftest.$ac_ext <<_ACEOF #else # include #endif - Syntax error + Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 @@ -3487,6 +3648,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -3507,7 +3669,6 @@ rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3525,6 +3686,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -3571,7 +3733,6 @@ do # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3582,7 +3743,7 @@ cat >>conftest.$ac_ext <<_ACEOF #else # include #endif - Syntax error + Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 @@ -3594,6 +3755,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -3614,7 +3776,6 @@ rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3632,6 +3793,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -3680,7 +3842,6 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3698,11 +3859,20 @@ main (); _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3715,7 +3885,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_m_main=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_m_main" >&5 @@ -3740,21 +3911,28 @@ if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ + #ifdef __STDC__ # include #else # include #endif + +#undef $ac_func + /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" @@ -3785,11 +3963,20 @@ return f != $ac_func; _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3802,7 +3989,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 @@ -3877,7 +4065,6 @@ if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3898,11 +4085,20 @@ main () _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3915,12 +4111,11 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3942,7 +4137,6 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3967,7 +4161,6 @@ if test $ac_cv_header_stdc = yes; then : else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3979,9 +4172,9 @@ cat >>conftest.$ac_ext <<_ACEOF # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif @@ -3992,7 +4185,7 @@ main () int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) + || toupper (i) != TOUPPER (i)) exit(2); exit (0); } @@ -4017,7 +4210,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi @@ -4042,7 +4235,7 @@ fi for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h + inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 @@ -4051,7 +4244,6 @@ if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -4063,11 +4255,20 @@ $ac_includes_default _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4080,7 +4281,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 @@ -4111,7 +4312,6 @@ else echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -4122,11 +4322,20 @@ $ac_includes_default _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4139,7 +4348,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 @@ -4147,7 +4356,6 @@ echo "${ECHO_T}$ac_header_compiler" >&6 echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -4165,6 +4373,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -4184,33 +4393,32 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) + no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 @@ -4221,7 +4429,7 @@ echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=$ac_header_preproc" + eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 @@ -4248,7 +4456,6 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ljpeg $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -4272,11 +4479,20 @@ jpeg_destroy_decompress (); _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4289,7 +4505,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_jpeg_jpeg_destroy_decompress=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_jpeg_jpeg_destroy_decompress" >&5 @@ -4360,7 +4577,6 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -4378,11 +4594,20 @@ main (); _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4395,7 +4620,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_main=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_z_main" >&5 @@ -4422,7 +4648,6 @@ else echo "$as_me:$LINENO: checking tiffio.h usability" >&5 echo $ECHO_N "checking tiffio.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -4433,11 +4658,20 @@ $ac_includes_default _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4450,7 +4684,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 @@ -4458,7 +4692,6 @@ echo "${ECHO_T}$ac_header_compiler" >&6 echo "$as_me:$LINENO: checking tiffio.h presence" >&5 echo $ECHO_N "checking tiffio.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -4476,6 +4709,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -4495,33 +4729,32 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: tiffio.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: tiffio.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: tiffio.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: tiffio.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + { echo "$as_me:$LINENO: WARNING: tiffio.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: tiffio.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) + no:yes:* ) { echo "$as_me:$LINENO: WARNING: tiffio.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: tiffio.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: tiffio.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: tiffio.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: tiffio.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: tiffio.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: tiffio.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: tiffio.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: tiffio.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: tiffio.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: tiffio.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: tiffio.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: tiffio.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: tiffio.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 @@ -4555,7 +4788,6 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ltiff $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -4579,11 +4811,20 @@ TIFFReadScanline (); _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4596,7 +4837,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_tiff_TIFFReadScanline=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_tiff_TIFFReadScanline" >&5 @@ -4652,7 +4894,6 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lpng $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -4676,11 +4917,20 @@ png_sig_cmp (); _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4693,7 +4943,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_png_png_sig_cmp=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_png_png_sig_cmp" >&5 @@ -4769,7 +5020,6 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lungif $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -4793,11 +5043,20 @@ DGifOpen (); _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4810,7 +5069,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ungif_DGifOpen=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_ungif_DGifOpen" >&5 @@ -4844,7 +5104,6 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lungif $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -4868,11 +5127,20 @@ DGifCloseFile (); _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4885,7 +5153,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ungif_DGifCloseFile=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_ungif_DGifCloseFile" >&5 @@ -4932,7 +5201,6 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-laspell $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -4956,11 +5224,20 @@ new_aspell_document_checker (); _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4973,7 +5250,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_aspell_new_aspell_document_checker=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_aspell_new_aspell_document_checker" >&5 @@ -5005,7 +5283,6 @@ else echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -5016,11 +5293,20 @@ $ac_includes_default _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5033,7 +5319,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 @@ -5041,7 +5327,6 @@ echo "${ECHO_T}$ac_header_compiler" >&6 echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -5059,6 +5344,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -5078,33 +5364,32 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) + no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 @@ -5115,7 +5400,7 @@ echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=$ac_header_preproc" + eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 @@ -5185,7 +5470,6 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-laudiofile $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -5209,11 +5493,20 @@ afGetVirtualFrameSize (); _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5226,7 +5519,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_audiofile_afGetVirtualFrameSize=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_audiofile_afGetVirtualFrameSize" >&5 @@ -5259,7 +5553,6 @@ else echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -5270,11 +5563,20 @@ $ac_includes_default _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5287,7 +5589,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 @@ -5295,7 +5597,6 @@ echo "${ECHO_T}$ac_header_compiler" >&6 echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -5313,6 +5614,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -5332,33 +5634,32 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) + no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 @@ -5369,7 +5670,7 @@ echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=$ac_header_preproc" + eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 @@ -5390,6 +5691,318 @@ done fi + +#-------------------------------------------------------------------- +# Find CUPS +#-------------------------------------------------------------------- +GSCUPS_CFLAGS= +GSCUPS_LDFLAGS= +GSCUPS_LIBS= +GSCUPS_DATADIR= +BUILD_GSCUPS=NO + +# Check whether --enable-cups or --disable-cups was given. +if test "${enable_cups+set}" = set; then + enableval="$enable_cups" + +else + enable_cups=yes +fi; + +if test $enable_cups = yes; then + BUILD_GSCUPS=YES + # Extract the first word of "cups-config", so it can be a program name with args. +set dummy cups-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_have_cups+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$have_cups"; then + ac_cv_prog_have_cups="$have_cups" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_have_cups="yes" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_have_cups" && ac_cv_prog_have_cups="no" +fi +fi +have_cups=$ac_cv_prog_have_cups +if test -n "$have_cups"; then + echo "$as_me:$LINENO: result: $have_cups" >&5 +echo "${ECHO_T}$have_cups" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + + if test $have_cups = no; then + echo "Could not find cups-config program, cups printing support will not be built." + enable_cups=no + BUILD_GSCUPS=NO + else + GSCUPS_CFLAGS=`cups-config --cflags` + GSCUPS_LDFLAGS=`cups-config --ldflags` + GSCUPS_LIBS=`cups-config --libs` + GSCUPS_DATADIR=`cups-config --datadir` + + orig_CPPFLAGS="${CPPFLAGS}" + orig_LDFLAGS="${LDFLAGS}" + CPPFLAGS="$GSCUPS_CFLAGS ${CPPFLAGS}" + LDFLAGS="$GSCUPS_LDFLAGS ${LDFLAGS}" + + +for ac_header in cups/cups.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + have_cups=yes +else + have_cups=no +fi + +done + + if test "$have_cups" = no; then + enable_cups=no + BUILD_GSCUPS=NO + echo "Could not find cups.h, cups printing support will not be built." + fi + echo "$as_me:$LINENO: checking for cupsServer in -lcups" >&5 +echo $ECHO_N "checking for cupsServer in -lcups... $ECHO_C" >&6 +if test "${ac_cv_lib_cups_cupsServer+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcups $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char cupsServer (); +int +main () +{ +cupsServer (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_cups_cupsServer=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_cups_cupsServer=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_cups_cupsServer" >&5 +echo "${ECHO_T}$ac_cv_lib_cups_cupsServer" >&6 +if test $ac_cv_lib_cups_cupsServer = yes; then + have_cups=yes +else + have_cups=no +fi + + if test "$have_cups" = no; then + enable_cups=no + BUILD_GSCUPS=NO + echo "Could not find the cups library, cups printing support will not be built." + fi + CPPFLAGS="${orig_CPPFLAGS}" + LDFLAGS="${orig_LDFLAGS}" + fi +fi + + + + + + #-------------------------------------------------------------------- # Record the version #-------------------------------------------------------------------- @@ -5447,13 +6060,13 @@ _ACEOF # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | @@ -5483,13 +6096,13 @@ test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ + ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; +s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; -s/^[^=]*=[ ]*$//; +s/^[^=]*=[ ]*$//; }' fi @@ -5500,7 +6113,7 @@ ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' @@ -5544,9 +6157,10 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi +DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false @@ -5565,7 +6179,7 @@ for as_var in \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var @@ -5744,16 +6358,17 @@ rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else + test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS @@ -5780,7 +6395,7 @@ _ASBOX cat >&5 <<_CSEOF This file was extended by $as_me, which was -generated by GNU Autoconf 2.57. Invocation command line was +generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -5824,9 +6439,9 @@ Usage: $0 [OPTIONS] [FILE]... -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] - instantiate the configuration file FILE + instantiate the configuration file FILE --header=FILE[:TEMPLATE] - instantiate the configuration header FILE + instantiate the configuration header FILE Configuration files: $config_files @@ -5840,11 +6455,10 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.57, +configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. +Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir @@ -6052,6 +6666,12 @@ s,@OBJEXT@,$OBJEXT,;t t s,@CPP@,$CPP,;t t s,@EGREP@,$EGREP,;t t s,@BUILD_GSND@,$BUILD_GSND,;t t +s,@have_cups@,$have_cups,;t t +s,@GSCUPS_CFLAGS@,$GSCUPS_CFLAGS,;t t +s,@GSCUPS_LDFLAGS@,$GSCUPS_LDFLAGS,;t t +s,@GSCUPS_LIBS@,$GSCUPS_LIBS,;t t +s,@GSCUPS_DATADIR@,$GSCUPS_DATADIR,;t t +s,@BUILD_GSCUPS@,$BUILD_GSCUPS,;t t s,@GNUSTEP_GUI_VERSION@,$GNUSTEP_GUI_VERSION,;t t s,@GNUSTEP_GUI_MAJOR_VERSION@,$GNUSTEP_GUI_MAJOR_VERSION,;t t s,@GNUSTEP_GUI_MINOR_VERSION@,$GNUSTEP_GUI_MINOR_VERSION,;t t @@ -6089,9 +6709,9 @@ _ACEOF (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end @@ -6109,21 +6729,21 @@ for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } @@ -6139,10 +6759,10 @@ echo X"$ac_file" | as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } @@ -6180,20 +6800,48 @@ case $srcdir in ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ @@ -6203,7 +6851,7 @@ echo "$as_me: creating $ac_file" >&6;} configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." + sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. @@ -6212,26 +6860,32 @@ echo "$as_me: creating $ac_file" >&6;} case $f in -) echo $tmp/stdin ;; [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } - echo $f;; + echo "$f";; *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } - fi;; + fi;; esac done` || { (exit 1); exit 1; } + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub @@ -6270,12 +6924,12 @@ cat >>$CONFIG_STATUS <<\_ACEOF # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='[ ].*$,\1#\2' +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' @@ -6284,11 +6938,11 @@ for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac @@ -6302,28 +6956,29 @@ echo "$as_me: creating $ac_file" >&6;} case $f in -) echo $tmp/stdin ;; [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } - echo $f;; + # Do quote $f, to prevent DOS paths from being IFS'd. + echo "$f";; *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } - fi;; + fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. - sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF @@ -6346,9 +7001,9 @@ s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times @@ -6362,13 +7017,13 @@ rm -f confdef2sed.sed # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >>conftest.undefs <<\_ACEOF -s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS -echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail @@ -6377,7 +7032,7 @@ do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. - echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS @@ -6404,7 +7059,7 @@ do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' - echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS @@ -6438,10 +7093,10 @@ echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } @@ -6457,10 +7112,10 @@ echo X"$ac_file" | as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } diff --git a/configure.ac b/configure.ac index f44482c6c..19996f6cc 100644 --- a/configure.ac +++ b/configure.ac @@ -294,6 +294,61 @@ if test $ac_cv_lib_audiofile_afGetVirtualFrameSize = yes -a $enable_gsnd = yes; fi AC_SUBST(BUILD_GSND) + +#-------------------------------------------------------------------- +# Find CUPS +#-------------------------------------------------------------------- +GSCUPS_CFLAGS= +GSCUPS_LDFLAGS= +GSCUPS_LIBS= +GSCUPS_DATADIR= +BUILD_GSCUPS=NO + +AC_ARG_ENABLE(cups, + [ --disable-cups Disable cups printing support],, + enable_cups=yes) + +if test $enable_cups = yes; then + BUILD_GSCUPS=YES + AC_CHECK_PROG(have_cups, cups-config, yes, no) + + if test $have_cups = no; then + echo "Could not find cups-config program, cups printing support will not be built." + enable_cups=no + BUILD_GSCUPS=NO + else + GSCUPS_CFLAGS=`cups-config --cflags` + GSCUPS_LDFLAGS=`cups-config --ldflags` + GSCUPS_LIBS=`cups-config --libs` + GSCUPS_DATADIR=`cups-config --datadir` + + orig_CPPFLAGS="${CPPFLAGS}" + orig_LDFLAGS="${LDFLAGS}" + CPPFLAGS="$GSCUPS_CFLAGS ${CPPFLAGS}" + LDFLAGS="$GSCUPS_LDFLAGS ${LDFLAGS}" + + AC_CHECK_HEADERS(cups/cups.h, have_cups=yes, have_cups=no) + if test "$have_cups" = no; then + enable_cups=no + BUILD_GSCUPS=NO + echo "Could not find cups.h, cups printing support will not be built." + fi + AC_CHECK_LIB(cups, cupsServer, have_cups=yes, have_cups=no) + if test "$have_cups" = no; then + enable_cups=no + BUILD_GSCUPS=NO + echo "Could not find the cups library, cups printing support will not be built." + fi + CPPFLAGS="${orig_CPPFLAGS}" + LDFLAGS="${orig_LDFLAGS}" + fi +fi +AC_SUBST(GSCUPS_CFLAGS) +AC_SUBST(GSCUPS_LDFLAGS) +AC_SUBST(GSCUPS_LIBS) +AC_SUBST(GSCUPS_DATADIR) +AC_SUBST(BUILD_GSCUPS) + #-------------------------------------------------------------------- # Record the version #--------------------------------------------------------------------