OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /or1k/trunk/rtems-20020807/cpukit/libblock
    from Rev 1028 to Rev 1765
    Reverse comparison

Rev 1028 → Rev 1765

/include/rtems/ramdisk.h
0,0 → 1,52
/* ramdisk.c -- RAM disk block device implementation
*
* Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia
* Author: Victor V. Vengerov <vvv@oktet.ru>
*
* @(#) ramdisk.h,v 1.1 2002/02/28 20:39:54 joel Exp
*/
 
#ifndef __RTEMS_LIBBLOCK_RAMDISK_H__
#define __RTEMS_LIBBLOCK_RAMDISK_H__
 
#ifdef __cplusplus
extern "C" {
#endif
 
#include <rtems.h>
 
#include "rtems/blkdev.h"
 
/* RAM disk configuration table entry */
typedef struct rtems_ramdisk_config {
int block_size; /* RAM disk block size */
int block_num; /* Number of blocks on this RAM disk */
void *location; /* RAM disk permanent location (out of RTEMS controlled
memory), or NULL if RAM disk memory should be
allocated dynamically */
} rtems_ramdisk_config;
 
/* If application want to use RAM disk, it should specify configuration of
* available RAM disks.
* The following is definitions for RAM disk configuration table
*/
extern rtems_ramdisk_config rtems_ramdisk_configuration[];
extern int rtems_ramdisk_configuration_size;
 
/* ramdisk_initialize --
* RAM disk driver initialization entry point.
*/
rtems_device_driver
ramdisk_initialize(
rtems_device_major_number major,
rtems_device_minor_number minor,
void *arg);
 
#define RAMDISK_DRIVER_TABLE_ENTRY \
{ ramdisk_initialize, GENERIC_BLOCK_DEVICE_DRIVER_ENTRIES }
 
#ifdef __cplusplus
}
#endif
 
#endif
/include/rtems/diskdevs.h
0,0 → 1,206
/*
* logdisk.h - Physical and logical block devices (disks) support
*
* Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia
* Author: Victor V. Vengerov <vvv@oktet.ru>
*
* @(#) diskdevs.h,v 1.1 2002/02/28 20:39:54 joel Exp
*/
 
#ifndef __RTEMS_LIBBLOCK_LOGDISK_H__
#define __RTEMS_LIBBLOCK_LOGDISK_H__
 
#ifdef __cplusplus
extern "C" {
#endif
 
#include <rtems.h>
#include <rtems/libio.h>
#include <stdlib.h>
 
#include "rtems/blkdev.h"
 
/* Buffer pool identifier */
typedef int rtems_bdpool_id;
 
/* Block device ioctl handler */
typedef int (* block_device_ioctl) (dev_t dev, int req, void *argp);
 
/* disk_device: Entry of this type created for every disk device (both for
* logical and physical disks).
* Array of arrays of pointers to disk_device structures maintained. First
* table indexed by major number and second table indexed by minor number.
* Such data organization allow quick lookup using data structure of
* moderated size.
*/
typedef struct disk_device {
dev_t dev; /* Device ID (major + minor) */
struct disk_device *phys_dev; /* Physical device ID (the same
as dev if this entry specifies
the physical device) */
char *name; /* Disk device name */
int uses; /* Use counter. Device couldn't be
removed if it is in use. */
int start; /* Starting block number (0 for
physical devices, block offset
on the related physical device
for logical device) */
int size; /* Size of physical or logical disk
in disk blocks */
int block_size; /* Size of device block (minimum
transfer unit) in bytes
(must be power of 2) */
int block_size_log2; /* log2 of block_size */
rtems_bdpool_id pool; /* Buffer pool assigned to this
device */
block_device_ioctl ioctl; /* ioctl handler for this block
device */
} disk_device;
 
/* rtems_disk_create_phys --
* Create physical disk entry. This function usually invoked from
* block device driver initialization code when physical device
* detected in the system. Device driver should provide ioctl handler
* to allow block device access operations. This primitive will register
* device in rtems (invoke rtems_io_register_name).
*
* PARAMETERS:
* dev - device identifier (major, minor numbers)
* block_size - size of disk block (minimum data transfer unit); must be
* power of 2
* disk_size - number of blocks on device
* handler - IOCTL handler (function providing basic block input/output
* request handling BIOREQUEST and other device management
* operations)
* name - character name of device (e.g. /dev/hda)
*
* RETURNS:
* RTEMS_SUCCESSFUL if information about new physical disk added, or
* error code if error occured (device already registered, wrong block
* size value, no memory available).
*/
rtems_status_code
rtems_disk_create_phys(dev_t dev, int block_size, int disk_size,
block_device_ioctl handler,
char *name);
 
/* rtems_disk_create_log --
* Create logical disk entry. Logical disk is contiguous area on physical
* disk. Disk may be splitted to several logical disks in several ways:
* manually or using information stored in blocks on physical disk
* (DOS-like partition table, BSD disk label, etc). This function usually
* invoked from application when application-specific splitting are in use,
* or from generic code which handle different logical disk organizations.
* This primitive will register device in rtems (invoke
* rtems_io_register_name).
*
* PARAMETERS:
* dev - logical device identifier (major, minor numbers)
* phys - physical device (block device which holds this logical disk)
* identifier
* start - starting block number on the physical device
* size - logical disk size in blocks
* name - logical disk name
*
* RETURNS:
* RTEMS_SUCCESSFUL if logical device successfully added, or error code
* if error occured (device already registered, no physical device
* exists, logical disk is out of physical disk boundaries, no memory
* available).
*/
rtems_status_code
rtems_disk_create_log(dev_t dev, dev_t phys, int start, int size, char *name);
 
/* rtems_disk_delete --
* Delete physical or logical disk device. Device may be deleted if its
* use counter (and use counters of all logical devices - if it is
* physical device) equal to 0. When physical device deleted,
* all logical devices deleted inherently. Appropriate devices removed
* from "/dev" filesystem.
*
* PARAMETERS:
* dev - device identifier (major, minor numbers)
*
* RETURNS:
* RTEMS_SUCCESSFUL if block device successfully deleted, or error code
* if error occured (device is not defined, device is in use).
*/
rtems_status_code
rtems_disk_delete(dev_t dev);
 
/* rtems_disk_lookup --
* Find block device descriptor by its device identifier. This function
* increment usage counter to 1. User should release disk_device structure
* by invoking rtems_disk_release primitive.
*
* PARAMETERS:
* dev - device identifier (major, minor numbers)
*
* RETURNS:
* pointer to the block device descriptor, or NULL if no such device
* exists.
*/
disk_device *
rtems_disk_lookup(dev_t dev);
 
/* rtems_disk_release --
* Release disk_device structure (decrement usage counter to 1).
*
* PARAMETERS:
* dd - pointer to disk device structure
*
* RETURNS:
* RTEMS_SUCCESSFUL
*
* NOTE:
* It should be implemented as inline function.
*/
rtems_status_code
rtems_disk_release(disk_device *dd);
/* rtems_disk_next --
* Disk device enumerator. Looking for device having device number larger
* than dev and return disk device descriptor for it. If there are no
* such device, NULL value returned.
*
* PARAMETERS:
* dev - device number (use -1 to start search)
*
* RETURNS:
* Pointer to the disk descriptor for next disk device, or NULL if all
* devices enumerated. */
disk_device *
rtems_disk_next(dev_t dev);
 
/* rtems_diskio_initialize --
* Initialization of disk device library (initialize all data structures,
* etc.)
*
* PARAMETERS:
* none
*
* RETURNS:
* RTEMS_SUCCESSFUL if library initialized, or error code if error
* occured.
*/
rtems_status_code
rtems_disk_io_initialize(void);
 
/* rtems_diskio_done --
* Release all resources allocated for disk device interface.
*
* PARAMETERS:
* none
*
* RETURNS:
* RTEMS_SUCCESSFUL if all resources released, or error code if error
* occured.
*/
rtems_status_code
rtems_disk_io_done(void);
 
#ifdef __cplusplus
}
#endif
 
#endif
/include/rtems/bdbuf.h
0,0 → 1,275
/* bdbuf.h -- block device buffer management
*
* Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia
* Author: Victor V. Vengerov <vvv@oktet.ru>
*
* @(#) bdbuf.h,v 1.3 2002/04/03 13:56:34 joel Exp
*/
 
#ifndef __RTEMS_LIBBLOCK_BDBUF_H__
#define __RTEMS_LIBBLOCK_BDBUF_H__
 
#ifdef __cplusplus
extern "C" {
#endif
 
#include <rtems.h>
#include <rtems/libio.h>
#include <chain.h>
 
#include "rtems/blkdev.h"
#include "rtems/diskdevs.h"
 
 
/*
* To manage buffers we using Buffer Descriptors.
* To speed-up buffer lookup descriptors are organized in AVL-Tree.
* The fields 'dev' and 'block' are search key.
*/
 
/* Buffer descriptors
* Descriptors organized in AVL-tree to speedup buffer lookup.
* dev and block fields are search key in AVL-tree.
* Modified buffers, free buffers and used buffers linked in 'mod', 'free' and
* 'lru' chains appropriately.
*/
 
typedef struct bdbuf_buffer {
Chain_Node link; /* Link in the lru, mod or free chains */
 
struct bdbuf_avl_node {
signed char cache; /* Cache */
 
struct bdbuf_buffer* left; /* Left Child */
struct bdbuf_buffer* right; /* Right Child */
 
signed char bal; /* The balance of the sub-tree */
} avl;
 
dev_t dev; /* device number */
blkdev_bnum block; /* block number on the device */
char *buffer; /* Pointer to the buffer memory area */
rtems_status_code status; /* Last I/O operation completion status */
int error; /* If status != RTEMS_SUCCESSFUL, this field contains
errno value which can be used by user later */
boolean modified:1; /* =1 if buffer was modified */
boolean in_progress:1; /* =1 if exchange with disk is in progress;
need to wait on semaphore */
boolean actual:1; /* Buffer contains actual data */
int use_count; /* Usage counter; incremented when somebody use
this buffer; decremented when buffer released
without modification or when buffer is flushed
by swapout task */
 
rtems_bdpool_id pool; /* Identifier of buffer pool to which this buffer
belongs */
CORE_mutex_Control transfer_sema;
/* Transfer operation semaphore */
} bdbuf_buffer;
 
 
 
/* bdbuf_config structure describes block configuration (size,
* amount, memory location) for buffering layer
*/
typedef struct rtems_bdbuf_config {
int size; /* Size of block */
int num; /* Number of blocks of appropriate size */
char *mem_area; /* Pointer to the blocks location or NULL, in this
case memory for blocks will be allocated by
Buffering Layer with the help of RTEMS partition
manager */
} rtems_bdbuf_config;
 
extern rtems_bdbuf_config rtems_bdbuf_configuration[];
extern int rtems_bdbuf_configuration_size;
 
/* rtems_bdbuf_init --
* Prepare buffering layer to work - initialize buffer descritors
* and (if it is neccessary) buffers. Buffers will be allocated accoriding
* to the configuration table, each entry describes kind of block and
* amount requested. After initialization all blocks is placed into
* free elements lists.
*
* PARAMETERS:
* conf_table - pointer to the buffers configuration table
* size - number of entries in configuration table
*
* RETURNS:
* RTEMS status code (RTEMS_SUCCESSFUL if operation completed successfully
* or error code if error is occured)
*/
rtems_status_code
rtems_bdbuf_init(rtems_bdbuf_config *conf_table, int size);
 
 
/* rtems_bdbuf_get --
* Obtain block buffer. If specified block already cached (i.e. there's
* block in the _modified_, or _recently_used_), return address
* of appropriate buffer descriptor and increment reference counter to 1.
* If block is not cached, allocate new buffer and return it. Data
* shouldn't be read to the buffer from media; buffer may contains
* arbitrary data. This primitive may be blocked if there are no free
* buffer descriptors available and there are no unused non-modified
* (or synchronized with media) buffers available.
*
* PARAMETERS:
* device - device number (constructed of major and minor device number)
* block - linear media block number
* bd - address of variable to store pointer to the buffer descriptor
*
* RETURNS:
* RTEMS status code (RTEMS_SUCCESSFUL if operation completed successfully
* or error code if error is occured)
*
* SIDE EFFECTS:
* bufget_sema semaphore obtained by this primitive.
*/
rtems_status_code
rtems_bdbuf_get(dev_t device, blkdev_bnum block, bdbuf_buffer **bdb_ptr);
 
/* rtems_bdbuf_read --
* (Similar to the rtems_bdbuf_get, except reading data from media)
* Obtain block buffer. If specified block already cached, return address
* of appropriate buffer and increment reference counter to 1. If block is
* not cached, allocate new buffer and read data to it from the media.
* This primitive may be blocked on waiting until data to be read from
* media, if there are no free buffer descriptors available and there are
* no unused non-modified (or synchronized with media) buffers available.
*
* PARAMETERS:
* device - device number (consists of major and minor device number)
* block - linear media block number
* bd - address of variable to store pointer to the buffer descriptor
*
* RETURNS:
* RTEMS status code (RTEMS_SUCCESSFUL if operation completed successfully
* or error code if error is occured)
*
* SIDE EFFECTS:
* bufget_sema and transfer_sema semaphores obtained by this primitive.
*/
rtems_status_code
rtems_bdbuf_read(dev_t device, blkdev_bnum block, bdbuf_buffer **bdb_ptr);
 
/* rtems_bdbuf_release --
* Release buffer allocated before. This primitive decrease the
* usage counter. If it is zero, further destiny of buffer depends on
* 'modified' status. If buffer was modified, it is placed to the end of
* mod list and flush task waken up. If buffer was not modified,
* it is placed to the end of lru list, and bufget_sema released, allowing
* to reuse this buffer.
*
* PARAMETERS:
* bd_buf - pointer to the bdbuf_buffer structure previously obtained using
* get/read primitive.
*
* RETURNS:
* RTEMS status code (RTEMS_SUCCESSFUL if operation completed successfully
* or error code if error is occured)
*
* SIDE EFFECTS:
* flush_sema and bufget_sema semaphores may be released by this primitive.
*/
rtems_status_code
rtems_bdbuf_release(bdbuf_buffer *bd_buf);
 
/* rtems_bdbuf_release_modified --
* Release buffer allocated before, assuming that it is _modified_ by
* it's owner. This primitive decrease usage counter for buffer, mark
* buffer descriptor as modified. If usage counter is 0, insert it at
* end of mod chain and release flush_sema semaphore to activate the
* flush task.
*
* PARAMETERS:
* bd_buf - pointer to the bdbuf_buffer structure previously obtained using
* get/read primitive.
*
* RETURNS:
* RTEMS status code (RTEMS_SUCCESSFUL if operation completed successfully
* or error code if error is occured)
*
* SIDE EFFECTS:
* flush_sema semaphore may be released by this primitive.
*/
rtems_status_code
rtems_bdbuf_release_modified(bdbuf_buffer *bd_buf);
 
/* rtems_bdbuf_sync --
* Wait until specified buffer synchronized with disk. Invoked on exchanges
* critical for data consistency on the media. This primitive mark owned
* block as modified, decrease usage counter. If usage counter is 0,
* block inserted to the mod chain and flush_sema semaphore released.
* Finally, primitives blocked on transfer_sema semaphore.
*
* PARAMETERS:
* bd_buf - pointer to the bdbuf_buffer structure previously obtained using
* get/read primitive.
*
* RETURNS:
* RTEMS status code (RTEMS_SUCCESSFUL if operation completed successfully
* or error code if error is occured)
*
* SIDE EFFECTS:
* Primitive may be blocked on transfer_sema semaphore.
*/
rtems_status_code
rtems_bdbuf_sync(bdbuf_buffer *bd_buf);
 
/* rtems_bdbuf_syncdev --
* Synchronize with disk all buffers containing the blocks belonging to
* specified device.
*
* PARAMETERS:
* dev - block device number
*
* RETURNS:
* RTEMS status code (RTEMS_SUCCESSFUL if operation completed successfully
* or error code if error is occured)
*/
rtems_status_code
rtems_bdbuf_syncdev(dev_t dev);
 
/* rtems_bdbuf_find_pool --
* Find first appropriate buffer pool. This primitive returns the index
* of first buffer pool which block size is greater than or equal to
* specified size.
*
* PARAMETERS:
* block_size - requested block size
* pool - placeholder for result
*
* RETURNS:
* RTEMS status code: RTEMS_SUCCESSFUL if operation completed successfully,
* RTEMS_INVALID_SIZE if specified block size is invalid (not a power
* of 2), RTEMS_NOT_DEFINED if buffer pool for this or greater block size
* is not configured.
*/
rtems_status_code
rtems_bdbuf_find_pool(int block_size, rtems_bdpool_id *pool);
 
/* rtems_bdbuf_get_pool_info --
* Obtain characteristics of buffer pool with specified number.
*
* PARAMETERS:
* pool - buffer pool number
* block_size - block size for which buffer pool is configured returned
* there
* blocks - number of buffers in buffer pool returned there
*
* RETURNS:
* RTEMS status code: RTEMS_SUCCESSFUL if operation completed successfully,
* RTEMS_INVALID_NUMBER if appropriate buffer pool is not configured.
*
* NOTE:
* Buffer pools enumerated contiguously starting from 0.
*/
rtems_status_code
rtems_bdbuf_get_pool_info(rtems_bdpool_id pool, int *block_size, int *blocks);
 
#ifdef __cplusplus
}
#endif
 
#endif
/include/rtems/blkdev.h
0,0 → 1,147
/*
* blkdev.h - block device driver interface definitions
*
* Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia
* Author: Victor V. Vengerov <vvv@oktet.ru>
*
* @(#) blkdev.h,v 1.1 2002/02/28 20:39:54 joel Exp
*/
 
#ifndef __RTEMS_LIBBLOCK_BLKDEV_H__
#define __RTEMS_LIBBLOCK_BLKDEV_H__
 
#include <rtems.h>
#include <sys/ioctl.h>
 
#ifdef __cplusplus
extern "C" {
#endif
 
/* Interface with device drivers
* Block device looks, initialized and behaves like traditional RTEMS device
* driver. Heart of the block device driver is in BIOREQUEST ioctl. This call
* puts I/O request to the block device queue, in priority order, for
* asynchronous processing. When driver executes request, req_done
* function invoked, so callee knows about it. Look for details below.
*/
 
 
/* Block device block number datatype */
typedef rtems_unsigned32 blkdev_bnum;
 
/* Block device request type */
typedef enum blkdev_request_op {
BLKDEV_REQ_READ, /* Read operation */
BLKDEV_REQ_WRITE /* Write operation */
} blkdev_request_op;
 
/* Type for block device request done callback function.
*
* PARAMETERS:
* arg - argument supplied in blkdev_request
* status - rtems status code for this operation
* errno - errno value to be passed to the user when
* status != RTEMS_SUCCESSFUL
*/
typedef void (* blkdev_request_cb)(void *arg,
rtems_status_code status,
int error);
 
/* blkdev_sg_buffer
* Block device scatter/gather buffer structure
*/
typedef struct blkdev_sg_buffer {
rtems_unsigned32 length; /* Buffer length */
void *buffer; /* Buffer pointer */
} blkdev_sg_buffer;
 
/* blkdev_request (Block Device Request) structure is
* used to read/write a number of blocks from/to device.
*/
typedef struct blkdev_request {
blkdev_request_op req; /* Block device operation (read or write) */
blkdev_request_cb req_done; /* Callback function */
void *done_arg; /* Argument to be passed to callback function*/
blkdev_bnum start; /* Start block number */
rtems_unsigned32 count; /* Number of blocks to be exchanged */
rtems_unsigned32 bufnum; /* Number of buffers provided */
blkdev_sg_buffer bufs[0];/* List of scatter/gather buffers */
} blkdev_request;
 
/* Block device IOCTL request codes */
#define BLKIO_REQUEST _IOWR('B', 1, blkdev_request)
#define BLKIO_GETBLKSIZE _IO('B', 2)
#define BLKIO_GETSIZE _IO('B', 3)
#define BLKIO_SYNCDEV _IO('B', 4)
 
/* Device driver interface conventions suppose that driver may
* contain initialize/open/close/read/write/ioctl entry points. These
* primitives (except initialize) can be implemented in generic fashion,
* based upon supplied block device driver ioctl handler. Every block
* device driver should provide initialize entry point, which is register
* all block devices and appropriate ioctl handlers.
*/
 
#define GENERIC_BLOCK_DEVICE_DRIVER_ENTRIES \
rtems_blkdev_generic_open, rtems_blkdev_generic_close, \
rtems_blkdev_generic_read, rtems_blkdev_generic_write, \
rtems_blkdev_generic_ioctl
 
/* blkdev_generic_read --
* Generic block device read primitive. Implemented using block device
* buffer management primitives.
*/
rtems_device_driver
rtems_blkdev_generic_read(
rtems_device_major_number major,
rtems_device_minor_number minor,
void * arg
);
 
/* blkdev_generic_write --
* Generic block device driver write primitive. Implemented using block
* device buffer management primitives.
*/
rtems_device_driver
rtems_blkdev_generic_write(
rtems_device_major_number major,
rtems_device_minor_number minor,
void * arg
);
 
/* blkdev_generic_open --
* Generic block device open primitive.
*/
rtems_device_driver
rtems_blkdev_generic_open(
rtems_device_major_number major,
rtems_device_minor_number minor,
void * arg
);
 
/* blkdev_generic_close --
* Generic block device close primitive.
*/
rtems_device_driver
rtems_blkdev_generic_close(
rtems_device_major_number major,
rtems_device_minor_number minor,
void * arg
);
 
/* blkdev_generic_ioctl --
* Generic block device ioctl primitive.
*/
rtems_device_driver
rtems_blkdev_generic_ioctl(
rtems_device_major_number major,
rtems_device_minor_number minor,
void * arg
);
 
#ifdef __cplusplus
}
#endif
 
