diff --git a/Documentation/NSDataLinkDelegateCallbacks.md b/Documentation/NSDataLinkDelegateCallbacks.md new file mode 100644 index 0000000000..f7223723eb --- /dev/null +++ b/Documentation/NSDataLinkDelegateCallbacks.md @@ -0,0 +1,197 @@ +# NSDataLink and NSDataLinkManager Delegate Callback Enhancements + +## Overview + +This update enhances NSDataLink and NSDataLinkManager with comprehensive delegate callbacks that provide fine-grained control over link management, updates, and visual feedback. + +## New Delegate Methods Implemented + +### Link Tracking Callbacks + +#### `dataLinkManager:startTrackingLink:` +- Called when a new link is added to the manager +- Triggered by `addLink:at:` and `addSourceLink:` methods +- Allows delegates to set up monitoring or UI elements for the link + +#### `dataLinkManager:stopTrackingLink:` +- Called when a link is removed or broken +- Triggered by `removeLink:`, `breakAllLinks`, and individual link breaks +- Allows delegates to clean up resources associated with the link + +### Update Management Callbacks + +#### `dataLinkManager:isUpdateNeededForLink:` +- Called to check if a link needs updating +- Used by file monitoring system and manual update checks +- Delegates can implement custom logic to determine update necessity +- Considers file modification times, user preferences, etc. + +#### `dataLinkManagerRedrawLinkOutlines:` +- Called when link outline visibility changes +- Triggered by `setLinkOutlinesVisible:` and `redrawLinkOutlines` +- Allows UI to refresh link visual indicators + +#### `dataLinkManagerTracksLinksIndividually:` +- Queries the delegate about tracking behavior +- Returns whether links should be monitored individually +- Affects performance and granularity of updates + +### Enhanced Document Status Callbacks + +#### `dataLinkManagerDidEditLinks:` +- Enhanced to be called during document editing and reverting +- Provides consistent notification of link changes + +#### `dataLinkManagerCloseDocument:` +- Called when document is closing +- Allows cleanup of delegate resources + +## New Public Methods + +### NSDataLinkManager + +#### `addSourceLink:` +- Convenience method for adding source links +- Includes proper delegate notifications +- Manages source link collection + +#### `removeLink:` +- Safely removes links from both source and destination collections +- Includes proper delegate notifications +- Ensures consistent cleanup + +#### `checkForLinkUpdates` +- Manually triggers update checking for all destination links +- Uses `isUpdateNeededForLink:` delegate callback +- Performs actual updates when needed + +#### `redrawLinkOutlines` +- Manually triggers outline redraw +- Calls `dataLinkManagerRedrawLinkOutlines:` delegate method + +#### `tracksLinksIndividually` +- Queries delegate about tracking preferences +- Returns boolean indicating tracking mode + +### Enhanced Document Management + +#### `noteDocumentSaved` +- Now updates all source link timestamps +- Triggers update checking for destination links +- Provides comprehensive save handling + +#### `noteDocumentSavedAs:` +- Updates internal filename reference +- Calls standard save handling +- Maintains link consistency across file operations + +#### `noteDocumentSavedTo:` +- Updates source link filenames when applicable +- Handles "Save As" scenarios properly +- Maintains link integrity + +## Enhanced NSDataLink Methods + +#### `updateDestination` +- Now consults delegate via `isUpdateNeededForLink:` +- Updates timestamp on successful update +- Provides better control over update process + +## File Monitoring Integration + +The file monitoring system now integrates with delegate callbacks: + +- File change detection triggers `isUpdateNeededForLink:` +- Automatic updates respect delegate decisions +- Provides seamless integration between file system events and application logic + +## Usage Examples + +### Basic Delegate Implementation + +```objectivec +@interface MyDelegate : NSObject +@end + +@implementation MyDelegate + +- (void)dataLinkManager:(NSDataLinkManager *)sender + startTrackingLink:(NSDataLink *)link +{ + // Set up UI elements, start monitoring, etc. + [self addLinkToUI: link]; +} + +- (BOOL)dataLinkManager:(NSDataLinkManager *)sender + isUpdateNeededForLink:(NSDataLink *)link +{ + // Custom update logic + return [self shouldUpdateLink: link]; +} + +- (void)dataLinkManagerRedrawLinkOutlines:(NSDataLinkManager *)sender +{ + // Refresh visual indicators + [self refreshLinkOutlines]; +} + +@end +``` + +### Integration with Applications + +```objectivec +// Initialize with delegate +MyDelegate *delegate = [[MyDelegate alloc] init]; +NSDataLinkManager *manager = [[NSDataLinkManager alloc] + initWithDelegate: delegate]; + +// Add links with automatic delegate notification +NSDataLink *link = [[NSDataLink alloc] initLinkedToFile: @"source.txt"]; +[manager addSourceLink: link]; // Triggers startTrackingLink: + +// Manual update checking +[manager checkForLinkUpdates]; // Uses isUpdateNeededForLink: + +// Visual management +[manager setLinkOutlinesVisible: YES]; // Triggers redraw callback +``` + +## Benefits + +1. **Fine-grained Control**: Delegates have complete control over link lifecycle +2. **Performance Optimization**: Custom update logic prevents unnecessary operations +3. **UI Integration**: Comprehensive callbacks for visual feedback +4. **Resource Management**: Proper cleanup notifications prevent leaks +5. **Consistency**: All link operations now provide delegate notifications +6. **Flexibility**: Delegates can implement custom policies for updates and tracking + +## Backward Compatibility + +All enhancements maintain full backward compatibility with existing code. Applications not implementing the new delegate methods will continue to work with default behaviors. + +## Implementation Details + +### Files Modified + +- **NSDataLinkManager.h**: Added new method declarations +- **NSDataLinkManager.m**: Implemented all delegate callback integration +- **NSDataLink.m**: Enhanced `updateDestination` method with delegate consultation + +### Key Changes + +1. All link addition/removal methods now call appropriate tracking delegates +2. File monitoring system integrates with `isUpdateNeededForLink:` callback +3. Document save operations trigger comprehensive link updates +4. Outline visibility changes trigger redraw callbacks +5. Enhanced error handling and resource cleanup + +### Testing + +The implementation includes a comprehensive example (`NSDataLinkExample.m`) that demonstrates: + +- Delegate method implementation +- Link lifecycle management +- Update checking integration +- Visual feedback handling +- Resource cleanup diff --git a/Examples/NSDataLinkExample.m b/Examples/NSDataLinkExample.m new file mode 100644 index 0000000000..39fe1fd68b --- /dev/null +++ b/Examples/NSDataLinkExample.m @@ -0,0 +1,166 @@ +/** + * Example demonstrating NSDataLink delegate callbacks + * + * This example shows how to implement the NSDataLinkManager delegate methods + * to handle link tracking, updates, and outline drawing. + */ + +#import +#import "AppKit/NSDataLinkManager.h" +#import "AppKit/NSDataLink.h" +#import "AppKit/NSSelection.h" +#import "AppKit/NSPasteboard.h" + +@interface DataLinkDelegate : NSObject +{ + NSMutableArray *_trackedLinks; +} +@end + +@implementation DataLinkDelegate + +- (id) init +{ + if ((self = [super init])) + { + _trackedLinks = [[NSMutableArray alloc] init]; + } + return self; +} + +- (void) dealloc +{ + [_trackedLinks release]; + [super dealloc]; +} + +// Required delegate methods for link management +- (void)dataLinkManager: (NSDataLinkManager *)sender + startTrackingLink: (NSDataLink *)link +{ + NSLog(@"Started tracking link #%d", [link linkNumber]); + [_trackedLinks addObject: link]; +} + +- (void)dataLinkManager: (NSDataLinkManager *)sender + stopTrackingLink: (NSDataLink *)link +{ + NSLog(@"Stopped tracking link #%d", [link linkNumber]); + [_trackedLinks removeObject: link]; +} + +- (void)dataLinkManager: (NSDataLinkManager *)sender + didBreakLink: (NSDataLink *)link +{ + NSLog(@"Link #%d was broken", [link linkNumber]); + [_trackedLinks removeObject: link]; +} + +- (BOOL)dataLinkManager: (NSDataLinkManager *)sender + isUpdateNeededForLink: (NSDataLink *)link +{ + // Check if the source has been modified since last update + NSDate *lastUpdate = [link lastUpdateTime]; + NSString *sourceFile = [link sourceFilename]; + + if (sourceFile) + { + NSDictionary *attrs = [[NSFileManager defaultManager] + attributesOfItemAtPath: sourceFile error: nil]; + NSDate *modDate = [attrs objectForKey: NSFileModificationDate]; + + if (modDate && lastUpdate && [modDate compare: lastUpdate] == NSOrderedDescending) + { + NSLog(@"Update needed for link #%d - source modified", [link linkNumber]); + return YES; + } + } + + return NO; +} + +- (void)dataLinkManagerDidEditLinks: (NSDataLinkManager *)sender +{ + NSLog(@"Document links were edited"); +} + +- (void)dataLinkManagerRedrawLinkOutlines: (NSDataLinkManager *)sender +{ + NSLog(@"Should redraw link outlines (visibility: %s)", + [sender areLinkOutlinesVisible] ? "visible" : "hidden"); +} + +- (BOOL)dataLinkManagerTracksLinksIndividually: (NSDataLinkManager *)sender +{ + NSLog(@"Using individual link tracking"); + return YES; // Enable individual tracking +} + +- (void)dataLinkManagerCloseDocument: (NSDataLinkManager *)sender +{ + NSLog(@"Document is closing, cleaning up %lu tracked links", + (unsigned long)[_trackedLinks count]); +} + +// Optional selection management methods +- (BOOL)copyToPasteboard: (NSPasteboard *)pasteboard + at: (NSSelection *)selection + cheapCopyAllowed: (BOOL)flag +{ + NSLog(@"Copy to pasteboard requested for selection"); + return YES; +} + +- (BOOL)showSelection: (NSSelection *)selection +{ + NSLog(@"Show selection requested"); + return YES; +} + +@end + +// Example usage +int main(int argc, char *argv[]) +{ + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + DataLinkDelegate *delegate = [[DataLinkDelegate alloc] init]; + NSDataLinkManager *manager = [[NSDataLinkManager alloc] + initWithDelegate: delegate]; + + // Create a test link + NSDataLink *link = [[NSDataLink alloc] initLinkedToFile: @"/tmp/test.txt"]; + + // Add the link - this will trigger startTrackingLink delegate callback + NSLog(@"Adding link..."); + [manager addSourceLink: link]; + + // Test update checking + NSLog(@"Checking for updates..."); + [manager checkForLinkUpdates]; + + // Test outline visibility changes + NSLog(@"Setting outline visibility..."); + [manager setLinkOutlinesVisible: YES]; + [manager setLinkOutlinesVisible: NO]; + + // Test manual redraw + NSLog(@"Manual redraw..."); + [manager redrawLinkOutlines]; + + // Test tracking mode + NSLog(@"Individual tracking: %s", + [manager tracksLinksIndividually] ? "YES" : "NO"); + + // Remove the link - this will trigger stopTrackingLink delegate callback + NSLog(@"Removing link..."); + [manager removeLink: link]; + + // Cleanup + [link release]; + [manager release]; + [delegate release]; + [pool release]; + + return 0; +} diff --git a/Headers/Additions/GNUstepGUI/config.h.in b/Headers/Additions/GNUstepGUI/config.h.in index 64f2cbcab1..e9e30c6d45 100644 --- a/Headers/Additions/GNUstepGUI/config.h.in +++ b/Headers/Additions/GNUstepGUI/config.h.in @@ -175,6 +175,8 @@ /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS +/* Do we have inotify */ +#undef HAVE_INOTIFY_H /* Define for those who don't have rintf and/or rint */ #ifndef HAVE_RINTF diff --git a/Headers/AppKit/NSDataLink.h b/Headers/AppKit/NSDataLink.h index 89fc47d73d..e776c66467 100644 --- a/Headers/AppKit/NSDataLink.h +++ b/Headers/AppKit/NSDataLink.h @@ -1,4 +1,4 @@ -/* +/* NSDataLink.h Link between a source and dependent document @@ -7,7 +7,7 @@ Author: Scott Christley Date: 1996 - + This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or @@ -22,15 +22,15 @@ You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. - If not, see or write to the - Free Software Foundation, 51 Franklin Street, Fifth Floor, + If not, see or write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ +*/ #ifndef _GNUstep_H_NSDataLink #define _GNUstep_H_NSDataLink -#import +#import #import @class NSString; @@ -46,7 +46,7 @@ typedef int NSDataLinkNumber; typedef enum _NSDataLinkDisposition { NSLinkInDestination, NSLinkInSource, - NSLinkBroken + NSLinkBroken } NSDataLinkDisposition; typedef enum _NSDataLinkUpdateMode { @@ -64,25 +64,25 @@ APPKIT_EXPORT_CLASS // Attributes @private // link info. - NSDataLinkNumber linkNumber; - NSDataLinkDisposition disposition; - NSDataLinkUpdateMode updateMode; + NSDataLinkNumber _linkNumber; + NSDataLinkDisposition _disposition; + NSDataLinkUpdateMode _updateMode; // info about the source. - NSDate *lastUpdateTime; - NSString *sourceApplicationName; - NSString *sourceFilename; - NSSelection *sourceSelection; - id sourceManager; + NSDate *_lastUpdateTime; + NSString *_sourceApplicationName; + NSString *_sourceFilename; + NSSelection *_sourceSelection; + id _sourceManager; // info about the destination - NSString *destinationApplicationName; - NSString *destinationFilename; - NSSelection *destinationSelection; - id destinationManager; - + NSString *_destinationApplicationName; + NSString *_destinationFilename; + NSSelection *_destinationSelection; + id _destinationManager; + // types. - NSArray *types; + NSArray *_types; // other flags struct __linkFlags { @@ -99,51 +99,168 @@ APPKIT_EXPORT_CLASS // // Initializing a Link // + +/** Initializes a data link connected to a file. + * Creates a new NSDataLink object that references the specified file. + * The link will monitor the file for changes and can update dependent + * documents when the source file is modified. + */ - (id)initLinkedToFile:(NSString *)filename; + +/** Initializes a data link with a source selection managed by a link manager. + * Creates a new NSDataLink that represents a selection within a document + * managed by the specified NSDataLinkManager. This is typically used for + * creating links between different parts of the same application. + */ - (id)initLinkedToSourceSelection:(NSSelection *)selection managedBy:(NSDataLinkManager *)linkManager supportingTypes:(NSArray *)newTypes; + +/** Initializes a data link from a saved file. + * Reconstructs a data link from a previously saved link file. + * The file should contain archived link data created by writeToFile. + */ - (id)initWithContentsOfFile:(NSString *)filename; + +/** Initializes a data link from pasteboard data. + * Creates a data link from link data stored on the pasteboard. + * This is typically used when pasting linked data. + */ - (id)initWithPasteboard:(NSPasteboard *)pasteboard; // // Exporting a Link // + +/** Saves the link to a directory. + * Writes the link data to a file in the specified directory. + * The filename is automatically generated based on the link number. + */ - (BOOL)saveLinkIn:(NSString *)directoryName; + +/** Writes the link data to a specific file. + * Archives the complete link data to the specified file path. + * The saved file can later be used with initWithContentsOfFile. + */ - (BOOL)writeToFile:(NSString *)filename; + +/** Writes link data to the pasteboard. + * Puts the link data onto the pasteboard so it can be pasted + * into other documents or applications. + */ - (void)writeToPasteboard:(NSPasteboard *)pasteboard; // // Information about the Link // + +/** Returns the current disposition of the link. + * The disposition indicates whether the link exists in the source + * document, destination document, or is broken. + */ - (NSDataLinkDisposition)disposition; + +/** Returns the unique number identifying this link. + * Each link has a unique number assigned by its manager. + * This number is used for tracking and identification purposes. + */ - (NSDataLinkNumber)linkNumber; + +/** Returns the link manager responsible for this link. + * The manager handles link updates, monitoring, and lifecycle management. + */ - (NSDataLinkManager *)manager; // // Information about the Link's Source // + +/** Returns the last time the source was updated. + * This timestamp indicates when the source data was last modified. + * It's used to determine if destination links need updating. + */ - (NSDate *)lastUpdateTime; + +/** Opens the source document or application. + * Attempts to open the source document in its associated application. + * This allows users to edit the source data directly. + */ - (BOOL)openSource; + +/** Returns the name of the source application. + * Identifies which application created or manages the source data. + */ - (NSString *)sourceApplicationName; + +/** Returns the filename of the source data. + * For file-based links, this returns the path to the source file. + */ - (NSString *)sourceFilename; + +/** Returns the selection within the source document. + * For document-based links, this identifies the specific portion + * of the source document that is linked. + */ - (NSSelection *)sourceSelection; + +/** Returns the array of supported data types. + * Lists the pasteboard types that this link can provide. + * Used during copy/paste operations to determine compatibility. + */ - (NSArray *)types; // // Information about the Link's Destination // + +/** Returns the name of the destination application. + * Identifies which application contains the destination document. + */ - (NSString *)destinationApplicationName; + +/** Returns the filename of the destination document. + * For file-based destinations, this returns the path to the destination file. + */ - (NSString *)destinationFilename; + +/** Returns the selection within the destination document. + * Identifies where the linked data appears in the destination document. + */ - (NSSelection *)destinationSelection; // // Changing the Link // + +/** Breaks the data link connection. + * Permanently severs the connection between source and destination. + * Once broken, the link cannot be restored and will no longer update. + * Notifies both source and destination managers via delegate callbacks. + */ - (BOOL)break; + +/** Notifies the link that its source has been edited. + * Call this method when the source data has been modified. + * This marks the link as dirty and may trigger update checks + * depending on the current update mode. + */ - (void)noteSourceEdited; + +/** Sets when the link should update its destination. + * Controls the automatic update behavior of the link. + */ - (void)setUpdateMode:(NSDataLinkUpdateMode)mode; + +/** Updates the destination with current source data. + * Attempts to update the destination with the latest source data. + * Consults the destination manager's delegate to determine if update + * is needed and handles the actual data transfer. + */ - (BOOL)updateDestination; + +/** Returns the current update mode. + * Indicates when this link will automatically update its destination. + */ - (NSDataLinkUpdateMode)updateMode; @end diff --git a/Headers/AppKit/NSDataLinkManager.h b/Headers/AppKit/NSDataLinkManager.h index 0712cb5b9c..fb0ec0bce3 100644 --- a/Headers/AppKit/NSDataLinkManager.h +++ b/Headers/AppKit/NSDataLinkManager.h @@ -1,4 +1,4 @@ -/* +/* NSDataLinkManager.h Manager of a NSDataLink @@ -7,7 +7,7 @@ Author: Scott Christley Date: 1996 - + This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or @@ -22,33 +22,38 @@ You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. - If not, see or write to the - Free Software Foundation, 51 Franklin Street, Fifth Floor, + If not, see or write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ +*/ #ifndef _GNUstep_H_NSDataLinkManager #define _GNUstep_H_NSDataLinkManager -#import #import +#import +#import -@class NSString; @class NSEnumerator; @class NSMutableArray; -@class NSDataLink; -@class NSSelection; @class NSPasteboard; +@class NSString; +@class NSSelection; +@class NSThread; @class NSWindow; APPKIT_EXPORT_CLASS @interface NSDataLinkManager : NSObject { // Attributes - id delegate; - NSString *filename; - NSMutableArray *sourceLinks; - NSMutableArray *destinationLinks; + id _delegate; + NSString *_filename; + NSMutableArray *_sourceLinks; + NSMutableArray *_destinationLinks; + NSDataLinkNumber _nextLinkNumber; + NSThread *_monitorThread; + int _inotifyFD; + NSMutableDictionary *_watchDescriptors; struct __dlmFlags { unsigned areLinkOutlinesVisible:1; @@ -56,58 +61,230 @@ APPKIT_EXPORT_CLASS unsigned interactsWithUser:1; unsigned isEdited:1; } _flags; - } // // Initializing and Freeing a Link Manager // -- (id)initWithDelegate:(id)anObject; -- (id)initWithDelegate:(id)anObject - fromFile:(NSString *)path; + +/** Initializes a link manager with a delegate. + * Creates a new NSDataLinkManager with the specified delegate. + * The delegate will receive callbacks for link management events. + */ +- (id) initWithDelegate: (id)anObject; + +/** Initializes a link manager with a delegate and associates it with a file. + * Creates a new NSDataLinkManager with the specified delegate and + * associates it with a particular file. This is typically used when + * the manager represents links within a specific document. + */ +- (id) initWithDelegate: (id)anObject + fromFile: (NSString *)path; // // Adding and Removing Links // -- (BOOL)addLink:(NSDataLink *)link - at:(NSSelection *)selection; -- (BOOL)addLinkAsMarker:(NSDataLink *)link - at:(NSSelection *)selection; -- (NSDataLink *)addLinkPreviouslyAt:(NSSelection *)oldSelection - fromPasteboard:(NSPasteboard *)pasteboard - at:(NSSelection *)selection; + +/** Adds a destination link at the specified selection. + * Registers a new data link as a destination within this manager. + * The link will be positioned at the given selection and the manager + * will monitor it for updates. Triggers startTrackingLink delegate callback. + */ +- (BOOL)addLink: (NSDataLink *)link + at: (NSSelection *)selection; + +/** Adds a source link to this manager. + * Registers a new data link as a source within this manager. + * The manager will monitor the source for changes and can provide + * data to destination links. Triggers startTrackingLink delegate callback. + */ +- (BOOL)addSourceLink: (NSDataLink *)link; + +/** Adds a link as a marker at the specified selection. + * Adds a data link that serves only as a position marker. + * Marker links don't transfer data but can be useful for UI purposes. + */ +- (BOOL)addLinkAsMarker: (NSDataLink *)link + at: (NSSelection *)selection; + +/** Recreates a link that was previously at another location. + * Used when moving or copying links between documents. + * Attempts to restore a link from pasteboard data. + */ +- (NSDataLink *)addLinkPreviouslyAt: (NSSelection *)oldSelection + fromPasteboard: (NSPasteboard *)pasteboard + at: (NSSelection *)selection; + +/** Removes a specific link from this manager. + * Removes the specified link from both source and destination collections. + * Triggers stopTrackingLink delegate callback for proper cleanup. + */ +- (void)removeLink: (NSDataLink *)link; + +/** Breaks all links managed by this manager. + * Permanently breaks all source and destination links. + * Each link will be broken individually and delegate callbacks + * will be triggered for each one. + */ - (void)breakAllLinks; -- (void)writeLinksToPasteboard:(NSPasteboard *)pasteboard; + +/** Writes all source links to the pasteboard. + * Puts data for all source links onto the pasteboard, + * allowing them to be pasted into other documents. + */ +- (void)writeLinksToPasteboard: (NSPasteboard *)pasteboard; // // Informing the Link Manager of Document Status // + +/** Notifies the manager that its document is closing. + * Call this when the document associated with this manager is being closed. + * Triggers the dataLinkManagerCloseDocument delegate callback. + */ - (void)noteDocumentClosed; + +/** Notifies the manager that its document has been edited. + * Call this when the document has been modified. + * Triggers the dataLinkManagerDidEditLinks delegate callback. + */ - (void)noteDocumentEdited; + +/** Notifies the manager that its document has been reverted. + * Call this when the document has been reverted to a saved state. + * Triggers the dataLinkManagerDidEditLinks delegate callback. + */ - (void)noteDocumentReverted; + +/** Notifies the manager that its document has been saved. + * Updates timestamps for all source links and triggers update + * checking for destination links. This ensures links stay synchronized + * with saved document state. + */ - (void)noteDocumentSaved; -- (void)noteDocumentSavedAs:(NSString *)path; -- (void)noteDocumentSavedTo:(NSString *)path; + +/** Notifies the manager that its document has been saved with a new name. + * Updates the internal filename reference and performs standard save processing. + * This maintains link integrity when documents are renamed. + */ +- (void)noteDocumentSavedAs: (NSString *)path; + +/** Notifies the manager that its document has been saved to a different location. + * Updates source link filenames when applicable for "Save As" operations. + * This ensures links continue to reference the correct files. + */ +- (void)noteDocumentSavedTo: (NSString *)path; // // Getting and Setting Information about the Link Manager // + +// +// Manager Information +// + +/** Returns the delegate object for this manager. + * The delegate handles link tracking, updates, and user interactions. + * Returns nil if no delegate is set. + */ - (id)delegate; + +/** Returns whether the delegate verifies links before processing. + * When YES, the delegate will be asked to verify each link operation. + * This provides additional control over link management. + */ - (BOOL)delegateVerifiesLinks; + +/** Returns the filename of the document managed by this instance. + * This is the file path used for link resolution and document identification. + * Returns nil if no filename is set. + */ - (NSString *)filename; + +/** Returns whether the manager interacts with users during operations. + * When YES, the manager may display dialogs or request user input. + * When NO, operations proceed automatically without user interaction. + */ - (BOOL)interactsWithUser; + +/** Returns whether the managed document has been edited. + * This flag tracks modification state for proper link updating. + * Used to determine when links need timestamp updates. + */ - (BOOL)isEdited; -- (void)setDelegateVerifiesLinks:(BOOL)flag; -- (void)setInteractsWithUser:(BOOL)flag; + +/** Sets whether the delegate verifies links before processing. + * Pass YES to enable delegate verification of link operations. + * Pass NO to allow automatic processing without delegate verification. + */ +- (void)setDelegateVerifiesLinks: (BOOL)flag; + +/** Sets whether the manager interacts with users during operations. + * Pass YES to enable user interaction dialogs and prompts. + * Pass NO to operate silently without user interruption. + */ +- (void)setInteractsWithUser: (BOOL)flag; // // Getting and Setting Information about the Manager's Links // + +// +// Link Management and Information +// + +/** Returns whether link outlines are currently visible. + * Link outlines provide visual feedback about data link locations. + * Returns YES if outlines are drawn, NO if they are hidden. + */ - (BOOL)areLinkOutlinesVisible; + +/** Returns an enumerator for all destination links in this document. + * Destination links are data links that receive updates from source links. + * Use this to iterate through all incoming data connections. + */ - (NSEnumerator *)destinationLinkEnumerator; -- (NSDataLink *)destinationLinkWithSelection:(NSSelection *)destSel; -- (void)setLinkOutlinesVisible:(BOOL)flag; + +/** Returns the destination link that contains the specified selection. + * Searches through destination links to find one matching the selection. + * Returns nil if no destination link matches the selection. + */ +- (NSDataLink *)destinationLinkWithSelection: (NSSelection *)destSel; + +/** Sets whether link outlines are visible in the document. + * Pass YES to show visual outlines around data links. + * Pass NO to hide link outlines for cleaner display. + */ +- (void)setLinkOutlinesVisible: (BOOL)flag; + +/** Returns an enumerator for all source links in this document. + * Source links are data links that provide data to other documents. + * Use this to iterate through all outgoing data connections. + */ - (NSEnumerator *)sourceLinkEnumerator; + +// +// Link Update Management +// + +/** Manually checks all destination links for needed updates. + * Iterates through all destination links and consults the delegate + * via isUpdateNeededForLink to determine which links need updating. + * Performs updates for links that need them. + */ +- (void)checkForLinkUpdates; + +/** Manually triggers redrawing of link outlines. + * Calls the dataLinkManagerRedrawLinkOutlines delegate method + * to request that visual link indicators be refreshed. + */ +- (void)redrawLinkOutlines; + +/** Returns whether links are tracked individually. + * Queries the delegate via dataLinkManagerTracksLinksIndividually + * to determine the current tracking mode. + */ +- (BOOL)tracksLinksIndividually; @end @@ -115,37 +292,114 @@ APPKIT_EXPORT_CLASS // Methods Implemented by the Delegate // @interface NSObject (NSDataLinkManagerDelegate) -// data link management methods. -- (void)dataLinkManager:(NSDataLinkManager *)sender - didBreakLink:(NSDataLink *)link; -- (BOOL)dataLinkManager:(NSDataLinkManager *)sender - isUpdateNeededForLink:(NSDataLink *)link; -- (void)dataLinkManager:(NSDataLinkManager *)sender - startTrackingLink:(NSDataLink *)link; -- (void)dataLinkManager:(NSDataLinkManager *)sender - stopTrackingLink:(NSDataLink *)link; -- (void)dataLinkManagerCloseDocument:(NSDataLinkManager *)sender; -- (void)dataLinkManagerDidEditLinks:(NSDataLinkManager *)sender; -- (void)dataLinkManagerRedrawLinkOutlines:(NSDataLinkManager *)sender; -- (BOOL)dataLinkManagerTracksLinksIndividually:(NSDataLinkManager *)sender; - -// selection management methods. -- (BOOL)copyToPasteboard:(NSPasteboard *)pasteboard - at:(NSSelection *)selection - cheapCopyAllowed:(BOOL)flag; -- (BOOL)importFile:(NSString *)filename - at:(NSSelection *)selection; -- (BOOL)pasteFromPasteboard:(NSPasteboard *)pasteboard - at:(NSSelection *)selection; -- (BOOL)showSelection:(NSSelection *)selection; -- (NSWindow *)windowForSelection:(NSSelection *)selection; + +// Data link management methods + +/** Called when a data link has been broken. + * Notifies the delegate that a link connection has been permanently + * severed and will no longer provide updates. + */ +- (void)dataLinkManager: (NSDataLinkManager *)sender + didBreakLink: (NSDataLink *)link; + +/** Called to determine if a link needs updating. + * The delegate should return YES if the link's destination should + * be updated with current source data. This is called during file + * monitoring and manual update checks. + */ +- (BOOL)dataLinkManager: (NSDataLinkManager *)sender + isUpdateNeededForLink: (NSDataLink *)link; + +/** Called when the manager starts tracking a new link. + * Notifies the delegate that a new link has been added and + * the manager is now monitoring it for changes. + */ +- (void)dataLinkManager: (NSDataLinkManager *)sender + startTrackingLink: (NSDataLink *)link; + +/** Called when the manager stops tracking a link. + * Notifies the delegate that a link has been removed and + * is no longer being monitored. Use this for cleanup operations. + */ +- (void)dataLinkManager: (NSDataLinkManager *)sender + stopTrackingLink: (NSDataLink *)link; + +/** Called when the document associated with the manager is closing. + * Gives the delegate a chance to perform cleanup operations + * before the document is closed. + */ +- (void)dataLinkManagerCloseDocument: (NSDataLinkManager *)sender; + +/** Called when the document's links have been modified. + * Notifies the delegate that links have been added, removed, + * or otherwise changed in the document. + */ +- (void)dataLinkManagerDidEditLinks: (NSDataLinkManager *)sender; + +/** Called when link outlines should be redrawn. + * Requests that the delegate refresh visual indicators + * around linked data in the document. + */ +- (void)dataLinkManagerRedrawLinkOutlines: (NSDataLinkManager *)sender; + +/** Called to determine the link tracking mode. + * The delegate should return YES if links should be tracked + * individually, or NO for batch tracking operations. + */ +- (BOOL)dataLinkManagerTracksLinksIndividually: (NSDataLinkManager *)sender; + +// Selection management methods + +/** Called to copy data to the pasteboard. + * The delegate should copy the data at the specified selection + * to the pasteboard. Used during link operations and copy/paste. + */ +- (BOOL)copyToPasteboard: (NSPasteboard *)pasteboard + at: (NSSelection *)selection + cheapCopyAllowed: (BOOL)flag; + +/** Called to import a file at the specified selection. + * The delegate should import the contents of the specified file + * into the document at the given selection location. + */ +- (BOOL)importFile: (NSString *)filename + at: (NSSelection *)selection; + +/** Called to paste data from the pasteboard. + * The delegate should paste the data from the pasteboard + * into the document at the specified selection location. + */ +- (BOOL)pasteFromPasteboard: (NSPasteboard *)pasteboard + at: (NSSelection *)selection; + +/** Called to show or highlight a selection. + * The delegate should make the specified selection visible + * and highlighted in the document view. + */ +- (BOOL)showSelection: (NSSelection *)selection; + +/** Called to get the window containing a selection. + * The delegate should return the window that contains + * the specified selection. + */ +- (NSWindow *)windowForSelection: (NSSelection *)selection; @end // // Draw a Distinctive Outline around Linked Data // + +/** Draws a distinctive frame around linked data. + * Utility function to draw visual indicators around linked content. + * The frame style differs depending on whether the data is a source or destination. + */ void NSFrameLinkRect(NSRect aRect, BOOL isDestination); + +/** Returns the thickness of link frame outlines. + * Utility function that returns the standard thickness used + * for drawing link outline frames. + */ float NSLinkFrameThickness(void); #endif // _GNUstep_H_NSDataLinkManager diff --git a/Headers/AppKit/NSDataLinkPanel.h b/Headers/AppKit/NSDataLinkPanel.h index 6a8cd079fe..23ffb127da 100644 --- a/Headers/AppKit/NSDataLinkPanel.h +++ b/Headers/AppKit/NSDataLinkPanel.h @@ -1,4 +1,4 @@ -/* +/* NSDataLinkPanel.h Standard panel for inspecting data links @@ -7,7 +7,7 @@ Author: Scott Christley Date: 1996 - + This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or @@ -22,10 +22,10 @@ You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. - If not, see or write to the - Free Software Foundation, 51 Franklin Street, Fifth Floor, + If not, see or write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ +*/ #ifndef _GNUstep_H_NSDataLinkPanel #define _GNUstep_H_NSDataLinkPanel @@ -64,20 +64,45 @@ APPKIT_EXPORT_CLASS // // Initializing // + +/** Returns the shared data link panel instance. + * Creates and returns the singleton NSDataLinkPanel instance. + * This panel is used throughout the application for managing data links. + */ + (NSDataLinkPanel *)sharedDataLinkPanel; // // Keeping the Panel Up to Date // + +/** Gets the current link and manager from the panel. + * Returns the currently selected data link and its manager. + * Also indicates whether multiple links are selected. + */ + (void)getLink:(NSDataLink **)link manager:(NSDataLinkManager **)linkManager isMultiple:(BOOL *)flag; + +/** Sets the current link and manager for the panel. + * Updates the panel to display information about the specified link. + * Pass YES for isMultiple when multiple links are selected. + */ + (void)setLink:(NSDataLink *)link manager:(NSDataLinkManager *)linkManager isMultiple:(BOOL)flag; + +/** Gets the current link and manager from the panel instance. + * Instance method version that returns the currently selected data link + * and its manager. Also indicates whether multiple links are selected. + */ - (void)getLink:(NSDataLink **)link manager:(NSDataLinkManager **)linkManager isMultiple:(BOOL *)flag; + +/** Sets the current link and manager for the panel instance. + * Instance method version that updates the panel to display information + * about the specified link. Pass YES for isMultiple when multiple links are selected. + */ - (void)setLink:(NSDataLink *)link manager:(NSDataLinkManager *)linkManager isMultiple:(BOOL)flag; @@ -85,16 +110,51 @@ APPKIT_EXPORT_CLASS // // Customizing the Panel // + +/** Returns the accessory view for the panel. + * The accessory view allows applications to add custom controls + * to the data link panel for application-specific functionality. + */ - (NSView *)accessoryView; + +/** Sets the accessory view for the panel. + * Applications can provide a custom view to extend the panel's + * functionality with application-specific controls and information. + */ - (void)setAccessoryView:(NSView *)aView; // // Responding to User Input // + +/** Handles the "Break All Links" button action. + * Called when the user clicks the button to break all data links + * in the current selection or document. Confirms the action with the user. + */ - (void)pickedBreakAllLinks:(id)sender; + +/** Handles the "Break Link" button action. + * Called when the user clicks the button to break the currently + * selected data link. Permanently severs the link connection. + */ - (void)pickedBreakLink:(id)sender; + +/** Handles the "Open Source" button action. + * Called when the user clicks the button to open the source document + * or application. Attempts to launch the appropriate application. + */ - (void)pickedOpenSource:(id)sender; + +/** Handles the "Update Destination" button action. + * Called when the user clicks the button to manually update the + * destination with current source data. + */ - (void)pickedUpdateDestination:(id)sender; + +/** Handles the update mode selection control. + * Called when the user changes the update mode setting for the + * current data link (continuous, on save, manual, or never). + */ - (void)pickedUpdateMode:(id)sender; @end diff --git a/Panels/English.lproj/GSDataLinkPanel.gorm/data.classes b/Panels/English.lproj/GSDataLinkPanel.gorm/data.classes index fa4cc4626c..bd10652aa6 100644 --- a/Panels/English.lproj/GSDataLinkPanel.gorm/data.classes +++ b/Panels/English.lproj/GSDataLinkPanel.gorm/data.classes @@ -1,144 +1,8 @@ { + "## Comment" = "Do NOT change this file, Gorm maintains it"; FirstResponder = { Actions = ( - "activateContextHelpMode:", - "alignCenter:", - "alignJustified:", - "alignLeft:", - "alignRight:", - "arrangeInFront:", - "cancel:", - "capitalizeWord:", - "changeColor:", - "changeFont:", - "checkSpelling:", - "close:", - "complete:", - "copy:", - "copyFont:", - "copyRuler:", - "cut:", - "delete:", - "deleteBackward:", - "deleteForward:", - "deleteToBeginningOfLine:", - "deleteToBeginningOfParagraph:", - "deleteToEndOfLine:", - "deleteToEndOfParagraph:", - "deleteToMark:", - "deleteWordBackward:", - "deleteWordForward:", - "deminiaturize:", - "deselectAll:", - "fax:", - "hide:", - "hideOtherApplications:", - "indent:", - "loosenKerning:", - "lowerBaseline:", - "lowercaseWord:", - "makeKeyAndOrderFront:", - "miniaturize:", - "miniaturizeAll:", - "moveBackward:", - "moveBackwardAndModifySelection:", - "moveDown:", - "moveDownAndModifySelection:", - "moveForward:", - "moveForwardAndModifySelection:", - "moveLeft:", - "moveRight:", - "moveToBeginningOfDocument:", - "moveToBeginningOfLine:", - "moveToBeginningOfParagraph:", - "moveToEndOfDocument:", - "moveToEndOfLine:", - "moveToEndOfParagraph:", - "moveUp:", - "moveUpAndModifySelection:", - "moveWordBackward:", - "moveWordBackwardAndModifySelection:", - "moveWordForward:", - "moveWordForwardAndModifySelection:", - "newDocument:", - "ok:", - "openDocument:", - "orderBack:", - "orderFront:", - "orderFrontColorPanel:", - "orderFrontDataLinkPanel:", - "orderFrontFontPanel:", - "orderFrontHelpPanel:", - "orderFrontStandardAboutPanel:", - "orderFrontStandardInfoPanel:", - "orderOut:", - "pageDown:", - "pageUp:", - "paste:", - "pasteAsPlainText:", - "pasteAsRichText:", - "pasteFont:", - "pasteRuler:", - "performClose:", - "performMiniaturize:", - "performZoom:", - "print:", - "raiseBaseline:", - "revertDocumentToSaved:", - "runPageLayout:", - "runToolbarCustomizationPalette:", - "saveAllDocuments:", - "saveDocument:", - "saveDocumentAs:", - "saveDocumentTo:", - "scrollLineDown:", - "scrollLineUp:", - "scrollPageDown:", - "scrollPageUp:", - "scrollViaScroller:", - "selectAll:", - "selectLine:", - "selectNextKeyView:", - "selectParagraph:", - "selectPreviousKeyView:", - "selectText:", - "selectText:", - "selectToMark:", - "selectWord:", - "showContextHelp:", - "showGuessPanel:", - "showHelp:", - "showWindow:", - "stop:", - "subscript:", - "superscript:", - "swapWithMark:", - "takeDoubleValueFrom:", - "takeFloatValueFrom:", - "takeIntValueFrom:", - "takeObjectValueFrom:", - "takeStringValueFrom:", - "terminate:", - "tightenKerning:", - "toggle:", - "toggleContinuousSpellChecking:", - "toggleRuler:", - "toggleToolbarShown:", - "toggleTraditionalCharacterShape:", - "transpose:", - "transposeWords:", - "turnOffKerning:", - "turnOffLigatures:", - "underline:", - "unhide:", - "unhideAllApplications:", - "unscript:", - "uppercaseWord:", - "useAllLigatures:", - "useStandardKerning:", - "useStandardLigatures:", - "yank:", - "zoom:" + "orderFrontFontPanel:" ); Super = NSObject; }; @@ -159,14 +23,14 @@ "pickedBreakAllLinks:" ); Outlets = ( - _updateModeButton, - _breakAllLinksButton, - _breakLinkButton, - _updateDestinationButton, - _openSourceButton, - _lastUpdateField, - _sourceField, - _updateView + "_updateModeButton", + "_breakAllLinksButton", + "_breakLinkButton", + "_updateDestinationButton", + "_openSourceButton", + "_lastUpdateField", + "_sourceField", + "_updateView" ); Super = NSPanel; }; diff --git a/Panels/English.lproj/GSDataLinkPanel.gorm/data.info b/Panels/English.lproj/GSDataLinkPanel.gorm/data.info index f80de56ac1..f888a11755 100644 Binary files a/Panels/English.lproj/GSDataLinkPanel.gorm/data.info and b/Panels/English.lproj/GSDataLinkPanel.gorm/data.info differ diff --git a/Panels/English.lproj/GSDataLinkPanel.gorm/objects.gorm b/Panels/English.lproj/GSDataLinkPanel.gorm/objects.gorm index a3aed09487..a1d7e05bf6 100644 Binary files a/Panels/English.lproj/GSDataLinkPanel.gorm/objects.gorm and b/Panels/English.lproj/GSDataLinkPanel.gorm/objects.gorm differ diff --git a/Source/NSDataLink.m b/Source/NSDataLink.m index 7084d94efd..a1db9927b5 100644 --- a/Source/NSDataLink.m +++ b/Source/NSDataLink.m @@ -6,7 +6,7 @@ Date: 2005 Author: Scott Christley Date: 1996 - + This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or @@ -21,15 +21,18 @@ You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. - If not, see or write to the - Free Software Foundation, 51 Franklin Street, Fifth Floor, + If not, see or write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ +*/ #include "config.h" + #import #import #import +#import + #import "AppKit/NSDataLink.h" #import "AppKit/NSDataLinkManager.h" #import "AppKit/NSPasteboard.h" @@ -38,10 +41,7 @@ @implementation NSDataLink -// -// Class methods -// -+ (void)initialize ++ (void) initialize { if (self == [NSDataLink class]) { @@ -50,171 +50,137 @@ + (void)initialize } } -// -// -// Instance methods -// -// Initializing a Link -// -- (id)initLinkedToFile:(NSString *)filename +- (id) initLinkedToFile: (NSString * )filename { - if ((self = [self init]) != nil) + if ((self = [super init])) { - NSData *data = [NSData dataWithBytes: [filename cString] length: [filename cStringLength]]; - NSSelection *selection = [NSSelection selectionWithDescriptionData: data]; - ASSIGN(sourceSelection, selection); + NSDictionary *dict = [[NSFileManager defaultManager] attributesOfItemAtPath:filename error:nil]; + + _sourceFilename = [filename copy]; + _disposition = NSLinkInSource; + _lastUpdateTime = [dict objectForKey: NSFileModificationDate]; + _updateMode = NSUpdateWhenSourceSaved; + _flags.broken = NO; } return self; } -- (id)initLinkedToSourceSelection:(NSSelection *)selection - managedBy:(NSDataLinkManager *)linkManager - supportingTypes:(NSArray *)newTypes +- (id) initLinkedToSourceSelection: (NSSelection *)selection + managedBy: (NSDataLinkManager *)linkManager + supportingTypes: (NSArray *)newTypes { - if ((self = [self init]) != nil) + if ((self = [super init])) { - ASSIGN(sourceSelection,selection); - ASSIGN(sourceManager,linkManager); - ASSIGN(types,newTypes); + _sourceSelection = [selection retain]; + _sourceManager = [linkManager retain]; + _types = [newTypes retain]; + _disposition = NSLinkInSource; + _updateMode = NSUpdateWhenSourceSaved; + _flags.broken = NO; } return self; } -- (id)initWithContentsOfFile:(NSString *)filename +- (id) initWithContentsOfFile: (NSString *)filename { - NSData *data = [[NSData alloc] initWithContentsOfFile: filename]; - id object = [NSUnarchiver unarchiveObjectWithData: data]; - - RELEASE(data); - RELEASE(self); - return RETAIN(object); + NSData *data = [NSData dataWithContentsOfFile:filename]; + if (data) + { + return [NSKeyedUnarchiver unarchiveObjectWithData:data]; + } + return nil; } -- (id)initWithPasteboard:(NSPasteboard *)pasteboard +- (id) initWithPasteboard: (NSPasteboard *)pasteboard { - NSData *data = [pasteboard dataForType: NSDataLinkPboardType]; - id object = [NSUnarchiver unarchiveObjectWithData: data]; - - RELEASE(self); - return RETAIN(object); + NSData *data = [pasteboard dataForType:NSDataLinkPboardType]; + if (data) + { + return [NSKeyedUnarchiver unarchiveObjectWithData:data]; + } + return nil; } -// -// Exporting a Link -// - (BOOL)saveLinkIn:(NSString *)directoryName { - NSSavePanel *sp; - int result; - - sp = [NSSavePanel savePanel]; - [sp setRequiredFileType: NSDataLinkFilenameExtension]; - result = [sp runModalForDirectory: directoryName file: @""]; - if (result == NSOKButton) - { - NSFileManager *mgr = [NSFileManager defaultManager]; - NSString *path = [sp filename]; - - if ([mgr fileExistsAtPath: path] == YES) - { - /* NSSavePanel has already asked if it's ok to replace */ - NSString *bPath = [path stringByAppendingString: @"~"]; - - [mgr removeFileAtPath: bPath handler: nil]; - [mgr movePath: path toPath: bPath handler: nil]; - } - - // save it. - return [self writeToFile: path]; - } - return NO; + NSString *filePath = [directoryName stringByAppendingPathComponent: + [NSString stringWithFormat:@"Link_%d.link", _linkNumber]]; + return [self writeToFile:filePath]; } - (BOOL)writeToFile:(NSString *)filename { - NSString *path = filename; - - if ([[path pathExtension] isEqual: NSDataLinkFilenameExtension] == NO) - { - path = [filename stringByAppendingPathExtension: NSDataLinkFilenameExtension]; - } - - return [NSArchiver archiveRootObject: self toFile: path]; + NSData *data = [NSKeyedArchiver archivedDataWithRootObject:self]; + return [data writeToFile:filename atomically:YES]; } - (void)writeToPasteboard:(NSPasteboard *)pasteboard { - NSData *data = [NSArchiver archivedDataWithRootObject: self]; + NSData *data = [NSKeyedArchiver archivedDataWithRootObject:self]; + NSArray *array = [NSArray arrayWithObject: NSDataLinkPboardType]; + + [pasteboard declareTypes: array owner: nil]; [pasteboard setData: data forType: NSDataLinkPboardType]; } -// -// Information about the Link -// - (NSDataLinkDisposition)disposition { - return disposition; + return _disposition; } - (NSDataLinkNumber)linkNumber { - return linkNumber; + return _linkNumber; } - (NSDataLinkManager *)manager { - return sourceManager; + return (_disposition == NSLinkInSource) ? _sourceManager : _destinationManager; } -// -// Information about the Link's Source -// - (NSDate *)lastUpdateTime { - return lastUpdateTime; + return _lastUpdateTime; } - (BOOL)openSource { - return NO; + return NO; /* Stub */ } - (NSString *)sourceApplicationName { - return sourceApplicationName; + return _sourceApplicationName; } - (NSString *)sourceFilename { - return sourceFilename; + return _sourceFilename; } - (NSSelection *)sourceSelection { - return sourceSelection; + return _sourceSelection; } - (NSArray *)types { - return types; + return _types; } -// -// Information about the Link's Destination -// - (NSString *)destinationApplicationName { - return destinationApplicationName; + return _destinationApplicationName; } - (NSString *)destinationFilename { - return destinationFilename; + return _destinationFilename; } - (NSSelection *)destinationSelection { - return destinationSelection; + return _destinationSelection; } // @@ -222,21 +188,23 @@ - (NSSelection *)destinationSelection // - (BOOL)break { - id srcDelegate = [sourceManager delegate]; - id dstDelegate = [destinationManager delegate]; + id srcDelegate = [_sourceManager delegate]; + id dstDelegate = [_destinationManager delegate]; - // The spec is quite vague here. I don't know under what - // circumstances a link cannot be broken, so this method + // The spec is quite vague here. I don't know under what + // circumstances a link cannot be broken, so this method // always returns YES. + _disposition = NSLinkBroken; + if ([srcDelegate respondsToSelector: @selector(dataLinkManager:didBreakLink:)]) { - [srcDelegate dataLinkManager: sourceManager didBreakLink: self]; + [srcDelegate dataLinkManager: _sourceManager didBreakLink: self]; } if ([dstDelegate respondsToSelector: @selector(dataLinkManager:didBreakLink:)]) { - [dstDelegate dataLinkManager: destinationManager didBreakLink: self]; + [dstDelegate dataLinkManager: _destinationManager didBreakLink: self]; } return (_flags.broken = YES); @@ -246,25 +214,41 @@ - (void)noteSourceEdited { _flags.isDirty = YES; - if (updateMode != NSUpdateNever) + if (_updateMode != NSUpdateNever) { - [sourceManager noteDocumentEdited]; + [_sourceManager noteDocumentEdited]; } } - (void)setUpdateMode:(NSDataLinkUpdateMode)mode { - updateMode = mode; + _updateMode = mode; } - (BOOL)updateDestination { - return NO; + id dstDelegate = [_destinationManager delegate]; + + if (_flags.broken || _updateMode == NSUpdateNever) + return NO; + + // Check with delegate if update is needed + if ([dstDelegate respondsToSelector: @selector(dataLinkManager:isUpdateNeededForLink:)]) + { + BOOL needsUpdate = [dstDelegate dataLinkManager: _destinationManager isUpdateNeededForLink: self]; + if (!needsUpdate) + return NO; + } + + _flags.isDirty = NO; + _lastUpdateTime = [NSDate date]; + + return YES; } - (NSDataLinkUpdateMode)updateMode { - return updateMode; + return _updateMode; } // @@ -273,27 +257,27 @@ - (NSDataLinkUpdateMode)updateMode - (void) encodeWithCoder: (NSCoder*)aCoder { BOOL flag = NO; - + if ([aCoder allowsKeyedCoding]) { - [aCoder encodeInt: linkNumber forKey: @"GSLinkNumber"]; - [aCoder encodeInt: disposition forKey: @"GSUpdateMode"]; - [aCoder encodeInt: updateMode forKey: @"GSLastUpdateMode"]; - - [aCoder encodeObject: lastUpdateTime forKey: @"GSLastUpdateTime"]; - - [aCoder encodeObject: sourceApplicationName forKey: @"GSSourceApplicationName"]; - [aCoder encodeObject: sourceFilename forKey: @"GSSourceFilename"]; - [aCoder encodeObject: sourceSelection forKey: @"GSSourceSelection"]; - [aCoder encodeObject: sourceManager forKey: @"GSSourceManager"]; - - [aCoder encodeObject: destinationApplicationName forKey: @"GSDestinationApplicationName"]; - [aCoder encodeObject: destinationFilename forKey: @"GSDestinationFilename"]; - [aCoder encodeObject: destinationSelection forKey: @"GSDestinationSelection"]; - [aCoder encodeObject: destinationManager forKey: @"GSDestinationManager"]; - - [aCoder encodeObject: types forKey: @"GSTypes"]; - + [aCoder encodeInt: _linkNumber forKey: @"GSLinkNumber"]; + [aCoder encodeInt: _disposition forKey: @"GSUpdateMode"]; + [aCoder encodeInt: _updateMode forKey: @"GSLastUpdateMode"]; + + [aCoder encodeObject: _lastUpdateTime forKey: @"GSLastUpdateTime"]; + + [aCoder encodeObject: _sourceApplicationName forKey: @"GSSourceApplicationName"]; + [aCoder encodeObject: _sourceFilename forKey: @"GSSourceFilename"]; + [aCoder encodeObject: _sourceSelection forKey: @"GSSourceSelection"]; + [aCoder encodeObject: _sourceManager forKey: @"GSSourceManager"]; + + [aCoder encodeObject: _destinationApplicationName forKey: @"GSDestinationApplicationName"]; + [aCoder encodeObject: _destinationFilename forKey: @"GSDestinationFilename"]; + [aCoder encodeObject: _destinationSelection forKey: @"GSDestinationSelection"]; + [aCoder encodeObject: _destinationManager forKey: @"GSDestinationManager"]; + + [aCoder encodeObject: _types forKey: @"GSTypes"]; + // flags... flag = _flags.appVerifies; [aCoder encodeBool: flag forKey: @"GSAppVerifies"]; @@ -308,23 +292,23 @@ - (void) encodeWithCoder: (NSCoder*)aCoder } else { - [aCoder encodeValueOfObjCType: @encode(int) at: &linkNumber]; - [aCoder encodeValueOfObjCType: @encode(int) at: &disposition]; - [aCoder encodeValueOfObjCType: @encode(int) at: &updateMode]; - [aCoder encodeValueOfObjCType: @encode(id) at: &lastUpdateTime]; - - [aCoder encodeValueOfObjCType: @encode(id) at: &sourceApplicationName]; - [aCoder encodeValueOfObjCType: @encode(id) at: &sourceFilename]; - [aCoder encodeValueOfObjCType: @encode(id) at: &sourceSelection]; - [aCoder encodeValueOfObjCType: @encode(id) at: &sourceManager]; - - [aCoder encodeValueOfObjCType: @encode(id) at: &destinationApplicationName]; - [aCoder encodeValueOfObjCType: @encode(id) at: &destinationFilename]; - [aCoder encodeValueOfObjCType: @encode(id) at: &destinationSelection]; - [aCoder encodeValueOfObjCType: @encode(id) at: &destinationManager]; - - [aCoder encodeValueOfObjCType: @encode(id) at: &types]; - + [aCoder encodeValueOfObjCType: @encode(int) at: &_linkNumber]; + [aCoder encodeValueOfObjCType: @encode(int) at: &_disposition]; + [aCoder encodeValueOfObjCType: @encode(int) at: &_updateMode]; + [aCoder encodeValueOfObjCType: @encode(id) at: &_lastUpdateTime]; + + [aCoder encodeValueOfObjCType: @encode(id) at: &_sourceApplicationName]; + [aCoder encodeValueOfObjCType: @encode(id) at: &_sourceFilename]; + [aCoder encodeValueOfObjCType: @encode(id) at: &_sourceSelection]; + [aCoder encodeValueOfObjCType: @encode(id) at: &_sourceManager]; + + [aCoder encodeValueOfObjCType: @encode(id) at: &_destinationApplicationName]; + [aCoder encodeValueOfObjCType: @encode(id) at: &_destinationFilename]; + [aCoder encodeValueOfObjCType: @encode(id) at: &_destinationSelection]; + [aCoder encodeValueOfObjCType: @encode(id) at: &_destinationManager]; + + [aCoder encodeValueOfObjCType: @encode(id) at: &_types]; + // flags... flag = _flags.appVerifies; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; @@ -345,34 +329,34 @@ - (id) initWithCoder: (NSCoder*)aCoder { id obj; - linkNumber = [aCoder decodeIntForKey: @"GSLinkNumber"]; - disposition = [aCoder decodeIntForKey: @"GSDisposition"]; - updateMode = [aCoder decodeIntForKey: @"GSUpdateMode"]; + _linkNumber = [aCoder decodeIntForKey: @"GSLinkNumber"]; + _disposition = [aCoder decodeIntForKey: @"GSDisposition"]; + _updateMode = [aCoder decodeIntForKey: @"GSLastUpdateMode"]; obj = [aCoder decodeObjectForKey: @"GSSourceManager"]; - ASSIGN(sourceManager,obj); + ASSIGN(_sourceManager,obj); obj = [aCoder decodeObjectForKey: @"GSDestinationManager"]; - ASSIGN(destinationManager,obj); + ASSIGN(_destinationManager,obj); obj = [aCoder decodeObjectForKey: @"GSLastUpdateTime"]; - ASSIGN(lastUpdateTime, obj); + ASSIGN(_lastUpdateTime, obj); obj = [aCoder decodeObjectForKey: @"GSSourceApplicationName"]; - ASSIGN(sourceApplicationName,obj); + ASSIGN(_sourceApplicationName,obj); obj = [aCoder decodeObjectForKey: @"GSSourceFilename"]; - ASSIGN(sourceFilename,obj); + ASSIGN(_sourceFilename,obj); obj = [aCoder decodeObjectForKey: @"GSSourceSelection"]; - ASSIGN(sourceSelection,obj); + ASSIGN(_sourceSelection,obj); obj = [aCoder decodeObjectForKey: @"GSSourceManager"]; - ASSIGN(sourceManager,obj); + ASSIGN(_sourceManager,obj); obj = [aCoder decodeObjectForKey: @"GSDestinationApplicationName"]; - ASSIGN(destinationApplicationName,obj); + ASSIGN(_destinationApplicationName,obj); obj = [aCoder decodeObjectForKey: @"GSDestinationFilename"]; - ASSIGN(destinationFilename,obj); + ASSIGN(_destinationFilename,obj); obj = [aCoder decodeObjectForKey: @"GSDestinationSelection"]; - ASSIGN(destinationSelection,obj); + ASSIGN(_destinationSelection,obj); obj = [aCoder decodeObjectForKey: @"GSDestinationManager"]; - ASSIGN(destinationManager,obj); + ASSIGN(_destinationManager,obj); obj = [aCoder decodeObjectForKey: @"GSTypes"]; - ASSIGN(types,obj); + ASSIGN(_types,obj); // flags... _flags.appVerifies = [aCoder decodeBoolForKey: @"GSAppVerifies"]; @@ -387,26 +371,26 @@ - (id) initWithCoder: (NSCoder*)aCoder if (version == 0) { BOOL flag = NO; - - [aCoder decodeValueOfObjCType: @encode(int) at: &linkNumber]; - [aCoder decodeValueOfObjCType: @encode(int) at: &disposition]; - [aCoder decodeValueOfObjCType: @encode(int) at: &updateMode]; - [aCoder decodeValueOfObjCType: @encode(id) at: &sourceManager]; - [aCoder decodeValueOfObjCType: @encode(id) at: &destinationManager]; - [aCoder decodeValueOfObjCType: @encode(id) at: &lastUpdateTime]; - - [aCoder decodeValueOfObjCType: @encode(id) at: &sourceApplicationName]; - [aCoder decodeValueOfObjCType: @encode(id) at: &sourceFilename]; - [aCoder decodeValueOfObjCType: @encode(id) at: &sourceSelection]; - [aCoder decodeValueOfObjCType: @encode(id) at: &sourceManager]; - - [aCoder decodeValueOfObjCType: @encode(id) at: &destinationApplicationName]; - [aCoder decodeValueOfObjCType: @encode(id) at: &destinationFilename]; - [aCoder decodeValueOfObjCType: @encode(id) at: &destinationSelection]; - [aCoder decodeValueOfObjCType: @encode(id) at: &destinationManager]; - - [aCoder decodeValueOfObjCType: @encode(id) at: &types]; - + + [aCoder decodeValueOfObjCType: @encode(int) at: &_linkNumber]; + [aCoder decodeValueOfObjCType: @encode(int) at: &_disposition]; + [aCoder decodeValueOfObjCType: @encode(int) at: &_updateMode]; + [aCoder decodeValueOfObjCType: @encode(id) at: &_sourceManager]; + [aCoder decodeValueOfObjCType: @encode(id) at: &_destinationManager]; + [aCoder decodeValueOfObjCType: @encode(id) at: &_lastUpdateTime]; + + [aCoder decodeValueOfObjCType: @encode(id) at: &_sourceApplicationName]; + [aCoder decodeValueOfObjCType: @encode(id) at: &_sourceFilename]; + [aCoder decodeValueOfObjCType: @encode(id) at: &_sourceSelection]; + [aCoder decodeValueOfObjCType: @encode(id) at: &_sourceManager]; + + [aCoder decodeValueOfObjCType: @encode(id) at: &_destinationApplicationName]; + [aCoder decodeValueOfObjCType: @encode(id) at: &_destinationFilename]; + [aCoder decodeValueOfObjCType: @encode(id) at: &_destinationSelection]; + [aCoder decodeValueOfObjCType: @encode(id) at: &_destinationManager]; + + [aCoder decodeValueOfObjCType: @encode(id) at: &_types]; + // flags... [aCoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _flags.appVerifies = flag; @@ -426,4 +410,39 @@ - (id) initWithCoder: (NSCoder*)aCoder return self; } +- (NSString *) description +{ + NSString *description = [NSString stringWithFormat: + @"%@ <_linkNumber = %d, _disposition = %d, _updateMode = %d, " + "_sourceManager = %@, _destinationManager = %@, _lastUpdateTime = %@, " + "_sourceApplicationName = %@, _sourceFilename = %@, _sourceSelection = %@, _sourceManager = %@, " + "_destinationApplicationName = %@, _destinationFilename = %@, _destinationSelection = %@, _destinationManager = %@, " + "%d, %d, %d, %d, %d", + [super description], + _linkNumber, + _disposition, + _updateMode, + // objects... + _sourceManager, + _destinationManager, + _lastUpdateTime, + // source... + _sourceApplicationName, + _sourceFilename, + _sourceSelection, + _sourceManager, + // destination... + _destinationApplicationName, + _destinationFilename, + _destinationSelection, + _destinationManager, + // flags + _flags.appVerifies, + _flags.canUpdateContinuously, + _flags.isDirty, + _flags.willOpenSource, + _flags.willUpdate]; + return description; +} + @end diff --git a/Source/NSDataLinkManager.m b/Source/NSDataLinkManager.m index a56937b11b..f3a50e693a 100644 --- a/Source/NSDataLinkManager.m +++ b/Source/NSDataLinkManager.m @@ -6,7 +6,7 @@ Date: 2005 Author: Scott Christley Date: 1996 - + This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or @@ -21,20 +21,40 @@ You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. - If not, see or write to the - Free Software Foundation, 51 Franklin Street, Fifth Floor, + If not, see or write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ +*/ #include "config.h" +#import +#import #import #import -#import -#import +#import +#import + +#import "AppKit/NSPanel.h" #import "AppKit/NSDataLinkManager.h" #import "AppKit/NSDataLink.h" #import "AppKit/NSPasteboard.h" +#ifdef HAVE_INOTIFY_H +#import +#endif + +#import +#import + +#import "GSFastEnumeration.h" + +@interface NSDataLinkManager (Private) +- (void) stopMonitoring; +- (void) startMonitoring; +- (void) monitorLoop; +@end + +// Private setters/getters for links... @interface NSDataLink (Private) - (void) setLastUpdateTime: (NSDate *)date; - (void) setSourceFilename: (NSString *)src; @@ -48,37 +68,37 @@ - (void) setDestinationSelection: (id)dst; @implementation NSDataLink (Private) - (void) setLastUpdateTime: (NSDate *)date { - ASSIGN(lastUpdateTime, date); + ASSIGN(_lastUpdateTime, date); } - (void) setSourceFilename: (NSString *)src { - ASSIGN(sourceFilename,src); + ASSIGN(_sourceFilename,src); } - (void) setDestinationFilename: (NSString *)dst { - ASSIGN(destinationFilename, dst); + ASSIGN(_destinationFilename, dst); } - (void) setSourceManager: (id)src { - ASSIGN(sourceManager,src); + ASSIGN(_sourceManager,src); } - (void) setDestinationManager: (id)dst { - ASSIGN(destinationManager,dst); + ASSIGN(_destinationManager,dst); } - (void) setSourceSelection: (id)src { - ASSIGN(sourceSelection,src); + ASSIGN(_sourceSelection,src); } - (void) setDestinationSelection: (id)dst { - ASSIGN(destinationSelection,dst); + ASSIGN(_destinationSelection,dst); } - (void) setIsMarker: (BOOL)flag @@ -108,71 +128,172 @@ + (void)initialize // // Initializing and Freeing a Link Manager // -- (id)initWithDelegate:(id)anObject +- (id) initWithDelegate: (id)anObject + fromFile: (NSString *)path { self = [super init]; if (self != nil) { - ASSIGN(delegate,anObject); - filename = nil; + _delegate = anObject; // don't retain... + ASSIGN(_filename,path); _flags.delegateVerifiesLinks = NO; _flags.interactsWithUser = NO; _flags.isEdited = NO; _flags.areLinkOutlinesVisible = NO; + + _sourceLinks = [[NSMutableArray alloc] init]; + _destinationLinks = [[NSMutableArray alloc] init]; + _watchDescriptors = [[NSMutableDictionary alloc] init]; + _nextLinkNumber = 1; +#ifdef HAVE_INOTIFY_H + _inotifyFD = inotify_init(); +#endif + if (_inotifyFD < 0) + { + NSLog(@"Failed to initialize inotify"); + } + [self startMonitoring]; } return self; } -- (id)initWithDelegate:(id)anObject - fromFile:(NSString *)path +- (id)initWithDelegate: (id)anObject { - self = [super init]; + return [self initWithDelegate: anObject fromFile: nil]; +} - if (self != nil) +- (void) dealloc +{ + RELEASE(_sourceLinks); + RELEASE(_destinationLinks); + RELEASE(_watchDescriptors); + + [self stopMonitoring]; + [super dealloc]; +} + +// +// Monitoring methods +// +- (void)stopMonitoring +{ +#ifdef HAVE_INOTIFY_H + NSArray *allKeys = [_watchDescriptors allKeys]; + NSEnumerator *en = [allKeys objectEnumerator]; + NSNumber *key = nil; + + while ((key = [en nextObject]) != nil) { - ASSIGN(delegate,anObject); - ASSIGN(filename,path); - _flags.delegateVerifiesLinks = NO; - _flags.interactsWithUser = NO; - _flags.isEdited = NO; - _flags.areLinkOutlinesVisible = NO; + inotify_rm_watch(_inotifyFD, [key intValue]); } - return self; + [_watchDescriptors removeAllObjects]; + + if (_inotifyFD >= 0) + { + close(_inotifyFD); + _inotifyFD = -1; + } + + if (_monitorThread && [_monitorThread isExecuting]) + { + [_monitorThread cancel]; // thread must check isCancelled + } +#endif +} + +- (void)startMonitoring +{ + _monitorThread = [[NSThread alloc] initWithTarget:self selector:@selector(monitorLoop) object:nil]; + [_monitorThread start]; +} + +- (void)monitorLoop +{ +#ifdef HAVE_INOTIFY_H + char buffer[1024]; + while (![[NSThread currentThread] isCancelled]) + { + ssize_t length = read(_inotifyFD, buffer, sizeof(buffer)); + if (length < 0) + { + continue; + } + + ssize_t i = 0; + while (i < length) + { + struct inotify_event *event = (struct inotify_event *)&buffer[i]; + NSNumber *key = [NSNumber numberWithInt:event->wd]; + NSDataLink *link = [_watchDescriptors objectForKey: key]; + if (link != nil) + { + [link noteSourceEdited]; + NSLog(@"Source file changed for link #%d", [link linkNumber]); + + // Check if delegate wants to verify this update + if ([_delegate respondsToSelector: @selector(dataLinkManager:isUpdateNeededForLink:)]) + { + BOOL needsUpdate = [_delegate dataLinkManager: self isUpdateNeededForLink: link]; + if (needsUpdate) + { + [link updateDestination]; + } + } + } + i += sizeof(struct inotify_event) + event->len; + } + } +#endif +} + +- (void) _checkLink: (NSDataLink *)link +{ + if (link == nil) + { + NSRunAlertPanel(@"Links", @"You must save the source document before you can link to it.", @"OK", nil, nil); + } } // // Adding and Removing Links // -- (BOOL)addLink:(NSDataLink *)link - at:(NSSelection *)selection +- (BOOL) addLink: (NSDataLink *)link + at: (NSSelection *)selection { BOOL result = NO; + [self _checkLink: link]; [link setDestinationSelection: selection]; [link setDestinationManager: self]; - if ([destinationLinks containsObject: link] == NO) + if ([_destinationLinks containsObject: link] == NO) { - [destinationLinks addObject: link]; + [_destinationLinks addObject: link]; result = YES; + + // Notify delegate that we're starting to track this link + if ([_delegate respondsToSelector: @selector(dataLinkManager:startTrackingLink:)]) + { + [_delegate dataLinkManager: self startTrackingLink: link]; + } } return result; } -- (BOOL)addLinkAsMarker:(NSDataLink *)link - at:(NSSelection *)selection +- (BOOL) addLinkAsMarker: (NSDataLink *)link + at: (NSSelection *)selection { [link setIsMarker: YES]; return [self addLink: link at: selection]; } -- (NSDataLink *)addLinkPreviouslyAt:(NSSelection *)oldSelection - fromPasteboard:(NSPasteboard *)pasteboard - at:(NSSelection *)selection +- (NSDataLink *) addLinkPreviouslyAt: (NSSelection *)oldSelection + fromPasteboard: (NSPasteboard *)pasteboard + at: (NSSelection *)selection { NSData *data = [pasteboard dataForType: NSDataLinkPboardType]; NSArray *links = [NSUnarchiver unarchiveObjectWithData: data]; @@ -181,86 +302,157 @@ - (NSDataLink *)addLinkPreviouslyAt:(NSSelection *)oldSelection while ((link = [en nextObject]) != nil) { - if ([link destinationSelection] == oldSelection) - { + if ([link destinationSelection] == oldSelection) + { } } return nil; } -- (void)breakAllLinks +- (void) breakAllLinks +{ + FOR_IN(NSDataLink*, src, _sourceLinks) + { + // Notify delegate we're stopping tracking + if ([_delegate respondsToSelector: @selector(dataLinkManager:stopTrackingLink:)]) + { + [_delegate dataLinkManager: self stopTrackingLink: src]; + } + [src break]; + } + END_FOR_IN(_sourceLinks); + + FOR_IN(NSDataLink*, dst, _destinationLinks) + { + // Notify delegate we're stopping tracking + if ([_delegate respondsToSelector: @selector(dataLinkManager:stopTrackingLink:)]) + { + [_delegate dataLinkManager: self stopTrackingLink: dst]; + } + [dst break]; + } + END_FOR_IN(_destinationLinks); +} + +- (void) removeLink: (NSDataLink *)link { - NSArray *allLinks = [sourceLinks arrayByAddingObjectsFromArray: destinationLinks]; - NSEnumerator *en = [allLinks objectEnumerator]; - id obj = nil; + if ([_sourceLinks containsObject: link]) + { + // Notify delegate we're stopping tracking + if ([_delegate respondsToSelector: @selector(dataLinkManager:stopTrackingLink:)]) + { + [_delegate dataLinkManager: self stopTrackingLink: link]; + } + [_sourceLinks removeObject: link]; + } - while ((obj = [en nextObject]) != nil) + if ([_destinationLinks containsObject: link]) { - [obj break]; + // Notify delegate we're stopping tracking + if ([_delegate respondsToSelector: @selector(dataLinkManager:stopTrackingLink:)]) + { + [_delegate dataLinkManager: self stopTrackingLink: link]; + } + [_destinationLinks removeObject: link]; } } -- (void)writeLinksToPasteboard:(NSPasteboard *)pasteboard +- (BOOL) addSourceLink: (NSDataLink *)link { - NSArray *allLinks = [sourceLinks arrayByAddingObjectsFromArray: destinationLinks]; - NSEnumerator *en = [allLinks objectEnumerator]; - id obj = nil; + BOOL result = NO; + + [link setSourceManager: self]; - while ((obj = [en nextObject]) != nil) + if ([_sourceLinks containsObject: link] == NO) + { + [_sourceLinks addObject: link]; + result = YES; + + // Notify delegate that we're starting to track this link + if ([_delegate respondsToSelector: @selector(dataLinkManager:startTrackingLink:)]) + { + [_delegate dataLinkManager: self startTrackingLink: link]; + } + } + + return result; +} + +- (void) writeLinksToPasteboard: (NSPasteboard *)pasteboard +{ + FOR_IN(NSDataLink*, obj, _sourceLinks) { [obj writeToPasteboard: pasteboard]; } + END_FOR_IN(_sourceLinks); } // // Informing the Link Manager of Document Status // -- (void)noteDocumentClosed +- (void) noteDocumentClosed { - if ([delegate respondsToSelector: @selector(dataLinkManagerCloseDocument:)]) + if ([_delegate respondsToSelector: @selector(dataLinkManagerCloseDocument:)]) { - [delegate dataLinkManagerCloseDocument: self]; + [_delegate dataLinkManagerCloseDocument: self]; } } -- (void)noteDocumentEdited +- (void) noteDocumentEdited { - if ([delegate respondsToSelector: @selector(dataLinkManagerDidEditLinks:)]) + if ([_delegate respondsToSelector: @selector(dataLinkManagerDidEditLinks:)]) { - [delegate dataLinkManagerDidEditLinks: self]; + [_delegate dataLinkManagerDidEditLinks: self]; } } -- (void)noteDocumentReverted +- (void) noteDocumentReverted { - if ([delegate respondsToSelector: @selector(dataLinkManagerDidEditLinks:)]) + if ([_delegate respondsToSelector: @selector(dataLinkManagerDidEditLinks:)]) { - [delegate dataLinkManagerDidEditLinks: self]; + [_delegate dataLinkManagerDidEditLinks: self]; } } -- (void)noteDocumentSaved +- (void) noteDocumentSaved { - // implemented by subclass + // Update all source links when document is saved + FOR_IN(NSDataLink*, link, _sourceLinks) + { + [link setLastUpdateTime: [NSDate date]]; + } + END_FOR_IN(_sourceLinks); + + // Check if any destination links need updates + [self checkForLinkUpdates]; } -- (void)noteDocumentSavedAs:(NSString *)path +- (void) noteDocumentSavedAs:(NSString *)path { - // implemented by subclass + ASSIGN(_filename, path); + [self noteDocumentSaved]; } - (void)noteDocumentSavedTo:(NSString *)path { - // implemented by subclass + // When saving to a different location, update source links if applicable + FOR_IN(NSDataLink*, link, _sourceLinks) + { + if ([[link sourceFilename] isEqualToString: _filename]) + { + [link setSourceFilename: path]; + } + } + END_FOR_IN(_sourceLinks); } // // Getting and Setting Information about the Link Manager // -- (id)delegate +- (id) delegate { - return delegate; + return _delegate; } - (BOOL)delegateVerifiesLinks @@ -270,7 +462,7 @@ - (BOOL)delegateVerifiesLinks - (NSString *)filename { - return filename; + return _filename; } - (BOOL)interactsWithUser @@ -303,33 +495,40 @@ - (BOOL)areLinkOutlinesVisible - (NSEnumerator *)destinationLinkEnumerator { - return [destinationLinks objectEnumerator]; + return [_destinationLinks objectEnumerator]; } - (NSDataLink *)destinationLinkWithSelection:(NSSelection *)destSel { - NSEnumerator *en = [self destinationLinkEnumerator]; - id obj = nil; + id result = nil; - while ((obj = [en nextObject]) != nil) + FOR_IN(id, obj, _destinationLinks) { - if ([obj destinationSelection] == destSel) + if ([[obj destinationSelection] isEqual: destSel]) { + result = obj; break; } } + END_FOR_IN(_destinationLinks); - return obj; + return result; } - (void)setLinkOutlinesVisible:(BOOL)flag { _flags.areLinkOutlinesVisible = flag; + + // Notify delegate to redraw outlines when visibility changes + if ([_delegate respondsToSelector: @selector(dataLinkManagerRedrawLinkOutlines:)]) + { + [_delegate dataLinkManagerRedrawLinkOutlines: self]; + } } - (NSEnumerator *)sourceLinkEnumerator { - return [sourceLinks objectEnumerator]; + return [_sourceLinks objectEnumerator]; } // @@ -341,10 +540,10 @@ - (void) encodeWithCoder: (NSCoder*)aCoder if ([aCoder allowsKeyedCoding]) { - [aCoder encodeObject: filename forKey: @"GSFilename"]; - [aCoder encodeObject: sourceLinks forKey: @"GSSourceLinks"]; - [aCoder encodeObject: destinationLinks forKey: @"GSDestinationLinks"]; - + [aCoder encodeObject: _filename forKey: @"GSFilename"]; + [aCoder encodeObject: _sourceLinks forKey: @"GSSourceLinks"]; + [aCoder encodeObject: _destinationLinks forKey: @"GSDestinationLinks"]; + flag = _flags.areLinkOutlinesVisible; [aCoder encodeBool: flag forKey: @"GSAreLinkOutlinesVisible"]; flag = _flags.delegateVerifiesLinks; @@ -356,10 +555,10 @@ - (void) encodeWithCoder: (NSCoder*)aCoder } else { - [aCoder encodeValueOfObjCType: @encode(id) at: &filename]; - [aCoder encodeValueOfObjCType: @encode(id) at: &sourceLinks]; - [aCoder encodeValueOfObjCType: @encode(id) at: &destinationLinks]; - + [aCoder encodeValueOfObjCType: @encode(id) at: &_filename]; + [aCoder encodeValueOfObjCType: @encode(id) at: &_sourceLinks]; + [aCoder encodeValueOfObjCType: @encode(id) at: &_destinationLinks]; + flag = _flags.areLinkOutlinesVisible; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _flags.delegateVerifiesLinks; @@ -379,13 +578,13 @@ - (id) initWithCoder: (NSCoder*)aCoder id obj; obj = [aCoder decodeObjectForKey: @"GSFilename"]; - ASSIGN(filename,obj); + ASSIGN(_filename,obj); obj = [aCoder decodeObjectForKey: @"GSSourceLinks"]; - ASSIGN(sourceLinks,obj); + ASSIGN(_sourceLinks,obj); obj = [aCoder decodeObjectForKey: @"GSDestinationLinks"]; - ASSIGN(destinationLinks,obj); - - flag = [aCoder decodeBoolForKey: @"GSAreLinkOutlinesVisible"]; + ASSIGN(_destinationLinks,obj); + + flag = [aCoder decodeBoolForKey: @"GSAreLinkOutlinesVisible"]; _flags.areLinkOutlinesVisible = flag; flag = [aCoder decodeBoolForKey: @"GSDelegateVerifiesLinks"]; _flags.delegateVerifiesLinks = flag; @@ -400,11 +599,11 @@ - (id) initWithCoder: (NSCoder*)aCoder if (version == 0) { BOOL flag = NO; - - [aCoder decodeValueOfObjCType: @encode(id) at: &filename]; - [aCoder decodeValueOfObjCType: @encode(id) at: &sourceLinks]; - [aCoder decodeValueOfObjCType: @encode(id) at: &destinationLinks]; - + + [aCoder decodeValueOfObjCType: @encode(id) at: &_filename]; + [aCoder decodeValueOfObjCType: @encode(id) at: &_sourceLinks]; + [aCoder decodeValueOfObjCType: @encode(id) at: &_destinationLinks]; + [aCoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _flags.areLinkOutlinesVisible = flag; [aCoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; @@ -420,4 +619,40 @@ - (id) initWithCoder: (NSCoder*)aCoder return self; } +// +// Additional delegate callback methods +// +- (void) checkForLinkUpdates +{ + FOR_IN(NSDataLink*, link, _destinationLinks) + { + if ([_delegate respondsToSelector: @selector(dataLinkManager:isUpdateNeededForLink:)]) + { + BOOL needsUpdate = [_delegate dataLinkManager: self isUpdateNeededForLink: link]; + if (needsUpdate) + { + [link updateDestination]; + } + } + } + END_FOR_IN(_destinationLinks); +} + +- (void) redrawLinkOutlines +{ + if ([_delegate respondsToSelector: @selector(dataLinkManagerRedrawLinkOutlines:)]) + { + [_delegate dataLinkManagerRedrawLinkOutlines: self]; + } +} + +- (BOOL) tracksLinksIndividually +{ + if ([_delegate respondsToSelector: @selector(dataLinkManagerTracksLinksIndividually:)]) + { + return [_delegate dataLinkManagerTracksLinksIndividually: self]; + } + return YES; // Default behavior +} + @end diff --git a/Source/NSDataLinkPanel.m b/Source/NSDataLinkPanel.m index 11cfd21e04..024d2f60c0 100644 --- a/Source/NSDataLinkPanel.m +++ b/Source/NSDataLinkPanel.m @@ -26,14 +26,19 @@ */ #import "config.h" + #import +#import + #import "AppKit/NSApplication.h" #import "AppKit/NSDataLinkPanel.h" #import "AppKit/NSDataLinkManager.h" #import "AppKit/NSDataLink.h" #import "AppKit/NSGraphics.h" +#import "AppKit/NSPopUpButton.h" #import "AppKit/NSView.h" #import "AppKit/NSNibLoading.h" + #import "GSGuiPrivate.h" static NSDataLinkPanel *_sharedDataLinkPanel; @@ -169,9 +174,24 @@ - (void)setLink:(NSDataLink *)link manager:(NSDataLinkManager *)linkManager isMultiple:(BOOL)flag { + NSDate *date = [link lastUpdateTime]; + NSDateFormatter *formatter = [_lastUpdateField formatter]; + NSString *dateString = @"Never"; + + // Set the date string if it's set... + if (date != nil) + { + dateString = [formatter stringFromDate: date]; + } + ASSIGN(_currentDataLink, link); ASSIGN(_currentDataLinkManager, linkManager); _multipleSelection = flag; + + // Set panel to reflect the settings in the link... + [_sourceField setStringValue: [link sourceFilename]]; + [_lastUpdateField setStringValue: dateString]; + [_updateModeButton selectItemWithTag: [link updateMode]]; } // diff --git a/configure b/configure index 70dc2161b3..614419ec60 100755 --- a/configure +++ b/configure @@ -1,9 +1,10 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69. +# Generated by GNU Autoconf 2.71. # # -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Inc. # # # This configure script is free software; the Free Software Foundation @@ -14,14 +15,16 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -31,46 +34,46 @@ esac fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -79,13 +82,6 @@ if test "${PATH_SEPARATOR+set}" != set; then fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -94,8 +90,12 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -107,30 +107,10 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. @@ -152,20 +132,22 @@ esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + as_bourne_compatible="as_nop=: +if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else +else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( @@ -185,42 +167,52 @@ as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : -else +else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" + if (eval "$as_required") 2>/dev/null +then : as_have_required=yes -else +else $as_nop as_have_required=no fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : -else +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base + as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : break 2 fi fi @@ -228,14 +220,21 @@ fi esac as_found=false done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi +fi - if test "x$CONFIG_SHELL" != x; then : + if test "x$CONFIG_SHELL" != x +then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also @@ -253,18 +252,19 @@ esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." @@ -291,6 +291,7 @@ as_fn_unset () } as_unset=as_fn_unset + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -308,6 +309,14 @@ as_fn_exit () as_fn_set_status $1 exit $1 } # as_fn_exit +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -322,7 +331,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -331,7 +340,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -370,12 +379,13 @@ as_fn_executable_p () # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -387,18 +397,27 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -410,9 +429,9 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -439,7 +458,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -483,7 +502,7 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall @@ -497,6 +516,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits exit } + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -510,6 +533,13 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -575,50 +605,46 @@ MFLAGS= MAKEFLAGS= # Identity of this package. -PACKAGE_NAME= -PACKAGE_TARNAME= -PACKAGE_VERSION= -PACKAGE_STRING= -PACKAGE_BUGREPORT= -PACKAGE_URL= +PACKAGE_NAME='' +PACKAGE_TARNAME='' +PACKAGE_VERSION='' +PACKAGE_STRING='' +PACKAGE_BUGREPORT='' +PACKAGE_URL='' ac_unique_file="Source/NSApplication.m" # Factoring default headers for most tests. ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include +#include +#ifdef HAVE_STDIO_H +# include #endif -#ifdef STDC_HEADERS +#ifdef HAVE_STDLIB_H # include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif #endif #ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif # include #endif -#ifdef HAVE_STRINGS_H -# include -#endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif #ifdef HAVE_UNISTD_H # include #endif" +ac_header_c_list= ac_subst_vars='LTLIBOBJS LIBOBJS cross_compiling @@ -654,8 +680,6 @@ IMAGEMAGICK_CFLAGS HAVE_LIBPNG_CONFIG TIFF_LIBS TIFF_CFLAGS -EGREP -GREP XMKMF PKG_CONFIG_LIBDIR PKG_CONFIG_PATH @@ -700,6 +724,7 @@ infodir docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -801,6 +826,7 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' @@ -830,8 +856,6 @@ do *) ac_optarg=yes ;; esac - # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; @@ -872,9 +896,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -898,9 +922,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1053,6 +1077,15 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1102,9 +1135,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1118,9 +1151,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1164,9 +1197,9 @@ Try \`$0 --help' for more information" *) # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; @@ -1182,7 +1215,7 @@ if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1190,7 +1223,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1246,7 +1279,7 @@ $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | +printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1343,6 +1376,7 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1451,9 +1485,9 @@ if test "$ac_init_help" = "recursive"; then case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1481,7 +1515,8 @@ esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive @@ -1489,7 +1524,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix echo && $SHELL "$ac_srcdir/configure" --help=recursive else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1499,9 +1534,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.69 +generated by GNU Autoconf 2.71 -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1518,14 +1553,14 @@ fi ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1533,14 +1568,15 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + } && test -s conftest.$ac_objext +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1562,7 +1598,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1570,14 +1606,15 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1593,14 +1630,14 @@ fi ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1608,17 +1645,18 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1639,11 +1677,12 @@ fi ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. @@ -1651,16 +1690,9 @@ else #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif + which can conflict with char $2 (); below. */ +#include #undef $2 /* Override any GCC internal prototype to avoid an error. @@ -1678,157 +1710,29 @@ choke me #endif int -main () +main (void) { return $2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in @@ -1836,26 +1740,28 @@ fi ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile @@ -1867,16 +1773,17 @@ $as_echo "$ac_res" >&6; } ac_fn_c_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 -$as_echo_n "checking for $2.$3... " >&6; } -if eval \${$4+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +printf %s "checking for $2.$3... " >&6; } +if eval test \${$4+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int -main () +main (void) { static $2 ac_aggr; if (ac_aggr.$3) @@ -1885,14 +1792,15 @@ return 0; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$4=yes" -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int -main () +main (void) { static $2 ac_aggr; if (sizeof ac_aggr.$3) @@ -1901,29 +1809,50 @@ return 0; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$4=yes" -else +else $as_nop eval "$4=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$4 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done + +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; +esac + cat >config.log <<_ACEOF 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.69. Invocation command line was +generated by GNU Autoconf 2.71. Invocation command line was - $ $0 $@ + $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log @@ -1956,8 +1885,12 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS @@ -1992,7 +1925,7 @@ do | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; @@ -2027,11 +1960,13 @@ done # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo - $as_echo "## ---------------- ## + printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo @@ -2042,8 +1977,8 @@ trap 'exit_status=$? case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -2067,7 +2002,7 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ) echo - $as_echo "## ----------------- ## + printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo @@ -2075,14 +2010,14 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## + printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo @@ -2090,15 +2025,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then - $as_echo "## ----------- ## + printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo @@ -2106,8 +2041,8 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; echo fi test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -2121,63 +2056,48 @@ ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h -$as_echo "/* confdefs.h */" > confdefs.h +printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac + ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" + +for ac_site_file in $ac_site_files do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi @@ -2187,130 +2107,518 @@ if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; 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 - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + 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 do not provoke an error unfortunately, instead are silently treated + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' -# If GNUSTEP_MAKEFILES is undefined, try to use gnustep-config to determine it. -if test -z "$GNUSTEP_MAKEFILES"; then - GNUSTEP_MAKEFILES=`gnustep-config --variable=GNUSTEP_MAKEFILES 2>&5` -fi +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' -if test -z "$GNUSTEP_MAKEFILES"; then - as_fn_error $? "You must have the gnustep-make package installed and set up the GNUSTEP_MAKEFILES environment variable to contain the path to the makefiles directory before configuring!" "$LINENO" 5 -fi +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +// Does the compiler advertise C99 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif -#-------------------------------------------------------------------- -# Use config.guess, config.sub and install-sh provided by gnustep-make -#-------------------------------------------------------------------- -ac_aux_dir= -for ac_dir in $GNUSTEP_MAKEFILES "$srcdir"/$GNUSTEP_MAKEFILES; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +// Does the compiler advertise C11 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" + +# Auxiliary files required by this configure script. +ac_aux_files="config.guess config.sub" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="$GNUSTEP_MAKEFILES" + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in $GNUSTEP_MAKEFILES \"$srcdir\"/$GNUSTEP_MAKEFILES" "$LINENO" 5 +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 fi + # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. +if test -f "${ac_aux_dir}config.guess"; then + ac_config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_configure="$SHELL ${ac_aux_dir}configure" +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; 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 + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# If GNUSTEP_MAKEFILES is undefined, try to use gnustep-config to determine it. +if test -z "$GNUSTEP_MAKEFILES"; then + GNUSTEP_MAKEFILES=`gnustep-config --variable=GNUSTEP_MAKEFILES 2>&5` +fi + +if test -z "$GNUSTEP_MAKEFILES"; then + as_fn_error $? "You must have the gnustep-make package installed and set up the GNUSTEP_MAKEFILES environment variable to contain the path to the makefiles directory before configuring!" "$LINENO" 5 +fi + +#-------------------------------------------------------------------- +# Use config.guess, config.sub and install-sh provided by gnustep-make +#-------------------------------------------------------------------- + ac_config_headers="$ac_config_headers Headers/Additions/GNUstepGUI/config.h" @@ -2318,26 +2626,30 @@ ac_config_headers="$ac_config_headers Headers/Additions/GNUstepGUI/config.h" #-------------------------------------------------------------------- # Determine the host, build, and target systems #-------------------------------------------------------------------- -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else + + + + # Make sure we can run config.sub. +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_build_alias=$build_alias test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` + ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 +ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; @@ -2356,21 +2668,22 @@ IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 + ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; @@ -2389,21 +2702,22 @@ IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 -$as_echo_n "checking target system type... " >&6; } -if ${ac_cv_target+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +printf %s "checking target system type... " >&6; } +if test ${ac_cv_target+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else - ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 + ac_cv_target=`$SHELL "${ac_aux_dir}config.sub" $target_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $target_alias failed" "$LINENO" 5 fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 -$as_echo "$ac_cv_target" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +printf "%s\n" "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; @@ -2439,10 +2753,10 @@ if test "$CC" = ""; then CC=$MAKECC else if test "$CC" != "$MAKECC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You are running configure with the compiler ($CC) set to a different value from that used by gnustep-make ($MAKECC). To a + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: You are running configure with the compiler ($CC) set to a different value from that used by gnustep-make ($MAKECC). To a void conflicts/problems, reconfigure/reinstall gnustep-make to use $CC or run the gnustep-base configure again with your CC environment var iable set to $MAKECC" >&5 -$as_echo "$as_me: WARNING: You are running configure with the compiler ($CC) set to a different value from that used by gnustep-make ($MAKECC). To a +printf "%s\n" "$as_me: WARNING: You are running configure with the compiler ($CC) set to a different value from that used by gnustep-make ($MAKECC). To a void conflicts/problems, reconfigure/reinstall gnustep-make to use $CC or run the gnustep-base configure again with your CC environment var iable set to $MAKECC" >&2;} fi @@ -2451,10 +2765,10 @@ if test "$CPP" = ""; then CPP=$MAKECPP else if test "$CPP" != "$MAKECPP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You are running configure with the preprocessor ($CPP) set to a different value from that used by gnustep-make ($MAKECPP). + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: You are running configure with the preprocessor ($CPP) set to a different value from that used by gnustep-make ($MAKECPP). To avoid conflicts/problems, reconfigure/reinstall gnustep-make to use $CPP or run the gnustep-base configure again with your CPP environ ment variable set to $MAKECPP" >&5 -$as_echo "$as_me: WARNING: You are running configure with the preprocessor ($CPP) set to a different value from that used by gnustep-make ($MAKECPP). +printf "%s\n" "$as_me: WARNING: You are running configure with the preprocessor ($CPP) set to a different value from that used by gnustep-make ($MAKECPP). To avoid conflicts/problems, reconfigure/reinstall gnustep-make to use $CPP or run the gnustep-base configure again with your CPP environ ment variable set to $MAKECPP" >&2;} fi @@ -2463,14 +2777,23 @@ if test "$CXX" = ""; then CXX=$MAKECXX else if test "$CXX" != "$MAKECXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You are running configure with the compiler ($CXX) set to a different value from that used by gnustep-make ($MAKECXX). To + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: You are running configure with the compiler ($CXX) set to a different value from that used by gnustep-make ($MAKECXX). To avoid conflicts/problems, reconfigure/reinstall gnustep-make to use $CXX or run the gnustep-base configure again with your CXX environment variable set to $MAKECXX" >&5 -$as_echo "$as_me: WARNING: You are running configure with the compiler ($CXX) set to a different value from that used by gnustep-make ($MAKECXX). To +printf "%s\n" "$as_me: WARNING: You are running configure with the compiler ($CXX) set to a different value from that used by gnustep-make ($MAKECXX). To avoid conflicts/problems, reconfigure/reinstall gnustep-make to use $CXX or run the gnustep-base configure again with your CXX environment variable set to $MAKECXX" >&2;} fi fi + + + + + + + + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2479,11 +2802,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -2491,11 +2815,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2506,11 +2834,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2519,11 +2847,12 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -2531,11 +2860,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2546,11 +2879,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -2558,8 +2891,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2572,11 +2905,12 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -2584,11 +2918,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2599,11 +2937,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2612,11 +2950,12 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -2625,15 +2964,19 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2649,18 +2992,18 @@ if test $ac_prog_rejected = yes; then # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2671,11 +3014,12 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -2683,11 +3027,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2698,11 +3046,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2715,11 +3063,12 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -2727,11 +3076,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2742,11 +3095,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2758,34 +3111,138 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi +else + CC="$ac_cv_prog_CC" fi fi -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -for ac_option in --version -v -V -qversion; do +for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -2795,7 +3252,7 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done @@ -2803,7 +3260,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -2815,9 +3272,9 @@ ac_clean_files="$ac_clean_files a.out a.out.dSYM 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. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" @@ -2838,11 +3295,12 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, @@ -2859,7 +3317,7 @@ do # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi @@ -2875,44 +3333,46 @@ do done test "$ac_cv_exeext" = no && ac_cv_exeext= -else +else $as_nop ac_file='' fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -2926,15 +3386,15 @@ for ac_file in conftest.exe conftest conftest.*; do * ) break;; esac done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext @@ -2943,7 +3403,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; @@ -2955,8 +3415,8 @@ _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in @@ -2964,10 +3424,10 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in @@ -2975,39 +3435,40 @@ $as_echo "$ac_try_echo"; } >&5 *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -3021,11 +3482,12 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in @@ -3034,31 +3496,32 @@ $as_echo "$ac_try_echo"; } >&5 break;; esac done -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -3068,29 +3531,33 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else +else $as_nop ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi -ac_test_CFLAGS=${CFLAGS+set} +ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no @@ -3099,57 +3566,60 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes -else +else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then @@ -3164,94 +3634,144 @@ else CFLAGS= fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - 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 -std 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 -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program _ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : + if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_c89=$ac_arg fi -rm -f core conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC - fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi fi ac_ext=c @@ -3265,40 +3785,36 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +printf %s "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + if test ${ac_cv_prog_CPP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # Double quotes because $CC needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. # 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif +#include Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : -else +else $as_nop # Broken: fails on valid input. continue fi @@ -3310,10 +3826,11 @@ rm -f conftest.err conftest.i conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : # Broken: success on invalid input. continue -else +else $as_nop # Passes both tests. ac_preproc_ok=: break @@ -3323,7 +3840,8 @@ rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +if $ac_preproc_ok +then : break fi @@ -3335,29 +3853,24 @@ fi else ac_cv_prog_CPP=$CPP fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +printf "%s\n" "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. # 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif +#include Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : -else +else $as_nop # Broken: fails on valid input. continue fi @@ -3369,10 +3882,11 @@ rm -f conftest.err conftest.i conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : # Broken: success on invalid input. continue -else +else $as_nop # Passes both tests. ac_preproc_ok=: break @@ -3382,11 +3896,12 @@ rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +if $ac_preproc_ok +then : -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi @@ -3403,11 +3918,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu #-------------------------------------------------------------------- # Extract the first word of "whoami", so it can be a program name with args. set dummy whoami; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_WHOAMI+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_WHOAMI+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $WHOAMI in [\\/]* | ?:[\\/]*) ac_cv_path_WHOAMI="$WHOAMI" # Let the user override the test with a path. @@ -3418,11 +3934,15 @@ as_dummy="$PATH:/usr/ucb" for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_WHOAMI="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_WHOAMI="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3435,11 +3955,11 @@ esac fi WHOAMI=$ac_cv_path_WHOAMI if test -n "$WHOAMI"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WHOAMI" >&5 -$as_echo "$WHOAMI" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $WHOAMI" >&5 +printf "%s\n" "$WHOAMI" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3454,11 +3974,12 @@ if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. @@ -3468,11 +3989,15 @@ else for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3484,11 +4009,11 @@ esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +printf "%s\n" "$PKG_CONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3497,11 +4022,12 @@ if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. @@ -3511,11 +4037,15 @@ else for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3527,11 +4057,11 @@ esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 -$as_echo "$ac_pt_PKG_CONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +printf "%s\n" "$ac_pt_PKG_CONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then @@ -3539,8 +4069,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG @@ -3552,14 +4082,14 @@ fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 -$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +printf %s "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } PKG_CONFIG="" fi fi @@ -3568,11 +4098,12 @@ fi if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. @@ -3582,11 +4113,15 @@ else for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3598,11 +4133,11 @@ esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +printf "%s\n" "$PKG_CONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3623,12 +4158,13 @@ esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 -$as_echo_n "checking for X... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for X" >&5 +printf %s "checking for X... " >&6; } # Check whether --with-x was given. -if test "${with_x+set}" = set; then : +if test ${with_x+y} +then : withval=$with_x; fi @@ -3639,12 +4175,41 @@ if test "x$with_x" = xno; then else case $x_includes,$x_libraries in #( *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( - *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then : - $as_echo_n "(cached) " >&6 -else + *,NONE | NONE,*) if test ${ac_cv_have_x+y} +then : + printf %s "(cached) " >&6 +else $as_nop # One or both of the vars are not set, and there is no cached value. -ac_x_includes=no ac_x_libraries=no -rm -f -r conftest.dir +ac_x_includes=no +ac_x_libraries=no +# Do we need to do anything special at all? +ac_save_LIBS=$LIBS +LIBS="-lX11 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +XrmInitialize () + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + # We can compile and link X programs with no special options. + ac_x_includes= + ac_x_libraries= +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS="$ac_save_LIBS" +# If that didn't work, only try xmkmf and file system searches +# for native compilation. +if test x"$ac_x_includes" = xno && test "$cross_compiling" = no +then : + rm -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir cat >Imakefile <<'_ACEOF' @@ -3683,7 +4248,7 @@ _ACEOF rm -f -r conftest.dir fi -# Standard set of common directories for X headers. + # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include @@ -3710,6 +4275,8 @@ ac_x_header_dirs=' /usr/local/include/X11R5 /usr/local/include/X11R4 +/opt/X11/include + /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 @@ -3731,10 +4298,11 @@ if test "$ac_x_includes" = no; then /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : # We can compile using X headers with no special include directory. ac_x_includes= -else +else $as_nop for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir @@ -3755,20 +4323,21 @@ if test "$ac_x_libraries" = no; then /* end confdefs.h. */ #include int -main () +main (void) { XrmInitialize () ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= -else +else $as_nop LIBS=$ac_save_LIBS -for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` +for ac_dir in `printf "%s\n" "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl dylib la dll; do @@ -3779,19 +4348,21 @@ do done done fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no +fi +# Record the results. case $ac_x_includes,$ac_x_libraries in #( - no,* | *,no | *\'*) + no,* | *,no | *\'*) : # Didn't find X, or a directory has "'" in its name. - ac_cv_have_x="have_x=no";; #( - *) + ac_cv_have_x="have_x=no" ;; #( + *) : # 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_libraries='$ac_x_libraries'" ;; esac fi ;; #( @@ -3801,8 +4372,8 @@ fi fi # $with_x != no if test "$have_x" != yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 -$as_echo "$have_x" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 +printf "%s\n" "$have_x" >&6; } no_x=yes else # If each of the values was on the command line, it overrides each guess. @@ -3812,8 +4383,8 @@ else ac_cv_have_x="have_x=yes\ ac_x_includes='$x_includes'\ ac_x_libraries='$x_libraries'" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 -$as_echo "libraries $x_libraries, headers $x_includes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 +printf "%s\n" "libraries $x_libraries, headers $x_includes" >&6; } fi # Added for checking the existence of ungif. Note that # -gui uses the API of the underlying window system ONLY IF @@ -3857,11 +4428,12 @@ CPPFLAGS="$CPPFLAGS -I$GNUSTEP_HDIR" LDFLAGS="$LDFLAGS -L$GNUSTEP_LDIR/$LIBRARY_COMBO -L$GNUSTEP_LDIR" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lm" >&5 -$as_echo_n "checking for main in -lm... " >&6; } -if ${ac_cv_lib_m_main+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lm" >&5 +printf %s "checking for main in -lm... " >&6; } +if test ${ac_cv_lib_m_main+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3869,372 +4441,150 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext int -main () +main (void) { return main (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_m_main=yes -else +else $as_nop ac_cv_lib_m_main=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_main" >&5 -$as_echo "$ac_cv_lib_m_main" >&6; } -if test "x$ac_cv_lib_m_main" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBM 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_main" >&5 +printf "%s\n" "$ac_cv_lib_m_main" >&6; } +if test "x$ac_cv_lib_m_main" = xyes +then : + printf "%s\n" "#define HAVE_LIBM 1" >>confdefs.h LIBS="-lm $LIBS" fi -for ac_func in rint rintf atan2f floorf -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "rint" "ac_cv_func_rint" +if test "x$ac_cv_func_rint" = xyes +then : + printf "%s\n" "#define HAVE_RINT 1" >>confdefs.h fi -done - - +ac_fn_c_check_func "$LINENO" "rintf" "ac_cv_func_rintf" +if test "x$ac_cv_func_rintf" = xyes +then : + printf "%s\n" "#define HAVE_RINTF 1" >>confdefs.h -#-------------------------------------------------------------------- -# Support for determining mountpoints -#-------------------------------------------------------------------- -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac +fi +ac_fn_c_check_func "$LINENO" "atan2f" "ac_cv_func_atan2f" +if test "x$ac_cv_func_atan2f" = xyes +then : + printf "%s\n" "#define HAVE_ATAN2F 1" >>confdefs.h - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP fi +ac_fn_c_check_func "$LINENO" "floorf" "ac_cv_func_floorf" +if test "x$ac_cv_func_floorf" = xyes +then : + printf "%s\n" "#define HAVE_FLOORF 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin + +#-------------------------------------------------------------------- +# Support for determining mountpoints +#-------------------------------------------------------------------- +ac_header= ac_cache= +for ac_item in $ac_header_c_list do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core 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 confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include +done -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : -else - ac_cv_header_stdc=no -fi -rm -f conftest* -fi -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# 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')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then -$as_echo "#define STDC_HEADERS 1" >>confdefs.h -fi +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi - -done - - -for ac_header in mntent.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "mntent.h" "ac_cv_header_mntent_h" "$ac_includes_default" -if test "x$ac_cv_header_mntent_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_MNTENT_H 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "mntent.h" "ac_cv_header_mntent_h" "$ac_includes_default" +if test "x$ac_cv_header_mntent_h" = xyes +then : + printf "%s\n" "#define HAVE_MNTENT_H 1" >>confdefs.h fi -done - -for ac_header in sys/mntent.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/mntent.h" "ac_cv_header_sys_mntent_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_mntent_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_MNTENT_H 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "sys/mntent.h" "ac_cv_header_sys_mntent_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_mntent_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_MNTENT_H 1" >>confdefs.h fi -done - ac_fn_c_check_member "$LINENO" "struct mntent" "mnt_fsname" "ac_cv_member_struct_mntent_mnt_fsname" "#include " -if test "x$ac_cv_member_struct_mntent_mnt_fsname" = xyes; then : +if test "x$ac_cv_member_struct_mntent_mnt_fsname" = xyes +then : -$as_echo "#define MNT_FSNAME mnt_fsname" >>confdefs.h +printf "%s\n" "#define MNT_FSNAME mnt_fsname" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct mntent" "mnt_fsname" "ac_cv_member_struct_mntent_mnt_fsname" "#include " -if test "x$ac_cv_member_struct_mntent_mnt_fsname" = xyes; then : +if test "x$ac_cv_member_struct_mntent_mnt_fsname" = xyes +then : -$as_echo "#define MNT_FSNAME mnt_fsname" >>confdefs.h +printf "%s\n" "#define MNT_FSNAME mnt_fsname" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct mntent" "mnt_dir" "ac_cv_member_struct_mntent_mnt_dir" "#include " -if test "x$ac_cv_member_struct_mntent_mnt_dir" = xyes; then : +if test "x$ac_cv_member_struct_mntent_mnt_dir" = xyes +then : -$as_echo "#define MNT_MEMB mnt_dir" >>confdefs.h +printf "%s\n" "#define MNT_MEMB mnt_dir" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct mntent" "mnt_mountp" "ac_cv_member_struct_mntent_mnt_mountp" "#include " -if test "x$ac_cv_member_struct_mntent_mnt_mountp" = xyes; then : +if test "x$ac_cv_member_struct_mntent_mnt_mountp" = xyes +then : -$as_echo "#define MNT_MEMB mnt_mountp" >>confdefs.h +printf "%s\n" "#define MNT_MEMB mnt_mountp" >>confdefs.h fi # getmntent is in the standard C library on UNICOS, in -lsun on Irix 4, # -lseq on Dynix/PTX, -lgen on Unixware. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getmntent" >&5 -$as_echo_n "checking for library containing getmntent... " >&6; } -if ${ac_cv_search_getmntent+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing getmntent" >&5 +printf %s "checking for library containing getmntent... " >&6; } +if test ${ac_cv_search_getmntent+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4242,113 +4592,93 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char getmntent (); int -main () +main (void) { return getmntent (); ; return 0; } _ACEOF -for ac_lib in '' sun seq gen; do +for ac_lib in '' sun seq gen +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_getmntent=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_getmntent+:} false; then : + if test ${ac_cv_search_getmntent+y} +then : break fi done -if ${ac_cv_search_getmntent+:} false; then : +if test ${ac_cv_search_getmntent+y} +then : -else +else $as_nop ac_cv_search_getmntent=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getmntent" >&5 -$as_echo "$ac_cv_search_getmntent" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getmntent" >&5 +printf "%s\n" "$ac_cv_search_getmntent" >&6; } ac_res=$ac_cv_search_getmntent -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" ac_cv_func_getmntent=yes -$as_echo "#define HAVE_GETMNTENT 1" >>confdefs.h +printf "%s\n" "#define HAVE_GETMNTENT 1" >>confdefs.h -else +else $as_nop ac_cv_func_getmntent=no fi -for ac_func in getmntinfo -do : - ac_fn_c_check_func "$LINENO" "getmntinfo" "ac_cv_func_getmntinfo" -if test "x$ac_cv_func_getmntinfo" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GETMNTINFO 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "getmntinfo" "ac_cv_func_getmntinfo" +if test "x$ac_cv_func_getmntinfo" = xyes +then : + printf "%s\n" "#define HAVE_GETMNTINFO 1" >>confdefs.h fi -done -for ac_func in statfs -do : - ac_fn_c_check_func "$LINENO" "statfs" "ac_cv_func_statfs" -if test "x$ac_cv_func_statfs" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STATFS 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "statfs" "ac_cv_func_statfs" +if test "x$ac_cv_func_statfs" = xyes +then : + printf "%s\n" "#define HAVE_STATFS 1" >>confdefs.h fi -done -for ac_func in statvfs -do : - ac_fn_c_check_func "$LINENO" "statvfs" "ac_cv_func_statvfs" -if test "x$ac_cv_func_statvfs" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STATVFS 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "statvfs" "ac_cv_func_statvfs" +if test "x$ac_cv_func_statvfs" = xyes +then : + printf "%s\n" "#define HAVE_STATVFS 1" >>confdefs.h fi -done -for ac_header in sys/statvfs.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/statvfs.h" "ac_cv_header_sys_statvfs_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_statvfs_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_STATVFS_H 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "sys/statvfs.h" "ac_cv_header_sys_statvfs_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_statvfs_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_STATVFS_H 1" >>confdefs.h fi -done - -for ac_header in sys/vfs.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/vfs.h" "ac_cv_header_sys_vfs_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_vfs_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_VFS_H 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "sys/vfs.h" "ac_cv_header_sys_vfs_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_vfs_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_VFS_H 1" >>confdefs.h fi -done - ac_fn_c_check_member "$LINENO" "struct statfs" "f_flags" "ac_cv_member_struct_statfs_f_flags" " #if defined(HAVE_GETMNTINFO) @@ -4363,11 +4693,10 @@ ac_fn_c_check_member "$LINENO" "struct statfs" "f_flags" "ac_cv_member_struct_st #endif " -if test "x$ac_cv_member_struct_statfs_f_flags" = xyes; then : +if test "x$ac_cv_member_struct_statfs_f_flags" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STATFS_F_FLAGS 1 -_ACEOF +printf "%s\n" "#define HAVE_STRUCT_STATFS_F_FLAGS 1" >>confdefs.h fi @@ -4384,11 +4713,10 @@ ac_fn_c_check_member "$LINENO" "struct statfs" "f_owner" "ac_cv_member_struct_st #endif " -if test "x$ac_cv_member_struct_statfs_f_owner" = xyes; then : +if test "x$ac_cv_member_struct_statfs_f_owner" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STATFS_F_OWNER 1 -_ACEOF +printf "%s\n" "#define HAVE_STRUCT_STATFS_F_OWNER 1" >>confdefs.h fi @@ -4399,11 +4727,10 @@ ac_fn_c_check_member "$LINENO" "struct statvfs" "f_flag" "ac_cv_member_struct_st #endif " -if test "x$ac_cv_member_struct_statvfs_f_flag" = xyes; then : +if test "x$ac_cv_member_struct_statvfs_f_flag" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STATVFS_F_FLAG 1 -_ACEOF +printf "%s\n" "#define HAVE_STRUCT_STATVFS_F_FLAG 1" >>confdefs.h fi @@ -4413,11 +4740,10 @@ ac_fn_c_check_member "$LINENO" "struct statvfs" "f_owner" "ac_cv_member_struct_s #endif " -if test "x$ac_cv_member_struct_statvfs_f_owner" = xyes; then : +if test "x$ac_cv_member_struct_statvfs_f_owner" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STATVFS_F_OWNER 1 -_ACEOF +printf "%s\n" "#define HAVE_STRUCT_STATVFS_F_OWNER 1" >>confdefs.h fi @@ -4428,9 +4754,10 @@ fi #-------------------------------------------------------------------- # Check whether --with-include-flags was given. -if test "${with_include_flags+set}" = set; then : +if test ${with_include_flags+y} +then : withval=$with_include_flags; include_flags="$withval" -else +else $as_nop include_flags="no" fi @@ -4441,9 +4768,10 @@ fi # Check whether --with-library-flags was given. -if test "${with_library_flags+set}" = set; then : +if test ${with_library_flags+y} +then : withval=$with_library_flags; library_flags="$withval" -else +else $as_nop library_flags="no" fi @@ -4459,9 +4787,10 @@ GRAPHIC_CFLAGS= GRAPHIC_LFLAGS= # Check whether --enable-jpeg was given. -if test "${enable_jpeg+set}" = set; then : +if test ${enable_jpeg+y} +then : enableval=$enable_jpeg; -else +else $as_nop enable_jpeg=yes fi @@ -4469,17 +4798,19 @@ fi if test $enable_jpeg = yes; then # Check whether --with-jpeg_library was given. -if test "${with_jpeg_library+set}" = set; then : +if test ${with_jpeg_library+y} +then : withval=$with_jpeg_library; -else +else $as_nop with_jpeg_library= fi # Check whether --with-jpeg_include was given. -if test "${with_jpeg_include+set}" = set; then : +if test ${with_jpeg_include+y} +then : withval=$with_jpeg_include; -else +else $as_nop with_jpeg_include= fi @@ -4493,26 +4824,25 @@ fi CPPFLAGS="$with_jpeg_include ${CPPFLAGS}" LDFLAGS="$with_jpeg_library ${LDFLAGS}" - for ac_header in jpeglib.h + for ac_header in jpeglib.h do : - ac_fn_c_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default" -if test "x$ac_cv_header_jpeglib_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_JPEGLIB_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default" +if test "x$ac_cv_header_jpeglib_h" = xyes +then : + printf "%s\n" "#define HAVE_JPEGLIB_H 1" >>confdefs.h have_jpeg=yes -else +else $as_nop have_jpeg=no fi done - if test "$have_jpeg" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_destroy_decompress in -ljpeg" >&5 -$as_echo_n "checking for jpeg_destroy_decompress in -ljpeg... " >&6; } -if ${ac_cv_lib_jpeg_jpeg_destroy_decompress+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for jpeg_destroy_decompress in -ljpeg" >&5 +printf %s "checking for jpeg_destroy_decompress in -ljpeg... " >&6; } +if test ${ac_cv_lib_jpeg_jpeg_destroy_decompress+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ljpeg $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4521,33 +4851,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char jpeg_destroy_decompress (); int -main () +main (void) { return jpeg_destroy_decompress (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_jpeg_jpeg_destroy_decompress=yes -else +else $as_nop ac_cv_lib_jpeg_jpeg_destroy_decompress=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_destroy_decompress" >&5 -$as_echo "$ac_cv_lib_jpeg_jpeg_destroy_decompress" >&6; } -if test "x$ac_cv_lib_jpeg_jpeg_destroy_decompress" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBJPEG 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_destroy_decompress" >&5 +printf "%s\n" "$ac_cv_lib_jpeg_jpeg_destroy_decompress" >&6; } +if test "x$ac_cv_lib_jpeg_jpeg_destroy_decompress" = xyes +then : + printf "%s\n" "#define HAVE_LIBJPEG 1" >>confdefs.h LIBS="-ljpeg $LIBS" @@ -4575,17 +4902,19 @@ fi #-------------------------------------------------------------------- # Check whether --with-tiff_library was given. -if test "${with_tiff_library+set}" = set; then : +if test ${with_tiff_library+y} +then : withval=$with_tiff_library; -else +else $as_nop with_tiff_library= fi # Check whether --with-tiff_include was given. -if test "${with_tiff_include+set}" = set; then : +if test ${with_tiff_include+y} +then : withval=$with_tiff_include; -else +else $as_nop with_tiff_include= fi @@ -4599,11 +4928,12 @@ fi CPPFLAGS="$with_tiff_include ${CPPFLAGS}" LDFLAGS="$with_tiff_library ${LDFLAGS}" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lz" >&5 -$as_echo_n "checking for main in -lz... " >&6; } -if ${ac_cv_lib_z_main+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lz" >&5 +printf %s "checking for main in -lz... " >&6; } +if test ${ac_cv_lib_z_main+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4611,47 +4941,48 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext int -main () +main (void) { return main (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_z_main=yes -else +else $as_nop ac_cv_lib_z_main=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_main" >&5 -$as_echo "$ac_cv_lib_z_main" >&6; } -if test "x$ac_cv_lib_z_main" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBZ 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_main" >&5 +printf "%s\n" "$ac_cv_lib_z_main" >&6; } +if test "x$ac_cv_lib_z_main" = xyes +then : + printf "%s\n" "#define HAVE_LIBZ 1" >>confdefs.h LIBS="-lz $LIBS" fi -ac_fn_c_check_header_mongrel "$LINENO" "tiffio.h" "ac_cv_header_tiffio_h" "$ac_includes_default" -if test "x$ac_cv_header_tiffio_h" = xyes; then : +ac_fn_c_check_header_compile "$LINENO" "tiffio.h" "ac_cv_header_tiffio_h" "$ac_includes_default" +if test "x$ac_cv_header_tiffio_h" = xyes +then : have_tiff=yes -else +else $as_nop have_tiff=no fi - if test "$have_tiff" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIFFReadScanline in -ltiff" >&5 -$as_echo_n "checking for TIFFReadScanline in -ltiff... " >&6; } -if ${ac_cv_lib_tiff_TIFFReadScanline+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for TIFFReadScanline in -ltiff" >&5 +printf %s "checking for TIFFReadScanline in -ltiff... " >&6; } +if test ${ac_cv_lib_tiff_TIFFReadScanline+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ltiff $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4660,33 +4991,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char TIFFReadScanline (); int -main () +main (void) { return TIFFReadScanline (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_tiff_TIFFReadScanline=yes -else +else $as_nop ac_cv_lib_tiff_TIFFReadScanline=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFReadScanline" >&5 -$as_echo "$ac_cv_lib_tiff_TIFFReadScanline" >&6; } -if test "x$ac_cv_lib_tiff_TIFFReadScanline" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBTIFF 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFReadScanline" >&5 +printf "%s\n" "$ac_cv_lib_tiff_TIFFReadScanline" >&6; } +if test "x$ac_cv_lib_tiff_TIFFReadScanline" = xyes +then : + printf "%s\n" "#define HAVE_LIBTIFF 1" >>confdefs.h LIBS="-ltiff $LIBS" @@ -4698,17 +5026,17 @@ fi else pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libtiff-4" >&5 -$as_echo_n "checking for libtiff-4... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libtiff-4" >&5 +printf %s "checking for libtiff-4... " >&6; } if test -n "$TIFF_CFLAGS"; then pkg_cv_TIFF_CFLAGS="$TIFF_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libtiff-4\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libtiff-4\""; } >&5 ($PKG_CONFIG --exists --print-errors "libtiff-4") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_TIFF_CFLAGS=`$PKG_CONFIG --cflags "libtiff-4" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -4722,10 +5050,10 @@ if test -n "$TIFF_LIBS"; then pkg_cv_TIFF_LIBS="$TIFF_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libtiff-4\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libtiff-4\""; } >&5 ($PKG_CONFIG --exists --print-errors "libtiff-4") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_TIFF_LIBS=`$PKG_CONFIG --libs "libtiff-4" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -4739,8 +5067,8 @@ fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -4759,16 +5087,16 @@ fi have_tiff=no elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } have_tiff=no else TIFF_CFLAGS=$pkg_cv_TIFF_CFLAGS TIFF_LIBS=$pkg_cv_TIFF_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } GRAPHIC_LFLAGS="$TIFF_LIBS $GRAPHIC_LFLAGS" GRAPHIC_CFLAGS="$TIFF_CFLAGS $GRAPHIC_CFLAGS" @@ -4778,8 +5106,8 @@ fi fi if test "$have_tiff" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find libtiff header and/or library" >&5 -$as_echo "$as_me: WARNING: Cannot find libtiff header and/or library" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find libtiff header and/or library" >&5 +printf "%s\n" "$as_me: WARNING: Cannot find libtiff header and/or library" >&2;} echo "* The GUI library reqiures the TIFF library" echo "* Use --with-tiff-library to specify the tiff library" echo "* directory if it is not in the usual place(s)" @@ -4792,9 +5120,10 @@ fi # Find PNG #-------------------------------------------------------------------- # Check whether --enable-png was given. -if test "${enable_png+set}" = set; then : +if test ${enable_png+y} +then : enableval=$enable_png; -else +else $as_nop enable_png=yes fi @@ -4803,11 +5132,12 @@ if test $enable_png = yes; then # use libpng-config if available # Extract the first word of "libpng-config", so it can be a program name with args. set dummy libpng-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_HAVE_LIBPNG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_HAVE_LIBPNG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$HAVE_LIBPNG_CONFIG"; then ac_cv_prog_HAVE_LIBPNG_CONFIG="$HAVE_LIBPNG_CONFIG" # Let the user override the test. else @@ -4815,11 +5145,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_HAVE_LIBPNG_CONFIG="yes" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4830,11 +5164,11 @@ fi fi HAVE_LIBPNG_CONFIG=$ac_cv_prog_HAVE_LIBPNG_CONFIG if test -n "$HAVE_LIBPNG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_LIBPNG_CONFIG" >&5 -$as_echo "$HAVE_LIBPNG_CONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $HAVE_LIBPNG_CONFIG" >&5 +printf "%s\n" "$HAVE_LIBPNG_CONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4843,23 +5177,19 @@ fi PNG_LDFLAGS="`libpng-config --ldflags`" CPPFLAGS="${CPPFLAGS} $PNG_CFLAGS" LDFLAGS="$PNG_LDFLAGS ${LDFLAGS}" - for ac_header in png.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "png.h" "ac_cv_header_png_h" "$ac_includes_default" -if test "x$ac_cv_header_png_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PNG_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "png.h" "ac_cv_header_png_h" "$ac_includes_default" +if test "x$ac_cv_header_png_h" = xyes +then : + printf "%s\n" "#define HAVE_PNG_H 1" >>confdefs.h fi -done - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_sig_cmp in -lpng" >&5 -$as_echo_n "checking for png_sig_cmp in -lpng... " >&6; } -if ${ac_cv_lib_png_png_sig_cmp+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for png_sig_cmp in -lpng" >&5 +printf %s "checking for png_sig_cmp in -lpng... " >&6; } +if test ${ac_cv_lib_png_png_sig_cmp+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpng $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4868,33 +5198,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char png_sig_cmp (); int -main () +main (void) { return png_sig_cmp (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_png_png_sig_cmp=yes -else +else $as_nop ac_cv_lib_png_png_sig_cmp=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_sig_cmp" >&5 -$as_echo "$ac_cv_lib_png_png_sig_cmp" >&6; } -if test "x$ac_cv_lib_png_png_sig_cmp" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBPNG 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_sig_cmp" >&5 +printf "%s\n" "$ac_cv_lib_png_png_sig_cmp" >&6; } +if test "x$ac_cv_lib_png_png_sig_cmp" = xyes +then : + printf "%s\n" "#define HAVE_LIBPNG 1" >>confdefs.h LIBS="-lpng $LIBS" @@ -4903,29 +5230,25 @@ fi if test "$ac_cv_search_png_sig_cmp" != no; then GRAPHIC_CFLAGS="$PNG_CFLAGS $GRAPHIC_CFLAGS" GRAPHIC_LFLAGS="$PNG_LDFLAGS $GRAPHIC_LFLAGS" - $as_echo "#define HAVE_LIBPNG 1" >>confdefs.h + printf "%s\n" "#define HAVE_LIBPNG 1" >>confdefs.h fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't find libpng-config, guessing required headers and libraries." >&5 -$as_echo "$as_me: WARNING: Can't find libpng-config, guessing required headers and libraries." >&2;} - for ac_header in png.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "png.h" "ac_cv_header_png_h" "$ac_includes_default" -if test "x$ac_cv_header_png_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PNG_H 1 -_ACEOF + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Can't find libpng-config, guessing required headers and libraries." >&5 +printf "%s\n" "$as_me: WARNING: Can't find libpng-config, guessing required headers and libraries." >&2;} + ac_fn_c_check_header_compile "$LINENO" "png.h" "ac_cv_header_png_h" "$ac_includes_default" +if test "x$ac_cv_header_png_h" = xyes +then : + printf "%s\n" "#define HAVE_PNG_H 1" >>confdefs.h fi -done - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_sig_cmp in -lpng" >&5 -$as_echo_n "checking for png_sig_cmp in -lpng... " >&6; } -if ${ac_cv_lib_png_png_sig_cmp+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for png_sig_cmp in -lpng" >&5 +printf %s "checking for png_sig_cmp in -lpng... " >&6; } +if test ${ac_cv_lib_png_png_sig_cmp+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpng $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4934,33 +5257,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char png_sig_cmp (); int -main () +main (void) { return png_sig_cmp (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_png_png_sig_cmp=yes -else +else $as_nop ac_cv_lib_png_png_sig_cmp=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_sig_cmp" >&5 -$as_echo "$ac_cv_lib_png_png_sig_cmp" >&6; } -if test "x$ac_cv_lib_png_png_sig_cmp" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBPNG 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_sig_cmp" >&5 +printf "%s\n" "$ac_cv_lib_png_png_sig_cmp" >&6; } +if test "x$ac_cv_lib_png_png_sig_cmp" = xyes +then : + printf "%s\n" "#define HAVE_LIBPNG 1" >>confdefs.h LIBS="-lpng $LIBS" @@ -4983,16 +5303,18 @@ fi # Find additional image libs #-------------------------------------------------------------------- # Check whether --enable-ungif was given. -if test "${enable_ungif+set}" = set; then : +if test ${enable_ungif+y} +then : enableval=$enable_ungif; -else +else $as_nop enable_ungif=yes fi # Check whether --enable-libgif was given. -if test "${enable_libgif+set}" = set; then : +if test ${enable_libgif+y} +then : enableval=$enable_libgif; -else +else $as_nop enable_libgif=no fi @@ -5002,11 +5324,12 @@ fi have_ungif=no if test "${enable_ungif}" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DGifOpen in -lungif" >&5 -$as_echo_n "checking for DGifOpen in -lungif... " >&6; } -if ${ac_cv_lib_ungif_DGifOpen+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for DGifOpen in -lungif" >&5 +printf %s "checking for DGifOpen in -lungif... " >&6; } +if test ${ac_cv_lib_ungif_DGifOpen+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lungif $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5015,33 +5338,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char DGifOpen (); int -main () +main (void) { return DGifOpen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_ungif_DGifOpen=yes -else +else $as_nop ac_cv_lib_ungif_DGifOpen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ungif_DGifOpen" >&5 -$as_echo "$ac_cv_lib_ungif_DGifOpen" >&6; } -if test "x$ac_cv_lib_ungif_DGifOpen" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBUNGIF 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ungif_DGifOpen" >&5 +printf "%s\n" "$ac_cv_lib_ungif_DGifOpen" >&6; } +if test "x$ac_cv_lib_ungif_DGifOpen" = xyes +then : + printf "%s\n" "#define HAVE_LIBUNGIF 1" >>confdefs.h LIBS="-lungif $LIBS" @@ -5055,8 +5375,8 @@ fi orig_CPPFLAGS="${CPPFLAGS}" orig_LDFLAGS="${LDFLAGS}" orig_LIBS="${LIBS}" - { $as_echo "$as_me:${as_lineno-$LINENO}: Checking if ungif is linked against -lX11" >&5 -$as_echo "$as_me: Checking if ungif is linked against -lX11" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Checking if ungif is linked against -lX11" >&5 +printf "%s\n" "$as_me: Checking if ungif is linked against -lX11" >&6;} # This implies either that ungif is not installed at all, or that it # explicitly refers to the symbols defined in X11. Now see if the latter # is the case. @@ -5064,11 +5384,12 @@ $as_echo "$as_me: Checking if ungif is linked against -lX11" >&6;} LDFLAGS="${LDFLAGS} -L${ac_x_libraries}" LIBS="${LIBS} -lX11" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DGifCloseFile in -lungif" >&5 -$as_echo_n "checking for DGifCloseFile in -lungif... " >&6; } -if ${ac_cv_lib_ungif_DGifCloseFile+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for DGifCloseFile in -lungif" >&5 +printf %s "checking for DGifCloseFile in -lungif... " >&6; } +if test ${ac_cv_lib_ungif_DGifCloseFile+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lungif $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5077,33 +5398,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char DGifCloseFile (); int -main () +main (void) { return DGifCloseFile (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_ungif_DGifCloseFile=yes -else +else $as_nop ac_cv_lib_ungif_DGifCloseFile=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ungif_DGifCloseFile" >&5 -$as_echo "$ac_cv_lib_ungif_DGifCloseFile" >&6; } -if test "x$ac_cv_lib_ungif_DGifCloseFile" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBUNGIF 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ungif_DGifCloseFile" >&5 +printf "%s\n" "$ac_cv_lib_ungif_DGifCloseFile" >&6; } +if test "x$ac_cv_lib_ungif_DGifCloseFile" = xyes +then : + printf "%s\n" "#define HAVE_LIBUNGIF 1" >>confdefs.h LIBS="-lungif $LIBS" @@ -5119,8 +5437,8 @@ fi # This indicates ungif actually refers to the X11's symbols. We modify # the flags so that -gui gets linked against the X11 library to support # ungif. - { $as_echo "$as_me:${as_lineno-$LINENO}: -gui will be linked against -lX11 to support ungif images" >&5 -$as_echo "$as_me: -gui will be linked against -lX11 to support ungif images" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -gui will be linked against -lX11 to support ungif images" >&5 +printf "%s\n" "$as_me: -gui will be linked against -lX11 to support ungif images" >&6;} GRAPHIC_CFLAGS="-I${ac_x_includes} $GRAPHIC_CFLAGS" GRAPHIC_LFLAGS="-L${ac_x_libraries} $GRAPHIC_LFLAGS" have_ungif=yes @@ -5129,11 +5447,12 @@ $as_echo "$as_me: -gui will be linked against -lX11 to support ungif images" >&6 fi if test "$have_ungif" = no -o "${enable_libgif}" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DGifOpen in -lgif" >&5 -$as_echo_n "checking for DGifOpen in -lgif... " >&6; } -if ${ac_cv_lib_gif_DGifOpen+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for DGifOpen in -lgif" >&5 +printf %s "checking for DGifOpen in -lgif... " >&6; } +if test ${ac_cv_lib_gif_DGifOpen+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lgif $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5142,33 +5461,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char DGifOpen (); int -main () +main (void) { return DGifOpen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_gif_DGifOpen=yes -else +else $as_nop ac_cv_lib_gif_DGifOpen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gif_DGifOpen" >&5 -$as_echo "$ac_cv_lib_gif_DGifOpen" >&6; } -if test "x$ac_cv_lib_gif_DGifOpen" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBGIF 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gif_DGifOpen" >&5 +printf "%s\n" "$ac_cv_lib_gif_DGifOpen" >&6; } +if test "x$ac_cv_lib_gif_DGifOpen" = xyes +then : + printf "%s\n" "#define HAVE_LIBGIF 1" >>confdefs.h LIBS="-lgif $LIBS" @@ -5179,8 +5495,8 @@ fi orig_CPPFLAGS="${CPPFLAGS}" orig_LDFLAGS="${LDFLAGS}" orig_LIBS="${LIBS}" - { $as_echo "$as_me:${as_lineno-$LINENO}: Checking if libgif is linked against -lX11" >&5 -$as_echo "$as_me: Checking if libgif is linked against -lX11" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Checking if libgif is linked against -lX11" >&5 +printf "%s\n" "$as_me: Checking if libgif is linked against -lX11" >&6;} # This implies either that libgif is not installed at all, or that it # explicitly refers to the symbols defined in X11. Now see if the latter # is the case. @@ -5188,11 +5504,12 @@ $as_echo "$as_me: Checking if libgif is linked against -lX11" >&6;} LDFLAGS="${LDFLAGS} -L${ac_x_libraries}" LIBS="${LIBS} -lX11" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DGifCloseFile in -lgif" >&5 -$as_echo_n "checking for DGifCloseFile in -lgif... " >&6; } -if ${ac_cv_lib_gif_DGifCloseFile+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for DGifCloseFile in -lgif" >&5 +printf %s "checking for DGifCloseFile in -lgif... " >&6; } +if test ${ac_cv_lib_gif_DGifCloseFile+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lgif $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5201,33 +5518,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char DGifCloseFile (); int -main () +main (void) { return DGifCloseFile (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_gif_DGifCloseFile=yes -else +else $as_nop ac_cv_lib_gif_DGifCloseFile=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gif_DGifCloseFile" >&5 -$as_echo "$ac_cv_lib_gif_DGifCloseFile" >&6; } -if test "x$ac_cv_lib_gif_DGifCloseFile" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBGIF 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gif_DGifCloseFile" >&5 +printf "%s\n" "$ac_cv_lib_gif_DGifCloseFile" >&6; } +if test "x$ac_cv_lib_gif_DGifCloseFile" = xyes +then : + printf "%s\n" "#define HAVE_LIBGIF 1" >>confdefs.h LIBS="-lgif $LIBS" @@ -5243,8 +5557,8 @@ fi # This indicates libgif actually refers to the X11's symbols. We modify # the flags so that -gui gets linked against the X11 library to support # libgif. - { $as_echo "$as_me:${as_lineno-$LINENO}: -gui will be linked against -lX11 to support libgif images" >&5 -$as_echo "$as_me: -gui will be linked against -lX11 to support libgif images" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -gui will be linked against -lX11 to support libgif images" >&5 +printf "%s\n" "$as_me: -gui will be linked against -lX11 to support libgif images" >&6;} GRAPHIC_CFLAGS="-I${ac_x_includes} $GRAPHIC_CFLAGS" GRAPHIC_LFLAGS="-L${ac_x_libraries} $GRAPHIC_LFLAGS" fi @@ -5254,27 +5568,19 @@ fi # QuantizeBuffer was removed from giflib in version 4.2 but was reintroduced # in the 5.0 release with a new name. If this function is not present # we disable the support to create gif image representations. -for ac_func in QuantizeBuffer -do : - ac_fn_c_check_func "$LINENO" "QuantizeBuffer" "ac_cv_func_QuantizeBuffer" -if test "x$ac_cv_func_QuantizeBuffer" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_QUANTIZEBUFFER 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "QuantizeBuffer" "ac_cv_func_QuantizeBuffer" +if test "x$ac_cv_func_QuantizeBuffer" = xyes +then : + printf "%s\n" "#define HAVE_QUANTIZEBUFFER 1" >>confdefs.h fi -done -for ac_func in GifQuantizeBuffer -do : - ac_fn_c_check_func "$LINENO" "GifQuantizeBuffer" "ac_cv_func_GifQuantizeBuffer" -if test "x$ac_cv_func_GifQuantizeBuffer" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GIFQUANTIZEBUFFER 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "GifQuantizeBuffer" "ac_cv_func_GifQuantizeBuffer" +if test "x$ac_cv_func_GifQuantizeBuffer" = xyes +then : + printf "%s\n" "#define HAVE_GIFQUANTIZEBUFFER 1" >>confdefs.h fi -done #-------------------------------------------------------------------- @@ -5282,25 +5588,27 @@ done #-------------------------------------------------------------------- # Check whether --enable-imagemagick was given. -if test "${enable_imagemagick+set}" = set; then : +if test ${enable_imagemagick+y} +then : enableval=$enable_imagemagick; fi -if test "x$enable_imagemagick" = "xyes"; then : +if test "x$enable_imagemagick" = "xyes" +then : pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MagickCore" >&5 -$as_echo_n "checking for MagickCore... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MagickCore" >&5 +printf %s "checking for MagickCore... " >&6; } if test -n "$IMAGEMAGICK_CFLAGS"; then pkg_cv_IMAGEMAGICK_CFLAGS="$IMAGEMAGICK_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"MagickCore\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"MagickCore\""; } >&5 ($PKG_CONFIG --exists --print-errors "MagickCore") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_IMAGEMAGICK_CFLAGS=`$PKG_CONFIG --cflags "MagickCore" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -5314,10 +5622,10 @@ if test -n "$IMAGEMAGICK_LIBS"; then pkg_cv_IMAGEMAGICK_LIBS="$IMAGEMAGICK_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"MagickCore\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"MagickCore\""; } >&5 ($PKG_CONFIG --exists --print-errors "MagickCore") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_IMAGEMAGICK_LIBS=`$PKG_CONFIG --libs "MagickCore" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -5331,8 +5639,8 @@ fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -5348,44 +5656,45 @@ fi echo "$IMAGEMAGICK_PKG_ERRORS" >&5 -$as_echo "#define HAVE_IMAGEMAGICK 0" >>confdefs.h +printf "%s\n" "#define HAVE_IMAGEMAGICK 0" >>confdefs.h elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } -$as_echo "#define HAVE_IMAGEMAGICK 0" >>confdefs.h +printf "%s\n" "#define HAVE_IMAGEMAGICK 0" >>confdefs.h else IMAGEMAGICK_CFLAGS=$pkg_cv_IMAGEMAGICK_CFLAGS IMAGEMAGICK_LIBS=$pkg_cv_IMAGEMAGICK_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } GRAPHIC_CFLAGS="$IMAGEMAGICK_CFLAGS $GRAPHIC_CFLAGS" GRAPHIC_LFLAGS="$IMAGEMAGICK_LIBS $GRAPHIC_LFLAGS" -$as_echo "#define HAVE_IMAGEMAGICK 1" >>confdefs.h +printf "%s\n" "#define HAVE_IMAGEMAGICK 1" >>confdefs.h fi fi -if test "x$enable_imagemagick" = "xyes"; then : +if test "x$enable_imagemagick" = "xyes" +then : pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MagickCore >= 7" >&5 -$as_echo_n "checking for MagickCore >= 7... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MagickCore >= 7" >&5 +printf %s "checking for MagickCore >= 7... " >&6; } if test -n "$MAGICKCORE_CFLAGS"; then pkg_cv_MAGICKCORE_CFLAGS="$MAGICKCORE_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"MagickCore >= 7\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"MagickCore >= 7\""; } >&5 ($PKG_CONFIG --exists --print-errors "MagickCore >= 7") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_MAGICKCORE_CFLAGS=`$PKG_CONFIG --cflags "MagickCore >= 7" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -5399,10 +5708,10 @@ if test -n "$MAGICKCORE_LIBS"; then pkg_cv_MAGICKCORE_LIBS="$MAGICKCORE_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"MagickCore >= 7\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"MagickCore >= 7\""; } >&5 ($PKG_CONFIG --exists --print-errors "MagickCore >= 7") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_MAGICKCORE_LIBS=`$PKG_CONFIG --libs "MagickCore >= 7" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -5416,8 +5725,8 @@ fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -5433,21 +5742,21 @@ fi echo "$MAGICKCORE_PKG_ERRORS" >&5 -$as_echo "#define MAGICKCORE_7_OR_NEWER 0" >>confdefs.h +printf "%s\n" "#define MAGICKCORE_7_OR_NEWER 0" >>confdefs.h elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } -$as_echo "#define MAGICKCORE_7_OR_NEWER 0" >>confdefs.h +printf "%s\n" "#define MAGICKCORE_7_OR_NEWER 0" >>confdefs.h else MAGICKCORE_CFLAGS=$pkg_cv_MAGICKCORE_CFLAGS MAGICKCORE_LIBS=$pkg_cv_MAGICKCORE_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define MAGICKCORE_7_OR_NEWER 1" >>confdefs.h +printf "%s\n" "#define MAGICKCORE_7_OR_NEWER 1" >>confdefs.h fi @@ -5459,23 +5768,26 @@ fi #-------------------------------------------------------------------- HAVE_ICU=0 # Check whether --enable-icu was given. -if test "${enable_icu+set}" = set; then : +if test ${enable_icu+y} +then : enableval=$enable_icu; -else +else $as_nop enable_icu=yes fi # Check whether --with-icu-library was given. -if test "${with_icu_library+set}" = set; then : +if test ${with_icu_library+y} +then : withval=$with_icu_library; icu_libdir="$withval" -else +else $as_nop icu_libdir="no" fi -if test "x$enable_icu" = "xyes"; then : +if test "x$enable_icu" = "xyes" +then : # First attempt, icu-config @@ -5484,11 +5796,12 @@ if test "x$enable_icu" = "xyes"; then : if test -z "$ICU_CONFIG"; then # Extract the first word of "icu-config", so it can be a program name with args. set dummy icu-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ICU_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ICU_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ICU_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ICU_CONFIG="$ICU_CONFIG" # Let the user override the test with a path. @@ -5498,11 +5811,15 @@ else for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ICU_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ICU_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5515,11 +5832,11 @@ esac fi ICU_CONFIG=$ac_cv_path_ICU_CONFIG if test -n "$ICU_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ICU_CONFIG" >&5 -$as_echo "$ICU_CONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ICU_CONFIG" >&5 +printf "%s\n" "$ICU_CONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5531,24 +5848,24 @@ fi echo "See http://site.icu-project.org/ for help." else ICU_VERSION=`$ICU_CONFIG --version` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ICU >= 4.0" >&5 -$as_echo_n "checking for ICU >= 4.0... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ICU >= 4.0" >&5 +printf %s "checking for ICU >= 4.0... " >&6; } found=`expr $ICU_VERSION \>= 4.0` if test "$found" = "1" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ok=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking ICU_LIBS" >&5 -$as_echo_n "checking ICU_LIBS... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking ICU_LIBS" >&5 +printf %s "checking ICU_LIBS... " >&6; } ICU_LIBS=`$ICU_CONFIG --ldflags-libsonly` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ICU_LIBS" >&5 -$as_echo "$ICU_LIBS" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking ICU_LDFLAGS" >&5 -$as_echo_n "checking ICU_LDFLAGS... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ICU_LIBS" >&5 +printf "%s\n" "$ICU_LIBS" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking ICU_LDFLAGS" >&5 +printf %s "checking ICU_LDFLAGS... " >&6; } ICU_LDFLAGS=`$ICU_CONFIG --ldflags-searchpath` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ICU_LDFLAGS" >&5 -$as_echo "$ICU_LDFLAGS" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ICU_LDFLAGS" >&5 +printf "%s\n" "$ICU_LDFLAGS" >&6; } else ICU_LIBS="" ICU_LDFLAGS="" @@ -5570,17 +5887,17 @@ $as_echo "$ICU_LDFLAGS" >&6; } if test $HAVE_ICU = 0; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for icu-i18n > 49.0" >&5 -$as_echo_n "checking for icu-i18n > 49.0... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for icu-i18n > 49.0" >&5 +printf %s "checking for icu-i18n > 49.0... " >&6; } if test -n "$ICU_CFLAGS"; then pkg_cv_ICU_CFLAGS="$ICU_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"icu-i18n > 49.0\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"icu-i18n > 49.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "icu-i18n > 49.0") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_ICU_CFLAGS=`$PKG_CONFIG --cflags "icu-i18n > 49.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -5594,10 +5911,10 @@ if test -n "$ICU_LIBS"; then pkg_cv_ICU_LIBS="$ICU_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"icu-i18n > 49.0\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"icu-i18n > 49.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "icu-i18n > 49.0") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_ICU_LIBS=`$PKG_CONFIG --libs "icu-i18n > 49.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -5611,8 +5928,8 @@ fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -5629,35 +5946,35 @@ fi HAVE_ICU=0 elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } HAVE_ICU=0 else ICU_CFLAGS=$pkg_cv_ICU_CFLAGS ICU_LIBS=$pkg_cv_ICU_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - for ac_header in unicode/uloc.h unicode/ulocdata.h unicode/ucol.h unicode/ucurr.h unicode/uregex.h unicode/ucal.h unicode/unorm2.h unicode/unum.h unicode/udat.h unicode/udatpg.h unicode/ustring.h unicode/usearch.h unicode/ucnv.h unicode/utext.h unicode/ubrk.h unicode/utypes.h + for ac_header in unicode/uloc.h unicode/ulocdata.h unicode/ucol.h unicode/ucurr.h unicode/uregex.h unicode/ucal.h unicode/unorm2.h unicode/unum.h unicode/udat.h unicode/udatpg.h unicode/ustring.h unicode/usearch.h unicode/ucnv.h unicode/utext.h unicode/ubrk.h unicode/utypes.h do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF HAVE_ICU=1 fi done - fi fi if test $HAVE_ICU = 0; then HAVE_ICU=0; - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libicu (icu-config disabled)..." >&5 -$as_echo "$as_me: checking for libicu (icu-config disabled)..." >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libicu (icu-config disabled)..." >&5 +printf "%s\n" "$as_me: checking for libicu (icu-config disabled)..." >&6;} if test "$icu_libdir" != "no"; then ICU_LDFLAGS="-L$icu_libdir"; fi @@ -5667,19 +5984,20 @@ $as_echo "$as_me: checking for libicu (icu-config disabled)..." >&6;} /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : HAVE_ICU=1 -else +else $as_nop HAVE_ICU=0 fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext; LDFLAGS="$saved_LDFLAGS"; ICU_LIBS="-licui18n -licuuc -licudata -lm" @@ -5687,28 +6005,28 @@ rm -f core conftest.err conftest.$ac_objext \ if test $HAVE_ICU = 1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - for ac_header in unicode/uchar.h unicode/ustring.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ac_fn_c_check_header_compile "$LINENO" "unicode/uchar.h" "ac_cv_header_unicode_uchar_h" "$ac_includes_default" +if test "x$ac_cv_header_unicode_uchar_h" = xyes +then : + printf "%s\n" "#define HAVE_UNICODE_UCHAR_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "unicode/ustring.h" "ac_cv_header_unicode_ustring_h" "$ac_includes_default" +if test "x$ac_cv_header_unicode_ustring_h" = xyes +then : + printf "%s\n" "#define HAVE_UNICODE_USTRING_H 1" >>confdefs.h -done +fi GRAPHIC_LFLAGS="$ICU_LDFLAGS $ICU_LIBS $GRAPHIC_LFLAGS" HAVE_ICU=1 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The International Components for Unicode (ICU) development headers and libraries do not appear to be available on this system." >&5 -$as_echo "$as_me: WARNING: The International Components for Unicode (ICU) development headers and libraries do not appear to be available on this system." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: The International Components for Unicode (ICU) development headers and libraries do not appear to be available on this system." >&5 +printf "%s\n" "$as_me: WARNING: The International Components for Unicode (ICU) development headers and libraries do not appear to be available on this system." >&2;} fi fi @@ -5720,18 +6038,20 @@ fi # Apple's libobjc.A, screwing up the links to the GNU libobjc. #-------------------------------------------------------------------- # Check whether --enable-aspell was given. -if test "${enable_aspell+set}" = set; then : +if test ${enable_aspell+y} +then : enableval=$enable_aspell; -else +else $as_nop enable_aspell=yes fi if test "$enable_aspell" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for new_aspell_document_checker in -laspell" >&5 -$as_echo_n "checking for new_aspell_document_checker in -laspell... " >&6; } -if ${ac_cv_lib_aspell_new_aspell_document_checker+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for new_aspell_document_checker in -laspell" >&5 +printf %s "checking for new_aspell_document_checker in -laspell... " >&6; } +if test ${ac_cv_lib_aspell_new_aspell_document_checker+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-laspell $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5740,33 +6060,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char new_aspell_document_checker (); int -main () +main (void) { return new_aspell_document_checker (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_aspell_new_aspell_document_checker=yes -else +else $as_nop ac_cv_lib_aspell_new_aspell_document_checker=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_aspell_new_aspell_document_checker" >&5 -$as_echo "$ac_cv_lib_aspell_new_aspell_document_checker" >&6; } -if test "x$ac_cv_lib_aspell_new_aspell_document_checker" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBASPELL 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_aspell_new_aspell_document_checker" >&5 +printf "%s\n" "$ac_cv_lib_aspell_new_aspell_document_checker" >&6; } +if test "x$ac_cv_lib_aspell_new_aspell_document_checker" = xyes +then : + printf "%s\n" "#define HAVE_LIBASPELL 1" >>confdefs.h LIBS="-laspell $LIBS" @@ -5774,31 +6091,27 @@ fi fi if test "${ac_cv_lib_aspell_new_aspell_document_checker}" = yes; then - for ac_header in aspell.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "aspell.h" "ac_cv_header_aspell_h" "$ac_includes_default" -if test "x$ac_cv_header_aspell_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ASPELL_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "aspell.h" "ac_cv_header_aspell_h" "$ac_includes_default" +if test "x$ac_cv_header_aspell_h" = xyes +then : + printf "%s\n" "#define HAVE_ASPELL_H 1" >>confdefs.h fi -done - -$as_echo "#define HAVE_ASPELL 1" >>confdefs.h +printf "%s\n" "#define HAVE_ASPELL 1" >>confdefs.h fi #-------------------------------------------------------------------- # Check for ICNS library. #-------------------------------------------------------------------- -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for icns_read_family_from_file in -licns" >&5 -$as_echo_n "checking for icns_read_family_from_file in -licns... " >&6; } -if ${ac_cv_lib_icns_icns_read_family_from_file+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for icns_read_family_from_file in -licns" >&5 +printf %s "checking for icns_read_family_from_file in -licns... " >&6; } +if test ${ac_cv_lib_icns_icns_read_family_from_file+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-licns $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5807,33 +6120,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char icns_read_family_from_file (); int -main () +main (void) { return icns_read_family_from_file (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_icns_icns_read_family_from_file=yes -else +else $as_nop ac_cv_lib_icns_icns_read_family_from_file=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_icns_icns_read_family_from_file" >&5 -$as_echo "$ac_cv_lib_icns_icns_read_family_from_file" >&6; } -if test "x$ac_cv_lib_icns_icns_read_family_from_file" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBICNS 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_icns_icns_read_family_from_file" >&5 +printf "%s\n" "$ac_cv_lib_icns_icns_read_family_from_file" >&6; } +if test "x$ac_cv_lib_icns_icns_read_family_from_file" = xyes +then : + printf "%s\n" "#define HAVE_LIBICNS 1" >>confdefs.h LIBS="-licns $LIBS" @@ -5844,43 +6154,40 @@ fi # NSSound #-------------------------------------------------------------------- # Check whether --enable-sound was given. -if test "${enable_sound+set}" = set; then : +if test ${enable_sound+y} +then : enableval=$enable_sound; -else +else $as_nop enable_sound=yes fi # Initialize to nothing... BUILD_SOUND= # Check for the headers... -for ac_header in sndfile.h + for ac_header in sndfile.h do : - ac_fn_c_check_header_mongrel "$LINENO" "sndfile.h" "ac_cv_header_sndfile_h" "$ac_includes_default" -if test "x$ac_cv_header_sndfile_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SNDFILE_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "sndfile.h" "ac_cv_header_sndfile_h" "$ac_includes_default" +if test "x$ac_cv_header_sndfile_h" = xyes +then : + printf "%s\n" "#define HAVE_SNDFILE_H 1" >>confdefs.h have_sndfile=yes -else +else $as_nop have_sndfile=no fi done - -for ac_header in ao/ao.h + for ac_header in ao/ao.h do : - ac_fn_c_check_header_mongrel "$LINENO" "ao/ao.h" "ac_cv_header_ao_ao_h" "$ac_includes_default" -if test "x$ac_cv_header_ao_ao_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_AO_AO_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "ao/ao.h" "ac_cv_header_ao_ao_h" "$ac_includes_default" +if test "x$ac_cv_header_ao_ao_h" = xyes +then : + printf "%s\n" "#define HAVE_AO_AO_H 1" >>confdefs.h have_ao=yes -else +else $as_nop have_ao=no fi done - # Only if we have both... if test $have_sndfile = yes -a $have_ao = yes -a $enable_sound = yes; then BUILD_SOUND="sound" @@ -5891,20 +6198,22 @@ fi # NSSpeechSynthesizer #-------------------------------------------------------------------- # Check whether --enable-speech was given. -if test "${enable_speech+set}" = set; then : +if test ${enable_speech+y} +then : enableval=$enable_speech; -else +else $as_nop enable_speech=yes fi BUILD_SPEECH= # has flite, for speech synthesis. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for new_utterance in -lflite" >&5 -$as_echo_n "checking for new_utterance in -lflite... " >&6; } -if ${ac_cv_lib_flite_new_utterance+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for new_utterance in -lflite" >&5 +printf %s "checking for new_utterance in -lflite... " >&6; } +if test ${ac_cv_lib_flite_new_utterance+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lflite $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5913,57 +6222,55 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char new_utterance (); int -main () +main (void) { return new_utterance (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_flite_new_utterance=yes -else +else $as_nop ac_cv_lib_flite_new_utterance=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_flite_new_utterance" >&5 -$as_echo "$ac_cv_lib_flite_new_utterance" >&6; } -if test "x$ac_cv_lib_flite_new_utterance" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_flite_new_utterance" >&5 +printf "%s\n" "$ac_cv_lib_flite_new_utterance" >&6; } +if test "x$ac_cv_lib_flite_new_utterance" = xyes +then : have_speech=yes -else +else $as_nop have_speech=no fi -for ac_header in flite/flite.h + for ac_header in flite/flite.h do : - ac_fn_c_check_header_mongrel "$LINENO" "flite/flite.h" "ac_cv_header_flite_flite_h" "$ac_includes_default" -if test "x$ac_cv_header_flite_flite_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_FLITE_FLITE_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "flite/flite.h" "ac_cv_header_flite_flite_h" "$ac_includes_default" +if test "x$ac_cv_header_flite_flite_h" = xyes +then : + printf "%s\n" "#define HAVE_FLITE_FLITE_H 1" >>confdefs.h have_flite=yes -else +else $as_nop have_flite=no fi done - if test $have_flite = yes -a $have_speech = yes -a $enable_speech = yes; then BUILD_SPEECH="speech say" FLITE_BASE_LIBS="-lflite_usenglish -lflite_cmulex -lflite" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for register_cmu_us_kal16 in -lflite_cmu_us_kal16" >&5 -$as_echo_n "checking for register_cmu_us_kal16 in -lflite_cmu_us_kal16... " >&6; } -if ${ac_cv_lib_flite_cmu_us_kal16_register_cmu_us_kal16+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for register_cmu_us_kal16 in -lflite_cmu_us_kal16" >&5 +printf %s "checking for register_cmu_us_kal16 in -lflite_cmu_us_kal16... " >&6; } +if test ${ac_cv_lib_flite_cmu_us_kal16_register_cmu_us_kal16+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lflite_cmu_us_kal16 $FLITE_BASE_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5972,32 +6279,31 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char register_cmu_us_kal16 (); int -main () +main (void) { return register_cmu_us_kal16 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_flite_cmu_us_kal16_register_cmu_us_kal16=yes -else +else $as_nop ac_cv_lib_flite_cmu_us_kal16_register_cmu_us_kal16=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_flite_cmu_us_kal16_register_cmu_us_kal16" >&5 -$as_echo "$ac_cv_lib_flite_cmu_us_kal16_register_cmu_us_kal16" >&6; } -if test "x$ac_cv_lib_flite_cmu_us_kal16_register_cmu_us_kal16" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_flite_cmu_us_kal16_register_cmu_us_kal16" >&5 +printf "%s\n" "$ac_cv_lib_flite_cmu_us_kal16_register_cmu_us_kal16" >&6; } +if test "x$ac_cv_lib_flite_cmu_us_kal16_register_cmu_us_kal16" = xyes +then : have_kal16=yes -else +else $as_nop have_kal16=no fi @@ -6011,20 +6317,22 @@ fi # NSSpeechRecognizer #-------------------------------------------------------------------- # Check whether --enable-speech-recognizer was given. -if test "${enable_speech_recognizer+set}" = set; then : +if test ${enable_speech_recognizer+y} +then : enableval=$enable_speech_recognizer; -else +else $as_nop enable_speech_recognizer=yes fi BUILD_SPEECH_RECOGNIZER= # has pocketsphinx, for speech recognition. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ps_start_utt in -lpocketsphinx" >&5 -$as_echo_n "checking for ps_start_utt in -lpocketsphinx... " >&6; } -if ${ac_cv_lib_pocketsphinx_ps_start_utt+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ps_start_utt in -lpocketsphinx" >&5 +printf %s "checking for ps_start_utt in -lpocketsphinx... " >&6; } +if test ${ac_cv_lib_pocketsphinx_ps_start_utt+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpocketsphinx $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -6033,49 +6341,46 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char ps_start_utt (); int -main () +main (void) { return ps_start_utt (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pocketsphinx_ps_start_utt=yes -else +else $as_nop ac_cv_lib_pocketsphinx_ps_start_utt=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pocketsphinx_ps_start_utt" >&5 -$as_echo "$ac_cv_lib_pocketsphinx_ps_start_utt" >&6; } -if test "x$ac_cv_lib_pocketsphinx_ps_start_utt" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pocketsphinx_ps_start_utt" >&5 +printf "%s\n" "$ac_cv_lib_pocketsphinx_ps_start_utt" >&6; } +if test "x$ac_cv_lib_pocketsphinx_ps_start_utt" = xyes +then : have_speech_recognizer=yes -else +else $as_nop have_speech_recognizer=no fi -for ac_header in pocketsphinx/pocketsphinx_export.h + for ac_header in pocketsphinx/pocketsphinx_export.h do : - ac_fn_c_check_header_mongrel "$LINENO" "pocketsphinx/pocketsphinx_export.h" "ac_cv_header_pocketsphinx_pocketsphinx_export_h" "$ac_includes_default" -if test "x$ac_cv_header_pocketsphinx_pocketsphinx_export_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_POCKETSPHINX_POCKETSPHINX_EXPORT_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "pocketsphinx/pocketsphinx_export.h" "ac_cv_header_pocketsphinx_pocketsphinx_export_h" "$ac_includes_default" +if test "x$ac_cv_header_pocketsphinx_pocketsphinx_export_h" = xyes +then : + printf "%s\n" "#define HAVE_POCKETSPHINX_POCKETSPHINX_EXPORT_H 1" >>confdefs.h have_pocketsphinx=yes -else +else $as_nop have_pocketsphinx=no fi done - if test $have_pocketsphinx = yes -a $have_speech_recognizer = yes -a $enable_speech_recognizer = yes; then BUILD_SPEECH_RECOGNIZER="speech_recognizer" RECOGNIZER_BASE_LIBS=`pkg-config --libs pocketsphinx sphinxbase` @@ -6097,9 +6402,10 @@ GSCUPS_DATADIR= BUILD_GSCUPS=NO # Check whether --enable-cups was given. -if test "${enable_cups+set}" = set; then : +if test ${enable_cups+y} +then : enableval=$enable_cups; -else +else $as_nop enable_cups=yes fi @@ -6108,11 +6414,12 @@ 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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_have_cups+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_have_cups+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$have_cups"; then ac_cv_prog_have_cups="$have_cups" # Let the user override the test. else @@ -6120,11 +6427,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_have_cups="yes" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6136,11 +6447,11 @@ fi fi have_cups=$ac_cv_prog_have_cups if test -n "$have_cups"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_cups" >&5 -$as_echo "$have_cups" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_cups" >&5 +printf "%s\n" "$have_cups" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6160,30 +6471,29 @@ fi CPPFLAGS="$GSCUPS_CFLAGS ${CPPFLAGS}" LDFLAGS="$GSCUPS_LDFLAGS ${LDFLAGS}" - for ac_header in cups/cups.h + for ac_header in cups/cups.h do : - ac_fn_c_check_header_mongrel "$LINENO" "cups/cups.h" "ac_cv_header_cups_cups_h" "$ac_includes_default" -if test "x$ac_cv_header_cups_cups_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_CUPS_CUPS_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "cups/cups.h" "ac_cv_header_cups_cups_h" "$ac_includes_default" +if test "x$ac_cv_header_cups_cups_h" = xyes +then : + printf "%s\n" "#define HAVE_CUPS_CUPS_H 1" >>confdefs.h have_cups=yes -else +else $as_nop 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 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cupsServer in -lcups" >&5 -$as_echo_n "checking for cupsServer in -lcups... " >&6; } -if ${ac_cv_lib_cups_cupsServer+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cupsServer in -lcups" >&5 +printf %s "checking for cupsServer in -lcups... " >&6; } +if test ${ac_cv_lib_cups_cupsServer+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcups $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -6192,32 +6502,31 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char cupsServer (); int -main () +main (void) { return cupsServer (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cups_cupsServer=yes -else +else $as_nop ac_cv_lib_cups_cupsServer=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cups_cupsServer" >&5 -$as_echo "$ac_cv_lib_cups_cupsServer" >&6; } -if test "x$ac_cv_lib_cups_cupsServer" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cups_cupsServer" >&5 +printf "%s\n" "$ac_cv_lib_cups_cupsServer" >&6; } +if test "x$ac_cv_lib_cups_cupsServer" = xyes +then : have_cups=yes -else +else $as_nop have_cups=no fi @@ -6236,11 +6545,25 @@ fi +#------------------------------------------------------------------- +# Check for inotify.h +#------------------------------------------------------------------- +ac_fn_c_check_header_compile "$LINENO" "sys/inotify.h" "ac_cv_header_sys_inotify_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_inotify_h" = xyes +then : + + +printf "%s\n" "#define HAVE_INOTIFY_H 1" >>confdefs.h + + +fi + + #-------------------------------------------------------------------- # Check for -Wdeclaration-after-statement #-------------------------------------------------------------------- -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wdeclaration-after-statement" >&5 -$as_echo_n "checking whether the compiler supports -Wdeclaration-after-statement... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wdeclaration-after-statement" >&5 +printf %s "checking whether the compiler supports -Wdeclaration-after-statement... " >&6; } saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wdeclaration-after-statement" @@ -6248,23 +6571,24 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : HAS_W_DECL_AFTER_STATEMENT=yes -else +else $as_nop HAS_W_DECL_AFTER_STATEMENT=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$saved_CFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAS_W_DECL_AFTER_STATEMENT" >&5 -$as_echo "$HAS_W_DECL_AFTER_STATEMENT" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $HAS_W_DECL_AFTER_STATEMENT" >&5 +printf "%s\n" "$HAS_W_DECL_AFTER_STATEMENT" >&6; } if test x"$HAS_W_DECL_AFTER_STATEMENT" = x"yes"; then WARN_FLAGS="-Wall -Wdeclaration-after-statement" @@ -6285,13 +6609,13 @@ GUILIBS=`gnustep-config --gui-libs` #-------------------------------------------------------------------- # Record the version #-------------------------------------------------------------------- -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the version of gnustep-gui we are compiling" >&5 -$as_echo_n "checking for the version of gnustep-gui we are compiling... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the version of gnustep-gui we are compiling" >&5 +printf %s "checking for the version of gnustep-gui we are compiling... " >&6; } if test -f "Version"; then . ./Version fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNUSTEP_GUI_VERSION" >&5 -$as_echo "$GNUSTEP_GUI_VERSION" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GNUSTEP_GUI_VERSION" >&5 +printf "%s\n" "$GNUSTEP_GUI_VERSION" >&6; } @@ -6338,8 +6662,8 @@ _ACEOF case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -6369,15 +6693,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; /^ac_cv_env_/b end t clear :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else @@ -6391,8 +6715,8 @@ $as_echo "$as_me: updating cache $cache_file" >&6;} fi fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -6409,7 +6733,7 @@ U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -6425,8 +6749,8 @@ LTLIBOBJS=$ac_ltlibobjs ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL @@ -6449,14 +6773,16 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -6466,46 +6792,46 @@ esac fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -6514,13 +6840,6 @@ if test "${PATH_SEPARATOR+set}" != set; then fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -6529,8 +6848,12 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -6542,30 +6865,10 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] @@ -6578,13 +6881,14 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -6611,18 +6915,20 @@ as_fn_unset () { eval $1=; unset $1;} } as_unset=as_fn_unset + # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -6634,12 +6940,13 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` @@ -6670,7 +6977,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -6692,6 +6999,10 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -6705,6 +7016,12 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -6746,7 +7063,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -6755,7 +7072,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -6818,7 +7135,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.69. Invocation command line was +generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -6876,14 +7193,16 @@ $config_headers Report bugs to the package provider." _ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.69, +configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -6920,15 +7239,15 @@ do -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; + printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; + printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" @@ -6936,7 +7255,7 @@ do --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; @@ -6945,7 +7264,7 @@ do as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; + printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; @@ -6973,7 +7292,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" @@ -6987,7 +7306,7 @@ exec 5>>config.log sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - $as_echo "$ac_log" + printf "%s\n" "$ac_log" } >&5 _ACEOF @@ -7016,8 +7335,8 @@ done # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree @@ -7353,7 +7672,7 @@ do esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done @@ -7361,17 +7680,17 @@ do # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | + ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac @@ -7388,7 +7707,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | +printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -7412,9 +7731,9 @@ $as_echo X"$ac_file" | case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -7467,8 +7786,8 @@ ac_sed_dataroot=' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' @@ -7510,9 +7829,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" @@ -7528,20 +7847,20 @@ which seems to be undefined. Please make sure it is defined" >&2;} # if test x"$ac_file" != x-; then { - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi @@ -7582,7 +7901,8 @@ if test "$no_create" != yes; then $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi + diff --git a/configure.ac b/configure.ac index 98640cb6b6..fb49355766 100644 --- a/configure.ac +++ b/configure.ac @@ -643,6 +643,13 @@ AC_SUBST(GSCUPS_LIBS) AC_SUBST(GSCUPS_DATADIR) AC_SUBST(BUILD_GSCUPS) +#------------------------------------------------------------------- +# Check for inotify.h +#------------------------------------------------------------------- +AC_CHECK_HEADER([sys/inotify.h], [ + AC_DEFINE([HAVE_INOTIFY_H], [1], [Define if inotify is available]) +]) + #-------------------------------------------------------------------- # Check for -Wdeclaration-after-statement #--------------------------------------------------------------------