#endif
include/rtems Property changes : Added: svn:ignore ## -0,0 +1,2 ## +Makefile +Makefile.in Index: include =================================================================== --- include (nonexistent) +++ include (revision 1765)
include Property changes : Added: svn:ignore ## -0,0 +1,2 ## +Makefile +Makefile.in Index: src/bdbuf.c =================================================================== --- src/bdbuf.c (nonexistent) +++ src/bdbuf.c (revision 1765) @@ -0,0 +1,1648 @@ +/* + * Disk I/O buffering + * Buffer managment + * + * Copyright (C) 2001 OKTET Ltd., St.-Peterburg, Russia + * Author: Andrey G. Ivanov + * Victor V. Vengerov + * Alexander Kukuta + * + * @(#) bdbuf.c,v 1.3 2002/07/01 22:37:58 joel Exp + */ + +#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__ +#include +#include +#include +#include + +#include "rtems/bdbuf.h" + +/* Fatal errors: */ +#define BLKDEV_FATAL_ERROR(n) (('B' << 24) | ((n) & 0x00FFFFFF)) +#define BLKDEV_FATAL_BDBUF_CONSISTENCY BLKDEV_FATAL_ERROR(1) +#define BLKDEV_FATAL_BDBUF_SWAPOUT BLKDEV_FATAL_ERROR(2) + + +#define SWAPOUT_PRIORITY 15 +#define SWAPOUT_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE * 2) + +static rtems_task bdbuf_swapout_task(rtems_task_argument unused); + +/* + * The groups of the blocks with the same size are collected in the + * bd_pool. Note that a several of the buffer's groups with the + * same size can exists. + */ +typedef struct bdbuf_pool +{ + bdbuf_buffer *tree; /* Buffer descriptor lookup AVL tree root */ + + Chain_Control free; /* Free buffers list */ + Chain_Control lru; /* Last recently used list */ + + int blksize; /* The size of the blocks (in bytes) */ + int nblks; /* Number of blocks in this pool */ + rtems_id bufget_sema; /* Buffer obtain counting semaphore */ + void *mallocd_bufs; /* Pointer to the malloc'd buffer memory, + or NULL, if buffer memory provided in + buffer configuration */ + bdbuf_buffer *bdbufs; /* Pointer to table of buffer descriptors + allocated for this buffer pool. */ +} bdbuf_pool; + +/* Buffering layer context definition */ +struct bdbuf_context { + bdbuf_pool *pool; /* Table of buffer pools */ + int npools; /* Number of entries in pool table */ + + Chain_Control mod; /* Modified buffers list */ + rtems_id flush_sema; /* Buffer flush semaphore; counting + semaphore; incremented when buffer + flushed to the disk; decremented when + buffer modified */ + rtems_id swapout_task; /* Swapout task ID */ +}; + +/* Block device request with a single buffer provided */ +typedef struct blkdev_request1 { + blkdev_request req; + blkdev_sg_buffer sg[1]; +} blkdev_request1; + +/* The static context of buffering layer */ +static struct bdbuf_context bd_ctx; + +#define SAFE +#ifdef SAFE +typedef rtems_mode preemption_key; + +#define DISABLE_PREEMPTION(key) \ + do { \ + rtems_task_mode(RTEMS_PREEMPT_MASK, RTEMS_NO_PREEMPT, &(key)); \ + } while (0) + +#define ENABLE_PREEMPTION(key) \ + do { \ + rtems_mode temp; \ + rtems_task_mode(RTEMS_PREEMPT_MASK, (key), &temp); \ + } while (0) + +#else + +typedef boolean preemption_key; + +#define DISABLE_PREEMPTION(key) \ + do { \ + (key) = _Thread_Executing->is_preemptible; \ + _Thread_Executing->is_preemptible = 0; \ + } while (0) + +#define ENABLE_PREEMPTION(key) \ + do { \ + _Thread_Executing->is_preemptible = (key); \ + if (_Thread_Evaluate_mode()) \ + _Thread_Dispatch(); \ + } while (0) + +#endif + + +/* The default maximum height of 32 allows for AVL trees having + between 5,704,880 and 4,294,967,295 nodes, depending on order of + insertion. You may change this compile-time constant as you + wish. */ +#ifndef AVL_MAX_HEIGHT +#define AVL_MAX_HEIGHT 32 +#endif + +/* + * avl_search -- + * Searches for the node with specified dev/block. + * + * PARAMETERS: + * root - pointer to the root node of the AVL-Tree. + * dev, block - search key + * + * RETURNS: + * NULL if node with specified dev/block not found + * non-NULL - pointer to the node with specified dev/block + */ +static bdbuf_buffer * +avl_search(bdbuf_buffer **root, dev_t dev, blkdev_bnum block) +{ + bdbuf_buffer *p = *root; + + while ((p != NULL) && ((p->dev != dev) || (p->block != block))) + { + if ((p->dev < dev) || ((p->dev == dev) && (p->block < block))) + { + p = p->avl.right; + } + else + { + p = p->avl.left; + } + } + + return p; +} + + +/* avl_search_for_sync -- + * Search in AVL tree for first modified buffer belongs to specified + * disk device. + * + * PARAMETERS: + * root - pointer to tree root + * dd - disk device descriptor + * + * RETURNS: + * Block buffer, or NULL if no modified blocks on specified device + * exists. + */ +static bdbuf_buffer * +avl_search_for_sync(bdbuf_buffer **root, disk_device *dd) +{ + dev_t dev = dd->phys_dev->dev; + blkdev_bnum block_start = dd->start; + blkdev_bnum block_end = dd->start + dd->size - 1; + + bdbuf_buffer *buf_stack[AVL_MAX_HEIGHT]; + bdbuf_buffer **buf_prev = buf_stack; + bdbuf_buffer *p = *root; + + while (p != NULL) + { + if ((p->dev < dev) || ((p->dev == dev) && (p->block < block_start))) + { + p = p->avl.right; + } + else if ((p->dev > dev) || ((p->dev == dev) && (p->block > block_end))) + { + p = p->avl.left; + } + else if (p->modified) + { + return p; + } + else + { + if (p->avl.right != NULL) + { + *buf_prev++ = p->avl.right; + } + p = p->avl.left; + } + + if ((p == NULL) && (buf_prev > buf_stack)) + { + p = *--buf_prev; + } + } + + return p; +} + + +/* + * avl_insert -- + * Inserts the specified node to the AVl-Tree. + * + * PARAMETERS: + * root - Pointer to pointer to the root node + * node - Pointer to the node to add. + * + * RETURNS: + * 0 - The node added successfully + * -1 - An error occured + */ +static int +avl_insert(bdbuf_buffer **root, bdbuf_buffer *node) +{ + dev_t dev = node->dev; + blkdev_bnum block = node->block; + + bdbuf_buffer *p = *root; + bdbuf_buffer *q, *p1, *p2; + bdbuf_buffer *buf_stack[AVL_MAX_HEIGHT]; + bdbuf_buffer **buf_prev = buf_stack; + + boolean modified = FALSE; + + if (p == NULL) + { + *root = node; + node->avl.left = NULL; + node->avl.right = NULL; + node->avl.bal = 0; + return 0; + } + + while (p != NULL) + { + *buf_prev++ = p; + + if ((p->dev < dev) || ((p->dev == dev) && (p->block < block))) + { + p->avl.cache = 1; + q = p->avl.right; + if (q == NULL) + { + q = node; + p->avl.right = q = node; + break; + } + } + else if ((p->dev != dev) || (p->block != block)) + { + p->avl.cache = -1; + q = p->avl.left; + if (q == NULL) + { + q = node; + p->avl.left = q; + break; + } + } + else + { + return -1; + } + + p = q; + } + + q->avl.left = q->avl.right = NULL; + q->avl.bal = 0; + modified = TRUE; + buf_prev--; + + while (modified) + { + if (p->avl.cache == -1) + { + switch (p->avl.bal) + { + case 1: + p->avl.bal = 0; + modified = FALSE; + break; + + case 0: + p->avl.bal = -1; + break; + + case -1: + p1 = p->avl.left; + if (p1->avl.bal == -1) /* simple LL-turn */ + { + p->avl.left = p1->avl.right; + p1->avl.right = p; + p->avl.bal = 0; + p = p1; + } + else /* double LR-turn */ + { + p2 = p1->avl.right; + p1->avl.right = p2->avl.left; + p2->avl.left = p1; + p->avl.left = p2->avl.right; + p2->avl.right = p; + if (p2->avl.bal == -1) p->avl.bal = +1; else p->avl.bal = 0; + if (p2->avl.bal == +1) p1->avl.bal = -1; else p1->avl.bal = 0; + p = p2; + } + p->avl.bal = 0; + modified = FALSE; + break; + + default: + break; + } + } + else + { + switch (p->avl.bal) + { + case -1: + p->avl.bal = 0; + modified = FALSE; + break; + + case 0: + p->avl.bal = 1; + break; + + case 1: + p1 = p->avl.right; + if (p1->avl.bal == 1) /* simple RR-turn */ + { + p->avl.right = p1->avl.left; + p1->avl.left = p; + p->avl.bal = 0; + p = p1; + } + else /* double RL-turn */ + { + p2 = p1->avl.left; + p1->avl.left = p2->avl.right; + p2->avl.right = p1; + p->avl.right = p2->avl.left; + p2->avl.left = p; + if (p2->avl.bal == +1) p->avl.bal = -1; else p->avl.bal = 0; + if (p2->avl.bal == -1) p1->avl.bal = +1; else p1->avl.bal = 0; + p = p2; + } + p->avl.bal = 0; + modified = FALSE; + break; + + default: + break; + } + } + q = p; + if (buf_prev > buf_stack) + { + p = *--buf_prev; + + if (p->avl.cache == -1) + { + p->avl.left = q; + } + else + { + p->avl.right = q; + } + } + else + { + *root = p; + break; + } + }; + + return 0; +} + + +/* avl_remove -- + * removes the node from the tree. + * + * PARAMETERS: + * root_addr - Pointer to pointer to the root node + * node - Pointer to the node to remove + * + * RETURNS: + * 0 - Item removed + * -1 - No such item found + */ +static int +avl_remove(bdbuf_buffer **root, const bdbuf_buffer *node) +{ + dev_t dev = node->dev; + blkdev_bnum block = node->block; + + bdbuf_buffer *p = *root; + bdbuf_buffer *q, *r, *s, *p1, *p2; + bdbuf_buffer *buf_stack[AVL_MAX_HEIGHT]; + bdbuf_buffer **buf_prev = buf_stack; + + boolean modified = FALSE; + + memset(buf_stack, 0, sizeof(buf_stack)); + + while (p != NULL) + { + *buf_prev++ = p; + + if ((p->dev < dev) || ((p->dev == dev) && (p->block < block))) + { + p->avl.cache = 1; + p = p->avl.right; + } + else if ((p->dev != dev) || (p->block != block)) + { + p->avl.cache = -1; + p = p->avl.left; + } + else + { + /* node found */ + break; + } + } + + if (p == NULL) + { + /* there is no such node */ + return -1; + } + + q = p; + + buf_prev--; + if (buf_prev > buf_stack) + { + p = *(buf_prev - 1); + } + else + { + p = NULL; + } + + /* at this moment q - is a node to delete, p is q's parent */ + if (q->avl.right == NULL) + { + r = q->avl.left; + if (r != NULL) + { + r->avl.bal = 0; + } + q = r; + } + else + { + bdbuf_buffer **t; + + r = q->avl.right; + + if (r->avl.left == NULL) + { + r->avl.left = q->avl.left; + r->avl.bal = q->avl.bal; + r->avl.cache = 1; + *buf_prev++ = q = r; + } + else + { + t = buf_prev++; + s = r; + + while (s->avl.left != NULL) + { + *buf_prev++ = r = s; + s = r->avl.left; + r->avl.cache = -1; + } + + s->avl.left = q->avl.left; + r->avl.left = s->avl.right; + s->avl.right = q->avl.right; + s->avl.bal = q->avl.bal; + s->avl.cache = 1; + + *t = q = s; + } + } + + if (p != NULL) + { + if (p->avl.cache == -1) + { + p->avl.left = q; + } + else + { + p->avl.right = q; + } + } + else + { + *root = q; + } + + modified = TRUE; + + while (modified) + { + if (buf_prev > buf_stack) + { + p = *--buf_prev; + } + else + { + break; + } + + if (p->avl.cache == -1) + { + /* rebalance left branch */ + switch (p->avl.bal) + { + case -1: + p->avl.bal = 0; + break; + case 0: + p->avl.bal = 1; + modified = FALSE; + break; + + case +1: + p1 = p->avl.right; + + if (p1->avl.bal >= 0) /* simple RR-turn */ + { + p->avl.right = p1->avl.left; + p1->avl.left = p; + + if (p1->avl.bal == 0) + { + p1->avl.bal = -1; + modified = FALSE; + } + else + { + p->avl.bal = 0; + p1->avl.bal = 0; + } + p = p1; + } + else /* double RL-turn */ + { + p2 = p1->avl.left; + + p1->avl.left = p2->avl.right; + p2->avl.right = p1; + p->avl.right = p2->avl.left; + p2->avl.left = p; + + if (p2->avl.bal == +1) p->avl.bal = -1; else p->avl.bal = 0; + if (p2->avl.bal == -1) p1->avl.bal = 1; else p1->avl.bal = 0; + + p = p2; + p2->avl.bal = 0; + } + break; + + default: + break; + } + } + else + { + /* rebalance right branch */ + switch (p->avl.bal) + { + case +1: + p->avl.bal = 0; + break; + + case 0: + p->avl.bal = -1; + modified = FALSE; + break; + + case -1: + p1 = p->avl.left; + + if (p1->avl.bal <= 0) /* simple LL-turn */ + { + p->avl.left = p1->avl.right; + p1->avl.right = p; + if (p1->avl.bal == 0) + { + p1->avl.bal = 1; + modified = FALSE; + } + else + { + p->avl.bal = 0; + p1->avl.bal = 0; + } + p = p1; + } + else /* double LR-turn */ + { + p2 = p1->avl.right; + + p1->avl.right = p2->avl.left; + p2->avl.left = p1; + p->avl.left = p2->avl.right; + p2->avl.right = p; + + if (p2->avl.bal == -1) p->avl.bal = 1; else p->avl.bal = 0; + if (p2->avl.bal == +1) p1->avl.bal = -1; else p1->avl.bal = 0; + + p = p2; + p2->avl.bal = 0; + } + break; + + default: + break; + } + } + + if (buf_prev > buf_stack) + { + q = *(buf_prev - 1); + + if (q->avl.cache == -1) + { + q->avl.left = p; + } + else + { + q->avl.right = p; + } + } + else + { + *root = p; + break; + } + + } + + return 0; +} + +/* bdbuf_initialize_pool -- + * Initialize single buffer pool. + * + * PARAMETERS: + * config - buffer pool configuration + * pool - pool number + * + * RETURNS: + * RTEMS_SUCCESSFUL, if buffer pool initialized successfully, or error + * code if error occured. + */ +static rtems_status_code +bdbuf_initialize_pool(rtems_bdbuf_config *config, int pool) +{ + bdbuf_pool *p = bd_ctx.pool + pool; + unsigned char *bufs; + bdbuf_buffer *b; + rtems_status_code rc; + int i; + + p->blksize = config->size; + p->nblks = config->num; + p->tree = NULL; + + Chain_Initialize_empty(&p->free); + Chain_Initialize_empty(&p->lru); + + /* Allocate memory for buffer descriptors */ + p->bdbufs = calloc(config->num, sizeof(bdbuf_buffer)); + if (p->bdbufs == NULL) + { + return RTEMS_NO_MEMORY; + } + + /* Allocate memory for buffers if required */ + if (config->mem_area == NULL) + { + bufs = p->mallocd_bufs = malloc(config->num * config->size); + if (bufs == NULL) + { + free(p->bdbufs); + return RTEMS_NO_MEMORY; + } + } + else + { + bufs = config->mem_area; + p->mallocd_bufs = NULL; + } + + for (i = 0, b = p->bdbufs; i < p->nblks; i++, b++, bufs += p->blksize) + { + b->dev = -1; b->block = 0; + b->buffer = bufs; + b->actual = b->modified = b->in_progress = FALSE; + b->use_count = 0; + b->pool = pool; + _Chain_Append(&p->free, &b->link); + } + + rc = rtems_semaphore_create( + rtems_build_name('B', 'U', 'F', 'G'), + p->nblks, + RTEMS_FIFO | RTEMS_COUNTING_SEMAPHORE | RTEMS_NO_INHERIT_PRIORITY | + RTEMS_NO_PRIORITY_CEILING | RTEMS_LOCAL, + 0, + &p->bufget_sema); + + if (rc != RTEMS_SUCCESSFUL) + { + free(p->bdbufs); + free(p->mallocd_bufs); + return rc; + } + + return RTEMS_SUCCESSFUL; +} + +/* bdbuf_release_pool -- + * Free resources allocated for buffer pool with specified number. + * + * PARAMETERS: + * pool - buffer pool number + * + * RETURNS: + * RTEMS_SUCCESSFUL + */ +static rtems_status_code +bdbuf_release_pool(rtems_bdpool_id pool) +{ + bdbuf_pool *p = bd_ctx.pool + pool; + rtems_semaphore_delete(p->bufget_sema); + free(p->bdbufs); + free(p->mallocd_bufs); + return RTEMS_SUCCESSFUL; +} + +/* rtems_bdbuf_init -- + * Prepare buffering layer to work - initialize buffer descritors + * and (if it is neccessary)buffers. Buffers will be allocated accoriding + * to the configuration table, each entry describes kind of block and + * amount requested. After initialization all blocks is placed into + * free elements lists. + * + * PARAMETERS: + * conf_table - pointer to the buffers configuration table + * size - number of entries in configuration table + * + * RETURNS: + * RTEMS status code (RTEMS_SUCCESSFUL if operation completed successfully + * or error code if error is occured) + */ +rtems_status_code +rtems_bdbuf_init(rtems_bdbuf_config *conf_table, int size) +{ + rtems_bdpool_id i; + rtems_status_code rc; + + if (size <= 0) + return RTEMS_INVALID_SIZE; + + bd_ctx.npools = size; + + /* + * Allocate memory for buffer pool descriptors + */ + bd_ctx.pool = calloc(size, sizeof(bdbuf_pool)); + if (bd_ctx.pool == NULL) + { + return RTEMS_NO_MEMORY; + } + + Chain_Initialize_empty(&bd_ctx.mod); + + /* Initialize buffer pools and roll out if something failed */ + for (i = 0; i < size; i++) + { + rc = bdbuf_initialize_pool(conf_table + i, i); + if (rc != RTEMS_SUCCESSFUL) + { + rtems_bdpool_id j; + for (j = 0; j < i - 1; j++) + { + bdbuf_release_pool(j); + } + return rc; + } + } + + /* Create buffer flush semaphore */ + rc = rtems_semaphore_create( + rtems_build_name('B', 'F', 'L', 'U'), 0, + RTEMS_FIFO | RTEMS_COUNTING_SEMAPHORE | RTEMS_NO_INHERIT_PRIORITY | + RTEMS_NO_PRIORITY_CEILING | RTEMS_LOCAL, 0, + &bd_ctx.flush_sema); + if (rc != RTEMS_SUCCESSFUL) + { + for (i = 0; i < size; i++) + bdbuf_release_pool(i); + free(bd_ctx.pool); + return rc; + } + + /* Create and start swapout task */ + rc = rtems_task_create( + rtems_build_name('B', 'S', 'W', 'P'), + SWAPOUT_PRIORITY, + SWAPOUT_STACK_SIZE, + RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, + RTEMS_DEFAULT_ATTRIBUTES, + &bd_ctx.swapout_task); + if (rc != RTEMS_SUCCESSFUL) + { + rtems_semaphore_delete(bd_ctx.flush_sema); + for (i = 0; i < size; i++) + bdbuf_release_pool(i); + free(bd_ctx.pool); + return rc; + } + + rc = rtems_task_start(bd_ctx.swapout_task, bdbuf_swapout_task, 0); + if (rc != RTEMS_SUCCESSFUL) + { + rtems_task_delete(bd_ctx.swapout_task); + rtems_semaphore_delete(bd_ctx.flush_sema); + for (i = 0; i < size; i++) + bdbuf_release_pool(i); + free(bd_ctx.pool); + return rc; + } + + return RTEMS_SUCCESSFUL; +} + +/* find_or_assign_buffer -- + * Looks for buffer already assigned for this dev/block. If one is found + * obtain block buffer. If specified block already cached (i.e. there's + * block in the _modified_, or _recently_used_), return address + * of appropriate buffer descriptor and increment reference counter to 1. + * If block is not cached, allocate new buffer and return it. Data + * shouldn't be read to the buffer from media; buffer contains arbitrary + * data. This primitive may be blocked if there are no free buffer + * descriptors available and there are no unused non-modified (or + * synchronized with media) buffers available. + * + * PARAMETERS: + * device - device number (constructed of major and minor device number + * block - linear media block number + * ret_buf - address of the variable to store address of found descriptor + * + * RETURNS: + * RTEMS status code (RTEMS_SUCCESSFUL if operation completed successfully + * or error code if error is occured) + * + * SIDE EFFEECTS: + * bufget_sema may be obtained by this primitive + * + * NOTE: + * It is assumed that primitive invoked when thread preemption is disabled. + */ +static rtems_status_code +find_or_assign_buffer(disk_device *dd, + blkdev_bnum block, + bdbuf_buffer **ret_buf) +{ + bdbuf_buffer *bd_buf; + bdbuf_pool *bd_pool; + rtems_status_code rc; + dev_t device; + ISR_Level level; + + int blksize; + + device = dd->dev; + bd_pool = bd_ctx.pool + dd->pool; + blksize = dd->block_size; + +again: + /* Looking for buffer descriptor used for this dev/block. */ + bd_buf = avl_search(&bd_pool->tree, device, block); + + if (bd_buf == NULL) + { + /* Try to obtain semaphore without waiting first. It is the most + frequent case when reasonable number of buffers configured. If + it is failed, obtain semaphore blocking on it. In this case + it should be checked that appropriate buffer hasn't been loaded + by another thread, because this thread is preempted */ + rc = rtems_semaphore_obtain(bd_pool->bufget_sema, RTEMS_NO_WAIT, 0); + if (rc == RTEMS_UNSATISFIED) + { + rc = rtems_semaphore_obtain(bd_pool->bufget_sema, + RTEMS_WAIT, RTEMS_NO_TIMEOUT); + bd_buf = avl_search(&bd_pool->tree, device, block); + if (bd_buf != NULL) + rtems_semaphore_release(bd_pool->bufget_sema); + } + } + + if (bd_buf == NULL) + { + /* Assign new buffer descriptor */ + if (_Chain_Is_empty(&bd_pool->free)) + { + bd_buf = (bdbuf_buffer *)Chain_Get(&bd_pool->lru); + if (bd_buf != NULL) + { + int avl_result; + avl_result = avl_remove(&bd_pool->tree, bd_buf); + if (avl_result != 0) + { + rtems_fatal_error_occurred(BLKDEV_FATAL_BDBUF_CONSISTENCY); + return RTEMS_INTERNAL_ERROR; + } + } + } + else + { + bd_buf = (bdbuf_buffer *)Chain_Get(&(bd_pool->free)); + } + + if (bd_buf == NULL) + { + goto again; + } + else + { + bd_buf->dev = device; + bd_buf->block = block; +#ifdef AVL_GPL + bd_buf->avl.link[0] = NULL; + bd_buf->avl.link[1] = NULL; +#else + bd_buf->avl.left = NULL; + bd_buf->avl.right = NULL; +#endif + bd_buf->use_count = 1; + bd_buf->modified = bd_buf->actual = bd_buf->in_progress = FALSE; + bd_buf->status = RTEMS_SUCCESSFUL; + + if (avl_insert(&bd_pool->tree, bd_buf) != 0) + { + rtems_fatal_error_occurred(BLKDEV_FATAL_BDBUF_CONSISTENCY); + return RTEMS_INTERNAL_ERROR; + } + + *ret_buf = bd_buf; + + return RTEMS_SUCCESSFUL; + } + } + else + { + /* Buffer descriptor already assigned for this dev/block */ + if (bd_buf->use_count == 0) + { + /* If we are removing from lru list, obtain the bufget_sema + * first. If we are removing from mod list, obtain flush sema. + * It should be obtained without blocking because we know + * that our buffer descriptor is in the list. */ + if (bd_buf->modified) + { + rc = rtems_semaphore_obtain(bd_ctx.flush_sema, + RTEMS_NO_WAIT, 0); + } + else + { + rc = rtems_semaphore_obtain(bd_pool->bufget_sema, + RTEMS_NO_WAIT, 0); + } + /* It is possible that we couldn't obtain flush or bufget sema + * although buffer in the appropriate chain is available: + * semaphore may be released to swapout task, but this task + * actually did not start to process it. */ + if (rc == RTEMS_UNSATISFIED) + rc = RTEMS_SUCCESSFUL; + if (rc != RTEMS_SUCCESSFUL) + { + rtems_fatal_error_occurred(BLKDEV_FATAL_BDBUF_CONSISTENCY); + return RTEMS_INTERNAL_ERROR; + } + + /* Buffer descriptor is linked to the lru or mod chain. Remove + it from there. */ + Chain_Extract(&bd_buf->link); + } + bd_buf->use_count++; + while (bd_buf->in_progress != 0) + { + rtems_interrupt_disable(level); + _CORE_mutex_Seize(&bd_buf->transfer_sema, 0, TRUE, + WATCHDOG_NO_TIMEOUT, level); + } + + *ret_buf = bd_buf; + return RTEMS_SUCCESSFUL; + } +} + +/* rtems_bdbuf_get -- + * Obtain block buffer. If specified block already cached (i.e. there's + * block in the _modified_, or _recently_used_), return address + * of appropriate buffer descriptor and increment reference counter to 1. + * If block is not cached, allocate new buffer and return it. Data + * shouldn't be read to the buffer from media; buffer may contains + * arbitrary data. This primitive may be blocked if there are no free + * buffer descriptors available and there are no unused non-modified + * (or synchronized with media) buffers available. + * + * PARAMETERS: + * device - device number (constructed of major and minor device number) + * block - linear media block number + * bd - address of variable to store pointer to the buffer descriptor + * + * RETURNS: + * RTEMS status code (RTEMS_SUCCESSFUL if operation completed successfully + * or error code if error is occured) + * + * SIDE EFFECTS: + * bufget_sema semaphore obtained by this primitive. + */ +rtems_status_code +rtems_bdbuf_get(dev_t device, blkdev_bnum block, bdbuf_buffer **bd) +{ + rtems_status_code rc; + disk_device *dd; + disk_device *pdd; + preemption_key key; + + /* + * Convert logical dev/block to physical one + */ + dd = rtems_disk_lookup(device); + if (dd == NULL) + return RTEMS_INVALID_ID; + + if (block >= dd->size) + { + rtems_disk_release(dd); + return RTEMS_INVALID_NUMBER; + } + + pdd = dd->phys_dev; + block += dd->start; + rtems_disk_release(dd); + + DISABLE_PREEMPTION(key); + rc = find_or_assign_buffer(pdd, block, bd); + ENABLE_PREEMPTION(key); + + if (rc != RTEMS_SUCCESSFUL) + return rc; + + return RTEMS_SUCCESSFUL; +} + +/* bdbuf_initialize_transfer_sema -- + * Initialize transfer_sema mutex semaphore associated with buffer + * descriptor. + */ +static inline void +bdbuf_initialize_transfer_sema(bdbuf_buffer *bd_buf) +{ + CORE_mutex_Attributes mutex_attr; + mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_BLOCKS; + mutex_attr.only_owner_release = FALSE; + mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO; + mutex_attr.priority_ceiling = 0; + + _CORE_mutex_Initialize(&bd_buf->transfer_sema, + &mutex_attr, CORE_MUTEX_LOCKED); +} + +/* bdbuf_write_transfer_done -- + * Callout function. Invoked by block device driver when data transfer + * to device (write) is completed. This function may be invoked from + * interrupt handler. + * + * PARAMETERS: + * arg - arbitrary argument specified in block device request + * structure (in this case - pointer to the appropriate + * bdbuf_buffer buffer descriptor structure). + * status - I/O completion status + * error - errno error code if status != RTEMS_SUCCESSFUL + * + * RETURNS: + * none + */ +static void +bdbuf_write_transfer_done(void *arg, rtems_status_code status, int error) +{ + bdbuf_buffer *bd_buf = arg; + bd_buf->status = status; + bd_buf->error = error; + bd_buf->in_progress = bd_buf->modified = FALSE; + _CORE_mutex_Surrender(&bd_buf->transfer_sema, 0, NULL); + _CORE_mutex_Flush(&bd_buf->transfer_sema, NULL, + CORE_MUTEX_STATUS_SUCCESSFUL); +} + +/* bdbuf_read_transfer_done -- + * Callout function. Invoked by block device driver when data transfer + * from device (read) is completed. This function may be invoked from + * interrupt handler. + * + * PARAMETERS: + * arg - arbitrary argument specified in block device request + * structure (in this case - pointer to the appropriate + * bdbuf_buffer buffer descriptor structure). + * status - I/O completion status + * error - errno error code if status != RTEMS_SUCCESSFUL + * + * RETURNS: + * none + */ +static void +bdbuf_read_transfer_done(void *arg, rtems_status_code status, int error) +{ + bdbuf_buffer *bd_buf = arg; + bd_buf->status = status; + bd_buf->error = error; + _CORE_mutex_Surrender(&bd_buf->transfer_sema, 0, NULL); + _CORE_mutex_Flush(&bd_buf->transfer_sema, NULL, + CORE_MUTEX_STATUS_SUCCESSFUL); +} + +/* rtems_bdbuf_read -- + * (Similar to the rtems_bdbuf_get, except reading data from media) + * Obtain block buffer. If specified block already cached, return address + * of appropriate buffer and increment reference counter to 1. If block is + * not cached, allocate new buffer and read data to it from the media. + * This primitive may be blocked on waiting until data to be read from + * media, if there are no free buffer descriptors available and there are + * no unused non-modified (or synchronized with media) buffers available. + * + * PARAMETERS: + * device - device number (consists of major and minor device number) + * block - linear media block number + * bd - address of variable to store pointer to the buffer descriptor + * + * RETURNS: + * RTEMS status code (RTEMS_SUCCESSFUL if operation completed successfully + * or error code if error is occured) + * + * SIDE EFFECTS: + * bufget_sema and transfer_sema semaphores obtained by this primitive. + */ +rtems_status_code +rtems_bdbuf_read(dev_t device, + blkdev_bnum block, + bdbuf_buffer **bd) +{ + preemption_key key; + ISR_Level level; + + bdbuf_buffer *bd_buf; + rtems_status_code rc; + int result; + disk_device *dd; + disk_device *pdd; + blkdev_request1 req; + + dd = rtems_disk_lookup(device); + if (dd == NULL) + return RTEMS_INVALID_ID; + + if (block >= dd->size) + { + rtems_disk_release(dd); + return RTEMS_INVALID_NUMBER; + } + + pdd = dd->phys_dev; + block += dd->start; + + DISABLE_PREEMPTION(key); + rc = find_or_assign_buffer(pdd, block, &bd_buf); + + if (rc != RTEMS_SUCCESSFUL) + { + ENABLE_PREEMPTION(key); + rtems_disk_release(dd); + return rc; + } + + if (!bd_buf->actual) + { + bd_buf->in_progress = 1; + + req.req.req = BLKDEV_REQ_READ; + req.req.req_done = bdbuf_read_transfer_done; + req.req.done_arg = bd_buf; + req.req.start = block; + req.req.count = 1; + req.req.bufnum = 1; + req.req.bufs[0].length = dd->block_size; + req.req.bufs[0].buffer = bd_buf->buffer; + + bdbuf_initialize_transfer_sema(bd_buf); + result = dd->ioctl(device, BLKIO_REQUEST, &req); + if (result == -1) + { + bd_buf->status = RTEMS_IO_ERROR; + bd_buf->error = errno; + bd_buf->actual = FALSE; + } + else + { + rtems_interrupt_disable(level); + _CORE_mutex_Seize(&bd_buf->transfer_sema, 0, TRUE, + WATCHDOG_NO_TIMEOUT, level); + bd_buf->actual = TRUE; + } + bd_buf->in_progress = FALSE; + } + rtems_disk_release(dd); + + ENABLE_PREEMPTION(key); + + *bd = bd_buf; + + return RTEMS_SUCCESSFUL; +} + + +/* bdbuf_release -- + * Release buffer. Decrease buffer usage counter. If it is zero, further + * processing depends on modified attribute. If buffer was modified, it + * is inserted into mod chain and swapout task waken up. If buffer was + * not modified, it is returned to the end of lru chain making it available + * for further use. + * + * PARAMETERS: + * bd_buf - pointer to the released buffer descriptor. + * + * RETURNS: + * RTEMS_SUCCESSFUL if buffer released successfully, or error code if + * error occured. + * + * NOTE: + * This is internal function. It is assumed that task made non-preemptive + * before its invocation. + */ +static rtems_status_code +bdbuf_release(bdbuf_buffer *bd_buf) +{ + bdbuf_pool *bd_pool; + rtems_status_code rc = RTEMS_SUCCESSFUL; + + if (bd_buf->use_count <= 0) + return RTEMS_INTERNAL_ERROR; + + bd_pool = bd_ctx.pool + bd_buf->pool; + + bd_buf->use_count--; + + if (bd_buf->use_count == 0) + { + if (bd_buf->modified) + { + + /* Buffer was modified. Insert buffer to the modified buffers + * list and initiate flushing. */ + Chain_Append(&bd_ctx.mod, &bd_buf->link); + + /* Release the flush_sema */ + rc = rtems_semaphore_release(bd_ctx.flush_sema); + } + else + { + /* Buffer was not modified. Add this descriptor to the + * end of lru chain and make it available for reuse. */ + Chain_Append(&bd_pool->lru, &bd_buf->link); + rc = rtems_semaphore_release(bd_pool->bufget_sema); + } + } + return rc; +} + + +/* rtems_bdbuf_release -- + * Release buffer allocated before. This primitive decrease the + * usage counter. If it is zero, further destiny of buffer depends on + * 'modified' status. If buffer was modified, it is placed to the end of + * mod list and flush task waken up. If buffer was not modified, + * it is placed to the end of lru list, and bufget_sema released, allowing + * to reuse this buffer. + * + * PARAMETERS: + * bd_buf - pointer to the bdbuf_buffer structure previously obtained using + * get/read primitive. + * + * RETURNS: + * RTEMS status code (RTEMS_SUCCESSFUL if operation completed successfully + * or error code if error is occured) + * + * SIDE EFFECTS: + * flush_sema and bufget_sema semaphores may be released by this primitive. + */ +rtems_status_code +rtems_bdbuf_release(bdbuf_buffer *bd_buf) +{ + preemption_key key; + rtems_status_code rc = RTEMS_SUCCESSFUL; + + if (bd_buf == NULL) + return RTEMS_INVALID_ADDRESS; + + DISABLE_PREEMPTION(key); + + rc = bdbuf_release(bd_buf); + + ENABLE_PREEMPTION(key); + + return rc; +} + +/* rtems_bdbuf_release_modified -- + * Release buffer allocated before, assuming that it is _modified_ by + * it's owner. This primitive decrease usage counter for buffer, mark + * buffer descriptor as modified. If usage counter is 0, insert it at + * end of mod chain and release flush_sema semaphore to activate the + * flush task. + * + * PARAMETERS: + * bd_buf - pointer to the bdbuf_buffer structure previously obtained using + * get/read primitive. + * + * RETURNS: + * RTEMS status code (RTEMS_SUCCESSFUL if operation completed successfully + * or error code if error is occured) + * + * SIDE EFFECTS: + * flush_sema semaphore may be released by this primitive. + */ +rtems_status_code +rtems_bdbuf_release_modified(bdbuf_buffer *bd_buf) +{ + preemption_key key; + rtems_status_code rc = RTEMS_SUCCESSFUL; + + if (bd_buf == NULL) + return RTEMS_INVALID_ADDRESS; + + DISABLE_PREEMPTION(key); + + if (!bd_buf->modified) + { + bdbuf_initialize_transfer_sema(bd_buf); + } + bd_buf->modified = TRUE; + bd_buf->actual = TRUE; + rc = bdbuf_release(bd_buf); + + ENABLE_PREEMPTION(key); + + return rc; +} + +/* rtems_bdbuf_sync -- + * Wait until specified buffer synchronized with disk. Invoked on exchanges + * critical for data consistency on the media. This primitive mark owned + * block as modified, decrease usage counter. If usage counter is 0, + * block inserted to the mod chain and flush_sema semaphore released. + * Finally, primitives blocked on transfer_sema semaphore. + * + * PARAMETERS: + * bd_buf - pointer to the bdbuf_buffer structure previously obtained using + * get/read primitive. + * + * RETURNS: + * RTEMS status code (RTEMS_SUCCESSFUL if operation completed successfully + * or error code if error is occured) + * + * SIDE EFFECTS: + * Primitive may be blocked on transfer_sema semaphore. + */ +rtems_status_code +rtems_bdbuf_sync(bdbuf_buffer *bd_buf) +{ + preemption_key key; + ISR_Level level; + rtems_status_code rc = RTEMS_SUCCESSFUL; + + if (bd_buf == NULL) + return RTEMS_INVALID_ADDRESS; + + DISABLE_PREEMPTION(key); + + if (!bd_buf->modified) + { + bdbuf_initialize_transfer_sema(bd_buf); + } + bd_buf->modified = TRUE; + bd_buf->actual = TRUE; + + rc = bdbuf_release(bd_buf); + + if (rc == RTEMS_SUCCESSFUL) + { + rtems_interrupt_disable(level); + _CORE_mutex_Seize(&bd_buf->transfer_sema, 0, TRUE, + WATCHDOG_NO_TIMEOUT, level); + } + + ENABLE_PREEMPTION(key); + + return rc; +} + +/* rtems_bdbuf_syncdev -- + * Synchronize with disk all buffers containing the blocks belonging to + * specified device. + * + * PARAMETERS: + * dev - block device number + * + * RETURNS: + * RTEMS status code (RTEMS_SUCCESSFUL if operation completed successfully + * or error code if error is occured) + */ +rtems_status_code +rtems_bdbuf_syncdev(dev_t dev) +{ + preemption_key key; + ISR_Level level; + + bdbuf_buffer *bd_buf; + disk_device *dd; + bdbuf_pool *pool; + + dd = rtems_disk_lookup(dev); + if (dd == NULL) + return RTEMS_INVALID_ID; + + pool = bd_ctx.pool + dd->pool; + + DISABLE_PREEMPTION(key); + do { + bd_buf = avl_search_for_sync(&pool->tree, dd); + if (bd_buf != NULL /* && bd_buf->modified */) + { + rtems_interrupt_disable(level); + _CORE_mutex_Seize(&bd_buf->transfer_sema, 0, TRUE, + WATCHDOG_NO_TIMEOUT, level); + } + } while (bd_buf != NULL); + ENABLE_PREEMPTION(key); + return rtems_disk_release(dd); +} + +/* bdbuf_swapout_task -- + * Body of task which take care on flushing modified buffers to the + * disk. + */ +static rtems_task +bdbuf_swapout_task(rtems_task_argument unused) +{ + rtems_status_code rc; + int result; + ISR_Level level; + bdbuf_buffer *bd_buf; + bdbuf_pool *bd_pool; + disk_device *dd; + blkdev_request1 req; + + while (1) + { + rc = rtems_semaphore_obtain(bd_ctx.flush_sema, RTEMS_WAIT, 0); + if (rc != RTEMS_SUCCESSFUL) + { + rtems_fatal_error_occurred(BLKDEV_FATAL_BDBUF_SWAPOUT); + } + + bd_buf = (bdbuf_buffer *)Chain_Get(&bd_ctx.mod); + if (bd_buf == NULL) + { + /* It is possible that flush_sema semaphore will be released, but + * buffer to be removed from mod chain before swapout task start + * its processing. */ + continue; + } + + bd_buf->in_progress = TRUE; + bd_buf->use_count++; + bd_pool = bd_ctx.pool + bd_buf->pool; + dd = rtems_disk_lookup(bd_buf->dev); + + req.req.req = BLKDEV_REQ_WRITE; + req.req.req_done = bdbuf_write_transfer_done; + req.req.done_arg = bd_buf; + req.req.start = bd_buf->block + dd->start; + req.req.count = 1; + req.req.bufnum = 1; + req.req.bufs[0].length = dd->block_size; + req.req.bufs[0].buffer = bd_buf->buffer; + + /* transfer_sema initialized when bd_buf inserted in the mod chain + first time */ + result = dd->ioctl(dd->phys_dev->dev, BLKIO_REQUEST, &req); + + rtems_disk_release(dd); + + if (result == -1) + { + bd_buf->status = RTEMS_IO_ERROR; + bd_buf->error = errno; + /* Release tasks waiting on syncing this buffer */ + _CORE_mutex_Flush(&bd_buf->transfer_sema, NULL, + CORE_MUTEX_STATUS_SUCCESSFUL); + } + else + { + if (bd_buf->in_progress) + { + rtems_interrupt_disable(level); + _CORE_mutex_Seize(&bd_buf->transfer_sema, 0, TRUE, 0, level); + } + } + bd_buf->use_count--; + + /* Another task have chance to use this buffer, or even + * modify it. If buffer is not in use, insert it in appropriate chain + * and release semaphore */ + if (bd_buf->use_count == 0) + { + if (bd_buf->modified) + { + Chain_Append(&bd_ctx.mod, &bd_buf->link); + rc = rtems_semaphore_release(bd_ctx.flush_sema); + } + else + { + Chain_Append(&bd_pool->lru, &bd_buf->link); + rc = rtems_semaphore_release(bd_pool->bufget_sema); + } + } + } +} + +/* rtems_bdbuf_find_pool -- + * Find first appropriate buffer pool. This primitive returns the index + * of first buffer pool which block size is greater than or equal to + * specified size. + * + * PARAMETERS: + * block_size - requested block size + * pool - placeholder for result + * + * RETURNS: + * RTEMS status code: RTEMS_SUCCESSFUL if operation completed successfully, + * RTEMS_INVALID_SIZE if specified block size is invalid (not a power + * of 2), RTEMS_NOT_DEFINED if buffer pool for this or greater block size + * is not configured. + */ +rtems_status_code +rtems_bdbuf_find_pool(int block_size, rtems_bdpool_id *pool) +{ + rtems_bdpool_id i; + bdbuf_pool *p; + int cursize = INT_MAX; + rtems_bdpool_id curid = -1; + rtems_boolean found = FALSE; + int j; + + for (j = block_size; (j != 0) && ((j & 1) == 0); j >>= 1); + if (j != 1) + return RTEMS_INVALID_SIZE; + + for (i = 0, p = bd_ctx.pool; i < bd_ctx.npools; i++, p++) + { + if ((p->blksize >= block_size) && + (p->blksize < cursize)) + { + curid = i; + cursize = p->blksize; + found = TRUE; + } + } + + if (found) + { + if (pool != NULL) + *pool = curid; + return RTEMS_SUCCESSFUL; + } + else + { + return RTEMS_NOT_DEFINED; + } +} + +/* rtems_bdbuf_get_pool_info -- + * Obtain characteristics of buffer pool with specified number. + * + * PARAMETERS: + * pool - buffer pool number + * block_size - block size for which buffer pool is configured returned + * there + * blocks - number of buffers in buffer pool returned there + * + * RETURNS: + * RTEMS status code: RTEMS_SUCCESSFUL if operation completed successfully, + * RTEMS_INVALID_NUMBER if appropriate buffer pool is not configured. + * + * NOTE: + * Buffer pools enumerated contiguously starting from 0. + */ +rtems_status_code +rtems_bdbuf_get_pool_info(rtems_bdpool_id pool, int *block_size, + int *blocks) +{ + if (pool >= bd_ctx.npools) + return RTEMS_INVALID_NUMBER; + + if (block_size != NULL) + { + *block_size = bd_ctx.pool[pool].blksize; + } + + if (blocks != NULL) + { + *blocks = bd_ctx.pool[pool].nblks; + } + + return RTEMS_SUCCESSFUL; +} Index: src/blkdev.c =================================================================== --- src/blkdev.c (nonexistent) +++ src/blkdev.c (revision 1765) @@ -0,0 +1,245 @@ +/* + * blkdev.h - block device driver generic support + * + * Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia + * Author: Victor V. Vengerov + * + * @(#) blkdev.c,v 1.2 2002/04/08 18:29:02 joel Exp + */ + +#include + +#include +#include +#include + +#include "rtems/diskdevs.h" +#include "rtems/bdbuf.h" + +/* rtems_blkdev_generic_read -- + * Generic block device read primitive. Implemented using block device + * buffer management primitives. + */ +rtems_device_driver +rtems_blkdev_generic_read( + rtems_device_major_number major, + rtems_device_minor_number minor, + void * arg) +{ + rtems_libio_rw_args_t *args = arg; + int block_size_log2; + int block_size; + char *buf; + unsigned int count; + unsigned int block; + unsigned int blkofs; + dev_t dev; + disk_device *dd; + + dev = rtems_filesystem_make_dev_t(major, minor); + dd = rtems_disk_lookup(dev); + if (dd == NULL) + return RTEMS_INVALID_NUMBER; + + block_size_log2 = dd->block_size_log2; + block_size = dd->block_size; + + buf = args->buffer; + count = args->count; + args->bytes_moved = 0; + + block = args->offset >> block_size_log2; + blkofs = args->offset & (block_size - 1); + + while (count > 0) + { + bdbuf_buffer *diskbuf; + int copy; + rtems_status_code rc; + + rc = rtems_bdbuf_read(dev, block, &diskbuf); + if (rc != RTEMS_SUCCESSFUL) + return rc; + copy = block_size - blkofs; + if (copy > count) + copy = count; + memcpy(buf, (char *)diskbuf->buffer + blkofs, copy); + rc = rtems_bdbuf_release(diskbuf); + args->bytes_moved += copy; + if (rc != RTEMS_SUCCESSFUL) + return rc; + count -= copy; + buf += copy; + blkofs = 0; + block++; + } + return RTEMS_SUCCESSFUL; +} + +/* rtems_blkdev_generic_write -- + * Generic block device write primitive. Implemented using block device + * buffer management primitives. + */ +rtems_device_driver +rtems_blkdev_generic_write( + rtems_device_major_number major, + rtems_device_minor_number minor, + void * arg) +{ + rtems_libio_rw_args_t *args = arg; + int block_size_log2; + int block_size; + char *buf; + unsigned int count; + unsigned int block; + unsigned int blkofs; + dev_t dev; + rtems_status_code rc; + disk_device *dd; + + dev = rtems_filesystem_make_dev_t(major, minor); + dd = rtems_disk_lookup(dev); + if (dd == NULL) + return RTEMS_INVALID_NUMBER; + + block_size_log2 = dd->block_size_log2; + block_size = dd->block_size; + + buf = args->buffer; + count = args->count; + args->bytes_moved = 0; + + block = args->offset >> block_size_log2; + blkofs = args->offset & (block_size - 1); + + while (count > 0) + { + bdbuf_buffer *diskbuf; + int copy; + + if ((blkofs == 0) && (count > block_size)) + rc = rtems_bdbuf_get(dev, block, &diskbuf); + else + rc = rtems_bdbuf_read(dev, block, &diskbuf); + if (rc != RTEMS_SUCCESSFUL) + return rc; + + copy = block_size - blkofs; + if (copy > count) + copy = count; + memcpy((char *)diskbuf->buffer + blkofs, buf, copy); + args->bytes_moved += copy; + + rc = rtems_bdbuf_release_modified(diskbuf); + if (rc != RTEMS_SUCCESSFUL) + return rc; + + count -= copy; + buf += copy; + blkofs = 0; + block++; + } + return RTEMS_SUCCESSFUL; +} + +/* blkdev_generic_open -- + * Generic block device open primitive. + */ +rtems_device_driver +rtems_blkdev_generic_open( + rtems_device_major_number major, + rtems_device_minor_number minor, + void * arg) +{ + dev_t dev; + disk_device *dd; + + dev = rtems_filesystem_make_dev_t(major, minor); + dd = rtems_disk_lookup(dev); + if (dd == NULL) + return RTEMS_INVALID_NUMBER; + + dd->uses++; + + rtems_disk_release(dd); + + return RTEMS_SUCCESSFUL; +} + + +/* blkdev_generic_close -- + * Generic block device close primitive. + */ +rtems_device_driver +rtems_blkdev_generic_close( + rtems_device_major_number major, + rtems_device_minor_number minor, + void * arg) +{ + dev_t dev; + disk_device *dd; + + dev = rtems_filesystem_make_dev_t(major, minor); + dd = rtems_disk_lookup(dev); + if (dd == NULL) + return RTEMS_INVALID_NUMBER; + + dd->uses--; + + rtems_disk_release(dd); + + return RTEMS_SUCCESSFUL; +} + +/* blkdev_generic_ioctl -- + * Generic block device ioctl primitive. + */ +rtems_device_driver +rtems_blkdev_generic_ioctl( + rtems_device_major_number major, + rtems_device_minor_number minor, + void * arg) +{ + rtems_libio_ioctl_args_t *args = arg; + dev_t dev; + disk_device *dd; + int rc; + + dev = rtems_filesystem_make_dev_t(major, minor); + dd = rtems_disk_lookup(dev); + if (dd == NULL) + return RTEMS_INVALID_NUMBER; + + switch (args->command) + { + case BLKIO_GETBLKSIZE: + args->ioctl_return = dd->block_size; + break; + + case BLKIO_GETSIZE: + args->ioctl_return = dd->size; + break; + + case BLKIO_SYNCDEV: + rc = rtems_bdbuf_syncdev(dd->dev); + args->ioctl_return = (rc == RTEMS_SUCCESSFUL ? 0 : -1); + break; + + case BLKIO_REQUEST: + { + blkdev_request *req = args->buffer; + req->start += dd->start; + args->ioctl_return = dd->ioctl(dd->phys_dev->dev, args->command, + req); + break; + } + + default: + args->ioctl_return = dd->ioctl(dd->phys_dev->dev, args->command, + args->buffer); + break; + } + rtems_disk_release(dd); + + return RTEMS_SUCCESSFUL; +} Index: src/ramdisk.c =================================================================== --- src/ramdisk.c (nonexistent) +++ src/ramdisk.c (revision 1765) @@ -0,0 +1,225 @@ +/* ramdisk.c -- RAM disk block device implementation + * + * Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia + * Author: Victor V. Vengerov + * + * @(#) ramdisk.c,v 1.2 2002/04/08 18:29:02 joel Exp + */ + +#include +#include +#include +#include +#include +#include + +#include "rtems/blkdev.h" +#include "rtems/diskdevs.h" +#include "rtems/ramdisk.h" + +#define RAMDISK_DEVICE_BASE_NAME "/dev/ramdisk" + +/* Internal RAM disk descriptor */ +struct ramdisk { + int block_size; /* RAM disk block size */ + int block_num; /* Number of blocks on this RAM disk */ + void *area; /* RAM disk memory area */ + rtems_boolean initialized;/* RAM disk is initialized */ + rtems_boolean malloced; /* != 0, if memory allocated by malloc for this + RAM disk */ +}; + +static struct ramdisk *ramdisk; +static int nramdisks; + +/* ramdisk_read -- + * RAM disk READ request handler. This primitive copies data from RAM + * disk to supplied buffer and invoke the callout function to inform + * upper layer that reading is completed. + * + * PARAMETERS: + * req - pointer to the READ block device request info + * + * RETURNS: + * ioctl return value + */ +static int +ramdisk_read(struct ramdisk *rd, blkdev_request *req) +{ + char *from; + rtems_unsigned32 i; + blkdev_sg_buffer *sg; + rtems_unsigned32 remains; + + from = (char *)rd->area + (req->start * rd->block_size); + remains = rd->block_size * req->count; + sg = req->bufs; + for (i = 0; (remains > 0) && (i < req->bufnum); i++, sg++) + { + int count = sg->length; + if (count > remains) + count = remains; + memcpy(sg->buffer, from, count); + remains -= count; + } + req->req_done(req->done_arg, RTEMS_SUCCESSFUL, 0); + return 0; +} + +/* ramdisk_write -- + * RAM disk WRITE request handler. This primitive copies data from + * supplied buffer to RAM disk and invoke the callout function to inform + * upper layer that writing is completed. + * + * PARAMETERS: + * req - pointer to the WRITE block device request info + * + * RETURNS: + * ioctl return value + */ +static int +ramdisk_write(struct ramdisk *rd, blkdev_request *req) +{ + char *to; + rtems_unsigned32 i; + blkdev_sg_buffer *sg; + rtems_unsigned32 remains; + + to = (char *)rd->area + (req->start * rd->block_size); + remains = rd->block_size * req->count; + sg = req->bufs; + for (i = 0; (remains > 0) && (i < req->bufnum); i++, sg++) + { + int count = sg->length; + if (count > remains) + count = remains; + memcpy(to, sg->buffer, count); + remains -= count; + } + req->req_done(req->done_arg, RTEMS_SUCCESSFUL, 0); + return 0; +} + +/* ramdisk_ioctl -- + * IOCTL handler for RAM disk device. + * + * PARAMETERS: + * dev - device number (major, minor number) + * req - IOCTL request code + * argp - IOCTL argument + * + * RETURNS: + * IOCTL return value + */ +static int +ramdisk_ioctl(dev_t dev, int req, void *argp) +{ + switch (req) + { + case BLKIO_REQUEST: + { + rtems_device_minor_number minor; + blkdev_request *r = argp; + struct ramdisk *rd; + + minor = rtems_filesystem_dev_minor_t(dev); + if ((minor >= nramdisks) || !ramdisk[minor].initialized) + { + errno = ENODEV; + return -1; + } + + rd = ramdisk + minor; + + switch (r->req) + { + case BLKDEV_REQ_READ: + return ramdisk_read(rd, r); + + case BLKDEV_REQ_WRITE: + return ramdisk_write(rd, r); + + default: + errno = EBADRQC; + return -1; + } + break; + } + + default: + errno = EBADRQC; + return -1; + } +} + +/* ramdisk_initialize -- + * RAM disk device driver initialization. Run through RAM disk + * configuration information and configure appropriate RAM disks. + * + * PARAMETERS: + * major - RAM disk major device number + * minor - minor device number, not applicable + * arg - initialization argument, not applicable + * + * RETURNS: + * none + */ +rtems_device_driver +ramdisk_initialize( + rtems_device_major_number major, + rtems_device_minor_number minor, + void *arg) +{ + rtems_device_minor_number i; + rtems_ramdisk_config *c = rtems_ramdisk_configuration; + struct ramdisk *r; + rtems_status_code rc; + + rc = rtems_disk_io_initialize(); + if (rc != RTEMS_SUCCESSFUL) + return rc; + + r = ramdisk = calloc(rtems_ramdisk_configuration_size, + sizeof(struct ramdisk)); + + for (i = 0; i < rtems_ramdisk_configuration_size; i++, c++, r++) + { + dev_t dev = rtems_filesystem_make_dev_t(major, i); + char name[sizeof(RAMDISK_DEVICE_BASE_NAME "0123456789")]; + snprintf(name, sizeof(name), RAMDISK_DEVICE_BASE_NAME "%d", i); + r->block_size = c->block_size; + r->block_num = c->block_num; + if (c->location == NULL) + { + r->malloced = TRUE; + r->area = malloc(r->block_size * r->block_num); + if (r->area == NULL) /* No enough memory for this disk */ + { + r->initialized = FALSE; + continue; + } + else + { + r->initialized = TRUE; + } + } + else + { + r->malloced = FALSE; + r->initialized = TRUE; + r->area = c->location; + } + rc = rtems_disk_create_phys(dev, c->block_size, c->block_num, + ramdisk_ioctl, name); + if (rc != RTEMS_SUCCESSFUL) + { + if (r->malloced) + { + free(r->area); + } + r->initialized = FALSE; + } + } + nramdisks = rtems_ramdisk_configuration_size; + return RTEMS_SUCCESSFUL; +} Index: src/diskdevs.c =================================================================== --- src/diskdevs.c (nonexistent) +++ src/diskdevs.c (revision 1765) @@ -0,0 +1,631 @@ +/* + * diskdevs.c - Physical and logical block devices (disks) support + * + * Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia + * Author: Victor V. Vengerov + * + * @(#) diskdevs.c,v 1.1 2002/02/28 20:39:54 joel Exp + */ + + +#include +#include +#include +#include + +#include "rtems/diskdevs.h" +#include "rtems/bdbuf.h" + +#define DISKTAB_INITIAL_SIZE 32 + +/* Table of disk devices having the same major number */ +struct disk_device_table { + disk_device **minor; /* minor-indexed disk device table */ + int size; /* Number of entries in the table */ +}; + +/* Pointer to [major].minor[minor] indexed array of disk devices */ +static struct disk_device_table *disktab; + +/* Number of allocated entries in disktab table */ +static int disktab_size; + +/* Mutual exclusion semaphore for disk devices table */ +static rtems_id diskdevs_mutex; + +/* Flag meaning that disk I/O, buffering etc. already has been initialized. */ +static boolean disk_io_initialized = FALSE; + +/* diskdevs data structures protection flag. + * Normally, only table lookup operations performed. It is quite fast, so + * it is possible to done lookups when interrupts are disabled, avoiding + * obtaining the semaphore. This flags sets immediately after entering in + * mutex-protected section and cleared before leaving this section in + * "big" primitives like add/delete new device etc. Lookup function first + * disable interrupts and check this flag. If it is set, lookup function + * will be blocked on semaphore and lookup operation will be performed in + * semaphore-protected code. If it is not set (very-very frequent case), + * we can do lookup safely, enable interrupts and return result. + */ +static volatile rtems_boolean diskdevs_protected; + +/* create_disk_entry -- + * Return pointer to the disk_entry structure for the specified device, or + * create one if it is not exists. + * + * PARAMETERS: + * dev - device id (major, minor) + * + * RETURNS: + * pointer to the disk device descirptor entry, or NULL if no memory + * available for its creation. + */ +static disk_device * +create_disk_entry(dev_t dev) +{ + rtems_device_major_number major; + rtems_device_minor_number minor; + struct disk_device **d; + + rtems_filesystem_split_dev_t (dev, major, minor); + + if (major >= disktab_size) + { + struct disk_device_table *p; + int newsize; + int i; + newsize = disktab_size * 2; + if (major >= newsize) + newsize = major + 1; + p = realloc(disktab, sizeof(struct disk_device_table) * newsize); + if (p == NULL) + return NULL; + p += disktab_size; + for (i = disktab_size; i < newsize; i++, p++) + { + p->minor = NULL; + p->size = 0; + } + disktab_size = newsize; + } + + if ((disktab[major].minor == NULL) || + (minor >= disktab[major].size)) + { + int newsize; + disk_device **p; + int i; + int s = disktab[major].size; + + if (s == 0) + newsize = DISKTAB_INITIAL_SIZE; + else + newsize = s * 2; + if (minor >= newsize) + newsize = minor + 1; + + p = realloc(disktab[major].minor, sizeof(disk_device *) * newsize); + if (p == NULL) + return NULL; + disktab[major].minor = p; + p += s; + for (i = s; i < newsize; i++, p++) + *p = NULL; + disktab[major].size = newsize; + } + + d = disktab[major].minor + minor; + if (*d == NULL) + { + *d = calloc(1, sizeof(disk_device)); + } + return *d; +} + +/* get_disk_entry -- + * Get disk device descriptor by device number. + * + * PARAMETERS: + * dev - block device number + * + * RETURNS: + * Pointer to the disk device descriptor corresponding to the specified + * device number, or NULL if disk device with such number not exists. + */ +static inline disk_device * +get_disk_entry(dev_t dev) +{ + rtems_device_major_number major; + rtems_device_minor_number minor; + struct disk_device_table *dtab; + + rtems_filesystem_split_dev_t (dev, major, minor); + + if ((major >= disktab_size) || (disktab == NULL)) + return NULL; + + dtab = disktab + major; + + if ((minor >= dtab->size) || (dtab->minor == NULL)) + return NULL; + + return dtab->minor[minor]; +} + +/* create_disk -- + * Check that disk entry for specified device number is not defined + * and create it. + * + * PARAMETERS: + * dev - device identifier (major, minor numbers) + * name - character name of device (e.g. /dev/hda) + * disdev - placeholder for pointer to created disk descriptor + * + * RETURNS: + * RTEMS_SUCCESSFUL if disk entry successfully created, or + * error code if error occured (device already registered, + * no memory available). + */ +static rtems_status_code +create_disk(dev_t dev, char *name, disk_device **diskdev) +{ + disk_device *dd; + char *n; + + dd = get_disk_entry(dev); + if (dd != NULL) + { + return RTEMS_RESOURCE_IN_USE; + } + + if (name == NULL) + { + n = NULL; + } + else + { + int nlen = strlen(name) + 1; + n = malloc(nlen); + if (n == NULL) + return RTEMS_NO_MEMORY; + strncpy(n, name, nlen); + } + + dd = create_disk_entry(dev); + if (dd == NULL) + { + free(n); + return RTEMS_NO_MEMORY; + } + + dd->dev = dev; + dd->name = n; + + *diskdev = dd; + + return RTEMS_SUCCESSFUL; +} + +/* rtems_disk_create_phys -- + * Create physical disk entry. This function usually invoked from + * block device driver initialization code when physical device + * detected in the system. Device driver should provide ioctl handler + * to allow block device access operations. This primitive will register + * device in rtems (invoke rtems_io_register_name). + * + * PARAMETERS: + * dev - device identifier (major, minor numbers) + * block_size - size of disk block (minimum data transfer unit); must be + * power of 2 + * disk_size - number of blocks on device + * handler - IOCTL handler (function providing basic block input/output + * request handling BIOREQUEST and other device management + * operations) + * name - character name of device (e.g. /dev/hda) + * + * RETURNS: + * RTEMS_SUCCESSFUL if information about new physical disk added, or + * error code if error occured (device already registered, wrong block + * size value, no memory available). + */ +rtems_status_code +rtems_disk_create_phys(dev_t dev, int block_size, int disk_size, + block_device_ioctl handler, + char *name) +{ + int bs_log2; + int i; + disk_device *dd; + rtems_status_code rc; + rtems_bdpool_id pool; + rtems_device_major_number major; + rtems_device_minor_number minor; + + rtems_filesystem_split_dev_t (dev, major, minor); + + + for (bs_log2 = 0, i = block_size; (i & 1) == 0; i >>= 1, bs_log2++); + if ((bs_log2 < 9) || (i != 1)) /* block size < 512 or not power of 2 */ + return RTEMS_INVALID_NUMBER; + + rc = rtems_semaphore_obtain(diskdevs_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); + if (rc != RTEMS_SUCCESSFUL) + return rc; + diskdevs_protected = TRUE; + + rc = rtems_bdbuf_find_pool(block_size, &pool); + if (rc != RTEMS_SUCCESSFUL) + { + diskdevs_protected = FALSE; + rtems_semaphore_release(diskdevs_mutex); + return rc; + } + + rc = create_disk(dev, name, &dd); + if (rc != RTEMS_SUCCESSFUL) + { + diskdevs_protected = FALSE; + rtems_semaphore_release(diskdevs_mutex); + return rc; + } + + dd->phys_dev = dd; + dd->uses = 0; + dd->start = 0; + dd->size = disk_size; + dd->block_size = block_size; + dd->block_size_log2 = bs_log2; + dd->ioctl = handler; + dd->pool = pool; + + rc = rtems_io_register_name(name, major, minor); + + diskdevs_protected = FALSE; + rtems_semaphore_release(diskdevs_mutex); + + return rc; +} + +/* rtems_disk_create_log -- + * Create logical disk entry. Logical disk is contiguous area on physical + * disk. Disk may be splitted to several logical disks in several ways: + * manually or using information stored in blocks on physical disk + * (DOS-like partition table, BSD disk label, etc). This function usually + * invoked from application when application-specific splitting are in use, + * or from generic code which handle different logical disk organizations. + * This primitive will register device in rtems (invoke + * rtems_io_register_name). + * + * PARAMETERS: + * dev - logical device identifier (major, minor numbers) + * phys - physical device (block device which holds this logical disk) + * identifier + * start - starting block number on the physical device + * size - logical disk size in blocks + * name - logical disk name + * + * RETURNS: + * RTEMS_SUCCESSFUL if logical device successfully added, or error code + * if error occured (device already registered, no physical device + * exists, logical disk is out of physical disk boundaries, no memory + * available). + */ +rtems_status_code +rtems_disk_create_log(dev_t dev, dev_t phys, int start, int size, char *name) +{ + disk_device *dd; + disk_device *pdd; + rtems_status_code rc; + rtems_device_major_number major; + rtems_device_minor_number minor; + + rtems_filesystem_split_dev_t (dev, major, minor); + + rc = rtems_semaphore_obtain(diskdevs_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); + if (rc != RTEMS_SUCCESSFUL) + return rc; + diskdevs_protected = TRUE; + + pdd = get_disk_entry(phys); + if (pdd == NULL) + { + diskdevs_protected = FALSE; + rtems_semaphore_release(diskdevs_mutex); + return RTEMS_INVALID_NUMBER; + } + + rc = create_disk(dev, name, &dd); + if (rc != RTEMS_SUCCESSFUL) + { + diskdevs_protected = FALSE; + rtems_semaphore_release(diskdevs_mutex); + return rc; + } + + dd->phys_dev = pdd; + dd->uses = 0; + dd->start = start; + dd->size = size; + dd->block_size = pdd->block_size; + dd->block_size_log2 = pdd->block_size_log2; + dd->ioctl = pdd->ioctl; + + rc = rtems_io_register_name(name, major, minor); + + diskdevs_protected = FALSE; + rc = rtems_semaphore_release(diskdevs_mutex); + + return rc; +} + +/* rtems_disk_delete -- + * Delete physical or logical disk device. Device may be deleted if its + * use counter (and use counters of all logical devices - if it is + * physical device) equal to 0. When physical device deleted, + * all logical devices deleted inherently. Appropriate devices removed + * from "/dev" filesystem. + * + * PARAMETERS: + * dev - device identifier (major, minor numbers) + * + * RETURNS: + * RTEMS_SUCCESSFUL if block device successfully deleted, or error code + * if error occured (device is not defined, device is in use). + */ +rtems_status_code +rtems_disk_delete(dev_t dev) +{ + rtems_status_code rc; + int used; + rtems_device_major_number maj; + rtems_device_minor_number min; + + rc = rtems_semaphore_obtain(diskdevs_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); + if (rc != RTEMS_SUCCESSFUL) + return rc; + diskdevs_protected = TRUE; + + /* Check if this device is in use -- calculate usage counter */ + used = 0; + for (maj = 0; maj < disktab_size; maj++) + { + struct disk_device_table *dtab = disktab + maj; + if (dtab != NULL) + { + for (min = 0; min < dtab->size; min++) + { + disk_device *dd = dtab->minor[min]; + if ((dd != NULL) && (dd->phys_dev->dev == dev)) + used += dd->uses; + } + } + } + + if (used != 0) + { + diskdevs_protected = FALSE; + rtems_semaphore_release(diskdevs_mutex); + return RTEMS_RESOURCE_IN_USE; + } + + /* Delete this device and all of its logical devices */ + for (maj = 0; maj < disktab_size; maj++) + { + struct disk_device_table *dtab = disktab +maj; + if (dtab != NULL) + { + for (min = 0; min < dtab->size; min++) + { + disk_device *dd = dtab->minor[min]; + if ((dd != NULL) && (dd->phys_dev->dev == dev)) + { + unlink(dd->name); + free(dd->name); + free(dd); + dtab->minor[min] = NULL; + } + } + } + } + + diskdevs_protected = FALSE; + rc = rtems_semaphore_release(diskdevs_mutex); + return rc; +} + +/* rtems_disk_lookup -- + * Find block device descriptor by its device identifier. + * + * PARAMETERS: + * dev - device identifier (major, minor numbers) + * + * RETURNS: + * pointer to the block device descriptor, or NULL if no such device + * exists. + */ +disk_device * +rtems_disk_lookup(dev_t dev) +{ + rtems_interrupt_level level; + disk_device *dd; + rtems_status_code rc; + + rtems_interrupt_disable(level); + if (diskdevs_protected) + { + rtems_interrupt_enable(level); + rc = rtems_semaphore_obtain(diskdevs_mutex, RTEMS_WAIT, + RTEMS_NO_TIMEOUT); + if (rc != RTEMS_SUCCESSFUL) + return NULL; + diskdevs_protected = TRUE; + dd = get_disk_entry(dev); + dd->uses++; + diskdevs_protected = FALSE; + rtems_semaphore_release(diskdevs_mutex); + return dd; + } + else + { + /* Frequent and quickest case */ + dd = get_disk_entry(dev); + dd->uses++; + rtems_interrupt_enable(level); + return dd; + } +} + +/* rtems_disk_release -- + * Release disk_device structure (decrement usage counter to 1). + * + * PARAMETERS: + * dd - pointer to disk device structure + * + * RETURNS: + * RTEMS_SUCCESSFUL + */ +rtems_status_code +rtems_disk_release(disk_device *dd) +{ + rtems_interrupt_level level; + rtems_interrupt_disable(level); + dd->uses--; + rtems_interrupt_enable(level); + return RTEMS_SUCCESSFUL; +} + +/* rtems_disk_next -- + * Disk device enumerator. Looking for device having device number larger + * than dev and return disk device descriptor for it. If there are no + * such device, NULL value returned. + * + * PARAMETERS: + * dev - device number (use -1 to start search) + * + * RETURNS: + * Pointer to the disk descriptor for next disk device, or NULL if all + * devices enumerated. + */ +disk_device * +rtems_disk_next(dev_t dev) +{ + rtems_device_major_number major; + rtems_device_minor_number minor; + struct disk_device_table *dtab; + + dev++; + rtems_filesystem_split_dev_t (dev, major, minor); + + if (major >= disktab_size) + return NULL; + + dtab = disktab + major; + while (TRUE) + { + if ((dtab == NULL) || (minor > dtab->size)) + { + major++; minor = 0; + if (major >= disktab_size) + return NULL; + dtab = disktab + major; + } + else if (dtab->minor[minor] == NULL) + { + minor++; + } + else + return dtab->minor[minor]; + } +} + +/* rtems_disk_initialize -- + * Initialization of disk device library (initialize all data structures, + * etc.) + * + * PARAMETERS: + * none + * + * RETURNS: + * RTEMS_SUCCESSFUL if library initialized, or error code if error + * occured. + */ +rtems_status_code +rtems_disk_io_initialize(void) +{ + rtems_status_code rc; + + if (disk_io_initialized) + return RTEMS_SUCCESSFUL; + + disktab_size = DISKTAB_INITIAL_SIZE; + disktab = calloc(disktab_size, sizeof(struct disk_device_table)); + if (disktab == NULL) + return RTEMS_NO_MEMORY; + + diskdevs_protected = FALSE; + rc = rtems_semaphore_create( + rtems_build_name('D', 'D', 'E', 'V'), 1, + RTEMS_FIFO | RTEMS_BINARY_SEMAPHORE | RTEMS_NO_INHERIT_PRIORITY | + RTEMS_NO_PRIORITY_CEILING | RTEMS_LOCAL, 0, &diskdevs_mutex); + + if (rc != RTEMS_SUCCESSFUL) + { + free(disktab); + return rc; + } + + rc = rtems_bdbuf_init(rtems_bdbuf_configuration, + rtems_bdbuf_configuration_size); + + if (rc != RTEMS_SUCCESSFUL) + { + rtems_semaphore_delete(diskdevs_mutex); + free(disktab); + return rc; + } + + disk_io_initialized = 1; + return RTEMS_SUCCESSFUL; +} + +/* rtems_disk_io_done -- + * Release all resources allocated for disk device interface. + * + * PARAMETERS: + * none + * + * RETURNS: + * RTEMS_SUCCESSFUL if all resources released, or error code if error + * occured. + */ +rtems_status_code +rtems_disk_io_done(void) +{ + rtems_device_major_number maj; + rtems_device_minor_number min; + rtems_status_code rc; + + /* Free data structures */ + for (maj = 0; maj < disktab_size; maj++) + { + struct disk_device_table *dtab = disktab + maj; + if (dtab != NULL) + { + for (min = 0; min < dtab->size; min++) + { + disk_device *dd = dtab->minor[min]; + unlink(dd->name); + free(dd->name); + free(dd); + } + free(dtab); + } + } + free(disktab); + + rc = rtems_semaphore_release(diskdevs_mutex); + + /* XXX bdbuf should be released too! */ + disk_io_initialized = 0; + return rc; +} Index: src =================================================================== --- src (nonexistent) +++ src (revision 1765)
src Property changes : Added: svn:ignore ## -0,0 +1,2 ## +Makefile +Makefile.in Index: configure =================================================================== --- configure (nonexistent) +++ configure (revision 1765) @@ -0,0 +1,3753 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by Autoconf 2.52 for rtems-c-src-libblock ss-20020528. +# +# Report bugs to . +# +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Name of the executable. +as_me=`echo "$0" |sed 's,.*[\\/],,'` + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +# NLS nuisances. +$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } +$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } +$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } +$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } +$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } +$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } +$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } +$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +cross_compiling=no +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +ac_unique_file="src/bdbuf.c" +ac_default_prefix=/opt/rtems + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Identity of this package. +PACKAGE_NAME='rtems-c-src-libblock' +PACKAGE_TARNAME='rtems-c-src-libblock' +PACKAGE_VERSION='ss-20020528' +PACKAGE_STRING='rtems-c-src-libblock ss-20020528' +PACKAGE_BUGREPORT='rtems-bugs@OARcorp.com' + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: should be removed in autoconf 3.0. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_RTEMS_BSP_set=${RTEMS_BSP+set} +ac_env_RTEMS_BSP_value=$RTEMS_BSP +ac_cv_env_RTEMS_BSP_set=${RTEMS_BSP+set} +ac_cv_env_RTEMS_BSP_value=$RTEMS_BSP +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat < if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +EOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue + cd $ac_subdir + # A "../" for each directory in /$ac_subdir. + ac_dots=`echo $ac_subdir | + sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'` + + case $srcdir in + .) # No --srcdir option. We are building in place. + ac_sub_srcdir=$srcdir ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_sub_srcdir=$srcdir/$ac_subdir ;; + *) # Relative path. + ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;; + esac + + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_sub_srcdir/configure.gnu; then + echo + $SHELL $ac_sub_srcdir/configure.gnu --help=recursive + elif test -f $ac_sub_srcdir/configure; then + echo + $SHELL $ac_sub_srcdir/configure --help=recursive + elif test -f $ac_sub_srcdir/configure.ac || + test -f $ac_sub_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\EOF +rtems-c-src-libblock configure ss-20020528 +generated by GNU Autoconf 2.52 + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +EOF + exit 0 +fi +exec 5>config.log +cat >&5 </dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +PATH = $PATH + +_ASUNAME +} >&5 + +cat >&5 <\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + ac_sep=" " ;; + *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg" + ac_sep=" " ;; + esac + # Get rid of the leading space. +done + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + echo >&5 + echo "## ----------------- ##" >&5 + echo "## Cache variables. ##" >&5 + echo "## ----------------- ##" >&5 + echo >&5 + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} >&5 + sed "/^$/d" confdefs.h >conftest.log + if test -s conftest.log; then + echo >&5 + echo "## ------------ ##" >&5 + echo "## confdefs.h. ##" >&5 + echo "## ------------ ##" >&5 + echo >&5 + cat conftest.log >&5 + fi + (echo; echo) >&5 + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" >&5 + echo "$as_me: exit $exit_status" >&5 + rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:854: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + cat "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:865: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:873: creating cache $cache_file" >&5 +echo "$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 `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:889: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:893: error: \`$ac_var' was not set in the previous run" >&5 +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 + { echo "$as_me:899: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:901: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:903: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. It doesn't matter if + # we pass some twice (in addition to the command line arguments). + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` + ac_configure_args="$ac_configure_args '$ac_arg'" + ;; + *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val" + ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:922: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:924: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +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 + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac +echo "#! $SHELL" >conftest.sh +echo "exit 0" >>conftest.sh +chmod +x conftest.sh +if { (echo "$as_me:944: PATH=\".;.\"; conftest.sh") >&5 + (PATH=".;."; conftest.sh) 2>&5 + ac_status=$? + echo "$as_me:947: \$? = $ac_status" >&5 + (exit $ac_status); }; then + ac_path_separator=';' +else + ac_path_separator=: +fi +PATH_SEPARATOR="$ac_path_separator" +rm -f conftest.sh + +for ac_prog in gmake make +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:960: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_MAKE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$MAKE"; then + ac_cv_prog_MAKE="$MAKE" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_MAKE="$ac_prog" +echo "$as_me:975: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +MAKE=$ac_cv_prog_MAKE +if test -n "$MAKE"; then + echo "$as_me:983: result: $MAKE" >&5 +echo "${ECHO_T}$MAKE" >&6 +else + echo "$as_me:986: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$MAKE" && break +done + +ENDIF=endif + +RTEMS_TOPdir="../.."; + +test -n "$with_target_subdir" || with_target_subdir="." + +if test "$with_target_subdir" = "." ; then +# Native +PROJECT_TOPdir="${with_project_root}${RTEMS_TOPdir}/\$(MULTIBUILDTOP)\$(top_builddir)" +else +# Cross +dots=`echo $with_target_subdir|\ +sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` +PROJECT_TOPdir="${dots}${with_project_root}${RTEMS_TOPdir}/\$(MULTIBUILDTOP)\$(top_builddir)" +fi + +PROJECT_ROOT="${with_project_root}${RTEMS_TOPdir}/\$(MULTIBUILDTOP)\$(top_builddir)" + +echo "$as_me:1011: checking for RTEMS Version" >&5 +echo $ECHO_N "checking for RTEMS Version... $ECHO_C" >&6 +if test -r "${srcdir}/${RTEMS_TOPdir}/cpukit/aclocal/version.m4"; then + : +else + { { echo "$as_me:1016: error: Unable to find ${RTEMS_TOPdir}/cpukit/aclocal/version.m4" >&5 +echo "$as_me: error: Unable to find ${RTEMS_TOPdir}/cpukit/aclocal/version.m4" >&2;} + { (exit 1); exit 1; }; } +fi + +echo "$as_me:1021: result: ss-20020528" >&5 +echo "${ECHO_T}ss-20020528" >&6 + +ac_aux_dir= +for ac_dir in ../.. $srcdir/../..; 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 +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:1041: error: cannot find install-sh or install.sh in ../.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in ../.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:1051: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:1055: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:1064: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:1068: error: $ac_config_sub $ac_cv_build_alias failed." >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:1073: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 +build=$ac_cv_build +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +echo "$as_me:1080: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:1089: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:1094: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +echo "$as_me:1101: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6 +if test "${ac_cv_target+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_target_alias=$target_alias +test "x$ac_cv_target_alias" = "x" && + ac_cv_target_alias=$ac_cv_host_alias +ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || + { { echo "$as_me:1110: error: $ac_config_sub $ac_cv_target_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:1115: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6 +target=$ac_cv_target +target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- +echo "$as_me:1128: checking rtems target cpu" >&5 +echo $ECHO_N "checking rtems target cpu... $ECHO_C" >&6 +case "${target}" in + # hpux unix port should go here + i[34567]86-*linux*) # unix "simulator" port + RTEMS_CPU=unix + ;; + i[34567]86-*freebsd*) # unix "simulator" port + RTEMS_CPU=unix + ;; + i[34567]86-pc-cygwin*) # Cygwin is just enough unix like :) + RTEMS_CPU=unix + ;; + no_cpu-*rtems*) + RTEMS_CPU=no_cpu + ;; + sparc-sun-solaris*) # unix "simulator" port + RTEMS_CPU=unix + ;; + *) + RTEMS_CPU=`echo $target | sed 's%^\([^-]*\)-\(.*\)$%\1%'` + ;; +esac + +echo "$as_me:1152: result: $RTEMS_CPU" >&5 +echo "${ECHO_T}$RTEMS_CPU" >&6 + +RTEMS_HOST=$host_os +case "${target}" in + # hpux unix port should go here + i[34567]86-*linux*) # unix "simulator" port + RTEMS_HOST=Linux + ;; + i[34567]86-*freebsd*) # unix "simulator" port + RTEMS_HOST=FreeBSD + ;; + i[34567]86-pc-cygwin*) # Cygwin is just enough unix like :) + RTEMS_HOST=Cygwin + ;; + sparc-sun-solaris*) # unix "simulator" port + RTEMS_HOST=Solaris + ;; + *) + ;; +esac + +am__api_version="1.6" +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:1187: checking for a BSD compatible install" >&5 +echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_save_IFS=$IFS; IFS=$ac_path_separator + for ac_dir in $PATH; do + IFS=$ac_save_IFS + # Account for people who put trailing slashes in PATH elements. + case $ac_dir/ in + / | ./ | .// | /cC/* \ + | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \ + | /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if $as_executable_p "$ac_dir/$ac_prog"; then + if test $ac_prog = install && + grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:1236: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo "$as_me:1247: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { { echo "$as_me:1271: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:1284: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +echo "$as_me:1290: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +test "$program_prefix" != NONE && + program_transform_name="s,^,$program_prefix,;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$,$program_suffix,;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:1314: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +for ac_prog in mawk gawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:1322: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_AWK="$ac_prog" +echo "$as_me:1337: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:1345: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:1348: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$AWK" && break +done + +echo "$as_me:1355: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:1375: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:1379: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + # test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + { { echo "$as_me:1387: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } +fi + +# Define the identity of the package. + PACKAGE=rtems-c-src-libblock + VERSION=ss-20020528 + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +install_sh=${install_sh-"$am_aux_dir/install-sh"} + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo "$as_me:1420: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_STRIP="${ac_tool_prefix}strip" +echo "$as_me:1435: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:1443: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:1446: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo "$as_me:1455: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_STRIP="strip" +echo "$as_me:1470: found $ac_dir/$ac_word" >&5 +break +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:1479: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:1482: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. + +echo "$as_me:1497: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi; + echo "$as_me:1506: result: $USE_MAINTAINER_MODE" >&5 +echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { { echo "$as_me:1525: error: bad value ${enableval} for multilib option" >&5 +echo "$as_me: error: bad value ${enableval} for multilib option" >&2;} + { (exit 1); exit 1; }; } ;; + esac +else + multilib=no +fi; + +if test x"${multilib}" = x"yes"; then + MULTILIB_TRUE= + MULTILIB_FALSE='#' +else + MULTILIB_TRUE='#' + MULTILIB_FALSE= +fi + +if test x"$multilib" = x"yes"; then + if test -n "$with_multisubdir"; then + MULTIBUILDTOP=`echo "/$with_multisubdir" | sed 's,/[^\\/]*,../,g'` +fi + + if test -n "$with_multisubdir"; then + MULTISUBDIR="/$with_multisubdir" +fi + + GCC_SPECS="-isystem \$(PROJECT_INCLUDE)" + + PROJECT_INCLUDE="\$(PROJECT_ROOT)/lib/include" + + project_libdir="\$(PROJECT_ROOT)/lib" + + RTEMS_ROOT="${PROJECT_ROOT}" + + includedir="\${exec_prefix}/lib/include" + libdir="${libdir}\$(MULTISUBDIR)" +else + +echo "$as_me:1562: checking for RTEMS_BSP" >&5 +echo $ECHO_N "checking for RTEMS_BSP... $ECHO_C" >&6 +if test "${rtems_cv_RTEMS_BSP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + test -n "${RTEMS_BSP}" && rtems_cv_RTEMS_BSP="$RTEMS_BSP"; + +fi +if test -z "$rtems_cv_RTEMS_BSP"; then + { { echo "$as_me:1571: error: Missing RTEMS_BSP" >&5 +echo "$as_me: error: Missing RTEMS_BSP" >&2;} + { (exit 1); exit 1; }; } +fi +RTEMS_BSP="$rtems_cv_RTEMS_BSP" +echo "$as_me:1576: result: ${RTEMS_BSP}" >&5 +echo "${ECHO_T}${RTEMS_BSP}" >&6 + +PROJECT_INCLUDE="\$(PROJECT_ROOT)/$RTEMS_BSP/lib/include" + +project_libdir="${PROJECT_ROOT}/$RTEMS_BSP/lib" + +RTEMS_ROOT="$PROJECT_ROOT/c/$RTEMS_BSP" + +GCC_SPECS="-isystem \$(PROJECT_INCLUDE)" + +# Check whether --enable-bare-cpu-cflags or --disable-bare-cpu-cflags was given. +if test "${enable_bare_cpu_cflags+set}" = set; then + enableval="$enable_bare_cpu_cflags" + case "${enableval}" in + no) BARE_CPU_CFLAGS="" ;; + *) BARE_CPU_CFLAGS="${enableval}" ;; +esac +else + BARE_CPU_CFLAGS="" +fi; + +# Check whether --enable-bare-cpu-model or --disable-bare-cpu-model was given. +if test "${enable_bare_cpu_model+set}" = set; then + enableval="$enable_bare_cpu_model" + case "${enableval}" in + no) BARE_CPU_MODEL="" ;; + *) BARE_CPU_MODEL="${enableval}" ;; +esac +else + BARE_CPU_MODEL="" +fi; + +if false; then + MULTILIB_TRUE= + MULTILIB_FALSE='#' +else + MULTILIB_TRUE='#' + MULTILIB_FALSE= +fi + +includedir="\${exec_prefix}/${RTEMS_BSP}/lib/include" +libdir="\${exec_prefix}/${RTEMS_BSP}/lib" + +echo "$as_me:1620: checking for make/custom/$RTEMS_BSP.cfg" >&5 +echo $ECHO_N "checking for make/custom/$RTEMS_BSP.cfg... $ECHO_C" >&6 +if test -r "$srcdir/$RTEMS_TOPdir/make/custom/$RTEMS_BSP.cfg"; then + echo "$as_me:1623: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + { { echo "$as_me:1626: error: no" >&5 +echo "$as_me: error: no" >&2;} + { (exit 1); exit 1; }; } +fi + +fi + +# Is this a supported CPU? +echo "$as_me:1634: checking if cpu $RTEMS_CPU is supported" >&5 +echo $ECHO_N "checking if cpu $RTEMS_CPU is supported... $ECHO_C" >&6 +if test -d "$srcdir/$RTEMS_TOPdir/cpukit/score/cpu/$RTEMS_CPU"; then + echo "$as_me:1637: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + { { echo "$as_me:1640: error: no" >&5 +echo "$as_me: error: no" >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f .deps 2>/dev/null +mkdir .deps 2>/dev/null +if test -d .deps; then + DEPDIR=.deps +else + # MS-DOS does not allow filenames that begin with a dot. + DEPDIR=_deps +fi +rmdir .deps 2>/dev/null + +ac_config_commands="$ac_config_commands depfiles" + +am_make=${MAKE-make} +cat > confinc << 'END' +doit: + @echo done +END +# If we don't find an include directive, just comment out the code. +echo "$as_me:1663: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + +echo "$as_me:1690: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6 +rm -f confinc confmf + +# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval="$enable_dependency_tracking" + +fi; +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + +if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + if test "x$build_alias" != "x$host_alias"; then + rtems_tool_prefix=${ac_tool_prefix} +fi + + # Extract the first word of "${rtems_tool_prefix}gcc", so it can be a program name with args. +set dummy ${rtems_tool_prefix}gcc; ac_word=$2 +echo "$as_me:1718: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CC="${rtems_tool_prefix}gcc" +echo "$as_me:1733: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1741: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1744: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +test -z "$CC" && \ + { { echo "$as_me:1749: error: no acceptable cc found in \$PATH" >&5 +echo "$as_me: error: no acceptable cc found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +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 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 +echo "$as_me:1760: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CC="${ac_tool_prefix}gcc" +echo "$as_me:1775: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1783: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1786: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +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 +echo "$as_me:1795: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="gcc" +echo "$as_me:1810: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:1818: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1821: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +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 +echo "$as_me:1834: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CC="${ac_tool_prefix}cc" +echo "$as_me:1849: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1857: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1860: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:1869: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="cc" +echo "$as_me:1884: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:1892: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1895: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +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 +echo "$as_me:1908: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue +fi +ac_cv_prog_CC="cc" +echo "$as_me:1928: found $ac_dir/$ac_word" >&5 +break +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # 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 + set dummy "$ac_dir/$ac_word" ${1+"$@"} + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1950: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1953: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + 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 +echo "$as_me:1964: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CC="$ac_tool_prefix$ac_prog" +echo "$as_me:1979: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1987: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1990: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:2003: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="$ac_prog" +echo "$as_me:2018: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:2026: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:2029: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + +test -z "$CC" && { { echo "$as_me:2041: error: no acceptable cc found in \$PATH" >&5 +echo "$as_me: error: no acceptable cc found in \$PATH" >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:2046:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:2049: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:2052: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:2054: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:2057: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:2059: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:2062: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +#line 2066 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:2082: checking for C compiler default output" >&5 +echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:2085: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:2088: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. +for ac_file in `ls a.exe conftest.exe 2>/dev/null; + ls a.out conftest 2>/dev/null; + ls a.* conftest.* 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + a.out ) # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool --akim. + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:2111: error: C compiler cannot create executables" >&5 +echo "$as_me: error: C compiler cannot create executables" >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:2117: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:2122: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:2128: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2131: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:2138: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:2146: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:2153: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:2155: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:2158: checking for executable suffix" >&5 +echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 +if { (eval echo "$as_me:2160: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:2163: \$? = $ac_status" >&5 + (exit $ac_status); }; 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 +# `rm'. +for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:2179: error: cannot compute EXEEXT: cannot compile and link" >&5 +echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:2185: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:2191: checking for object suffix" >&5 +echo $ECHO_N "checking for object suffix... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2197 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:2209: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2212: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:2224: error: cannot compute OBJEXT: cannot compile" >&5 +echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:2231: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:2235: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2241 "configure" +#include "confdefs.h" + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2256: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2259: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2262: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2265: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:2277: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:2283: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2289 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2301: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2304: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2307: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2310: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_prog_cc_g=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:2320: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2347: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2350: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2353: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2356: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + ''\ + '#include ' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +#line 2368 "configure" +#include "confdefs.h" +#include +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2381: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2384: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2387: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2390: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +continue +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line 2400 "configure" +#include "confdefs.h" +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2412: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2415: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2418: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2421: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +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 + +depcc="$CC" am_compiler_list= + +echo "$as_me:2450: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + echo '#include "conftest.h"' > conftest.c + echo 'int i;' > conftest.h + echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=conftest.c object=conftest.o \ + depfile=conftest.Po tmpdepfile=conftest.TPo \ + $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && + grep conftest.h conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +echo "$as_me:2512: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + +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 +echo "$as_me:2521: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-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. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line 2542 "configure" +#include "confdefs.h" +#include + Syntax error +_ACEOF +if { (eval echo "$as_me:2547: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:2553: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line 2576 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:2580: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:2586: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:2623: result: $CPP" >&5 +echo "${ECHO_T}$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. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line 2633 "configure" +#include "confdefs.h" +#include + Syntax error +_ACEOF +if { (eval echo "$as_me:2638: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:2644: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line 2667 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:2671: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:2677: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:2705: error: C preprocessor \"$CPP\" fails sanity check" >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} + { (exit 1); exit 1; }; } +fi + +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 test x"$GCC" = x"yes"; then + RTEMS_USE_GCC_TRUE= + RTEMS_USE_GCC_FALSE='#' +else + RTEMS_USE_GCC_TRUE='#' + RTEMS_USE_GCC_FALSE= +fi + +echo "$as_me:2724: checking whether $CC accepts -specs" >&5 +echo $ECHO_N "checking whether $CC accepts -specs... $ECHO_C" >&6 +if test "${rtems_cv_gcc_specs+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +rtems_cv_gcc_specs=no +if test x"$GCC" = x"yes"; then + touch confspec + echo 'void f(){}' >conftest.c + if test -z "`${CC} -specs confspec -c conftest.c 2>&1`";then + rtems_cv_gcc_specs=yes + fi +fi +rm -f confspec conftest* + +fi +echo "$as_me:2741: result: $rtems_cv_gcc_specs" >&5 +echo "${ECHO_T}$rtems_cv_gcc_specs" >&6 + +echo "$as_me:2744: checking whether $CC accepts --pipe" >&5 +echo $ECHO_N "checking whether $CC accepts --pipe... $ECHO_C" >&6 +if test "${rtems_cv_gcc_pipe+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +rtems_cv_gcc_pipe=no +if test x"$GCC" = x"yes"; then + echo 'void f(){}' >conftest.c + if test -z "`${CC} --pipe -c conftest.c 2>&1`";then + rtems_cv_gcc_pipe=yes + fi + rm -f conftest* +fi + +fi +echo "$as_me:2760: result: $rtems_cv_gcc_pipe" >&5 +echo "${ECHO_T}$rtems_cv_gcc_pipe" >&6 + +test "$rtems_cv_gcc_pipe" = "yes" && CC="$CC --pipe" + +if test "$GCC" = yes; then + +CPPFLAGS="$CPPFLAGS " + +CFLAGS="-g -Wall" +fi + +#case $build_os in +#*cygwin*) GCCSED="| sed 's%\\\\%/%g'" ;; +#*) ;; +#esac + + if test "x$build_alias" != "x$host_alias"; then + rtems_tool_prefix=${ac_tool_prefix} +fi + + # Extract the first word of "${rtems_tool_prefix}ar", so it can be a program name with args. +set dummy ${rtems_tool_prefix}ar; ac_word=$2 +echo "$as_me:2783: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_AR="${rtems_tool_prefix}ar" +echo "$as_me:2798: found $ac_dir/$ac_word" >&5 +break +done + + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="no" +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + echo "$as_me:2807: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 +else + echo "$as_me:2810: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + if test "x$build_alias" != "x$host_alias"; then + rtems_tool_prefix=${ac_tool_prefix} +fi + + # Extract the first word of "${rtems_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${rtems_tool_prefix}ranlib; ac_word=$2 +echo "$as_me:2820: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_RANLIB="${rtems_tool_prefix}ranlib" +echo "$as_me:2835: found $ac_dir/$ac_word" >&5 +break +done + + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:2844: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:2847: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo "$as_me:2854: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" +echo "$as_me:2869: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:2877: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:2880: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo "$as_me:2889: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_RANLIB="ranlib" +echo "$as_me:2904: found $ac_dir/$ac_word" >&5 +break +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:2913: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:2916: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +# Explicitly list all Makefiles here +ac_config_files="$ac_config_files Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overriden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if cmp -s $cache_file confcache; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then we branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +cat >confdef2opt.sed <<\EOF +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +t quote +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +t quote +d +: quote +s,[ `~#$^&*(){}\\|;'"<>?],\\&,g +s,\[,\\&,g +s,\],\\&,g +s,\$,$$,g +p +EOF +# We use echo to avoid assuming a particular line-breaking character. +# The extra dot is to prevent the shell from consuming trailing +# line-breaks from the sub-command output. A line-break within +# single-quotes doesn't work because, if this script is created in a +# platform that uses two characters for line-breaks (e.g., DOS), tr +# would break. +ac_LF_and_DOT=`echo; echo .` +DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` +rm -f confdef2opt.sed + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + { { echo "$as_me:3035: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${MULTILIB_TRUE}" && test -z "${MULTILIB_FALSE}"; then + { { echo "$as_me:3042: error: conditional \"MULTILIB\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"MULTILIB\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${MULTILIB_TRUE}" && test -z "${MULTILIB_FALSE}"; then + { { echo "$as_me:3049: error: conditional \"MULTILIB\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"MULTILIB\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { echo "$as_me:3056: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${RTEMS_USE_GCC_TRUE}" && test -z "${RTEMS_USE_GCC_FALSE}"; then + { { echo "$as_me:3063: error: conditional \"RTEMS_USE_GCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"RTEMS_USE_GCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:3073: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated automatically by configure. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +SHELL=\${CONFIG_SHELL-$SHELL} +ac_cs_invocation="\$0 \$@" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Name of the executable. +as_me=`echo "$0" |sed 's,.*[\\/],,'` + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +# NLS nuisances. +$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } +$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } +$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } +$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } +$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } +$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } +$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } +$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } + +exec 6>&1 + +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\EOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Configuration commands: +$config_commands + +Report bugs to ." +EOF + +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + shift + set dummy "$ac_option" "$ac_optarg" ${1+"$@"} + shift + ;; + -*);; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_need_defaults=false;; + esac + + case $1 in + # Handling of the options. +EOF +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:3244: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + shift + CONFIG_FILES="$CONFIG_FILES $1" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + shift + CONFIG_HEADERS="$CONFIG_HEADERS $1" + ac_need_defaults=false;; + + # This is an error. + -*) { { echo "$as_me:3263: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +exec 5>>config.log +cat >&5 << _ACEOF + +## ----------------------- ## +## Running config.status. ## +## ----------------------- ## + +This file was extended by $as_me (rtems-c-src-libblock ss-20020528) 2.52, executed with + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + > $ac_cs_invocation +on `(hostname || uname -n) 2>/dev/null | sed 1q` + +_ACEOF +EOF + +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + *) { { echo "$as_me:3309: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# 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_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. +: ${TMPDIR=/tmp} +{ + tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=$TMPDIR/cs$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in $TMPDIR" >&2 + { (exit 1); exit 1; } +} + +EOF + +cat >>$CONFIG_STATUS <\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@DEFS@,$DEFS,;t t +s,@LIBS@,$LIBS,;t t +s,@MAKE@,$MAKE,;t t +s,@ENDIF@,$ENDIF,;t t +s,@RTEMS_TOPdir@,$RTEMS_TOPdir,;t t +s,@PROJECT_TOPdir@,$PROJECT_TOPdir,;t t +s,@PROJECT_ROOT@,$PROJECT_ROOT,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@target@,$target,;t t +s,@target_cpu@,$target_cpu,;t t +s,@target_vendor@,$target_vendor,;t t +s,@target_os@,$target_os,;t t +s,@RTEMS_CPU@,$RTEMS_CPU,;t t +s,@RTEMS_HOST@,$RTEMS_HOST,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@PACKAGE@,$PACKAGE,;t t +s,@VERSION@,$VERSION,;t t +s,@ACLOCAL@,$ACLOCAL,;t t +s,@AUTOCONF@,$AUTOCONF,;t t +s,@AUTOMAKE@,$AUTOMAKE,;t t +s,@AUTOHEADER@,$AUTOHEADER,;t t +s,@MAKEINFO@,$MAKEINFO,;t t +s,@AMTAR@,$AMTAR,;t t +s,@install_sh@,$install_sh,;t t +s,@STRIP@,$STRIP,;t t +s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t +s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t +s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t +s,@MAINT@,$MAINT,;t t +s,@MULTILIB_TRUE@,$MULTILIB_TRUE,;t t +s,@MULTILIB_FALSE@,$MULTILIB_FALSE,;t t +s,@MULTIBUILDTOP@,$MULTIBUILDTOP,;t t +s,@MULTISUBDIR@,$MULTISUBDIR,;t t +s,@GCC_SPECS@,$GCC_SPECS,;t t +s,@PROJECT_INCLUDE@,$PROJECT_INCLUDE,;t t +s,@project_libdir@,$project_libdir,;t t +s,@RTEMS_ROOT@,$RTEMS_ROOT,;t t +s,@RTEMS_BSP@,$RTEMS_BSP,;t t +s,@BARE_CPU_MODEL@,$BARE_CPU_MODEL,;t t +s,@BARE_CPU_CFLAGS@,$BARE_CPU_CFLAGS,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@DEPDIR@,$DEPDIR,;t t +s,@am__include@,$am__include,;t t +s,@am__quote@,$am__quote,;t t +s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t +s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t +s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t +s,@CCDEPMODE@,$CCDEPMODE,;t t +s,@CPP@,$CPP,;t t +s,@RTEMS_USE_GCC_TRUE@,$RTEMS_USE_GCC_TRUE,;t t +s,@RTEMS_USE_GCC_FALSE@,$RTEMS_USE_GCC_FALSE,;t t +s,@GCCSED@,$GCCSED,;t t +s,@AR@,$AR,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +CEOF + +EOF + + cat >>$CONFIG_STATUS <<\EOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +EOF +cat >>$CONFIG_STATUS <<\EOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + { case "$ac_dir" in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; +esac +as_dummy="$ac_dir" +for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || mkdir "$as_incr_dir" + ;; + esac +done; } + + ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'` + else + ac_dir_suffix= ac_dots= + fi + + case $srcdir in + .) ac_srcdir=. + if test -z "$ac_dots"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_dots$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_dots$srcdir ;; + esac + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_dots$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:3575: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated automatically by config.status. */ + configure_input="Generated automatically from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:3593: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:3606: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +EOF +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +EOF +cat >>$CONFIG_STATUS <<\EOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + + case $ac_dest in + depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + else + continue + fi + grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n -e '/^U = / s///p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # We invoke sed twice because it is the simplest approach to + # changing $(DEPDIR) to its actual value in the expansion. + for file in `sed -n -e ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { case $dirpart/$fdir in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; +esac +as_dummy=$dirpart/$fdir +for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || mkdir "$as_incr_dir" + ;; + esac +done; } + + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + esac +done +EOF + +cat >>$CONFIG_STATUS <<\EOF + +{ (exit 0); exit 0; } +EOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + exec 5>/dev/null + $SHELL $CONFIG_STATUS || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi +
configure Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: Makefile.in =================================================================== --- Makefile.in (nonexistent) +++ Makefile.in (revision 1765) @@ -0,0 +1,585 @@ +# Makefile.in generated by automake 1.6.2 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ + +EXEEXT = @EXEEXT@ +OBJEXT = @OBJEXT@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +AMTAR = @AMTAR@ +AWK = @AWK@ +BARE_CPU_CFLAGS = @BARE_CPU_CFLAGS@ +BARE_CPU_MODEL = @BARE_CPU_MODEL@ + +CC = @CC@ $(GCCSPECS) +CPP = @CPP@ $(GCCSPECS) +DEPDIR = @DEPDIR@ +ENDIF = @ENDIF@ +GCCSED = @GCCSED@ +GCC_SPECS = @GCC_SPECS@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +MAINT = @MAINT@ +MAKE = @MAKE@ +MULTIBUILDTOP = @MULTIBUILDTOP@ +MULTISUBDIR = @MULTISUBDIR@ +PACKAGE = @PACKAGE@ +PROJECT_INCLUDE = @PROJECT_INCLUDE@ +PROJECT_ROOT = @PROJECT_ROOT@ +PROJECT_TOPdir = @PROJECT_TOPdir@ +RANLIB = @RANLIB@ +RTEMS_BSP = @RTEMS_BSP@ +RTEMS_CPU = @RTEMS_CPU@ +RTEMS_HOST = @RTEMS_HOST@ +RTEMS_ROOT = @RTEMS_ROOT@ +RTEMS_TOPdir = @RTEMS_TOPdir@ +STRIP = @STRIP@ +VERSION = @VERSION@ +am__include = @am__include@ +am__quote = @am__quote@ +install_sh = @install_sh@ +multilib_basedir = @multilib_basedir@ +project_libdir = @project_libdir@ + +ACLOCAL_AMFLAGS = -I ../aclocal + +@MULTILIB_TRUE@MULTISRCTOP = +@MULTILIB_TRUE@MULTIDIRS = +@MULTILIB_TRUE@MULTIDO = true +@MULTILIB_TRUE@MULTICLEAN = true + +@RTEMS_USE_GCC_TRUE@CFLAGS_DEFAULT = -g -Wall +@RTEMS_USE_GCC_TRUE@GCCSPECS = $(GCC_SPECS) + +DEFS = @DEFS@ + +CPPFLAGS = @CPPFLAGS@ $(CPU_DEFINES) \ + $(DEFINES) $(XCPPFLAGS) $(CPPFLAGS_GCC) + +CFLAGS = $(CFLAGS_DEFAULT) $(CPU_CFLAGS) $(XCFLAGS) +ASFLAGS = $(CPU_ASFLAGS) $(CPU_CFLAGS) $(XASFLAGS) + +# when debugging, optimize flag: typically empty +# some compilers do allow optimization with their "-g" +CFLAGS_DEBUG_OPTIMIZE_V = -g + +# profile flag; use gprof(1) +CFLAGS_PROFILE_V = -pg + + +# +# How to compile stuff into ${ARCH} subdirectory +# +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) + +CCLD = $(CC) + +CCASCOMPILE = $(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS) + + +# Dependency files for use by gmake +# NOTE: we don't put them into $(ARCH) +# so that 'make clean' doesn't blow it away +DEPEND = Depends-${ARCH} + +CLEAN_DEPEND = $(DEPEND).tmp +CLOBBER_DEPEND = $(DEPEND) + +VARIANT = OPTIMIZE + +VARIANT_OPTIMIZE_V = OPTIMIZE +VARIANT_DEBUG_V = DEBUG +VARIANT_PROFILE_V = PROFILE +VARIANT_optimize_V = OPTIMIZE +VARIANT_debug_V = DEBUG +VARIANT_profile_V = PROFILE + +VARIANT_V = $(VARIANT_$(VARIANT)_V) + +ARCH_OPTIMIZE_V = o-optimize +ARCH_DEBUG_V = o-debug +ARCH_PROFILE_V = o-profile + +ARCH__V = $(ARCH_OPTIMIZE_V) +ARCH = $(ARCH_$(VARIANT_V)_V) + +LIBSUFFIX_OPTIMIZE_V = +LIBSUFFIX_DEBUG_V = _g +LIBSUFFIX_PROFILE_V = _p +LIBSUFFIX__V = $(LIBSUFFIX_OPTIMIZE_V) + +LIB_VARIANT = $(LIBSUFFIX_$(VARIANT_V)_V) +LIBSUFFIX_VA = $(LIB_VARIANT).a + +CFLAGS__V = $(CFLAGS_OPTIMIZE_V) + +@RTEMS_USE_GCC_TRUE@RTEMS_CFLAGS_OPTIMIZE_V = +@RTEMS_USE_GCC_TRUE@RTEMS_CFLAGS_DEBUG_V = -Wno-unused +@RTEMS_USE_GCC_TRUE@RTEMS_CFLAGS_PROFILE_V = + +RTEMS_CFLAGS__V = $(RTEMS_CFLAGS_OPTIMIZE_V) + +AM_CPPFLAGS = $(RTEMS_CPPFLAGS) + +AM_CFLAGS = $(RTEMS_CFLAGS_$(VARIANT_V)_V) $(CFLAGS_$(VARIANT_V)_V) $(LIBC_DEFINES) + +# AM_CFLAGS = $(RTEMS_BSP_CFLAGS) $(RTEMS_CFLAGS) +AM_CCASFLAGS = $(RTEMS_BSP_CFLAGS) $(RTEMS_CPPFLAGS) $(RTEMS_ASFLAGS) + +AR = @AR@ + +ARFLAGS = ruv + +TMPINSTALL_FILES = $(project_libdir)$(MULTISUBDIR) + +include_rtemsdir = $(includedir)/rtems + +include_rtems_HEADERS = \ + include/rtems/bdbuf.h include/rtems/blkdev.h \ + include/rtems/diskdevs.h include/rtems/ramdisk.h + + +PREINSTALL_FILES = $(PROJECT_INCLUDE)/rtems \ + $(include_rtems_HEADERS:include/%=$(PROJECT_INCLUDE)/%) + + +LIB = ${ARCH}/libblock.a + +C_FILES = src/bdbuf.c src/blkdev.c src/diskdevs.c src/ramdisk.c + +C_O_FILES = $(C_FILES:src/%.c=${ARCH}/%.$(OBJEXT)) + +SRCS = $(C_FILES) +OBJS = $(C_O_FILES) + +PROJECT_TOOLS = $(PROJECT_RELEASE)/build-tools +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs +CONFIG_CLEAN_FILES = +DIST_SOURCES = +HEADERS = $(include_rtems_HEADERS) + +DIST_COMMON = README $(include_rtems_HEADERS) ../../COPYING \ + ../../ChangeLog ../../INSTALL ../../README ../../acinclude.m4 \ + ../../config.guess ../../config.sub ../../configure \ + ../../configure.ac ../../depcomp ../../install-sh ../../missing \ + ../../mkinstalldirs ChangeLog Makefile.am Makefile.in \ + aclocal.m4 configure configure.ac +all: all-am + +.SUFFIXES: + +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/../automake/multilib.am $(top_srcdir)/../automake/compile.am $(top_srcdir)/../automake/lib.am $(top_srcdir)/../automake/local.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe) + +$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(srcdir)/configure.ac $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.ac ../aclocal/bsp-alias.m4 ../aclocal/canonical-host.m4 ../aclocal/canonical-target-name.m4 ../aclocal/canonicalize-tools.m4 ../aclocal/check-bsp-cache.m4 ../aclocal/check-bsps.m4 ../aclocal/check-cpu.m4 ../aclocal/check-itron.m4 ../aclocal/check-multiprocessing.m4 ../aclocal/check-networking.m4 ../aclocal/check-newlib.m4 ../aclocal/check-posix.m4 ../aclocal/check-tool.m4 ../aclocal/enable-bare.m4 ../aclocal/enable-inlines.m4 ../aclocal/enable-itron.m4 ../aclocal/enable-multiprocessing.m4 ../aclocal/enable-networking.m4 ../aclocal/enable-posix.m4 ../aclocal/enable-rtemsbsp.m4 ../aclocal/env-rtemsbsp.m4 ../aclocal/env-rtemscpu.m4 ../aclocal/gcc-pipe.m4 ../aclocal/gcc-specs.m4 ../aclocal/multi.m4 ../aclocal/multilib.m4 ../aclocal/prog-cc.m4 ../aclocal/prog-ccas.m4 ../aclocal/rtems-cpu-subdirs.m4 ../aclocal/rtems-debug.m4 ../aclocal/rtems-top.m4 ../aclocal/sysv-ipc.m4 ../aclocal/tool-paths.m4 ../aclocal/version.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +uninstall-info-am: +include_rtemsHEADERS_INSTALL = $(INSTALL_HEADER) +install-include_rtemsHEADERS: $(include_rtems_HEADERS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(include_rtemsdir) + @list='$(include_rtems_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(include_rtemsHEADERS_INSTALL) $$d$$p $(DESTDIR)$(include_rtemsdir)/$$f"; \ + $(include_rtemsHEADERS_INSTALL) $$d$$p $(DESTDIR)$(include_rtemsdir)/$$f; \ + done + +uninstall-include_rtemsHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(include_rtems_HEADERS)'; for p in $$list; do \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " rm -f $(DESTDIR)$(include_rtemsdir)/$$f"; \ + rm -f $(DESTDIR)$(include_rtemsdir)/$$f; \ + done + +ETAGS = etags +ETAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = . +distdir = $(PACKAGE)-$(VERSION) + +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } + +GZIP_ENV = --best +distcleancheck_listfiles = find . -type f -print + +distdir: $(DISTFILES) + $(am__remove_distdir) + mkdir $(distdir) + $(mkinstalldirs) $(distdir)/../.. $(distdir)/include/rtems + @list='$(DISTFILES)'; for file in $$list; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist-gzip: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist dist-all: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + $(am__remove_distdir) + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + chmod a-w $(distdir) + dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \ + && cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && (test `find $$dc_install_base -type f -print | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + find $$dc_install_base -type f -print ; \ + exit 1; } >&2 ) \ + && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \ + && rm -f $(distdir).tar.gz \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @echo "$(distdir).tar.gz is ready for distribution" | \ + sed 'h;s/./=/g;p;x;p;x' +distcleancheck: distclean + if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-am +all-am: Makefile $(HEADERS) all-local + +installdirs: + $(mkinstalldirs) $(DESTDIR)$(include_rtemsdir) + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-local mostlyclean-am + +distclean: distclean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) +distclean-am: clean-am distclean-generic distclean-local distclean-tags + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: install-include_rtemsHEADERS + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf autom4te.cache +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +uninstall-am: uninstall-include_rtemsHEADERS uninstall-info-am + +.PHONY: GTAGS all all-am all-local check check-am clean clean-generic \ + clean-local dist dist-all dist-gzip distcheck distclean \ + distclean-generic distclean-local distclean-tags distcleancheck \ + distdir dvi dvi-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am \ + install-include_rtemsHEADERS install-info install-info-am \ + install-man install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic tags uninstall uninstall-am \ + uninstall-include_rtemsHEADERS uninstall-info-am + + +# Multilib support rules +.PHONY: all-multi install-multi mostlyclean-multi clean-multi distclean-multi \ + maintainer-clean-multi + +@MULTILIB_TRUE@all-recursive: all-multi +@MULTILIB_TRUE@install-recursive: install-multi + +@MULTILIB_TRUE@mostlyclean-recursive: mostlyclean-multi +@MULTILIB_TRUE@clean-recursive: clean-multi +@MULTILIB_TRUE@distclean-recursive: distclean-multi +@MULTILIB_TRUE@maintainer-clean-recursive: maintainer-clean-multi + +@MULTILIB_TRUE@all-multi: +@MULTILIB_TRUE@ $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do +@MULTILIB_TRUE@install-multi: +@MULTILIB_TRUE@ $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do + +@MULTILIB_TRUE@mostlyclean-multi: +@MULTILIB_TRUE@ $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean +@MULTILIB_TRUE@clean-multi: +@MULTILIB_TRUE@ $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean +@MULTILIB_TRUE@distclean-multi: +@MULTILIB_TRUE@ $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean +@MULTILIB_TRUE@maintainer-clean-multi: +@MULTILIB_TRUE@ $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean +@MULTILIB_FALSE@include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +@RTEMS_USE_GCC_FALSE@include $(CONFIG.CC) + +${ARCH}/%.$(OBJEXT): %.c + ${COMPILE} -o $@ -c $< + +${ARCH}/%.$(OBJEXT): %.S + ${CCASCOMPILE} -o $@ -c $< + +# Make foo.rel from foo.$(OBJEXT) +${ARCH}/%.rel: ${ARCH}/%.$(OBJEXT) + ${make-rel} + +# We deliberately don't have anything depend on the +# $(DEPEND) file; otherwise it will get rebuilt even +# on 'make clean' +# + +depend-am: $(C_FILES) $(CC_FILES) $(S_FILES) + $(COMPILE) -M $^ | \ + sed -e 's?^\(.*\)\.o[ ]*:?$$(ARCH)/\1.o:?' \ + -e 's?$(ARCH)/?$$(ARCH)/?' >$(DEPEND).tmp + mv $(DEPEND).tmp $(DEPEND) +depend: depend-am + +# pull in dependencies if they exist +ifeq (${DEPEND},$(wildcard ${DEPEND})) +include ${DEPEND} +@ENDIF@ + +define make-library +$(RM) $@ +$(AR) $(ARFLAGS) $@ $^ +$(RANLIB) $@ +endef + +$(project_libdir)$(MULTISUBDIR): + @$(mkinstalldirs) $@ + +.PRECIOUS: $(LIB) + +$(PROJECT_INCLUDE)/%.h: include/%.h + $(INSTALL_DATA) $< $@ + +$(PROJECT_INCLUDE)/rtems: + @$(mkinstalldirs) $@ + +${ARCH}/%.$(OBJEXT): src/%.c + ${COMPILE} -o $@ -c $< + +$(LIB): ${OBJS} + $(make-library) + +all-local: $(PREINSTALL_FILES) ${ARCH} $(LIB) + +debug: + @echo + @echo "\"make debug\" is obsolete, instead use:" + @echo " make VARIANT=DEBUG" + @echo + +.PHONY: debug + +profile: + @echo + @echo "\"make profile\" is obsolete, instead use:" + @echo " make VARIANT=PROFILE" + @echo + +.PHONY: profile + +preinstall-am: $(PREINSTALL_FILES) +preinstall: preinstall-am +.PHONY: preinstall preinstall-am + +depend-am: +depend: depend-am +.PHONY: depend depend-am + +${ARCH}: + mkdir ${ARCH} + +clean-local: + $(RM) -r o-optimize o-debug o-profile $(CLEANDIRS) + $(RM) Depends-o-optimize.tmp Depends-o-debug.tmp Depends-o-profile.tmp + +distclean-local: + $(RM) Depends-o-optimize Depends-o-debug Depends-o-profile +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: Index: configure.ac =================================================================== --- configure.ac (nonexistent) +++ configure.ac (revision 1765) @@ -0,0 +1,26 @@ +## Process this file with autoconf to produce a configure script. +## +## configure.ac,v 1.8 2002/07/31 05:48:15 ralf Exp + +AC_PREREQ(2.52) +AC_INIT([rtems-c-src-libblock],[_RTEMS_VERSION],[rtems-bugs@OARcorp.com]) +AC_CONFIG_SRCDIR([src/bdbuf.c]) +RTEMS_TOP(../..) +AC_CONFIG_AUX_DIR(../..) + +RTEMS_CANONICAL_TARGET_CPU +RTEMS_CANONICAL_HOST + +AM_INIT_AUTOMAKE([no-define foreign 1.6]) +AM_MAINTAINER_MODE + +RTEMS_ENV_RTEMSCPU +RTEMS_CHECK_CPU +RTEMS_PROG_CC_FOR_TARGET + +RTEMS_CANONICALIZE_TOOLS +AC_PROG_RANLIB + +# Explicitly list all Makefiles here +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT Index: ChangeLog =================================================================== --- ChangeLog (nonexistent) +++ ChangeLog (revision 1765) @@ -0,0 +1,129 @@ +2002-07-31 Ralf Corsepius + + * Makefile.am: Merge src/Makefile.am. + * src/Makefile.am: Remove. + * configure.ac: Remove src/Makefile.am + +2002-07-22 Ralf Corsepius + + * src/Makefile.am: Use .$(OBJEXT) instead of .o. + +2002-07-22 Ralf Corsepius + + * src/Makefile.am: Eliminate LIBNAME. Cosmetical cleanups. + +2002-07-05 Ralf Corsepius + + * configure.ac: RTEMS_TOP(../..). + +2002-07-01 Joel Sherrill + + * Mega patch merge to change the format of the object IDs to + loosen the dependency between the SCORE and the various APIs. + There was considerable work to simplify the object name management + and it appears that the name_table field is no longer needed. + This patch also includes the addition of the internal mutex + which is currently only used to protect some types of allocation + and deallocation. This significantly can reduce context + switch latency under certain circumstances. In particular, + some heap/region operations were O(n) and had dispatching + disabled. This should help enormously. With this merge, + the patch is not as clean as it should be. In particular, + the documentation has not been modified to reflect the new object + ID layout, the IDs in the test screens are not updated, and + _Objects_Get_information needs to be a real routine not inlined. + As part of this patch a lot of MP code for thread/proxy blocking + was made conditional and cleaned up. + * src/bdbuf.c: Modified as part of above. +2002-07-01 Ralf Corsepius + + * configure.ac: Remove RTEMS_PROJECT_ROOT. + +2002-06-27 Ralf Corsepius + + * configure.ac: Use AC_CONFIG_AUX_DIR(../..). + Add AC_PROG_RANLIB. + +2002-06-26 Ralf Corsepius + + * src/Makefile.am: Don't preinstall libblock.a. + +2002-06-18 Ralf Corsepius + + * Makefile.am: Merge-in include/Makefile.am. + * include/Makefile.am: Remove. + * configure.ac: Reflect changes above. + +2002-06-17 Ralf Corsepius + + * include/Makefile.am: Include $(top_srcdir)/../automake/*.am. + * Makefile.am: Include $(top_srcdir)/../automake/*.am. + Use ../aclocal. + * src/Makefile.am: Include $(top_srcdir)/../automake/*.am. + +2002-05-18 Ralf Corsepius + + Move from c/src/libblock to c/src/exec/libblock + * configure.ac: Reflect move. + * Makefile.am: Ditto. + * include/Makefile.am: Ditto. + * src/Makefile.am: Ditto. + +2002-04-06 Ralf Corsepius + + * src/ramdisk.c: include . + * src/blkdev.c: include . + +2002-04-03 Alexander Kukuta + + * include/rtems/bdbuf.h: Address PR168 by changing bdbuf_buffer.avl.bal + and bdbuf_buffer.avl.cache to signed char instead of char. + +2002-03-27 Ralf Corsepius + + * configure.ac: + AC_INIT(package,_RTEMS_VERSION,_RTEMS_BUGS). + AM_INIT_AUTOMAKE([no-define foreign 1.6]). + * include/Makefile.am: Remove AUTOMAKE_OPTIONS. + * Makefile.am: Remove AUTOMAKE_OPTIONS. + * src/Makefile.am: Remove AUTOMAKE_OPTIONS. + +2002-03-21 Alexander Kukuta + + * src/bdbuf.c (avl_insert, avl_remove): Reimplemented from scratch + to avoid using GPLed sources in RTEMS core. + * src/bdbuf.c, include/rtems/bdbuf.h: Remove "binary tree" + implementation which was used for debugging only. + +2002-03-13 Victor V. Vengerov + + * src/bdbuf.c (find_or_assign_buffer, rtems_bdbuf_read, + rtems_bdbuf_sync, rtems_bdbuf_syncdev, bdbuf_swapout_task): + Fix bug: disable interrupts and set level properly before + _CORE_mutex_Seize invocation). + +2002-02-28 Joel Sherrill + + * Submitted by Victor V. Vengerov and merged + into the RTEMS source. + * ChangeLog, Makefile.am, README, configure.ac, include/Makefile.am, + include/rtems/bdbuf.h, include/rtems/blkdev.h, include/rtems/diskdevs.h, + include/rtems/ramdisk.h, include/rtems/.cvsignore, include/.cvsignore, + src/Makefile.am, src/bdbuf.c, src/blkdev.c, src/diskdevs.c, + src/ramdisk.c, src/.cvsignore, .cvsignore: New files. + +2001-11-29 Victor V. Vengerov + * AVL trees implementation added. + +2001-11-16 Victor V. Vengerov + * include/rtems/bdbuf.h, src/bdbuf.c(rtems_bdbuf_syncdev): New. + +2001-11-07 Victor V. Vengerov + + * ChangeLog: New file. + * src/, include/, include/rtems/: New directories. + * README, configure.ac, Makefile.am, src/Makefile.am, + include/Makefile.am: New files. + * include/rtems/bdbuf.h include/rtems/blkdev.h + include/rtems/diskdevs.h include/rtems/ramdisk.h + src/bdbuf.c src/blkdev.c src/diskdevs.c src/ramdisk.c: New files. Index: Makefile.am =================================================================== --- Makefile.am (nonexistent) +++ Makefile.am (revision 1765) @@ -0,0 +1,45 @@ +## +## Makefile.am,v 1.7 2002/07/31 05:48:15 ralf Exp +## + +ACLOCAL_AMFLAGS = -I ../aclocal + +include $(top_srcdir)/../automake/multilib.am +include $(top_srcdir)/../automake/compile.am +include $(top_srcdir)/../automake/lib.am + +include_rtemsdir = $(includedir)/rtems + +$(PROJECT_INCLUDE)/%.h: include/%.h + $(INSTALL_DATA) $< $@ + +$(PROJECT_INCLUDE)/rtems: + @$(mkinstalldirs) $@ + +include_rtems_HEADERS = \ + include/rtems/bdbuf.h include/rtems/blkdev.h \ + include/rtems/diskdevs.h include/rtems/ramdisk.h + +PREINSTALL_FILES = $(PROJECT_INCLUDE)/rtems \ + $(include_rtems_HEADERS:include/%=$(PROJECT_INCLUDE)/%) + +LIB = ${ARCH}/libblock.a + +C_FILES = src/bdbuf.c src/blkdev.c src/diskdevs.c src/ramdisk.c + +C_O_FILES = $(C_FILES:src/%.c=${ARCH}/%.$(OBJEXT)) + +SRCS = $(C_FILES) +OBJS = $(C_O_FILES) + +AM_CFLAGS += $(LIBC_DEFINES) + +${ARCH}/%.$(OBJEXT): src/%.c + ${COMPILE} -o $@ -c $< + +$(LIB): ${OBJS} + $(make-library) + +all-local: $(PREINSTALL_FILES) ${ARCH} $(LIB) + +include $(top_srcdir)/../automake/local.am Index: README =================================================================== --- README (nonexistent) +++ README (revision 1765) @@ -0,0 +1,14 @@ +# +# README,v 1.1 2002/02/28 20:39:54 joel Exp +# + +This directory contains the block device (HDD, CDROMs, etc) support code. +It includes: + - block device driver interface + - generic open/close/read/write/ioctl primitives for block device drivers + - disk I/O buffering + - logical disk support + - RAM disk block device driver + +Victor V. Vengerov, +November, 7 2001 Index: aclocal.m4 =================================================================== --- aclocal.m4 (nonexistent) +++ aclocal.m4 (revision 1765) @@ -0,0 +1,1231 @@ +# aclocal.m4 generated automatically by aclocal 1.6.2 -*- Autoconf -*- + +# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +dnl rtems-top.m4,v 1.5 2002/07/31 14:40:48 ralf Exp + +dnl +dnl RTEMS_TOP($1) +dnl +dnl $1 .. relative path from this configure.in to the toplevel configure.in +dnl +AC_DEFUN(RTEMS_TOP, +[dnl +AC_REQUIRE([RTEMS_VERSIONING]) +AC_CHECK_PROGS(MAKE, gmake make) +AC_BEFORE([$0], [AC_CONFIG_AUX_DIR])dnl +AC_BEFORE([$0], [AM_INIT_AUTOMAKE])dnl + +AC_PREFIX_DEFAULT([/opt/rtems]) + +ENDIF=endif +AC_SUBST(ENDIF) + +RTEMS_TOPdir="$1"; +AC_SUBST(RTEMS_TOPdir) + +test -n "$with_target_subdir" || with_target_subdir="." + +if test "$with_target_subdir" = "." ; then +# Native +PROJECT_TOPdir="${with_project_root}${RTEMS_TOPdir}/\$(MULTIBUILDTOP)\$(top_builddir)" +else +# Cross +dots=`echo $with_target_subdir|\ +sed -e 's%^\./%%' -e 's%[[^/]]$%&/%' -e 's%[[^/]]*/%../%g'` +PROJECT_TOPdir="${dots}${with_project_root}${RTEMS_TOPdir}/\$(MULTIBUILDTOP)\$(top_builddir)" +fi +AC_SUBST(PROJECT_TOPdir) + +PROJECT_ROOT="${with_project_root}${RTEMS_TOPdir}/\$(MULTIBUILDTOP)\$(top_builddir)" +AC_SUBST(PROJECT_ROOT) + +AC_MSG_CHECKING([for RTEMS Version]) +AS_IF([test -r "${srcdir}/${RTEMS_TOPdir}/cpukit/aclocal/version.m4"], +[], +[AC_MSG_ERROR([Unable to find ${RTEMS_TOPdir}/cpukit/aclocal/version.m4])]) +AC_MSG_RESULT([_RTEMS_VERSION]) +])dnl + +AC_DEFUN([RTEMS_VERSIONING], +m4_define([_RTEMS_VERSION],[ss-20020528])) + +# Do all the work for Automake. -*- Autoconf -*- + +# This macro actually does too much some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 8 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +AC_PREREQ([2.52]) + +# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow +# the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl + AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl + AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl + AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_MISSING_PROG(AMTAR, tar) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl + +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_][CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_][CC], + defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_][CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_][CXX], + defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) +]) + +# Copyright 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.6"]) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION so it can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([1.6.2])]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright 2001, 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# +# Check to make sure that the build environment is sane. +# + +# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# -*- Autoconf -*- + + +# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# AM_AUX_DIR_EXPAND + +# Copyright 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +# Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50]) + +AC_DEFUN([AM_AUX_DIR_EXPAND], [ +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. + +# Copyright 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# AM_PROG_INSTALL_STRIP + +# Copyright 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# serial 4 -*- Autoconf -*- + +# Copyright 1999, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + echo '#include "conftest.h"' > conftest.c + echo 'int i;' > conftest.h + echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=conftest.c object=conftest.o \ + depfile=conftest.Po tmpdepfile=conftest.TPo \ + $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && + grep conftest.h conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[rm -f .deps 2>/dev/null +mkdir .deps 2>/dev/null +if test -d .deps; then + DEPDIR=.deps +else + # MS-DOS does not allow filenames that begin with a dot. + DEPDIR=_deps +fi +rmdir .deps 2>/dev/null +AC_SUBST([DEPDIR]) +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking Speeds up one-time builds + --enable-dependency-tracking Do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH]) +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +#serial 2 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n -e '/^U = / s///p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # We invoke sed twice because it is the simplest approach to + # changing $(DEPDIR) to its actual value in the expansion. + for file in `sed -n -e ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Copyright 2001 Free Software Foundation, Inc. -*- Autoconf -*- + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +doit: + @echo done +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST(am__include) +AC_SUBST(am__quote) +AC_MSG_RESULT($_am_result) +rm -f confinc confmf +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright 1997, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 5 + +AC_PREREQ(2.52) + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([conditional \"$1\" was never defined. +Usually this means the macro was only invoked conditionally.]) +fi])]) + +dnl +dnl canonical-target-name.m4,v 1.1 2002/06/17 08:52:47 ralf Exp +dnl + +dnl canonicalize target cpu +dnl NOTE: Most rtems targets do not fullfil autoconf's +dnl target naming conventions "processor-vendor-os" +dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them +dnl and we have to fix it for rtems ourselves + +AC_DEFUN(RTEMS_CANONICAL_TARGET_CPU, +[ +AC_CANONICAL_TARGET +AC_MSG_CHECKING(rtems target cpu) +case "${target}" in + # hpux unix port should go here + i[[34567]]86-*linux*) # unix "simulator" port + RTEMS_CPU=unix + ;; + i[[34567]]86-*freebsd*) # unix "simulator" port + RTEMS_CPU=unix + ;; + i[[34567]]86-pc-cygwin*) # Cygwin is just enough unix like :) + RTEMS_CPU=unix + ;; + no_cpu-*rtems*) + RTEMS_CPU=no_cpu + ;; + sparc-sun-solaris*) # unix "simulator" port + RTEMS_CPU=unix + ;; + *) + RTEMS_CPU=`echo $target | sed 's%^\([[^-]]*\)-\(.*\)$%\1%'` + ;; +esac +AC_SUBST(RTEMS_CPU) +AC_MSG_RESULT($RTEMS_CPU) +]) + +dnl canonical-host.m4,v 1.1 2002/06/17 08:52:47 ralf Exp + +AC_DEFUN(RTEMS_CANONICAL_HOST, +[dnl +AC_REQUIRE([AC_CANONICAL_HOST]) +RTEMS_HOST=$host_os +case "${target}" in + # hpux unix port should go here + i[[34567]]86-*linux*) # unix "simulator" port + RTEMS_HOST=Linux + ;; + i[[34567]]86-*freebsd*) # unix "simulator" port + RTEMS_HOST=FreeBSD + ;; + i[[34567]]86-pc-cygwin*) # Cygwin is just enough unix like :) + RTEMS_HOST=Cygwin + ;; + sparc-sun-solaris*) # unix "simulator" port + RTEMS_HOST=Solaris + ;; + *) + ;; +esac +AC_SUBST(RTEMS_HOST) +])dnl + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# Copyright 1996, 1998, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 1 + +AC_DEFUN([AM_MAINTAINER_MODE], +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +dnl env-rtemscpu.m4,v 1.4 2002/08/06 07:31:26 ralf Exp + +AC_DEFUN(RTEMS_ENV_RTEMSCPU, +[AC_REQUIRE([RTEMS_ENABLE_MULTILIB]) + +if test x"$multilib" = x"yes"; then + AS_IF([test -n "$with_multisubdir"], + [MULTIBUILDTOP=`echo "/$with_multisubdir" | sed 's,/[[^\\/]]*,../,g'`]) + AC_SUBST(MULTIBUILDTOP) + + AS_IF([test -n "$with_multisubdir"], + [MULTISUBDIR="/$with_multisubdir"]) + AC_SUBST(MULTISUBDIR) + + GCC_SPECS="-isystem \$(PROJECT_INCLUDE)" + AC_SUBST(GCC_SPECS) + + PROJECT_INCLUDE="\$(PROJECT_ROOT)/lib/include" + AC_SUBST(PROJECT_INCLUDE) + + project_libdir="\$(PROJECT_ROOT)/lib" + AC_SUBST(project_libdir) + + RTEMS_ROOT="${PROJECT_ROOT}" + AC_SUBST(RTEMS_ROOT) + + includedir="\${exec_prefix}/lib/include" + libdir="${libdir}\$(MULTISUBDIR)" +else + RTEMS_ENV_RTEMSBSP + RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP) +fi +]) + +dnl This provides configure definitions used for multilib support + +dnl parts of these macros are derived from newlib-1.8.2's multilib support + +AC_DEFUN(RTEMS_ENABLE_MULTILIB, +[ +AC_ARG_ENABLE(multilib, +AC_HELP_STRING([--enable-multilib], +[build many library versions (default=no)]), +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=no])dnl + +AM_CONDITIONAL(MULTILIB,test x"${multilib}" = x"yes") +]) + +AC_DEFUN([RTEMS_ENABLE_MULTILIB_MASTER], +[ +AC_REQUIRE([RTEMS_ENABLE_MULTILIB]) + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + multilib_basedir="[$]{srcdir}/[$]{with_multisrctop}../ifelse([$2],,,[$2])" + else + multilib_basedir="[$]{srcdir}/[$]{with_multisrctop}ifelse([$2],,,[$2])" + fi +else + multilib_basedir="[$]{srcdir}/ifelse([$2],,,[$2])" +fi +AC_SUBST(multilib_basedir) + +if test "${multilib}" = "yes"; then + multilib_arg="--enable-multilib" +else + multilib_arg= +fi + +AC_OUTPUT_COMMANDS( +[case " $CONFIG_FILES " in + *" ]m4_if([$1],,Makefile,[$1])[ "*) + ac_file=]m4_if([$1],,Makefile,[$1])[ . ${multilib_basedir}/config-ml.in +esac], +[ + srcdir=${srcdir} + host=${host} + target=${target} + with_multisrctop="${with_multisrctop}" + with_target_subdir="${with_target_subdir}" + with_multisubdir="${with_multisubdir}" + ac_configure_args="${multilib_arg} ${ac_configure_args}" + CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + multilib_basedir=${multilib_basedir} + CC="${CC}"]) +]) + +dnl env-rtemsbsp.m4,v 1.3 2002/08/06 10:09:33 ralf Exp + +dnl Pass a single BSP via an environment variable +dnl used by per BSP configure scripts +AC_DEFUN(RTEMS_ENV_RTEMSBSP, +[dnl +AC_BEFORE([$0], [RTEMS_ENABLE_RTEMSBSP])dnl +AC_BEFORE([$0], [RTEMS_PROJECT_ROOT])dnl +AC_BEFORE([$0], [RTEMS_CHECK_CUSTOM_BSP])dnl + +AC_ARG_VAR([RTEMS_BSP],[RTEMS_BSP to build]) +AC_MSG_CHECKING([for RTEMS_BSP]) +AC_CACHE_VAL(rtems_cv_RTEMS_BSP, +[dnl + test -n "${RTEMS_BSP}" && rtems_cv_RTEMS_BSP="$RTEMS_BSP"; +])dnl +if test -z "$rtems_cv_RTEMS_BSP"; then + AC_MSG_ERROR([Missing RTEMS_BSP]) +fi +RTEMS_BSP="$rtems_cv_RTEMS_BSP" +AC_MSG_RESULT(${RTEMS_BSP}) +AC_SUBST(RTEMS_BSP) + +PROJECT_INCLUDE="\$(PROJECT_ROOT)/$RTEMS_BSP/lib/include" +AC_SUBST(PROJECT_INCLUDE) + +project_libdir="${PROJECT_ROOT}/$RTEMS_BSP/lib" +AC_SUBST(project_libdir) + +RTEMS_ROOT="$PROJECT_ROOT/c/$RTEMS_BSP" +AC_SUBST(RTEMS_ROOT) + +GCC_SPECS="-isystem \$(PROJECT_INCLUDE)" +AC_SUBST(GCC_SPECS) + +RTEMS_ENABLE_BARE +AC_SUBST(BARE_CPU_MODEL) +AC_SUBST(BARE_CPU_CFLAGS) + +AM_CONDITIONAL([MULTILIB],[false]) + +includedir="\${exec_prefix}/${RTEMS_BSP}/lib/include" +libdir="\${exec_prefix}/${RTEMS_BSP}/lib" +]) + +dnl enable-rtemsbsp.m4,v 1.1 2002/06/17 08:52:47 ralf Exp + +dnl Override the set of BSPs to be built. +dnl used by the toplevel configure script +dnl RTEMS_ENABLE_RTEMSBSP(rtems_bsp_list) +AC_DEFUN(RTEMS_ENABLE_RTEMSBSP, +[ +AC_BEFORE([$0], [RTEMS_ENV_RTEMSBSP])dnl +AC_ARG_ENABLE(rtemsbsp, +AC_HELP_STRING([--enable-rtemsbsp="bsp1 bsp2 .."], +[BSPs to include in build]), +[case "${enableval}" in + yes|no) AC_MSG_ERROR([missing argument to --enable-rtemsbsp=\"bsp1 bsp2\"]);; + *) $1=$enableval;; +esac],[$1=""]) +]) + +dnl check-bsps.m4,v 1.3 2002/07/17 22:28:20 ralf Exp + +AC_DEFUN(RTEMS_CHECK_CUSTOM_BSP, +[dnl +AC_REQUIRE([RTEMS_TOP]) + +AC_MSG_CHECKING([for make/custom/[$]$1.cfg]) +if test -r "$srcdir/$RTEMS_TOPdir/make/custom/[$]$1.cfg"; then + AC_MSG_RESULT([yes]) +else + AC_MSG_ERROR([no]) +fi +])dnl + +AC_DEFUN(RTEMS_ENABLE_BARE, +[ +AC_ARG_ENABLE(bare-cpu-cflags, +AC_HELP_STRING([--enable-bare-cpu-cflags],[specify a particular cpu cflag (bare bsp specific)]), +[case "${enableval}" in + no) BARE_CPU_CFLAGS="" ;; + *) BARE_CPU_CFLAGS="${enableval}" ;; +esac], +[BARE_CPU_CFLAGS=""]) + +AC_ARG_ENABLE(bare-cpu-model, +AC_HELP_STRING([--enable-bare-cpu-model],[specify a particular cpu model (bare bsp specific)]), +[case "${enableval}" in + no) BARE_CPU_MODEL="" ;; + *) BARE_CPU_MODEL="${enableval}" ;; +esac], +[BARE_CPU_MODEL=""]) +]) + + +dnl check-cpu.m4,v 1.3 2002/07/17 22:28:20 ralf Exp + +dnl check if RTEMS support a cpu +AC_DEFUN(RTEMS_CHECK_CPU, +[dnl +AC_REQUIRE([RTEMS_TOP]) +AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU]) + +# Is this a supported CPU? +AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported]) +if test -d "$srcdir/$RTEMS_TOPdir/cpukit/score/cpu/$RTEMS_CPU"; then + AC_MSG_RESULT(yes) +else + AC_MSG_ERROR(no) +fi +])dnl + + +dnl +dnl prog-cc.m4,v 1.2 2002/07/01 09:20:43 ralf Exp +dnl +dnl Check for target gcc +dnl + +AC_DEFUN(RTEMS_PROG_CC, +[ +AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_BEFORE([$0], [AC_PROG_CC])dnl +AC_BEFORE([$0], [RTEMS_CANONICALIZE_TOOLS])dnl + +RTEMS_CHECK_TOOL(CC,gcc) +test -z "$CC" && \ + AC_MSG_ERROR([no acceptable cc found in \$PATH]) +AC_PROG_CC +AC_PROG_CPP + +AM_CONDITIONAL(RTEMS_USE_GCC,test x"$GCC" = x"yes") +]) + +AC_DEFUN(RTEMS_PROG_CC_FOR_TARGET, +[ +dnl check target cc +RTEMS_PROG_CC +dnl check if the compiler supports --specs +RTEMS_GCC_SPECS +dnl check if the target compiler may use --pipe +RTEMS_GCC_PIPE +test "$rtems_cv_gcc_pipe" = "yes" && CC="$CC --pipe" + +if test "$GCC" = yes; then +] +m4_if([$1],,[],[CPPFLAGS="$CPPFLAGS $1"]) +[ +CFLAGS="-g -Wall" +fi + +dnl FIXME: HACK for egcs/cygwin mixing '\\' and '/' in gcc -print-* +#case $build_os in +#*cygwin*) GCCSED="| sed 's%\\\\%/%g'" ;; +#*) ;; +#esac +AC_SUBST(GCCSED) +]) + +dnl +dnl canonicalize-tools.m4,v 1.3 2002/07/31 14:57:47 ralf Exp +dnl +dnl Set target tools +dnl + +AC_DEFUN(RTEMS_CANONICALIZE_TOOLS, +[AC_REQUIRE([RTEMS_PROG_CC])dnl + +dnl FIXME: What shall be done if these tools are not available? + RTEMS_CHECK_TOOL(AR,ar,no) + +dnl special treatment of ranlib + RTEMS_CHECK_TOOL(RANLIB,ranlib,:) +]) + +dnl check-tool.m4,v 1.1 2002/06/17 08:52:47 ralf Exp + +dnl RTEMS_CHECK_TOOL(VARIABLE, PROG-TO-CHECK-FOR[, VALUE-IF-NOT-FOUND [, PATH]]) +AC_DEFUN(RTEMS_CHECK_TOOL, +[ + AS_IF([test "x$build_alias" != "x$host_alias"], + [rtems_tool_prefix=${ac_tool_prefix}]) + AC_CHECK_PROG($1, ${rtems_tool_prefix}$2, ${rtems_tool_prefix}$2, $3, $4) +]) + +dnl +dnl gcc-specs.m4,v 1.1 2002/06/17 08:52:47 ralf Exp +dnl +dnl Check whether the target compiler accepts -specs +dnl + +AC_DEFUN(RTEMS_GCC_SPECS, +[AC_REQUIRE([RTEMS_PROG_CC]) +AC_CACHE_CHECK(whether $CC accepts -specs,rtems_cv_gcc_specs, +[ +rtems_cv_gcc_specs=no +if test x"$GCC" = x"yes"; then + touch confspec + echo 'void f(){}' >conftest.c + if test -z "`${CC} -specs confspec -c conftest.c 2>&1`";then + rtems_cv_gcc_specs=yes + fi +fi +rm -f confspec conftest* +])]) + +dnl +dnl gcc-pipe.m4,v 1.1 2002/06/17 08:52:47 ralf Exp +dnl +dnl Check whether the target compiler accepts -pipe +dnl + +AC_DEFUN(RTEMS_GCC_PIPE, +[AC_REQUIRE([RTEMS_PROG_CC]) +AC_REQUIRE([AC_CANONICAL_HOST]) +AC_CACHE_CHECK(whether $CC accepts --pipe,rtems_cv_gcc_pipe, +[ +rtems_cv_gcc_pipe=no +if test x"$GCC" = x"yes"; then + echo 'void f(){}' >conftest.c + if test -z "`${CC} --pipe -c conftest.c 2>&1`";then + rtems_cv_gcc_pipe=yes + fi + rm -f conftest* +fi +]) +]) + Index: . =================================================================== --- . (nonexistent) +++ . (revision 1765)
. Property changes : Added: svn:ignore ## -0,0 +1,14 ## +Makefile +Makefile.in +aclocal.m4 +autom4te.cache +config.cache +config.guess +config.log +config.status +config.sub +configure +depcomp +install-sh +missing +mkinstalldirs

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.