sane-backends-extras-1.0.22.3ubuntu1/0000775000000000000000000000000011600675053014156 5ustar sane-backends-extras-1.0.22.3ubuntu1/backend/0000775000000000000000000000000011600675052015544 5ustar sane-backends-extras-1.0.22.3ubuntu1/backend/geniusvp2.h0000664000000000000000000000631211527030747017645 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 2004, 2005 Anderson Lizardo This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. SANE backend for the Genius ColorPage-Vivid Pro II scanner. */ #ifndef geniusvp2_h #define geniusvp2_h #undef BACKEND_NAME #define BACKEND_NAME geniusvp2 #define DEBUG_NOT_STATIC #include "../include/sane/sane.h" #include "../include/sane/sanei_config.h" #include "../include/sane/sanei_backend.h" #define MM_PER_INCH 25.4 #define VP2_ASIC_ID 0xE1 /* EICI 091000 ASIC ID */ #define VP2_PRODUCT_ID 0x06 /* Genius ColorPage-Vivid Pro II product ID */ typedef enum { param_none = 0, param_bool, param_int, param_fixed, param_string } parameter_type; typedef enum { opt_num_opts = 0, opt_mode_group, opt_mode, opt_depth, opt_resolution, opt_special_group, opt_print_options, opt_geometry_group, opt_tl_x, opt_tl_y, opt_br_x, opt_br_y, /* must come last: */ num_options } geniusvp2_opts; typedef struct VP2_Device { struct VP2_Device *next; SANE_Device sane; SANE_Option_Descriptor opt[num_options]; Option_Value val[num_options]; SANE_Parameters params; SANE_String name; SANE_Int reader_pid; SANE_Int reader_fds; SANE_Int pipe; SANE_Word bytes_per_line; SANE_Word pixels_per_line; SANE_Word lines; SANE_Int bytes_total; SANE_Bool open; SANE_Bool scanning; SANE_Bool cancelled; SANE_Bool eof; } VP2_Device; #endif /* geniusvp2_h */ sane-backends-extras-1.0.22.3ubuntu1/backend/sane_strstatus.c0000664000000000000000000000670011475557446021015 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 1996, 1997 David Mosberger-Tang and Andreas Beck This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. This file implements the backend-independent parts of SANE. */ #include #include "../include/sane/sane.h" #ifndef SANE_I18N #define SANE_I18N(text) text #endif SANE_String_Const sane_strstatus (SANE_Status status) { static char buf[80]; switch (status) { case SANE_STATUS_GOOD: return SANE_I18N("Success"); case SANE_STATUS_UNSUPPORTED: return SANE_I18N("Operation not supported"); case SANE_STATUS_CANCELLED: return SANE_I18N("Operation was cancelled"); case SANE_STATUS_DEVICE_BUSY: return SANE_I18N("Device busy"); case SANE_STATUS_INVAL: return SANE_I18N("Invalid argument"); case SANE_STATUS_EOF: return SANE_I18N("End of file reached"); case SANE_STATUS_JAMMED: return SANE_I18N("Document feeder jammed"); case SANE_STATUS_NO_DOCS: return SANE_I18N("Document feeder out of documents"); case SANE_STATUS_COVER_OPEN: return SANE_I18N("Scanner cover is open"); case SANE_STATUS_IO_ERROR: return SANE_I18N("Error during device I/O"); case SANE_STATUS_NO_MEM: return SANE_I18N("Out of memory"); case SANE_STATUS_ACCESS_DENIED: return SANE_I18N("Access to resource has been denied"); #ifdef SANE_STATUS_WARMING_UP case SANE_STATUS_WARMING_UP: return SANE_I18N("Lamp not ready, please retry"); #endif #ifdef SANE_STATUS_HW_LOCKED case SANE_STATUS_HW_LOCKED: return SANE_I18N("Scanner mechanism locked for transport"); #endif default: /* non-reentrant, but better than nothing */ sprintf (buf, "Unknown SANE status code %d", status); return buf; } } sane-backends-extras-1.0.22.3ubuntu1/backend/geniusvp2.conf.in0000664000000000000000000000155511527031047020746 0ustar # geniusvp2 backend configuration file ######################################## # Parallel port where scanner is attached to device /dev/parport0 # Default option values ######################################## # Scan mode (currently, only Color mode is supported) mode Color # Bit depth (currently, only a bit depth of 8 is supported) depth 8 # Resolution (75 - 600 dpi) resolution 200 # Read-limit (true, false) read-limit false # Read-limit size (1 - 65536 bytes) read-limit-size 1 # Read-delay (true, false) read-delay false # Read-delay duration (1000 - 200,000 microseconds) read-delay-duration 1000 # Non-blocking io (true, false) non-blocking false # Support select fd (true, false) select-fd false # Top-left x position (mm) tl_x 0.0 # Top-left y position (mm) tl_y 0.0 # Bottom-right x position (mm) br_x 80.0 # Bottom-right y position (mm) br_y 100.0 sane-backends-extras-1.0.22.3ubuntu1/backend/ls5000.c0000664000000000000000000020242711527030747016646 0ustar /* * ls5000.c - Coolscan 5000 ED SANE backend * * 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 of the * License, 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. * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. * * The exception is that, if you link a SANE library with other files * to produce an executable, this does not by itself cause the * resulting executable to be covered by the GNU General Public * License. Your use of that executable is in no way restricted on * account of linking the SANE library code into it. * * This exception does not, however, invalidate any other reasons why * the executable file might be covered by the GNU General Public * License. * * If you submit changes to SANE to the maintainers to be included in * a subsequent release, you agree by submitting the changes that * those changes may be distributed with this exception intact. * * If you write modifications of your own for SANE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. * * This file implements a SANE backend for Nikon Coolscan LS5000ED film * scanner. * * * Copyright 2007 Johannes Berg * * This code is based on coolscan2.c, * Copyright 2001-2002, Andras Major * * We would like to thank Nikon Corporation for providing technical * information. */ #include #include #include #include #include #include #include #include #include #include #include #define BACKEND_NAME ls5000 #include "sane/config.h" #include "sane/sanei_usb.h" #include "sane/sanei_debug.h" /* parameters */ #define NUM_LINES_READ 10 /* typedefs */ #define free(p) free((void*)p) enum ls5000_phase { LS5000_PHASE_NONE = 0x00, LS5000_PHASE_STATUS = 0x01, LS5000_PHASE_OUT = 0x02, LS5000_PHASE_IN = 0x03, LS5000_PHASE_BUSY = 0x04 }; enum ls5000_scan { LS5000_SCAN_NORMAL, LS5000_SCAN_AE, LS5000_SCAN_AE_WB }; enum ls5000_scan_stage { LS5000_SCAN_STAGE_IDLE, LS5000_SCAN_STAGE_ACQUIRE, }; enum ls500O_unit_ready { LS5000_ERROR, LS5000_GOOD, LS5000_BECOMING_READY, LS5000_MECHANICAL_ERROR, LS5000_INITIALISATION_REQUIRED, LS5000_ADAPTER_ERROR, LS5000_NOT_RESPONDING, LS5000_NO_MEDIUM, LS5000_CMD_SEQ_ERR, LS5000_UNIT_ATTENTION, LS5000_DATA_PHASE_ERROR, LS5000_OVERLAPPED_CMDS, }; enum ls5000_status { LS5000_STATUS_READY, LS5000_STATUS_BUSY, LS5000_STATUS_PROCESSING, LS5000_STATUS_ERROR, LS5000_STATUS_REISSUE, }; enum ls5000_option { LS5000_OPTION_NUM = 0, /* info options */ LS5000_OPTION_ADAPTER, /* actual settings */ LS5000_OPTION_NEGATIVE, LS5000_OPTION_PREVIEW, LS5000_OPTION_INFRARED, LS5000_OPTION_SCAN_MODE, LS5000_OPTION_EXPOSURE, LS5000_OPTION_EXPOSURE_R, LS5000_OPTION_EXPOSURE_G, LS5000_OPTION_EXPOSURE_B, LS5000_OPTION_SCAN_AE, LS5000_OPTION_SCAN_AE_WB, LS5000_OPTION_LUT_R, LS5000_OPTION_LUT_G, LS5000_OPTION_LUT_B, LS5000_OPTION_RES, LS5000_OPTION_FRAME, LS5000_OPTION_SUBFRAME, LS5000_OPTION_XMIN, LS5000_OPTION_XMAX, LS5000_OPTION_YMIN, LS5000_OPTION_YMAX, LS5000_OPTION_LOAD, LS5000_OPTION_EJECT, LS5000_OPTION_RESET, LS5000_OPTION_INQUIRE, LS5000_OPTION_FOCUS, LS5000_OPTION_AUTOFOCUS, LS5000_OPTION_FOCUS_ON_CENTRE, LS5000_OPTION_FOCUSX, LS5000_OPTION_FOCUSY, /* keep last */ LS5000_N_OPTIONS }; #define LS5000_CMD_INQUIRY 0x12 #define LS5000_CMD_TEST_UNIT_READY 0x00 #define LS5000_CMD_PHASE_CHECK 0xd0 #define LS5000_CMD_STATUS 0x06 #define LS5000_CMD_GET_WINDOW 0x25 #define LS5000_CMD_SET_WINDOW 0x24 #define LS5000_CMD_RESERVE_UNIT 0x16 #define LS5000_CMD_RELEASE_UNIT 0x17 #define LS5000_CMD_READ 0x28 #define LS5000_CMD_MODE_SELECT 0x15 #define LS5000_CMD_GET_PARAM 0xe1 #define LS5000_CMD_SET_PARAM 0xe0 #define LS5000_CMD_EXECUTE 0xc1 #define LS5000_CMD_SCAN 0x1b #define LS5000_CMD_SEND 0x2a #define LS5000_CMD_ABORT 0xc0 typedef unsigned int ls5000_pixel; struct ls5000 { int fd; SANE_Byte *recv_buf; size_t recv_buf_size; /* device characteristics */ char vendor_string[9], product_string[17], revision_string[5]; int maxbits; unsigned int res_optical, res_min, res_max, *res_list, res_n_list; unsigned long boundaryx, boundaryy; unsigned long frame_offset; unsigned int unit_dpi; double unit_mm; int n_frames; char adapter[50]; int focus_min, focus_max; /* settings */ SANE_Bool negative, infrared, preview, pinfrared, gray_scan; ls5000_pixel n_lut; ls5000_pixel *lut_r, *lut_g, *lut_b, *lut_neutral; unsigned long res; unsigned long xmin, xmax, ymin, ymax; int i_frame; double subframe; unsigned long real_xoffset, real_yoffset, real_width, real_height, logical_width, logical_height; double exposure, exposure_r, exposure_g, exposure_b; unsigned long real_exposure[4]; SANE_Bool focus_on_centre; unsigned long focusx, focusy; int focus; /* read block information */ int line_padding; size_t line_bytes, line; SANE_Byte *block, *ordered_block; size_t block_read_pos, ordered_block_size; SANE_Byte *ir_data; size_t ir_data_len; /* status */ enum ls5000_scan_stage scan_stage; unsigned long sense_key, sense_asc, sense_ascq, sense_info; int status; SANE_Bool must_read_now; /* SANE stuff */ SANE_Option_Descriptor option_list[LS5000_N_OPTIONS]; }; static SANE_Device **device_list = NULL; static int n_device_list = 0; static int open_devices = 0; /* command handling */ #define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0])) static enum ls5000_phase ls5000_phase_check(struct ls5000 *s) { static SANE_Byte phase_send_buf[1] = { LS5000_CMD_PHASE_CHECK }; SANE_Byte phase_recv_buf[1]; SANE_Status status = 0; size_t n = 1; static char *phases[] = { "NO", "STATUS IN", "DATA OUT", "DATA IN", "BUSY", }; char *phase = "UNKNOWN"; DBG(20, "PHASE_CHECK\n"); status = sanei_usb_write_bulk(s->fd, phase_send_buf, &n); status |= sanei_usb_read_bulk(s->fd, phase_recv_buf, &n); if (phase_recv_buf[0] < ARRAY_SIZE(phases)) phase = phases[phase_recv_buf[0]]; DBG(20, "PHASE_CHECK: %s (0x%02x)\n", phase, phase_recv_buf[0]); if (status) return -1; else return phase_recv_buf[0]; } static SANE_Status ls5000_parse_status(struct ls5000 *s) { if (s->sense_key == 0) DBG(20, "STATUS: GOOD\n\n"); else DBG(20, "STATUS: CHECK CONDITION, %02lx-%02lx-%02lx-%02lx\n\n", s->sense_key, s->sense_asc, s->sense_ascq, s->sense_info); if (s->sense_key == 0x09 && s->sense_asc == 0x80 && s->sense_ascq == 0x06 && (s->sense_info == 0 || s->sense_info == 1)) { s->status = LS5000_STATUS_REISSUE; return SANE_STATUS_GOOD; } if (s->sense_key == 0) { s->status = LS5000_STATUS_READY; return SANE_STATUS_GOOD; } s->status = LS5000_STATUS_ERROR; return SANE_STATUS_IO_ERROR; } static SANE_Status ls5000_check_status(struct ls5000 *s) { size_t n_status; static SANE_Byte status_buf[8]; DBG(20, "STATUS\n"); status_buf[0] = LS5000_CMD_STATUS; n_status = 1; sanei_usb_write_bulk(s->fd, status_buf, &n_status); n_status = 8; sanei_usb_read_bulk(s->fd, status_buf, &n_status); if (n_status != 8) { DBG(4, "ls5000_check_status: Failed to read 8" " status bytes from USB.\n"); return SANE_STATUS_IO_ERROR; } s->sense_key = status_buf[1] & 0x0f; s->sense_asc = status_buf[2] & 0xff; s->sense_ascq = status_buf[3] & 0xff; s->sense_info = status_buf[4] & 0xff; return ls5000_parse_status(s); } #define ls5000_issue_cmd(s, n_recv, bytes...) \ ({ SANE_Byte data[] = {bytes}; \ _ls5000_issue_cmd(s, n_recv, ARRAY_SIZE(data), data); \ }) static SANE_Status _ls5000_issue_cmd(struct ls5000 *s, int n_recv, size_t n_send, SANE_Byte *send_buf) { SANE_Status status = SANE_STATUS_INVAL; size_t n_cmd, n_written, i; int status_only = 0; char cmdbuf[10000]; char *cmd; int pos, l; switch (send_buf[0]) { case LS5000_CMD_TEST_UNIT_READY: cmd = "TEST_UNIT_READY"; break; case LS5000_CMD_PHASE_CHECK: cmd = "PHASE_CHECK"; break; case LS5000_CMD_INQUIRY: cmd = "INQUIRY"; break; case LS5000_CMD_STATUS: cmd = "STATUS"; break; case LS5000_CMD_GET_WINDOW: cmd = "GET_WINDOW"; break; case LS5000_CMD_SET_WINDOW: cmd = "SET_WINDOW"; break; case LS5000_CMD_RESERVE_UNIT: cmd = "RESERVE_UNIT"; break; case LS5000_CMD_RELEASE_UNIT: cmd = "RELEASE_UNIT"; break; case LS5000_CMD_READ: cmd = "READ"; break; case LS5000_CMD_MODE_SELECT: cmd = "MODE_SELECT"; break; case LS5000_CMD_GET_PARAM: cmd = "GET_PARAM"; break; case LS5000_CMD_SET_PARAM: cmd = "SET_PARAM"; break; case LS5000_CMD_EXECUTE: cmd = "EXECUTE"; break; case LS5000_CMD_SCAN: cmd = "SCAN"; break; case LS5000_CMD_ABORT: cmd = "ABORT"; break; case LS5000_CMD_SEND: cmd = "SEND"; break; default: snprintf(cmdbuf, sizeof(cmdbuf), "UNKNOWN_%.2x", send_buf[0]); cmd = cmdbuf; } DBG(20, "%s\n", cmd); s->status = LS5000_STATUS_READY; switch (send_buf[0]) { case LS5000_CMD_TEST_UNIT_READY: case LS5000_CMD_INQUIRY: case LS5000_CMD_MODE_SELECT: case LS5000_CMD_RESERVE_UNIT: case LS5000_CMD_RELEASE_UNIT: case 0x1a /*MODE SENSE*/: case LS5000_CMD_SCAN: case 0x1c /*RCVR DIAG RESULTS */: case 0x1d /*SEND DIAG */: case LS5000_CMD_ABORT: case LS5000_CMD_EXECUTE: n_cmd = 6; break; case LS5000_CMD_SET_WINDOW: case LS5000_CMD_GET_WINDOW: case LS5000_CMD_READ: case LS5000_CMD_SEND: case LS5000_CMD_SET_PARAM: case LS5000_CMD_GET_PARAM: n_cmd = 10; break; default: DBG(1, "BUG: ls5000_issue_cmd: Unknown" " command opcode 0x%02x.\n", send_buf[0]); break; } if (n_send < n_cmd) { DBG(1, "BUG: ls5000_issue_cmd: Not enough command bytes!\n"); return SANE_STATUS_INVAL; } if (n_recv != 0 && (n_send - n_cmd > 0)) { DBG(1, "BUG: ls5000_issue_cmd: Data in and out requested!\n"); return SANE_STATUS_INVAL; } if (n_recv > 0) { s->recv_buf = realloc(s->recv_buf, n_recv); if (!s->recv_buf) { DBG(1, "BUG: failed to alloc recv_buf\n"); return SANE_STATUS_NO_MEM; } } status = sanei_usb_write_bulk(s->fd, send_buf, &n_cmd); if (status != SANE_STATUS_GOOD) { DBG(1, "Error: ls5000_issue_cmd: Could not write command.\n"); return SANE_STATUS_IO_ERROR; } switch (ls5000_phase_check(s)) { case LS5000_PHASE_OUT: if (n_send - n_cmd == 0) { DBG(4, "Error: ls5000_issue_cmd: " "Unexpected data out phase.\n"); return SANE_STATUS_IO_ERROR; } n_written = n_send - n_cmd; status = sanei_usb_write_bulk(s->fd, send_buf + n_cmd, &n_written); if (n_written != n_send - n_cmd) { DBG(4, "Error: ls5000_issue_cmd: " "scanner only took %d bytes\n", n_written); return SANE_STATUS_IO_ERROR; } pos = 0; snprintf(cmdbuf, sizeof(cmdbuf), "%s_DATA:", cmd); l = strlen(cmdbuf); for (i = 0; i < n_written; i++) { snprintf(cmdbuf + l + pos, sizeof(cmdbuf) - pos, " %.2x", (send_buf + n_cmd)[i]); pos += 3; if (sizeof(cmdbuf) - pos > 3) { DBG(20, "the following data was truncated\n"); break; } } DBG(20, "%s\n", cmdbuf); break; case LS5000_PHASE_IN: if (n_recv == 0) { DBG(4, "Error: ls5000_issue_cmd: " "Unexpected data in phase.\n"); return SANE_STATUS_IO_ERROR; } if (n_recv < 0) return SANE_STATUS_DEVICE_BUSY; status = sanei_usb_read_bulk(s->fd, s->recv_buf, (size_t*) &n_recv); break; case LS5000_PHASE_NONE: DBG(4, "Error: ls5000_issue_cmd: No command received!\n"); return SANE_STATUS_IO_ERROR; default: if (n_recv) { DBG(4, "Error: ls5000_issue_cmd: " "Unexpected non-data phase.\n"); status_only = 1; } break; } status = ls5000_check_status(s); if (status_only) return SANE_STATUS_IO_ERROR; else return status; } static enum ls500O_unit_ready ls5000_get_status(struct ls5000 *s) { int status; /* issue_cmd fills the sense_key stuff from the STATUS reply */ ls5000_issue_cmd(s, 0, LS5000_CMD_TEST_UNIT_READY, 0, 0, 0, 0, 0); if (s->sense_key == 0) return LS5000_GOOD; if (s->sense_key == 6) return LS5000_UNIT_ATTENTION; status = (s->sense_key << 24) | (s->sense_asc << 16) | (s->sense_ascq << 8); /* not sense_info */ switch (status) { case 0x02040100: return LS5000_BECOMING_READY; case 0x02040200: return LS5000_MECHANICAL_ERROR; case 0x02040000: return LS5000_INITIALISATION_REQUIRED; case 0x02040300: return LS5000_ADAPTER_ERROR; case 0x02050000: return LS5000_NOT_RESPONDING; case 0x023a0000: return LS5000_NO_MEDIUM; case 0x052c0000: return LS5000_CMD_SEQ_ERR; case 0x0b4b0000: return LS5000_DATA_PHASE_ERROR; case 0x0b4e0000: return LS5000_OVERLAPPED_CMDS; default: return LS5000_ERROR; } } static SANE_Status ls5000_get_error(struct ls5000 *s) { int stat = ls5000_get_status(s); switch (stat) { case LS5000_GOOD: return SANE_STATUS_GOOD; case LS5000_NO_MEDIUM: return SANE_STATUS_NO_DOCS; case LS5000_MECHANICAL_ERROR: return SANE_STATUS_JAMMED; case LS5000_ADAPTER_ERROR: return SANE_STATUS_COVER_OPEN; case LS5000_BECOMING_READY: return SANE_STATUS_DEVICE_BUSY; default: return SANE_STATUS_IO_ERROR; } } static inline void order_values( unsigned long imin, unsigned long imax, unsigned long *min, unsigned long *max) { if (imin > imax) { *min = imax; *max = imin; } else { *min = imin; *max = imax; } } static void ls5000_convert_options(struct ls5000 *s) { int i_colour, pitch; unsigned long xmin, xmax, ymin, ymax; /* * The prefix "real_" refers to data in device units (1/maxdpi), * "logical_" refers to resolution-dependent data. */ pitch = s->res_max / s->res; order_values(s->xmin, s->xmax, &xmin, &xmax); order_values(s->ymin, s->ymax, &ymin, &ymax); s->real_xoffset = xmin; s->real_yoffset = ymin + (s->i_frame - 1) * s->frame_offset + s->subframe / s->unit_mm; s->logical_width = (xmax - xmin + 1) / pitch; s->logical_height = (ymax - ymin + 1) / pitch; s->real_width = s->logical_width * pitch; s->real_height = s->logical_height * pitch; s->real_exposure[0] = s->exposure * s->exposure_r * 100.; s->real_exposure[1] = s->exposure * s->exposure_g * 100.; s->real_exposure[2] = s->exposure * s->exposure_b * 100.; for (i_colour = 0; i_colour < 3; i_colour++) if (s->real_exposure[i_colour] < 1) s->real_exposure[i_colour] = 1; } static SANE_Status ls5000_execute(struct ls5000 *s) { return ls5000_issue_cmd(s, 0, LS5000_CMD_EXECUTE, 0, 0, 0, 0, 0); } static SANE_Status ls5000_eject(struct ls5000 *s) { SANE_Status status; DBG(20, "EJECT\n"); status = ls5000_issue_cmd(s, 0, LS5000_CMD_SET_PARAM, 0, /* LUN */ 0xd0, /* Operation "Unload object" */ 0, 0, 0, /* reserved */ 0, 0, 13, /* parameter length, must be 13 */ 0, /* ctrl */ 0,0,0,0,0,0,0,0,0,0,0,0,0 /* 13 dummy parameters */ ); if (status) return status; return ls5000_execute(s); } static SANE_Status ls5000_focus(struct ls5000 *s) { SANE_Status status; DBG(20, "FOCUS\n"); status = ls5000_issue_cmd(s, 0, LS5000_CMD_SET_PARAM, 0, /* LUN */ 0xc1, /* Operation "Focus move" */ 0, 0, 0, /* reserved */ 0, 0, 13, /* parameter length */ 0, /* ctrl */ 0, /* color (dummy) */ (s->focus >> 24) & 0xff, (s->focus >> 16) & 0xff, (s->focus >> 8) & 0xff, s->focus & 0xff, 0,0,0,0,0,0,0,0 /* rest dummy */); if (status) return status; return ls5000_execute(s); } static SANE_Status ls5000_autofocus(struct ls5000 *s) { SANE_Status status; int real_focusx, real_focusy, tmo = 15, stat; ls5000_convert_options(s); if (s->focus_on_centre) { real_focusx = s->real_xoffset + s->real_width / 2; real_focusy = s->real_yoffset + s->real_height / 2; } else { real_focusx = s->focusx; real_focusy = s->focusy + (s->i_frame - 1) * s->frame_offset + s->subframe / s->unit_mm; } DBG(20, "AUTOFOCUS\n"); status = ls5000_issue_cmd(s, 0, LS5000_CMD_SET_PARAM, 0, /* LUN */ 0xa0, /* Operation "autofocus" */ 0, 0, 0, /* reserved */ 0, 0, 13, /* parameter length */ 0, /* ctrl */ 0, /* color specification, ignored */ (real_focusx >> 24) & 0xff, (real_focusx >> 16) & 0xff, (real_focusx >> 8) & 0xff, real_focusx & 0xff, (real_focusy >> 24) & 0xff, (real_focusy >> 16) & 0xff, (real_focusy >> 8) & 0xff, real_focusy & 0xff, 0, 0, 0, 0); /* dummy */ if (status) return status; stat = ls5000_get_status(s); while (stat == LS5000_BECOMING_READY) { usleep(500000); stat = ls5000_get_status(s); if (!tmo--) return SANE_STATUS_IO_ERROR; } status = ls5000_execute(s); if (status) return status; status = ls5000_issue_cmd(s, 13, LS5000_CMD_GET_PARAM, 0, /* LUN */ 0xc1, /* Operation "Focus move" */ 0, 0, 0, /* reserved */ 0, 0, 13, /* parameter length */ 0 /* ctrl */); if (status) return status; s->focus = s->recv_buf[4] + 256 * (s->recv_buf[3] + 256 * (s->recv_buf[2] + 256 * s->recv_buf[1])); return SANE_STATUS_INVAL; } static SANE_Status ls5000_get_exposure(struct ls5000 *s) { SANE_Status status; int i_colour; for (i_colour = 0; i_colour < 3; i_colour++) { status = ls5000_issue_cmd(s, 58, LS5000_CMD_GET_WINDOW, 1, /* LUN, single = 1 */ 0, 0, 0, /* reserved */ i_colour + 1, /* window ID */ 0, 0, 58, /* transfer length */ 0); /* control */ if (status) return status; s->real_exposure[i_colour] = 65536 * (256 * s->recv_buf[54] + s->recv_buf[55]) + 256 * s->recv_buf[56] + s->recv_buf[57]; } return SANE_STATUS_GOOD; } static SANE_Status ls5000_scan(struct ls5000 *s, enum ls5000_scan type) { SANE_Status status; int i_colour, n_colour, window, stat, tmo = 15; unsigned char scan_kind, exp_b0, exp_b1, exp_b2, exp_b3; stat = ls5000_get_status(s); while (stat == LS5000_BECOMING_READY || stat == LS5000_UNIT_ATTENTION || stat == LS5000_CMD_SEQ_ERR) { usleep(500000); stat = ls5000_get_status(s); if (!tmo--) return SANE_STATUS_IO_ERROR; } status = ls5000_issue_cmd(s, 0, LS5000_CMD_MODE_SELECT, 0x10 /* PF=1 */, 0x00, 0x00, /* reserved */ 20, /* len */ 0, /* ctrl */ 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 1, 3, 6, 0, 0, (s->unit_dpi >> 8) & 0xff, (s->unit_dpi >> 0) & 0xff, 0, 0); if (status) return status; ls5000_convert_options(s); s->line_padding = 0; n_colour = 3 + !!s->infrared; if (s->gray_scan) n_colour = 1 + !!s->infrared; DBG(1, "n_colour = %d\n", n_colour); switch (type) { case LS5000_SCAN_NORMAL: scan_kind = 0x01; break; case LS5000_SCAN_AE: scan_kind = 0x20; break; case LS5000_SCAN_AE_WB: scan_kind = 0x40; break; /* thumbnail: 2, scanning setup: 4, scanning2 setup: 8 */ default: DBG(1, "BUG: ls5000_scan: Unknown scanning type.\n"); return SANE_STATUS_INVAL; } for (i_colour = 0; i_colour < n_colour; i_colour++) { /* if infrared requested set parameters for it first */ if (s->infrared && i_colour == 0) { /* automatic exposure for infrared */ exp_b0 = 0; exp_b1 = 0; exp_b2 = 0; exp_b3 = 0; window = 9; /* IR window */ } else { exp_b0 = (s->real_exposure[i_colour] >> 24) & 0xff; exp_b1 = (s->real_exposure[i_colour] >> 16) & 0xff; exp_b2 = (s->real_exposure[i_colour] >> 8) & 0xff; exp_b3 = s->real_exposure[i_colour] & 0xff; /* * Windows are 1,2,3, if infrared came first we don't * need to adjust */ window = i_colour + !s->infrared; } status = ls5000_issue_cmd(s, 0, LS5000_CMD_SET_WINDOW, 0, /* LUN */ 0, 0, 0, 0, /* reserved */ 0, 0, 58, /* transfer length */ 0x80, /* control */ 0, 0, 0, /* reserved */ 0, 0, 0, /* reserved */ 0, 50, /* window descriptor length */ window, /* window ID */ 0, /* reserved */ s->res >> 8, s->res & 0xff, /* X resolution */ s->res >> 8, s->res & 0xff, /* Y resolution */ (s->real_xoffset >> 24) & 0xff, (s->real_xoffset >> 16) & 0xff, (s->real_xoffset >> 8) & 0xff, s->real_xoffset & 0xff, /* Upper Left X offs */ (s->real_yoffset >> 24) & 0xff, (s->real_yoffset >> 16) & 0xff, (s->real_yoffset >> 8) & 0xff, s->real_yoffset & 0xff, /* Upper Left Y offs */ (s->real_width >> 24) & 0xff, (s->real_width >> 16) & 0xff, (s->real_width >> 8) & 0xff, s->real_width & 0xff, /* Window width */ (s->real_height >> 24) & 0xff, (s->real_height >> 16) & 0xff, (s->real_height >> 8) & 0xff, s->real_height & 0xff, /* Window height */ 0, /* brightness */ 0, /* threshold */ 0, /* contrast */ /* image composition: rgb or gray */ s->gray_scan ? 2 : 5, 16, /* pixel composition */ 0, 0, /* halftone pattern */ 0, /* reserved, padding type */ 0, 0, /* bit ordering */ 0, 0, /* compression type, args */ 0, 0, 0, 0, 0, 0, /* reserved */ 0, /* multiread, color ordering */ /* averaging (top 4 bits), pos/neg (bit 0) */ 0 | (s->negative ? 0 : 1), scan_kind, /* scanning kind */ 0x02, /* scanning mode (normal) */ /* colour interleaving (line-interleaving) */ 0x02, 0xff, /* auto exposure target */ exp_b0, exp_b1, exp_b2, exp_b3); /* exposure (32-bit value) */ if (status) return status; } status = ls5000_focus(s); if (status) return status; scan: switch (n_colour) { case 1: status = ls5000_issue_cmd(s, 0, LS5000_CMD_SCAN, 0, /* LUN */ 0, 0, /* reserved */ 1, /* transfer len (#windows) */ 0, /* control */ 1); /* windows: red */ break; case 2: status = ls5000_issue_cmd(s, 0, LS5000_CMD_SCAN, 0, /* LUN */ 0, 0, /* reserved */ 2, /* transfer length (#windows) */ 0, /* control */ 1, 9); /* windows: red,ir */ break; case 3: status = ls5000_issue_cmd(s, 0, LS5000_CMD_SCAN, 0, /* LUN */ 0, 0, /* reserved */ 3, /* transfer len (#windows) */ 0, /* control */ 1, 2, 3); /* windows: red,green,blue */ break; case 4: status = ls5000_issue_cmd(s, 0, LS5000_CMD_SCAN, 0, /* LUN */ 0, 0, /* reserved */ 4, /* transfer len (#windows) */ 0, /* control */ 1, 2, 3, 9); /* windows: red,green,blue,ir */ break; default: DBG(1, "BUG: ls5000_scan: " "Unknown number of input colours (%d).\n", n_colour); break; } if (s->status == LS5000_STATUS_REISSUE) { status = ls5000_issue_cmd(s, 6, LS5000_CMD_READ, 0, /* LUN */ 0x87, /* Initiator cooperative action parameter */ 0, /* reserved */ 0, 0, /* data type qualifier */ 0, 0, 6, /* transfer length */ 0x80); /* control */ if (status) return status; /* * received data is now * byte 0: data type code * 1: data item bits * 2-5: data len */ status = ls5000_issue_cmd(s, s->recv_buf[5] + 6, LS5000_CMD_READ, 0, /* LUN */ 0x87, /* Initiator cooperative action parameter */ 0, /* reserved */ 0, 0, /* data type qualifier */ 0, 0, s->recv_buf[5] + 6, /* transfer length */ 0x80); /* control */ if (status) return status; /* * received data is now * byte 0: data type code * 1: data item bits * 2-5: data len * 6-: data */ if ((s->recv_buf[11] != 0x08) || (s->recv_buf[12] != 0x00)) DBG(1, "BUG: ls5000_scan: " "Unexpected line_padding position.\n"); s->line_padding = 256 * s->recv_buf[19] + s->recv_buf[20]; goto scan; } tmo = 15; stat = ls5000_get_status(s); while (stat == LS5000_BECOMING_READY || stat == LS5000_UNIT_ATTENTION || stat == LS5000_CMD_SEQ_ERR) { usleep(500000); stat = ls5000_get_status(s); if (!tmo--) return SANE_STATUS_IO_ERROR; } return ls5000_get_error(s); } /* use page == -1 to query evpd 0/page 0 */ static SANE_Status ls5000_page_inquiry(struct ls5000 *s, int page) { SANE_Status status; size_t len; char evpd = 0; if (page >= 0) { /* check length of requested page */ evpd = 1; status = ls5000_issue_cmd(s, 4, LS5000_CMD_INQUIRY, evpd, /* EVPD */ page, /* page code */ 0, /* reserved */ 4, /* size */ 0); /* control */ if (status) { DBG(4, "Error: ls5000_page_inquiry: " "retrieving size of page 0x%x failed: %s.\n", page, sane_strstatus(status)); return status; } /* the required length is at byte 3 (w/o header len) */ len = s->recv_buf[3] + 4; } else { /* * the only page with evpd (vital product data) == 0 is 0, * it always has length 36 */ len = 36; evpd = 0; page = 0; } status = ls5000_issue_cmd(s, len, LS5000_CMD_INQUIRY, evpd, /* EVPD */ page, /* page code */ 0, /* reserved */ len, /* size */ 0); /* control */ if (status) { DBG(4, "Error: ls5000_page_inquiry failed: %s.\n", sane_strstatus(status)); return status; } return SANE_STATUS_GOOD; } static void ls5000_close(struct ls5000 *s) { free(s->lut_r); free(s->lut_g); free(s->lut_b); free(s->lut_neutral); free(s->ir_data); sanei_usb_close(s->fd); open_devices--; free(s); } static SANE_Status ls5000_open(const char *device, struct ls5000 **sp) { SANE_Status status; struct ls5000 *s; char *line; SANE_Device **device_list_new; s = malloc(sizeof(struct ls5000)); if (!s) return SANE_STATUS_NO_MEM; memset(s, 0, sizeof(struct ls5000)); status = sanei_usb_open(device, &s->fd); if (status) { free(s); return status; } open_devices++; /* identify scanner */ status = ls5000_page_inquiry(s, -1); if (status) { DBG(4, "Error: ls5000_open: failed to get page 0: %s.\n", sane_strstatus(status)); ls5000_close(s); return status; } strncpy(s->vendor_string, (char*)s->recv_buf + 8, 8); s->vendor_string[8] = '\0'; strncpy(s->product_string, (char*)s->recv_buf + 16, 16); s->product_string[16] = '\0'; strncpy(s->revision_string, (char*)s->recv_buf + 32, 4); s->revision_string[4] = '\0'; DBG(10, "ls5000_open: Inquiry: vendor = '%s', " "product = '%s', revision = '%s'.\n", s->vendor_string, s->product_string, s->revision_string); if (strncmp(s->product_string, "LS-5000 ED ", 16) != 0) { ls5000_close(s); return SANE_STATUS_UNSUPPORTED; } if (sp) { *sp = s; return SANE_STATUS_GOOD; } device_list_new = realloc(device_list, (n_device_list + 2) * sizeof(SANE_Device *)); if (!device_list_new) return SANE_STATUS_NO_MEM; device_list = device_list_new; device_list[n_device_list] = malloc(sizeof(SANE_Device)); if (!device_list[n_device_list]) return SANE_STATUS_NO_MEM; line = malloc(strlen(device) + 1); if (!line) goto error; strcpy(line, device); device_list[n_device_list]->name = line; line = malloc(strlen(s->vendor_string) + 1); if (!line) goto error; strcpy(line, s->vendor_string); device_list[n_device_list]->vendor = line; line = malloc(strlen(s->product_string) + 1); if (!line) goto error; strcpy(line, s->product_string); device_list[n_device_list]->model = line; device_list[n_device_list]->type = "film scanner"; n_device_list++; device_list[n_device_list] = NULL; ls5000_close(s); return SANE_STATUS_GOOD; error: free(device_list[n_device_list]->name); free(device_list[n_device_list]->vendor); free(device_list[n_device_list]->model); free(device_list[n_device_list]); return SANE_STATUS_NO_MEM; } static SANE_Status ls5000_full_inquiry(struct ls5000 *s) { SANE_Status status; int pitch, pitch_max; size_t asciilen; ls5000_pixel pixel; status = ls5000_page_inquiry(s, 0xc1); if (status) return status; s->maxbits = s->recv_buf[82]; s->n_lut = 1; s->n_lut <<= s->maxbits; if (s->n_lut > 1) { s->lut_r = realloc(s->lut_r, s->n_lut * sizeof(ls5000_pixel)); s->lut_g = realloc(s->lut_g, s->n_lut * sizeof(ls5000_pixel)); s->lut_b = realloc(s->lut_b, s->n_lut * sizeof(ls5000_pixel)); s->lut_neutral = realloc(s->lut_neutral, s->n_lut * sizeof(ls5000_pixel)); if (!s->lut_r || !s->lut_g || !s->lut_b || !s->lut_neutral) { free(s->lut_r); free(s->lut_g); free(s->lut_b); free(s->lut_neutral); return SANE_STATUS_NO_MEM; } for (pixel = 0; pixel < s->n_lut; pixel++) { s->lut_r[pixel] = pixel; s->lut_g[pixel] = pixel; s->lut_b[pixel] = pixel; s->lut_neutral[pixel] = pixel; } } else { free(s->lut_r); free(s->lut_g); free(s->lut_b); free(s->lut_neutral); s->lut_r = NULL; s->lut_g = NULL; s->lut_b = NULL; s->lut_neutral = NULL; } s->res_optical = 256 * s->recv_buf[18] + s->recv_buf[19]; s->res_max = 256 * s->recv_buf[20] + s->recv_buf[21]; s->res_min = 256 * s->recv_buf[22] + s->recv_buf[23]; s->boundaryx = 65536 * (256 * s->recv_buf[36] + s->recv_buf[37]) + 256 * s->recv_buf[38] + s->recv_buf[39]; s->boundaryy = 65536 * (256 * s->recv_buf[58] + s->recv_buf[59]) + 256 * s->recv_buf[60] + s->recv_buf[61]; s->focus_min = 256 * s->recv_buf[76] + s->recv_buf[77]; s->focus_max = 256 * s->recv_buf[78] + s->recv_buf[79]; s->n_frames = s->recv_buf[75]; /* XXX */ s->frame_offset = s->res_max * 1.5 + 1; /* generate resolution list */ s->res_n_list = pitch_max = floor(s->res_max / (double)s->res_min); s->res_list = realloc(s->res_list, pitch_max * sizeof(unsigned int)); for (pitch = 1; pitch <= pitch_max; pitch++) s->res_list[pitch - 1] = s->res_max / pitch; s->unit_dpi = s->res_max; s->unit_mm = 25.4 / s->unit_dpi; /* get adapter information */ status = ls5000_page_inquiry(s, 1); if (status) { strncpy(s->adapter, "(none)", sizeof(s->adapter) - 1); return SANE_STATUS_GOOD; } asciilen = s->recv_buf[4]; if (asciilen > sizeof(s->adapter) - 1) asciilen = sizeof(s->adapter) - 1; strncpy(s->adapter, (char*)s->recv_buf + 5, asciilen); /* This doesn't seem to work as documented, I get "Mount" in the second string as well. if (strcmp(s->adapter, "Mount") == 0) { DBG(10, "mount adapter\n"); status = ls5000_page_inquiry(s, 0x10); if (status) return SANE_STATUS_GOOD; asciilen = s->recv_buf[4]; snprintf(s->adapter, sizeof(s->adapter), "Mount: %*s", asciilen-1, (char*)s->recv_buf + 5); } */ return SANE_STATUS_GOOD; } static SANE_Status ls5000_load(struct ls5000 *s) { SANE_Status status; DBG(20, "LOAD\n"); status = ls5000_issue_cmd(s, 0, LS5000_CMD_SET_PARAM, 0, /* LUN */ 0xd1, /* Operation "Load object" */ 0, 0, 0, /* reserved */ 0, 0, 13, /* parameter length */ 0, /* ctrl */ 0,0,0,0,0,0,0,0,0,0,0,0,0 /* dummy parameters */ ); if (status) return status; return ls5000_execute(s); } static SANE_Status ls5000_reset(struct ls5000 *s) { SANE_Status status; DBG(20, "RESET\n"); status = ls5000_issue_cmd(s, 0, LS5000_CMD_SET_PARAM, 0, /* LUN */ 0x80, /* Operation "Initialize" */ 0, 0, 0, /* reserved */ 0, 0, 13, /* parameter length */ 0, /* ctrl */ 0,0,0,0,0,0,0,0,0,0,0,0,0 /* dummy parameters */ ); if (status) return status; status = ls5000_execute(s); if (status) return status; return ls5000_full_inquiry(s); } /* SANE entry points */ SANE_Status sane_ls5000_init(SANE_Int * version_code, SANE_Auth_Callback authorize) { (void)authorize; /* shut up compiler */ DBG_INIT(); if (version_code) /* XXX V_MAJOR, V_MINOR */ *version_code = SANE_VERSION_CODE(1, 0, 0); sanei_usb_init(); return SANE_STATUS_GOOD; } void sane_ls5000_exit(void) { int i; for (i = 0; i < n_device_list; i++) { free(device_list[i]->name); free(device_list[i]->vendor); free(device_list[i]->model); free(device_list[i]); } free(device_list); } /* just a tiny helper */ static SANE_Status ls5000_attach(const char *dev) { return ls5000_open(dev, NULL); } SANE_Status sane_ls5000_get_devices(const SANE_Device ***list, SANE_Bool local_only) { (void)local_only; /* shut up compiler */ if (device_list) { *list = (const SANE_Device **)device_list; return SANE_STATUS_GOOD; } if (open_devices) return SANE_STATUS_IO_ERROR; sanei_usb_attach_matching_devices("usb 0x04b0 0x4002", ls5000_attach); *list = (const SANE_Device **)device_list; return SANE_STATUS_GOOD; } SANE_Status sane_ls5000_open(SANE_String_Const name, SANE_Handle *h) { SANE_Status status; struct ls5000 *s; int i_option; unsigned int i_list; SANE_Option_Descriptor o; SANE_Word *word_list = NULL; SANE_Range *range = NULL; SANE_String_Const *str_list; status = ls5000_open(name, &s); if (status) return status; *h = (SANE_Handle) s; /* get device properties */ s->lut_r = s->lut_g = s->lut_b = s->lut_neutral = NULL; s->res_list = NULL; s->res_n_list = 0; status = ls5000_full_inquiry(s); if (status) return status; /* option descriptors */ for (i_option = 0; i_option < LS5000_N_OPTIONS; i_option++) { memset(&o, 0, sizeof(o)); switch (i_option) { case LS5000_OPTION_NUM: o.name = ""; o.title = SANE_TITLE_NUM_OPTIONS; o.desc = SANE_DESC_NUM_OPTIONS; o.type = SANE_TYPE_INT; o.size = sizeof(SANE_Word); o.cap = SANE_CAP_SOFT_DETECT; break; case LS5000_OPTION_ADAPTER: o.name = SANE_NAME_SCAN_SOURCE; o.title = SANE_TITLE_SCAN_SOURCE; o.desc = SANE_DESC_SCAN_SOURCE; o.type = SANE_TYPE_STRING; o.size = sizeof(s->adapter); o.cap = SANE_CAP_SOFT_DETECT; o.constraint_type = SANE_CONSTRAINT_NONE; break; case LS5000_OPTION_PREVIEW: o.name = SANE_NAME_PREVIEW; o.title = SANE_TITLE_PREVIEW; o.desc = SANE_DESC_PREVIEW; o.type = SANE_TYPE_BOOL; o.size = sizeof(SANE_Word); o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; o.constraint_type = SANE_CONSTRAINT_NONE; break; case LS5000_OPTION_NEGATIVE: o.name = "negative"; o.title = "Negative"; o.desc = "Negative film: make scanner invert colours"; o.type = SANE_TYPE_BOOL; o.size = sizeof(SANE_Word); o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT | SANE_CAP_INACTIVE; break; case LS5000_OPTION_INFRARED: o.name = "infrared"; o.title = "Read infrared channel"; o.desc = "Read infrared channel as second image"; o.type = SANE_TYPE_BOOL; o.size = sizeof(SANE_Word); o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; break; case LS5000_OPTION_SCAN_MODE: o.name = SANE_NAME_SCAN_MODE; o.title = SANE_TITLE_SCAN_MODE; o.desc = SANE_DESC_SCAN_MODE; o.type = SANE_TYPE_STRING; o.size = 100; o.constraint_type = SANE_CONSTRAINT_STRING_LIST; str_list = calloc(3, sizeof(char *)); if (!str_list) goto error; str_list[0] = SANE_VALUE_SCAN_MODE_COLOR; str_list[1] = SANE_VALUE_SCAN_MODE_GRAY; o.constraint.string_list = str_list; o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; break; case LS5000_OPTION_EXPOSURE: o.name = "exposure"; o.title = "Exposure multiplier"; o.desc = "Exposure multiplier for all channels"; o.type = SANE_TYPE_FIXED; o.unit = SANE_UNIT_NONE; o.size = sizeof(SANE_Word); o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; o.constraint_type = SANE_CONSTRAINT_RANGE; range = malloc(sizeof(SANE_Range)); if (!range) goto error; range->min = SANE_FIX(0.); range->max = SANE_FIX(10.); range->quant = SANE_FIX(0.1); o.constraint.range = range; break; case LS5000_OPTION_EXPOSURE_R: o.name = SANE_NAME_SCAN_EXPOS_TIME_R; o.title = SANE_TITLE_SCAN_EXPOS_TIME_R; o.desc = SANE_DESC_SCAN_EXPOS_TIME_R; o.type = SANE_TYPE_FIXED; o.unit = SANE_UNIT_MICROSECOND; o.size = sizeof(SANE_Word); o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; o.constraint_type = SANE_CONSTRAINT_RANGE; range = malloc(sizeof(SANE_Range)); if (!range) goto error; range->min = SANE_FIX(50.); range->max = SANE_FIX(20000.); range->quant = SANE_FIX(10.); o.constraint.range = range; break; case LS5000_OPTION_EXPOSURE_G: o.name = SANE_NAME_SCAN_EXPOS_TIME_G; o.title = SANE_TITLE_SCAN_EXPOS_TIME_G; o.desc = SANE_DESC_SCAN_EXPOS_TIME_G; o.type = SANE_TYPE_FIXED; o.unit = SANE_UNIT_MICROSECOND; o.size = sizeof(SANE_Word); o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; o.constraint_type = SANE_CONSTRAINT_RANGE; range = malloc(sizeof(SANE_Range)); if (!range) goto error; range->min = SANE_FIX(50.); range->max = SANE_FIX(20000.); range->quant = SANE_FIX(10.); o.constraint.range = range; break; case LS5000_OPTION_EXPOSURE_B: o.name = SANE_NAME_SCAN_EXPOS_TIME_B; o.title = SANE_TITLE_SCAN_EXPOS_TIME_B; o.desc = SANE_DESC_SCAN_EXPOS_TIME_B; o.type = SANE_TYPE_FIXED; o.unit = SANE_UNIT_MICROSECOND; o.size = sizeof(SANE_Word); o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; o.constraint_type = SANE_CONSTRAINT_RANGE; range = malloc(sizeof(SANE_Range)); if (!range) goto error; range->min = SANE_FIX(50.); range->max = SANE_FIX(20000.); range->quant = SANE_FIX(10.); o.constraint.range = range; break; case LS5000_OPTION_LUT_R: o.name = SANE_NAME_GAMMA_VECTOR_R; o.title = SANE_TITLE_GAMMA_VECTOR_R; o.desc = SANE_DESC_GAMMA_VECTOR_R; o.type = SANE_TYPE_INT; o.size = s->n_lut * sizeof(SANE_Word); o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; o.constraint_type = SANE_CONSTRAINT_RANGE; range = malloc(sizeof(SANE_Range)); if (!range) goto error; range->min = 0; range->max = s->n_lut - 1; range->quant = 1; o.constraint.range = range; break; case LS5000_OPTION_LUT_G: o.name = SANE_NAME_GAMMA_VECTOR_G; o.title = SANE_TITLE_GAMMA_VECTOR_G; o.desc = SANE_DESC_GAMMA_VECTOR_G; o.type = SANE_TYPE_INT; o.size = s->n_lut * sizeof(SANE_Word); o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; o.constraint_type = SANE_CONSTRAINT_RANGE; range = malloc(sizeof(SANE_Range)); if (!range) goto error; range->min = 0; range->max = s->n_lut - 1; range->quant = 1; o.constraint.range = range; break; case LS5000_OPTION_LUT_B: o.name = SANE_NAME_GAMMA_VECTOR_B; o.title = SANE_TITLE_GAMMA_VECTOR_B; o.desc = SANE_DESC_GAMMA_VECTOR_B; o.type = SANE_TYPE_INT; o.size = s->n_lut * sizeof(SANE_Word); o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; o.constraint_type = SANE_CONSTRAINT_RANGE; range = malloc(sizeof(SANE_Range)); if (!range) goto error; range->min = 0; range->max = s->n_lut - 1; range->quant = 1; o.constraint.range = range; break; case LS5000_OPTION_LOAD: o.name = "load"; o.title = "Load"; o.desc = "Load next slide"; o.type = SANE_TYPE_BUTTON; o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; break; case LS5000_OPTION_EJECT: o.name = "eject"; o.title = "Eject"; o.desc = "Eject loaded medium"; o.type = SANE_TYPE_BUTTON; o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; break; case LS5000_OPTION_RESET: o.name = "reset"; o.title = "Reset scanner"; o.desc = "Initialize scanner"; o.type = SANE_TYPE_BUTTON; o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; break; case LS5000_OPTION_INQUIRE: o.name = "inquire"; o.title = "Inquire scanner"; o.desc = "Inquire scanner status " "(attached adapter etc.)"; o.type = SANE_TYPE_BUTTON; o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; break; case LS5000_OPTION_RES: o.name = SANE_NAME_SCAN_RESOLUTION; o.title = SANE_TITLE_SCAN_RESOLUTION; o.desc = SANE_DESC_SCAN_RESOLUTION; o.type = SANE_TYPE_INT; o.unit = SANE_UNIT_DPI; o.size = sizeof(SANE_Word); o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; o.constraint_type = SANE_CONSTRAINT_WORD_LIST; word_list = calloc(s->res_n_list + 1, sizeof(SANE_Word)); if (!word_list) goto error; for (i_list = 0; i_list < s->res_n_list; i_list++) word_list[i_list + 1] = s->res_list[i_list]; word_list[0] = s->res_n_list; o.constraint.word_list = word_list; break; case LS5000_OPTION_FRAME: o.name = "frame"; o.title = "Frame number"; o.desc = "Number of frame to be scanned"; o.type = SANE_TYPE_INT; o.unit = SANE_UNIT_NONE; o.size = sizeof(SANE_Word); o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; if (s->n_frames <= 1) o.cap |= SANE_CAP_INACTIVE; else o.cap &= ~SANE_CAP_INACTIVE; o.constraint_type = SANE_CONSTRAINT_RANGE; range = malloc(sizeof(SANE_Range)); if (!range) goto error; range->min = 1; range->max = s->n_frames; range->quant = 1; o.constraint.range = range; break; case LS5000_OPTION_SUBFRAME: o.name = "subframe"; o.title = "Frame shift"; o.desc = "Fine position within the selected frame"; o.type = SANE_TYPE_FIXED; o.unit = SANE_UNIT_MM; o.size = sizeof(SANE_Word); o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; o.constraint_type = SANE_CONSTRAINT_RANGE; range = malloc(sizeof(SANE_Range)); if (!range) goto error; range->min = SANE_FIX(0.); range->max = SANE_FIX((s->boundaryy - 1) * s->unit_mm); range->quant = SANE_FIX(0.); o.constraint.range = range; break; case LS5000_OPTION_XMIN: o.name = SANE_NAME_SCAN_TL_X; o.title = SANE_TITLE_SCAN_TL_X; o.desc = SANE_DESC_SCAN_TL_X; o.type = SANE_TYPE_INT; o.unit = SANE_UNIT_PIXEL; o.size = sizeof(SANE_Word); o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; o.constraint_type = SANE_CONSTRAINT_RANGE; if (!range) goto error; range = (SANE_Range *) malloc(sizeof(SANE_Range)); range->min = 0; range->max = s->boundaryx - 1; range->quant = 1; o.constraint.range = range; break; case LS5000_OPTION_XMAX: o.name = SANE_NAME_SCAN_BR_X; o.title = SANE_TITLE_SCAN_BR_X; o.desc = SANE_DESC_SCAN_BR_X; o.type = SANE_TYPE_INT; o.unit = SANE_UNIT_PIXEL; o.size = sizeof(SANE_Word); o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; o.constraint_type = SANE_CONSTRAINT_RANGE; range = malloc(sizeof(SANE_Range)); if (!range) goto error; range->min = 0; range->max = s->boundaryx - 1; range->quant = 1; o.constraint.range = range; break; case LS5000_OPTION_YMIN: o.name = SANE_NAME_SCAN_TL_Y; o.title = SANE_TITLE_SCAN_TL_Y; o.desc = SANE_DESC_SCAN_TL_Y; o.type = SANE_TYPE_INT; o.unit = SANE_UNIT_PIXEL; o.size = sizeof(SANE_Word); o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; o.constraint_type = SANE_CONSTRAINT_RANGE; range = malloc(sizeof(SANE_Range)); if (!range) goto error; range->min = 0; range->max = s->boundaryy - 1; range->quant = 1; o.constraint.range = range; break; case LS5000_OPTION_YMAX: o.name = SANE_NAME_SCAN_BR_Y; o.title = SANE_TITLE_SCAN_BR_Y; o.desc = SANE_DESC_SCAN_BR_Y; o.type = SANE_TYPE_INT; o.unit = SANE_UNIT_PIXEL; o.size = sizeof(SANE_Word); o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; o.constraint_type = SANE_CONSTRAINT_RANGE; range = malloc(sizeof(SANE_Range)); if (!range) goto error; range->min = 0; range->max = s->boundaryy - 1; range->quant = 1; o.constraint.range = range; break; case LS5000_OPTION_FOCUS_ON_CENTRE: o.name = "focus-on-centre"; o.title = "Use centre of scan area as AF point"; o.desc = "Use centre of scan area as AF point " "instead of manual AF point selection"; o.type = SANE_TYPE_BOOL; o.size = sizeof(SANE_Word); o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; break; case LS5000_OPTION_FOCUS: o.name = "focus"; o.title = "Focus position"; o.desc = "Focus position for manual focus"; o.type = SANE_TYPE_INT; o.unit = SANE_UNIT_NONE; o.size = sizeof(SANE_Word); o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; o.constraint_type = SANE_CONSTRAINT_RANGE; range = malloc(sizeof(SANE_Range)); if (!range) goto error; range->min = s->focus_min; range->max = s->focus_max; range->quant = 1; o.constraint.range = range; break; case LS5000_OPTION_AUTOFOCUS: o.name = "autofocus"; o.title = "Autofocus now"; o.desc = "Autofocus now"; o.type = SANE_TYPE_BUTTON; o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; break; case LS5000_OPTION_FOCUSX: o.name = "focusx"; o.title = "X coordinate of AF point"; o.desc = "X coordinate of AF point"; o.type = SANE_TYPE_INT; o.unit = SANE_UNIT_PIXEL; o.size = sizeof(SANE_Word); o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT | SANE_CAP_INACTIVE; o.constraint_type = SANE_CONSTRAINT_RANGE; range = malloc(sizeof(SANE_Range)); if (!range) goto error; range->min = 0; range->max = s->boundaryx - 1; range->quant = 1; o.constraint.range = range; break; case LS5000_OPTION_FOCUSY: o.name = "focusy"; o.title = "Y coordinate of AF point"; o.desc = "Y coordinate of AF point"; o.type = SANE_TYPE_INT; o.unit = SANE_UNIT_PIXEL; o.size = sizeof(SANE_Word); o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT | SANE_CAP_INACTIVE; o.constraint_type = SANE_CONSTRAINT_RANGE; range = malloc(sizeof(SANE_Range)); if (!range) goto error; range->min = 0; range->max = s->boundaryy - 1; range->quant = 1; o.constraint.range = range; break; case LS5000_OPTION_SCAN_AE: o.name = "ae"; o.title = "Auto-exposure scan now"; o.desc = "Perform auto-exposure scan"; o.type = SANE_TYPE_BUTTON; o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; break; case LS5000_OPTION_SCAN_AE_WB: o.name = "ae-wb"; o.title = "Auto-exposure scan with white balance now"; o.desc = "Perform auto-exposure scan " "with white balance"; o.type = SANE_TYPE_BUTTON; o.cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; break; } s->option_list[i_option] = o; } s->scan_stage = LS5000_SCAN_STAGE_IDLE; s->negative = SANE_FALSE; s->infrared = SANE_FALSE; s->pinfrared = SANE_FALSE; s->gray_scan = SANE_FALSE; s->preview = SANE_FALSE; s->i_frame = 1; s->subframe = 0.; s->res = s->res_max; s->xmin = 0; s->xmax = s->boundaryx - 1; s->ymin = 0; s->ymax = s->boundaryy - 1; s->focus_on_centre = SANE_TRUE; s->focus = 0; s->focusx = 0; s->focusy = 0; s->exposure = 1.; s->exposure_r = 1200.; s->exposure_g = 1200.; s->exposure_b = 1000.; return SANE_STATUS_GOOD; error: ls5000_close(s); return SANE_STATUS_NO_MEM; } void sane_ls5000_close(SANE_Handle h) { struct ls5000 *s = (struct ls5000 *) h; ls5000_close(s); } const SANE_Option_Descriptor * sane_ls5000_get_option_descriptor(SANE_Handle h, SANE_Int n) { struct ls5000 *s = (struct ls5000 *) h; if ((n >= 0) && (n < LS5000_N_OPTIONS)) return &s->option_list[n]; else return NULL; } static SANE_Status ls5000_get_option_value(struct ls5000 *s, SANE_Int option, void *v) { ls5000_pixel pixel; switch (option) { case LS5000_OPTION_NUM: *(SANE_Word *) v = LS5000_N_OPTIONS; break; case LS5000_OPTION_ADAPTER: strcpy(v, s->adapter); break; case LS5000_OPTION_PREVIEW: *(SANE_Word *) v = s->preview; break; case LS5000_OPTION_NEGATIVE: *(SANE_Word *) v = s->negative; break; case LS5000_OPTION_INFRARED: *(SANE_Word *) v = s->pinfrared; break; case LS5000_OPTION_SCAN_MODE: if (s->gray_scan) strcpy(v, SANE_VALUE_SCAN_MODE_GRAY); else strcpy(v, SANE_VALUE_SCAN_MODE_COLOR); break; case LS5000_OPTION_EXPOSURE: *(SANE_Word *) v = SANE_FIX(s->exposure); break; case LS5000_OPTION_EXPOSURE_R: *(SANE_Word *) v = SANE_FIX(s->exposure_r); break; case LS5000_OPTION_EXPOSURE_G: *(SANE_Word *) v = SANE_FIX(s->exposure_g); break; case LS5000_OPTION_EXPOSURE_B: *(SANE_Word *) v = SANE_FIX(s->exposure_b); break; case LS5000_OPTION_LUT_R: if (!(s->lut_r)) return SANE_STATUS_INVAL; for (pixel = 0; pixel < s->n_lut; pixel++) ((SANE_Word *) v)[pixel] = s->lut_r[pixel]; break; case LS5000_OPTION_LUT_G: if (!(s->lut_g)) return SANE_STATUS_INVAL; for (pixel = 0; pixel < s->n_lut; pixel++) ((SANE_Word *) v)[pixel] = s->lut_g[pixel]; break; case LS5000_OPTION_LUT_B: if (!(s->lut_b)) return SANE_STATUS_INVAL; for (pixel = 0; pixel < s->n_lut; pixel++) ((SANE_Word *) v)[pixel] = s->lut_b[pixel]; break; case LS5000_OPTION_EJECT: break; case LS5000_OPTION_LOAD: break; case LS5000_OPTION_RESET: break; case LS5000_OPTION_INQUIRE: break; case LS5000_OPTION_FRAME: *(SANE_Word *) v = s->i_frame; break; case LS5000_OPTION_SUBFRAME: *(SANE_Word *) v = SANE_FIX(s->subframe); break; case LS5000_OPTION_RES: *(SANE_Word *) v = s->res; break; case LS5000_OPTION_XMIN: *(SANE_Word *) v = s->xmin; break; case LS5000_OPTION_XMAX: *(SANE_Word *) v = s->xmax; break; case LS5000_OPTION_YMIN: *(SANE_Word *) v = s->ymin; break; case LS5000_OPTION_YMAX: *(SANE_Word *) v = s->ymax; break; case LS5000_OPTION_FOCUS_ON_CENTRE: *(SANE_Word *) v = s->focus_on_centre; break; case LS5000_OPTION_FOCUS: *(SANE_Word *) v = s->focus; break; case LS5000_OPTION_AUTOFOCUS: break; case LS5000_OPTION_FOCUSX: *(SANE_Word *) v = s->focusx; break; case LS5000_OPTION_FOCUSY: *(SANE_Word *) v = s->focusy; break; case LS5000_OPTION_SCAN_AE: break; case LS5000_OPTION_SCAN_AE_WB: break; } return SANE_STATUS_GOOD; } static SANE_Status ls5000_set_option_value(struct ls5000 *s, SANE_Int option, void *v, int *flags) { ls5000_pixel pixel; SANE_Option_Descriptor o = s->option_list[option]; SANE_Status status = SANE_STATUS_GOOD; if (s->scan_stage != LS5000_SCAN_STAGE_IDLE) return SANE_STATUS_INVAL; /* XXX do this for all elements of arrays */ switch (o.type) { case SANE_TYPE_BOOL: if (!v) return SANE_STATUS_INVAL; if ((*(SANE_Word *) v != SANE_TRUE) && (*(SANE_Word *) v != SANE_FALSE)) return SANE_STATUS_INVAL; break; case SANE_TYPE_INT: case SANE_TYPE_FIXED: if (!v) return SANE_STATUS_INVAL; switch (o.constraint_type) { case SANE_CONSTRAINT_RANGE: if (*(SANE_Word *) v < o.constraint.range->min) { *(SANE_Word *) v = o.constraint.range->min; *flags |= SANE_INFO_INEXACT; } else if (*(SANE_Word *) v > o.constraint.range->max) { *(SANE_Word *) v = o.constraint.range->max; *flags |= SANE_INFO_INEXACT; } break; case SANE_CONSTRAINT_WORD_LIST: break; default: break; } break; case SANE_TYPE_STRING: if (!v) return SANE_STATUS_INVAL; break; case SANE_TYPE_BUTTON: break; case SANE_TYPE_GROUP: break; } switch (option) { case LS5000_OPTION_NUM: return SANE_STATUS_INVAL; break; case LS5000_OPTION_ADAPTER: return SANE_STATUS_INVAL; break; case LS5000_OPTION_PREVIEW: s->preview = *(SANE_Word *) v; if (s->preview) { s->infrared = SANE_FALSE; free(s->ir_data); s->ir_data = NULL; } else s->infrared = s->pinfrared; break; case LS5000_OPTION_NEGATIVE: s->negative = *(SANE_Word *) v; break; case LS5000_OPTION_INFRARED: s->infrared = *(SANE_Word *) v; s->pinfrared = *(SANE_Word *) v; break; case LS5000_OPTION_SCAN_MODE: if (strcmp(v, SANE_VALUE_SCAN_MODE_GRAY) == 0) s->gray_scan = SANE_TRUE; else if (strcmp(v, SANE_VALUE_SCAN_MODE_COLOR) == 0) s->gray_scan = SANE_FALSE; else return SANE_STATUS_INVAL; *flags |= SANE_INFO_RELOAD_PARAMS; break; case LS5000_OPTION_EXPOSURE: s->exposure = SANE_UNFIX(*(SANE_Word *) v); break; case LS5000_OPTION_EXPOSURE_R: s->exposure_r = SANE_UNFIX(*(SANE_Word *) v); break; case LS5000_OPTION_EXPOSURE_G: s->exposure_g = SANE_UNFIX(*(SANE_Word *) v); break; case LS5000_OPTION_EXPOSURE_B: s->exposure_b = SANE_UNFIX(*(SANE_Word *) v); break; case LS5000_OPTION_LUT_R: if (!(s->lut_r)) return SANE_STATUS_INVAL; for (pixel = 0; pixel < s->n_lut; pixel++) s->lut_r[pixel] = ((SANE_Word *) v)[pixel]; break; case LS5000_OPTION_LUT_G: if (!(s->lut_g)) return SANE_STATUS_INVAL; for (pixel = 0; pixel < s->n_lut; pixel++) s->lut_g[pixel] = ((SANE_Word *) v)[pixel]; break; case LS5000_OPTION_LUT_B: if (!(s->lut_b)) return SANE_STATUS_INVAL; for (pixel = 0; pixel < s->n_lut; pixel++) s->lut_b[pixel] = ((SANE_Word *) v)[pixel]; break; case LS5000_OPTION_LOAD: ls5000_load(s); break; case LS5000_OPTION_EJECT: ls5000_eject(s); break; case LS5000_OPTION_RESET: *flags |= SANE_INFO_RELOAD_OPTIONS; return ls5000_reset(s); break; case LS5000_OPTION_INQUIRE: *flags |= SANE_INFO_RELOAD_OPTIONS; return ls5000_full_inquiry(s); break; case LS5000_OPTION_FRAME: s->i_frame = *(SANE_Word *) v; break; case LS5000_OPTION_SUBFRAME: s->subframe = SANE_UNFIX(*(SANE_Word *) v); break; case LS5000_OPTION_RES: s->res = *(SANE_Word *) v; *flags |= SANE_INFO_RELOAD_PARAMS; break; case LS5000_OPTION_XMIN: s->xmin = *(SANE_Word *) v; *flags |= SANE_INFO_RELOAD_PARAMS; break; case LS5000_OPTION_XMAX: s->xmax = *(SANE_Word *) v; *flags |= SANE_INFO_RELOAD_PARAMS; break; case LS5000_OPTION_YMIN: s->ymin = *(SANE_Word *) v; *flags |= SANE_INFO_RELOAD_PARAMS; break; case LS5000_OPTION_YMAX: s->ymax = *(SANE_Word *) v; *flags |= SANE_INFO_RELOAD_PARAMS; break; case LS5000_OPTION_FOCUS_ON_CENTRE: s->focus_on_centre = *(SANE_Word *) v; if (s->focus_on_centre) { s->option_list[LS5000_OPTION_FOCUSX].cap |= SANE_CAP_INACTIVE; s->option_list[LS5000_OPTION_FOCUSY].cap |= SANE_CAP_INACTIVE; } else { s->option_list[LS5000_OPTION_FOCUSX].cap &= ~SANE_CAP_INACTIVE; s->option_list[LS5000_OPTION_FOCUSY].cap &= ~SANE_CAP_INACTIVE; } *flags |= SANE_INFO_RELOAD_OPTIONS; break; case LS5000_OPTION_FOCUS: s->focus = *(SANE_Word *) v; break; case LS5000_OPTION_AUTOFOCUS: ls5000_autofocus(s); *flags |= SANE_INFO_RELOAD_OPTIONS; break; case LS5000_OPTION_FOCUSX: s->focusx = *(SANE_Word *) v; break; case LS5000_OPTION_FOCUSY: s->focusy = *(SANE_Word *) v; break; case LS5000_OPTION_SCAN_AE: status = ls5000_scan(s, LS5000_SCAN_AE); if (status) return status; status = ls5000_get_exposure(s); if (status) return status; s->exposure = 1.; s->exposure_r = s->real_exposure[0] / 100.; s->exposure_g = s->real_exposure[1] / 100.; s->exposure_b = s->real_exposure[2] / 100.; *flags |= SANE_INFO_RELOAD_OPTIONS; break; case LS5000_OPTION_SCAN_AE_WB: status = ls5000_scan(s, LS5000_SCAN_AE_WB); if (status) return status; status = ls5000_get_exposure(s); if (status) return status; s->exposure = 1.; s->exposure_r = s->real_exposure[0] / 100.; s->exposure_g = s->real_exposure[1] / 100.; s->exposure_b = s->real_exposure[2] / 100.; *flags |= SANE_INFO_RELOAD_OPTIONS; break; } return status; } SANE_Status sane_ls5000_control_option(SANE_Handle h, SANE_Int option, SANE_Action action, void *v, SANE_Int *outflags) { struct ls5000 *s = (struct ls5000 *) h; SANE_Int *flags, dummyflags = 0; if (option >= LS5000_N_OPTIONS) return SANE_STATUS_INVAL; switch (action) { case SANE_ACTION_GET_VALUE: return ls5000_get_option_value(s, option, v); case SANE_ACTION_SET_VALUE: if (outflags) flags = outflags; else flags = &dummyflags; return ls5000_set_option_value(s, option, v, flags); default: DBG(1, "BUG: sane_ls5000_control_option: Unknown action.\n"); return SANE_STATUS_INVAL; } } SANE_Status sane_ls5000_get_parameters(SANE_Handle h, SANE_Parameters *p) { struct ls5000 *s = (struct ls5000 *) h; ls5000_convert_options(s); p->last_frame = SANE_TRUE; if (s->ir_data && s->scan_stage == LS5000_SCAN_STAGE_IDLE) { p->format = SANE_FRAME_GRAY; p->bytes_per_line = 1 * s->logical_width * 2; } else { if (s->gray_scan) { p->format = SANE_FRAME_GRAY; p->bytes_per_line = 1 * s->logical_width * 2; } else { p->format = SANE_FRAME_RGB; p->bytes_per_line = 3 * s->logical_width * 2; } } p->lines = s->logical_height; p->depth = 16; p->pixels_per_line = s->logical_width; return SANE_STATUS_GOOD; } SANE_Status sane_ls5000_start(SANE_Handle h) { struct ls5000 *s = (struct ls5000 *) h; SANE_Status status; if (s->must_read_now) return SANE_STATUS_INVAL; if (s->ir_data && s->scan_stage == LS5000_SCAN_STAGE_IDLE) { s->must_read_now = SANE_TRUE; return SANE_STATUS_GOOD; } ls5000_convert_options(s); status = ls5000_scan(s, LS5000_SCAN_NORMAL); if (status) return status; s->must_read_now = SANE_TRUE; if (s->scan_stage == LS5000_SCAN_STAGE_IDLE) s->scan_stage = LS5000_SCAN_STAGE_ACQUIRE; return SANE_STATUS_GOOD; } /* * This function does the bulk of the data format conversion, * see the comment for sane_ls5000_read. */ static void ls5000_shuffle_block(struct ls5000 *s, int block_lines) { int line, i; int line_padded = s->line_bytes + s->line_padding; int line_pixels = s->logical_width; if (s->gray_scan) { /* * Gray scans are relatively easy, we just need to * split off the infrared data if present. * * A gray-only scan on big-endian machines could be optimised * (less data copying) but that just increases code complexity * for little gain. */ for (line = 0; line < block_lines; line++) { uint16_t *src = (uint16_t*)s->block + line*line_padded/2; uint16_t *graydst = (uint16_t*)s->ordered_block + line*line_pixels; uint16_t *irsrc = src + line_pixels; uint16_t *irdst = (uint16_t*)s->ir_data + (s->line + line)*s->logical_width; #if __BYTE_ORDER == __BIG_ENDIAN if (s->infrared) memcpy(irdst, irsrc, 2*line_pixels); memcpy(graydst, src, 2*line_pixels); #else if (s->infrared) for (i = 0; i < line_pixels; i++) irdst[i] = ntohs(irsrc[i]); for (i = 0; i < line_pixels; i++) graydst[i] = ntohs(src[i]); #endif } } else { /* * For RGB scans we not only need to split off the infrared * data if it is present but also need to rearrange the color * components. */ for (line = 0; line < block_lines; line++) { uint16_t *src = (uint16_t*)s->block + line*line_padded/2; uint16_t *rgb = (uint16_t*)s->ordered_block + line*3*line_pixels; uint16_t *irsrc = src + 3*line_pixels; uint16_t *irdst = (uint16_t*)s->ir_data + (s->line + line)*s->logical_width; if (s->infrared) #if __BYTE_ORDER == __BIG_ENDIAN memcpy(irdst, irsrc, 2*line_pixels); #else for (i = 0; i < line_pixels; i++) irdst[i] = ntohs(irsrc[i]); #endif for (i = 0; i < line_pixels; i++) { rgb[i*3 + 0] = ntohs(src[0*line_pixels + i]); rgb[i*3 + 1] = ntohs(src[1*line_pixels + i]); rgb[i*3 + 2] = ntohs(src[2*line_pixels + i]); } } } } /* * Due to the image format used by the scanner, sane_ls5000_read is * a bit more complex. * * The data sent by the scanner is line-interleaved as opposed to * pixel-interleaved which SANE requires. * * If we're reading an RGB image, we get the data as follows: * RR...RR GG...GG BB...BB * where each R/G/B consists of two bytes in big-endian order for each * pixel, and the number of each one depends on the line width. * * For the other modes, we get: * rgb/infrared: RR...RR GG...GG BB...BB II...II * gray: GG...GG * gray/infrared: GG...GG II...II * * The second complication is that SANE cannot handle infrared channels * at all. Hence, we cache the infrared data in memory and send it out * as a second image when the next image is scanned. */ SANE_Status sane_ls5000_read(SANE_Handle h, SANE_Byte *buf, SANE_Int maxlen, SANE_Int *len) { struct ls5000 *s = (struct ls5000 *) h; SANE_Status status; unsigned long xfer_len; size_t n_recv, remaining, offset; int colors; unsigned int block_lines; /* colors without infrared */ colors = 3; if (s->gray_scan) colors = 1; /* sane_ls5000_scan wasn't invoked! */ if (!s->must_read_now) { *len = 0; return SANE_STATUS_CANCELLED; } /* * The scanner is idle (we're not scanning right now) and we * have infrared data pending. That means we just scanned an * image and now it's the second "scan" to get the IR image. */ if (s->ir_data && s->scan_stage == LS5000_SCAN_STAGE_IDLE) { *len = s->ir_data_len - s->block_read_pos; if (*len == 0) { s->block_read_pos = 0; free(s->ir_data); s->ir_data = NULL; s->scan_stage = LS5000_SCAN_STAGE_IDLE; s->must_read_now = SANE_FALSE; return SANE_STATUS_EOF; } if (*len > maxlen) *len = maxlen; memcpy(buf, s->ir_data + s->block_read_pos, *len); s->block_read_pos += *len; return SANE_STATUS_GOOD; } /* * No more lines to read, block read position is 0 (i.e. the whole * block was read) and we do have a block. This means we're done * with the gray/rgb part of the image and possibly everything. */ if (s->line == s->logical_height && s->block_read_pos == 0 && s->block) { *len = 0; free(s->block); s->block = NULL; free(s->ordered_block); s->ordered_block = NULL; s->line = 0; s->must_read_now = SANE_FALSE; /* scanimage doesn't call sane_ls5000_cancel between pages */ s->scan_stage = LS5000_SCAN_STAGE_IDLE; return SANE_STATUS_EOF; } /* * Similar conditions as before, but we don't have a block. This means * that sane_ls5000_scan was just invoked and now we're in sane_read * for the first time after that and should calculate how much data we * need to read and allocate memory as necessary. */ if (s->line == 0 && s->block_read_pos == 0) { /* store how many bytes for each scanline */ s->line_bytes = (colors + !!s->infrared) * s->logical_width * 2; /* * lines are padded to multiples of 512, we have received the * required line padding when the REISSUE status comes from the * scanner. */ xfer_len = s->logical_height * (s->line_bytes + s->line_padding); /* * Allocate memory for the raw block, the reordered block * for the frontend and the infrared data. We could be faster * and use less memory by reordering the data directly into * the frontend buffer, but since we want to read large chunks * from the scanner to speed up the scanner that would increase * code complexity a lot. */ s->block = malloc(NUM_LINES_READ * (s->line_bytes + s->line_padding)); if (!s->block) return SANE_STATUS_NO_MEM; s->ordered_block = malloc(NUM_LINES_READ * colors * s->logical_width * 2); if (!s->ordered_block) return SANE_STATUS_NO_MEM; if (s->infrared) { s->ir_data_len = s->logical_height * s->logical_width * 2; s->ir_data = malloc(s->ir_data_len); if (!s->ir_data) return SANE_STATUS_NO_MEM; } } /* * Now this is where we get either * (a) right after the block above or * (b) when we have already read a few blocks but copied out all data * to the frontend already. */ if (s->block_read_pos == 0) { /* * Read in a whole block of ten lines, ten is arbitrary, * we probably should adjust this based on line length * for optimal performance. */ block_lines = NUM_LINES_READ; if (block_lines > s->logical_height - s->line) block_lines = s->logical_height - s->line; /* calculate how many bytes that means */ remaining = block_lines * (s->line_bytes + s->line_padding); /* issue the read command */ status = ls5000_issue_cmd(s, -1, LS5000_CMD_READ, 0, /* LUN */ 0, /* data type: image */ 0, /* reserved */ 0, 1, /* data type qualifier (default, 2-byte data) */ (remaining >> 16) & 0xff, (remaining >> 8) & 0xff, (remaining >> 0) & 0xff, /* transfer length */ 0x80); /* control */ if (status != SANE_STATUS_DEVICE_BUSY) { *len = 0; s->block_read_pos = 0; s->must_read_now = SANE_FALSE; s->line = 0; free(s->block); s->block = NULL; free(s->ordered_block); s->ordered_block = NULL; return status; } /* * Now read data into our block buffer in * small blocks of 512 bytes. */ offset = 0; while (remaining > 0) { n_recv = 512; status = sanei_usb_read_bulk(s->fd, s->block + offset, &n_recv); if (status) return status; offset += n_recv; remaining -= n_recv; } /* each command requires a status check afterwards */ status = ls5000_check_status(s); if (status) { *len = 0; s->block_read_pos = 0; s->must_read_now = SANE_FALSE; s->line = 0; free(s->block); s->block = NULL; free(s->ordered_block); s->ordered_block = NULL; return status; } /* * This is the hard part, see the comments there * and at the start of this function. */ ls5000_shuffle_block(s, block_lines); /* calculate how much data to copy to the frontend */ s->ordered_block_size = block_lines * s->logical_width * 2 * colors; /* we've read a few lines, keep track */ s->line += block_lines; } /* * Now, if any code blocks above were executed or not, then * at this point we have some data pending in our block buffers * that we need to push to the frontend before we start reading * from the scanner again. */ /* Calculate how much data we still have pending */ *len = s->ordered_block_size - s->block_read_pos; /* Too much? */ if (*len > maxlen) *len = maxlen; /* Copy it to the frontend */ memcpy(buf, s->ordered_block + s->block_read_pos, *len); s->block_read_pos += *len; /* * If the whole block was read out start from zero again, * this will execute some more code above again to read data * from the scanner. */ if (s->block_read_pos == s->ordered_block_size) s->block_read_pos = 0; return SANE_STATUS_GOOD; } void sane_ls5000_cancel(SANE_Handle h) { struct ls5000 *s = (struct ls5000 *) h; if (s->scan_stage == LS5000_SCAN_STAGE_ACQUIRE) { ls5000_issue_cmd(s, 0, LS5000_CMD_ABORT, 0, 0, 0, 0, 0); free(s->ir_data); s->ir_data = NULL; free(s->block); s->block = NULL; free(s->ordered_block); s->ordered_block = NULL; } s->block_read_pos = 0; s->line = 0; s->must_read_now = SANE_FALSE; s->scan_stage = LS5000_SCAN_STAGE_IDLE; } SANE_Status sane_ls5000_set_io_mode(SANE_Handle h, SANE_Bool m) { (void)h; /* shut up compiler */ if (m == SANE_FALSE) return SANE_STATUS_GOOD; else return SANE_STATUS_UNSUPPORTED; } SANE_Status sane_ls5000_get_select_fd(SANE_Handle h, SANE_Int * fd) { struct ls5000 *s = (struct ls5000 *) h; (void)fd; (void)s; return SANE_STATUS_UNSUPPORTED; } sane-backends-extras-1.0.22.3ubuntu1/backend/geniusvp2-adc.c0000664000000000000000000001244711527030747020373 0ustar /* adc.c - WM8143-12 ADC I/O functions * * Copyright (C) 2004, 2005 Anderson Lizardo * * 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 of the License, 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 */ #include "geniusvp2-adc.h" #include "geniusvp2-asic.h" #include "geniusvp2-misc.h" #define DARK_REF_LINES 5 /* * Write data to the specified ADC register */ static void adc_write (unsigned char reg, unsigned char data) { int bit; reg13.w = 0x80; sane_geniusvp2_reg_write (13, reg13.w); for (bit = 5; bit >= 0; bit--) { if (reg & (1 << bit)) reg13.r.SDO = 1; else reg13.r.SDO = 0; sane_geniusvp2_reg_write (13, reg13.w); reg13.r.SCLK = 1; sane_geniusvp2_reg_write (13, reg13.w); reg13.r.SCLK = 0; sane_geniusvp2_reg_write (13, reg13.w); } for (bit = 7; bit >= 0; bit--) { if (data & (1 << bit)) reg13.r.SDO = 1; else reg13.r.SDO = 0; sane_geniusvp2_reg_write (13, reg13.w); reg13.r.SCLK = 1; sane_geniusvp2_reg_write (13, reg13.w); reg13.r.SCLK = 0; sane_geniusvp2_reg_write (13, reg13.w); } reg13.r.SEN = 1; sane_geniusvp2_reg_write (13, reg13.w); reg13.r.SDO = 0; reg13.r.SEN = 0; sane_geniusvp2_reg_write (13, reg13.w); } /* * Set offset value * xoff = -255 .. +255 */ static void set_adc_offset (int roff, int goff, int boff) { /* Set DAC Signs register */ if (roff < 0) adc_write (0x24, 1); else adc_write (0x24, 0); if (goff < 0) adc_write (0x25, 1); else adc_write (0x25, 0); if (boff < 0) adc_write (0x26, 1); else adc_write (0x26, 0); if (roff < 0) roff = -roff; if (goff < 0) goff = -goff; if (boff < 0) boff = -boff; /* Set DAC Values register */ adc_write (0x20, roff & 0xff); adc_write (0x21, goff & 0xff); adc_write (0x22, boff & 0xff); sane_geniusvp2_reg_write (13, 0x20); } /* * Set Programmable Gain Amplifier */ void sane_geniusvp2_set_adc_gain (int rgain, int ggain, int bgain) { adc_write (0x28, rgain & 0x1f); adc_write (0x29, ggain & 0x1f); adc_write (0x2a, bgain & 0x1f); sane_geniusvp2_reg_write (13, 0x20); } /* * Initialize ADC */ void sane_geniusvp2_init_adc (void) { sane_geniusvp2_reg_write (5, 0x90); sane_geniusvp2_reg_write (25, 0x0f); /* Clear panel button */ sane_geniusvp2_reg_read (12, ®12.w); reg12.r.KeyButton = 0; sane_geniusvp2_reg_write (12, reg12.w); adc_write (0x01, 0x03); adc_write (0x02, 0x04); adc_write (0x03, 0x22); adc_write (0x05, 0x10); set_adc_offset (190, 190, 190); sane_geniusvp2_set_adc_gain (2, 2, 2); } /* * Adjust offset to get a reading in the range 1 to 10 */ void sane_geniusvp2_adjust_offset (void) { int offsetr = 0; int offsetg = 0; int offsetb = 0; int mask, rtmp, gtmp, btmp; set_adc_offset (offsetr, offsetg, offsetb); for (mask = 0x80; mask != 0x00; mask = mask >> 1) { sane_geniusvp2_get_avg_reading (&rtmp, >mp, &btmp); if (rtmp < 1) offsetr = offsetr - mask; else if (rtmp > 10) offsetr = offsetr + mask; if (gtmp < 1) offsetg = offsetg - mask; else if (gtmp > 10) offsetg = offsetg + mask; if (btmp < 1) offsetb = offsetb - mask; else if (btmp > 10) offsetb = offsetb + mask; set_adc_offset (offsetr, offsetg, offsetb); } } /* * Get an average color reading */ void sane_geniusvp2_get_avg_reading (int *red, int *green, int *blue) { int i, j; ScanArea area; area.top = 0; area.left = 6; area.height = DARK_REF_LINES; area.width = 7; /*sane_geniusvp2_lamp_off (); */ sane_geniusvp2_set_scan_area (area); sane_geniusvp2_set_scan_params (600); sane_geniusvp2_reset_fifo (); sane_geniusvp2_set_operation_mode (mStop); sane_geniusvp2_set_operation_mode (mScanMotorOff); /* Read ADC to get average values */ *red = *green = *blue = 0; for (i = 0; i < DARK_REF_LINES; i++) { sane_geniusvp2_wait_fifo (area.width); for (j = 0; j < area.width; j++) { sane_geniusvp2_reg_read (17, ®17.w); *red += reg17.w; sane_geniusvp2_reg_read (17, ®17.w); *green += reg17.w; sane_geniusvp2_reg_read (17, ®17.w); *blue += reg17.w; } } *red /= (area.width * DARK_REF_LINES); *green /= (area.width * DARK_REF_LINES); *blue /= (area.width * DARK_REF_LINES); sane_geniusvp2_set_operation_mode (mStop); /*sane_geniusvp2_lamp_on (); */ } sane-backends-extras-1.0.22.3ubuntu1/backend/geniusvp2-asic.c0000664000000000000000000000507411527030747020561 0ustar /* asic.c - ASIC registers I/O functions * * Copyright (C) 2004, 2005 Anderson Lizardo * * 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 of the License, 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 */ #ifdef __linux__ # include #endif #include "geniusvp2-asic.h" #include "geniusvp2-parport.h" int sane_geniusvp2_reg_read (unsigned char reg, unsigned char *data) { return sane_geniusvp2_reg_read_buf (reg, data, 1); } int sane_geniusvp2_reg_read_buf (unsigned char reg, unsigned char *data, size_t size) { #ifdef __linux__ sane_geniusvp2_epp_set_mode (IEEE1284_ADDR); sane_geniusvp2_epp_write (®, 1); sane_geniusvp2_epp_set_mode (IEEE1284_DATA); #elif defined (__FreeBSD__) || defined(__FreeBSD_kernel__) sane_geniusvp2_epp_write_addr (reg); #endif return sane_geniusvp2_epp_read (data, size); } int sane_geniusvp2_reg_write (unsigned char reg, unsigned char data) { return sane_geniusvp2_reg_write_buf (reg, &data, 1); } int sane_geniusvp2_reg_write_buf (unsigned char reg, unsigned char *data, size_t size) { #ifdef __linux__ sane_geniusvp2_epp_set_mode (IEEE1284_ADDR); sane_geniusvp2_epp_write (®, 1); sane_geniusvp2_epp_set_mode (IEEE1284_DATA); #elif defined (__FreeBSD__) || defined(__FreeBSD_kernel__) sane_geniusvp2_epp_write_addr (reg); #endif return sane_geniusvp2_epp_write (data, size); } void sane_geniusvp2_init_regs (void) { reg0.w = 0xe1; reg1.w = 0x5a; reg2.w = 0x00; reg3.w = 0x0f; reg4.w = 0x32; reg5.w = 0x00; reg6.w = 0x94; reg7.w = 0x09; reg8.w = 0xc4; reg9.w = 0x0a; reg10.w = 0x17; reg11.w = 0x70; reg12.w = 0x44; reg13.w = 0x91; reg14.w = 0x07; reg15.w = 0xff; reg16.w = 0xff; reg17.w = 0x00; reg18.w = 0x00; reg19.w = 0x00; reg20.w = 0x00; reg21.w = 0x00; reg22.w = 0x13; reg23.w = 0xec; reg24.w = 0x86; reg25.w = 0xf0; reg26.w = 0x18; reg27.w = 0x22; reg28.w = 0x58; reg29.w = 0x58; } sane-backends-extras-1.0.22.3ubuntu1/backend/geniusvp2-image.h0000664000000000000000000000330511527030747020724 0ustar /* image.h - Image handling functions * * Copyright (C) 2004, 2005 Anderson Lizardo * * 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 of the License, 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 */ /* Disabled by now, until code gets fixed */ #if 0 #ifndef _IMAGE_H #define _IMAGE_H typedef struct { double brightness; double contrast; double gamma; } color_setting; typedef struct { int width; /* image width (pixels) */ int height; /* image height (pixels) */ float from_top; /* distance from top (inch) */ float from_left; /* distance from left side (inch) */ int resolution; int num_colors; /* number of colors */ color_setting color[3]; /* b/c/g of all colors */ unsigned char *color_table[3]; char *filename; } scan_image; extern const int color_table_size; extern int redmax, greenmax, bluemax, redmin, greenmin, bluemin; extern void calc_color_table (scan_image * image); extern void calibrate (scan_image * image); extern void init_image (scan_image ** image); #endif /* _IMAGE_H */ #endif sane-backends-extras-1.0.22.3ubuntu1/backend/geniusvp2-misc.c0000664000000000000000000002670611527030747020602 0ustar /* misc.c - Various functions that do not have a proper file (yet) * * Author: Anderson Lizardo * * Copyright (C) 2004, 2005 Anderson Lizardo * * 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 of the License, 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 */ #include #include #include #include "geniusvp2-adc.h" #include "geniusvp2-asic.h" #include "geniusvp2-image.h" #include "geniusvp2-misc.h" /* Default values from e1.ini */ const int max_exposure_time = 13800; const int min_exposure_time = 2200; const int motor_change = 3000; const float left_leading = 0.22; const int back_step = 20; const unsigned char ccd_line_offset = 4; static void init_timer (struct timeval *timer, unsigned long sec) { gettimeofday (timer, NULL); timer->tv_sec += sec; } static int check_timer (struct timeval *timer) { struct timeval current_time; gettimeofday (¤t_time, NULL); if (timercmp (¤t_time, timer, >)) return TIMEOUT; else return NO_TIMEOUT; } /* * Status (reg. 12) polling routine. * NOTE: Always start with waiting! */ void sane_geniusvp2_poll_12 (unsigned char val, unsigned char mask) { do { usleep (5000); sane_geniusvp2_reg_read (12, ®12.w); } while ((reg12.w & mask) != val); } ssize_t sane_geniusvp2_wait_fifo (size_t count) { size_t fifo_count = 0; struct timeval timer; /* set timeout to 10 sec. */ init_timer (&timer, 10); do { usleep (5000); sane_geniusvp2_reg_read (18, ®18.w); sane_geniusvp2_reg_read (19, ®19.w); sane_geniusvp2_reg_read (12, ®12.w); /*fifo_count = (reg18.w << 8) | reg19.w; */ fifo_count = (reg18.w * 2048 + reg19.w * 8 + 8) * 3; DBG (1, "sane_geniusvp2_wait_fifo: FIFO = %lu, FinishFlag = %d\n", (unsigned long) fifo_count, reg12.r.FinishFlag); if (check_timer (&timer)) { DBG (1, "sane_geniusvp2_wait_fifo: TIMEOUT\n"); return -1; } } while (!((fifo_count > 2 * count) || reg12.r.FinishFlag)); if (reg12.r.FinishFlag) DBG (1, "sane_geniusvp2_wait_fifo: FinishFlag is set\n"); return count; } #if 0 void get_fifo_count (size_t * count) { do { sane_geniusvp2_reg_read (18, ®18.w); sane_geniusvp2_reg_read (19, ®19.w); sane_geniusvp2_reg_read (12, ®12.w); *count = (reg18.w << 8) | reg19.w; } while (!(*count /* || reg12.r.FinishFlag */ )); DBG (1, "get_fifo_count: FIFO has %lu bytes\n", (unsigned long) *count); if (reg12.r.FinishFlag) { DBG (1, "get_fifo_count: FinishFlag is set\n"); *count = 0; } } #endif void sane_geniusvp2_set_operation_mode (operation_mode mode) { sane_geniusvp2_reg_read (6, ®6.w); if (mode == mScanMotorOff) reg6.r.Operation = mScan; else reg6.r.Operation = mode; if (mode == mStop || mode == mScanMotorOff) reg6.r.MotorPower = 0; else reg6.r.MotorPower = 1; sane_geniusvp2_reg_write (6, reg6.w); } void sane_geniusvp2_reset_fifo (void) { sane_geniusvp2_set_operation_mode (mStop); sane_geniusvp2_reg_read (3, ®3.w); reg3.r.FiFoReset = 0; sane_geniusvp2_reg_write (3, reg3.w); reg3.r.FiFoReset = 1; sane_geniusvp2_reg_write (3, reg3.w); sane_geniusvp2_set_operation_mode (mStop); sane_geniusvp2_reg_read (3, ®3.w); reg3.r.FiFoReset = 0; sane_geniusvp2_reg_write (3, reg3.w); reg3.r.FiFoReset = 1; sane_geniusvp2_reg_write (3, reg3.w); } void sane_geniusvp2_set_memory_addr (int addr) { reg14.w = (addr & 0x1f0000) >> 16; reg15.w = (addr & 0x00ff00) >> 8; reg16.w = (addr & 0x0000ff); sane_geniusvp2_reg_write (14, reg14.w); sane_geniusvp2_reg_write (15, reg15.w); sane_geniusvp2_reg_write (16, reg16.w); } static void sane_geniusvp2_set_line_start (int start) { reg20.w = (start & 0x3f00) >> 8; reg21.w = (start & 0x00ff); sane_geniusvp2_reg_write (20, reg20.w); sane_geniusvp2_reg_write (21, reg21.w); } static void sane_geniusvp2_set_line_width (int width) { reg22.w = (width & 0x3f00) >> 8; reg23.w = (width & 0x00ff); sane_geniusvp2_reg_write (22, reg22.w); sane_geniusvp2_reg_write (23, reg23.w); } /* * Set the distance of carriage's next movement. */ static void sane_geniusvp2_set_distance (int distance) { reg7.w = (distance & 0xff00) >> 8; reg8.w = (distance & 0x00ff); sane_geniusvp2_reg_write (7, reg7.w); sane_geniusvp2_reg_write (8, reg8.w); } /* * Set for how long the carriage stays on each step. */ static void sane_geniusvp2_set_step_time (int time) { reg10.w = (time & 0xff00) >> 8; reg11.w = (time & 0x00ff); sane_geniusvp2_reg_write (10, reg10.w); sane_geniusvp2_reg_write (11, reg11.w); } static void sane_geniusvp2_set_scan_speed (int speed) { speed &= 0x07; sane_geniusvp2_reg_read (3, ®3.w); reg3.r.ScanSpeed = speed; sane_geniusvp2_reg_write (3, reg3.w); } /* * Move carriage forward. */ void sane_geniusvp2_move_carriage_forward (int distance) { int StepTime; unsigned char ScanSpeed; sane_geniusvp2_set_operation_mode (mStop); ScanSpeed = 7; sane_geniusvp2_set_scan_speed (ScanSpeed); StepTime = max_exposure_time / (ScanSpeed + 1); if (StepTime < min_exposure_time) StepTime = min_exposure_time; sane_geniusvp2_set_step_time (StepTime); sane_geniusvp2_set_distance (distance); sane_geniusvp2_reg_read (6, ®6.w); reg6.r.MotorPower = 1; reg6.r.HalfFull = 1; sane_geniusvp2_reg_write (6, reg6.w); sane_geniusvp2_set_operation_mode (mForward); sane_geniusvp2_poll_12 (0x08, 0x08); } static void sane_geniusvp2_set_line_offset (int offset) { sane_geniusvp2_reg_read (6, ®6.w); sane_geniusvp2_reg_read (4, ®4.w); if (offset < 0) reg4.r.NoLineOffset = 0; else reg4.r.NoLineOffset = 1; reg6.r.LineOffset = offset & 0x07; sane_geniusvp2_reg_write (6, reg6.w); sane_geniusvp2_reg_write (4, reg4.w); } /* * Set scanning resolution. */ static void sane_geniusvp2_set_resolution (unsigned int res) { sane_geniusvp2_reg_read (3, ®3.w); sane_geniusvp2_reg_read (27, ®27.w); sane_geniusvp2_reg_read (28, ®28.w); sane_geniusvp2_reg_read (29, ®29.w); reg27.r.XRes = (res & 0x0700) >> 8; reg28.r.XRes = (res & 0x00ff); reg27.r.YRes = ((res * (reg3.r.ScanSpeed + 1)) & 0x0700) >> 8; reg29.r.YRes = ((res * (reg3.r.ScanSpeed + 1)) & 0x00ff); sane_geniusvp2_reg_write (27, reg27.w); sane_geniusvp2_reg_write (28, reg28.w); sane_geniusvp2_reg_write (29, reg29.w); } /* * Return carriage to its home position. */ void sane_geniusvp2_go_home (void) { int ScanSpeed, StepTime; sane_geniusvp2_reg_read (12, ®12.w); if (reg12.r.HomeSensor) return; sane_geniusvp2_set_operation_mode (mStop); ScanSpeed = 7; sane_geniusvp2_set_scan_speed (ScanSpeed); StepTime = max_exposure_time / (ScanSpeed + 1); if (StepTime < min_exposure_time) StepTime = min_exposure_time; sane_geniusvp2_set_step_time (StepTime); sane_geniusvp2_reg_read (6, ®6.w); reg6.r.MotorPower = 1; reg6.r.HalfFull = 1; sane_geniusvp2_reg_write (6, reg6.w); sane_geniusvp2_set_operation_mode (mAutoHome); } SANE_Bool sane_geniusvp2_is_lamp_on (void) { sane_geniusvp2_reg_read (12, ®12.w); return (reg12.r.Lamp ? SANE_TRUE : SANE_FALSE); } SANE_Status sane_geniusvp2_lamp_on (void) { if (sane_geniusvp2_reg_read (12, ®12.w)) return SANE_STATUS_IO_ERROR; reg12.r.Lamp = 1; if (sane_geniusvp2_reg_write (12, reg12.w)) return SANE_STATUS_IO_ERROR; return SANE_STATUS_GOOD; } SANE_Status sane_geniusvp2_lamp_off (void) { if (sane_geniusvp2_reg_read (12, ®12.w)) return SANE_STATUS_IO_ERROR; reg12.r.Lamp = 0; if (sane_geniusvp2_reg_write (12, reg12.w)) return SANE_STATUS_IO_ERROR; return SANE_STATUS_GOOD; } int sane_geniusvp2_read_scan_data (SANE_Byte * data, size_t size) { return sane_geniusvp2_reg_read_buf (17, (unsigned char *) data, size); } void sane_geniusvp2_set_scan_area (ScanArea area) { sane_geniusvp2_set_line_start (area.left); sane_geniusvp2_set_line_width (area.width); sane_geniusvp2_set_distance (area.height); } void sane_geniusvp2_set_scan_params (int res) { int ScanSpeed, LineOffset, StepTime; /* FIXME: This value is not fixed; should be calculated */ sane_geniusvp2_reg_write (26, 0x09); ScanSpeed = (OPT_RESOLUTION / res) - 1; if (ScanSpeed > 7) ScanSpeed = 7; sane_geniusvp2_set_scan_speed (ScanSpeed); sane_geniusvp2_set_resolution (res); LineOffset = (ccd_line_offset / (ScanSpeed + 1)) - 1; sane_geniusvp2_set_line_offset (LineOffset); StepTime = max_exposure_time / (ScanSpeed + 1); if (StepTime < min_exposure_time) StepTime = min_exposure_time; sane_geniusvp2_set_step_time (StepTime * 2); sane_geniusvp2_reg_read (6, ®6.w); reg6.r.HalfFull = 0; sane_geniusvp2_reg_write (6, reg6.w); /* Set motor back steps */ sane_geniusvp2_reg_write (9, back_step); if (StepTime >= motor_change) sane_geniusvp2_reg_write (25, 0x00); else sane_geniusvp2_reg_write (25, 0x0f); } SANE_Status sane_geniusvp2_prepare_scan (ScanArea area, int res) { int i, j; unsigned char *memdata; sane_geniusvp2_go_home (); sane_geniusvp2_poll_12 (0x04, 0x04); sane_geniusvp2_reg_write (0x06, 0x80); sane_geniusvp2_init_adc (); sane_geniusvp2_reg_write (0x06, 0x80); memdata = calloc (20 * 1024, sizeof (unsigned char)); if (!memdata) return SANE_STATUS_NO_MEM; /* Reset gain table */ sane_geniusvp2_set_memory_addr (0x006000); sane_geniusvp2_reg_write_buf (17, memdata, 20 * 1024); /* Reset dark table */ sane_geniusvp2_set_memory_addr (0x003000); sane_geniusvp2_reg_write_buf (17, memdata, 12 * 1024); /* Download linear LUT to scanner */ sane_geniusvp2_set_memory_addr (0x000000); for (i = 0; i <= 255; i++) { for (j = 0; j < 16; j++) { memdata[0 * 4096 + i * 16 + j] = i; memdata[1 * 4096 + i * 16 + j] = i; memdata[2 * 4096 + i * 16 + j] = i; } } sane_geniusvp2_reg_write_buf (17, memdata, 12 * 1024); free (memdata); /* Disabled for now as it's broken */ /*calibrate (image); */ sane_geniusvp2_go_home (); sane_geniusvp2_poll_12 (0x04, 0x04); /* Move to start of scan area (with some offset to skip over calibration * lines) */ sane_geniusvp2_move_carriage_forward (area.top); sane_geniusvp2_set_scan_area (area); sane_geniusvp2_set_scan_params (res); sane_geniusvp2_reset_fifo (); sane_geniusvp2_set_operation_mode (mStop); sane_geniusvp2_set_operation_mode (mScan); return SANE_STATUS_GOOD; } sane-backends-extras-1.0.22.3ubuntu1/backend/Makefile.in0000664000000000000000000011627311527266663017637 0ustar # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = backend DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/byteorder.m4 \ $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/sane/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(sanelibdir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(sanelib_LTLIBRARIES) libgeniusvp2_la_LIBADD = am_libgeniusvp2_la_OBJECTS = libgeniusvp2_la-geniusvp2-adc.lo \ libgeniusvp2_la-geniusvp2-asic.lo \ libgeniusvp2_la-geniusvp2-image.lo \ libgeniusvp2_la-geniusvp2-misc.lo \ libgeniusvp2_la-geniusvp2-parport.lo \ libgeniusvp2_la-geniusvp2-switcher.lo \ libgeniusvp2_la-geniusvp2.lo libgeniusvp2_la_OBJECTS = $(am_libgeniusvp2_la_OBJECTS) libls5000_la_LIBADD = am_libls5000_la_OBJECTS = libls5000_la-ls5000.lo libls5000_la_OBJECTS = $(am_libls5000_la_OBJECTS) am__DEPENDENCIES_1 = libsane_geniusvp2_la_DEPENDENCIES = $(COMMON_LIBS) libgeniusvp2.la \ ../sanei/sanei_init_debug.lo ../sanei/sanei_config.lo \ ../sanei/sanei_constrain_value.lo ../sanei/sanei_thread.lo \ sane_strstatus.lo $(am__DEPENDENCIES_1) nodist_libsane_geniusvp2_la_OBJECTS = \ libsane_geniusvp2_la-geniusvp2-s.lo libsane_geniusvp2_la_OBJECTS = $(nodist_libsane_geniusvp2_la_OBJECTS) libsane_geniusvp2_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libsane_geniusvp2_la_LDFLAGS) $(LDFLAGS) -o $@ libsane_ls5000_la_DEPENDENCIES = $(COMMON_LIBS) libls5000.la \ ../sanei/sanei_init_debug.lo ../sanei/sanei_config.lo \ ../sanei/sanei_constrain_value.lo ../sanei/sanei_usb.lo \ sane_strstatus.lo $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) nodist_libsane_ls5000_la_OBJECTS = libsane_ls5000_la-ls5000-s.lo libsane_ls5000_la_OBJECTS = $(nodist_libsane_ls5000_la_OBJECTS) libsane_ls5000_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libsane_ls5000_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include/sane depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libgeniusvp2_la_SOURCES) $(libls5000_la_SOURCES) \ $(nodist_libsane_geniusvp2_la_SOURCES) \ $(nodist_libsane_ls5000_la_SOURCES) DIST_SOURCES = $(libgeniusvp2_la_SOURCES) $(libls5000_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AWK = @AWK@ BACKEND_CONFS_ENABLED = @BACKEND_CONFS_ENABLED@ BACKEND_LIBS_ENABLED = @BACKEND_LIBS_ENABLED@ BACKEND_MANS_ENABLED = @BACKEND_MANS_ENABLED@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISTCLEAN_FILES = @DISTCLEAN_FILES@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DVIPS = @DVIPS@ DYNAMIC_FLAG = @DYNAMIC_FLAG@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GPHOTO2_CPPFLAGS = @GPHOTO2_CPPFLAGS@ GPHOTO2_LDFLAGS = @GPHOTO2_LDFLAGS@ GPHOTO2_LIBS = @GPHOTO2_LIBS@ GREP = @GREP@ HAVE_GPHOTO2 = @HAVE_GPHOTO2@ IEEE1284_LIBS = @IEEE1284_LIBS@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_LOCKPATH = @INSTALL_LOCKPATH@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JPEG_LIBS = @JPEG_LIBS@ LATEX = @LATEX@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ # LIBTOOL install is a little to noisy for my liking. LIBTOOL = @LIBTOOL@ --silent LIBUSB_1_0_CFLAGS = @LIBUSB_1_0_CFLAGS@ LIBUSB_1_0_LIBS = @LIBUSB_1_0_LIBS@ LIBV4L_CFLAGS = @LIBV4L_CFLAGS@ LIBV4L_LIBS = @LIBV4L_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LOCKPATH_GROUP = @LOCKPATH_GROUP@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINDEX = @MAKEINDEX@ MAKEINFO = @MAKEINFO@ MATH_LIB = @MATH_LIB@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ NUMBER_VERSION = @NUMBER_VERSION@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PRELOADABLE_BACKENDS = @PRELOADABLE_BACKENDS@ PRELOADABLE_BACKENDS_ENABLED = @PRELOADABLE_BACKENDS_ENABLED@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RESMGR_LIBS = @RESMGR_LIBS@ SANEI_SANEI_JPEG_LO = @SANEI_SANEI_JPEG_LO@ SANE_CONFIG_PATH = @SANE_CONFIG_PATH@ SCSI_LIBS = @SCSI_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SNMP_CONFIG_PATH = @SNMP_CONFIG_PATH@ SOCKET_LIBS = @SOCKET_LIBS@ STRICT_LDFLAGS = @STRICT_LDFLAGS@ STRIP = @STRIP@ SYSLOG_LIBS = @SYSLOG_LIBS@ TIFF_LIBS = @TIFF_LIBS@ USB_LIBS = @USB_LIBS@ VERSION = @VERSION@ V_MAJOR = @V_MAJOR@ V_MINOR = @V_MINOR@ V_REV = @V_REV@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ configdir = @configdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ effective_target = @effective_target@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ locksanedir = @locksanedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_builddir)/include -I$(top_srcdir)/include -DLIBDIR="$(libdir)/sane" AM_LDFLAGS = @STRICT_LDFLAGS@ # The -rpath option is added because we are creating _LTLIBRARIES based # on configure substitution. This causes automake to not know the # correct $libdir and must be added here. DIST_SANELIBS_LDFLAGS = $(AM_LDFLAGS) -rpath '$(libdir)/sane' -version-number $(V_MAJOR):$(V_MINOR):$(V_REV) $(DYNAMIC_FLAG) DIST_LIBS_LDFLAGS = $(AM_LDFLAGS) -rpath '$(libdir)' -version-number $(V_MAJOR):$(V_MINOR):$(V_REV) FIRMWARE_DIRS = # TODO: This really belongs together with the saned sources and # should be installed there as well. EXTRA_DIST = sane_strstatus.c stubs.c saned.conf.in # Backends are not required to have a config file. Any backend # that wants to install a config file should list it here. BACKEND_CONFS = geniusvp2.conf SUFFIXES = .conf.in .conf CLEANFILES = $(BACKEND_CONFS) $(be_convenience_libs) # Backends # # All possible backends should be listed here. As a first step, we create # a convenience library containing all files needed to link a backend # directly into libsane.la. Convenience library should have the # form of lib${backend}.la to match what configure will list to # build. # Occasionally, this approach will have name conflicts with external # libraries that need to be linked in. See libgphoto2_i.la for # example of working around that issue. be_convenience_libs = libgeniusvp2.la libls5000.la # Each stand alone backend thats possible to be built should be listed # here. There are the libraries that are installed under $(libdir)/sane. # Format is libsane-${backend}.la. be_dlopen_libs = libsane-geniusvp2.la libsane-ls5000.la EXTRA_LTLIBRARIES = $(be_convenience_libs) $(be_dlopen_libs) lib_LTLIBRARIES = sanelibdir = $(libdir)/sane sanelib_LTLIBRARIES = $(BACKEND_LIBS_ENABLED) COMMON_LIBS = ../lib/liblib.la # Each backend should define a convenience library that compiles # all related files within backend directory. General guideline # is to have a ${backend}.c and ${backend}.h. Some backends also # add a few support source files to convience library. # Note: automake doesn't really use header files listed here. # They are indications that they need to be distributed only. # Each backend should define a stand alone library that gets installed. # This will need to link in a special file ${backend}-s.c that allows # the backend to be stand alone and contain all SANE API functions. # Also, it will need to link in related convenience library as well as # any external libraries required to resolve symbols. # # All backends should include $(DIST_SANELIBS_LDFLAGS) so that # library is correctly versioned. # # If a backend has a config file, it must be listed here to get distributed. libgeniusvp2_la_SOURCES = geniusvp2-adc.c geniusvp2-adc.h geniusvp2-asic.c geniusvp2-asic.h geniusvp2-image.c geniusvp2-image.h \ geniusvp2-misc.c geniusvp2-misc.h geniusvp2-parport.c geniusvp2-parport.h geniusvp2-registers.h geniusvp2-switcher.c \ geniusvp2-switcher.h geniusvp2.c geniusvp2.h libgeniusvp2_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=geniusvp2 nodist_libsane_geniusvp2_la_SOURCES = geniusvp2-s.c libsane_geniusvp2_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=geniusvp2 libsane_geniusvp2_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) libsane_geniusvp2_la_LIBADD = $(COMMON_LIBS) libgeniusvp2.la ../sanei/sanei_init_debug.lo ../sanei/sanei_config.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_thread.lo sane_strstatus.lo $(PTHREAD_LIBS) libls5000_la_SOURCES = ls5000.c libls5000_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=ls5000 nodist_libsane_ls5000_la_SOURCES = ls5000-s.c libsane_ls5000_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=ls5000 libsane_ls5000_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) libsane_ls5000_la_LIBADD = $(COMMON_LIBS) libls5000.la ../sanei/sanei_init_debug.lo ../sanei/sanei_config.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_usb.lo sane_strstatus.lo $(USB_LIBS) $(MATH_LIB) all: all-am .SUFFIXES: .SUFFIXES: .conf.in .conf .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu backend/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu backend/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-sanelibLTLIBRARIES: $(sanelib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(sanelibdir)" || $(MKDIR_P) "$(DESTDIR)$(sanelibdir)" @list='$(sanelib_LTLIBRARIES)'; test -n "$(sanelibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(sanelibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(sanelibdir)"; \ } uninstall-sanelibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(sanelib_LTLIBRARIES)'; test -n "$(sanelibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(sanelibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(sanelibdir)/$$f"; \ done clean-sanelibLTLIBRARIES: -test -z "$(sanelib_LTLIBRARIES)" || rm -f $(sanelib_LTLIBRARIES) @list='$(sanelib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libgeniusvp2.la: $(libgeniusvp2_la_OBJECTS) $(libgeniusvp2_la_DEPENDENCIES) $(LINK) $(libgeniusvp2_la_OBJECTS) $(libgeniusvp2_la_LIBADD) $(LIBS) libls5000.la: $(libls5000_la_OBJECTS) $(libls5000_la_DEPENDENCIES) $(LINK) $(libls5000_la_OBJECTS) $(libls5000_la_LIBADD) $(LIBS) libsane-geniusvp2.la: $(libsane_geniusvp2_la_OBJECTS) $(libsane_geniusvp2_la_DEPENDENCIES) $(libsane_geniusvp2_la_LINK) $(libsane_geniusvp2_la_OBJECTS) $(libsane_geniusvp2_la_LIBADD) $(LIBS) libsane-ls5000.la: $(libsane_ls5000_la_OBJECTS) $(libsane_ls5000_la_DEPENDENCIES) $(libsane_ls5000_la_LINK) $(libsane_ls5000_la_OBJECTS) $(libsane_ls5000_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgeniusvp2_la-geniusvp2-adc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgeniusvp2_la-geniusvp2-asic.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgeniusvp2_la-geniusvp2-image.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgeniusvp2_la-geniusvp2-misc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgeniusvp2_la-geniusvp2-parport.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgeniusvp2_la-geniusvp2-switcher.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgeniusvp2_la-geniusvp2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libls5000_la-ls5000.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsane_geniusvp2_la-geniusvp2-s.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsane_ls5000_la-ls5000-s.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< libgeniusvp2_la-geniusvp2-adc.lo: geniusvp2-adc.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgeniusvp2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgeniusvp2_la-geniusvp2-adc.lo -MD -MP -MF $(DEPDIR)/libgeniusvp2_la-geniusvp2-adc.Tpo -c -o libgeniusvp2_la-geniusvp2-adc.lo `test -f 'geniusvp2-adc.c' || echo '$(srcdir)/'`geniusvp2-adc.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libgeniusvp2_la-geniusvp2-adc.Tpo $(DEPDIR)/libgeniusvp2_la-geniusvp2-adc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='geniusvp2-adc.c' object='libgeniusvp2_la-geniusvp2-adc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgeniusvp2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgeniusvp2_la-geniusvp2-adc.lo `test -f 'geniusvp2-adc.c' || echo '$(srcdir)/'`geniusvp2-adc.c libgeniusvp2_la-geniusvp2-asic.lo: geniusvp2-asic.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgeniusvp2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgeniusvp2_la-geniusvp2-asic.lo -MD -MP -MF $(DEPDIR)/libgeniusvp2_la-geniusvp2-asic.Tpo -c -o libgeniusvp2_la-geniusvp2-asic.lo `test -f 'geniusvp2-asic.c' || echo '$(srcdir)/'`geniusvp2-asic.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libgeniusvp2_la-geniusvp2-asic.Tpo $(DEPDIR)/libgeniusvp2_la-geniusvp2-asic.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='geniusvp2-asic.c' object='libgeniusvp2_la-geniusvp2-asic.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgeniusvp2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgeniusvp2_la-geniusvp2-asic.lo `test -f 'geniusvp2-asic.c' || echo '$(srcdir)/'`geniusvp2-asic.c libgeniusvp2_la-geniusvp2-image.lo: geniusvp2-image.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgeniusvp2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgeniusvp2_la-geniusvp2-image.lo -MD -MP -MF $(DEPDIR)/libgeniusvp2_la-geniusvp2-image.Tpo -c -o libgeniusvp2_la-geniusvp2-image.lo `test -f 'geniusvp2-image.c' || echo '$(srcdir)/'`geniusvp2-image.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libgeniusvp2_la-geniusvp2-image.Tpo $(DEPDIR)/libgeniusvp2_la-geniusvp2-image.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='geniusvp2-image.c' object='libgeniusvp2_la-geniusvp2-image.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgeniusvp2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgeniusvp2_la-geniusvp2-image.lo `test -f 'geniusvp2-image.c' || echo '$(srcdir)/'`geniusvp2-image.c libgeniusvp2_la-geniusvp2-misc.lo: geniusvp2-misc.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgeniusvp2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgeniusvp2_la-geniusvp2-misc.lo -MD -MP -MF $(DEPDIR)/libgeniusvp2_la-geniusvp2-misc.Tpo -c -o libgeniusvp2_la-geniusvp2-misc.lo `test -f 'geniusvp2-misc.c' || echo '$(srcdir)/'`geniusvp2-misc.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libgeniusvp2_la-geniusvp2-misc.Tpo $(DEPDIR)/libgeniusvp2_la-geniusvp2-misc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='geniusvp2-misc.c' object='libgeniusvp2_la-geniusvp2-misc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgeniusvp2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgeniusvp2_la-geniusvp2-misc.lo `test -f 'geniusvp2-misc.c' || echo '$(srcdir)/'`geniusvp2-misc.c libgeniusvp2_la-geniusvp2-parport.lo: geniusvp2-parport.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgeniusvp2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgeniusvp2_la-geniusvp2-parport.lo -MD -MP -MF $(DEPDIR)/libgeniusvp2_la-geniusvp2-parport.Tpo -c -o libgeniusvp2_la-geniusvp2-parport.lo `test -f 'geniusvp2-parport.c' || echo '$(srcdir)/'`geniusvp2-parport.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libgeniusvp2_la-geniusvp2-parport.Tpo $(DEPDIR)/libgeniusvp2_la-geniusvp2-parport.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='geniusvp2-parport.c' object='libgeniusvp2_la-geniusvp2-parport.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgeniusvp2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgeniusvp2_la-geniusvp2-parport.lo `test -f 'geniusvp2-parport.c' || echo '$(srcdir)/'`geniusvp2-parport.c libgeniusvp2_la-geniusvp2-switcher.lo: geniusvp2-switcher.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgeniusvp2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgeniusvp2_la-geniusvp2-switcher.lo -MD -MP -MF $(DEPDIR)/libgeniusvp2_la-geniusvp2-switcher.Tpo -c -o libgeniusvp2_la-geniusvp2-switcher.lo `test -f 'geniusvp2-switcher.c' || echo '$(srcdir)/'`geniusvp2-switcher.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libgeniusvp2_la-geniusvp2-switcher.Tpo $(DEPDIR)/libgeniusvp2_la-geniusvp2-switcher.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='geniusvp2-switcher.c' object='libgeniusvp2_la-geniusvp2-switcher.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgeniusvp2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgeniusvp2_la-geniusvp2-switcher.lo `test -f 'geniusvp2-switcher.c' || echo '$(srcdir)/'`geniusvp2-switcher.c libgeniusvp2_la-geniusvp2.lo: geniusvp2.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgeniusvp2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgeniusvp2_la-geniusvp2.lo -MD -MP -MF $(DEPDIR)/libgeniusvp2_la-geniusvp2.Tpo -c -o libgeniusvp2_la-geniusvp2.lo `test -f 'geniusvp2.c' || echo '$(srcdir)/'`geniusvp2.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libgeniusvp2_la-geniusvp2.Tpo $(DEPDIR)/libgeniusvp2_la-geniusvp2.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='geniusvp2.c' object='libgeniusvp2_la-geniusvp2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgeniusvp2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgeniusvp2_la-geniusvp2.lo `test -f 'geniusvp2.c' || echo '$(srcdir)/'`geniusvp2.c libls5000_la-ls5000.lo: ls5000.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libls5000_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libls5000_la-ls5000.lo -MD -MP -MF $(DEPDIR)/libls5000_la-ls5000.Tpo -c -o libls5000_la-ls5000.lo `test -f 'ls5000.c' || echo '$(srcdir)/'`ls5000.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libls5000_la-ls5000.Tpo $(DEPDIR)/libls5000_la-ls5000.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ls5000.c' object='libls5000_la-ls5000.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libls5000_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libls5000_la-ls5000.lo `test -f 'ls5000.c' || echo '$(srcdir)/'`ls5000.c libsane_geniusvp2_la-geniusvp2-s.lo: geniusvp2-s.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_geniusvp2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_geniusvp2_la-geniusvp2-s.lo -MD -MP -MF $(DEPDIR)/libsane_geniusvp2_la-geniusvp2-s.Tpo -c -o libsane_geniusvp2_la-geniusvp2-s.lo `test -f 'geniusvp2-s.c' || echo '$(srcdir)/'`geniusvp2-s.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_geniusvp2_la-geniusvp2-s.Tpo $(DEPDIR)/libsane_geniusvp2_la-geniusvp2-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='geniusvp2-s.c' object='libsane_geniusvp2_la-geniusvp2-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_geniusvp2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_geniusvp2_la-geniusvp2-s.lo `test -f 'geniusvp2-s.c' || echo '$(srcdir)/'`geniusvp2-s.c libsane_ls5000_la-ls5000-s.lo: ls5000-s.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_ls5000_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsane_ls5000_la-ls5000-s.lo -MD -MP -MF $(DEPDIR)/libsane_ls5000_la-ls5000-s.Tpo -c -o libsane_ls5000_la-ls5000-s.lo `test -f 'ls5000-s.c' || echo '$(srcdir)/'`ls5000-s.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsane_ls5000_la-ls5000-s.Tpo $(DEPDIR)/libsane_ls5000_la-ls5000-s.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ls5000-s.c' object='libsane_ls5000_la-ls5000-s.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsane_ls5000_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsane_ls5000_la-ls5000-s.lo `test -f 'ls5000-s.c' || echo '$(srcdir)/'`ls5000-s.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(sanelibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-libLTLIBRARIES clean-libtool clean-local \ clean-sanelibLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-sanelibLTLIBRARIES @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES uninstall-sanelibLTLIBRARIES @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: install-am install-data-am install-strip uninstall-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool clean-local \ clean-sanelibLTLIBRARIES ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-data-hook install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-ps install-ps-am install-sanelibLTLIBRARIES \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am uninstall-hook \ uninstall-libLTLIBRARIES uninstall-sanelibLTLIBRARIES all: becfg # FIXME: % is a GNU extension... This is only thing left requiring # use to use GNU make. %-s.c: $(srcdir)/stubs.c rm -f $@ $(LN_S) $(srcdir)/stubs.c $@ dll-preload.h: rm -f $@ list="$(PRELOADABLE_BACKENDS)"; for be in $$list; do \ echo "PRELOAD_DECL($$be)" >> $@; \ done echo "static struct backend preloaded_backends[] = {" >> $@ sep=""; \ list="$(PRELOADABLE_BACKENDS)"; \ if test -z "$${list}"; then \ echo { 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }} >> $@; \ else \ for be in $$list; do \ echo "$${sep}PRELOAD_DEFN($$be)" >> $@; \ sep=","; \ done; \ fi echo "};" >> $@ becfg: $(BACKEND_CONFS) .conf.in.conf: @echo Generating $@ from $^ @sed -e 's|@DATADIR@|$(datadir)|g' \ -e 's|@CONFIGDIR@|$(configdir)|g' \ -e 's|@DOCDIR@|$(docdir)|g' \ -e 's|@LIBDIR@|$(libdir)/sane|g' \ -e 's|@BINDIR@|$(bindir)|g' \ -e 's|@SBINDIR@|$(sbindir)|g' \ -e 's|@PACKAGEVERSION@|$(PACKAGE_VERSION)|g' $? > $@ install-data-hook: install-becfg install-firmware-path $(INSTALL_LOCKPATH) # Custom install target to install config files. Do not overwrite # files that have been previously installed so that user modifications # are not lost. install-becfg: @# Libtool has a bug where it will sometimes symlink the last @# installed library in $(sanelibdir) to $(sanelibdir)/libsane.*. @# Having two libsane's can cause issues so get rid of it. -rm -f $(DESTDIR)$(sanelibdir)/libsane.* test -z "$(configdir)" || $(MKDIR_P) "$(DESTDIR)$(configdir)" test -z "$(configdir)/dll.d" || $(MKDIR_P) "$(DESTDIR)$(configdir)/dll.d" @list="$(BACKEND_CONFS_ENABLED) saned.conf dll.conf"; for cfg in $$list; do \ if test ! -r $${cfg}; then continue; fi; \ if test -f $(DESTDIR)$(configdir)/$${cfg}; then \ echo NOT overwriting $${cfg} in $(configdir)...; \ else \ echo installing $${cfg} in $(configdir)/$${cfg}...; \ $(INSTALL_DATA) $${cfg} $(DESTDIR)$(configdir)/$${cfg} \ || exit 1; \ fi; \ done install-firmware-path: for dir in $(FIRMWARE_DIRS) ; do \ $(mkinstalldirs) $(DESTDIR)$(datadir)/sane/$${dir} ; \ done install-lockpath: $(mkinstalldirs) -m 775 -g $(LOCKPATH_GROUP) $(DESTDIR)$(locksanedir) uninstall-hook: rm -rf $(DESTDIR)$(libdir)/sane $(DESTDIR)$(configdir) $(DESTDIR)$(locksanedir) rm -f $(DESTDIR)$(libdir)/libsane.* -for dir in $(FIRMWARE_DIRS) ; do \ rmdir $(DESTDIR)$(datadir)/sane/$${dir} ; \ done clean-local: find . -type l -name \*-s.c | xargs rm -f # 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: sane-backends-extras-1.0.22.3ubuntu1/backend/geniusvp2-asic.h0000664000000000000000000000237611527030747020570 0ustar /* asic.h - ASIC registers I/O functions * * Copyright (C) 2004, 2005 Anderson Lizardo * * 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 of the License, 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 */ #include #include "geniusvp2-registers.h" extern int sane_geniusvp2_reg_read (unsigned char reg, unsigned char *data); extern int sane_geniusvp2_reg_read_buf (unsigned char reg, unsigned char *data, size_t size); extern int sane_geniusvp2_reg_write (unsigned char reg, unsigned char data); extern int sane_geniusvp2_reg_write_buf (unsigned char reg, unsigned char *data, size_t size); extern void sane_geniusvp2_init_regs (void); sane-backends-extras-1.0.22.3ubuntu1/backend/geniusvp2-image.c0000664000000000000000000002536511527030747020731 0ustar /* image.c - Calibration and image handling functions * * Copyright (C) 2004, 2005 Anderson Lizardo * * 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 of the License, 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 */ /* Disabled by now, until code gets fixed */ #if 0 #include #include #include "geniusvp2-adc.h" #include "geniusvp2-asic.h" #include "geniusvp2-image.h" #include "geniusvp2-misc.h" const int color_table_size = 4096; int redmax, greenmax, bluemax, redmin, greenmin, bluemin; /* * Calculate the color matrix */ void calc_color_table (scan_image * image) { int i; double midin, val, m, b; int maxin = color_table_size - 1; int maxout = 255; /* do the gamma correction observing the actual range of input data */ midin = (double) (redmin + redmax) / 2.0; b = (1.0 + image->color[0].brightness / 100.0) * midin; m = 1.0 + image->color[0].contrast / 100.0; for (i = 0; i <= maxin; i++) { val = ((double) i - midin) * m + b; if ((int) val < redmin) image->color_table[0][i] = 0; else { if ((int) val > redmax) image->color_table[0][i] = 255; else { image->color_table[0][i] = maxout * pow ((val - (double) redmin) / (double) (redmax - redmin), (1.0 / image->color[0].gamma)); } } } midin = (double) (greenmin + greenmax) / 2.0; b = (1.0 + image->color[1].brightness / 100.0) * midin; m = 1.0 + image->color[1].contrast / 100.0; for (i = 0; i <= maxin; i++) { val = ((double) i - midin) * m + b; if ((int) val < greenmin) image->color_table[1][i] = 0; else { if ((int) val > greenmax) image->color_table[1][i] = 255; else { image->color_table[1][i] = maxout * pow ((val - (double) greenmin) / (double) (greenmax - greenmin), (1.0 / image->color[1].gamma)); } } } midin = (double) (bluemin + bluemax) / 2.0; b = (1.0 + image->color[2].brightness / 100.0) * midin; m = 1.0 + image->color[2].contrast / 100.0; for (i = 0; i <= maxin; i++) { val = ((double) i - midin) * m + b; if ((int) val < bluemin) image->color_table[2][i] = 0; else { if ((int) val > bluemax) image->color_table[2][i] = 255; else { image->color_table[2][i] = maxout * pow ((val - (double) bluemin) / (double) (bluemax - bluemin), (1.0 / image->color[2].gamma)); } } } DBG (2, "min = %i %i %i max = %i %i %i \n", redmin, greenmin, bluemin, redmax, greenmax, bluemax); } void init_image (scan_image ** image) { int i; *image = malloc (sizeof (scan_image)); (*image)->width = 100; (*image)->height = 100; (*image)->resolution = 100; (*image)->from_top = 0; (*image)->from_left = 0; (*image)->num_colors = 3; for (i = 0; i < 3; i++) { ((*image)->color)[i].gamma = 1.0; ((*image)->color)[i].contrast = 0; ((*image)->color)[i].brightness = 0; (*image)->color_table[i] = malloc (color_table_size); } (*image)->filename = malloc (100); (*image)->filename = "test.tiff"; } /* FIXME: Calibration code is broken */ void calibrate (scan_image * image) { int i, j; int *whiteline, redlow, greenlow, bluelow; ScanArea area; /* Adjust offsets */ sane_geniusvp2_adjust_offset (); area.top = 0; area.left = 0; area.height = 200; area.width = 800; sane_geniusvp2_set_scan_area (area); sane_geniusvp2_set_scan_params (200); sane_geniusvp2_reset_fifo (); sane_geniusvp2_set_operation_mode (mStop); sane_geniusvp2_set_operation_mode (mScan); /* * here we are to find out the location of the calibration area and hence the window */ { int k, w, ystart; ystart = 0; for (j = 0; j < 50; j++) { sane_geniusvp2_wait_fifo (200); for (k = 0; k < 200; k++) sane_geniusvp2_reg_read (17, ®17.w); /* skip over the x-calibration strip */ w = 0; for (i = 0; i < 3; i++) { sane_geniusvp2_wait_fifo (200); for (k = 0; k < 200; k++) { sane_geniusvp2_reg_read (17, ®17.w); w = w + reg17.w; } } if (ystart == 0 && w > 0x78 * 600) ystart = j; } } /*sane_geniusvp2_set_operation_mode (mStop); ScanSpeed = 7; sane_geniusvp2_set_scan_speed (ScanSpeed); StepTime = max_exposure_time / (ScanSpeed + 1); if (StepTime < min_exposure_time) StepTime = min_exposure_time; sane_geniusvp2_set_step_time (StepTime); sane_geniusvp2_set_distance (0x0006); sane_geniusvp2_reg_read (6, ®6.w); reg6.r.MotorPower = 1; reg6.r.HalfFull = 1; sane_geniusvp2_reg_write (6, reg6.w); sane_geniusvp2_set_operation_mode (mBackward); sane_geniusvp2_poll_12 (0x08, 0x08); if (StepTime >= motor_change) sane_geniusvp2_reg_write (25, 0x00); else sane_geniusvp2_reg_write (25, 0x0f); */ sane_geniusvp2_go_home (); sane_geniusvp2_poll_12 (0x04, 0x04); /* Set location of the white area */ area.top = 236; sane_geniusvp2_move_carriage_forward (area.top); area.left = 131; area.height = 10; area.width = 8.5 * 600; sane_geniusvp2_set_scan_area (area); sane_geniusvp2_set_scan_params (600); sane_geniusvp2_reset_fifo (); sane_geniusvp2_set_operation_mode (mStop); sane_geniusvp2_set_operation_mode (mScan); /* Find max reading for each color */ { float redgain, greengain, bluegain; redgain = greengain = bluegain = 0.0; for (j = 0; j < area.height; j++) { sane_geniusvp2_wait_fifo (area.width); for (i = 0; i < area.width; i++) { sane_geniusvp2_reg_read (17, ®17.w); if (reg17.w > redgain) redgain = reg17.w; sane_geniusvp2_reg_read (17, ®17.w); if (reg17.w > greengain) greengain = reg17.w; sane_geniusvp2_reg_read (17, ®17.w); if (reg17.w > bluegain) bluegain = reg17.w; } } /* Convert color gains to ADC register codes */ redgain = ((210 / redgain) - 0.5) / 0.25; greengain = ((225 / greengain) - 0.5) / 0.25; bluegain = ((225 / bluegain) - 0.5) / 0.25; /* From the read above we can set max gain for each color */ sane_geniusvp2_set_adc_gain (redgain, greengain, bluegain); } /* Try out a new set of offsets for the current gain settings */ sane_geniusvp2_adjust_offset (); /* Do an extra read to see the final result */ sane_geniusvp2_get_avg_reading (&redmin, &greenmin, &bluemin); area.top = 0; area.left = 131; area.height = 40; area.width = 8.5 * 600; sane_geniusvp2_set_scan_area (area); sane_geniusvp2_set_scan_params (600); sane_geniusvp2_reset_fifo (); sane_geniusvp2_set_operation_mode (mStop); sane_geniusvp2_set_operation_mode (mScan); /* Test of calibration */ whiteline = calloc (5100 * 3, sizeof (int)); for (j = 0; j < 10; j++) { sane_geniusvp2_wait_fifo (5100); for (i = 0; i < 5100 * 3; i += 3) { sane_geniusvp2_reg_read (17, ®17.w); whiteline[i] = whiteline[i] + reg17.w; sane_geniusvp2_reg_read (17, ®17.w); whiteline[i + 1] = whiteline[i + 1] + reg17.w; sane_geniusvp2_reg_read (17, ®17.w); whiteline[i + 2] = whiteline[i + 2] + reg17.w; } } for (i = 0; i < 5100 * 3; i++) whiteline[i] = whiteline[i] / 10; /* Find the highest reading for each color */ redlow = greenlow = bluelow = 0; for (i = 0; i < 5100 * 3; i += 3) { if (whiteline[i] > redlow) redlow = whiteline[i]; if (whiteline[i + 1] > greenlow) greenlow = whiteline[i + 1]; if (whiteline[i + 2] > bluelow) bluelow = whiteline[i + 2]; } /* Load the x-direction map */ sane_geniusvp2_set_memory_addr (0x006000); redmax = 32 * (redlow - 124); greenmax = 32 * (greenlow - 124); bluemax = 32 * (bluelow - 124); for (i = 0; i < 132; i++) sane_geniusvp2_reg_write (17, 0); for (i = 0; i < 5100; i++) sane_geniusvp2_reg_write (17, (redlow - whiteline[i * 3]) * 3); for (i = 0; i < 912; i++) sane_geniusvp2_reg_write (17, 0); for (i = 0; i < 132; i++) sane_geniusvp2_reg_write (17, 0); for (i = 0; i < 1916; i++) sane_geniusvp2_reg_write (17, (redlow - whiteline[i * 3]) * 3); for (i = 0; i < 132; i++) sane_geniusvp2_reg_write (17, 0); for (i = 0; i < 5100; i++) sane_geniusvp2_reg_write (17, (greenlow - whiteline[i * 3 + 1]) * 3); for (i = 0; i < 912; i++) sane_geniusvp2_reg_write (17, 0); for (i = 0; i < 132; i++) sane_geniusvp2_reg_write (17, 0); for (i = 0; i < 5100; i++) sane_geniusvp2_reg_write (17, (bluelow - whiteline[i * 3 + 2]) * 3); for (i = 0; i < 912; i++) sane_geniusvp2_reg_write (17, 0); free (whiteline); sane_geniusvp2_set_memory_addr (0x003000); for (i = 0; i < 12 * 1024; i += 2) { sane_geniusvp2_reg_write (17, 0x80); sane_geniusvp2_reg_write (17, 0x00); } calc_color_table (image); /* Set up the final color-matrix */ /* Send colormap */ sane_geniusvp2_set_memory_addr (0x000000); for (i = 0; i < 3; i++) for (j = 0; j < color_table_size; j++) sane_geniusvp2_reg_write (17, (char) (image->color_table[i][j])); } #endif sane-backends-extras-1.0.22.3ubuntu1/backend/geniusvp2-switcher.c0000664000000000000000000000375311527030747021474 0ustar /* switcher.c - on/off switcher functions * * Copyright (C) 2004, 2005 Anderson Lizardo * * 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 of the License, 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 */ #include "geniusvp2-parport.h" #include "geniusvp2-switcher.h" static int switcher (unsigned char sequence, unsigned char onoff) { int offset, bit; sane_geniusvp2_pp_write (PP_CONTROL, 0xc4); sane_geniusvp2_pp_write (PP_DATA, 0xff); sane_geniusvp2_pp_write (PP_DATA, 0xfe); sane_geniusvp2_pp_write (PP_DATA, 0xff); for (bit = 7; bit >= 0; bit--) { offset = ((sequence >> bit) & 0x01) << 1; offset |= onoff; sane_geniusvp2_pp_write (PP_DATA, 0x71 + offset); /* send a double clock pulse */ sane_geniusvp2_pp_write (PP_DATA, 0xf1 + offset); sane_geniusvp2_pp_write (PP_DATA, 0x71 + offset); sane_geniusvp2_pp_write (PP_DATA, 0xf1 + offset); sane_geniusvp2_pp_write (PP_DATA, 0x71 + offset); } sane_geniusvp2_pp_write (PP_DATA, 0xff); if (onoff == 0x04) { /* scanner is online */ sane_geniusvp2_pp_write (PP_DATA, 0xfe); /* let the ASIC work */ sane_geniusvp2_pp_write (PP_DATA, 0xff); } return 0; } int sane_geniusvp2_scanner_on (void) { return switcher (0xf9, 0x04); } int sane_geniusvp2_scanner_off (void) { return switcher (0xf0, 0x00); } sane-backends-extras-1.0.22.3ubuntu1/backend/geniusvp2.c0000664000000000000000000014466611527030747017657 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 2004, 2005 Anderson Lizardo This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. SANE backend for the Genius ColorPage-Vivid Pro II scanner. */ #define BUILD 0 #include "../include/sane/config.h" #include #include #include #include #include #include #include #include #include #include #include "geniusvp2.h" #include "geniusvp2-asic.h" #include "geniusvp2-misc.h" #include "geniusvp2-parport.h" #include "geniusvp2-switcher.h" #include "../include/sane/saneopts.h" #include "../include/sane/sanei_thread.h" #define BACKEND_VERSION "0.2" #define VP2_CONFIG_FILE "geniusvp2.conf" #define VP2_DEFAULT_DEVICE "/dev/parport0" static SANE_Bool inited = SANE_FALSE; static int num_devices = 0; static SANE_Device **sane_device_list = NULL; static VP2_Device *first_vp2_device = NULL; static SANE_Range x_geometry_range = { SANE_FIX (0.0), SANE_FIX (216.0), SANE_FIX (1.0) }; static SANE_Range y_geometry_range = { SANE_FIX (0.0), SANE_FIX (297.0), SANE_FIX (1.0) }; static SANE_Range resolution_range = { 75, 600, 1 }; static SANE_String_Const mode_list[] = { SANE_VALUE_SCAN_MODE_COLOR, 0 }; static SANE_Int depth_list[] = { 1, 8 }; static void swap_double (double *a, double *b) { double c; c = *a; *a = *b; *b = c; return; } static size_t max_string_size (const SANE_String_Const strings[]) { size_t size, max_size = 0; SANE_Int i; for (i = 0; strings[i]; ++i) { size = strlen (strings[i]) + 1; if (size > max_size) max_size = size; } return max_size; } static SANE_Bool check_handle (SANE_Handle handle) { VP2_Device *vp2_device = first_vp2_device; while (vp2_device) { if (vp2_device == (VP2_Device *) handle) return SANE_TRUE; vp2_device = vp2_device->next; } return SANE_FALSE; } static SANE_Status init_options (VP2_Device * vp2_device) { SANE_Option_Descriptor *od; DBG (2, "init_options: vp2_device=%p\n", (void *) vp2_device); /* opt_num_opts */ od = &vp2_device->opt[opt_num_opts]; od->name = ""; od->title = SANE_TITLE_NUM_OPTIONS; od->desc = SANE_DESC_NUM_OPTIONS; od->type = SANE_TYPE_INT; od->unit = SANE_UNIT_NONE; od->size = sizeof (SANE_Word); od->cap = SANE_CAP_SOFT_DETECT; od->constraint_type = SANE_CONSTRAINT_NONE; od->constraint.range = 0; vp2_device->val[opt_num_opts].w = num_options; /* opt_mode_group */ od = &vp2_device->opt[opt_mode_group]; od->name = ""; od->title = SANE_I18N ("Scan Mode"); od->desc = ""; od->type = SANE_TYPE_GROUP; od->unit = SANE_UNIT_NONE; od->size = 0; od->cap = 0; od->constraint_type = SANE_CONSTRAINT_NONE; od->constraint.range = 0; vp2_device->val[opt_mode_group].w = 0; /* opt_mode */ od = &vp2_device->opt[opt_mode]; od->name = SANE_NAME_SCAN_MODE; od->title = SANE_TITLE_SCAN_MODE; od->desc = SANE_DESC_SCAN_MODE; od->type = SANE_TYPE_STRING; od->unit = SANE_UNIT_NONE; od->size = max_string_size (mode_list); od->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT; od->constraint_type = SANE_CONSTRAINT_STRING_LIST; od->constraint.string_list = mode_list; vp2_device->val[opt_mode].s = malloc (od->size); if (!vp2_device->val[opt_mode].s) return SANE_STATUS_NO_MEM; strcpy (vp2_device->val[opt_mode].s, "Color"); /* opt_depth */ od = &vp2_device->opt[opt_depth]; od->name = SANE_NAME_BIT_DEPTH; od->title = SANE_TITLE_BIT_DEPTH; od->desc = SANE_DESC_BIT_DEPTH; od->type = SANE_TYPE_INT; od->unit = SANE_UNIT_NONE; od->size = sizeof (SANE_Word); od->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT; od->constraint_type = SANE_CONSTRAINT_WORD_LIST; od->constraint.word_list = depth_list; vp2_device->val[opt_depth].w = 8; /* opt_resolution */ od = &vp2_device->opt[opt_resolution]; od->name = SANE_NAME_SCAN_RESOLUTION; od->title = SANE_TITLE_SCAN_RESOLUTION; od->desc = SANE_DESC_SCAN_RESOLUTION; od->type = SANE_TYPE_INT; od->unit = SANE_UNIT_DPI; od->size = sizeof (SANE_Word); od->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT; od->constraint_type = SANE_CONSTRAINT_RANGE; od->constraint.range = &resolution_range; vp2_device->val[opt_resolution].w = 200; /* opt_special_group */ od = &vp2_device->opt[opt_special_group]; od->name = ""; od->title = SANE_I18N ("Special Options"); od->desc = ""; od->type = SANE_TYPE_GROUP; od->unit = SANE_UNIT_NONE; od->size = 0; od->cap = 0; od->constraint_type = SANE_CONSTRAINT_NONE; od->constraint.range = 0; vp2_device->val[opt_special_group].w = 0; /* opt_print_options */ od = &vp2_device->opt[opt_print_options]; od->name = "print-options"; od->title = SANE_I18N ("Print options"); od->desc = SANE_I18N ("Print a list of all options."); od->type = SANE_TYPE_BUTTON; od->unit = SANE_UNIT_NONE; od->size = 0; od->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT; od->constraint_type = SANE_CONSTRAINT_NONE; od->constraint.string_list = 0; vp2_device->val[opt_print_options].w = 0; /* opt_geometry_group */ od = &vp2_device->opt[opt_geometry_group]; od->name = ""; od->title = SANE_I18N ("Geometry"); od->desc = ""; od->type = SANE_TYPE_GROUP; od->unit = SANE_UNIT_NONE; od->size = 0; od->cap = 0; od->constraint_type = SANE_CONSTRAINT_NONE; od->constraint.range = 0; vp2_device->val[opt_geometry_group].w = 0; /* opt_tl_x */ od = &vp2_device->opt[opt_tl_x]; od->name = SANE_NAME_SCAN_TL_X; od->title = SANE_TITLE_SCAN_TL_X; od->desc = SANE_DESC_SCAN_TL_X; od->type = SANE_TYPE_FIXED; od->unit = SANE_UNIT_MM; od->size = sizeof (SANE_Word); od->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT; od->constraint_type = SANE_CONSTRAINT_RANGE; od->constraint.range = &x_geometry_range; vp2_device->val[opt_tl_x].w = SANE_FIX (0.0); /* opt_tl_y */ od = &vp2_device->opt[opt_tl_y]; od->name = SANE_NAME_SCAN_TL_Y; od->title = SANE_TITLE_SCAN_TL_Y; od->desc = SANE_DESC_SCAN_TL_Y; od->type = SANE_TYPE_FIXED; od->unit = SANE_UNIT_MM; od->size = sizeof (SANE_Word); od->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT; od->constraint_type = SANE_CONSTRAINT_RANGE; od->constraint.range = &y_geometry_range; vp2_device->val[opt_tl_y].w = SANE_FIX (0.0); /* opt_br_x */ od = &vp2_device->opt[opt_br_x]; od->name = SANE_NAME_SCAN_BR_X; od->title = SANE_TITLE_SCAN_BR_X; od->desc = SANE_DESC_SCAN_BR_X; od->type = SANE_TYPE_FIXED; od->unit = SANE_UNIT_MM; od->size = sizeof (SANE_Word); od->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT; od->constraint_type = SANE_CONSTRAINT_RANGE; od->constraint.range = &x_geometry_range; vp2_device->val[opt_br_x].w = SANE_FIX (80.0); /* opt_br_y */ od = &vp2_device->opt[opt_br_y]; od->name = SANE_NAME_SCAN_BR_Y; od->title = SANE_TITLE_SCAN_BR_Y; od->desc = SANE_DESC_SCAN_BR_Y; od->type = SANE_TYPE_FIXED; od->unit = SANE_UNIT_MM; od->size = sizeof (SANE_Word); od->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_SOFT_SELECT; od->constraint_type = SANE_CONSTRAINT_RANGE; od->constraint.range = &y_geometry_range; vp2_device->val[opt_br_y].w = SANE_FIX (100.0); return SANE_STATUS_GOOD; } static SANE_Status read_option (SANE_String line, SANE_String option_string, parameter_type p_type, void *value) { SANE_String_Const cp; SANE_Char *word, *end; word = NULL; cp = sanei_config_get_string (line, &word); if (!word) return SANE_STATUS_INVAL; if (strcmp (word, option_string) != 0) return SANE_STATUS_INVAL; free (word); word = NULL; switch (p_type) { case param_none: return SANE_STATUS_GOOD; case param_bool: { cp = sanei_config_get_string (cp, &word); if (!word) return SANE_STATUS_INVAL; if (strlen (word) == 0) { DBG (3, "read_option: option `%s' requires parameter\n", option_string); return SANE_STATUS_INVAL; } if (strcmp (word, "true") != 0 && strcmp (word, "false") != 0) { DBG (3, "read_option: option `%s' requires parameter " "`true' or `false'\n", option_string); return SANE_STATUS_INVAL; } else if (strcmp (word, "true") == 0) *(SANE_Bool *) value = SANE_TRUE; else *(SANE_Bool *) value = SANE_FALSE; DBG (3, "read_option: set option `%s' to %s\n", option_string, *(SANE_Bool *) value == SANE_TRUE ? "true" : "false"); break; } case param_int: { SANE_Int int_value; cp = sanei_config_get_string (cp, &word); if (!word) return SANE_STATUS_INVAL; errno = 0; int_value = (SANE_Int) strtol (word, &end, 0); if (end == word) { DBG (3, "read_option: option `%s' requires parameter\n", option_string); return SANE_STATUS_INVAL; } else if (errno) { DBG (3, "read_option: option `%s': can't parse parameter `%s' " "(%s)\n", option_string, word, strerror (errno)); return SANE_STATUS_INVAL; } else { DBG (3, "read_option: set option `%s' to %d\n", option_string, int_value); *(SANE_Int *) value = int_value; } break; } case param_fixed: { double double_value; SANE_Fixed fixed_value; cp = sanei_config_get_string (cp, &word); if (!word) return SANE_STATUS_INVAL; errno = 0; double_value = strtod (word, &end); if (end == word) { DBG (3, "read_option: option `%s' requires parameter\n", option_string); return SANE_STATUS_INVAL; } else if (errno) { DBG (3, "read_option: option `%s': can't parse parameter `%s' " "(%s)\n", option_string, word, strerror (errno)); return SANE_STATUS_INVAL; } else { DBG (3, "read_option: set option `%s' to %.0f\n", option_string, double_value); fixed_value = SANE_FIX (double_value); *(SANE_Fixed *) value = fixed_value; } break; } case param_string: { cp = sanei_config_get_string (cp, &word); if (!word) return SANE_STATUS_INVAL; if (strlen (word) == 0) { DBG (3, "read_option: option `%s' requires parameter\n", option_string); return SANE_STATUS_INVAL; } else { DBG (3, "read_option: set option `%s' to `%s'\n", option_string, word); *(SANE_String *) value = strdup (word); } break; } default: DBG (1, "read_option: unknown param_type %d\n", p_type); return SANE_STATUS_INVAL; } /* switch */ if (word) free (word); word = NULL; return SANE_STATUS_GOOD; } static SANE_Status reader_process (VP2_Device * vp2_device, SANE_Int fd) { SANE_Word byte_count = 0, bytes_total; SANE_Byte *buffer = NULL, *buffer_ptr; ssize_t bytes_written = 0, buffer_size = 0; size_t write_count = 0; DBG (2, "(child) reader_process: vp2_device=%p, fd=%d\n", (void *) vp2_device, fd); bytes_total = vp2_device->lines * vp2_device->bytes_per_line; buffer = malloc (vp2_device->bytes_per_line); if (!buffer) { DBG (1, "(child) reader_process: could not malloc buffer\n"); return SANE_STATUS_NO_MEM; } DBG (2, "(child) reader_process: buffer=%p\n", buffer); while (byte_count < bytes_total) { buffer_size = sane_geniusvp2_wait_fifo (vp2_device->bytes_per_line); if (buffer_size > 0) { if (buffer_size > vp2_device->bytes_per_line) buffer_size = vp2_device->bytes_per_line; sane_geniusvp2_read_scan_data (buffer, buffer_size); } else if (buffer_size == 0) { DBG (1, "(child) reader_process: scanner returned EOF\n"); /*write (fd, NULL, 0);*/ close (fd); break; } else { DBG (1, "(child) reader_process: scanner timed out\n"); free (buffer); close (fd); return SANE_STATUS_IO_ERROR; } write_count = buffer_size; if (byte_count + (SANE_Word) write_count > bytes_total) write_count = bytes_total - byte_count; buffer_ptr = buffer; while (write_count > 0) { bytes_written = write (fd, buffer_ptr, write_count); if (bytes_written < 0) { DBG (1, "(child) reader_process: write returned %s\n", strerror (errno)); return SANE_STATUS_IO_ERROR; } byte_count += bytes_written; DBG (4, "(child) reader_process: wrote %ld bytes of %lu (%d total)\n", (long) bytes_written, (u_long) write_count, byte_count); buffer_ptr += bytes_written; write_count -= bytes_written; } } free (buffer); if (sanei_thread_is_forked ()) { DBG (4, "(child) reader_process: finished, wrote %d bytes, expected %d " "bytes, now waiting\n", byte_count, bytes_total); while (SANE_TRUE) sleep (10); DBG (4, "(child) reader_process: this should have never happened..."); close (fd); } else { DBG (4, "(child) reader_process: finished, wrote %d bytes, expected %d " "bytes\n", byte_count, bytes_total); } return SANE_STATUS_GOOD; } /* * this code either runs in child or thread context... */ static int reader_task (void *data) { SANE_Status status; struct SIGACTION act; struct VP2_Device *vp2_device = (struct VP2_Device *) data; DBG (2, "reader_task started\n"); if (sanei_thread_is_forked ()) { DBG (3, "reader_task started (forked)\n"); close (vp2_device->pipe); vp2_device->pipe = -1; } else { DBG (3, "reader_task started (as thread)\n"); } memset (&act, 0, sizeof (act)); sigaction (SIGTERM, &act, NULL); status = reader_process (vp2_device, vp2_device->reader_fds); DBG (2, "(child) reader_task: reader_process finished (%s)\n", sane_strstatus (status)); return (int) status; } static SANE_Status finish_pass (VP2_Device * vp2_device) { SANE_Status return_status = SANE_STATUS_GOOD; DBG (2, "finish_pass: vp2_device=%p\n", (void *) vp2_device); vp2_device->scanning = SANE_FALSE; if (vp2_device->pipe >= 0) { DBG (2, "finish_pass: closing pipe\n"); close (vp2_device->pipe); DBG (2, "finish_pass: pipe closed\n"); vp2_device->pipe = -1; } if (vp2_device->reader_pid > 0) { int status; int pid; DBG (2, "finish_pass: terminating reader process %d\n", vp2_device->reader_pid); sanei_thread_kill (vp2_device->reader_pid); pid = sanei_thread_waitpid (vp2_device->reader_pid, &status); if (pid < 0) { DBG (1, "finish_pass: sanei_thread_waitpid failed, already terminated? (%s)\n", strerror (errno)); } else { DBG (2, "finish_pass: reader process terminated with status: %s\n", sane_strstatus (status)); } vp2_device->reader_pid = 0; } /* this happens when running in thread context... */ if (vp2_device->reader_fds >= 0) { DBG (2, "finish_pass: closing reader pipe\n"); close (vp2_device->reader_fds); DBG (2, "finish_pass: reader pipe closed\n"); vp2_device->reader_fds = -1; } sane_geniusvp2_go_home (); return return_status; } static SANE_Status lamp_warmup (int warmup_time) { SANE_Status status = SANE_STATUS_GOOD; static struct timeval last_warmup; unsigned int remain_time; DBG (2, "lamp_warmup: warmup_time=%d\n", warmup_time); if (sane_geniusvp2_is_lamp_on ()) { struct timeval current_time; if (gettimeofday (¤t_time, NULL) == -1) { DBG (1, "lamp_warmup: gettimeofday returned %s\n", strerror (errno)); return SANE_STATUS_IO_ERROR; } if (current_time.tv_sec - last_warmup.tv_sec < warmup_time) { remain_time = warmup_time - (current_time.tv_sec - last_warmup.tv_sec); } else remain_time = 0; } else { status = sane_geniusvp2_lamp_on (); if (gettimeofday (&last_warmup, NULL) == -1) { DBG (1, "lamp_warmup: gettimeofday returned %s\n", strerror (errno)); return SANE_STATUS_IO_ERROR; } remain_time = warmup_time; } if (!remain_time) DBG (2, "lamp_warmup: lamp warm up is not necessary\n"); else { DBG (2, "lamp_warmup: lamp not completely warmed up, " "remaining time = %d sec\n", remain_time); sleep (remain_time); } return status; } static void print_options (VP2_Device * vp2_device) { SANE_Option_Descriptor *od; SANE_Word option_number; SANE_Char caps[1024]; for (option_number = 0; option_number < num_options; option_number++) { od = &vp2_device->opt[option_number]; DBG (0, "-----> number: %d\n", option_number); DBG (0, " name: `%s'\n", od->name); DBG (0, " title: `%s'\n", od->title); DBG (0, " description: `%s'\n", od->desc); DBG (0, " type: %s\n", od->type == SANE_TYPE_BOOL ? "SANE_TYPE_BOOL" : od->type == SANE_TYPE_INT ? "SANE_TYPE_INT" : od->type == SANE_TYPE_FIXED ? "SANE_TYPE_FIXED" : od->type == SANE_TYPE_STRING ? "SANE_TYPE_STRING" : od->type == SANE_TYPE_BUTTON ? "SANE_TYPE_BUTTON" : od->type == SANE_TYPE_GROUP ? "SANE_TYPE_GROUP" : "unknown"); DBG (0, " unit: %s\n", od->unit == SANE_UNIT_NONE ? "SANE_UNIT_NONE" : od->unit == SANE_UNIT_PIXEL ? "SANE_UNIT_PIXEL" : od->unit == SANE_UNIT_BIT ? "SANE_UNIT_BIT" : od->unit == SANE_UNIT_MM ? "SANE_UNIT_MM" : od->unit == SANE_UNIT_DPI ? "SANE_UNIT_DPI" : od->unit == SANE_UNIT_PERCENT ? "SANE_UNIT_PERCENT" : od->unit == SANE_UNIT_MICROSECOND ? "SANE_UNIT_MICROSECOND" : "unknown"); DBG (0, " size: %d\n", od->size); caps[0] = '\0'; if (od->cap & SANE_CAP_SOFT_SELECT) strcat (caps, "SANE_CAP_SOFT_SELECT "); if (od->cap & SANE_CAP_HARD_SELECT) strcat (caps, "SANE_CAP_HARD_SELECT "); if (od->cap & SANE_CAP_SOFT_DETECT) strcat (caps, "SANE_CAP_SOFT_DETECT "); if (od->cap & SANE_CAP_EMULATED) strcat (caps, "SANE_CAP_EMULATED "); if (od->cap & SANE_CAP_AUTOMATIC) strcat (caps, "SANE_CAP_AUTOMATIC "); if (od->cap & SANE_CAP_INACTIVE) strcat (caps, "SANE_CAP_INACTIVE "); if (od->cap & SANE_CAP_ADVANCED) strcat (caps, "SANE_CAP_ADVANCED "); DBG (0, " capabilities: %s\n", caps); DBG (0, "constraint type: %s\n", od->constraint_type == SANE_CONSTRAINT_NONE ? "SANE_CONSTRAINT_NONE" : od->constraint_type == SANE_CONSTRAINT_RANGE ? "SANE_CONSTRAINT_RANGE" : od->constraint_type == SANE_CONSTRAINT_WORD_LIST ? "SANE_CONSTRAINT_WORD_LIST" : od->constraint_type == SANE_CONSTRAINT_STRING_LIST ? "SANE_CONSTRAINT_STRING_LIST" : "unknown"); } } /***************************** SANE API ****************************/ SANE_Status sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) { FILE *fp; SANE_Int linenumber; SANE_Char line[PATH_MAX], *word; SANE_String_Const cp; SANE_String device_name = VP2_DEFAULT_DEVICE; VP2_Device *vp2_device = NULL; DBG_INIT (); sanei_thread_init (); DBG (2, "sane_init: version_code=%p, authorize=%p\n", (void *) version_code, (void *) authorize); DBG (1, "sane_init: SANE geniusvp2 backend version " BACKEND_VERSION " from %s\n", PACKAGE_STRING); if (version_code) *version_code = SANE_VERSION_CODE (V_MAJOR, V_MINOR, BUILD); if (inited) DBG (3, "sane_init: warning: already inited\n"); fp = sanei_config_open (VP2_CONFIG_FILE); if (fp) { linenumber = 0; DBG (4, "sane_init: reading config file `%s'\n", VP2_CONFIG_FILE); while (sanei_config_read (line, sizeof (line), fp)) { word = NULL; linenumber++; cp = sanei_config_get_string (line, &word); if (!word || cp == line) { DBG (5, "sane_init: config file line %3d: ignoring empty line\n", linenumber); if (word) free (word); continue; } if (word[0] == '#') { DBG (5, "sane_init: config file line %3d: ignoring comment line\n", linenumber); free (word); continue; } DBG (5, "sane_init: config file line %3d: `%s'\n", linenumber, line); if (read_option (line, "device", param_string, &device_name) == SANE_STATUS_GOOD) continue; DBG (3, "sane-init: I don't know how to handle option `%s'\n", word); } /* while */ fclose (fp); } /* if */ else { DBG (3, "sane_init: couldn't find config file (%s), using default " "settings\n", VP2_CONFIG_FILE); } /* the scanner does not need to be detected on this stage, so sane_init * always return success (except for "out of memory" errors) */ if (!sane_geniusvp2_parport_open (device_name)) { sane_geniusvp2_scanner_on (); sane_geniusvp2_reg_read (0, ®0.w); sane_geniusvp2_reg_read (24, ®24.w); DBG (4, "sane_init: ASIC ID = 0x%02x, Product ID = 0x%02x\n", reg0.r.AsicType, reg24.r.ProductID); sane_geniusvp2_scanner_off (); sane_geniusvp2_parport_close (); if (reg0.r.AsicType == VP2_ASIC_ID) { /* create device */ vp2_device = malloc (sizeof (VP2_Device)); if (!vp2_device) return SANE_STATUS_NO_MEM; switch (reg24.r.ProductID) { case VP2_PRODUCT_ID: vp2_device->sane.vendor = "Genius"; vp2_device->sane.model = "ColorPage-Vivid Pro II"; break; default: vp2_device->sane.vendor = "Unknown Vendor"; vp2_device->sane.model = "Unknown Model"; } vp2_device->sane.type = "flatbed scanner"; vp2_device->name = device_name; vp2_device->sane.name = vp2_device->name; vp2_device->open = SANE_FALSE; vp2_device->scanning = SANE_FALSE; vp2_device->cancelled = SANE_FALSE; vp2_device->eof = SANE_FALSE; vp2_device->reader_pid = -1; vp2_device->pipe = -1; /* this is currently redundant as we don't support multiple devices yet */ vp2_device->next = first_vp2_device; first_vp2_device = vp2_device; num_devices++; DBG (4, "sane_init: new device: `%s' is a %s %s %s\n", vp2_device->sane.name, vp2_device->sane.vendor, vp2_device->sane.model, vp2_device->sane.type); } else { DBG (1, "sane_init: scanner not found on %s or " "ASIC is not supported\n", device_name); } } inited = SANE_TRUE; return SANE_STATUS_GOOD; } void sane_exit (void) { VP2_Device *vp2_device, *previous_device; DBG (2, "sane_exit\n"); if (!inited) { DBG (1, "sane_exit: not inited, call sane_init() first\n"); return; } vp2_device = first_vp2_device; while (vp2_device) { DBG (4, "sane_exit: freeing device %s\n", vp2_device->name); previous_device = vp2_device; vp2_device = vp2_device->next; if (previous_device->name) free (previous_device->name); free (previous_device); } DBG (4, "sane_exit: freeing device list\n"); if (sane_device_list) free (sane_device_list); sane_device_list = NULL; first_vp2_device = NULL; inited = SANE_FALSE; return; } SANE_Status sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) { int i; VP2_Device *dev; DBG (2, "sane_get_devices: device_list=%p, local_only=%d\n", (void *) device_list, local_only); if (!inited) { DBG (1, "sane_get_devices: not inited, call sane_init() first\n"); return SANE_STATUS_INVAL; } /* already called, so cleanup */ if (sane_device_list) free (sane_device_list); sane_device_list = malloc ((num_devices + 1) * sizeof (SANE_Device *)); if (!sane_device_list) return SANE_STATUS_NO_MEM; for (i = 0, dev = first_vp2_device; (i < num_devices) && dev; i++, dev = dev->next) sane_device_list[i] = &dev->sane; sane_device_list[i] = NULL; *device_list = (const SANE_Device **) sane_device_list; return SANE_STATUS_GOOD; } SANE_Status sane_open (SANE_String_Const devicename, SANE_Handle * handle) { VP2_Device *vp2_device = first_vp2_device; SANE_Status status; DBG (2, "sane_open: devicename = \"%s\", handle=%p\n", devicename, (void *) handle); if (!inited) { DBG (1, "sane_open: not inited, call sane_init() first\n"); return SANE_STATUS_INVAL; } if (!handle) { DBG (1, "sane_open: handle == NULL\n"); return SANE_STATUS_INVAL; } if (!devicename || strlen (devicename) == 0) { DBG (2, "sane_open: device name NULL or empty\n"); } else { for (vp2_device = first_vp2_device; vp2_device; vp2_device = vp2_device->next) { if (strcmp (devicename, vp2_device->name) == 0) break; } } if (!vp2_device) { DBG (1, "sane_open: device `%s' not found\n", devicename); return SANE_STATUS_INVAL; } if (vp2_device->open) { DBG (1, "sane_open: device `%s' already open\n", devicename); return SANE_STATUS_DEVICE_BUSY; } DBG (2, "sane_open: opening device `%s', handle = %p\n", vp2_device->name, (void *) vp2_device); status = init_options (vp2_device); if (status != SANE_STATUS_GOOD) return status; if (sane_geniusvp2_parport_open (devicename)) return SANE_STATUS_IO_ERROR; sane_geniusvp2_scanner_on (); sane_geniusvp2_lamp_off (); /* just in case lamp was left on */ sane_geniusvp2_go_home (); lamp_warmup (0); vp2_device->open = SANE_TRUE; vp2_device->scanning = SANE_FALSE; vp2_device->cancelled = SANE_FALSE; vp2_device->eof = SANE_FALSE; vp2_device->bytes_total = 0; *handle = vp2_device; return SANE_STATUS_GOOD; } void sane_close (SANE_Handle handle) { VP2_Device *vp2_device = handle; DBG (2, "sane_close: handle=%p\n", (void *) handle); if (!inited) { DBG (1, "sane_close: not inited, call sane_init() first\n"); return; } if (!check_handle (handle)) { DBG (1, "sane_close: handle %p unknown\n", (void *) handle); return; } if (!vp2_device->open) { DBG (1, "sane_close: handle %p not open\n", (void *) handle); return; } sane_geniusvp2_lamp_off (); sane_geniusvp2_scanner_off (); sane_geniusvp2_parport_close (); vp2_device->open = SANE_FALSE; return; } const SANE_Option_Descriptor * sane_get_option_descriptor (SANE_Handle handle, SANE_Int option) { VP2_Device *vp2_device = handle; DBG (4, "sane_get_option_descriptor: handle=%p, option = %d\n", (void *) handle, option); if (!inited) { DBG (1, "sane_get_option_descriptor: not inited, call sane_init() " "first\n"); return 0; } if (!check_handle (handle)) { DBG (1, "sane_get_option_descriptor: handle %p unknown\n", (void *) handle); return 0; } if (!vp2_device->open) { DBG (1, "sane_get_option_descriptor: not open\n"); return 0; } if (option < 0 || option >= num_options) { DBG (3, "sane_get_option_descriptor: option < 0 || " "option > num_options\n"); return 0; } return &vp2_device->opt[option]; } SANE_Status sane_control_option (SANE_Handle handle, SANE_Int option, SANE_Action action, void *value, SANE_Int * info) { VP2_Device *vp2_device = handle; SANE_Int myinfo = 0; SANE_Status status; DBG (4, "sane_control_option: handle=%p, opt=%d, act=%d, val=%p, info=%p\n", (void *) handle, option, action, (void *) value, (void *) info); if (!inited) { DBG (1, "sane_control_option: not inited, call sane_init() first\n"); return SANE_STATUS_INVAL; } if (!check_handle (handle)) { DBG (1, "sane_control_option: handle %p unknown\n", (void *) handle); return SANE_STATUS_INVAL; } if (!vp2_device->open) { DBG (1, "sane_control_option: not open\n"); return SANE_STATUS_INVAL; } if (vp2_device->scanning) { DBG (1, "sane_control_option: is scanning\n"); return SANE_STATUS_INVAL; } if (option < 0 || option >= num_options) { DBG (1, "sane_control_option: option < 0 || option > num_options\n"); return SANE_STATUS_INVAL; } if (!SANE_OPTION_IS_ACTIVE (vp2_device->opt[option].cap)) { DBG (1, "sane_control_option: option is inactive\n"); return SANE_STATUS_INVAL; } if (vp2_device->opt[option].type == SANE_TYPE_GROUP) { DBG (1, "sane_control_option: option is a group\n"); return SANE_STATUS_INVAL; } switch (action) { case SANE_ACTION_SET_AUTO: if (!SANE_OPTION_IS_SETTABLE (vp2_device->opt[option].cap)) { DBG (1, "sane_control_option: option is not setable\n"); return SANE_STATUS_INVAL; } if (!(vp2_device->opt[option].cap & SANE_CAP_AUTOMATIC)) { DBG (1, "sane_control_option: option is not automatically " "setable\n"); return SANE_STATUS_INVAL; } switch (option) { default: DBG (1, "sane_control_option: trying to automatically set " "unexpected option\n"); return SANE_STATUS_INVAL; } break; case SANE_ACTION_SET_VALUE: if (!SANE_OPTION_IS_SETTABLE (vp2_device->opt[option].cap)) { DBG (1, "sane_control_option: option is not setable\n"); return SANE_STATUS_INVAL; } status = sanei_constrain_value (&vp2_device->opt[option], value, &myinfo); if (status != SANE_STATUS_GOOD) { DBG (3, "sane_control_option: sanei_constrain_value returned %s\n", sane_strstatus (status)); return status; } switch (option) { case opt_tl_x: /* Fixed with parameter reloading */ case opt_tl_y: case opt_br_x: case opt_br_y: if (vp2_device->val[option].w == *(SANE_Fixed *) value) { DBG (4, "sane_control_option: option %d (%s) not changed\n", option, vp2_device->opt[option].name); break; } vp2_device->val[option].w = *(SANE_Fixed *) value; myinfo |= SANE_INFO_RELOAD_PARAMS; DBG (4, "sane_control_option: set option %d (%s) to %.0f %s\n", option, vp2_device->opt[option].name, SANE_UNFIX (*(SANE_Fixed *) value), vp2_device->opt[option].unit == SANE_UNIT_MM ? "mm" : ""); break; case opt_resolution: /* Int */ if (vp2_device->val[option].w == *(SANE_Int *) value) { DBG (4, "sane_control_option: option %d (%s) not changed\n", option, vp2_device->opt[option].name); break; } vp2_device->val[option].w = *(SANE_Int *) value; DBG (4, "sane_control_option: set option %d (%s) to %d\n", option, vp2_device->opt[option].name, *(SANE_Int *) value); break; case opt_depth: /* Word list with parameter and options reloading */ if (vp2_device->val[option].w == *(SANE_Int *) value) { DBG (4, "sane_control_option: option %d (%s) not changed\n", option, vp2_device->opt[option].name); break; } vp2_device->val[option].w = *(SANE_Int *) value; myinfo |= SANE_INFO_RELOAD_PARAMS; myinfo |= SANE_INFO_RELOAD_OPTIONS; DBG (4, "sane_control_option: set option %d (%s) to %d\n", option, vp2_device->opt[option].name, *(SANE_Int *) value); break; /* options with side-effects */ case opt_print_options: DBG (4, "sane_control_option: set option %d (%s)\n", option, vp2_device->opt[option].name); print_options (vp2_device); break; case opt_mode: if (strcmp (vp2_device->val[option].s, value) == 0) { DBG (4, "sane_control_option: option %d (%s) not changed\n", option, vp2_device->opt[option].name); break; } strcpy (vp2_device->val[option].s, (SANE_String) value); myinfo |= SANE_INFO_RELOAD_PARAMS; myinfo |= SANE_INFO_RELOAD_OPTIONS; DBG (4, "sane_control_option: set option %d (%s) to %s\n", option, vp2_device->opt[option].name, (SANE_String) value); break; default: DBG (1, "sane_control_option: trying to set unexpected option\n"); return SANE_STATUS_INVAL; } break; case SANE_ACTION_GET_VALUE: switch (option) { case opt_num_opts: *(SANE_Word *) value = num_options; DBG (4, "sane_control_option: get option 0, value = %d\n", num_options); break; case opt_tl_x: /* Fixed options */ case opt_tl_y: case opt_br_x: case opt_br_y: { *(SANE_Fixed *) value = vp2_device->val[option].w; DBG (4, "sane_control_option: get option %d (%s), value=%.1f %s\n", option, vp2_device->opt[option].name, SANE_UNFIX (*(SANE_Fixed *) value), vp2_device->opt[option].unit == SANE_UNIT_MM ? "mm" : ""); break; } case opt_mode: /* String (list) options */ strcpy (value, vp2_device->val[option].s); DBG (4, "sane_control_option: get option %d (%s), value=`%s'\n", option, vp2_device->opt[option].name, (SANE_String) value); break; case opt_depth: /* Int + word list options */ case opt_resolution: *(SANE_Int *) value = vp2_device->val[option].w; DBG (4, "sane_control_option: get option %d (%s), value=%d\n", option, vp2_device->opt[option].name, *(SANE_Int *) value); break; default: DBG (1, "sane_control_option: trying to get unexpected option\n"); return SANE_STATUS_INVAL; } break; default: DBG (1, "sane_control_option: trying unexpected action %d\n", action); return SANE_STATUS_INVAL; } if (info) *info = myinfo; DBG (4, "sane_control_option: finished, info=%s %s %s \n", myinfo & SANE_INFO_INEXACT ? "inexact" : "", myinfo & SANE_INFO_RELOAD_PARAMS ? "reload_parameters" : "", myinfo & SANE_INFO_RELOAD_OPTIONS ? "reload_options" : ""); return SANE_STATUS_GOOD; } SANE_Status sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) { VP2_Device *vp2_device = handle; SANE_Parameters *p; double tl_x = 0, tl_y = 0, br_x = 0, br_y = 0; SANE_String text_format, mode; SANE_Int channels = 1, res; DBG (2, "sane_get_parameters: handle=%p, params=%p\n", (void *) handle, (void *) params); if (!inited) { DBG (1, "sane_get_parameters: not inited, call sane_init() first\n"); return SANE_STATUS_INVAL; } if (!check_handle (handle)) { DBG (1, "sane_get_parameters: handle %p unknown\n", (void *) handle); return SANE_STATUS_INVAL; } if (!vp2_device->open) { DBG (1, "sane_get_parameters: handle %p not open\n", (void *) handle); return SANE_STATUS_INVAL; } res = vp2_device->val[opt_resolution].w; mode = vp2_device->val[opt_mode].s; p = &vp2_device->params; p->depth = vp2_device->val[opt_depth].w; tl_x = SANE_UNFIX (vp2_device->val[opt_tl_x].w); tl_y = SANE_UNFIX (vp2_device->val[opt_tl_y].w); br_x = SANE_UNFIX (vp2_device->val[opt_br_x].w); br_y = SANE_UNFIX (vp2_device->val[opt_br_y].w); if (tl_x > br_x) swap_double (&tl_x, &br_x); if (tl_y > br_y) swap_double (&tl_y, &br_y); vp2_device->lines = (SANE_Word) (res * (br_y - tl_y) / MM_PER_INCH); if (vp2_device->lines < 1) vp2_device->lines = 1; p->lines = vp2_device->lines; if (strcmp (mode, "Gray") == 0) { p->format = SANE_FRAME_GRAY; p->last_frame = SANE_TRUE; } else /* Color */ { p->format = SANE_FRAME_RGB; p->last_frame = SANE_TRUE; } p->pixels_per_line = (SANE_Int) (res * (br_x - tl_x) / MM_PER_INCH); if (p->pixels_per_line < 1) p->pixels_per_line = 1; if (p->format == SANE_FRAME_RGB) channels = 3; if (p->depth == 1) p->bytes_per_line = channels * (int) ((p->pixels_per_line + 7) / 8); else /* depth == 8 || depth == 16 */ p->bytes_per_line = channels * p->pixels_per_line * ((p->depth + 7) / 8); vp2_device->bytes_per_line = p->bytes_per_line; if (p->pixels_per_line < 1) p->pixels_per_line = 1; vp2_device->pixels_per_line = p->pixels_per_line; switch (p->format) { case SANE_FRAME_GRAY: text_format = "gray"; break; case SANE_FRAME_RGB: text_format = "rgb"; break; case SANE_FRAME_RED: text_format = "red"; break; case SANE_FRAME_GREEN: text_format = "green"; break; case SANE_FRAME_BLUE: text_format = "blue"; break; default: text_format = "unknown"; break; } DBG (3, "sane_get_parameters: format=%s\n", text_format); DBG (3, "sane_get_parameters: last_frame=%s\n", p->last_frame ? "true" : "false"); DBG (3, "sane_get_parameters: lines=%d\n", p->lines); DBG (3, "sane_get_parameters: depth=%d\n", p->depth); DBG (3, "sane_get_parameters: pixels_per_line=%d\n", p->pixels_per_line); DBG (3, "sane_get_parameters: bytes_per_line=%d\n", p->bytes_per_line); if (params) *params = *p; return SANE_STATUS_GOOD; } SANE_Status sane_start (SANE_Handle handle) { VP2_Device *vp2_device = handle; SANE_Status status; int pipe_descriptor[2]; ScanArea area; DBG (2, "sane_start: handle=%p\n", handle); if (!inited) { DBG (1, "sane_start: not inited, call sane_init() first\n"); return SANE_STATUS_INVAL; } if (!check_handle (handle)) { DBG (1, "sane_start: handle %p unknown\n", handle); return SANE_STATUS_INVAL; } if (!vp2_device->open) { DBG (1, "sane_start: not open\n"); return SANE_STATUS_INVAL; } if (vp2_device->scanning && strcmp (vp2_device->val[opt_mode].s, "Color") == 0) { DBG (1, "sane_start: already scanning\n"); return SANE_STATUS_INVAL; } vp2_device->scanning = SANE_TRUE; vp2_device->cancelled = SANE_FALSE; vp2_device->eof = SANE_FALSE; vp2_device->bytes_total = 0; sane_get_parameters (handle, 0); if (vp2_device->params.lines == 0) { DBG (1, "sane_start: lines == 0\n"); vp2_device->scanning = SANE_FALSE; return SANE_STATUS_INVAL; } if (vp2_device->params.pixels_per_line == 0) { DBG (1, "sane_start: pixels_per_line == 0\n"); vp2_device->scanning = SANE_FALSE; return SANE_STATUS_INVAL; } if (vp2_device->params.bytes_per_line == 0) { DBG (1, "sane_start: bytes_per_line == 0\n"); vp2_device->scanning = SANE_FALSE; return SANE_STATUS_INVAL; } if (pipe (pipe_descriptor) < 0) { DBG (1, "sane_start: pipe failed (%s)\n", strerror (errno)); return SANE_STATUS_IO_ERROR; } status = lamp_warmup (35); if (status != SANE_STATUS_GOOD) { DBG (1, "sane_start: lamp warm up failed (%s)\n", sane_strstatus (status)); } area.top = (SANE_UNFIX (vp2_device->val[opt_tl_y].w) / MM_PER_INCH + 0.47) * OPT_RESOLUTION * 2; /* Add some offset to skip over hidden left margin */ area.left = (SANE_UNFIX (vp2_device->val[opt_tl_x].w) / MM_PER_INCH + left_leading) * OPT_RESOLUTION; area.height = vp2_device->lines * (OPT_RESOLUTION / SANE_UNFIX (vp2_device->val[opt_resolution].w)); area.width = vp2_device->pixels_per_line; sane_geniusvp2_prepare_scan (area, vp2_device->val[opt_resolution].w); /* create reader routine as new process or thread */ vp2_device->pipe = pipe_descriptor[0]; vp2_device->reader_fds = pipe_descriptor[1]; vp2_device->reader_pid = sanei_thread_begin (reader_task, (void *) vp2_device); if (vp2_device->reader_pid < 0) { DBG (1, "sane_start: sanei_thread_begin failed (%s)\n", strerror (errno)); return SANE_STATUS_NO_MEM; } if (sanei_thread_is_forked ()) { close (vp2_device->reader_fds); vp2_device->reader_fds = -1; } return SANE_STATUS_GOOD; } SANE_Status sane_read (SANE_Handle handle, SANE_Byte * data, SANE_Int max_length, SANE_Int * length) { VP2_Device *vp2_device = handle; ssize_t bytes_read; SANE_Int bytes_total = vp2_device->lines * vp2_device->bytes_per_line; DBG (4, "sane_read: handle=%p, data=%p, max_length=%d, length=%p\n", handle, data, max_length, (void *) length); if (!inited) { DBG (1, "sane_read: not inited, call sane_init() first\n"); return SANE_STATUS_INVAL; } if (!check_handle (handle)) { DBG (1, "sane_read: handle %p unknown\n", handle); return SANE_STATUS_INVAL; } if (!length) { DBG (1, "sane_read: length == NULL\n"); return SANE_STATUS_INVAL; } *length = 0; if (!data) { DBG (1, "sane_read: data == NULL\n"); return SANE_STATUS_INVAL; } if (!vp2_device->open) { DBG (1, "sane_read: not open\n"); return SANE_STATUS_INVAL; } if (vp2_device->cancelled) { DBG (1, "sane_read: scan was cancelled\n"); return SANE_STATUS_CANCELLED; } if (vp2_device->eof) { DBG (2, "sane_read: No more data available, sending EOF\n"); return SANE_STATUS_EOF; } if (!vp2_device->scanning) { DBG (1, "sane_read: not scanning (call sane_start first)\n"); return SANE_STATUS_INVAL; } bytes_read = read (vp2_device->pipe, data, max_length); if (bytes_read == 0 || (bytes_read + vp2_device->bytes_total >= bytes_total)) { SANE_Status status; DBG (2, "sane_read: EOF reached\n"); status = finish_pass (vp2_device); if (status != SANE_STATUS_GOOD) { DBG (1, "sane_read: finish_pass returned `%s'\n", sane_strstatus (status)); return status; } vp2_device->eof = SANE_TRUE; if (bytes_read == 0) return SANE_STATUS_EOF; } else if (bytes_read < 0) { if (errno == EAGAIN) { DBG (2, "sane_read: no data available, try again\n"); return SANE_STATUS_GOOD; } else { DBG (1, "sane_read: read returned error: %s\n", strerror (errno)); return SANE_STATUS_IO_ERROR; } } *length = bytes_read; vp2_device->bytes_total += bytes_read; DBG (2, "sane_read: read %ld bytes of %d, total %d\n", (long) bytes_read, max_length, vp2_device->bytes_total); return SANE_STATUS_GOOD; } void sane_cancel (SANE_Handle handle) { VP2_Device *vp2_device = handle; DBG (2, "sane_cancel: handle = %p\n", handle); if (!inited) { DBG (1, "sane_cancel: not inited, call sane_init() first\n"); return; } if (!check_handle (handle)) { DBG (1, "sane_cancel: handle %p unknown\n", handle); return; } if (!vp2_device->open) { DBG (1, "sane_cancel: not open\n"); return; } if (vp2_device->cancelled) { DBG (1, "sane_cancel: scan already cancelled\n"); return; } if (!vp2_device->scanning) { DBG (2, "sane_cancel: scan is already finished\n"); return; } finish_pass (vp2_device); vp2_device->cancelled = SANE_TRUE; vp2_device->scanning = SANE_FALSE; vp2_device->eof = SANE_FALSE; return; } SANE_Status sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking) { VP2_Device *vp2_device = handle; DBG (2, "sane_set_io_mode: handle = %p, non_blocking = %d\n", handle, non_blocking); if (!inited) { DBG (1, "sane_set_io_mode: not inited, call sane_init() first\n"); return SANE_STATUS_INVAL; } if (!check_handle (handle)) { DBG (1, "sane_set_io_mode: handle %p unknown\n", handle); return SANE_STATUS_INVAL; } if (!vp2_device->open) { DBG (1, "sane_set_io_mode: not open\n"); return SANE_STATUS_INVAL; } if (!vp2_device->scanning) { DBG (1, "sane_set_io_mode: not scanning\n"); return SANE_STATUS_INVAL; } if (fcntl (vp2_device->pipe, F_SETFL, non_blocking ? O_NONBLOCK : 0) < 0) { DBG (1, "sane_set_io_mode: can't set io mode"); return SANE_STATUS_INVAL; } return SANE_STATUS_GOOD; } SANE_Status sane_get_select_fd (SANE_Handle handle, SANE_Int * fd) { VP2_Device *vp2_device = handle; DBG (2, "sane_get_select_fd: handle = %p, fd %s 0\n", handle, fd ? "!=" : "=="); if (!inited) { DBG (1, "sane_get_select_fd: not inited, call sane_init() first\n"); return SANE_STATUS_INVAL; } if (!check_handle (handle)) { DBG (1, "sane_get_select_fd: handle %p unknown\n", handle); return SANE_STATUS_INVAL; } if (!vp2_device->open) { DBG (1, "sane_get_select_fd: not open\n"); return SANE_STATUS_INVAL; } if (!vp2_device->scanning) { DBG (1, "sane_get_select_fd: not scanning\n"); return SANE_STATUS_INVAL; } *fd = vp2_device->pipe; return SANE_STATUS_GOOD; } sane-backends-extras-1.0.22.3ubuntu1/backend/geniusvp2-adc.h0000664000000000000000000000203511527030747020370 0ustar /* adc.h - WM8143-12 ADC I/O functions * * Copyright (C) 2004, 2005 Anderson Lizardo * * 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 of the License, 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 */ extern void sane_geniusvp2_set_adc_gain (int rgain, int ggain, int bgain); extern void sane_geniusvp2_init_adc (void); extern void sane_geniusvp2_adjust_offset (void); extern void sane_geniusvp2_get_avg_reading (int *red, int *green, int *blue); sane-backends-extras-1.0.22.3ubuntu1/backend/geniusvp2-misc.h0000664000000000000000000000537211527030747020603 0ustar /* misc.h - Various functions that do not have a proper file (yet) * * Copyright (C) 2004, 2005 Anderson Lizardo * * 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 of the License, 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 */ #define DEBUG_DECLARE_ONLY #include "geniusvp2.h" #include "geniusvp2-image.h" #define TIMEOUT 1 #define NO_TIMEOUT 0 #ifndef timercmp #define timercmp(a, b, CMP) \ (((a)->tv_sec == (b)->tv_sec) ? \ ((a)->tv_usec CMP (b)->tv_usec) : \ ((a)->tv_sec CMP (b)->tv_sec)) #endif /* Optical resolution in dpi's */ #define OPT_RESOLUTION 600 typedef struct { int top, left; /* top-left corner coordinates, in pixels */ int width, height; /* width and height, in pixels */ } ScanArea; typedef enum { mStop = 0, mPause = 1, mForward = 2, mBackward = 3, mScan = 4, mAutoHome = 5, mScanMotorOff /* mScan with motor power off, not an actual operation mode */ } operation_mode; extern const unsigned char ccd_line_offset; /* Default values from e1.ini */ extern const int max_exposure_time; extern const int min_exposure_time; extern const int motor_change; extern const float left_leading; extern const int back_step; extern void get_fifo_count (size_t * count); extern void sane_geniusvp2_go_home (void); extern SANE_Bool sane_geniusvp2_is_lamp_on (void); extern SANE_Status sane_geniusvp2_lamp_off (void); extern SANE_Status sane_geniusvp2_lamp_on (void); extern void sane_geniusvp2_move_carriage_forward (int distance); extern void sane_geniusvp2_poll_12 (unsigned char val, unsigned char mask); extern int sane_geniusvp2_read_scan_data (SANE_Byte * data, size_t size); extern void sane_geniusvp2_reset_fifo (void); extern SANE_Status sane_geniusvp2_prepare_scan (ScanArea area, int res); extern void sane_geniusvp2_set_memory_addr (int addr); extern void sane_geniusvp2_set_operation_mode (operation_mode mode); extern void sane_geniusvp2_set_scan_area (ScanArea area); extern void sane_geniusvp2_set_scan_params (int res); extern ssize_t sane_geniusvp2_wait_fifo (size_t count); sane-backends-extras-1.0.22.3ubuntu1/backend/geniusvp2-parport.c0000664000000000000000000001437411527030747021334 0ustar /* parport.c - Parallel port I/O functions * * Copyright (C) 2004, 2005 Anderson Lizardo * * 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 of the License, 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 */ #include #include #include #include #include #include #include #ifdef __linux__ # include # include #elif defined (__FreeBSD__) || defined(__FreeBSD_kernel__) # include # include # define PPRDATA PPIGDATA # define PPWDATA PPISDATA # define PPRSTATUS PPIGSTATUS # define PPWSTATUS PPISSTATUS # define PPRCONTROL PPIGCTRL # define PPWCONTROL PPISCTRL /* Not available anymore in userland in FreeBSD 8, for no good reason */ # define PPB_COMPATIBLE 0x0 # define PPB_EPP 0x4 #endif #define DEBUG_DECLARE_ONLY #include "geniusvp2.h" #include "geniusvp2-parport.h" static int port_fd; int sane_geniusvp2_parport_open (const char *pp_device) { int retval; unsigned int port_feature; port_fd = open (pp_device, O_RDWR); if (port_fd == -1) { DBG (1, "sane_geniusvp2_parport_open: could not open %s (%s)\n", pp_device, strerror (errno)); return 1; } #ifdef __linux__ retval = ioctl (port_fd, PPCLAIM); if (retval == -1) { DBG (1, "sane_geniusvp2_parport_open: could not claim port access (%s)\n", strerror (errno)); retval = close (port_fd); if (retval == -1) DBG (1, "sane_geniusvp2_parport_open: could not close port (%s)\n", strerror (errno)); return 1; } retval = ioctl (port_fd, PPGETMODES, &port_feature); if (retval == -1) { DBG (1, "sane_geniusvp2_parport_open: warning: could not get port capabilities " "(%s), assuming EPP is present\n", strerror (errno)); } else if (!(port_feature & PARPORT_MODE_EPP)) { DBG (1, "sane_geniusvp2_parport_open: this port does not support EPP mode, " "please enable EPP or EPP+ECP mode\n"); retval = ioctl (port_fd, PPRELEASE); if (retval == -1) DBG (1, "sane_geniusvp2_parport_open: could not release port (%s)\n", strerror (errno)); retval = close (port_fd); if (retval == -1) DBG (1, "sane_geniusvp2_parport_open: could not close port (%s)\n", strerror (errno)); return 1; } #elif defined (__FreeBSD__) || defined(__FreeBSD_kernel__) port_feature = PPB_EPP; retval = ioctl (port_fd, PPISECR, &port_feature); if (retval == -1) { DBG (1, "sane_geniusvp2_parport_open: could not switch port to EPP mode, " "please enable EPP or EPP+ECP mode (%s)\n", strerror (errno)); return 1; } #endif return 0; } int sane_geniusvp2_parport_close (void) { int retval; #ifdef __linux__ const int compat = IEEE1284_MODE_COMPAT; retval = ioctl (port_fd, PPNEGOT, &compat); #elif defined (__FreeBSD__) || defined(__FreeBSD_kernel__) const int compat = PPB_COMPATIBLE; retval = ioctl (port_fd, PPISECR, &compat); if (retval == -1) DBG (1, "sane_geniusvp2_parport_close: warning: could not negotiate " "compatibility mode (%s)\n", strerror (errno)); #endif #ifdef __linux__ retval = ioctl (port_fd, PPRELEASE); if (retval == -1) DBG (1, "sane_geniusvp2_parport_close: could not release port (%s)\n", strerror (errno)); #endif retval = close (port_fd); if (retval == -1) { DBG (1, "sane_geniusvp2_parport_close: could not close port (%s)\n", strerror (errno)); return 1; } return 0; } int sane_geniusvp2_epp_read (unsigned char *data, int size) { int returned; while (size > 0) { returned = read (port_fd, data, size); if (returned < 0) { DBG (1, "sane_geniusvp2_epp_read: %s\n", strerror (errno)); return 1; } data += returned; size -= returned; } return 0; } int sane_geniusvp2_epp_write (unsigned char *data, int size) { int written; while (size > 0) { written = write (port_fd, data, size); if (written < 0) { DBG (1, "sane_geniusvp2_epp_write: %s\n", strerror (errno)); return 1; } data += written; size -= written; } return 0; } #ifdef __linux__ int sane_geniusvp2_epp_set_mode (int mode) { int retval; mode |= IEEE1284_MODE_EPP; retval = ioctl (port_fd, PPSETMODE, &mode); if (retval == -1) { DBG (1, "sane_geniusvp2_epp_set_mode: %s\n", strerror (errno)); return 1; } return 0; } #elif defined (__FreeBSD__) || defined(__FreeBSD_kernel__) int sane_geniusvp2_epp_write_addr (unsigned char addr) { int retval; retval = ioctl (port_fd, PPISEPPA, &addr); if (retval == -1) { DBG (1, "sane_geniusvp2_epp_write_addr: %s\n", strerror (errno)); return 1; } return 0; } #endif int sane_geniusvp2_pp_write (unsigned long int line, unsigned char data) { switch (line) { case PP_DATA: return ioctl (port_fd, PPWDATA, &data); break; case PP_CONTROL: return ioctl (port_fd, PPWCONTROL, &data); break; } return 0; } int sane_geniusvp2_pp_read (unsigned long int line, unsigned char *data) { switch (line) { case PP_DATA: return ioctl (port_fd, PPRDATA, data); break; case PP_STATUS: return ioctl (port_fd, PPRSTATUS, data); break; case PP_CONTROL: return ioctl (port_fd, PPRCONTROL, data); break; } return 0; } sane-backends-extras-1.0.22.3ubuntu1/backend/geniusvp2-parport.h0000664000000000000000000000266511527030747021341 0ustar /* parport.h - Parallel port I/O functions * * Copyright (C) 2004, 2005 Anderson Lizardo * * 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 of the License, 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 */ enum { PP_DATA, PP_STATUS, PP_CONTROL }; extern int sane_geniusvp2_parport_open (const char *pp_device); extern int sane_geniusvp2_parport_close (void); extern int sane_geniusvp2_epp_read (unsigned char *data, int size); extern int sane_geniusvp2_epp_write (unsigned char *data, int size); #ifdef __linux__ extern int sane_geniusvp2_epp_set_mode (int mode); #elif defined (__FreeBSD__) || defined(__FreeBSD_kernel__) extern int sane_geniusvp2_epp_write_addr (unsigned char addr); #endif extern int sane_geniusvp2_pp_read (unsigned long int line, unsigned char *data); extern int sane_geniusvp2_pp_write (unsigned long int line, unsigned char data); sane-backends-extras-1.0.22.3ubuntu1/backend/stubs.c0000664000000000000000000000275411475557446017100 0ustar #define STUBS #include "../include/sane/sanei_backend.h" /* Now define the wrappers (we could use aliases here, but go for robustness for now...: */ SANE_Status sane_init (SANE_Int *vc, SANE_Auth_Callback cb) { return ENTRY(init) (vc, cb); } SANE_Status sane_get_devices (const SANE_Device ***dl, SANE_Bool local) { return ENTRY(get_devices) (dl, local); } SANE_Status sane_open (SANE_String_Const name, SANE_Handle *h) { return ENTRY(open) (name, h); } const SANE_Option_Descriptor * sane_get_option_descriptor (SANE_Handle h, SANE_Int opt) { return ENTRY(get_option_descriptor) (h, opt); } SANE_Status sane_control_option (SANE_Handle h, SANE_Int opt, SANE_Action act, void *val, SANE_Word *info) { return ENTRY(control_option) (h, opt, act, val, info); } SANE_Status sane_get_parameters (SANE_Handle h, SANE_Parameters *parms) { return ENTRY(get_parameters) (h, parms); } SANE_Status sane_start (SANE_Handle h) { return ENTRY(start) (h); } SANE_Status sane_read (SANE_Handle h, SANE_Byte *buf, SANE_Int maxlen, SANE_Int *lenp) { return ENTRY(read) (h, buf, maxlen, lenp); } SANE_Status sane_set_io_mode (SANE_Handle h, SANE_Bool non_blocking) { return ENTRY(set_io_mode) (h, non_blocking); } SANE_Status sane_get_select_fd (SANE_Handle h, SANE_Int *fdp) { return ENTRY(get_select_fd) (h, fdp); } void sane_cancel (SANE_Handle h) { ENTRY(cancel) (h); } void sane_close (SANE_Handle h) { ENTRY(close) (h); } void sane_exit (void) { ENTRY(exit) (); } sane-backends-extras-1.0.22.3ubuntu1/backend/geniusvp2-switcher.h0000664000000000000000000000160511527030747021473 0ustar /* switcher.h - on/off switcher functions * * Copyright (C) 2004, 2005 Anderson Lizardo * * 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 of the License, 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 */ extern int sane_geniusvp2_scanner_on (void); extern int sane_geniusvp2_scanner_off (void); sane-backends-extras-1.0.22.3ubuntu1/backend/geniusvp2-registers.h0000664000000000000000000001447411527030747021662 0ustar /* registers.h - Register definition for E1 ASIC * * Copyright (C) 2004, 2005 Anderson Lizardo * * 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 of the License, 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 */ /* FIXME: This code was initially taken from pxscan-0.41 and is based on the * E3 ASIC definition. Probably some of the registers below are incorrect for * E1 or even do not exist on it. */ /* ASIC ID - R */ struct REG0 { unsigned AsicType:8; }; /* General Register 0 - R/W */ struct REG1 { unsigned Data:8; }; /* General Register 1 - R/W */ struct REG2 { unsigned Data:8; }; /* Command Register 0 - R/W */ struct REG3 { unsigned SysReset:1; unsigned FiFoReset:1; unsigned EppUsb:1; unsigned WatchDog:1; unsigned SelfTest:1; unsigned ScanSpeed:3; }; /* Command Register 1 - R/W */ struct REG4 { unsigned AsicTest:1; unsigned NoLineOffset:1; unsigned Refresh:1; unsigned RefreshForever:1; unsigned WaitDelay:2; unsigned ScanMode:2; }; /* Command Register 2 - R/W */ struct REG5 { unsigned Sensor:2; unsigned SensorRes:2; /* Sensor Resolution: 0 - 300 dpi; 1 - 600 dpi */ unsigned Afe:3; unsigned Adc1210:1; }; /* Motor Control - R/W */ struct REG6 { unsigned MotorPower:1; unsigned HalfFull:1; /* 0 - Full Step; 1 - Half Step */ unsigned Operation:3; unsigned LineOffset:3; }; /* Motor Move Steps High Byte - R/W */ struct REG7 { unsigned Data:8; }; /* Motor Move Steps Low Byte - R/W */ struct REG8 { unsigned Data:8; }; /* Motor Back Steps (Scanning) - R/W */ struct REG9 { unsigned Data:8; }; /* Motor Trigger Period High Byte (Unit: 0.5 us) - R/W */ struct REG10 { unsigned Data:8; }; /* Motor Trigger Period Low Byte (Unit: 0.5 us) - R/W */ struct REG11 { unsigned Data:8; }; /* Sensor Status - R/W */ struct REG12 { unsigned Lamp:1; unsigned KeyButton:1; unsigned HomeSensor:1; unsigned FinishFlag:1; unsigned FiFoEmpty:2; unsigned Reserved:2; }; /* AFE Programming Register - R/W */ struct REG13 { unsigned SDI:1; unsigned SDO:1; /* Data to scanner's ADC ( = SDI of SDC ) */ unsigned SCLK:1; unsigned SEN:1; unsigned Reserved:1; unsigned VSMP:3; /* VSMP = Video SAMPle sync pulse */ }; /* Memory Address Port (MSB) - R/W */ struct REG14 { unsigned Mem:5; unsigned Reserved:2; unsigned Mem_512_2048:1; }; /* Memory Address Port High Byte - R/W */ struct REG15 { unsigned Data:8; }; /* Memory Address Port Low Byte - R/W */ struct REG16 { unsigned Data:8; }; /* Memory Data Port - R/W */ struct REG17 { unsigned Data:8; }; /* Data Size High Byte - R/W */ struct REG18 { unsigned Data:8; }; /* Data Size Low Byte - R/W */ struct REG19 { unsigned Data:8; }; /* Scan Area Start Point High Byte - R/W */ struct REG20 { unsigned AreaStart:6; unsigned Reserved:2; }; /* Scan Area Start Point Low Byte - R/W */ struct REG21 { unsigned AreaStart:8; }; /* Scan Area Width High Byte - R/W */ struct REG22 { unsigned AreaWidth:6; unsigned Reserved:2; }; /* Scan Area Width Low Byte - R/W */ struct REG23 { unsigned AreaWidth:8; }; /* General Purpose I/O Register 0 - R */ struct REG24 { unsigned ProductID:5; unsigned Gio5:1; unsigned Gio6:1; unsigned Reserved:1; }; /* General Purpose I/O Register 1 - R/W */ struct REG25 { unsigned Gio11:1; unsigned Gio12:1; unsigned Gio13:1; unsigned Gio14:1; unsigned Gio11ctl:1; unsigned Gio12ctl:1; unsigned Gio13ctl:1; unsigned Gio14ctl:1; }; /* Buffer Bank R/W Difference Motor Start & Stop - R/W */ struct REG26 { unsigned Stop:4; unsigned Start:4; }; /* X-Direction & Y-Direction Resolution Control High Byte - R/W */ struct REG27 { unsigned YRes:3; unsigned AutoPattern:1; unsigned XRes:3; unsigned True16Bit:1; }; /* X-Direction Resolution Control Low Byte - R/W */ struct REG28 { unsigned XRes:8; }; /* Y-Direction Resolution Control Low Byte - R/W */ struct REG29 { unsigned YRes:8; }; union { struct REG0 r; unsigned char w; } reg0; union { struct REG1 r; unsigned char w; } reg1; union { struct REG2 r; unsigned char w; } reg2; union { struct REG3 r; unsigned char w; } reg3; union { struct REG4 r; unsigned char w; } reg4; union { struct REG5 r; unsigned char w; } reg5; union { struct REG6 r; unsigned char w; } reg6; union { struct REG7 r; unsigned char w; } reg7; union { struct REG8 r; unsigned char w; } reg8; union { struct REG9 r; unsigned char w; } reg9; union { struct REG10 r; unsigned char w; } reg10; union { struct REG11 r; unsigned char w; } reg11; union { struct REG12 r; unsigned char w; } reg12; union { struct REG13 r; unsigned char w; } reg13; union { struct REG14 r; unsigned char w; } reg14; union { struct REG15 r; unsigned char w; } reg15; union { struct REG16 r; unsigned char w; } reg16; union { struct REG17 r; unsigned char w; } reg17; union { struct REG18 r; unsigned char w; } reg18; union { struct REG19 r; unsigned char w; } reg19; union { struct REG20 r; unsigned char w; } reg20; union { struct REG21 r; unsigned char w; } reg21; union { struct REG22 r; unsigned char w; } reg22; union { struct REG23 r; unsigned char w; } reg23; union { struct REG24 r; unsigned char w; } reg24; union { struct REG25 r; unsigned char w; } reg25; union { struct REG26 r; unsigned char w; } reg26; union { struct REG27 r; unsigned char w; } reg27; union { struct REG28 r; unsigned char w; } reg28; union { struct REG29 r; unsigned char w; } reg29; sane-backends-extras-1.0.22.3ubuntu1/backend/Makefile.am0000664000000000000000000001644511527266261017620 0ustar ## Makefile.am -- an automake template for Makefile.in file ## Copyright (C) 2009 Chris Bagwell, Olaf Meeuwissen, and Sane Developers. ## ## This file is part of the "Sane" build infra-structure. See ## included LICENSE file for license information. INSTALL_LOCKPATH = @INSTALL_LOCKPATH@ LOCKPATH_GROUP = @LOCKPATH_GROUP@ BACKEND_LIBS_ENABLED=@BACKEND_LIBS_ENABLED@ BACKEND_CONFS_ENABLED=@BACKEND_CONFS_ENABLED@ DL_LIBS = @DL_LIBS@ LIBV4L_LIBS = @LIBV4L_LIBS@ MATH_LIB = @MATH_LIB@ IEEE1284_LIBS = @IEEE1284_LIBS@ TIFF_LIBS = @TIFF_LIBS@ JPEG_LIBS = @JPEG_LIBS@ GPHOTO2_LIBS = @GPHOTO2_LIBS@ GPHOTO2_LDFLAGS = @GPHOTO2_LDFLAGS@ SOCKET_LIBS = @SOCKET_LIBS@ AVAHI_LIBS = @AVAHI_LIBS@ USB_LIBS = @USB_LIBS@ SCSI_LIBS = @SCSI_LIBS@ PTHREAD_LIBS = @PTHREAD_LIBS@ AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_builddir)/include -I$(top_srcdir)/include -DLIBDIR="$(libdir)/sane" V_MAJOR = @V_MAJOR@ V_MINOR = @V_MINOR@ V_REV = @V_REV@ AM_LDFLAGS = @STRICT_LDFLAGS@ # The -rpath option is added because we are creating _LTLIBRARIES based # on configure substitution. This causes automake to not know the # correct $libdir and must be added here. DIST_SANELIBS_LDFLAGS = $(AM_LDFLAGS) -rpath '$(libdir)/sane' -version-number $(V_MAJOR):$(V_MINOR):$(V_REV) $(DYNAMIC_FLAG) DIST_LIBS_LDFLAGS = $(AM_LDFLAGS) -rpath '$(libdir)' -version-number $(V_MAJOR):$(V_MINOR):$(V_REV) # LIBTOOL install is a little to noisy for my liking. LIBTOOL = @LIBTOOL@ --silent FIRMWARE_DIRS = EXTRA_DIST = sane_strstatus.c all: becfg EXTRA_DIST += stubs.c # FIXME: % is a GNU extension... This is only thing left requiring # use to use GNU make. %-s.c: $(srcdir)/stubs.c rm -f $@ $(LN_S) $(srcdir)/stubs.c $@ dll-preload.h: rm -f $@ list="$(PRELOADABLE_BACKENDS)"; for be in $$list; do \ echo "PRELOAD_DECL($$be)" >> $@; \ done echo "static struct backend preloaded_backends[] = {" >> $@ sep=""; \ list="$(PRELOADABLE_BACKENDS)"; \ if test -z "$${list}"; then \ echo { 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }} >> $@; \ else \ for be in $$list; do \ echo "$${sep}PRELOAD_DEFN($$be)" >> $@; \ sep=","; \ done; \ fi echo "};" >> $@ # TODO: This really belongs together with the saned sources and # should be installed there as well. EXTRA_DIST += saned.conf.in # Backends are not required to have a config file. Any backend # that wants to install a config file should list it here. BACKEND_CONFS = geniusvp2.conf becfg: $(BACKEND_CONFS) SUFFIXES = .conf.in .conf .conf.in.conf: @echo Generating $@ from $^ @sed -e 's|@DATADIR@|$(datadir)|g' \ -e 's|@CONFIGDIR@|$(configdir)|g' \ -e 's|@DOCDIR@|$(docdir)|g' \ -e 's|@LIBDIR@|$(libdir)/sane|g' \ -e 's|@BINDIR@|$(bindir)|g' \ -e 's|@SBINDIR@|$(sbindir)|g' \ -e 's|@PACKAGEVERSION@|$(PACKAGE_VERSION)|g' $? > $@ install-data-hook: install-becfg install-firmware-path $(INSTALL_LOCKPATH) # Custom install target to install config files. Do not overwrite # files that have been previously installed so that user modifications # are not lost. install-becfg: @# Libtool has a bug where it will sometimes symlink the last @# installed library in $(sanelibdir) to $(sanelibdir)/libsane.*. @# Having two libsane's can cause issues so get rid of it. -rm -f $(DESTDIR)$(sanelibdir)/libsane.* test -z "$(configdir)" || $(MKDIR_P) "$(DESTDIR)$(configdir)" test -z "$(configdir)/dll.d" || $(MKDIR_P) "$(DESTDIR)$(configdir)/dll.d" @list="$(BACKEND_CONFS_ENABLED) saned.conf dll.conf"; for cfg in $$list; do \ if test ! -r $${cfg}; then continue; fi; \ if test -f $(DESTDIR)$(configdir)/$${cfg}; then \ echo NOT overwriting $${cfg} in $(configdir)...; \ else \ echo installing $${cfg} in $(configdir)/$${cfg}...; \ $(INSTALL_DATA) $${cfg} $(DESTDIR)$(configdir)/$${cfg} \ || exit 1; \ fi; \ done install-firmware-path: for dir in $(FIRMWARE_DIRS) ; do \ $(mkinstalldirs) $(DESTDIR)$(datadir)/sane/$${dir} ; \ done install-lockpath: $(mkinstalldirs) -m 775 -g $(LOCKPATH_GROUP) $(DESTDIR)$(locksanedir) uninstall-hook: rm -rf $(DESTDIR)$(libdir)/sane $(DESTDIR)$(configdir) $(DESTDIR)$(locksanedir) rm -f $(DESTDIR)$(libdir)/libsane.* -for dir in $(FIRMWARE_DIRS) ; do \ rmdir $(DESTDIR)$(datadir)/sane/$${dir} ; \ done CLEANFILES = $(BACKEND_CONFS) $(be_convenience_libs) clean-local: find . -type l -name \*-s.c | xargs rm -f # Backends # # All possible backends should be listed here. As a first step, we create # a convenience library containing all files needed to link a backend # directly into libsane.la. Convenience library should have the # form of lib${backend}.la to match what configure will list to # build. # Occasionally, this approach will have name conflicts with external # libraries that need to be linked in. See libgphoto2_i.la for # example of working around that issue. be_convenience_libs = libgeniusvp2.la libls5000.la # Each stand alone backend thats possible to be built should be listed # here. There are the libraries that are installed under $(libdir)/sane. # Format is libsane-${backend}.la. be_dlopen_libs = libsane-geniusvp2.la libsane-ls5000.la EXTRA_LTLIBRARIES = $(be_convenience_libs) $(be_dlopen_libs) lib_LTLIBRARIES = sanelibdir = $(libdir)/sane sanelib_LTLIBRARIES = $(BACKEND_LIBS_ENABLED) COMMON_LIBS = ../lib/liblib.la # Each backend should define a convenience library that compiles # all related files within backend directory. General guideline # is to have a ${backend}.c and ${backend}.h. Some backends also # add a few support source files to convience library. # Note: automake doesn't really use header files listed here. # They are indications that they need to be distributed only. # Each backend should define a stand alone library that gets installed. # This will need to link in a special file ${backend}-s.c that allows # the backend to be stand alone and contain all SANE API functions. # Also, it will need to link in related convenience library as well as # any external libraries required to resolve symbols. # # All backends should include $(DIST_SANELIBS_LDFLAGS) so that # library is correctly versioned. # # If a backend has a config file, it must be listed here to get distributed. libgeniusvp2_la_SOURCES = geniusvp2-adc.c geniusvp2-adc.h geniusvp2-asic.c geniusvp2-asic.h geniusvp2-image.c geniusvp2-image.h \ geniusvp2-misc.c geniusvp2-misc.h geniusvp2-parport.c geniusvp2-parport.h geniusvp2-registers.h geniusvp2-switcher.c \ geniusvp2-switcher.h geniusvp2.c geniusvp2.h libgeniusvp2_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=geniusvp2 nodist_libsane_geniusvp2_la_SOURCES = geniusvp2-s.c libsane_geniusvp2_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=geniusvp2 libsane_geniusvp2_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) libsane_geniusvp2_la_LIBADD = $(COMMON_LIBS) libgeniusvp2.la ../sanei/sanei_init_debug.lo ../sanei/sanei_config.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_thread.lo sane_strstatus.lo $(PTHREAD_LIBS) libls5000_la_SOURCES = ls5000.c libls5000_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=ls5000 nodist_libsane_ls5000_la_SOURCES = ls5000-s.c libsane_ls5000_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=ls5000 libsane_ls5000_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) libsane_ls5000_la_LIBADD = $(COMMON_LIBS) libls5000.la ../sanei/sanei_init_debug.lo ../sanei/sanei_config.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_usb.lo sane_strstatus.lo $(USB_LIBS) $(MATH_LIB) sane-backends-extras-1.0.22.3ubuntu1/include/0000775000000000000000000000000011600675053015601 5ustar sane-backends-extras-1.0.22.3ubuntu1/include/lalloca.h0000664000000000000000000000465311475557446017410 0ustar /* sane - Scanner Access Now Easy. This file is part of the SANE package. SANE 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 of the License, or (at your option) any later version. SANE 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 sane; see the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. Choose suitable implementation of alloca. */ #ifndef lalloca_h #define lalloca_h /* The idea how to do this is from the autoconf documenation */ /* AIX requires this to be the first thing in the file. */ #if defined(__GNUC__) # define alloca __builtin_alloca #else # if HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ /* Remap to internal version name as not to conflict with * other libraries that also add as util to their libraries. */ #define alloca sanei_alloca # if __STDC__ void *alloca (); # else char *alloca (); # endif # endif # endif # endif #endif #endif /* lalloca_h */ sane-backends-extras-1.0.22.3ubuntu1/include/Makefile.in0000664000000000000000000003703211527266663017666 0ustar # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = include DIST_COMMON = $(nobase_include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/byteorder.m4 \ $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/sane/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(includedir)" HEADERS = $(nobase_include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AWK = @AWK@ BACKEND_CONFS_ENABLED = @BACKEND_CONFS_ENABLED@ BACKEND_LIBS_ENABLED = @BACKEND_LIBS_ENABLED@ BACKEND_MANS_ENABLED = @BACKEND_MANS_ENABLED@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISTCLEAN_FILES = @DISTCLEAN_FILES@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DVIPS = @DVIPS@ DYNAMIC_FLAG = @DYNAMIC_FLAG@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GPHOTO2_CPPFLAGS = @GPHOTO2_CPPFLAGS@ GPHOTO2_LDFLAGS = @GPHOTO2_LDFLAGS@ GPHOTO2_LIBS = @GPHOTO2_LIBS@ GREP = @GREP@ HAVE_GPHOTO2 = @HAVE_GPHOTO2@ IEEE1284_LIBS = @IEEE1284_LIBS@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_LOCKPATH = @INSTALL_LOCKPATH@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JPEG_LIBS = @JPEG_LIBS@ LATEX = @LATEX@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUSB_1_0_CFLAGS = @LIBUSB_1_0_CFLAGS@ LIBUSB_1_0_LIBS = @LIBUSB_1_0_LIBS@ LIBV4L_CFLAGS = @LIBV4L_CFLAGS@ LIBV4L_LIBS = @LIBV4L_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LOCKPATH_GROUP = @LOCKPATH_GROUP@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINDEX = @MAKEINDEX@ MAKEINFO = @MAKEINFO@ MATH_LIB = @MATH_LIB@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ NUMBER_VERSION = @NUMBER_VERSION@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PRELOADABLE_BACKENDS = @PRELOADABLE_BACKENDS@ PRELOADABLE_BACKENDS_ENABLED = @PRELOADABLE_BACKENDS_ENABLED@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RESMGR_LIBS = @RESMGR_LIBS@ SANEI_SANEI_JPEG_LO = @SANEI_SANEI_JPEG_LO@ SANE_CONFIG_PATH = @SANE_CONFIG_PATH@ SCSI_LIBS = @SCSI_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SNMP_CONFIG_PATH = @SNMP_CONFIG_PATH@ SOCKET_LIBS = @SOCKET_LIBS@ STRICT_LDFLAGS = @STRICT_LDFLAGS@ STRIP = @STRIP@ SYSLOG_LIBS = @SYSLOG_LIBS@ TIFF_LIBS = @TIFF_LIBS@ USB_LIBS = @USB_LIBS@ VERSION = @VERSION@ V_MAJOR = @V_MAJOR@ V_MINOR = @V_MINOR@ V_REV = @V_REV@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ configdir = @configdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ effective_target = @effective_target@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ locksanedir = @locksanedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ nobase_include_HEADERS = sane/sane.h sane/saneopts.h EXTRA_DIST = lalloca.h lassert.h lgetopt.h md5.h font_6x11.h \ sane/config.h.in sane/sanei.h sane/sanei_ab306.h \ sane/sanei_access.h sane/sanei_auth.h sane/sanei_backend.h \ sane/sanei_cderror.h sane/sanei_codec_ascii.h \ sane/sanei_codec_bin.h sane/sanei_config.h sane/sanei_debug.h \ sane/sanei_jinclude.h sane/sanei_jpeg.h sane/sanei_lm983x.h \ sane/sanei_net.h sane/sanei_pa4s2.h sane/sanei_pio.h \ sane/sanei_pp.h sane/sanei_pv8630.h sane/sanei_scsi.h \ sane/sanei_tcp.h sane/sanei_thread.h sane/sanei_udp.h \ sane/sanei_usb.h sane/sanei_wire.h sane/sanei_magic.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu include/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-nobase_includeHEADERS: $(nobase_include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \ $(am__nobase_list) | while read dir files; do \ xfiles=; for file in $$files; do \ if test -f "$$file"; then xfiles="$$xfiles $$file"; \ else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ test -z "$$xfiles" || { \ test "x$$dir" = x. || { \ echo "$(MKDIR_P) '$(DESTDIR)$(includedir)/$$dir'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)/$$dir"; }; \ echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(includedir)/$$dir'"; \ $(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(includedir)/$$dir" || exit $$?; }; \ done uninstall-nobase_includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \ $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(includedir)" && rm -f $$files 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: for dir in "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-nobase_includeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-nobase_includeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool ctags distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-nobase_includeHEADERS \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-nobase_includeHEADERS # 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: sane-backends-extras-1.0.22.3ubuntu1/include/sane/0000775000000000000000000000000011600675053016527 5ustar sane-backends-extras-1.0.22.3ubuntu1/include/sane/sanei.h0000664000000000000000000001255311475557446020024 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 1996 David Mosberger-Tang and Andreas Beck Copyright (C) 2002, 2003 Henning Meier-Geinitz This file is part of the SANE package. SANE 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 of the License, or (at your option) any later version. SANE 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 sane; see the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ /** @file sanei.h * Convenience macros and function declarations for backends * @sa sanei_backend.h sanei_thread.h */ /* Doxygen documentation */ /** @mainpage SANEI (SANE internal routines) documentation * * @image html sane-logo2.jpg * @section intro Introduction * * The header files in the include/sane/ directory named sanei_*.h provide * function declarations and macros that can be used by every SANE backend. * Their implementations can be found in the sanei/ directory. The code aims * to be platform-independent to avoid lots of \#ifdef code in the backends. * Please use the SANEI functions wherever possible. * * This documentation was created by the use of doxygen, the * doc/doxygen-sanei.conf configuration file and documentation in the sanei_*.h * files. * * This documentation is far from complete. Any help is appreciated. * * @section additional Additional documentation * - The SANE standard can be found at the SANE webserver, * though the PostScript version produced from the source may be more recent. * - Information on how to write a backend: backend-writing.txt. * - General SANE documentation is on the SANE documentation * page. * * @section contact Contact * * The common way to contact the developers of SANE is the sane-devel * mailing list. See the mailing list webpage * for details. That's the place to ask questions, report bugs, or announce * a new backend. * */ #ifndef sanei_h #define sanei_h #include /** @name Public macros and functions * @{ */ /** @def STRINGIFY(x) * Turn parameter into string. */ /** @def PASTE(x,y) * Concatenate parameters. * */ /** @def NELEMS(a) * Return number of elements of an array. * */ /** @fn extern SANE_Status sanei_check_value (const SANE_Option_Descriptor * opt, void * value); * Check the constraints of a SANE option. * * @param opt option to check * @param value value of the option * * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_INVAL - if the value doesn't fit inside the constraint * or any other error occured * @sa sanei_constrain_value() */ /** @fn extern SANE_Status sanei_constrain_value (const SANE_Option_Descriptor * opt, void * value, SANE_Word * info); * Check the constraints of a SANE option and adjust its value if necessary. * * Depending on the type of the option and constraint, value is modified * to fit inside constraint. * * @param opt option to check * @param value value of the option * @param info info is set to SANE_INFO_INEXACT if value was changed * * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_INVAL - if the function wasn't able to fit value into the * constraint or any other error occured * @sa sanei_check_value() */ /* @} */ /* A few convenience macros: */ /** @hideinitializer */ #define NELEMS(a) ((int)(sizeof (a) / sizeof (a[0]))) /** @hideinitializer */ #define STRINGIFY1(x) #x /** @hideinitializer */ #define STRINGIFY(x) STRINGIFY1(x) /** @hideinitializer */ #define PASTE1(x,y) x##y /** @hideinitializer */ #define PASTE(x,y) PASTE1(x,y) extern SANE_Status sanei_check_value (const SANE_Option_Descriptor * opt, void * value); extern SANE_Status sanei_constrain_value (const SANE_Option_Descriptor * opt, void * value, SANE_Word * info); #endif /* sanei_h */ sane-backends-extras-1.0.22.3ubuntu1/include/sane/sanei_access.h0000664000000000000000000000701311475557446021340 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 2005 Gerhard Jaeger This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ /** @file sanei_access.h * Interface file for the sanei_access functions. * * The idea is to provide some simple locking/unlocking mecanism, which * can be used to protect device access from more than one frontend * simultaneously. */ #ifndef sanei_access_h #define sanei_access_h #include "../include/sane/config.h" #include "../include/sane/sane.h" /** Initialize sanei_access. * * This function must be called before any other sanei_access function. * * @param backend - backend name, who uses this lib */ extern void sanei_access_init( const char * backend ); /** Set a lock. * * The function tries to open/create exclusively a lock file in * $PATH_SANE_LOCK_DIR. * If the file could be created successfully, the function fills in the * process ID. * The complete filename of the lockfile is created as follows: * $PATH_SANE_LOCK_DIR/LCK..<devicename> * If the lock could not be set, the function tries it until the timeout * period has been elapsed. * * @param devicename - unique part of the lockfile name * @param timeout - time in seconds to try to set a lock * @return * - SANE_STATUS_GOOD - if the lock has been successfully set * - SANE_STATUS_ACCESS_DENIED - the lock could not set */ extern SANE_Status sanei_access_lock( const char * devicename, SANE_Word timeout ); /** Unlock a previously set lock. * * The function tries to unlock a previously created lock. The lockfile will be * closed and removed. * * @param devicename - part of the lockfile name, use for sanei_acess_lock() * @return * - SANE_STATUS_GOOD - currently the one and only return value */ extern SANE_Status sanei_access_unlock( const char * devicename ); #endif /* sanei_access_h */ sane-backends-extras-1.0.22.3ubuntu1/include/sane/sanei_scsi.h0000664000000000000000000003043211475557446021041 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 1996, 1997 David Mosberger-Tang This file is part of the SANE package. SANE 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 of the License, or (at your option) any later version. SANE 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 sane; see the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ /** @file sanei_scsi.h * Generic interface to SCSI drivers. * @sa sanei_usb.h, sanei_ab306.h,sanei_lm983x.h, sanei_pa4s2.h, sanei_pio.h, * and man sane-scsi(5) for user-oriented documentation */ #ifndef sanei_scsi_h #define sanei_scsi_h #include #include #include /** Sense handler * * The sense handler can be implemented in backends. It's for deciding * which sense codes should be considered an error and which shouldn't. * * @param fd file descriptor * @param sense_buffer pointer to buffer containing sense codes * @param arg pointer to data buffer * * @return * - SANE_STATUS_GOOD - on success (sense isn't regarded as error) * - any other status if sense code is regarded as error */ typedef SANE_Status (*SANEI_SCSI_Sense_Handler) (int fd, u_char *sense_buffer, void *arg); /** Maximum size of a SCSI request */ extern int sanei_scsi_max_request_size; /** Find SCSI devices. * * Find each SCSI device that matches the pattern specified by the * arguments. String arguments can be "omitted" by passing NULL, * integer arguments can be "omitted" by passing -1. * * Example: vendor="HP" model=NULL, type=NULL, bus=3, id=-1, lun=-1 would * attach all HP devices on SCSI bus 3. * * @param vendor * @param model * @param type * @param bus * @param channel * @param id * @param lun * @param attach callback invoked once for each device, dev is the real devicename (passed to attach callback) * */ extern void sanei_scsi_find_devices (const char *vendor, const char *model, const char *type, int bus, int channel, int id, int lun, SANE_Status (*attach) (const char *dev)); /** Open a SCSI device * * Opens a SCSI device by its device filename and returns a file descriptor. * If it's necessary to adjust the SCSI buffer size, use * sanei_scsi_open_extended(). * * @param device_name name of the devicefile, e.g. "/dev/sg0" * @param fd file descriptor * @param sense_handler called whenever the SCSI driver returns a sense buffer * @param sense_arg pointer to data for the sense handler * * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_ACCESS_DENIED - if the file couldn't be accessed due to * permissions * - SANE_STATUS_NO_MEM - if malloc failed (not enough memory) * - SANE_STATUS_INVAL - if the filename was invalid or an unknown error occured * * @sa sanei_scsi_open_extended(), HAVE_SANEI_SCSI_OPEN_EXTENDED */ extern SANE_Status sanei_scsi_open (const char * device_name, int * fd, SANEI_SCSI_Sense_Handler sense_handler, void *sense_arg); /** Open a SCSI device and set the buffer size * * The extended open call allows a backend to ask for a specific buffer * size. sanei_scsi_open_extended() tries to allocate a buffer of the size * given by *buffersize upon entry to this function. If * sanei_scsi_open_extended returns successfully, *buffersize contains the * available buffer size. This value may be both smaller or larger than the * value requested by the backend; it can even be zero. The backend must * decide, if it got enough buffer memory to work. * * Note that the value of *buffersize may differ for different files. * * @param device_name name of the devicefile, e.g. "/dev/sg0" * @param fd file descriptor * @param sense_handler called whenever the SCSI driver returns a sense buffer * @param sense_arg pointer to data for the sense handler * @param buffersize size of the SCAI request buffer (in bytes) * * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_ACCESS_DENIED - if the file couldn't be accessed due to * permissions * - SANE_STATUS_NO_MEM - if malloc failed (not enough memory) * - SANE_STATUS_INVAL - if the filename was invalid or an unknown error occured * * @sa sanei_scsi_open(), HAVE_SANEI_SCSI_OPEN_EXTENDED */ extern SANE_Status sanei_scsi_open_extended ( const char * device_name, int * fd, SANEI_SCSI_Sense_Handler sense_handler, void *sense_arg, int *buffersize); /** Do we have sanei_scsi_open_extended()? * * Let backends decide, which open call to use: if * HAVE_SANEI_SCSI_OPEN_EXTENDED is defined, sanei_scsi_open_extended may be * used. May also be used to decide, if sanei_scsi_req_flush_all or * sanei_scsi_req_flush_all_extended() should be used. * * @sa sanei_scsi_open(), sanei_scsi_open_extended() */ #define HAVE_SANEI_SCSI_OPEN_EXTENDED /** Enqueue SCSI command * * One or more scsi commands can be enqueued by calling sanei_scsi_req_enter(). * * NOTE: Some systems may not support multiple outstanding commands. On such * systems, sanei_scsi_req_enter() may block. In other words, it is not proper * to assume that enter() is a non-blocking routine. * * @param fd file descriptor * @param src pointer to the SCSI command and associated write data (if any) * @param src_size length of the command and data * @param dst pointer to a buffer in which data is returned; NULL if no data is * returned * @param dst_size on input, the size of the buffer pointed to by dst, on exit, * set to the number of bytes returned in the buffer (which is less than or equal * to the buffer size; may be NULL if no data is expected * @param idp pointer to a void* that uniquely identifies the entered request * * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_IO_ERROR - if an error was received from the SCSI driver * - SANE_STATUS_NO_MEM - if malloc failed (not enough memory) * - SANE_STATUS_INVAL - if a locking or an unknown error occured * @sa sanei_scsi_req_enter2() * */ extern SANE_Status sanei_scsi_req_enter (int fd, const void * src, size_t src_size, void * dst, size_t * dst_size, void **idp); /** Enqueue SCSI command and separated data * * Same as sanei_scsi_req_enter(), but with separate buffers for the SCSI * command and for the data to be sent to the device. * * With sanei_scsi_req_enter(), the length of te SCSI command block must be * guessed. While that works in most cases, Canon scanners for example use the * vendor specific commands 0xd4, 0xd5 and 0xd6. The Canon scanners want to * get 6 byte command blocks for these commands, but sanei_scsi_req_enter() and * sanei_scsi_cmd() send 12 bytes. * * If dst_size and *dst_size are non-zero, a "read command" (ie, data transfer * from the device to the host) is assumed. * * @param fd file descriptor * @param cmd pointer to SCSI command * @param cmd_size size of the command * @param src pointer to the buffer with data to be sent to the scanner * @param src_size size of src buffer * @param dst pointer to a buffer in which data is returned; NULL if no data is * returned * @param dst_size on input, the size of the buffer pointed to by dst, on exit, * set to the number of bytes returned in the buffer (which is less than or equal * to the buffer size; may be NULL if no data is expected * @param idp pointer to a void* that uniquely identifies the entered request * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_IO_ERROR - if an error was received from the SCSI driver * - SANE_STATUS_NO_MEM - if malloc failed (not enough memory) * - SANE_STATUS_INVAL - if a locking or an unknown error occured * @sa sanei_scsi_req_enter() */ extern SANE_Status sanei_scsi_req_enter2 (int fd, const void * cmd, size_t cmd_size, const void * src, size_t src_size, void * dst, size_t * dst_size, void **idp); /** Wait for SCSI command * * Wait for the completion of the SCSI command with id ID. * * @param id id used in sanei_scsi_req_enter() * * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_DEVICE_BUSY - if the device is busy (try again later) * - SANE_STATUS_IO_ERROR - if an error was received from the SCSI driver */ extern SANE_Status sanei_scsi_req_wait (void *id); /** Send SCSI command * * This is a convenience function that is equivalent to a pair of * sanei_scsi_req_enter()/sanei_scsi_req_wait() calls. * * @param fd file descriptor * @param src pointer to the SCSI command and associated write data (if any) * @param src_size length of the command and data * @param dst pointer to a buffer in which data is returned; NULL if no data is * returned * @param dst_size on input, the size of the buffer pointed to by dst, on exit, * set to the number of bytes returned in the buffer (which is less than or equal * to the buffer size; may be NULL if no data is expected * * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_IO_ERROR - if an error was received from the SCSI driver * - SANE_STATUS_NO_MEM - if malloc failed (not enough memory) * - SANE_STATUS_INVAL - if a locking or an unknown error occured * * @sa sanei_scsi_cmd2(), sanei_scsi_req_enter(), sanei_scsi_req_wait() */ extern SANE_Status sanei_scsi_cmd (int fd, const void * src, size_t src_size, void * dst, size_t * dst_size); /** Send SCSI command and separated data * * This is a convenience function that is equivalent to a pair of * sanei_scsi_req_enter2()/sanei_scsi_req_wait() calls. * * @param fd file descriptor * @param cmd pointer to SCSI command * @param cmd_size size of the command * @param src pointer to the buffer with data to be sent to the scanner * @param src_size size of src buffer * @param dst pointer to a buffer in which data is returned; NULL if no data is * returned * @param dst_size on input, the size of the buffer pointed to by dst, on exit, * set to the number of bytes returned in the buffer (which is less than or equal * to the buffer size; may be NULL if no data is expected * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_IO_ERROR - if an error was received from the SCSI driver * - SANE_STATUS_NO_MEM - if malloc failed (not enough memory) * - SANE_STATUS_INVAL - if a locking or an unknown error occured * * @sa sanei_scsi_cmd(), sanei_scsi_req_enter(), sanei_scsi_req_wait() */ extern SANE_Status sanei_scsi_cmd2 (int fd, const void * cmd, size_t cmd_size, const void * src, size_t src_size, void * dst, size_t * dst_size); /** Flush queue * * Flush all pending SCSI commands. This function work only, if zero or one * SCSI file handles are open. * * @sa sanei_scsi_req_flush_all_extended() */ extern void sanei_scsi_req_flush_all (void); /** Flush queue for handle * * Flush all SCSI commands pending for one handle * * @param fd file descriptor * * @sa sanei_scsi_req_flush_all() */ extern void sanei_scsi_req_flush_all_extended (int fd); /** Close a SCSI device * * @param fd file descriptor * */ extern void sanei_scsi_close (int fd); #endif /* sanei_scsi_h */ sane-backends-extras-1.0.22.3ubuntu1/include/sane/sanei_net.h0000664000000000000000000000641011475557446020665 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 1997-1999 David Mosberger-Tang and Andreas Beck This file is part of the SANE package. This file is in the public domain. You may use and modify it as you see fit, as long as this copyright message is included and that there is an indication as to what modifications have been made (if any). SANE 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. This file declares SANE application interface. See the SANE standard for a detailed explanation of the interface. */ #ifndef sanei_net_h #define sanei_net_h #include #include #define SANEI_NET_PROTOCOL_VERSION 3 typedef enum { SANE_NET_LITTLE_ENDIAN = 0x1234, SANE_NET_BIG_ENDIAN = 0x4321 } SANE_Net_Byte_Order; typedef enum { SANE_NET_INIT = 0, SANE_NET_GET_DEVICES, SANE_NET_OPEN, SANE_NET_CLOSE, SANE_NET_GET_OPTION_DESCRIPTORS, SANE_NET_CONTROL_OPTION, SANE_NET_GET_PARAMETERS, SANE_NET_START, SANE_NET_CANCEL, SANE_NET_AUTHORIZE, SANE_NET_EXIT } SANE_Net_Procedure_Number; typedef struct { SANE_Word version_code; SANE_String username; } SANE_Init_Req; typedef struct { SANE_Status status; SANE_Word version_code; } SANE_Init_Reply; typedef struct { SANE_Status status; SANE_Device **device_list; } SANE_Get_Devices_Reply; typedef struct { SANE_Status status; SANE_Word handle; SANE_String resource_to_authorize; } SANE_Open_Reply; typedef struct { SANE_Word num_options; SANE_Option_Descriptor **desc; } SANE_Option_Descriptor_Array; typedef struct { SANE_Word handle; SANE_Word option; SANE_Word action; SANE_Word value_type; SANE_Word value_size; void *value; } SANE_Control_Option_Req; typedef struct { SANE_Status status; SANE_Word info; SANE_Word value_type; SANE_Word value_size; void *value; SANE_String resource_to_authorize; } SANE_Control_Option_Reply; typedef struct { SANE_Status status; SANE_Parameters params; } SANE_Get_Parameters_Reply; typedef struct { SANE_Status status; SANE_Word port; SANE_Word byte_order; SANE_String resource_to_authorize; } SANE_Start_Reply; typedef struct { SANE_String resource; SANE_String username; SANE_String password; } SANE_Authorization_Req; extern void sanei_w_init_req (Wire *w, SANE_Init_Req *req); extern void sanei_w_init_reply (Wire *w, SANE_Init_Reply *reply); extern void sanei_w_get_devices_reply (Wire *w, SANE_Get_Devices_Reply *reply); extern void sanei_w_open_reply (Wire *w, SANE_Open_Reply *reply); extern void sanei_w_option_descriptor_array (Wire *w, SANE_Option_Descriptor_Array *opt); extern void sanei_w_control_option_req (Wire *w, SANE_Control_Option_Req *req); extern void sanei_w_control_option_reply (Wire *w, SANE_Control_Option_Reply *reply); extern void sanei_w_get_parameters_reply (Wire *w, SANE_Get_Parameters_Reply *reply); extern void sanei_w_start_reply (Wire *w, SANE_Start_Reply *reply); extern void sanei_w_authorization_req (Wire *w, SANE_Authorization_Req *req); #endif /* sanei_net_h */ sane-backends-extras-1.0.22.3ubuntu1/include/sane/sanei_udp.h0000664000000000000000000000232111475557446020664 0ustar /* sane - Scanner Access Now Easy. * Copyright (C) 2007 Tower Technologies * Author: Alessandro Zummo * This file is part of the SANE package. * * This file is in the public domain. You may use and modify it as * you see fit, as long as this copyright message is included and * that there is an indication as to what modifications have been * made (if any). * * SANE 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. * * Header file for UDP/IP communications. */ #ifndef sanei_udp_h #define sanei_udp_h #include #include #include extern SANE_Status sanei_udp_open(const char *host, int port, int *fdp); extern SANE_Status sanei_udp_open_broadcast(int *fdp); extern void sanei_udp_close(int fd); extern ssize_t sanei_udp_write(int fd, const u_char * buf, int count); extern ssize_t sanei_udp_read(int fd, u_char * buf, int count); extern ssize_t sanei_udp_write_broadcast(int fd, int port, const u_char * buf, int count); extern ssize_t sanei_udp_recvfrom(int fd, u_char * buf, int count, char **fromp); #endif /* sanei_udp_h */ sane-backends-extras-1.0.22.3ubuntu1/include/sane/saneopts.h0000664000000000000000000004711011475557446020556 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 1996, 1997 David Mosberger-Tang and Andreas Beck This file is part of the SANE package. SANE 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 of the License, or (at your option) any later version. SANE 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 sane; see the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. This file declares common option names, titles, and descriptions. A backend is not limited to these options but for the sake of consistency it's better to use options declared here when appropriate. */ /* This file defines several option NAMEs, TITLEs and DESCs that are (or should be) used by several backends. All well known options should be listed here. But this does not mean that all options that are listed here are well known options. To find out if an option is a well known option and how well known options have to be defined please take a look at the sane standard!!! */ #ifndef saneopts_h #define saneopts_h #ifndef SANE_I18N #define SANE_I18N(text) text #endif /* This _must_ be the first option (index 0): */ #define SANE_NAME_NUM_OPTIONS "" /* never settable */ /* The common option groups */ #define SANE_NAME_STANDARD "standard" #define SANE_NAME_GEOMETRY "geometry" #define SANE_NAME_ENHANCEMENT "enhancement" #define SANE_NAME_ADVANCED "advanced" #define SANE_NAME_SENSORS "sensors" #define SANE_NAME_PREVIEW "preview" #define SANE_NAME_GRAY_PREVIEW "preview-in-gray" #define SANE_NAME_BIT_DEPTH "depth" #define SANE_NAME_SCAN_MODE "mode" #define SANE_NAME_SCAN_SPEED "speed" #define SANE_NAME_SCAN_SOURCE "source" #define SANE_NAME_BACKTRACK "backtrack" /* Most user-interfaces will let the user specify the scan area as the top-left corner and the width/height of the scan area. The reason the backend interface uses the top-left/bottom-right corner is so that the scan area values can be properly constraint independent of any other option value. */ #define SANE_NAME_SCAN_TL_X "tl-x" #define SANE_NAME_SCAN_TL_Y "tl-y" #define SANE_NAME_SCAN_BR_X "br-x" #define SANE_NAME_SCAN_BR_Y "br-y" #define SANE_NAME_SCAN_RESOLUTION "resolution" #define SANE_NAME_SCAN_X_RESOLUTION "x-resolution" #define SANE_NAME_SCAN_Y_RESOLUTION "y-resolution" #define SANE_NAME_PAGE_WIDTH "page-width" #define SANE_NAME_PAGE_HEIGHT "page-height" #define SANE_NAME_CUSTOM_GAMMA "custom-gamma" #define SANE_NAME_GAMMA_VECTOR "gamma-table" #define SANE_NAME_GAMMA_VECTOR_R "red-gamma-table" #define SANE_NAME_GAMMA_VECTOR_G "green-gamma-table" #define SANE_NAME_GAMMA_VECTOR_B "blue-gamma-table" #define SANE_NAME_BRIGHTNESS "brightness" #define SANE_NAME_CONTRAST "contrast" #define SANE_NAME_GRAIN_SIZE "grain" #define SANE_NAME_HALFTONE "halftoning" #define SANE_NAME_BLACK_LEVEL "black-level" #define SANE_NAME_WHITE_LEVEL "white-level" #define SANE_NAME_WHITE_LEVEL_R "white-level-r" #define SANE_NAME_WHITE_LEVEL_G "white-level-g" #define SANE_NAME_WHITE_LEVEL_B "white-level-b" #define SANE_NAME_SHADOW "shadow" #define SANE_NAME_SHADOW_R "shadow-r" #define SANE_NAME_SHADOW_G "shadow-g" #define SANE_NAME_SHADOW_B "shadow-b" #define SANE_NAME_HIGHLIGHT "highlight" #define SANE_NAME_HIGHLIGHT_R "highlight-r" #define SANE_NAME_HIGHLIGHT_G "highlight-g" #define SANE_NAME_HIGHLIGHT_B "highlight-b" #define SANE_NAME_HUE "hue" #define SANE_NAME_SATURATION "saturation" #define SANE_NAME_FILE "filename" #define SANE_NAME_HALFTONE_DIMENSION "halftone-size" #define SANE_NAME_HALFTONE_PATTERN "halftone-pattern" #define SANE_NAME_RESOLUTION_BIND "resolution-bind" #define SANE_NAME_NEGATIVE "negative" #define SANE_NAME_QUALITY_CAL "quality-cal" #define SANE_NAME_DOR "double-res" #define SANE_NAME_RGB_BIND "rgb-bind" #define SANE_NAME_THRESHOLD "threshold" #define SANE_NAME_ANALOG_GAMMA "analog-gamma" #define SANE_NAME_ANALOG_GAMMA_R "analog-gamma-r" #define SANE_NAME_ANALOG_GAMMA_G "analog-gamma-g" #define SANE_NAME_ANALOG_GAMMA_B "analog-gamma-b" #define SANE_NAME_ANALOG_GAMMA_BIND "analog-gamma-bind" #define SANE_NAME_WARMUP "warmup" #define SANE_NAME_CAL_EXPOS_TIME "cal-exposure-time" #define SANE_NAME_CAL_EXPOS_TIME_R "cal-exposure-time-r" #define SANE_NAME_CAL_EXPOS_TIME_G "cal-exposure-time-g" #define SANE_NAME_CAL_EXPOS_TIME_B "cal-exposure-time-b" #define SANE_NAME_SCAN_EXPOS_TIME "scan-exposure-time" #define SANE_NAME_SCAN_EXPOS_TIME_R "scan-exposure-time-r" #define SANE_NAME_SCAN_EXPOS_TIME_G "scan-exposure-time-g" #define SANE_NAME_SCAN_EXPOS_TIME_B "scan-exposure-time-b" #define SANE_NAME_SELECT_EXPOSURE_TIME "select-exposure-time" #define SANE_NAME_CAL_LAMP_DEN "cal-lamp-density" #define SANE_NAME_SCAN_LAMP_DEN "scan-lamp-density" #define SANE_NAME_SELECT_LAMP_DENSITY "select-lamp-density" #define SANE_NAME_LAMP_OFF_AT_EXIT "lamp-off-at-exit" /* well known options from 'SENSORS' group*/ #define SANE_NAME_SCAN "scan" #define SANE_NAME_EMAIL "email" #define SANE_NAME_FAX "fax" #define SANE_NAME_COPY "copy" #define SANE_NAME_PDF "pdf" #define SANE_NAME_CANCEL "cancel" #define SANE_NAME_PAGE_LOADED "page-loaded" #define SANE_NAME_COVER_OPEN "cover-open" #define SANE_TITLE_NUM_OPTIONS SANE_I18N("Number of options") #define SANE_TITLE_STANDARD SANE_I18N("Standard") #define SANE_TITLE_GEOMETRY SANE_I18N("Geometry") #define SANE_TITLE_ENHANCEMENT SANE_I18N("Enhancement") #define SANE_TITLE_ADVANCED SANE_I18N("Advanced") #define SANE_TITLE_SENSORS SANE_I18N("Sensors") #define SANE_TITLE_PREVIEW SANE_I18N("Preview") #define SANE_TITLE_GRAY_PREVIEW SANE_I18N("Force monochrome preview") #define SANE_TITLE_BIT_DEPTH SANE_I18N("Bit depth") #define SANE_TITLE_SCAN_MODE SANE_I18N("Scan mode") #define SANE_TITLE_SCAN_SPEED SANE_I18N("Scan speed") #define SANE_TITLE_SCAN_SOURCE SANE_I18N("Scan source") #define SANE_TITLE_BACKTRACK SANE_I18N("Force backtracking") #define SANE_TITLE_SCAN_TL_X SANE_I18N("Top-left x") #define SANE_TITLE_SCAN_TL_Y SANE_I18N("Top-left y") #define SANE_TITLE_SCAN_BR_X SANE_I18N("Bottom-right x") #define SANE_TITLE_SCAN_BR_Y SANE_I18N("Bottom-right y") #define SANE_TITLE_SCAN_RESOLUTION SANE_I18N("Scan resolution") #define SANE_TITLE_SCAN_X_RESOLUTION SANE_I18N("X-resolution") #define SANE_TITLE_SCAN_Y_RESOLUTION SANE_I18N("Y-resolution") #define SANE_TITLE_PAGE_WIDTH SANE_I18N("Page width") #define SANE_TITLE_PAGE_HEIGHT SANE_I18N("Page height") #define SANE_TITLE_CUSTOM_GAMMA SANE_I18N("Use custom gamma table") #define SANE_TITLE_GAMMA_VECTOR SANE_I18N("Image intensity") #define SANE_TITLE_GAMMA_VECTOR_R SANE_I18N("Red intensity") #define SANE_TITLE_GAMMA_VECTOR_G SANE_I18N("Green intensity") #define SANE_TITLE_GAMMA_VECTOR_B SANE_I18N("Blue intensity") #define SANE_TITLE_BRIGHTNESS SANE_I18N("Brightness") #define SANE_TITLE_CONTRAST SANE_I18N("Contrast") #define SANE_TITLE_GRAIN_SIZE SANE_I18N("Grain size") #define SANE_TITLE_HALFTONE SANE_I18N("Halftoning") #define SANE_TITLE_BLACK_LEVEL SANE_I18N("Black level") #define SANE_TITLE_WHITE_LEVEL SANE_I18N("White level") #define SANE_TITLE_WHITE_LEVEL_R SANE_I18N("White level for red") #define SANE_TITLE_WHITE_LEVEL_G SANE_I18N("White level for green") #define SANE_TITLE_WHITE_LEVEL_B SANE_I18N("White level for blue") #define SANE_TITLE_SHADOW SANE_I18N("Shadow") #define SANE_TITLE_SHADOW_R SANE_I18N("Shadow for red") #define SANE_TITLE_SHADOW_G SANE_I18N("Shadow for green") #define SANE_TITLE_SHADOW_B SANE_I18N("Shadow for blue") #define SANE_TITLE_HIGHLIGHT SANE_I18N("Highlight") #define SANE_TITLE_HIGHLIGHT_R SANE_I18N("Highlight for red") #define SANE_TITLE_HIGHLIGHT_G SANE_I18N("Highlight for green") #define SANE_TITLE_HIGHLIGHT_B SANE_I18N("Highlight for blue") #define SANE_TITLE_HUE SANE_I18N("Hue") #define SANE_TITLE_SATURATION SANE_I18N("Saturation") #define SANE_TITLE_FILE SANE_I18N("Filename") #define SANE_TITLE_HALFTONE_DIMENSION SANE_I18N("Halftone pattern size") #define SANE_TITLE_HALFTONE_PATTERN SANE_I18N("Halftone pattern") #define SANE_TITLE_RESOLUTION_BIND SANE_I18N("Bind X and Y resolution") #define SANE_TITLE_NEGATIVE SANE_I18N("Negative") #define SANE_TITLE_QUALITY_CAL SANE_I18N("Quality calibration") #define SANE_TITLE_DOR SANE_I18N("Double Optical Resolution") #define SANE_TITLE_RGB_BIND SANE_I18N("Bind RGB") #define SANE_TITLE_THRESHOLD SANE_I18N("Threshold") #define SANE_TITLE_ANALOG_GAMMA SANE_I18N("Analog gamma correction") #define SANE_TITLE_ANALOG_GAMMA_R SANE_I18N("Analog gamma red") #define SANE_TITLE_ANALOG_GAMMA_G SANE_I18N("Analog gamma green") #define SANE_TITLE_ANALOG_GAMMA_B SANE_I18N("Analog gamma blue") #define SANE_TITLE_ANALOG_GAMMA_BIND SANE_I18N("Bind analog gamma") #define SANE_TITLE_WARMUP SANE_I18N("Warmup lamp") #define SANE_TITLE_CAL_EXPOS_TIME SANE_I18N("Cal. exposure-time") #define SANE_TITLE_CAL_EXPOS_TIME_R SANE_I18N("Cal. exposure-time for red") #define SANE_TITLE_CAL_EXPOS_TIME_G SANE_I18N("Cal. exposure-time for " \ "green") #define SANE_TITLE_CAL_EXPOS_TIME_B SANE_I18N("Cal. exposure-time for blue") #define SANE_TITLE_SCAN_EXPOS_TIME SANE_I18N("Scan exposure-time") #define SANE_TITLE_SCAN_EXPOS_TIME_R SANE_I18N("Scan exposure-time for red") #define SANE_TITLE_SCAN_EXPOS_TIME_G SANE_I18N("Scan exposure-time for " \ "green") #define SANE_TITLE_SCAN_EXPOS_TIME_B SANE_I18N("Scan exposure-time for blue") #define SANE_TITLE_SELECT_EXPOSURE_TIME SANE_I18N("Set exposure-time") #define SANE_TITLE_CAL_LAMP_DEN SANE_I18N("Cal. lamp density") #define SANE_TITLE_SCAN_LAMP_DEN SANE_I18N("Scan lamp density") #define SANE_TITLE_SELECT_LAMP_DENSITY SANE_I18N("Set lamp density") #define SANE_TITLE_LAMP_OFF_AT_EXIT SANE_I18N("Lamp off at exit") /* well known options from 'SENSORS' group*/ #define SANE_TITLE_SCAN "Scan button" #define SANE_TITLE_EMAIL "Email button" #define SANE_TITLE_FAX "Fax button" #define SANE_TITLE_COPY "Copy button" #define SANE_TITLE_PDF "PDF button" #define SANE_TITLE_CANCEL "Cancel button" #define SANE_TITLE_PAGE_LOADED "Page loaded" #define SANE_TITLE_COVER_OPEN "Cover open" /* Descriptive/help strings for above options: */ #define SANE_DESC_NUM_OPTIONS \ SANE_I18N("Read-only option that specifies how many options a specific " \ "devices supports.") #define SANE_DESC_STANDARD SANE_I18N("Source, mode and resolution options") #define SANE_DESC_GEOMETRY SANE_I18N("Scan area and media size options") #define SANE_DESC_ENHANCEMENT SANE_I18N("Image modification options") #define SANE_DESC_ADVANCED SANE_I18N("Hardware specific options") #define SANE_DESC_SENSORS SANE_I18N("Scanner sensors and buttons") #define SANE_DESC_PREVIEW \ SANE_I18N("Request a preview-quality scan.") #define SANE_DESC_GRAY_PREVIEW \ SANE_I18N("Request that all previews are done in monochrome mode. On a " \ "three-pass scanner this cuts down the number of passes to one and on a " \ "one-pass scanner, it reduces the memory requirements and scan-time of the " \ "preview.") #define SANE_DESC_BIT_DEPTH \ SANE_I18N("Number of bits per sample, typical values are 1 for \"line-art\" " \ "and 8 for multibit scans.") #define SANE_DESC_SCAN_MODE \ SANE_I18N("Selects the scan mode (e.g., lineart, monochrome, or color).") #define SANE_DESC_SCAN_SPEED \ SANE_I18N("Determines the speed at which the scan proceeds.") #define SANE_DESC_SCAN_SOURCE \ SANE_I18N("Selects the scan source (such as a document-feeder).") #define SANE_DESC_BACKTRACK \ SANE_I18N("Controls whether backtracking is forced.") #define SANE_DESC_SCAN_TL_X \ SANE_I18N("Top-left x position of scan area.") #define SANE_DESC_SCAN_TL_Y \ SANE_I18N("Top-left y position of scan area.") #define SANE_DESC_SCAN_BR_X \ SANE_I18N("Bottom-right x position of scan area.") #define SANE_DESC_SCAN_BR_Y \ SANE_I18N("Bottom-right y position of scan area.") #define SANE_DESC_SCAN_RESOLUTION \ SANE_I18N("Sets the resolution of the scanned image.") #define SANE_DESC_SCAN_X_RESOLUTION \ SANE_I18N("Sets the horizontal resolution of the scanned image.") #define SANE_DESC_SCAN_Y_RESOLUTION \ SANE_I18N("Sets the vertical resolution of the scanned image.") #define SANE_DESC_PAGE_WIDTH \ SANE_I18N("Specifies the width of the media. Required for automatic " \ "centering of sheet-fed scans.") #define SANE_DESC_PAGE_HEIGHT \ SANE_I18N("Specifies the height of the media.") #define SANE_DESC_CUSTOM_GAMMA \ SANE_I18N("Determines whether a builtin or a custom gamma-table should be " \ "used.") #define SANE_DESC_GAMMA_VECTOR \ SANE_I18N("Gamma-correction table. In color mode this option equally " \ "affects the red, green, and blue channels simultaneously (i.e., it is an " \ "intensity gamma table).") #define SANE_DESC_GAMMA_VECTOR_R \ SANE_I18N("Gamma-correction table for the red band.") #define SANE_DESC_GAMMA_VECTOR_G \ SANE_I18N("Gamma-correction table for the green band.") #define SANE_DESC_GAMMA_VECTOR_B \ SANE_I18N("Gamma-correction table for the blue band.") #define SANE_DESC_BRIGHTNESS \ SANE_I18N("Controls the brightness of the acquired image.") #define SANE_DESC_CONTRAST \ SANE_I18N("Controls the contrast of the acquired image.") #define SANE_DESC_GRAIN_SIZE \ SANE_I18N("Selects the \"graininess\" of the acquired image. Smaller values " \ "result in sharper images.") #define SANE_DESC_HALFTONE \ SANE_I18N("Selects whether the acquired image should be halftoned (dithered).") #define SANE_DESC_BLACK_LEVEL \ SANE_I18N("Selects what radiance level should be considered \"black\".") #define SANE_DESC_WHITE_LEVEL \ SANE_I18N("Selects what radiance level should be considered \"white\".") #define SANE_DESC_WHITE_LEVEL_R \ SANE_I18N("Selects what red radiance level should be considered \"white\".") #define SANE_DESC_WHITE_LEVEL_G \ SANE_I18N("Selects what green radiance level should be considered \"white\".") #define SANE_DESC_WHITE_LEVEL_B \ SANE_I18N("Selects what blue radiance level should be considered \"white\".") #define SANE_DESC_SHADOW \ SANE_I18N("Selects what radiance level should be considered \"black\".") #define SANE_DESC_SHADOW_R \ SANE_I18N("Selects what red radiance level should be considered \"black\".") #define SANE_DESC_SHADOW_G \ SANE_I18N("Selects what green radiance level should be considered \"black\".") #define SANE_DESC_SHADOW_B \ SANE_I18N("Selects what blue radiance level should be considered \"black\".") #define SANE_DESC_HIGHLIGHT \ SANE_I18N("Selects what radiance level should be considered \"white\".") #define SANE_DESC_HIGHLIGHT_R \ SANE_I18N("Selects what red radiance level should be considered \"full red\".") #define SANE_DESC_HIGHLIGHT_G \ SANE_I18N("Selects what green radiance level should be considered \"full " \ "green\".") #define SANE_DESC_HIGHLIGHT_B \ SANE_I18N("Selects what blue radiance level should be considered \"full " \ "blue\".") #define SANE_DESC_HUE \ SANE_I18N("Controls the \"hue\" (blue-level) of the acquired image.") #define SANE_DESC_SATURATION \ SANE_I18N("The saturation level controls the amount of \"blooming\" that " \ "occurs when acquiring an image with a camera. Larger values cause more " \ "blooming.") #define SANE_DESC_FILE \ SANE_I18N("The filename of the image to be loaded.") #define SANE_DESC_HALFTONE_DIMENSION \ SANE_I18N("Sets the size of the halftoning (dithering) pattern used when " \ "scanning halftoned images.") #define SANE_DESC_HALFTONE_PATTERN \ SANE_I18N("Defines the halftoning (dithering) pattern for scanning " \ "halftoned images.") #define SANE_DESC_RESOLUTION_BIND \ SANE_I18N("Use same values for X and Y resolution") #define SANE_DESC_NEGATIVE \ SANE_I18N("Swap black and white") #define SANE_DESC_QUALITY_CAL \ SANE_I18N("Do a quality white-calibration") #define SANE_DESC_DOR \ SANE_I18N("Use lens that doubles optical resolution") #define SANE_DESC_RGB_BIND \ SANE_I18N("In RGB-mode use same values for each color") #define SANE_DESC_THRESHOLD \ SANE_I18N("Select minimum-brightness to get a white point") #define SANE_DESC_ANALOG_GAMMA \ SANE_I18N("Analog gamma-correction") #define SANE_DESC_ANALOG_GAMMA_R \ SANE_I18N("Analog gamma-correction for red") #define SANE_DESC_ANALOG_GAMMA_G \ SANE_I18N("Analog gamma-correction for green") #define SANE_DESC_ANALOG_GAMMA_B \ SANE_I18N("Analog gamma-correction for blue") #define SANE_DESC_ANALOG_GAMMA_BIND \ SANE_I18N("In RGB-mode use same values for each color") #define SANE_DESC_WARMUP \ SANE_I18N("Warmup lamp before scanning") #define SANE_DESC_CAL_EXPOS_TIME \ SANE_I18N("Define exposure-time for calibration") #define SANE_DESC_CAL_EXPOS_TIME_R \ SANE_I18N("Define exposure-time for red calibration") #define SANE_DESC_CAL_EXPOS_TIME_G \ SANE_I18N("Define exposure-time for green calibration") #define SANE_DESC_CAL_EXPOS_TIME_B \ SANE_I18N("Define exposure-time for blue calibration") #define SANE_DESC_SCAN_EXPOS_TIME \ SANE_I18N("Define exposure-time for scan") #define SANE_DESC_SCAN_EXPOS_TIME_R \ SANE_I18N("Define exposure-time for red scan") #define SANE_DESC_SCAN_EXPOS_TIME_G \ SANE_I18N("Define exposure-time for green scan") #define SANE_DESC_SCAN_EXPOS_TIME_B \ SANE_I18N("Define exposure-time for blue scan") #define SANE_DESC_SELECT_EXPOSURE_TIME \ SANE_I18N("Enable selection of exposure-time") #define SANE_DESC_CAL_LAMP_DEN \ SANE_I18N("Define lamp density for calibration") #define SANE_DESC_SCAN_LAMP_DEN \ SANE_I18N("Define lamp density for scan") #define SANE_DESC_SELECT_LAMP_DENSITY \ SANE_I18N("Enable selection of lamp density") #define SANE_DESC_LAMP_OFF_AT_EXIT \ SANE_I18N("Turn off lamp when program exits") /* well known options from 'SENSORS' group*/ #define SANE_DESC_SCAN SANE_I18N("Scan button") #define SANE_DESC_EMAIL SANE_I18N("Email button") #define SANE_DESC_FAX SANE_I18N("Fax button") #define SANE_DESC_COPY SANE_I18N("Copy button") #define SANE_DESC_PDF SANE_I18N("PDF button") #define SANE_DESC_CANCEL SANE_I18N("Cancel button") #define SANE_DESC_PAGE_LOADED SANE_I18N("Page loaded") #define SANE_DESC_COVER_OPEN SANE_I18N("Cover open") /* Typical values for stringlists (to keep the backends consistent) */ #define SANE_VALUE_SCAN_MODE_COLOR SANE_I18N("Color") #define SANE_VALUE_SCAN_MODE_COLOR_LINEART SANE_I18N("Color Lineart") #define SANE_VALUE_SCAN_MODE_COLOR_HALFTONE SANE_I18N("Color Halftone") #define SANE_VALUE_SCAN_MODE_GRAY SANE_I18N("Gray") #define SANE_VALUE_SCAN_MODE_HALFTONE SANE_I18N("Halftone") #define SANE_VALUE_SCAN_MODE_LINEART SANE_I18N("Lineart") #endif /* saneopts_h */ sane-backends-extras-1.0.22.3ubuntu1/include/sane/sanei_pv8630.h0000664000000000000000000000666011475557446021054 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 2000 Adrian Perez Jorge Copyright (C) 2001 Frank Zago Copyright (C) 2001 Marcio Teixeira This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. Interface files for the PowerVision 8630 chip, a USB to parallel converter used in many scanners. */ #ifndef sanei_pv8630_h #define sanei_pv8630_h #include "../include/sane/config.h" #include "../include/sane/sane.h" typedef enum { PV8630_REQ_READBYTE = 0x00, PV8630_REQ_WRITEBYTE = 0x01, PV8630_REQ_EPPBULKREAD = 0x02, PV8630_REQ_EPPBULKWRITE = 0x03, PV8630_REQ_FLUSHBUFFER = 0x04, PV8630_REQ_ENABLEINTERRUPT = 0x05, PV8630_REQ_DISABLEINTERRUPT = 0x06, PV8630_REQ_READWORD = 0x08, PV8630_REQ_WRITEWORD = 0x09 } SANEI_PV_Request; typedef enum { PV8630_RDATA = 0x00, PV8630_REPPADDRESS = 0x01, PV8630_UNKNOWN = 0x02, PV8630_RMODE = 0x03, PV8630_RSTATUS = 0x04 } SANEI_PV_Index; extern void sanei_pv8630_init (void); extern SANE_Status sanei_pv8630_write_byte (int fd, SANEI_PV_Index index, SANE_Byte byte); extern SANE_Status sanei_pv8630_read_byte (int fd, SANEI_PV_Index index, SANE_Byte * byte); extern SANE_Status sanei_pv8630_prep_bulkread (int fd, int len); extern SANE_Status sanei_pv8630_prep_bulkwrite (int fd, int len); extern SANE_Status sanei_pv8630_flush_buffer (int fd); extern SANE_Status sanei_pv8630_bulkwrite (int fd, const void *data, size_t * len); extern SANE_Status sanei_pv8630_bulkread (int fd, void *data, size_t * len); extern SANE_Status sanei_pv8630_xpect_byte (int fd, SANEI_PV_Index index, SANE_Byte value, SANE_Byte mask); extern SANE_Status sanei_pv8630_wait_byte (int fd, SANEI_PV_Index index, SANE_Byte value, SANE_Byte mask, int timeout); #endif /* sanei_pv8630_h */ sane-backends-extras-1.0.22.3ubuntu1/include/sane/sanei_pa4s2.h0000664000000000000000000001533111475557446021032 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 2000-2003 Jochen Eisinger This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ /** @file sanei_pa4s2.h * This file implements an interface for the Mustek PP chipset A4S2 * * @sa sanei_usb.h, sanei_ab306.h, sanei_lm983x.h, sanei_scsi.h, sanei_pio.h */ #ifndef sanei_pa4s2_h #define sanei_pa4s2_h #include #include /** @name Options to control interface operations */ /* @{ */ #define SANEI_PA4S2_OPT_DEFAULT 0 /* normal mode */ #define SANEI_PA4S2_OPT_TRY_MODE_UNI 1 /* enable UNI protocoll */ #define SANEI_PA4S2_OPT_ALT_LOCK 2 /* use alternative lock cmd */ #define SANEI_PA4S2_OPT_NO_EPP 4 /* do not try to use EPP */ /* @} */ /** Get list of possibly available devices * * Returns a list of arguments accepted as *dev by sanei_pa4s2_open * * @return * - array of known *devs. The last entry is marked as NULL pointer. The * user has to make sure, the array, but not the entries are freed. * * @sa sanei_pa4s2_open * */ extern const char ** sanei_pa4s2_devices(void); /** Open pa4s2 device * * Opens *dev as pa4s2 device. * * @param dev IO port address ("0x378", "0x278", or "0x3BC") * @param fd file descriptor * * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_INVAL - if no scanner was found or the port number was wrong * - SANE_STATUS_DEVICE_BUSY - if the device is already in use * - SANE_STATUS_IO_ERROR - if the port couldn't be accessed * */ extern SANE_Status sanei_pa4s2_open (const char *dev, int *fd); /** Open pa4s2 SCSI-over-parallel device * * Opens *dev as pa4s2 SCSI-over-parallel device. * * @param dev IO port address ("0x378", "0x278", or "0x3BC") * @param fd file descriptor * * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_INVAL - if no scanner was found or the port number was wrong * - SANE_STATUS_DEVICE_BUSY - if the device is already in use * - SANE_STATUS_IO_ERROR - if the port couldn't be accessed * */ extern SANE_Status sanei_pa4s2_scsi_pp_open (const char *dev, int *fd); /** Close pa4s2 device * * @param fd file descriptor */ extern void sanei_pa4s2_close (int fd); /** Set/get options * * Sets/gets interface options. Options will be taken over, when set is * SANE_TRUE. These options should be set before the first device is opened * * @param options pointer to options * @param set set (SANE_TRUE) or get (SANE_FALSE) options * * @return * - SANE_STATUS_GOOD - on success */ extern SANE_Status sanei_pa4s2_options (u_int * options, int set); /** Enables/disable device * * When the device is disabled, the printer can be accessed, when it's enabled * data can be read/written. * * @param fd file descriptor * @param enable enable (SANE_TRUE) or disable (SANE_FALSE) device * * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_INVAL - if fd is invalid or device not in use */ extern SANE_Status sanei_pa4s2_enable (int fd, int enable); /** Select a register * * The function to read a register is split up in three parts, so a register * can be read more than once. * * @param fd file descriptor * @param reg register * * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_INVAL - if fd is invalid or device not in use * * @sa sanei_pa4s2_readbyte(), sanei_pa4s2_readend() */ extern SANE_Status sanei_pa4s2_readbegin (int fd, u_char reg); /** Return port status information * * @param fd file descriptor * @param status variable to receive status * * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_INVAL - if fd is invalid or device not in use */ extern SANE_Status sanei_pa4s2_scsi_pp_get_status (int fd, u_char *status); /** Selects a register number on a SCSI-over-parallel scanner * * @param fd file descriptor * @param reg register number * * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_INVAL - if fd is invalid */ extern SANE_Status sanei_pa4s2_scsi_pp_reg_select (int fd, int reg); /** Read a register * * The function to read a register is split up in three parts, so a register * can be read more than once. * * @param fd file descriptor * @param val pointer to value * * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_INVAL - if fd is invalid or device not in use * * @sa sanei_pa4s2_readbegin(), sanei_pa4s2_readend() */ extern SANE_Status sanei_pa4s2_readbyte (int fd, u_char * val); /** Terminate reading sequence * * The function to read a register is split up in three parts, so a register * can be read more than once. * * @param fd file descriptor * * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_INVAL - if fd is invalid or device not in use * @sa sanei_pa4s2_readbegin(), sanei_pa4s2_readbyte() */ extern SANE_Status sanei_pa4s2_readend (int fd); /** Write a register * * @param fd file descriptor * @param reg register * @param val value to be written * * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_INVAL - if fd is invalid or device not in use */ extern SANE_Status sanei_pa4s2_writebyte (int fd, u_char reg, u_char val); #endif sane-backends-extras-1.0.22.3ubuntu1/include/sane/sanei_pio.h0000664000000000000000000000426611475557446020675 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 1998 Christian Bucher Copyright (C) 1998 Kling & Hautzinger GmbH This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ #ifndef sanei_pio_h #define sanei_pio_h #include #include extern SANE_Status sanei_pio_open (const char * dev, int * fd); extern void sanei_pio_close (int fd); extern int sanei_pio_read (int fd, u_char * buf, int n); extern int sanei_pio_write (int fd, const u_char * buf, int n); #endif /* sanei_pio_h */ sane-backends-extras-1.0.22.3ubuntu1/include/sane/sanei_config.h0000664000000000000000000001433611475557446021352 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 1997 Jeffrey S. Freedman This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ /** @file sanei_config.h * Generic configuration support. * * Use the functions of this header file if you want to read and analyze * configuration files. */ #ifndef sanei_config_h #define sanei_config_h 1 #include #include /** Search configuration file \a name along directory list and return file * pointer if such a file exists. * * The following directory list is used: * 1st: SANE_CONFIG_DIR environment variable. * 2nd: PATH_SANE_CONFIG_DIR set during configuration. * 3rd: Current directory. * @param name filename with extension but without path (such as "mustek.conf") * * @return file pointer, or NULL if not found * */ extern FILE *sanei_config_open (const char *name); /** Read a line from configuration file. * * Strips all unwanted chars. Use this instead of fgets() to remove * line ending chars on all known platforms. * * @param str points to the buffer for the line * @param n size of the buffer * @param stream file pointer * * @return \a str on success and NULL on error */ extern char *sanei_config_read (char *str, int n, FILE *stream); /** Remove all whitespace from the beginning of a string. * * @param str string * * @return string without leading whitespace * */ extern const char *sanei_config_skip_whitespace (const char *str); /** Scan a string constant from a line of text and return a malloced copy * of it. * * It's the responsibility of the caller to free the returned string constant * at an appropriate time. Whitespace in front of the string constant is * ignored. Whitespace can be included in the string constant by enclosing it * in double-quotes. * * @param str line of text to scan for a string constant * @param string_const copy of the string constant * * @return a pointer to the position in str where the scan stopped */ extern const char *sanei_config_get_string (const char *str, char **string_const); /** Expand device name patterns into a list of devices. * * Apart from a normal device name (such as /dev/sdb), this function currently * supports SCSI device specifications of the form: * * scsi VENDOR MODEL TYPE BUS CHANNEL ID LUN * * Where VENDOR is the desired vendor name. MODEL is the desired model name. * TYPE is the desired device type. All of these can be set to * to match * anything. To include whitespace in these strings, enclose them in * double-quotes ("). BUS, ID, and LUN are the desired SCSI bus, id, and * logical-unit numbers. These can be set to * or simply omitted to match * anything. * * @param name device name pattern * @param attach attach function */ extern void sanei_config_attach_matching_devices (const char *name, SANE_Status (*attach) (const char *dev)); /** this structure holds the description of configuration options. There is * a list for options and another for their values. * These lists are used when the configuration file is * parsed. Read values are stored in Option_Value. Helpers functions are * provided to access values easily */ typedef struct { /** number of options */ SANE_Int count; /** NULL terminated list of configuration option */ SANE_Option_Descriptor **descriptors; /** values for the configuration options */ void **values; } SANEI_Config; /** Parse configuration file, reading configuration options and trying to * attach devices found in file. * * The option are gathered in a single configuration structure. Each time * a line holds a value that is not an option, the attach function is called * with the name found and the configuration structure with it's current values. * * @param config_file name of the configuration file to read * @param config configuration structure to be filled during configuration * parsing and passed to the attach callback function * @param config_attach attach with config callback function * * @return SANE_STATUS_GOOD if no errors * SANE_STATUS_ACCESS_DENIED if configuration file can't be opened */ extern SANE_Status sanei_configure_attach ( const char *config_file, SANEI_Config *config, SANE_Status (*config_attach)(SANEI_Config *config, const char *devname) ); /** Return the list of config directories, extracted from the SANE_CONFIG_DIR * environment variable and the default paths. * @return a string containing the configuration paths, separated by the * operating system's path separator */ extern const char *sanei_config_get_paths (void); #endif /* sanei_config_h */ sane-backends-extras-1.0.22.3ubuntu1/include/sane/sanei_tcp.h0000664000000000000000000000175511475557446020674 0ustar /* sane - Scanner Access Now Easy. * Copyright (C) 2006 Tower Technologies * Author: Alessandro Zummo * This file is part of the SANE package. * * This file is in the public domain. You may use and modify it as * you see fit, as long as this copyright message is included and * that there is an indication as to what modifications have been * made (if any). * * SANE 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. * * Header file for TCP/IP communications. */ #ifndef sanei_tcp_h #define sanei_tcp_h #include #include #include extern SANE_Status sanei_tcp_open(const char *host, int port, int *fdp); extern void sanei_tcp_close(int fd); extern ssize_t sanei_tcp_write(int fd, const u_char * buf, int count); extern ssize_t sanei_tcp_read(int fd, u_char * buf, int count); #endif /* sanei_tcp_h */ sane-backends-extras-1.0.22.3ubuntu1/include/sane/sanei_magic.h0000664000000000000000000001306511475557446021163 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 2009 m. allan noah This file is part of the SANE package. SANE 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 of the License, or (at your option) any later version. SANE 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 sane; see the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ /** @file sanei_magic.h * This file provides an interface to simple image post-processing functions * * Currently, three operations are provided: * - Deskew (correct rotated scans, by detecting media edges) * - Autocrop (reduce image size to minimum rectangle containing media) * - Despeckle (replace dots of significantly different color with background) * * Note that these functions are simplistic, and are expected to change. * Patches and suggestions are welcome. */ #ifndef SANEI_MAGIC_H #define SANEI_MAGIC_H /** Initialize sanei_magic. * * Call this before any other sanei_magic function. */ extern void sanei_magic_init( void ); /** Update the image buffer, replacing dots with surrounding background color * * @param params describes image * @param buffer contains image data * @param diam maximum dot diameter to remove * * @return * - SANE_STATUS_GOOD - success * - SANE_STATUS_INVAL - invalid image parameters */ extern SANE_Status sanei_magic_despeck (SANE_Parameters * params, SANE_Byte * buffer, SANE_Int diam); /** Find the skew of the media inside the image, via edge detection. * * @param params describes image * @param buffer contains image data * @param dpiX horizontal resolution * @param dpiY vertical resolution * @param[out] centerX horizontal coordinate of center of rotation * @param[out] centerY vertical coordinate of center of rotation * @param[out] finSlope slope of rotation * * @return * - SANE_STATUS_GOOD - success * - SANE_STATUS_NO_MEM - not enough memory * - SANE_STATUS_INVAL - invalid image parameters * - SANE_STATUS_UNSUPPORTED - slope angle too shallow to detect */ extern SANE_Status sanei_magic_findSkew(SANE_Parameters * params, SANE_Byte * buffer, int dpiX, int dpiY, int * centerX, int * centerY, double * finSlope); /** Correct the skew of the media inside the image, via simple rotation * * @param params describes image * @param buffer contains image data * @param centerX horizontal coordinate of center of rotation * @param centerY vertical coordinate of center of rotation * @param slope slope of rotation * @param bg_color the replacement color for edges exposed by rotation * * @return * - SANE_STATUS_GOOD - success * - SANE_STATUS_NO_MEM - not enough memory * - SANE_STATUS_INVAL - invalid image parameters */ extern SANE_Status sanei_magic_rotate (SANE_Parameters * params, SANE_Byte * buffer, int centerX, int centerY, double slope, int bg_color); /** Find the edges of the media inside the image, parallel to image edges * * @param params describes image * @param buffer contains image data * @param dpiX horizontal resolution * @param dpiY vertical resolution * @param[out] top vertical offset to upper edge of media * @param[out] bot vertical offset to lower edge of media * @param[out] left horizontal offset to left edge of media * @param[out] right horizontal offset to right edge of media * * @return * - SANE_STATUS_GOOD - success * - SANE_STATUS_NO_MEM - not enough memory * - SANE_STATUS_UNSUPPORTED - edges could not be detected */ extern SANE_Status sanei_magic_findEdges(SANE_Parameters * params, SANE_Byte * buffer, int dpiX, int dpiY, int * top, int * bot, int * left, int * right); /** Crop the image, parallel to image edges * * @param params describes image * @param buffer contains image data * @param top vertical offset to upper edge of crop * @param bot vertical offset to lower edge of crop * @param left horizontal offset to left edge of crop * @param right horizontal offset to right edge of crop * * @return * - SANE_STATUS_GOOD - success * - SANE_STATUS_NO_MEM - not enough memory * - SANE_STATUS_INVAL - invalid image parameters */ extern SANE_Status sanei_magic_crop(SANE_Parameters * params, SANE_Byte * buffer, int top, int bot, int left, int right); #endif /* SANEI_MAGIC_H */ sane-backends-extras-1.0.22.3ubuntu1/include/sane/sanei_lm983x.h0000664000000000000000000001240711475557446021146 0ustar /* sane - Scanner Access Now Easy. based on sources acquired from Plustek Inc. Copyright (C) 2002-2003 Gerhard Jaeger This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ /** @file sanei_lm983x.h * Interface files for the NS LM9831/2/3 USB chip. * * The National Semiconductor LM9831, LM9832, and LM9833 chips are used in * many USB scanners. Examples include Plustek and Mustek devices. * * @sa sanei_usb.h */ #ifndef sanei_lm983x_h #define sanei_lm983x_h #include "../include/sane/config.h" #include "../include/sane/sane.h" /** * Read one data byte from a specific LM983x register. * * @param fd - device file descriptor (SANE_Int) * @param reg - number of register (SANE_Byte) * @param value - byte value to be written (SANE_Byte *) * * @return The SANE status code for the operation (SANE_Status): * - SANE_STATUS_GOOD - on success * - SANE_STATUS_IO_ERROR - system write function failed * - SANE_STATUS_INVAL - register out of range */ #define sanei_lm983x_read_byte(fd, reg, value) \ sanei_lm983x_read (fd, reg, value, 1, 0) /** * Initialize sanei_lm983x. * * Currently, this function only enables the debugging functionality. */ extern void sanei_lm983x_init( void ); /** * Write one data byte to a specific LM983x register. * * @param fd - device file descriptor * @param reg - number of register * @param value - byte value to be written * * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_IO_ERROR - system write function failed * - SANE_STATUS_INVAL - register out of range */ extern SANE_Status sanei_lm983x_write_byte( SANE_Int fd, SANE_Byte reg, SANE_Byte value ); /** * Write one or more data bytes to one or more specific LM983x * registers. * * @param fd - device file descriptor * @param reg - number of start-register * @param buffer - buffer to be written * @param len - number of bytes to be written * @param increment - SANE_TRUE enables the autoincrement of the register * value during the write cycle, SANE_FALSE disables this * * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_IO_ERROR - system read function failed * - SANE_STATUS_INVAL - register out of range or len field was 0 */ extern SANE_Status sanei_lm983x_write( SANE_Int fd, SANE_Byte reg, SANE_Byte *buffer, SANE_Word len, SANE_Bool increment ); /** * Read one or more data bytes from one ore more specific LM983x * registers. * * @param fd - device file descriptor * @param reg - number of start-register * @param buffer - buffer to receive the data * @param len - number of bytes to receive * @param increment - SANE_TRUE enables the autoincrement of the register * value during the read cylce, SANE_FALSE disables this * * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_IO_ERROR - system read function failed * - SANE_STATUS_INVAL - register out of range * - SANE_STATUS_EOF - if nothing can't be read */ extern SANE_Status sanei_lm983x_read( SANE_Int fd, SANE_Byte reg, SANE_Byte *buffer, SANE_Word len, SANE_Bool increment ); /** * Reset the LM983x chip. * * @param fd - device file descriptor * @return * - SANE_TRUE - reset successfuly done * - SANE_FALSE - reset failed */ extern SANE_Bool sanei_lm983x_reset( SANE_Int fd ); #endif /* sanei_lm983x_h */ sane-backends-extras-1.0.22.3ubuntu1/include/sane/sanei_jinclude.h0000664000000000000000000000626211475557446021701 0ustar /* * jinclude.h * * Copyright (C) 1991-1994, Thomas G. Lane. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * * This file exists to provide a single place to fix any problems with * including the wrong system include files. (Common problems are taken * care of by the standard jconfig symbols, but on really weird systems * you may have to edit this file.) * * NOTE: this file is NOT intended to be included by applications using the * JPEG library. Most applications need only include jpeglib.h. */ /* Include auto-config file to find out which system include files we need. */ #include "jconfig.h" /* auto configuration options */ #define JCONFIG_INCLUDED /* so that jpeglib.h doesn't do it again */ /* * We need the NULL macro and size_t typedef. * On an ANSI-conforming system it is sufficient to include . * Otherwise, we get them from or ; we may have to * pull in as well. * Note that the core JPEG library does not require ; * only the default error handler and data source/destination modules do. * But we must pull it in because of the references to FILE in jpeglib.h. * You can remove those references if you want to compile without . */ #ifdef HAVE_STDDEF_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef NEED_SYS_TYPES_H #include #endif #include /* * We need memory copying and zeroing functions, plus strncpy(). * ANSI and System V implementations declare these in . * BSD doesn't have the mem() functions, but it does have bcopy()/bzero(). * Some systems may declare memset and memcpy in . * * NOTE: we assume the size parameters to these functions are of type size_t. * Change the casts in these macros if not! */ #ifdef NEED_BSD_STRINGS #include #define MEMZERO(target,size) bzero((void *)(target), (size_t)(size)) #define MEMCOPY(dest,src,size) bcopy((const void *)(src), (void *)(dest), (size_t)(size)) #else /* not BSD, assume ANSI/SysV string lib */ #include #define MEMZERO(target,size) memset((void *)(target), 0, (size_t)(size)) #define MEMCOPY(dest,src,size) memcpy((void *)(dest), (const void *)(src), (size_t)(size)) #endif /* * In ANSI C, and indeed any rational implementation, size_t is also the * type returned by sizeof(). However, it seems there are some irrational * implementations out there, in which sizeof() returns an int even though * size_t is defined as long or unsigned long. To ensure consistent results * we always use this SIZEOF() macro in place of using sizeof() directly. */ #define SIZEOF(object) ((size_t) sizeof(object)) /* * The modules that use fread() and fwrite() always invoke them through * these macros. On some systems you may need to twiddle the argument casts. * CAUTION: argument order is different from underlying functions! */ #define JFREAD(file,buf,sizeofbuf) \ ((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) #define JFWRITE(file,buf,sizeofbuf) \ ((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) sane-backends-extras-1.0.22.3ubuntu1/include/sane/sanei_codec_ascii.h0000664000000000000000000000467711475557446022341 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 1996 David Mosberger-Tang and Andreas Beck This file is part of the SANE package. SANE 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 of the License, or (at your option) any later version. SANE 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 sane; see the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ /** @file sanei_codec_ascii.h * ASCII codec for network and file transmissions * * Instead translating data to a byte stream this codec uses ASCII hex numbers. * Therefore it can be used for streams that are not 8-bit clean or which can * only use printable characters. It's currently used for saving/restoring * data to/from disk. * * @sa sanei_codec_bin.h sanei_net.h sanei_wire.h */ #ifndef sanei_codec_ascii_h #define sanei_codec_ascii_h /** Initialize the ascii codec * * Set the i/o functions of the Wire to those of the ASCII codec. * * @param w Wire */ extern void sanei_codec_ascii_init (Wire *w); #endif /* sanei_codec_ascii_h */ sane-backends-extras-1.0.22.3ubuntu1/include/sane/sanei_cderror.h0000664000000000000000000001217011475557446021537 0ustar /* * cderror.h * * Copyright (C) 1994, Thomas G. Lane. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * * This file defines the error and message codes for the cjpeg/djpeg * applications. These strings are not needed as part of the JPEG library * proper. * Edit this file to add new codes, or to translate the message strings to * some other language. */ /* * To define the enum list of message codes, include this file without * defining macro JMESSAGE. To create a message string table, include it * again with a suitable JMESSAGE definition (see jerror.c for an example). */ #ifndef JMESSAGE #ifndef CDERROR_H #define CDERROR_H /* First time through, define the enum list */ #define JMAKE_ENUM_LIST #else /* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */ #define JMESSAGE(code,string) #endif /* CDERROR_H */ #endif /* JMESSAGE */ #ifdef JMAKE_ENUM_LIST typedef enum { #define JMESSAGE(code,string) code , #endif /* JMAKE_ENUM_LIST */ JMESSAGE(JMSG_FIRSTADDONCODE=1000, NULL) /* Must be first entry! */ #ifdef BMP_SUPPORTED JMESSAGE(JERR_BMP_BADCMAP, "Unsupported BMP colormap format") JMESSAGE(JERR_BMP_BADDEPTH, "Only 8- and 24-bit BMP files are supported") JMESSAGE(JERR_BMP_BADHEADER, "Invalid BMP file: bad header length") JMESSAGE(JERR_BMP_BADPLANES, "Invalid BMP file: biPlanes not equal to 1") JMESSAGE(JERR_BMP_COLORSPACE, "BMP output must be grayscale or RGB") JMESSAGE(JERR_BMP_COMPRESSED, "Sorry, compressed BMPs not yet supported") JMESSAGE(JERR_BMP_NOT, "Not a BMP file - does not start with BM") JMESSAGE(JTRC_BMP, "%ux%u 24-bit BMP image") JMESSAGE(JTRC_BMP_MAPPED, "%ux%u 8-bit colormapped BMP image") JMESSAGE(JTRC_BMP_OS2, "%ux%u 24-bit OS2 BMP image") JMESSAGE(JTRC_BMP_OS2_MAPPED, "%ux%u 8-bit colormapped OS2 BMP image") #endif /* BMP_SUPPORTED */ #ifdef GIF_SUPPORTED JMESSAGE(JERR_GIF_BUG, "GIF output got confused") JMESSAGE(JERR_GIF_CODESIZE, "Bogus GIF codesize %d") JMESSAGE(JERR_GIF_COLORSPACE, "GIF output must be grayscale or RGB") JMESSAGE(JERR_GIF_IMAGENOTFOUND, "Too few images in GIF file") JMESSAGE(JERR_GIF_NOT, "Not a GIF file") JMESSAGE(JTRC_GIF, "%ux%ux%d GIF image") JMESSAGE(JTRC_GIF_BADVERSION, "Warning: unexpected GIF version number '%c%c%c'") JMESSAGE(JTRC_GIF_EXTENSION, "Ignoring GIF extension block of type 0x%02x") JMESSAGE(JTRC_GIF_NONSQUARE, "Caution: nonsquare pixels in input") JMESSAGE(JWRN_GIF_BADDATA, "Corrupt data in GIF file") JMESSAGE(JWRN_GIF_CHAR, "Bogus char 0x%02x in GIF file, ignoring") JMESSAGE(JWRN_GIF_ENDCODE, "Premature end of GIF image") JMESSAGE(JWRN_GIF_NOMOREDATA, "Ran out of GIF bits") #endif /* GIF_SUPPORTED */ #ifdef PPM_SUPPORTED JMESSAGE(JERR_PPM_COLORSPACE, "PPM output must be grayscale or RGB") JMESSAGE(JERR_PPM_NONNUMERIC, "Nonnumeric data in PPM file") JMESSAGE(JERR_PPM_NOT, "Not a PPM file") JMESSAGE(JTRC_PGM, "%ux%u PGM image") JMESSAGE(JTRC_PGM_TEXT, "%ux%u text PGM image") JMESSAGE(JTRC_PPM, "%ux%u PPM image") JMESSAGE(JTRC_PPM_TEXT, "%ux%u text PPM image") #endif /* PPM_SUPPORTED */ #ifdef RLE_SUPPORTED JMESSAGE(JERR_RLE_BADERROR, "Bogus error code from RLE library") JMESSAGE(JERR_RLE_COLORSPACE, "RLE output must be grayscale or RGB") JMESSAGE(JERR_RLE_DIMENSIONS, "Image dimensions (%ux%u) too large for RLE") JMESSAGE(JERR_RLE_EMPTY, "Empty RLE file") JMESSAGE(JERR_RLE_EOF, "Premature EOF in RLE header") JMESSAGE(JERR_RLE_MEM, "Insufficient memory for RLE header") JMESSAGE(JERR_RLE_NOT, "Not an RLE file") JMESSAGE(JERR_RLE_TOOMANYCHANNELS, "Cannot handle %d output channels for RLE") JMESSAGE(JERR_RLE_UNSUPPORTED, "Cannot handle this RLE setup") JMESSAGE(JTRC_RLE, "%ux%u full-color RLE file") JMESSAGE(JTRC_RLE_FULLMAP, "%ux%u full-color RLE file with map of length %d") JMESSAGE(JTRC_RLE_GRAY, "%ux%u grayscale RLE file") JMESSAGE(JTRC_RLE_MAPGRAY, "%ux%u grayscale RLE file with map of length %d") JMESSAGE(JTRC_RLE_MAPPED, "%ux%u colormapped RLE file with map of length %d") #endif /* RLE_SUPPORTED */ #ifdef TARGA_SUPPORTED JMESSAGE(JERR_TGA_BADCMAP, "Unsupported Targa colormap format") JMESSAGE(JERR_TGA_BADPARMS, "Invalid or unsupported Targa file") JMESSAGE(JERR_TGA_COLORSPACE, "Targa output must be grayscale or RGB") JMESSAGE(JTRC_TGA, "%ux%u RGB Targa image") JMESSAGE(JTRC_TGA_GRAY, "%ux%u grayscale Targa image") JMESSAGE(JTRC_TGA_MAPPED, "%ux%u colormapped Targa image") #else JMESSAGE(JERR_TGA_NOTCOMP, "Targa support was not compiled") #endif /* TARGA_SUPPORTED */ JMESSAGE(JERR_BAD_CMAP_FILE, "Color map file is invalid or of unsupported format") JMESSAGE(JERR_TOO_MANY_COLORS, "Output file format cannot handle %d colormap entries") JMESSAGE(JERR_UNGETC_FAILED, "ungetc failed") #ifdef TARGA_SUPPORTED JMESSAGE(JERR_UNKNOWN_FORMAT, "Unrecognized input file format --- perhaps you need -targa") #else JMESSAGE(JERR_UNKNOWN_FORMAT, "Unrecognized input file format") #endif JMESSAGE(JERR_UNSUPPORTED_FORMAT, "Unsupported output file format") #ifdef JMAKE_ENUM_LIST JMSG_LASTADDONCODE } ADDON_MESSAGE_CODE; #undef JMAKE_ENUM_LIST #endif /* JMAKE_ENUM_LIST */ /* Zap JMESSAGE macro so that future re-inclusions do nothing by default */ #undef JMESSAGE sane-backends-extras-1.0.22.3ubuntu1/include/sane/sanei_wire.h0000664000000000000000000001104011475557446021040 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 1997 David Mosberger-Tang This file is part of the SANE package. SANE 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 of the License, or (at your option) any later version. SANE 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 sane; see the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. Support routines to translate internal datatypes into a wire-format (used for RPCs and to save/restore options). */ #ifndef sanei_wire_h #define sanei_wire_h #include #define MAX_MEM (1024 * 1024) typedef enum { WIRE_ENCODE = 0, WIRE_DECODE, WIRE_FREE } WireDirection; struct Wire; typedef void (*WireCodecFunc) (struct Wire *w, void *val_ptr); typedef ssize_t (*WireReadFunc) (int fd, void * buf, size_t len); typedef ssize_t (*WireWriteFunc) (int fd, const void * buf, size_t len); typedef struct Wire { int version; /* protocol version in use */ WireDirection direction; int status; int allocated_memory; struct { WireCodecFunc w_byte; WireCodecFunc w_char; WireCodecFunc w_word; WireCodecFunc w_string; } codec; struct { size_t size; char *curr; char *start; char *end; } buffer; struct { int fd; WireReadFunc read; WireWriteFunc write; } io; } Wire; extern void sanei_w_init (Wire *w, void (*codec_init)(Wire *)); extern void sanei_w_exit (Wire *w); extern void sanei_w_space (Wire *w, size_t howmuch); extern void sanei_w_void (Wire *w); extern void sanei_w_byte (Wire *w, SANE_Byte *v); extern void sanei_w_char (Wire *w, SANE_Char *v); extern void sanei_w_word (Wire *w, SANE_Word *v); extern void sanei_w_bool (Wire *w, SANE_Bool *v); extern void sanei_w_ptr (Wire *w, void **v, WireCodecFunc w_value, size_t value_size); extern void sanei_w_string (Wire *w, SANE_String *v); extern void sanei_w_status (Wire *w, SANE_Status *v); extern void sanei_w_constraint_type (Wire *w, SANE_Constraint_Type *v); extern void sanei_w_value_type (Wire *w, SANE_Value_Type *v); extern void sanei_w_unit (Wire *w, SANE_Unit *v); extern void sanei_w_action (Wire *w, SANE_Action *v); extern void sanei_w_frame (Wire *w, SANE_Frame *v); extern void sanei_w_range (Wire *w, SANE_Range *v); extern void sanei_w_range_ptr (Wire *w, SANE_Range **v); extern void sanei_w_device (Wire *w, SANE_Device *v); extern void sanei_w_device_ptr (Wire *w, SANE_Device **v); extern void sanei_w_option_descriptor (Wire *w, SANE_Option_Descriptor *v); extern void sanei_w_option_descriptor_ptr (Wire *w, SANE_Option_Descriptor **v); extern void sanei_w_parameters (Wire *w, SANE_Parameters *v); extern void sanei_w_array (Wire *w, SANE_Word *len, void **v, WireCodecFunc w_element, size_t element_size); extern void sanei_w_set_dir (Wire *w, WireDirection dir); extern void sanei_w_call (Wire *w, SANE_Word proc_num, WireCodecFunc w_arg, void *arg, WireCodecFunc w_reply, void *reply); extern void sanei_w_reply (Wire *w, WireCodecFunc w_reply, void *reply); extern void sanei_w_free (Wire *w, WireCodecFunc w_reply, void *reply); #endif /* sanei_wire_h */ sane-backends-extras-1.0.22.3ubuntu1/include/sane/sanei_jpeg.h0000664000000000000000000000347711475557446021036 0ustar /* * cdjpeg.h * * Copyright (C) 1994-1996, Thomas G. Lane. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * * This file contains common declarations for the sample applications * cjpeg and djpeg. It is NOT used by the core JPEG library. */ #define JPEG_CJPEG_DJPEG /* define proper options in jconfig.h */ #define JPEG_INTERNAL_OPTIONS /* cjpeg.c,djpeg.c need to see xxx_SUPPORTED */ #include "sane/sanei_jinclude.h" #include "jpeglib.h" #include "jerror.h" /* get library error codes too */ #include "sane/sanei_cderror.h" /* get application-specific error codes */ /* * Object interface for djpeg's output file encoding modules */ typedef struct djpeg_dest_struct * djpeg_dest_ptr; struct djpeg_dest_struct { /* start_output is called after jpeg_start_decompress finishes. * The color map will be ready at this time, if one is needed. */ JMETHOD(void, start_output, (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)); /* Emit the specified number of pixel rows from the buffer. */ JMETHOD(void, put_pixel_rows, (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, JDIMENSION rows_supplied, char *data)); /* Finish up at the end of the image. */ JMETHOD(void, finish_output, (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)); /* Target file spec; filled in by djpeg.c after object is created. */ FILE * output_file; /* Output pixel-row buffer. Created by module init or start_output. * Width is cinfo->output_width * cinfo->output_components; * height is buffer_height. */ JSAMPARRAY buffer; JDIMENSION buffer_height; }; /* Module selection routines for I/O modules. */ EXTERN(djpeg_dest_ptr) sanei_jpeg_jinit_write_ppm JPP((j_decompress_ptr cinfo)); /* miscellaneous useful macros */ sane-backends-extras-1.0.22.3ubuntu1/include/sane/sanei_debug.h0000664000000000000000000000743211475557446021172 0ustar /** @file sanei_debug.h * Support for printing debug messages. * * Use the functions of this header file to print debug or warning messages. */ #ifndef _SANEI_DEBUG_H #define _SANEI_DEBUG_H #include /** @name Public macros * These macros can be used in backends and other SANE-related * code. * * Before including sanei_debug.h, the following macros must be set: * * - BACKEND_NAME - The name of your backend without double-quotes (must be set in any case) * - STUBS - If this is defined, no macros will be included. Used in * backends consisting of more than one .c file. * - DEBUG_DECLARE_ONLY - Generates prototypes instead of functions. Used in * backends consisting of more than one .c file. * - DEBUG_NOT_STATIC - Doesn't generate static functions. Used in header files if * they are include in more than one .c file. * * @{ */ /** @def DBG_INIT() * Initialize sanei_debug. * * Call this function before you use any DBG function. */ /** @def DBG(level, fmt, ...) * Print a message at debug level `level' or higher using a printf-like * function. Example: DBG(1, "sane_open: opening fd \%d\\n", fd). * * @param level debug level * @param fmt format (see man 3 printf for details) * @param ... additional arguments */ /** @def IF_DBG(x) * Compile code only if debugging is enabled. * * Expands to x if debug support is enabled at compile-time. If NDEBUG is * defined at compile-time this macro expands to nothing. * * @param x code to expand when debugging is enabled */ /** * @def DBG_LEVEL * Current debug level. * * You can only read this "variable". */ /** @def ENTRY(name) * Expands to sane_BACKEND_NAME_name. * * Example: ENTRY(init) in mustek.c will expand to sane_mustek_init. */ /* @} */ /** @hideinitializer*/ #define ENTRY(name) PASTE(PASTE(PASTE(sane_,BACKEND_NAME),_),name) #ifdef NDEBUG extern void sanei_debug_ndebug (int level, const char *msg, ...); # define DBG_LEVEL (0) # define DBG_INIT() # define DBG sanei_debug_ndebug # define IF_DBG(x) #else /* !NDEBUG */ /** @hideinitializer*/ # define DBG_LEVEL PASTE(sanei_debug_,BACKEND_NAME) # if defined(BACKEND_NAME) && !defined(STUBS) # ifdef DEBUG_DECLARE_ONLY extern int DBG_LEVEL; # else /* !DEBUG_DECLARE_ONLY */ int DBG_LEVEL = 0; # endif /* DEBUG_DECLARE_ONLY */ # endif /* BACKEND_NAME && !STUBS */ /** @hideinitializer*/ # define DBG_INIT() \ sanei_init_debug (STRINGIFY(BACKEND_NAME), &DBG_LEVEL) /** @hideinitializer*/ # define DBG_LOCAL PASTE(DBG_LEVEL,_call) # ifndef STUBS # ifdef DEBUG_DECLARE_ONLY extern void DBG_LOCAL (int level, const char *msg, ...) #ifdef __GNUC__ __attribute__ ((format (printf, 2, 3))) #endif ; # else /* !DEBUG_DECLARE_ONLY */ # include extern void sanei_debug_msg (int level, int max_level, const char *be, const char *fmt, va_list ap); #ifdef __GNUC__ # ifndef DEBUG_NOT_STATIC static # endif /* !DEBUG_NOT_STATIC */ void DBG_LOCAL (int level, const char *msg, ...) __attribute__ ((format (printf, 2, 3))); #endif /* __GNUC__ */ # ifndef DEBUG_NOT_STATIC static # endif /* !DEBUG_NOT_STATIC */ void DBG_LOCAL (int level, const char *msg, ...) { va_list ap; va_start (ap, msg); sanei_debug_msg (level, DBG_LEVEL, STRINGIFY(BACKEND_NAME), msg, ap); va_end (ap); } # endif /* DEBUG_DECLARE_ONLY */ # endif /* !STUBS */ /** @hideinitializer*/ # define DBG DBG_LOCAL extern void sanei_init_debug (const char * backend, int * debug_level_var); /** @hideinitializer*/ # define IF_DBG(x) x #endif /* NDEBUG */ #endif /* _SANEI_DEBUG_H */ sane-backends-extras-1.0.22.3ubuntu1/include/sane/sanei_usb.h0000664000000000000000000003756411526062332020664 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 2001, 2002 Henning Meier-Geinitz Copyright (C) 2003, 2005 Rene Rebe (sanei_read_int,sanei_set_timeout) Copyright (C) 2008 m. allan noah (sanei_usb_clear_halt) Copyright (C) 2011 Reinhold Kainhofer (sanei_usb_set_endpoint) This file is part of the SANE package. SANE 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 of the License, or (at your option) any later version. SANE 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 sane; see the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ /** @file sanei_usb.h * This file provides a generic USB interface. * * Currently, two access methods to USB devices are provided: * - Access to device * files as used by the Linux kernel USB scanner driver is supported. FreeBSD * and OpenBSD with their uscanner drivers also work this way. However, * detection and control messages aren't supported on these platforms. * - Access using libusb (where available). * * A general remark: Do not mix sanei_usb functions with "normal" file-related * libc functions like open() or close. The device numbers used in sanei_usb * are not file descriptors. * * @sa sanei_lm983x.h, sanei_pa4s2.h, sanei_pio.h, sanei_scsi.h, and man sane-usb(5) * for user-oriented documentation */ #ifndef sanei_usb_h #define sanei_usb_h #include "../include/sane/config.h" #include "../include/sane/sane.h" #include /* for size_t */ /* USB spec defines */ #ifndef USB_CLASS_PER_INTERFACE /* Also defined in libusb */ /** @name Device and/or interface class codes */ /* @{ */ #define USB_CLASS_PER_INTERFACE 0x00 #define USB_CLASS_AUDIO 0x01 #define USB_CLASS_COMM 0x02 #define USB_CLASS_HID 0x03 #define USB_CLASS_PRINTER 0x07 #define USB_CLASS_MASS_STORAGE 0x08 #define USB_CLASS_HUB 0x09 #define USB_CLASS_DATA 0x0a #define USB_CLASS_VENDOR_SPEC 0xff /* @} */ /** @name USB descriptor types */ /* @{ */ #define USB_DT_DEVICE 0x01 #define USB_DT_CONFIG 0x02 #define USB_DT_STRING 0x03 #define USB_DT_INTERFACE 0x04 #define USB_DT_ENDPOINT 0x05 #define USB_DT_HID 0x21 #define USB_DT_REPORT 0x22 #define USB_DT_PHYSICAL 0x23 #define USB_DT_HUB 0x29 /* @} */ /** @name Descriptor sizes per descriptor type */ /* @{ */ #define USB_DT_DEVICE_SIZE 18 #define USB_DT_CONFIG_SIZE 9 #define USB_DT_INTERFACE_SIZE 9 #define USB_DT_ENDPOINT_SIZE 7 #define USB_DT_ENDPOINT_AUDIO_SIZE 9 #define USB_DT_HUB_NONVAR_SIZE 7 /* @} */ /** @name Endpoint descriptors */ /* @{ */ #define USB_ENDPOINT_ADDRESS_MASK 0x0f #define USB_ENDPOINT_DIR_MASK 0x80 #define USB_ENDPOINT_TYPE_MASK 0x03 #define USB_ENDPOINT_TYPE_CONTROL 0 #define USB_ENDPOINT_TYPE_ISOCHRONOUS 1 #define USB_ENDPOINT_TYPE_BULK 2 #define USB_ENDPOINT_TYPE_INTERRUPT 3 /* @} */ /** @name Standard requests */ /* @{ */ #define USB_REQ_GET_STATUS 0x00 #define USB_REQ_CLEAR_FEATURE 0x01 #define USB_REQ_SET_FEATURE 0x03 #define USB_REQ_SET_ADDRESS 0x05 #define USB_REQ_GET_DESCRIPTOR 0x06 #define USB_REQ_SET_DESCRIPTOR 0x07 #define USB_REQ_GET_CONFIGURATION 0x08 #define USB_REQ_SET_CONFIGURATION 0x09 #define USB_REQ_GET_INTERFACE 0x0A #define USB_REQ_SET_INTERFACE 0x0B #define USB_REQ_SYNCH_FRAME 0x0C /* @} */ /** @name USB types */ /* @{ */ #define USB_TYPE_STANDARD (0x00 << 5) #define USB_TYPE_CLASS (0x01 << 5) #define USB_TYPE_VENDOR (0x02 << 5) #define USB_TYPE_RESERVED (0x03 << 5) /* @} */ /** @name USB recipients */ /* @{ */ #define USB_RECIP_DEVICE 0x00 #define USB_RECIP_INTERFACE 0x01 #define USB_RECIP_ENDPOINT 0x02 #define USB_RECIP_OTHER 0x03 /* @} */ #endif /* not USB_CLASS_PER_INTERFACE */ /* Not defined in libsub */ /** @name USB Masks */ /* @{ */ #define USB_TYPE_MASK (0x03 << 5) #define USB_RECIP_MASK 0x1f /* @} */ /** @name USB directions */ /* @{ */ #define USB_DIR_OUT 0x00 #define USB_DIR_IN 0x80 /* @} */ /** */ struct sanei_usb_dev_descriptor { SANE_Byte desc_type; unsigned int bcd_usb; unsigned int bcd_dev; SANE_Byte dev_class; SANE_Byte dev_sub_class; SANE_Byte dev_protocol; SANE_Byte max_packet_size; }; /** Initialize sanei_usb. * * Call this before any other sanei_usb function. */ extern void sanei_usb_init (void); /** Get the vendor and product ids by device name. * * @param devname * @param vendor vendor id * @param product product id * * @return * - SANE_STATUS_GOOD - if the ids could be determined * - SANE_STATUS_INVAL - if the device is not found * - SANE_STATUS_UNSUPPORTED - if this method is not supported with the current * access method */ SANE_Status sanei_usb_get_vendor_product_byname (SANE_String_Const devname, SANE_Word * vendor, SANE_Word * product); /** Get the vendor and product ids. * * Currently, only libusb devices and scanners supported by the Linux USB * scanner module can be found. For the latter method, the Linux version * must be 2.4.8 or higher. * * @param dn device number of an already sanei_usb_opened device * @param vendor vendor id * @param product product id * * @return * - SANE_STATUS_GOOD - if the ids could be determined * - SANE_STATUS_UNSUPPORTED - if the OS doesn't support detection of ids */ extern SANE_Status sanei_usb_get_vendor_product (SANE_Int dn, SANE_Word * vendor, SANE_Word * product); /** Find devices that match given vendor and product ids. * * For limitations, see function sanei_usb_get_vendor_product(). * The function attach is called for every device which has been found. * * @param vendor vendor id * @param product product id * @param attach attach function * * @return SANE_STATUS_GOOD - on success (even if no scanner was found) */ extern SANE_Status sanei_usb_find_devices (SANE_Int vendor, SANE_Int product, SANE_Status (*attach) (SANE_String_Const devname)); /** Open a USB device. * * The device is opened by its name devname and the device number is * returned in dn on success. * * Device names can be either device file names for direct access over * kernel drivers (like /dev/usb/scanner) or libusb names. The libusb format * looks like this: "libusb:bus-id:device-id". Bus-id and device-id are * platform-dependent. An example could look like this: "libusb:001:002" * (Linux). * * @param devname name of the device to open * @param dn device number * * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_ACCESS_DENIED - if the file couldn't be accessed due to * permissions * - SANE_STATUS_INVAL - on every other error */ extern SANE_Status sanei_usb_open (SANE_String_Const devname, SANE_Int * dn); /** Set the endpoint for the USB communication * * Allows to switch to a different endpoint for the USB communication than * the default (auto-detected) endpoint. This function can only be called * after sanei_usb_open. * * @param dn device number * @param ep_type type of endpoint to set (bitwise or of USB_DIR_IN/OUT and * USB_ENDPOINT_TYPE_BULK/CONTROL/INTERRUPT/ISOCHRONOUS * @param ep endpoint to use for the given type * */ extern void sanei_usb_set_endpoint (SANE_Int dn, SANE_Int ep_type, SANE_Int ep); /** Retrieve the endpoint used for the USB communication * * Returns the endpoint used for the USB communication of the given type. * This function can only be called after sanei_usb_open. * * @param dn device number * @param ep_type type of endpoint to retrieve (bitwise or of USB_DIR_IN/OUT * and USB_ENDPOINT_TYPE_BULK/CONTROL/INTERRUPT/ISOCHRONOUS * @return endpoint used for the given type * */ extern SANE_Int sanei_usb_get_endpoint (SANE_Int dn, SANE_Int ep_type); /** Close a USB device. * * @param dn device number */ extern void sanei_usb_close (SANE_Int dn); /** Set the libusb timeout for bulk and interrupt reads. * * @param timeout the new timeout in ms */ extern void sanei_usb_set_timeout (SANE_Int timeout); /** Check if sanei_usb_set_timeout() is available. */ #define HAVE_SANEI_USB_SET_TIMEOUT /** Clear halt condition on bulk endpoints * * @param dn device number */ extern SANE_Status sanei_usb_clear_halt (SANE_Int dn); /** Check if sanei_usb_clear_halt() is available. */ #define HAVE_SANEI_USB_CLEAR_HALT /** Reset device * * @param dn device number */ extern SANE_Status sanei_usb_reset (SANE_Int dn); /** Initiate a bulk transfer read. * * Read up to size bytes from the device to buffer. After the read, size * contains the number of bytes actually read. * * @param dn device number * @param buffer buffer to store read data in * @param size size of the data * * @return * - SANE_STATUS_GOOD - on succes * - SANE_STATUS_EOF - if zero bytes have been read * - SANE_STATUS_IO_ERROR - if an error occured during the read * - SANE_STATUS_INVAL - on every other error * */ extern SANE_Status sanei_usb_read_bulk (SANE_Int dn, SANE_Byte * buffer, size_t * size); /** Initiate a bulk transfer write. * * Write up to size bytes from buffer to the device. After the write size * contains the number of bytes actually written. * * @param dn device number * @param buffer buffer to write to device * @param size size of the data * * @return * - SANE_STATUS_GOOD - on succes * - SANE_STATUS_IO_ERROR - if an error occured during the write * - SANE_STATUS_INVAL - on every other error */ extern SANE_Status sanei_usb_write_bulk (SANE_Int dn, const SANE_Byte * buffer, size_t * size); /** Send/receive a control message to/from a USB device. * * This function is only supported for libusb devices and kernel acces with * Linux 2.4.13 and newer. * For a detailed explanation of the parameters, have a look at the USB * specification at the * www.usb.org developers information page. * * @param dn device number * @param rtype specifies the characteristics of the request (e.g. data * direction) * @param req actual request * @param value parameter specific to the request * @param index parameter specific to the request (often used to select * endpoint) * @param len length of data to send/receive * @param data buffer to send/receive data * * @return * - SANE_STATUS_GOOD - on success * - SANE_STATUS_IO_ERROR - on error * - SANE_STATUS_UNSUPPORTED - if the feature is not supported by the OS or * SANE. */ extern SANE_Status sanei_usb_control_msg (SANE_Int dn, SANE_Int rtype, SANE_Int req, SANE_Int value, SANE_Int index, SANE_Int len, SANE_Byte * data); /** Initiate a interrupt transfer read. * * Read up to size bytes from the interrupt endpoint from the device to * buffer. After the read, size contains the number of bytes actually read. * * @param dn device number * @param buffer buffer to store read data in * @param size size of the data * * @return * - SANE_STATUS_GOOD - on succes * - SANE_STATUS_EOF - if zero bytes have been read * - SANE_STATUS_IO_ERROR - if an error occured during the read * - SANE_STATUS_INVAL - on every other error * */ extern SANE_Status sanei_usb_read_int (SANE_Int dn, SANE_Byte * buffer, size_t * size); /** Expand device name patterns into a list of devices. * * Apart from a normal device name (such as /dev/usb/scanner0 or * libusb:002:003), this function currently supports USB device * specifications of the form: * * usb VENDOR PRODUCT * * VENDOR and PRODUCT are non-negative integer numbers in decimal or * hexadecimal format. A similar function for SCSI devices can be found * in include/sane/config.h. * * @param name device name pattern * @param attach attach function * */ extern void sanei_usb_attach_matching_devices (const char *name, SANE_Status (*attach) (const char *dev)); /** Initiate set configuration. * * Change set configuration * * @param dn device number * @param configuration, configuration nummber * * @return * - SANE_STATUS_GOOD - on succes * - SANE_STATUS_EOF - if zero bytes have been read * - SANE_STATUS_IO_ERROR - if an error occured during the read * - SANE_STATUS_INVAL - on every other error * */ extern SANE_Status sanei_usb_set_configuration (SANE_Int dn, SANE_Int configuration); /** Initiate claim interface. * * Change claim interface * * @param dn device number * @param interface_number interface number * * @return * - SANE_STATUS_GOOD - on succes * - SANE_STATUS_EOF - if zero bytes have been read * - SANE_STATUS_IO_ERROR - if an error occured during the read * - SANE_STATUS_INVAL - on every other error * */ extern SANE_Status sanei_usb_claim_interface (SANE_Int dn, SANE_Int interface_number); /** Initiate release interface. * * Change release interface * * @param dn device number * @param interface_number interface number * * @return * - SANE_STATUS_GOOD - on succes * - SANE_STATUS_EOF - if zero bytes have been read * - SANE_STATUS_IO_ERROR - if an error occured during the read * - SANE_STATUS_INVAL - on every other error * */ extern SANE_Status sanei_usb_release_interface (SANE_Int dn, SANE_Int interface_number); /** Initiate a set altinterface. * * Change set alternate * * @param dn device number * @param alternate, alternate nummber * * @return * - SANE_STATUS_GOOD - on succes * - SANE_STATUS_EOF - if zero bytes have been read * - SANE_STATUS_IO_ERROR - if an error occured during the read * - SANE_STATUS_INVAL - on every other error * */ extern SANE_Status sanei_usb_set_altinterface (SANE_Int dn, SANE_Int alternate); /** Get some information from the device descriptor * * Sometimes it's useful to know something about revisions and * other stuff reported by the USB system * * @param dn device number * @param desc where to put the information to * * @return * - SANE_STATUS_GOOD - on succes * - SANE_STATUS_UNSUPPORTED - if the feature is not supported by the OS or * SANE. * - SANE_STATUS_INVAL - on every other error * */ extern SANE_Status sanei_usb_get_descriptor( SANE_Int dn, struct sanei_usb_dev_descriptor *desc ); /*------------------------------------------------------*/ #endif /* sanei_usb_h */ sane-backends-extras-1.0.22.3ubuntu1/include/sane/sanei_codec_bin.h0000664000000000000000000000451011475557446022003 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 1996 David Mosberger-Tang and Andreas Beck This file is part of the SANE package. SANE 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 of the License, or (at your option) any later version. SANE 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 sane; see the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ /** @file sanei_codec_bin.h * Binary codec for network transmissions * * Transtale data to a byte stream while taking byte order problems into * account. This codec is currently used for saned and the network backend. * * @sa sanei_codec_ascii.h sanei_net.h sanei_wire.h */ #ifndef sanei_codec_bin_h #define sanei_codec_bin_h /** Initialize the binary codec * * Set the i/o functions of the Wire to those of the binary codec. * * @param w Wire */ extern void sanei_codec_bin_init (Wire *w); #endif /* sanei_codec_bin_h */ sane-backends-extras-1.0.22.3ubuntu1/include/sane/config.h.in0000664000000000000000000004220411516151307020551 0ustar /* include/sane/config.h.in. Generated from configure.in by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ #undef CRAY_STACKSEG_END /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA /* Should we disable SCSI generic v3? */ #undef DISABLE_LINUX_SG_IO /* Define to 1 if the system supports IPv6 */ #undef ENABLE_IPV6 /* Define to 1 if device locking should be enabled. */ #undef ENABLE_LOCKING /* Define to 1 if struct sockaddr_storage has an ss_family member */ #undef HAS_SS_FAMILY /* Define to 1 if struct sockaddr_storage has __ss_family instead of ss_family */ #undef HAS___SS_FAMILY /* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA /* Define to 1 if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H /* Define to 1 if you have the header file. */ #undef HAVE_APOLLO_SCSI_H /* Define to 1 if you have the header file. */ #undef HAVE_ASM_IO_H /* Define to 1 if you have the header file. */ #undef HAVE_ASM_TYPES_H /* Define to 1 if you have the `atexit' function. */ #undef HAVE_ATEXIT /* Define to 1 if you have the header file. */ #undef HAVE_BE_DRIVERS_USB_SCANNER_H /* Define to 1 if you have the header file. */ #undef HAVE_BE_KERNEL_OS_H /* Define to 1 if you have the header file. */ #undef HAVE_BSD_DEV_SCSIREG_H /* Define to 1 if you have the header file. */ #undef HAVE_CAMLIB_H /* Define to 1 if you have the `cfmakeraw' function. */ #undef HAVE_CFMAKERAW /* Define to 1 if you have the header file. */ #undef HAVE_DEV_PPBUS_PPI_H /* Is /dev/urandom available? */ #undef HAVE_DEV_URANDOM /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the `dlopen' function. */ #undef HAVE_DLOPEN /* Define to 1 if you have the header file. */ #undef HAVE_DL_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `getaddrinfo' function. */ #undef HAVE_GETADDRINFO /* Define to 1 if you have the `getenv' function. */ #undef HAVE_GETENV /* Define to 1 if you have the `getnameinfo' function. */ #undef HAVE_GETNAMEINFO /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H /* Define to 1 if you have the `getopt_long' function. */ #undef HAVE_GETOPT_LONG /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE /* Define to 1 if you have the `gp_camera_init' function. */ #undef HAVE_GP_CAMERA_INIT /* Define to 1 if you have the `gp_port_info_get_path' function. */ #undef HAVE_GP_PORT_INFO_GET_PATH /* Define to 1 if you have the `i386_set_ioperm' function. */ #undef HAVE_I386_SET_IOPERM /* Define to 1 if you have the header file. */ #undef HAVE_IFADDRS_H /* Define to 1 if you have the `inet_addr' function. */ #undef HAVE_INET_ADDR /* Define to 1 if you have the `inet_aton' function. */ #undef HAVE_INET_ATON /* Define to 1 if you have the `inet_ntoa' function. */ #undef HAVE_INET_NTOA /* Define to 1 if you have the `inet_ntop' function. */ #undef HAVE_INET_NTOP /* Define to 1 if you have the `inet_pton' function. */ #undef HAVE_INET_PTON /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_IOKIT_CDB_IOSCSILIB_H /* Define to 1 if you have the header file. */ #undef HAVE_IOKIT_SCSI_COMMANDS_SCSICOMMANDOPERATIONCODES_H /* Define to 1 if you have the header file. */ #undef HAVE_IOKIT_SCSI_SCSICOMMANDOPERATIONCODES_H /* Define to 1 if you have the header file. */ #undef HAVE_IOKIT_SCSI_SCSITASKLIB_H /* Define to 1 if you have the `ioperm' function. */ #undef HAVE_IOPERM /* Define to 1 if you have the `iopl' function. */ #undef HAVE_IOPL /* Define to 1 if you have the header file. */ #undef HAVE_IO_CAM_CAM_H /* Define to 1 if you have the `isfdtype' function. */ #undef HAVE_ISFDTYPE /* Define to 1 if you have the header file. */ #undef HAVE_LIBC_H /* Define to 1 if you have the `ieee1284' library (-lcam). */ #undef HAVE_LIBIEEE1284 /* Define to 1 if you have the libjpeg library. */ #undef HAVE_LIBJPEG /* Define to 1 if you have the net-snmp library. */ #undef HAVE_LIBSNMP /* Define to 1 if you have libusb. */ #undef HAVE_LIBUSB /* Define to 1 if you have libusb-1.0. */ #undef HAVE_LIBUSB_1_0 /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_PPDEV_H /* Define if the long long type is available. */ #undef HAVE_LONG_LONG /* Define to 1 if you have the header file. */ #undef HAVE_MACHINE_CPUFUNC_H /* Define to 1 if you have the header file. */ #undef HAVE_MACH_O_DYLD_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mkdir' function. */ #undef HAVE_MKDIR /* Define to 1 if you have a working `mmap' system call. */ #undef HAVE_MMAP /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* Define to 1 if you have the `NSLinkModule' function. */ #undef HAVE_NSLINKMODULE /* Define to 1 if you have the header file. */ #undef HAVE_OS2_H /* Define to 1 if you have the `poll' function. */ #undef HAVE_POLL /* Define to 1 if you have the `pthread_cancel' function. */ #undef HAVE_PTHREAD_CANCEL /* Define to 1 if you have the `pthread_create' function. */ #undef HAVE_PTHREAD_CREATE /* Define to 1 if you have the `pthread_detach' function. */ #undef HAVE_PTHREAD_DETACH /* Define to 1 if you have the header file. */ #undef HAVE_PTHREAD_H /* Define to 1 if you have the `pthread_join' function. */ #undef HAVE_PTHREAD_JOIN /* Define to 1 if you have the `pthread_kill' function. */ #undef HAVE_PTHREAD_KILL /* Define to 1 if you have the `pthread_testcancel' function. */ #undef HAVE_PTHREAD_TESTCANCEL /* Define to 1 if you have the header file. */ #undef HAVE_PWD_H /* define if you have the resmgr library */ #undef HAVE_RESMGR /* Define to 1 if you have the header file. */ #undef HAVE_SCDDS_H /* Define to 1 if you have the `scsireq_enter' function. */ #undef HAVE_SCSIREQ_ENTER /* Define if SCSITaskSGElement is available. */ #undef HAVE_SCSITASKSGELEMENT /* Define to 1 if you have the header file. */ #undef HAVE_SCSI_H /* Define to 1 if you have the header file. */ #undef HAVE_SCSI_SG_H /* Define to 1 if you have the `setitimer' function. */ #undef HAVE_SETITIMER /* Define if sg_header.target_status is available. */ #undef HAVE_SG_TARGET_STATUS /* Define to 1 if you have the `shl_load' function. */ #undef HAVE_SHL_LOAD /* Define to 1 if you have the `sigprocmask' function. */ #undef HAVE_SIGPROCMASK /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strcasestr' function. */ #undef HAVE_STRCASESTR /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strftime' function. */ #undef HAVE_STRFTIME /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strncasecmp' function. */ #undef HAVE_STRNCASECMP /* Define to 1 if you have the `strndup' function. */ #undef HAVE_STRNDUP /* Define to 1 if you have the `strsep' function. */ #undef HAVE_STRSEP /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the `strtod' function. */ #undef HAVE_STRTOD /* Define if struct flock is available. */ #undef HAVE_STRUCT_FLOCK /* Define to 1 if you have the header file. */ #undef HAVE_SYS_BITYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DSREQ_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_HW_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IPC_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PASSTHRUDEF_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_POLL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SCANIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SCSICMD_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SCSIIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SCSI_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SCSI_SCSI_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SCSI_SGDEFS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SCSI_TARGETS_SCGIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SDI_COMM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SEM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SHM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SIGNAL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the `tcsendbreak' function. */ #undef HAVE_TCSENDBREAK /* Define to 1 if you have the header file. */ #undef HAVE_TIFFIO_H /* Define if union semun is available. */ #undef HAVE_UNION_SEMUN /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have usbcall.dll. */ #undef HAVE_USBCALL /* Define to 1 if you have the `usleep' function. */ #undef HAVE_USLEEP /* Define to 1 if the system has the type `u_char'. */ #undef HAVE_U_CHAR /* Define to 1 if the system has the type `u_int'. */ #undef HAVE_U_INT /* Define to 1 if the system has the type `u_long'. */ #undef HAVE_U_LONG /* Define to 1 if the system has the type `u_short'. */ #undef HAVE_U_SHORT /* Define to 1 if you have the `vsyslog' function. */ #undef HAVE_VSYSLOG /* Define to 1 if you have the header file. */ #undef HAVE_WINDOWS_H /* Define to 1 if you have the `_portaccess' function. */ #undef HAVE__PORTACCESS /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O /* Define to the name of the distribution. */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* SANE DLL revision number */ #undef SANE_DLL_V_BUILD /* SANE DLL major number */ #undef SANE_DLL_V_MAJOR /* SANE DLL minor number */ #undef SANE_DLL_V_MINOR /* SCSI command buffer size */ #undef SCSIBUFFERSIZE /* The size of `char', as computed by sizeof. */ #undef SIZEOF_CHAR /* The size of `int', as computed by sizeof. */ #undef SIZEOF_INT /* The size of `long', as computed by sizeof. */ #undef SIZEOF_LONG /* The size of `short', as computed by sizeof. */ #undef SIZEOF_SHORT /* The size of `void*', as computed by sizeof. */ #undef SIZEOF_VOIDP /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at runtime. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define if pthreads should be used instead of forked processes. */ #undef USE_PTHREAD /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Define to the version of the distribution. */ #undef VERSION /* define if Avahi support is enabled for saned and the net backend */ #undef WITH_AVAHI /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #endif /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to `int' if does not define. */ #undef pid_t /* Define scsireq_t as \'struct scsireq\' if necessary. */ #undef scsireq_t /* Define to `unsigned int' if does not define. */ #undef size_t /* Define socklen_t as \'int\' if necessary. */ #undef socklen_t /* Define to `long' if does not define. */ #undef ssize_t /* Define for OS/2 only */ #undef strcasecmp /* Define for OS/2 only */ #undef strncasecmp #if defined(__MINGW32__) #define _BSDTYPES_DEFINED #endif #ifndef HAVE_U_CHAR #define u_char unsigned char #endif #ifndef HAVE_U_SHORT #define u_short unsigned short #endif #ifndef HAVE_U_INT #define u_int unsigned int #endif #ifndef HAVE_U_LONG #define u_long unsigned long #endif /* Prototype for getenv */ #ifndef HAVE_GETENV #define getenv sanei_getenv char * getenv(const char *name); #endif /* Prototype for inet_ntop */ #ifndef HAVE_INET_NTOP #define inet_ntop sanei_inet_ntop #include const char * inet_ntop (int af, const void *src, char *dst, size_t cnt); #endif /* Prototype for inet_pton */ #ifndef HAVE_INET_PTON #define inet_pton sanei_inet_pton int inet_pton (int af, const char *src, void *dst); #endif /* Prototype for isfdtype */ #ifndef HAVE_ISFDTYPE #define isfdtype sanei_isfdtype int isfdtype(int fd, int fdtype); #endif /* Prototype for sigprocmask */ #ifndef HAVE_SIGPROCMASK #define sigprocmask sanei_sigprocmask int sigprocmask (int how, int *new, int *old); #endif /* Prototype for snprintf */ #ifndef HAVE_SNPRINTF #define snprintf sanei_snprintf #include int snprintf (char *str,size_t count,const char *fmt,...); #endif /* Prototype for strcasestr */ #ifndef HAVE_STRCASESTR #define strcasestr sanei_strcasestr char * strcasestr (const char *phaystack, const char *pneedle); #endif /* Prototype for strdup */ #ifndef HAVE_STRDUP #define strdup sanei_strdup char *strdup (const char * s); #endif /* Prototype for strndup */ #ifndef HAVE_STRNDUP #define strndup sanei_strndup #include char *strndup(const char * s, size_t n); #endif /* Prototype for strsep */ #ifndef HAVE_STRSEP #define strsep sanei_strsep char *strsep(char **stringp, const char *delim); #endif /* Prototype for usleep */ #ifndef HAVE_USLEEP #define usleep sanei_usleep unsigned int usleep (unsigned int useconds); #endif /* Prototype for vsyslog */ #ifndef HAVE_VSYSLOG #include void vsyslog(int priority, const char *format, va_list args); #endif sane-backends-extras-1.0.22.3ubuntu1/include/sane/sanei_ab306.h0000664000000000000000000000452011475557446020712 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 1997 Andreas Czechanowski This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ #ifndef sanei_ab306_h #define sanei_ab306_h #include #include SANE_Status sanei_ab306_open (const char *dev, int *fd); void sanei_ab306_close (int fd); void sanei_ab306_exit (void); SANE_Status sanei_ab306_get_io_privilege (int fd); SANE_Status sanei_ab306_test_ready (int fd); SANE_Status sanei_ab306_cmd (int fd, const void *src, size_t src_size, void *dst, size_t *dst_size); SANE_Status sanei_ab306_rdata (int fd, int planes, SANE_Byte *buf, int lines, int bpl); #endif /* sanei_ab306_h */ sane-backends-extras-1.0.22.3ubuntu1/include/sane/sane.h0000664000000000000000000001737011475557446017655 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 1997-1999 David Mosberger-Tang and Andreas Beck This file is part of the SANE package. This file is in the public domain. You may use and modify it as you see fit, as long as this copyright message is included and that there is an indication as to what modifications have been made (if any). SANE 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. This file declares SANE application interface. See the SANE standard for a detailed explanation of the interface. */ #ifndef sane_h #define sane_h #ifdef __cplusplus extern "C" { #endif /* * SANE types and defines */ #define SANE_CURRENT_MAJOR 1 #define SANE_CURRENT_MINOR 0 #define SANE_VERSION_CODE(major, minor, build) \ ( (((SANE_Word) (major) & 0xff) << 24) \ | (((SANE_Word) (minor) & 0xff) << 16) \ | (((SANE_Word) (build) & 0xffff) << 0)) #define SANE_VERSION_MAJOR(code) ((((SANE_Word)(code)) >> 24) & 0xff) #define SANE_VERSION_MINOR(code) ((((SANE_Word)(code)) >> 16) & 0xff) #define SANE_VERSION_BUILD(code) ((((SANE_Word)(code)) >> 0) & 0xffff) #define SANE_FALSE 0 #define SANE_TRUE 1 typedef unsigned char SANE_Byte; typedef int SANE_Word; typedef SANE_Word SANE_Bool; typedef SANE_Word SANE_Int; typedef char SANE_Char; typedef SANE_Char *SANE_String; typedef const SANE_Char *SANE_String_Const; typedef void *SANE_Handle; typedef SANE_Word SANE_Fixed; #define SANE_FIXED_SCALE_SHIFT 16 #define SANE_FIX(v) ((SANE_Word) ((v) * (1 << SANE_FIXED_SCALE_SHIFT))) #define SANE_UNFIX(v) ((double)(v) / (1 << SANE_FIXED_SCALE_SHIFT)) typedef enum { SANE_STATUS_GOOD = 0, /* everything A-OK */ SANE_STATUS_UNSUPPORTED, /* operation is not supported */ SANE_STATUS_CANCELLED, /* operation was cancelled */ SANE_STATUS_DEVICE_BUSY, /* device is busy; try again later */ SANE_STATUS_INVAL, /* data is invalid (includes no dev at open) */ SANE_STATUS_EOF, /* no more data available (end-of-file) */ SANE_STATUS_JAMMED, /* document feeder jammed */ SANE_STATUS_NO_DOCS, /* document feeder out of documents */ SANE_STATUS_COVER_OPEN, /* scanner cover is open */ SANE_STATUS_IO_ERROR, /* error during device I/O */ SANE_STATUS_NO_MEM, /* out of memory */ SANE_STATUS_ACCESS_DENIED /* access to resource has been denied */ } SANE_Status; /* following are for later sane version, older frontends wont support */ #if 0 #define SANE_STATUS_WARMING_UP 12 /* lamp not ready, please retry */ #define SANE_STATUS_HW_LOCKED 13 /* scanner mechanism locked for transport */ #endif typedef enum { SANE_TYPE_BOOL = 0, SANE_TYPE_INT, SANE_TYPE_FIXED, SANE_TYPE_STRING, SANE_TYPE_BUTTON, SANE_TYPE_GROUP } SANE_Value_Type; typedef enum { SANE_UNIT_NONE = 0, /* the value is unit-less (e.g., # of scans) */ SANE_UNIT_PIXEL, /* value is number of pixels */ SANE_UNIT_BIT, /* value is number of bits */ SANE_UNIT_MM, /* value is millimeters */ SANE_UNIT_DPI, /* value is resolution in dots/inch */ SANE_UNIT_PERCENT, /* value is a percentage */ SANE_UNIT_MICROSECOND /* value is micro seconds */ } SANE_Unit; typedef struct { SANE_String_Const name; /* unique device name */ SANE_String_Const vendor; /* device vendor string */ SANE_String_Const model; /* device model name */ SANE_String_Const type; /* device type (e.g., "flatbed scanner") */ } SANE_Device; #define SANE_CAP_SOFT_SELECT (1 << 0) #define SANE_CAP_HARD_SELECT (1 << 1) #define SANE_CAP_SOFT_DETECT (1 << 2) #define SANE_CAP_EMULATED (1 << 3) #define SANE_CAP_AUTOMATIC (1 << 4) #define SANE_CAP_INACTIVE (1 << 5) #define SANE_CAP_ADVANCED (1 << 6) #define SANE_OPTION_IS_ACTIVE(cap) (((cap) & SANE_CAP_INACTIVE) == 0) #define SANE_OPTION_IS_SETTABLE(cap) (((cap) & SANE_CAP_SOFT_SELECT) != 0) #define SANE_INFO_INEXACT (1 << 0) #define SANE_INFO_RELOAD_OPTIONS (1 << 1) #define SANE_INFO_RELOAD_PARAMS (1 << 2) typedef enum { SANE_CONSTRAINT_NONE = 0, SANE_CONSTRAINT_RANGE, SANE_CONSTRAINT_WORD_LIST, SANE_CONSTRAINT_STRING_LIST } SANE_Constraint_Type; typedef struct { SANE_Word min; /* minimum (element) value */ SANE_Word max; /* maximum (element) value */ SANE_Word quant; /* quantization value (0 if none) */ } SANE_Range; typedef struct { SANE_String_Const name; /* name of this option (command-line name) */ SANE_String_Const title; /* title of this option (single-line) */ SANE_String_Const desc; /* description of this option (multi-line) */ SANE_Value_Type type; /* how are values interpreted? */ SANE_Unit unit; /* what is the (physical) unit? */ SANE_Int size; SANE_Int cap; /* capabilities */ SANE_Constraint_Type constraint_type; union { const SANE_String_Const *string_list; /* NULL-terminated list */ const SANE_Word *word_list; /* first element is list-length */ const SANE_Range *range; } constraint; } SANE_Option_Descriptor; typedef enum { SANE_ACTION_GET_VALUE = 0, SANE_ACTION_SET_VALUE, SANE_ACTION_SET_AUTO } SANE_Action; typedef enum { SANE_FRAME_GRAY, /* band covering human visual range */ SANE_FRAME_RGB, /* pixel-interleaved red/green/blue bands */ SANE_FRAME_RED, /* red band only */ SANE_FRAME_GREEN, /* green band only */ SANE_FRAME_BLUE /* blue band only */ } SANE_Frame; /* push remaining types down to match existing backends */ /* these are to be exposed in a later version of SANE */ /* most front-ends will require updates to understand them */ #if 0 #define SANE_FRAME_TEXT 0x0A /* backend specific textual data */ #define SANE_FRAME_JPEG 0x0B /* complete baseline JPEG file */ #define SANE_FRAME_G31D 0x0C /* CCITT Group 3 1-D Compressed (MH) */ #define SANE_FRAME_G32D 0x0D /* CCITT Group 3 2-D Compressed (MR) */ #define SANE_FRAME_G42D 0x0E /* CCITT Group 4 2-D Compressed (MMR) */ #define SANE_FRAME_IR 0x0F /* bare infrared channel */ #define SANE_FRAME_RGBI 0x10 /* red+green+blue+infrared */ #define SANE_FRAME_GRAYI 0x11 /* gray+infrared */ #define SANE_FRAME_XML 0x12 /* undefined schema */ #endif typedef struct { SANE_Frame format; SANE_Bool last_frame; SANE_Int bytes_per_line; SANE_Int pixels_per_line; SANE_Int lines; SANE_Int depth; } SANE_Parameters; struct SANE_Auth_Data; #define SANE_MAX_USERNAME_LEN 128 #define SANE_MAX_PASSWORD_LEN 128 typedef void (*SANE_Auth_Callback) (SANE_String_Const resource, SANE_Char *username, SANE_Char *password); extern SANE_Status sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize); extern void sane_exit (void); extern SANE_Status sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only); extern SANE_Status sane_open (SANE_String_Const devicename, SANE_Handle * handle); extern void sane_close (SANE_Handle handle); extern const SANE_Option_Descriptor * sane_get_option_descriptor (SANE_Handle handle, SANE_Int option); extern SANE_Status sane_control_option (SANE_Handle handle, SANE_Int option, SANE_Action action, void *value, SANE_Int * info); extern SANE_Status sane_get_parameters (SANE_Handle handle, SANE_Parameters * params); extern SANE_Status sane_start (SANE_Handle handle); extern SANE_Status sane_read (SANE_Handle handle, SANE_Byte * data, SANE_Int max_length, SANE_Int * length); extern void sane_cancel (SANE_Handle handle); extern SANE_Status sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking); extern SANE_Status sane_get_select_fd (SANE_Handle handle, SANE_Int * fd); extern SANE_String_Const sane_strstatus (SANE_Status status); #ifdef __cplusplus } #endif #endif /* sane_h */ sane-backends-extras-1.0.22.3ubuntu1/include/sane/sanei_pp.h0000664000000000000000000001316511475557446020523 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 2003 Gerhard Jaeger This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ /** @file sanei_pp.h * This file implements an interface for accessing the parallel-port * * @sa sanei_pp.h */ #ifndef sanei_pp_h #define sanei_pp_h #include #include /** some modes, we'd like to see/use. */ enum sanei_pp_mode { SANEI_PP_MODE_SPP = (1<<1), /**< SPP */ SANEI_PP_MODE_BIDI = (1<<2), /**< BIDI */ SANEI_PP_MODE_EPP = (1<<4), /**< EPP */ SANEI_PP_MODE_ECP = (1<<8) /**< ECP */ }; #define SANEI_PP_DATAIN 1 #define SANEI_PP_DATAOUT 0 /* @{ */ /** Parallelport Control-Register definitions */ #define SANEI_PP_CTRL_STROBE 0x01 #define SANEI_PP_CTRL_AUTOLF 0x02 #define SANEI_PP_CTRL_NOT_INIT 0x04 #define SANEI_PP_CTRL_SELECT_IN 0x08 #define SANEI_PP_CTRL_ENABLE_IRQ 0x10 #define SANEI_PP_CTRL_DIRECTION 0x20 #define SANEI_PP_CTRL_RESERVED 0xc0 /* @} */ /** Initialize sanei_pp. * * This function must be called before any other sanei_pp function. */ extern SANE_Status sanei_pp_init( void ); /** Open a parport device. * * @param dev - name of device to open. * @param fd - pointer to variable that should revceive the handle. * @return */ extern SANE_Status sanei_pp_open( const char *dev, int *fd ); /* Close a previously opened parport device. * * @param fd - handle of the device to close */ extern void sanei_pp_close( int fd ); /** Claim a parport device * * @param fd - handle of the device to claim * @return */ extern SANE_Status sanei_pp_claim( int fd ); /** Release a previously claimed device * * @param fd - handle of the device to release * @return */ extern SANE_Status sanei_pp_release( int fd ); /** Set the data direction * * @param fd - handle of the device, where to change the direction. * @param rev - * @return SANE_STATUS_GOOD on success */ extern SANE_Status sanei_pp_set_datadir( int fd, int rev ); /** Check whether for libieee1284 usage. * * This function can be used to check if the lib uses libieee1284 or * in/out functions directly. * * @return SANE_TRUE if we use direct access, SANE_FALSE if the lib uses * libieee1284 functions. */ extern SANE_Bool sanei_pp_uses_directio( void ); /** Determine the available parallel port modes for a given device. * * @param fd - handle of the device, whose modes shall be checked for. * @param mode - pointer to variable, which should receive the modes. * @return SANE_STATUS_GOOD on success. */ extern SANE_Status sanei_pp_getmodes( int fd, int *mode ); /** Set the operation mode for a given device. * * @param fd - handle of the device, whose modes shall be set. * @param mode - mode to set, see sanei_pp_mode. * @return SANE_STATUS_GOOD on success. */ extern SANE_Status sanei_pp_setmode( int fd, int mode ); /** Write data to ports (spp-data, ctrl, epp-address and epp-data) * * @param fd - handle of device to which shall be written to. * @param val - data to write. * @return SANE_STATUS_GOOD on success. */ extern SANE_Status sanei_pp_outb_data( int fd, SANE_Byte val ); extern SANE_Status sanei_pp_outb_ctrl( int fd, SANE_Byte val ); extern SANE_Status sanei_pp_outb_addr( int fd, SANE_Byte val ); extern SANE_Status sanei_pp_outb_epp ( int fd, SANE_Byte val ); /** Read data from ports (spp-data, status, ctrl and epp-data) * @param fd - handle of device who should be read from. * @return value got from port */ extern SANE_Byte sanei_pp_inb_data( int fd ); extern SANE_Byte sanei_pp_inb_stat( int fd ); extern SANE_Byte sanei_pp_inb_ctrl( int fd ); extern SANE_Byte sanei_pp_inb_epp ( int fd ); /** Delay execution for some micro-seconds. * Please not, that the accuracy highly depends on your system architechture * and the time to delay. It is internally implemented as system calls to * gettimeofday(). * * @param usec - number of micro-seconds to delay */ extern void sanei_pp_udelay( unsigned long usec ); #endif sane-backends-extras-1.0.22.3ubuntu1/include/sane/sanei_backend.h0000664000000000000000000001154411475557446021472 0ustar /** @file sanei_backend.h * Compatibility header file for backends * * This file provides some defines for macros missing on some platforms. * It also has the SANE API entry points. sanei_backend.h must be included * by every backend. * * @sa sanei.h sanei_thread.h */ /* * Compiler related options */ /** Mark unused variables/parameters * * Tells the compiler a variable is unused, so the compiler doesn't spit a warning. */ #ifdef __GNUC__ #define __sane_unused__ __attribute__((unused)) #else #define __sane_unused__ #endif /** @name Compatibility macros * @{ */ #include #ifdef HAVE_SYS_HW_H /* OS/2 i/o-port access compatibility macros: */ # define inb(p) _inp8 (p) # define outb(v,p) _outp8 ((p),(v)) # define ioperm(b,l,o) _portaccess ((b),(b)+(l)-1) # define HAVE_IOPERM 1 #endif #ifndef HAVE_OS2_H #include #ifndef O_NONBLOCK # ifdef O_NDELAY # define O_NONBLOCK O_NDELAY # else # define O_NONBLOCK FNDELAY /* last resort */ # endif #endif #endif /* HAVE_OS2_H */ #include #ifndef PATH_MAX # define PATH_MAX 1024 #endif #ifndef M_PI #define M_PI 3.14159265358979323846 #endif #ifndef MM_PER_INCH #define MM_PER_INCH 25.4 #endif #ifdef HAVE_SIGPROCMASK # define SIGACTION sigaction #else /* Just enough backwards compatibility that we get by in the backends without making handstands. */ # ifdef sigset_t # undef sigset_t # endif # ifdef sigemptyset # undef sigemptyset # endif # ifdef sigfillset # undef sigfillset # endif # ifdef sigaddset # undef sigaddset # endif # ifdef sigdelset # undef sigdelset # endif # ifdef sigprocmask # undef sigprocmask # endif # ifdef SIG_BLOCK # undef SIG_BLOCK # endif # ifdef SIG_UNBLOCK # undef SIG_UNBLOCK # endif # ifdef SIG_SETMASK # undef SIG_SETMASK # endif # define sigset_t int # define sigemptyset(set) do { *(set) = 0; } while (0) # define sigfillset(set) do { *(set) = ~0; } while (0) # define sigaddset(set,signal) do { *(set) |= sigmask (signal); } while (0) # define sigdelset(set,signal) do { *(set) &= ~sigmask (signal); } while (0) # define sigaction(sig,new,old) sigvec (sig,new,old) /* Note: it's not safe to just declare our own "struct sigaction" since some systems (e.g., some versions of OpenStep) declare that structure, but do not implement sigprocmask(). Hard to believe, aint it? */ # define SIGACTION sigvec # define SIG_BLOCK 1 # define SIG_UNBLOCK 2 # define SIG_SETMASK 3 #endif /* !HAVE_SIGPROCMASK */ /* @} */ /** @name Declaration of entry points: * @{ */ extern SANE_Status ENTRY(init) (SANE_Int *, SANE_Auth_Callback); extern SANE_Status ENTRY(get_devices) (const SANE_Device ***, SANE_Bool); extern SANE_Status ENTRY(open) (SANE_String_Const, SANE_Handle *); extern const SANE_Option_Descriptor * ENTRY(get_option_descriptor) (SANE_Handle, SANE_Int); extern SANE_Status ENTRY(control_option) (SANE_Handle, SANE_Int, SANE_Action, void *, SANE_Word *); extern SANE_Status ENTRY(get_parameters) (SANE_Handle, SANE_Parameters *); extern SANE_Status ENTRY(start) (SANE_Handle); extern SANE_Status ENTRY(read) (SANE_Handle, SANE_Byte *, SANE_Int, SANE_Int *); extern SANE_Status ENTRY(set_io_mode) (SANE_Handle, SANE_Bool); extern SANE_Status ENTRY(get_select_fd) (SANE_Handle, SANE_Int *); extern void ENTRY(cancel) (SANE_Handle); extern void ENTRY(close) (SANE_Handle); extern void ENTRY(exit) (void); #ifndef STUBS /* Now redirect sane_* calls to backend's functions: */ #define sane_init(a,b) ENTRY(init) (a,b) #define sane_get_devices(a,b) ENTRY(get_devices) (a,b) #define sane_open(a,b) ENTRY(open) (a,b) #define sane_get_option_descriptor(a,b) ENTRY(get_option_descriptor) (a,b) #define sane_control_option(a,b,c,d,e) ENTRY(control_option) (a,b,c,d,e) #define sane_get_parameters(a,b) ENTRY(get_parameters) (a,b) #define sane_start(a) ENTRY(start) (a) #define sane_read(a,b,c,d) ENTRY(read) (a,b,c,d) #define sane_set_io_mode(a,b) ENTRY(set_io_mode) (a,b) #define sane_get_select_fd(a,b) ENTRY(get_select_fd) (a,b) #define sane_cancel(a) ENTRY(cancel) (a) #define sane_close(a) ENTRY(close) (a) #define sane_exit(a) ENTRY(exit) (a) #endif /* STUBS */ /* @} */ /** Internationalization for SANE backends * * Add SANE_I18N() to all texts that can be translated. * E.g. out_txt = SANE_I18N("Hello"); */ #ifndef SANE_I18N #define SANE_I18N(text) text #endif /** Option_Value union * * Convenience union to access option values given to the backend */ #ifndef SANE_OPTION typedef union { SANE_Bool b; /**< bool */ SANE_Word w; /**< word */ SANE_Word *wa; /**< word array */ SANE_String s; /**< string */ } Option_Value; #define SANE_OPTION 1 #endif sane-backends-extras-1.0.22.3ubuntu1/include/sane/sanei_thread.h0000664000000000000000000001152111475557446021345 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 1998-2001 Yuri Dario Copyright (C) 2002-2003 Henning Meier-Geinitz (documentation) Copyright (C) 2003-2004 Gerhard Jaeger (pthread/process support) This file is part of the SANE package. SANE 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 of the License, or (at your option) any later version. SANE 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 sane; see the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ /** @file sanei_thread.h * Support for forking processes and threading. * * Backends should not use fork() directly because fork() does not work * correctly on some platforms. Use the functions provided by sanei_thread * instead. The build system decides if fork() or threads are used. * * Please keep in mind that the behaviour of the child process depends * on if it's a process or thread especially concerning variables. * * In this file we use "task" as an umbrella term for process and thread. * * @sa sanei.h sanei_backend.h */ #ifndef sanei_thread_h #define sanei_thread_h #include "../include/sane/config.h" #ifdef USE_PTHREAD typedef long SANE_Pid; #else typedef int SANE_Pid; #endif /** Initialize sanei_thread. * * This function must be called before any other sanei_thread function. */ extern void sanei_thread_init (void); /** Do we use processes or threads? * * This function can be used to check if processes or threads are used. * * @return * - SANE_TRUE - if processes are used (fork) * - SANE_FALSE - i threads are used */ extern SANE_Bool sanei_thread_is_forked (void); /** Spawn a new task. * * This function should be used to start a new task. * * @param func() function to call as child task * @param args argument of the function (only one!) * * @return * - task id * - -1 if creating the new task failed */ extern SANE_Pid sanei_thread_begin (int (*func) (void *args), void *args); /** Terminate spawned task. * * This function terminates the task that was created with sanei_thread_begin. * * For processes, SIGTERM is sent. If threads are used, pthread_cancel() * terminates the task. * * @param pid - the id of the task * * @return * - 0 on success * - any other value if an error occured while terminating the task */ extern int sanei_thread_kill (SANE_Pid pid); /** Send a signal to a task. * * This function can be used to send a signal to a task. * * For terminating the task, sanei_thread_kill() should be used. * * @param pid - the id of the task * @param sig - the signal to send * * @return * - 0 - on success * - any other value - if an error occured while sending the signal */ extern int sanei_thread_sendsig (SANE_Pid pid, int sig); /** Wait for task termination. * * This function waits until a task that has been terminated by * sanei_thread_kill(), sanei_thread_sendsys() or by any other means * is finished. * * @param pid - the id of the task * @param status - status of the task that has just finished * * @return * - the pid of the task we have been waiting for */ extern SANE_Pid sanei_thread_waitpid (SANE_Pid pid, int *status); /** Check the current status of the spawned task * * * @param pid - the id of the task * * @return * - SANE_STATUS_GOOD - if the task finished without errors * - any other value - if the task finished unexpectantly or hasn't finished yet */ extern SANE_Status sanei_thread_get_status (SANE_Pid pid); #endif /* sanei_thread_h */ sane-backends-extras-1.0.22.3ubuntu1/include/sane/sanei_auth.h0000664000000000000000000000700311475557446021037 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 2000 Jochen Eisinger This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ /** @file sanei_auth.h * Interface for authorization of resources * * This file implements an interface for user authorization. The authorization * call is forwarded to the frontend which asks for a username and password. * An MD5 digest is used if supported by the frontend. * * @sa sanei.h sanei_backend.h */ #ifndef sanei_auth_h #define sanei_auth_h #include "../include/sane/sane.h" /** Check authorization for a resource * * This function looks for the file SANE_CONFIG_DIR/backend.users. * If this file doesn't exist, sanei_authorize always returns SANE_STATUS_GOOD. * The file backend.users contains a list of usernames, passwords, and * resources: * * username:password:resource * username:password:resource * * If the requested resource isn't listed in this file, sanei_authorize * return SANE_SATUS_GOOD. In all other cases, sanei_authorize sends a * challenge to the frontend of the form * * resource$MD5$randomstring * * where randomstring consists of the PID, the time, and some random * characters. It accepts two forms of answers * * std: username:password * md5: username:$MD5$m5digest * * where md5digest is md5(randomstring password). * * If this username/password/resource triple is listed in backend.users * sanei_authorize returns SANE_STATUS_GOOD, in all other cases it returns * SANE_STATUS_ACCESS_DENIED. * * @param resource resource to authorize * @param backend backend name * @param authorize auth callback * * @return * - SANE_STATUS_GOOD - access is granted * - SANE_STATUS_ACCESS_DENIED - access is denied */ SANE_Status sanei_authorize (const char *resource, const char *backend, SANE_Auth_Callback authorize); #endif /* sanei_auth_h */ sane-backends-extras-1.0.22.3ubuntu1/include/lgetopt.h0000664000000000000000000001463311475557446017456 0ustar /* Declarations for getopt. Copyright (C) 1989-1994, 1996-1999, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #if defined(HAVE_GETOPT_H) && defined(HAVE_GETOPT_LONG) #include #else #ifndef _GETOPT_H #ifndef __need_getopt # define _GETOPT_H 1 #endif /* If __GNU_LIBRARY__ is not already defined, either we are being used standalone, or this is the first header included in the source file. If we are being used with glibc, we need to include , but that does not exist if we are standalone. So: if __GNU_LIBRARY__ is not defined, include , which will pull in for us if it's from glibc. (Why ctype.h? It's guaranteed to exist and it doesn't flood the namespace with stuff the way some other headers do.) */ #if !defined __GNU_LIBRARY__ # include #endif #ifdef __cplusplus extern "C" { #endif /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; #ifndef __need_getopt /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of `struct option' terminated by an element containing a name which is zero. The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the option's `flag' field to zero and its `val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ struct option { # if (defined __STDC__ && __STDC__) || defined __cplusplus const char *name; # else char *name; # endif /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the `has_arg' field of `struct option'. */ # define no_argument 0 # define required_argument 1 # define optional_argument 2 #endif /* need getopt */ /* Get definitions and prototypes for functions to process the arguments in ARGV (ARGC of them, minus the program name) for options given in OPTS. Return the option character from OPTS just read. Return -1 when there are no more options. For unrecognized options, or options missing arguments, `optopt' is set to the option letter, and '?' is returned. The OPTS string is a list of characters which are recognized option letters, optionally followed by colons, specifying that that letter takes an argument, to be placed in `optarg'. If a letter in OPTS is followed by two colons, its argument is optional. This behavior is specific to the GNU `getopt'. The argument `--' causes premature termination of argument scanning, explicitly telling `getopt' that there are no more options. If OPTS begins with `--', then non-option arguments are treated as arguments to the option '\0'. This behavior is specific to the GNU `getopt'. */ #if (defined __STDC__ && __STDC__) || defined __cplusplus # ifdef __GNU_LIBRARY__ /* Many other libraries have conflicting prototypes for getopt, with differences in the consts, in stdlib.h. To avoid compilation errors, only prototype getopt for the GNU C library. */ extern int getopt (int ___argc, char *const *___argv, const char *__shortopts); # else /* not __GNU_LIBRARY__ */ extern int getopt (); # endif /* __GNU_LIBRARY__ */ # ifndef __need_getopt extern int getopt_long (int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind); extern int getopt_long_only (int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind); /* Internal only. Users should not call this directly. */ extern int _getopt_internal (int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind, int __long_only); # endif #else /* not __STDC__ */ extern int getopt (); # ifndef __need_getopt extern int getopt_long (); extern int getopt_long_only (); extern int _getopt_internal (); # endif #endif /* __STDC__ */ #ifdef __cplusplus } #endif /* Make sure we later can get all the definitions and declarations. */ #undef __need_getopt #endif /* lgetopt.h */ #endif /* !external getopt.h */ sane-backends-extras-1.0.22.3ubuntu1/include/font_6x11.h0000664000000000000000000020452111475557446017522 0ustar /**********************************************/ /* */ /* Font file generated by rthelen */ /* */ /**********************************************/ static unsigned char fontdata[] = { /* 0 0x00 '^A' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 1 0x01 '^B' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 2 0x02 '^C' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 3 0x03 '^D' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 4 0x04 '^E' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 5 0x05 '^F' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 6 0x06 '^G' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 7 0x07 '^H' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 8 0x08 '^I' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 9 0x09 '^J' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 10 0x0a '^K' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 11 0x0b '^L' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 12 0x0c '^M' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 13 0x0d '^N' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 14 0x0e '^O' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 15 0x0f '^P' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 16 0x10 '^Q' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 17 0x11 '^R' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x28, /* 00 0 000 */ 0x54, /* 0 0 0 00 */ 0x38, /* 00 000 */ 0x54, /* 0 0 0 00 */ 0x28, /* 00 0 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 18 0x12 '^S' */ 0x04, /* 00000 00 */ 0x04, /* 00000 00 */ 0x08, /* 0000 000 */ 0x08, /* 0000 000 */ 0x50, /* 0 0 0000 */ 0x50, /* 0 0 0000 */ 0x20, /* 00 00000 */ 0x20, /* 00 00000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 19 0x13 '^T' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x10, /* 000 0000 */ 0x38, /* 00 000 */ 0x7c, /* 0 00 */ 0x38, /* 00 000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 20 0x14 '^U' */ 0x18, /* 000 000 */ 0x10, /* 000 0000 */ 0x28, /* 00 0 000 */ 0x7c, /* 0 00 */ 0x78, /* 0 000 */ 0x78, /* 0 000 */ 0x7c, /* 0 00 */ 0x28, /* 00 0 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 21 0x15 '^V' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 22 0x16 '^W' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 23 0x17 '^X' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 24 0x18 '^Y' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 25 0x19 '^Z' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 26 0x1a '^[' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 27 0x1b '^\' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 28 0x1c '^]' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 29 0x1d '^^' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 30 0x1e '^_' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 31 0x1f '^`' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 32 0x20 ' ' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 33 0x21 '!' */ 0x00, /* 00000000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 34 0x22 '"' */ 0x28, /* 00 0 000 */ 0x28, /* 00 0 000 */ 0x28, /* 00 0 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 35 0x23 '#' */ 0x00, /* 00000000 */ 0x28, /* 00 0 000 */ 0x7c, /* 0 00 */ 0x28, /* 00 0 000 */ 0x7c, /* 0 00 */ 0x28, /* 00 0 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 36 0x24 '$' */ 0x10, /* 000 0000 */ 0x38, /* 00 000 */ 0x54, /* 0 0 0 00 */ 0x50, /* 0 0 0000 */ 0x38, /* 00 000 */ 0x14, /* 000 0 00 */ 0x54, /* 0 0 0 00 */ 0x38, /* 00 000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 37 0x25 '%' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x54, /* 0 0 0 00 */ 0x58, /* 0 0 000 */ 0x28, /* 00 0 000 */ 0x34, /* 00 0 00 */ 0x54, /* 0 0 0 00 */ 0x48, /* 0 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 38 0x26 '&' */ 0x00, /* 00000000 */ 0x30, /* 00 0000 */ 0x48, /* 0 00 000 */ 0x50, /* 0 0 0000 */ 0x20, /* 00 00000 */ 0x54, /* 0 0 0 00 */ 0x48, /* 0 00 000 */ 0x34, /* 00 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 39 0x27 ''' */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 40 0x28 '(' */ 0x04, /* 00000 00 */ 0x08, /* 0000 000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x08, /* 0000 000 */ 0x04, /* 00000 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 41 0x29 ')' */ 0x20, /* 00 00000 */ 0x10, /* 000 0000 */ 0x08, /* 0000 000 */ 0x08, /* 0000 000 */ 0x08, /* 0000 000 */ 0x08, /* 0000 000 */ 0x08, /* 0000 000 */ 0x10, /* 000 0000 */ 0x20, /* 00 00000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 42 0x2a '*' */ 0x00, /* 00000000 */ 0x10, /* 000 0000 */ 0x54, /* 0 0 0 00 */ 0x38, /* 00 000 */ 0x54, /* 0 0 0 00 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 43 0x2b '+' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x7c, /* 0 00 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 44 0x2c ',' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x30, /* 00 0000 */ 0x30, /* 00 0000 */ 0x10, /* 000 0000 */ 0x20, /* 00 00000 */ 0x00, /* 00000000 */ /* 45 0x2d '-' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7c, /* 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 46 0x2e '.' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x18, /* 000 000 */ 0x18, /* 000 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 47 0x2f '/' */ 0x04, /* 00000 00 */ 0x04, /* 00000 00 */ 0x08, /* 0000 000 */ 0x08, /* 0000 000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x20, /* 00 00000 */ 0x20, /* 00 00000 */ 0x40, /* 0 000000 */ 0x40, /* 0 000000 */ 0x00, /* 00000000 */ /* 48 0x30 '0' */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x4c, /* 0 00 00 */ 0x54, /* 0 0 0 00 */ 0x64, /* 0 00 00 */ 0x44, /* 0 000 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 49 0x31 '1' */ 0x00, /* 00000000 */ 0x08, /* 0000 000 */ 0x18, /* 000 000 */ 0x08, /* 0000 000 */ 0x08, /* 0000 000 */ 0x08, /* 0000 000 */ 0x08, /* 0000 000 */ 0x1c, /* 000 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 50 0x32 '2' */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x04, /* 00000 00 */ 0x08, /* 0000 000 */ 0x10, /* 000 0000 */ 0x20, /* 00 00000 */ 0x7c, /* 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 51 0x33 '3' */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x04, /* 00000 00 */ 0x18, /* 000 000 */ 0x04, /* 00000 00 */ 0x44, /* 0 000 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 52 0x34 '4' */ 0x00, /* 00000000 */ 0x08, /* 0000 000 */ 0x18, /* 000 000 */ 0x28, /* 00 0 000 */ 0x48, /* 0 00 000 */ 0x7c, /* 0 00 */ 0x08, /* 0000 000 */ 0x1c, /* 000 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 53 0x35 '5' */ 0x00, /* 00000000 */ 0x7c, /* 0 00 */ 0x40, /* 0 000000 */ 0x78, /* 0 000 */ 0x04, /* 00000 00 */ 0x04, /* 00000 00 */ 0x44, /* 0 000 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 54 0x36 '6' */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x40, /* 0 000000 */ 0x78, /* 0 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 55 0x37 '7' */ 0x00, /* 00000000 */ 0x7c, /* 0 00 */ 0x04, /* 00000 00 */ 0x04, /* 00000 00 */ 0x08, /* 0000 000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 56 0x38 '8' */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 57 0x39 '9' */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x3c, /* 00 00 */ 0x04, /* 00000 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 58 0x3a ':' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x18, /* 000 000 */ 0x18, /* 000 000 */ 0x00, /* 00000000 */ 0x18, /* 000 000 */ 0x18, /* 000 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 59 0x3b ';' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x30, /* 00 0000 */ 0x30, /* 00 0000 */ 0x00, /* 00000000 */ 0x30, /* 00 0000 */ 0x30, /* 00 0000 */ 0x10, /* 000 0000 */ 0x20, /* 00 00000 */ 0x00, /* 00000000 */ /* 60 0x3c '<' */ 0x00, /* 00000000 */ 0x04, /* 00000 00 */ 0x08, /* 0000 000 */ 0x10, /* 000 0000 */ 0x20, /* 00 00000 */ 0x10, /* 000 0000 */ 0x08, /* 0000 000 */ 0x04, /* 00000 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 61 0x3d '=' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7c, /* 0 00 */ 0x00, /* 00000000 */ 0x7c, /* 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 62 0x3e '>' */ 0x00, /* 00000000 */ 0x20, /* 00 00000 */ 0x10, /* 000 0000 */ 0x08, /* 0000 000 */ 0x04, /* 00000 00 */ 0x08, /* 0000 000 */ 0x10, /* 000 0000 */ 0x20, /* 00 00000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 63 0x3f '?' */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x04, /* 00000 00 */ 0x08, /* 0000 000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 64 0x40 '@' */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x74, /* 0 0 00 */ 0x54, /* 0 0 0 00 */ 0x78, /* 0 000 */ 0x40, /* 0 000000 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 65 0x41 'A' */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x7c, /* 0 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 66 0x42 'B' */ 0x00, /* 00000000 */ 0x78, /* 0 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x78, /* 0 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x78, /* 0 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 67 0x43 'C' */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x40, /* 0 000000 */ 0x40, /* 0 000000 */ 0x40, /* 0 000000 */ 0x44, /* 0 000 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 68 0x44 'D' */ 0x00, /* 00000000 */ 0x78, /* 0 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x78, /* 0 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 69 0x45 'E' */ 0x00, /* 00000000 */ 0x7c, /* 0 00 */ 0x40, /* 0 000000 */ 0x40, /* 0 000000 */ 0x78, /* 0 000 */ 0x40, /* 0 000000 */ 0x40, /* 0 000000 */ 0x7c, /* 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 70 0x46 'F' */ 0x00, /* 00000000 */ 0x7c, /* 0 00 */ 0x40, /* 0 000000 */ 0x40, /* 0 000000 */ 0x78, /* 0 000 */ 0x40, /* 0 000000 */ 0x40, /* 0 000000 */ 0x40, /* 0 000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 71 0x47 'G' */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x40, /* 0 000000 */ 0x4c, /* 0 00 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 72 0x48 'H' */ 0x00, /* 00000000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x7c, /* 0 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 73 0x49 'I' */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 74 0x4a 'J' */ 0x00, /* 00000000 */ 0x04, /* 00000 00 */ 0x04, /* 00000 00 */ 0x04, /* 00000 00 */ 0x04, /* 00000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 75 0x4b 'K' */ 0x00, /* 00000000 */ 0x44, /* 0 000 00 */ 0x48, /* 0 00 000 */ 0x50, /* 0 0 0000 */ 0x60, /* 0 00000 */ 0x50, /* 0 0 0000 */ 0x48, /* 0 00 000 */ 0x44, /* 0 000 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 76 0x4c 'L' */ 0x00, /* 00000000 */ 0x40, /* 0 000000 */ 0x40, /* 0 000000 */ 0x40, /* 0 000000 */ 0x40, /* 0 000000 */ 0x40, /* 0 000000 */ 0x40, /* 0 000000 */ 0x7c, /* 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 77 0x4d 'M' */ 0x00, /* 00000000 */ 0x44, /* 0 000 00 */ 0x6c, /* 0 0 00 */ 0x54, /* 0 0 0 00 */ 0x54, /* 0 0 0 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 78 0x4e 'N' */ 0x00, /* 00000000 */ 0x44, /* 0 000 00 */ 0x64, /* 0 00 00 */ 0x54, /* 0 0 0 00 */ 0x4c, /* 0 00 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 79 0x4f 'O' */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 80 0x50 'P' */ 0x00, /* 00000000 */ 0x78, /* 0 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x78, /* 0 000 */ 0x40, /* 0 000000 */ 0x40, /* 0 000000 */ 0x40, /* 0 000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 81 0x51 'Q' */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x54, /* 0 0 0 00 */ 0x38, /* 00 000 */ 0x04, /* 00000 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 82 0x52 'R' */ 0x00, /* 00000000 */ 0x78, /* 0 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x78, /* 0 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 83 0x53 'S' */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x40, /* 0 000000 */ 0x38, /* 00 000 */ 0x04, /* 00000 00 */ 0x44, /* 0 000 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 84 0x54 'T' */ 0x00, /* 00000000 */ 0x7c, /* 0 00 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 85 0x55 'U' */ 0x00, /* 00000000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 86 0x56 'V' */ 0x00, /* 00000000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x28, /* 00 0 000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 87 0x57 'W' */ 0x00, /* 00000000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x54, /* 0 0 0 00 */ 0x54, /* 0 0 0 00 */ 0x6c, /* 0 0 00 */ 0x44, /* 0 000 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 88 0x58 'X' */ 0x00, /* 00000000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x28, /* 00 0 000 */ 0x10, /* 000 0000 */ 0x28, /* 00 0 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 89 0x59 'Y' */ 0x00, /* 00000000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x28, /* 00 0 000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 90 0x5a 'Z' */ 0x00, /* 00000000 */ 0x7c, /* 0 00 */ 0x04, /* 00000 00 */ 0x08, /* 0000 000 */ 0x10, /* 000 0000 */ 0x20, /* 00 00000 */ 0x40, /* 0 000000 */ 0x7c, /* 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 91 0x5b '[' */ 0x0c, /* 0000 00 */ 0x08, /* 0000 000 */ 0x08, /* 0000 000 */ 0x08, /* 0000 000 */ 0x08, /* 0000 000 */ 0x08, /* 0000 000 */ 0x08, /* 0000 000 */ 0x08, /* 0000 000 */ 0x0c, /* 0000 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 92 0x5c '\' */ 0x20, /* 00 00000 */ 0x20, /* 00 00000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x08, /* 0000 000 */ 0x08, /* 0000 000 */ 0x04, /* 00000 00 */ 0x04, /* 00000 00 */ 0x02, /* 000000 0 */ 0x02, /* 000000 0 */ 0x00, /* 00000000 */ /* 93 0x5d ']' */ 0x30, /* 00 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x30, /* 00 0000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 94 0x5e '^' */ 0x00, /* 00000000 */ 0x10, /* 000 0000 */ 0x28, /* 00 0 000 */ 0x44, /* 0 000 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 95 0x5f '_' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 0 0 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 96 0x60 '`' */ 0x20, /* 00 00000 */ 0x10, /* 000 0000 */ 0x08, /* 0000 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 97 0x61 'a' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x4c, /* 0 00 00 */ 0x34, /* 00 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 98 0x62 'b' */ 0x00, /* 00000000 */ 0x40, /* 0 000000 */ 0x40, /* 0 000000 */ 0x78, /* 0 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x78, /* 0 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 99 0x63 'c' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x40, /* 0 000000 */ 0x44, /* 0 000 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 100 0x64 'd' */ 0x00, /* 00000000 */ 0x04, /* 00000 00 */ 0x04, /* 00000 00 */ 0x3c, /* 00 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 101 0x65 'e' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x7c, /* 0 00 */ 0x40, /* 0 000000 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 102 0x66 'f' */ 0x00, /* 00000000 */ 0x0c, /* 0000 00 */ 0x10, /* 000 0000 */ 0x38, /* 00 000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 103 0x67 'g' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x3c, /* 00 00 */ 0x04, /* 00000 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ /* 104 0x68 'h' */ 0x00, /* 00000000 */ 0x40, /* 0 000000 */ 0x40, /* 0 000000 */ 0x78, /* 0 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 105 0x69 'i' */ 0x00, /* 00000000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x30, /* 00 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 106 0x6a 'j' */ 0x00, /* 00000000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x30, /* 00 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x60, /* 0 00000 */ 0x00, /* 00000000 */ /* 107 0x6b 'k' */ 0x00, /* 00000000 */ 0x40, /* 0 000000 */ 0x40, /* 0 000000 */ 0x48, /* 0 00 000 */ 0x50, /* 0 0 0000 */ 0x70, /* 0 0000 */ 0x48, /* 0 00 000 */ 0x44, /* 0 000 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 108 0x6c 'l' */ 0x00, /* 00000000 */ 0x30, /* 00 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 109 0x6d 'm' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x78, /* 0 000 */ 0x54, /* 0 0 0 00 */ 0x54, /* 0 0 0 00 */ 0x54, /* 0 0 0 00 */ 0x54, /* 0 0 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 110 0x6e 'n' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x58, /* 0 0 000 */ 0x64, /* 0 00 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 111 0x6f 'o' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 112 0x70 'p' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x78, /* 0 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x78, /* 0 000 */ 0x40, /* 0 000000 */ 0x40, /* 0 000000 */ 0x00, /* 00000000 */ /* 113 0x71 'q' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x3c, /* 00 00 */ 0x04, /* 00000 00 */ 0x04, /* 00000 00 */ 0x00, /* 00000000 */ /* 114 0x72 'r' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x58, /* 0 0 000 */ 0x64, /* 0 00 00 */ 0x40, /* 0 000000 */ 0x40, /* 0 000000 */ 0x40, /* 0 000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 115 0x73 's' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x40, /* 0 000000 */ 0x38, /* 00 000 */ 0x04, /* 00000 00 */ 0x78, /* 0 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 116 0x74 't' */ 0x00, /* 00000000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x38, /* 00 000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x0c, /* 0000 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 117 0x75 'u' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x4c, /* 0 00 00 */ 0x34, /* 00 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 118 0x76 'v' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x28, /* 00 0 000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 119 0x77 'w' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x54, /* 0 0 0 00 */ 0x54, /* 0 0 0 00 */ 0x54, /* 0 0 0 00 */ 0x54, /* 0 0 0 00 */ 0x28, /* 00 0 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 120 0x78 'x' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x44, /* 0 000 00 */ 0x28, /* 00 0 000 */ 0x10, /* 000 0000 */ 0x28, /* 00 0 000 */ 0x44, /* 0 000 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 121 0x79 'y' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x3c, /* 00 00 */ 0x04, /* 00000 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ /* 122 0x7a 'z' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7c, /* 0 00 */ 0x08, /* 0000 000 */ 0x10, /* 000 0000 */ 0x20, /* 00 00000 */ 0x7c, /* 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 123 0x7b '{' */ 0x08, /* 0000 000 */ 0x08, /* 0000 000 */ 0x08, /* 0000 000 */ 0x08, /* 0000 000 */ 0x10, /* 000 0000 */ 0x08, /* 0000 000 */ 0x08, /* 0000 000 */ 0x08, /* 0000 000 */ 0x08, /* 0000 000 */ 0x04, /* 00000 00 */ 0x00, /* 00000000 */ /* 124 0x7c '|' */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 125 0x7d '}' */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x08, /* 0000 000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x20, /* 00 00000 */ 0x00, /* 00000000 */ /* 126 0x7e '~' */ 0x00, /* 00000000 */ 0x34, /* 00 0 00 */ 0x58, /* 0 0 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 127 0x7f '^?' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 128 0x80 '\200' */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x7c, /* 0 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 129 0x81 '\201' */ 0x28, /* 00 0 000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x7c, /* 0 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 130 0x82 '\202' */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x40, /* 0 000000 */ 0x40, /* 0 000000 */ 0x40, /* 0 000000 */ 0x44, /* 0 000 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 131 0x83 '\203' */ 0x10, /* 000 0000 */ 0x7c, /* 0 00 */ 0x40, /* 0 000000 */ 0x40, /* 0 000000 */ 0x78, /* 0 000 */ 0x40, /* 0 000000 */ 0x40, /* 0 000000 */ 0x7c, /* 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 132 0x84 '\204' */ 0x58, /* 0 0 000 */ 0x44, /* 0 000 00 */ 0x64, /* 0 00 00 */ 0x54, /* 0 0 0 00 */ 0x4c, /* 0 00 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 133 0x85 '\205' */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 134 0x86 '\206' */ 0x00, /* 00000000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 135 0x87 '\207' */ 0x08, /* 0000 000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x4c, /* 0 00 00 */ 0x34, /* 00 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 136 0x88 '\210' */ 0x10, /* 000 0000 */ 0x08, /* 0000 000 */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x4c, /* 0 00 00 */ 0x34, /* 00 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 137 0x89 '\211' */ 0x10, /* 000 0000 */ 0x28, /* 00 0 000 */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x4c, /* 0 00 00 */ 0x34, /* 00 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 138 0x8a '\212' */ 0x00, /* 00000000 */ 0x28, /* 00 0 000 */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x4c, /* 0 00 00 */ 0x34, /* 00 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 139 0x8b '\213' */ 0x34, /* 00 0 00 */ 0x58, /* 0 0 000 */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x4c, /* 0 00 00 */ 0x34, /* 00 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 140 0x8c '\214' */ 0x18, /* 000 000 */ 0x24, /* 00 00 00 */ 0x18, /* 000 000 */ 0x3c, /* 00 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x4c, /* 0 00 00 */ 0x34, /* 00 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 141 0x8d '\215' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x40, /* 0 000000 */ 0x40, /* 0 000000 */ 0x3c, /* 00 00 */ 0x10, /* 000 0000 */ 0x20, /* 00 00000 */ 0x00, /* 00000000 */ /* 142 0x8e '\216' */ 0x08, /* 0000 000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x7c, /* 0 00 */ 0x40, /* 0 000000 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 143 0x8f '\217' */ 0x20, /* 00 00000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x7c, /* 0 00 */ 0x40, /* 0 000000 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 144 0x90 '\220' */ 0x10, /* 000 0000 */ 0x28, /* 00 0 000 */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x7c, /* 0 00 */ 0x40, /* 0 000000 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 145 0x91 '\221' */ 0x00, /* 00000000 */ 0x28, /* 00 0 000 */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x7c, /* 0 00 */ 0x40, /* 0 000000 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 146 0x92 '\222' */ 0x08, /* 0000 000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 147 0x93 '\223' */ 0x20, /* 00 00000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 148 0x94 '\224' */ 0x10, /* 000 0000 */ 0x28, /* 00 0 000 */ 0x00, /* 00000000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 149 0x95 '\225' */ 0x00, /* 00000000 */ 0x28, /* 00 0 000 */ 0x00, /* 00000000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 150 0x96 '\226' */ 0x34, /* 00 0 00 */ 0x58, /* 0 0 000 */ 0x00, /* 00000000 */ 0x58, /* 0 0 000 */ 0x64, /* 0 00 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 151 0x97 '\227' */ 0x08, /* 0000 000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 152 0x98 '\230' */ 0x20, /* 00 00000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 153 0x99 '\231' */ 0x10, /* 000 0000 */ 0x28, /* 00 0 000 */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 154 0x9a '\232' */ 0x00, /* 00000000 */ 0x28, /* 00 0 000 */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 155 0x9b '\233' */ 0x34, /* 00 0 00 */ 0x58, /* 0 0 000 */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 156 0x9c '\234' */ 0x08, /* 0000 000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x4c, /* 0 00 00 */ 0x34, /* 00 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 157 0x9d '\235' */ 0x20, /* 00 00000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x4c, /* 0 00 00 */ 0x34, /* 00 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 158 0x9e '\236' */ 0x10, /* 000 0000 */ 0x28, /* 00 0 000 */ 0x00, /* 00000000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x4c, /* 0 00 00 */ 0x34, /* 00 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 159 0x9f '\237' */ 0x00, /* 00000000 */ 0x28, /* 00 0 000 */ 0x00, /* 00000000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x4c, /* 0 00 00 */ 0x34, /* 00 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 160 0xa0 '\240' */ 0x00, /* 00000000 */ 0x10, /* 000 0000 */ 0x38, /* 00 000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 161 0xa1 '\241' */ 0x18, /* 000 000 */ 0x24, /* 00 00 00 */ 0x24, /* 00 00 00 */ 0x18, /* 000 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 162 0xa2 '\242' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x10, /* 000 0000 */ 0x38, /* 00 000 */ 0x54, /* 0 0 0 00 */ 0x50, /* 0 0 0000 */ 0x54, /* 0 0 0 00 */ 0x38, /* 00 000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 163 0xa3 '\243' */ 0x30, /* 00 0000 */ 0x48, /* 0 00 000 */ 0x40, /* 0 000000 */ 0x70, /* 0 0000 */ 0x40, /* 0 000000 */ 0x40, /* 0 000000 */ 0x44, /* 0 000 00 */ 0x78, /* 0 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 164 0xa4 '\244' */ 0x44, /* 0 000 00 */ 0x24, /* 00 00 00 */ 0x50, /* 0 0 0000 */ 0x48, /* 0 00 000 */ 0x24, /* 00 00 00 */ 0x14, /* 000 0 00 */ 0x48, /* 0 00 000 */ 0x44, /* 0 000 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 165 0xa5 '\245' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x7c, /* 0 00 */ 0x7c, /* 0 00 */ 0x7c, /* 0 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 166 0xa6 '\246' */ 0x3c, /* 00 00 */ 0x54, /* 0 0 0 00 */ 0x54, /* 0 0 0 00 */ 0x54, /* 0 0 0 00 */ 0x3c, /* 00 00 */ 0x14, /* 000 0 00 */ 0x14, /* 000 0 00 */ 0x14, /* 000 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 167 0xa7 '\247' */ 0x18, /* 000 000 */ 0x24, /* 00 00 00 */ 0x44, /* 0 000 00 */ 0x48, /* 0 00 000 */ 0x48, /* 0 00 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x58, /* 0 0 000 */ 0x40, /* 0 000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 168 0xa8 '\250' */ 0x00, /* 00000000 */ 0x70, /* 0 0000 */ 0x08, /* 0000 000 */ 0x64, /* 0 00 00 */ 0x54, /* 0 0 0 00 */ 0x64, /* 0 00 00 */ 0x58, /* 0 0 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 169 0xa9 '\251' */ 0x00, /* 00000000 */ 0x70, /* 0 0000 */ 0x08, /* 0000 000 */ 0x34, /* 00 0 00 */ 0x44, /* 0 000 00 */ 0x34, /* 00 0 00 */ 0x08, /* 0000 000 */ 0x70, /* 0 0000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 170 0xaa '\252' */ 0x00, /* 00000000 */ 0x7a, /* 0 0 0 */ 0x2e, /* 00 0 0 */ 0x2e, /* 00 0 0 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 171 0xab '\253' */ 0x00, /* 00000000 */ 0x08, /* 0000 000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 172 0xac '\254' */ 0x00, /* 00000000 */ 0x28, /* 00 0 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 173 0xad '\255' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x08, /* 0000 000 */ 0x7c, /* 0 00 */ 0x10, /* 000 0000 */ 0x7c, /* 0 00 */ 0x20, /* 00 00000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 174 0xae '\256' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x50, /* 0 0 0000 */ 0x50, /* 0 0 0000 */ 0x78, /* 0 000 */ 0x50, /* 0 0 0000 */ 0x50, /* 0 0 0000 */ 0x5c, /* 0 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 175 0xaf '\257' */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x4c, /* 0 00 00 */ 0x54, /* 0 0 0 00 */ 0x64, /* 0 00 00 */ 0x44, /* 0 000 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 176 0xb0 '\260' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x6c, /* 0 0 00 */ 0x54, /* 0 0 0 00 */ 0x6c, /* 0 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 177 0xb1 '\261' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x7c, /* 0 00 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x7c, /* 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 178 0xb2 '\262' */ 0x00, /* 00000000 */ 0x08, /* 0000 000 */ 0x10, /* 000 0000 */ 0x20, /* 00 00000 */ 0x10, /* 000 0000 */ 0x08, /* 0000 000 */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 179 0xb3 '\263' */ 0x00, /* 00000000 */ 0x10, /* 000 0000 */ 0x08, /* 0000 000 */ 0x04, /* 00000 00 */ 0x08, /* 0000 000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x1c, /* 000 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 180 0xb4 '\264' */ 0x00, /* 00000000 */ 0x44, /* 0 000 00 */ 0x28, /* 00 0 000 */ 0x7c, /* 0 00 */ 0x10, /* 000 0000 */ 0x7c, /* 0 00 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 181 0xb5 '\265' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x48, /* 0 00 000 */ 0x48, /* 0 00 000 */ 0x48, /* 0 00 000 */ 0x48, /* 0 00 000 */ 0x74, /* 0 0 00 */ 0x40, /* 0 000000 */ 0x40, /* 0 000000 */ 0x00, /* 00000000 */ /* 182 0xb6 '\266' */ 0x00, /* 00000000 */ 0x10, /* 000 0000 */ 0x08, /* 0000 000 */ 0x0c, /* 0000 00 */ 0x14, /* 000 0 00 */ 0x24, /* 00 00 00 */ 0x24, /* 00 00 00 */ 0x18, /* 000 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 183 0xb7 '\267' */ 0x00, /* 00000000 */ 0x7c, /* 0 00 */ 0x24, /* 00 00 00 */ 0x10, /* 000 0000 */ 0x08, /* 0000 000 */ 0x10, /* 000 0000 */ 0x24, /* 00 00 00 */ 0x7c, /* 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 184 0xb8 '\270' */ 0x00, /* 00000000 */ 0x7c, /* 0 00 */ 0x28, /* 00 0 000 */ 0x28, /* 00 0 000 */ 0x28, /* 00 0 000 */ 0x28, /* 00 0 000 */ 0x28, /* 00 0 000 */ 0x28, /* 00 0 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 185 0xb9 '\271' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7c, /* 0 00 */ 0x28, /* 00 0 000 */ 0x28, /* 00 0 000 */ 0x28, /* 00 0 000 */ 0x28, /* 00 0 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 186 0xba '\272' */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x60, /* 0 00000 */ 0x00, /* 00000000 */ /* 187 0xbb '\273' */ 0x00, /* 00000000 */ 0x1c, /* 000 00 */ 0x24, /* 00 00 00 */ 0x24, /* 00 00 00 */ 0x1c, /* 000 00 */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 188 0xbc '\274' */ 0x00, /* 00000000 */ 0x18, /* 000 000 */ 0x24, /* 00 00 00 */ 0x24, /* 00 00 00 */ 0x18, /* 000 000 */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 189 0xbd '\275' */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x28, /* 00 0 000 */ 0x6c, /* 0 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 190 0xbe '\276' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x54, /* 0 0 0 00 */ 0x5c, /* 0 0 00 */ 0x50, /* 0 0 0000 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 191 0xbf '\277' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x4c, /* 0 00 00 */ 0x54, /* 0 0 0 00 */ 0x64, /* 0 00 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 192 0xc0 '\300' */ 0x00, /* 00000000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x10, /* 000 0000 */ 0x20, /* 00 00000 */ 0x40, /* 0 000000 */ 0x44, /* 0 000 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 193 0xc1 '\301' */ 0x00, /* 00000000 */ 0x08, /* 0000 000 */ 0x00, /* 00000000 */ 0x08, /* 0000 000 */ 0x08, /* 0000 000 */ 0x08, /* 0000 000 */ 0x08, /* 0000 000 */ 0x08, /* 0000 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 194 0xc2 '\302' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7c, /* 0 00 */ 0x04, /* 00000 00 */ 0x04, /* 00000 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 195 0xc3 '\303' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x0c, /* 0000 00 */ 0x08, /* 0000 000 */ 0x10, /* 000 0000 */ 0x50, /* 0 0 0000 */ 0x20, /* 00 00000 */ 0x20, /* 00 00000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 196 0xc4 '\304' */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x38, /* 00 000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x60, /* 0 00000 */ 0x00, /* 00000000 */ /* 197 0xc5 '\305' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x04, /* 00000 00 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x38, /* 00 000 */ 0x40, /* 0 000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 198 0xc6 '\306' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x10, /* 000 0000 */ 0x10, /* 000 0000 */ 0x28, /* 00 0 000 */ 0x28, /* 00 0 000 */ 0x44, /* 0 000 00 */ 0x7c, /* 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 199 0xc7 '\307' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x24, /* 00 00 00 */ 0x48, /* 0 00 000 */ 0x48, /* 0 00 000 */ 0x24, /* 00 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 200 0xc8 '\310' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x48, /* 0 00 000 */ 0x24, /* 00 00 00 */ 0x24, /* 00 00 00 */ 0x48, /* 0 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 201 0xc9 '\311' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x54, /* 0 0 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 202 0xca '\312' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 203 0xcb '\313' */ 0x10, /* 000 0000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x7c, /* 0 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 204 0xcc '\314' */ 0x58, /* 0 0 000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x7c, /* 0 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 205 0xcd '\315' */ 0x58, /* 0 0 000 */ 0x38, /* 00 000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 206 0xce '\316' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x50, /* 0 0 0000 */ 0x50, /* 0 0 0000 */ 0x58, /* 0 0 000 */ 0x50, /* 0 0 0000 */ 0x50, /* 0 0 0000 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 207 0xcf '\317' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x28, /* 00 0 000 */ 0x54, /* 0 0 0 00 */ 0x5c, /* 0 0 00 */ 0x50, /* 0 0 0000 */ 0x2c, /* 00 0 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 208 0xd0 '\320' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 209 0xd1 '\321' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 0 0 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 210 0xd2 '\322' */ 0x00, /* 00000000 */ 0x14, /* 000 0 00 */ 0x28, /* 00 0 000 */ 0x28, /* 00 0 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 211 0xd3 '\323' */ 0x00, /* 00000000 */ 0x14, /* 000 0 00 */ 0x14, /* 000 0 00 */ 0x28, /* 00 0 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 212 0xd4 '\324' */ 0x00, /* 00000000 */ 0x08, /* 0000 000 */ 0x10, /* 000 0000 */ 0x18, /* 000 000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 213 0xd5 '\325' */ 0x00, /* 00000000 */ 0x18, /* 000 000 */ 0x08, /* 0000 000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 214 0xd6 '\326' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x7c, /* 0 00 */ 0x00, /* 00000000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 215 0xd7 '\327' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x10, /* 000 0000 */ 0x28, /* 00 0 000 */ 0x44, /* 0 000 00 */ 0x28, /* 00 0 000 */ 0x10, /* 000 0000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 216 0xd8 '\330' */ 0x00, /* 00000000 */ 0x28, /* 00 0 000 */ 0x00, /* 00000000 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x44, /* 0 000 00 */ 0x3c, /* 00 00 */ 0x04, /* 00000 00 */ 0x38, /* 00 000 */ 0x00, /* 00000000 */ /* 217 0xd9 '\331' */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x7e, /* 0 0 */ 0x00, /* 00000000 */ 0x7e, /* 0 0 */ 0x00, /* 00000000 */ 0x7e, /* 0 0 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 218 0xda '\332' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 219 0xdb '\333' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 220 0xdc '\334' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 221 0xdd '\335' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 222 0xde '\336' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 223 0xdf '\337' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 224 0xe0 '\340' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 225 0xe1 '\341' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 226 0xe2 '\342' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 227 0xe3 '\343' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 228 0xe4 '\344' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 229 0xe5 '\345' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 230 0xe6 '\346' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 231 0xe7 '\347' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 232 0xe8 '\350' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 233 0xe9 '\351' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 234 0xea '\352' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 235 0xeb '\353' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 236 0xec '\354' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 237 0xed '\355' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 238 0xee '\356' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 239 0xef '\357' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 240 0xf0 '\360' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 241 0xf1 '\361' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 242 0xf2 '\362' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 243 0xf3 '\363' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 244 0xf4 '\364' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 245 0xf5 '\365' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 246 0xf6 '\366' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 247 0xf7 '\367' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 248 0xf8 '\370' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 249 0xf9 '\371' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 250 0xfa '\372' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 251 0xfb '\373' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 252 0xfc '\374' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 253 0xfd '\375' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 254 0xfe '\376' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ /* 255 0xff '\377' */ 0x00, /* 00000000 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x3c, /* 00 00 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ 0x00, /* 00000000 */ }; sane-backends-extras-1.0.22.3ubuntu1/include/md5.h0000664000000000000000000001236511475557446016465 0ustar /* Declaration of functions and data types used for MD5 sum computing library functions. Copyright (C) 1995,1996,1997,1999,2000,2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef _MD5_H #define _MD5_H 1 #include #if defined HAVE_LIMITS_H || _LIBC # include #endif /* The following contortions are an attempt to use the C preprocessor to determine an unsigned integral type that is 32 bits wide. An alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but doing that would require that the configure script compile and *run* the resulting executable. Locally running cross-compiled executables is usually not possible. */ #ifdef _LIBC # include typedef uint32_t md5_uint32; typedef uintptr_t md5_uintptr; #else # if defined __STDC__ && __STDC__ # define UINT_MAX_32_BITS 4294967295U # else # define UINT_MAX_32_BITS 0xFFFFFFFF # endif /* If UINT_MAX isn't defined, assume it's a 32-bit type. This should be valid for all systems GNU cares about because that doesn't include 16-bit systems, and only modern systems (that certainly have ) have 64+-bit integral types. */ # ifndef UINT_MAX # define UINT_MAX UINT_MAX_32_BITS # endif # if UINT_MAX == UINT_MAX_32_BITS typedef unsigned int md5_uint32; # else # if USHRT_MAX == UINT_MAX_32_BITS typedef unsigned short md5_uint32; # else # if ULONG_MAX == UINT_MAX_32_BITS typedef unsigned long md5_uint32; # else /* The following line is intended to evoke an error. Using #error is not portable enough. */ "Cannot determine unsigned 32-bit data type." # endif # endif # endif /* We have to make a guess about the integer type equivalent in size to pointers which should always be correct. */ typedef unsigned long int md5_uintptr; #endif #undef __P #if defined (__STDC__) && __STDC__ # define __P(x) x #else # define __P(x) () #endif #define __md5_buffer md5_buffer #if defined __GNUC__ #define ALIGN __attribute__ ((__aligned__ (4))) #else #define ALIGN #endif /* Structure to save state of computation between the single steps. */ struct md5_ctx { md5_uint32 A; md5_uint32 B; md5_uint32 C; md5_uint32 D; md5_uint32 total[2]; md5_uint32 buflen; char buffer[128] ALIGN; }; /* * The following three functions are build up the low level used in * the functions `md5_stream' and `md5_buffer'. */ /* Initialize structure containing state of computation. (RFC 1321, 3.3: Step 3) */ extern void __md5_init_ctx __P ((struct md5_ctx *ctx)); /* Starting with the result of former calls of this function (or the initialization function update the context for the next LEN bytes starting at BUFFER. It is necessary that LEN is a multiple of 64!!! */ extern void __md5_process_block __P ((const void *buffer, size_t len, struct md5_ctx *ctx)); /* Starting with the result of former calls of this function (or the initialization function update the context for the next LEN bytes starting at BUFFER. It is NOT required that LEN is a multiple of 64. */ extern void __md5_process_bytes __P ((const void *buffer, size_t len, struct md5_ctx *ctx)); /* Process the remaining bytes in the buffer and put result from CTX in first 16 bytes following RESBUF. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ extern void *__md5_finish_ctx __P ((struct md5_ctx *ctx, void *resbuf)); /* Put result from CTX in first 16 bytes following RESBUF. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ extern void *__md5_read_ctx __P ((const struct md5_ctx *ctx, void *resbuf)); /* Compute MD5 message digest for bytes read from STREAM. The resulting message digest number will be written into the 16 bytes beginning at RESBLOCK. */ extern int __md5_stream __P ((FILE *stream, void *resblock)); /* Compute MD5 message digest for LEN bytes beginning at BUFFER. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. */ extern void *__md5_buffer __P ((const char *buffer, size_t len, void *resblock)); #endif /* md5.h */ sane-backends-extras-1.0.22.3ubuntu1/include/lassert.h0000664000000000000000000000453311475557446017453 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 2001 by Henning Meier-Geinitz This file is part of the SANE package. SANE 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 of the License, or (at your option) any later version. SANE 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 sane; see the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. Choose suitable implementation of assert. */ #ifndef lassert_h #define lassert_h /* The idea is from the gcc header file assert.h. */ #if defined __GNUC__ && defined _AIX /* The implementation of assert of gcc on AIX is in libgcc.a. This doesn't work with shared libraries. So let's make our own assert(). */ #define assert(arg) \ ((void) ((arg) ? 0 : lassert (arg, __FILE__, __LINE__))) #define lassert(arg, file, lineno) \ (printf ("%s:%u: failed assertion\n", file, lineno), \ abort (), 0) #else # include #endif #endif /* lassert_h */ sane-backends-extras-1.0.22.3ubuntu1/include/Makefile.am0000664000000000000000000000156711475557446017665 0ustar ## Makefile.am -- an automake template for Makefile.in file ## Copyright (C) 2009 Chris Bagwell and Sane Developers. ## ## This file is part of the "Sane" build infra-structure. See ## included LICENSE file for license information. nobase_include_HEADERS = sane/sane.h sane/saneopts.h EXTRA_DIST = lalloca.h lassert.h lgetopt.h md5.h font_6x11.h EXTRA_DIST += sane/config.h.in sane/sanei.h sane/sanei_ab306.h \ sane/sanei_access.h sane/sanei_auth.h sane/sanei_backend.h \ sane/sanei_cderror.h sane/sanei_codec_ascii.h sane/sanei_codec_bin.h \ sane/sanei_config.h sane/sanei_debug.h sane/sanei_jinclude.h \ sane/sanei_jpeg.h sane/sanei_lm983x.h sane/sanei_net.h sane/sanei_pa4s2.h \ sane/sanei_pio.h sane/sanei_pp.h sane/sanei_pv8630.h sane/sanei_scsi.h \ sane/sanei_tcp.h sane/sanei_thread.h sane/sanei_udp.h sane/sanei_usb.h \ sane/sanei_wire.h sane/sanei_magic.h sane-backends-extras-1.0.22.3ubuntu1/m4/0000775000000000000000000000000011526102736014476 5ustar sane-backends-extras-1.0.22.3ubuntu1/m4/stdint.m40000664000000000000000000005640011475557446016271 0ustar dnl @synopsis AX_CREATE_STDINT_H [( HEADER-TO-GENERATE [, HEDERS-TO-CHECK])] dnl dnl the "ISO C9X: 7.18 Integer types " section requires the dnl existence of an include file that defines a set of dnl typedefs, especially uint8_t,int32_t,uintptr_t. Many older dnl installations will not provide this file, but some will have the dnl very same definitions in . In other enviroments we can dnl use the inet-types in which would define the typedefs dnl int8_t and u_int8_t respectivly. dnl dnl This macros will create a local "_stdint.h" or the headerfile given dnl as an argument. In many cases that file will just "#include dnl " or "#include ", while in other environments dnl it will provide the set of basic 'stdint's definitions/typedefs: dnl dnl int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,intptr_t,uintptr_t dnl int_least32_t.. int_fast32_t.. intmax_t dnl dnl which may or may not rely on the definitions of other files, or dnl using the AC_CHECK_SIZEOF macro to determine the actual sizeof each dnl type. dnl dnl if your header files require the stdint-types you will want to dnl create an installable file mylib-int.h that all your other dnl installable header may include. So if you have a library package dnl named "mylib", just use dnl dnl AX_CREATE_STDINT_H(mylib-int.h) dnl dnl in configure.ac and go to install that very header file in dnl Makefile.am along with the other headers (mylib.h) - and the dnl mylib-specific headers can simply use "#include " to dnl obtain the stdint-types. dnl dnl Remember, if the system already had a valid , the dnl generated file will include it directly. No need for fuzzy dnl HAVE_STDINT_H things... (oops, GCC 4.2.x has deliberatly disabled dnl its stdint.h for non-c99 compilation and the c99-mode is not the dnl default. Therefore this macro will not use the compiler's stdint.h dnl - please complain to the GCC developers). dnl dnl @category C dnl @author Guido U. Draheim dnl @version 2006-10-13 dnl @license GPLWithACException AC_DEFUN([AX_CHECK_DATA_MODEL],[ AC_CHECK_SIZEOF(char) AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(void*) ac_cv_char_data_model="" ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_char" ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_short" ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_int" ac_cv_long_data_model="" ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_int" ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_long" ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_voidp" AC_MSG_CHECKING([data model]) case "$ac_cv_char_data_model/$ac_cv_long_data_model" in 122/242) ac_cv_data_model="IP16" ; n="standard 16bit machine" ;; 122/244) ac_cv_data_model="LP32" ; n="standard 32bit machine" ;; 122/*) ac_cv_data_model="i16" ; n="unusual int16 model" ;; 124/444) ac_cv_data_model="ILP32" ; n="standard 32bit unixish" ;; 124/488) ac_cv_data_model="LP64" ; n="standard 64bit unixish" ;; 124/448) ac_cv_data_model="LLP64" ; n="unusual 64bit unixish" ;; 124/*) ac_cv_data_model="i32" ; n="unusual int32 model" ;; 128/888) ac_cv_data_model="ILP64" ; n="unusual 64bit numeric" ;; 128/*) ac_cv_data_model="i64" ; n="unusual int64 model" ;; 222/*2) ac_cv_data_model="DSP16" ; n="strict 16bit dsptype" ;; 333/*3) ac_cv_data_model="DSP24" ; n="strict 24bit dsptype" ;; 444/*4) ac_cv_data_model="DSP32" ; n="strict 32bit dsptype" ;; 666/*6) ac_cv_data_model="DSP48" ; n="strict 48bit dsptype" ;; 888/*8) ac_cv_data_model="DSP64" ; n="strict 64bit dsptype" ;; 222/*|333/*|444/*|666/*|888/*) : ac_cv_data_model="iDSP" ; n="unusual dsptype" ;; *) ac_cv_data_model="none" ; n="very unusual model" ;; esac AC_MSG_RESULT([$ac_cv_data_model ($ac_cv_long_data_model, $n)]) ]) dnl AX_CHECK_HEADER_STDINT_X([HEADERLIST][,ACTION-IF]) AC_DEFUN([AX_CHECK_HEADER_STDINT_X],[ AC_CACHE_CHECK([for stdint uintptr_t], [ac_cv_header_stdint_x],[ ac_cv_header_stdint_x="" # the 1997 typedefs (inttypes.h) AC_MSG_RESULT([(..)]) for i in m4_ifval([$1],[$1],[stdint.h inttypes.h sys/inttypes.h sys/types.h]) do unset ac_cv_type_uintptr_t unset ac_cv_type_uint64_t AC_CHECK_TYPE(uintptr_t,[ac_cv_header_stdint_x=$i],continue,[#include <$i>]) AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>]) m4_ifvaln([$1],[$1]) break done AC_MSG_CHECKING([for stdint uintptr_t]) ]) ]) AC_DEFUN([AX_CHECK_HEADER_STDINT_O],[ AC_CACHE_CHECK([for stdint uint32_t], [ac_cv_header_stdint_o],[ ac_cv_header_stdint_o="" # the 1995 typedefs (sys/inttypes.h) AC_MSG_RESULT([(..)]) for i in m4_ifval([$1],[$1],[inttypes.h sys/inttypes.h sys/types.h stdint.h]) do unset ac_cv_type_uint32_t unset ac_cv_type_uint64_t AC_CHECK_TYPE(uint32_t,[ac_cv_header_stdint_o=$i],continue,[#include <$i>]) AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>]) m4_ifvaln([$1],[$1]) break break; done AC_MSG_CHECKING([for stdint uint32_t]) ]) ]) AC_DEFUN([AX_CHECK_HEADER_STDINT_U],[ AC_CACHE_CHECK([for stdint u_int32_t], [ac_cv_header_stdint_u],[ ac_cv_header_stdint_u="" # the BSD typedefs (sys/types.h) AC_MSG_RESULT([(..)]) for i in m4_ifval([$1],[$1],[sys/types.h inttypes.h sys/inttypes.h]) ; do unset ac_cv_type_u_int32_t unset ac_cv_type_u_int64_t AC_CHECK_TYPE(u_int32_t,[ac_cv_header_stdint_u=$i],continue,[#include <$i>]) AC_CHECK_TYPE(u_int64_t,[and64="/u_int64_t"],[and64=""],[#include<$i>]) m4_ifvaln([$1],[$1]) break break; done AC_MSG_CHECKING([for stdint u_int32_t]) ]) ]) AC_DEFUN([AX_CREATE_STDINT_H], [# ------ AX CREATE STDINT H ------------------------------------- AC_MSG_CHECKING([for stdint types]) ac_stdint_h=`echo ifelse($1, , _stdint.h, $1)` # try to shortcircuit - if the default include path of the compiler # can find a "stdint.h" header then we assume that all compilers can. AC_CACHE_VAL([ac_cv_header_stdint_t],[ old_CXXFLAGS="$CXXFLAGS" ; CXXFLAGS="" old_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS="" old_CFLAGS="$CFLAGS" ; CFLAGS="" AC_TRY_COMPILE([#include ],[int_least32_t v = 0;], [ac_cv_stdint_result="(assuming C99 compatible system)" ac_cv_header_stdint_t="stdint.h"; ], [ac_cv_header_stdint_t=""]) if test "$GCC" = "yes" && test ".$ac_cv_header_stdint_t" = "."; then CFLAGS="-std=c99" AC_TRY_COMPILE([#include ],[int_least32_t v = 0;], [AC_MSG_WARN(your GCC compiler has a defunct stdint.h for its default-mode)]) fi CXXFLAGS="$old_CXXFLAGS" CPPFLAGS="$old_CPPFLAGS" CFLAGS="$old_CFLAGS" ]) v="... $ac_cv_header_stdint_h" if test "$ac_stdint_h" = "stdint.h" ; then AC_MSG_RESULT([(are you sure you want them in ./stdint.h?)]) elif test "$ac_stdint_h" = "inttypes.h" ; then AC_MSG_RESULT([(are you sure you want them in ./inttypes.h?)]) elif test "_$ac_cv_header_stdint_t" = "_" ; then AC_MSG_RESULT([(putting them into $ac_stdint_h)$v]) else ac_cv_header_stdint="$ac_cv_header_stdint_t" AC_MSG_RESULT([$ac_cv_header_stdint (shortcircuit)]) fi if test "_$ac_cv_header_stdint_t" = "_" ; then # can not shortcircuit.. dnl .....intro message done, now do a few system checks..... dnl btw, all old CHECK_TYPE macros do automatically "DEFINE" a type, dnl therefore we use the autoconf implementation detail CHECK_TYPE_NEW dnl instead that is triggered with 3 or more arguments (see types.m4) inttype_headers=`echo $2 | sed -e 's/,/ /g'` ac_cv_stdint_result="(no helpful system typedefs seen)" AX_CHECK_HEADER_STDINT_X(dnl stdint.h inttypes.h sys/inttypes.h $inttype_headers, ac_cv_stdint_result="(seen uintptr_t$and64 in $i)") if test "_$ac_cv_header_stdint_x" = "_" ; then AX_CHECK_HEADER_STDINT_O(dnl, inttypes.h sys/inttypes.h stdint.h $inttype_headers, ac_cv_stdint_result="(seen uint32_t$and64 in $i)") fi if test "_$ac_cv_header_stdint_x" = "_" ; then if test "_$ac_cv_header_stdint_o" = "_" ; then AX_CHECK_HEADER_STDINT_U(dnl, sys/types.h inttypes.h sys/inttypes.h $inttype_headers, ac_cv_stdint_result="(seen u_int32_t$and64 in $i)") fi fi dnl if there was no good C99 header file, do some typedef checks... if test "_$ac_cv_header_stdint_x" = "_" ; then AC_MSG_CHECKING([for stdint datatype model]) AC_MSG_RESULT([(..)]) AX_CHECK_DATA_MODEL fi if test "_$ac_cv_header_stdint_x" != "_" ; then ac_cv_header_stdint="$ac_cv_header_stdint_x" elif test "_$ac_cv_header_stdint_o" != "_" ; then ac_cv_header_stdint="$ac_cv_header_stdint_o" elif test "_$ac_cv_header_stdint_u" != "_" ; then ac_cv_header_stdint="$ac_cv_header_stdint_u" else ac_cv_header_stdint="stddef.h" fi AC_MSG_CHECKING([for extra inttypes in chosen header]) AC_MSG_RESULT([($ac_cv_header_stdint)]) dnl see if int_least and int_fast types are present in _this_ header. unset ac_cv_type_int_least32_t unset ac_cv_type_int_fast32_t AC_CHECK_TYPE(int_least32_t,,,[#include <$ac_cv_header_stdint>]) AC_CHECK_TYPE(int_fast32_t,,,[#include<$ac_cv_header_stdint>]) AC_CHECK_TYPE(intmax_t,,,[#include <$ac_cv_header_stdint>]) fi # shortcircut to system "stdint.h" # ------------------ PREPARE VARIABLES ------------------------------ if test "$GCC" = "yes" ; then ac_cv_stdint_message="using gnu compiler "`$CC --version | head -1` else ac_cv_stdint_message="using $CC" fi AC_MSG_RESULT([make use of $ac_cv_header_stdint in $ac_stdint_h dnl $ac_cv_stdint_result]) dnl ----------------------------------------------------------------- # ----------------- DONE inttypes.h checks START header ------------- AC_CONFIG_COMMANDS([$ac_stdint_h],[ AC_MSG_NOTICE(creating $ac_stdint_h : $_ac_stdint_h) ac_stdint=$tmp/_stdint.h echo "#ifndef" $_ac_stdint_h >$ac_stdint echo "#define" $_ac_stdint_h "1" >>$ac_stdint echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint echo "/* generated $ac_cv_stdint_message */" >>$ac_stdint if test "_$ac_cv_header_stdint_t" != "_" ; then echo "#define _STDINT_HAVE_STDINT_H" "1" >>$ac_stdint echo "#include " >>$ac_stdint echo "#endif" >>$ac_stdint echo "#endif" >>$ac_stdint else cat >>$ac_stdint < #else #include /* .................... configured part ............................ */ STDINT_EOF echo "/* whether we have a C99 compatible stdint header file */" >>$ac_stdint if test "_$ac_cv_header_stdint_x" != "_" ; then ac_header="$ac_cv_header_stdint_x" echo "#define _STDINT_HEADER_INTPTR" '"'"$ac_header"'"' >>$ac_stdint else echo "/* #undef _STDINT_HEADER_INTPTR */" >>$ac_stdint fi echo "/* whether we have a C96 compatible inttypes header file */" >>$ac_stdint if test "_$ac_cv_header_stdint_o" != "_" ; then ac_header="$ac_cv_header_stdint_o" echo "#define _STDINT_HEADER_UINT32" '"'"$ac_header"'"' >>$ac_stdint else echo "/* #undef _STDINT_HEADER_UINT32 */" >>$ac_stdint fi echo "/* whether we have a BSD compatible inet types header */" >>$ac_stdint if test "_$ac_cv_header_stdint_u" != "_" ; then ac_header="$ac_cv_header_stdint_u" echo "#define _STDINT_HEADER_U_INT32" '"'"$ac_header"'"' >>$ac_stdint else echo "/* #undef _STDINT_HEADER_U_INT32 */" >>$ac_stdint fi echo "" >>$ac_stdint if test "_$ac_header" != "_" ; then if test "$ac_header" != "stddef.h" ; then echo "#include <$ac_header>" >>$ac_stdint echo "" >>$ac_stdint fi fi echo "/* which 64bit typedef has been found */" >>$ac_stdint if test "$ac_cv_type_uint64_t" = "yes" ; then echo "#define _STDINT_HAVE_UINT64_T" "1" >>$ac_stdint else echo "/* #undef _STDINT_HAVE_UINT64_T */" >>$ac_stdint fi if test "$ac_cv_type_u_int64_t" = "yes" ; then echo "#define _STDINT_HAVE_U_INT64_T" "1" >>$ac_stdint else echo "/* #undef _STDINT_HAVE_U_INT64_T */" >>$ac_stdint fi echo "" >>$ac_stdint echo "/* which type model has been detected */" >>$ac_stdint if test "_$ac_cv_char_data_model" != "_" ; then echo "#define _STDINT_CHAR_MODEL" "$ac_cv_char_data_model" >>$ac_stdint echo "#define _STDINT_LONG_MODEL" "$ac_cv_long_data_model" >>$ac_stdint else echo "/* #undef _STDINT_CHAR_MODEL // skipped */" >>$ac_stdint echo "/* #undef _STDINT_LONG_MODEL // skipped */" >>$ac_stdint fi echo "" >>$ac_stdint echo "/* whether int_least types were detected */" >>$ac_stdint if test "$ac_cv_type_int_least32_t" = "yes"; then echo "#define _STDINT_HAVE_INT_LEAST32_T" "1" >>$ac_stdint else echo "/* #undef _STDINT_HAVE_INT_LEAST32_T */" >>$ac_stdint fi echo "/* whether int_fast types were detected */" >>$ac_stdint if test "$ac_cv_type_int_fast32_t" = "yes"; then echo "#define _STDINT_HAVE_INT_FAST32_T" "1" >>$ac_stdint else echo "/* #undef _STDINT_HAVE_INT_FAST32_T */" >>$ac_stdint fi echo "/* whether intmax_t type was detected */" >>$ac_stdint if test "$ac_cv_type_intmax_t" = "yes"; then echo "#define _STDINT_HAVE_INTMAX_T" "1" >>$ac_stdint else echo "/* #undef _STDINT_HAVE_INTMAX_T */" >>$ac_stdint fi echo "" >>$ac_stdint cat >>$ac_stdint <= 199901L #define _HAVE_UINT64_T #define _HAVE_LONGLONG_UINT64_T typedef long long int64_t; typedef unsigned long long uint64_t; #elif !defined __STRICT_ANSI__ #if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__ #define _HAVE_UINT64_T typedef __int64 int64_t; typedef unsigned __int64 uint64_t; #elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__ /* note: all ELF-systems seem to have loff-support which needs 64-bit */ #if !defined _NO_LONGLONG #define _HAVE_UINT64_T #define _HAVE_LONGLONG_UINT64_T typedef long long int64_t; typedef unsigned long long uint64_t; #endif #elif defined __alpha || (defined __mips && defined _ABIN32) #if !defined _NO_LONGLONG typedef long int64_t; typedef unsigned long uint64_t; #endif /* compiler/cpu type to define int64_t */ #endif #endif #endif #if defined _STDINT_HAVE_U_INT_TYPES /* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */ typedef u_int8_t uint8_t; typedef u_int16_t uint16_t; typedef u_int32_t uint32_t; /* glibc compatibility */ #ifndef __int8_t_defined #define __int8_t_defined #endif #endif #ifdef _STDINT_NEED_INT_MODEL_T /* we must guess all the basic types. Apart from byte-adressable system, */ /* there a few 32-bit-only dsp-systems that we guard with BYTE_MODEL 8-} */ /* (btw, those nibble-addressable systems are way off, or so we assume) */ dnl /* have a look at "64bit and data size neutrality" at */ dnl /* http://unix.org/version2/whatsnew/login_64bit.html */ dnl /* (the shorthand "ILP" types always have a "P" part) */ #if defined _STDINT_BYTE_MODEL #if _STDINT_LONG_MODEL+0 == 242 /* 2:4:2 = IP16 = a normal 16-bit system */ typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned long uint32_t; #ifndef __int8_t_defined #define __int8_t_defined typedef char int8_t; typedef short int16_t; typedef long int32_t; #endif #elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL == 444 /* 2:4:4 = LP32 = a 32-bit system derived from a 16-bit */ /* 4:4:4 = ILP32 = a normal 32-bit system */ typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #ifndef __int8_t_defined #define __int8_t_defined typedef char int8_t; typedef short int16_t; typedef int int32_t; #endif #elif _STDINT_LONG_MODEL+0 == 484 || _STDINT_LONG_MODEL+0 == 488 /* 4:8:4 = IP32 = a 32-bit system prepared for 64-bit */ /* 4:8:8 = LP64 = a normal 64-bit system */ typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #ifndef __int8_t_defined #define __int8_t_defined typedef char int8_t; typedef short int16_t; typedef int int32_t; #endif /* this system has a "long" of 64bit */ #ifndef _HAVE_UINT64_T #define _HAVE_UINT64_T typedef unsigned long uint64_t; typedef long int64_t; #endif #elif _STDINT_LONG_MODEL+0 == 448 /* LLP64 a 64-bit system derived from a 32-bit system */ typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #ifndef __int8_t_defined #define __int8_t_defined typedef char int8_t; typedef short int16_t; typedef int int32_t; #endif /* assuming the system has a "long long" */ #ifndef _HAVE_UINT64_T #define _HAVE_UINT64_T #define _HAVE_LONGLONG_UINT64_T typedef unsigned long long uint64_t; typedef long long int64_t; #endif #else #define _STDINT_NO_INT32_T #endif #else #define _STDINT_NO_INT8_T #define _STDINT_NO_INT32_T #endif #endif /* * quote from SunOS-5.8 sys/inttypes.h: * Use at your own risk. As of February 1996, the committee is squarely * behind the fixed sized types; the "least" and "fast" types are still being * discussed. The probability that the "fast" types may be removed before * the standard is finalized is high enough that they are not currently * implemented. */ #if defined _STDINT_NEED_INT_LEAST_T typedef int8_t int_least8_t; typedef int16_t int_least16_t; typedef int32_t int_least32_t; #ifdef _HAVE_UINT64_T typedef int64_t int_least64_t; #endif typedef uint8_t uint_least8_t; typedef uint16_t uint_least16_t; typedef uint32_t uint_least32_t; #ifdef _HAVE_UINT64_T typedef uint64_t uint_least64_t; #endif /* least types */ #endif #if defined _STDINT_NEED_INT_FAST_T typedef int8_t int_fast8_t; typedef int int_fast16_t; typedef int32_t int_fast32_t; #ifdef _HAVE_UINT64_T typedef int64_t int_fast64_t; #endif typedef uint8_t uint_fast8_t; typedef unsigned uint_fast16_t; typedef uint32_t uint_fast32_t; #ifdef _HAVE_UINT64_T typedef uint64_t uint_fast64_t; #endif /* fast types */ #endif #ifdef _STDINT_NEED_INTMAX_T #ifdef _HAVE_UINT64_T typedef int64_t intmax_t; typedef uint64_t uintmax_t; #else typedef long intmax_t; typedef unsigned long uintmax_t; #endif #endif #ifdef _STDINT_NEED_INTPTR_T #ifndef __intptr_t_defined #define __intptr_t_defined /* we encourage using "long" to store pointer values, never use "int" ! */ #if _STDINT_LONG_MODEL+0 == 242 || _STDINT_LONG_MODEL+0 == 484 typedef unsigned int uintptr_t; typedef int intptr_t; #elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL+0 == 444 typedef unsigned long uintptr_t; typedef long intptr_t; #elif _STDINT_LONG_MODEL+0 == 448 && defined _HAVE_UINT64_T typedef uint64_t uintptr_t; typedef int64_t intptr_t; #else /* matches typical system types ILP32 and LP64 - but not IP16 or LLP64 */ typedef unsigned long uintptr_t; typedef long intptr_t; #endif #endif #endif /* The ISO C99 standard specifies that in C++ implementations these should only be defined if explicitly requested. */ #if !defined __cplusplus || defined __STDC_CONSTANT_MACROS #ifndef UINT32_C /* Signed. */ # define INT8_C(c) c # define INT16_C(c) c # define INT32_C(c) c # ifdef _HAVE_LONGLONG_UINT64_T # define INT64_C(c) c ## L # else # define INT64_C(c) c ## LL # endif /* Unsigned. */ # define UINT8_C(c) c ## U # define UINT16_C(c) c ## U # define UINT32_C(c) c ## U # ifdef _HAVE_LONGLONG_UINT64_T # define UINT64_C(c) c ## UL # else # define UINT64_C(c) c ## ULL # endif /* Maximal type. */ # ifdef _HAVE_LONGLONG_UINT64_T # define INTMAX_C(c) c ## L # define UINTMAX_C(c) c ## UL # else # define INTMAX_C(c) c ## LL # define UINTMAX_C(c) c ## ULL # endif /* literalnumbers */ #endif #endif /* These limits are merily those of a two complement byte-oriented system */ /* Minimum of signed integral types. */ # define INT8_MIN (-128) # define INT16_MIN (-32767-1) # define INT32_MIN (-2147483647-1) # define INT64_MIN (-__INT64_C(9223372036854775807)-1) /* Maximum of signed integral types. */ # define INT8_MAX (127) # define INT16_MAX (32767) # define INT32_MAX (2147483647) # define INT64_MAX (__INT64_C(9223372036854775807)) /* Maximum of unsigned integral types. */ # define UINT8_MAX (255) # define UINT16_MAX (65535) # define UINT32_MAX (4294967295U) # define UINT64_MAX (__UINT64_C(18446744073709551615)) /* Minimum of signed integral types having a minimum size. */ # define INT_LEAST8_MIN INT8_MIN # define INT_LEAST16_MIN INT16_MIN # define INT_LEAST32_MIN INT32_MIN # define INT_LEAST64_MIN INT64_MIN /* Maximum of signed integral types having a minimum size. */ # define INT_LEAST8_MAX INT8_MAX # define INT_LEAST16_MAX INT16_MAX # define INT_LEAST32_MAX INT32_MAX # define INT_LEAST64_MAX INT64_MAX /* Maximum of unsigned integral types having a minimum size. */ # define UINT_LEAST8_MAX UINT8_MAX # define UINT_LEAST16_MAX UINT16_MAX # define UINT_LEAST32_MAX UINT32_MAX # define UINT_LEAST64_MAX UINT64_MAX /* shortcircuit*/ #endif /* once */ #endif #endif STDINT_EOF fi if cmp -s $ac_stdint_h $ac_stdint 2>/dev/null; then AC_MSG_NOTICE([$ac_stdint_h is unchanged]) else ac_dir=`AS_DIRNAME(["$ac_stdint_h"])` AS_MKDIR_P(["$ac_dir"]) rm -f $ac_stdint_h mv $ac_stdint $ac_stdint_h fi ],[# variables for create stdint.h replacement PACKAGE="$PACKAGE" VERSION="$VERSION" ac_stdint_h="$ac_stdint_h" _ac_stdint_h=AS_TR_CPP(_$PACKAGE-$ac_stdint_h) ac_cv_stdint_message="$ac_cv_stdint_message" ac_cv_header_stdint_t="$ac_cv_header_stdint_t" ac_cv_header_stdint_x="$ac_cv_header_stdint_x" ac_cv_header_stdint_o="$ac_cv_header_stdint_o" ac_cv_header_stdint_u="$ac_cv_header_stdint_u" ac_cv_type_uint64_t="$ac_cv_type_uint64_t" ac_cv_type_u_int64_t="$ac_cv_type_u_int64_t" ac_cv_char_data_model="$ac_cv_char_data_model" ac_cv_long_data_model="$ac_cv_long_data_model" ac_cv_type_int_least32_t="$ac_cv_type_int_least32_t" ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t" ac_cv_type_intmax_t="$ac_cv_type_intmax_t" ]) ]) sane-backends-extras-1.0.22.3ubuntu1/m4/libtool.m40000664000000000000000000100347411514441551016413 0ustar # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010 Free Software Foundation, # Inc. # Written by Gordon Matzigkeit, 1996 # # 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. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010 Free Software Foundation, # Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2010 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_XSI_SHELLFNS sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES # -------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX # ----------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl AC_LINK_IFELSE(AC_LANG_PROGRAM,[ lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`print -r -- -n 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [AC_CHECK_TOOL(AR, ar, false) test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1]) AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) void fnord () __attribute__((visibility("default"))); #endif void fnord () { int i=42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; haiku*) version_type=linux need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method == "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ const struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ F* | *Sun*Fortran*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag= tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE(int foo(void) {}, _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' ) LDFLAGS="$save_LDFLAGS" else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], [[If ld is used when linking, flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [fix_srcfile_path], [1], [Fix the shell variable $srcfile for the compiler]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ]) dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC CC=${F77-"f77"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC CC=${FC-"f95"} compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC="$lt_save_CC" ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC GCC= CC=${RC-"windres"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC="$lt_save_CC" ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_XSI_SHELLFNS # --------------------- # Bourne and XSI compatible variants of some useful shell functions. m4_defun([_LT_PROG_XSI_SHELLFNS], [case $xsi_shell in yes) cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac } # func_basename file func_basename () { func_basename_result="${1##*/}" } # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}" } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). func_stripname () { # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"} } # func_opt_split func_opt_split () { func_opt_split_opt=${1%%=*} func_opt_split_arg=${1#*=} } # func_lo2o object func_lo2o () { case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac } # func_xform libobj-or-source func_xform () { func_xform_result=${1%.*}.lo } # func_arith arithmetic-term... func_arith () { func_arith_result=$(( $[*] )) } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=${#1} } _LT_EOF ;; *) # Bourne compatible functions. cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } dnl func_dirname_and_basename dnl A portable version of this function is already defined in general.m4sh dnl so there is no need for it here. # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # sed scripts: my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' my_sed_long_arg='1s/^-[[^=]]*=//' # func_opt_split func_opt_split () { func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"` func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"` } # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[[^.]]*$/.lo/'` } # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "$[@]"` } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` } _LT_EOF esac case $lt_shell_append in yes) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$[1]+=\$[2]" } _LT_EOF ;; *) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$[1]=\$$[1]\$[2]" } _LT_EOF ;; esac ]) sane-backends-extras-1.0.22.3ubuntu1/m4/byteorder.m40000664000000000000000000002776611514441551016757 0ustar dnl AC_NEED_BYTEORDER_H ( HEADER-TO-GENERATE ) dnl Copyright 2001-2002 by Dan Fandrich dnl This file may be copied and used freely without restrictions. No warranty dnl is expressed or implied. dnl dnl Create a header file that guarantees that byte swapping macros of the dnl ntohl variety as well as the extended types included in OpenBSD and dnl NetBSD such as le32toh are defined. If possible, the standard ntohl dnl are overloaded as they are optimized for the given platform, but when dnl this is not possible (e.g. on a big-endian machine) they are defined dnl in this file. dnl Look for a symbol in a header file dnl AC_HAVE_SYMBOL ( IDENTIFIER, HEADER-FILE, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND ) AC_DEFUN([AC_HAVE_SYMBOL], [ AC_MSG_CHECKING(for $1 in $2) AC_EGREP_CPP([symbol is present|\<$1\>],[ #include <$2> #ifdef $1 symbol is present #endif ], [AC_MSG_RESULT(yes) $3 ], [AC_MSG_RESULT(no) $4 ])]) dnl Create a header file that defines extended byte swapping macros AC_DEFUN([AC_NEED_BYTEORDER_H], [ ac_byteorder_h=`echo ifelse($1, , _byteorder.h, $1)` changequote(, )dnl ac_dir=`echo $ac_byteorder_h|sed 's%/[^/][^/]*$%%'` changequote([, ])dnl if test "$ac_dir" != "$ac_byteorder" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" fi # We're only interested in the target CPU, but it's not always set effective_target="$target" if test "x$effective_target" = xNONE -o "x$effective_target" = x ; then effective_target="$host" fi AC_SUBST(effective_target) ac_byteorder=_byteorder.tmp cat > "$ac_byteorder" << EOF /* This file is generated automatically by configure */ /* It is valid only for the system type ${effective_target} */ #ifndef __BYTEORDER_H #define __BYTEORDER_H EOF dnl First, do an endian check AC_C_BIGENDIAN dnl Look for NetBSD-style extended byte swapping macros AC_HAVE_SYMBOL(le32toh,machine/endian.h, [HAVE_LE32TOH=1 cat >> "$ac_byteorder" << EOF /* extended byte swapping macros are already available */ #include EOF], [ dnl Look for standard byte swapping macros AC_HAVE_SYMBOL(ntohl,arpa/inet.h, [cat >> "$ac_byteorder" << EOF /* ntohl and relatives live here */ #include EOF], [AC_HAVE_SYMBOL(ntohl,netinet/in.h, [cat >> "$ac_byteorder" << EOF /* ntohl and relatives live here */ #include EOF],true)]) ]) dnl Look for generic byte swapping macros dnl OpenBSD AC_HAVE_SYMBOL(swap32,machine/endian.h, [cat >> "$ac_byteorder" << EOF /* swap32 and swap16 are defined in machine/endian.h */ EOF], [ dnl Linux GLIBC AC_HAVE_SYMBOL(bswap_32,byteswap.h, [cat >> "$ac_byteorder" << EOF /* Define generic byte swapping functions */ #include #define swap16(x) bswap_16(x) #define swap32(x) bswap_32(x) #define swap64(x) bswap_64(x) EOF], [ dnl NetBSD AC_HAVE_SYMBOL(bswap32,machine/endian.h, dnl We're already including machine/endian.h if this test succeeds [cat >> "$ac_byteorder" << EOF /* Define generic byte swapping functions */ EOF if test "$HAVE_LE32TOH" != "1"; then echo '#include '>> "$ac_byteorder" fi cat >> "$ac_byteorder" << EOF #define swap16(x) bswap16(x) #define swap32(x) bswap32(x) #define swap64(x) bswap64(x) EOF], [ dnl FreeBSD AC_HAVE_SYMBOL(__byte_swap_long,sys/types.h, [cat >> "$ac_byteorder" << EOF /* Define generic byte swapping functions */ #include #define swap16(x) __byte_swap_word(x) #define swap32(x) __byte_swap_long(x) /* No optimized 64 bit byte swapping macro is available */ #define swap64(x) ((uint64_t)(((uint64_t)(x) << 56) & 0xff00000000000000ULL | \\ ((uint64_t)(x) << 40) & 0x00ff000000000000ULL | \\ ((uint64_t)(x) << 24) & 0x0000ff0000000000ULL | \\ ((uint64_t)(x) << 8) & 0x000000ff00000000ULL | \\ ((x) >> 8) & 0x00000000ff000000ULL | \\ ((x) >> 24) & 0x0000000000ff0000ULL | \\ ((x) >> 40) & 0x000000000000ff00ULL | \\ ((x) >> 56) & 0x00000000000000ffULL)) EOF], [ dnl OS X AC_HAVE_SYMBOL(NXSwapLong,machine/byte_order.h, [cat >> "$ac_byteorder" << EOF /* Define generic byte swapping functions */ #include #define swap16(x) NXSwapShort(x) #define swap32(x) NXSwapLong(x) #define swap64(x) NXSwapLongLong(x) EOF], [ if test $ac_cv_c_bigendian = yes; then cat >> "$ac_byteorder" << EOF /* No other byte swapping functions are available on this big-endian system */ #define swap16(x) ((uint16_t)(((x) << 8) | ((uint16_t)(x) >> 8))) #define swap32(x) ((uint32_t)(((uint32_t)(x) << 24) & 0xff000000UL | \\ ((uint32_t)(x) << 8) & 0x00ff0000UL | \\ ((x) >> 8) & 0x0000ff00UL | \\ ((x) >> 24) & 0x000000ffUL)) #define swap64(x) ((uint64_t)(((uint64_t)(x) << 56) & 0xff00000000000000ULL | \\ ((uint64_t)(x) << 40) & 0x00ff000000000000ULL | \\ ((uint64_t)(x) << 24) & 0x0000ff0000000000ULL | \\ ((uint64_t)(x) << 8) & 0x000000ff00000000ULL | \\ ((x) >> 8) & 0x00000000ff000000ULL | \\ ((x) >> 24) & 0x0000000000ff0000ULL | \\ ((x) >> 40) & 0x000000000000ff00ULL | \\ ((x) >> 56) & 0x00000000000000ffULL)) EOF else cat >> "$ac_byteorder" << EOF /* Use these as generic byteswapping macros on this little endian system */ #define swap16(x) ntohs(x) #define swap32(x) ntohl(x) /* No optimized 64 bit byte swapping macro is available */ #define swap64(x) ((uint64_t)(((uint64_t)(x) << 56) & 0xff00000000000000ULL | \\ ((uint64_t)(x) << 40) & 0x00ff000000000000ULL | \\ ((uint64_t)(x) << 24) & 0x0000ff0000000000ULL | \\ ((uint64_t)(x) << 8) & 0x000000ff00000000ULL | \\ ((x) >> 8) & 0x00000000ff000000ULL | \\ ((x) >> 24) & 0x0000000000ff0000ULL | \\ ((x) >> 40) & 0x000000000000ff00ULL | \\ ((x) >> 56) & 0x00000000000000ffULL)) EOF fi ]) ]) ]) ]) ]) [ if test "$HAVE_LE32TOH" != "1"; then cat >> "$ac_byteorder" << EOF /* The byte swapping macros have the form: */ /* EENN[a]toh or htoEENN[a] where EE is be (big endian) or */ /* le (little-endian), NN is 16 or 32 (number of bits) and a, */ /* if present, indicates that the endian side is a pointer to an */ /* array of uint8_t bytes instead of an integer of the specified length. */ /* h refers to the host's ordering method. */ /* So, to convert a 32-bit integer stored in a buffer in little-endian */ /* format into a uint32_t usable on this machine, you could use: */ /* uint32_t value = le32atoh(&buf[3]); */ /* To put that value back into the buffer, you could use: */ /* htole32a(&buf[3], value); */ /* Define aliases for the standard byte swapping macros */ /* Arguments to these macros must be properly aligned on natural word */ /* boundaries in order to work properly on all architectures */ #ifndef htobe16 #define htobe16(x) htons(x) #endif #ifndef htobe32 #define htobe32(x) htonl(x) #endif #ifndef be16toh #define be16toh(x) ntohs(x) #endif #ifndef be32toh #define be32toh(x) ntohl(x) #endif #define HTOBE16(x) (x) = htobe16(x) #define HTOBE32(x) (x) = htobe32(x) #define BE32TOH(x) (x) = be32toh(x) #define BE16TOH(x) (x) = be16toh(x) EOF if test $ac_cv_c_bigendian = yes; then cat >> "$ac_byteorder" << EOF /* Define our own extended byte swapping macros for big-endian machines */ #ifndef htole16 #define htole16(x) swap16(x) #endif #ifndef htole32 #define htole32(x) swap32(x) #endif #ifndef le16toh #define le16toh(x) swap16(x) #endif #ifndef le32toh #define le32toh(x) swap32(x) #endif #ifndef htobe64 #define htobe64(x) (x) #endif #ifndef be64toh #define be64toh(x) (x) #endif #define HTOLE16(x) (x) = htole16(x) #define HTOLE32(x) (x) = htole32(x) #define LE16TOH(x) (x) = le16toh(x) #define LE32TOH(x) (x) = le32toh(x) #define HTOBE64(x) (void) (x) #define BE64TOH(x) (void) (x) EOF else cat >> "$ac_byteorder" << EOF /* On little endian machines, these macros are null */ #ifndef htole16 #define htole16(x) (x) #endif #ifndef htole32 #define htole32(x) (x) #endif #ifndef htole64 #define htole64(x) (x) #endif #ifndef le16toh #define le16toh(x) (x) #endif #ifndef le32toh #define le32toh(x) (x) #endif #ifndef le64toh #define le64toh(x) (x) #endif #define HTOLE16(x) (void) (x) #define HTOLE32(x) (void) (x) #define HTOLE64(x) (void) (x) #define LE16TOH(x) (void) (x) #define LE32TOH(x) (void) (x) #define LE64TOH(x) (void) (x) /* These don't have standard aliases */ #ifndef htobe64 #define htobe64(x) swap64(x) #endif #ifndef be64toh #define be64toh(x) swap64(x) #endif #define HTOBE64(x) (x) = htobe64(x) #define BE64TOH(x) (x) = be64toh(x) EOF fi fi cat >> "$ac_byteorder" << EOF /* Define the C99 standard length-specific integer types */ #include <_stdint.h> EOF case "${effective_target}" in i[3456]86-*) cat >> "$ac_byteorder" << EOF /* Here are some macros to create integers from a byte array */ /* These are used to get and put integers from/into a uint8_t array */ /* with a specific endianness. This is the most portable way to generate */ /* and read messages to a network or serial device. Each member of a */ /* packet structure must be handled separately. */ /* The i386 and compatibles can handle unaligned memory access, */ /* so use the optimized macros above to do this job */ #define be16atoh(x) be16toh(*(uint16_t*)(x)) #define be32atoh(x) be32toh(*(uint32_t*)(x)) #define be64atoh(x) be64toh(*(uint64_t*)(x)) #define le16atoh(x) le16toh(*(uint16_t*)(x)) #define le32atoh(x) le32toh(*(uint32_t*)(x)) #define le64atoh(x) le64toh(*(uint64_t*)(x)) #define htobe16a(a,x) *(uint16_t*)(a) = htobe16(x) #define htobe32a(a,x) *(uint32_t*)(a) = htobe32(x) #define htobe64a(a,x) *(uint64_t*)(a) = htobe64(x) #define htole16a(a,x) *(uint16_t*)(a) = htole16(x) #define htole32a(a,x) *(uint32_t*)(a) = htole32(x) #define htole64a(a,x) *(uint64_t*)(a) = htole64(x) EOF ;; *) cat >> "$ac_byteorder" << EOF /* Here are some macros to create integers from a byte array */ /* These are used to get and put integers from/into a uint8_t array */ /* with a specific endianness. This is the most portable way to generate */ /* and read messages to a network or serial device. Each member of a */ /* packet structure must be handled separately. */ /* Non-optimized but portable macros */ #define be16atoh(x) ((uint16_t)(((x)[0]<<8)|(x)[1])) #define be32atoh(x) ((uint32_t)(((x)[0]<<24)|((x)[1]<<16)|((x)[2]<<8)|(x)[3])) #define be64atoh(x) ((uint64_t)(((x)[0]<<56)|((x)[1]<<48)|((x)[2]<<40)| \\ ((x)[3]<<32)|((x)[4]<<24)|((x)[5]<<16)|((x)[6]<<8)|(x)[7])) #define le16atoh(x) ((uint16_t)(((x)[1]<<8)|(x)[0])) #define le32atoh(x) ((uint32_t)(((x)[3]<<24)|((x)[2]<<16)|((x)[1]<<8)|(x)[0])) #define le64atoh(x) ((uint64_t)(((x)[7]<<56)|((x)[6]<<48)|((x)[5]<<40)| \\ ((x)[4]<<32)|((x)[3]<<24)|((x)[2]<<16)|((x)[1]<<8)|(x)[0])) #define htobe16a(a,x) (a)[0]=(uint8_t)((x)>>8), (a)[1]=(uint8_t)(x) #define htobe32a(a,x) (a)[0]=(uint8_t)((x)>>24), (a)[1]=(uint8_t)((x)>>16), \\ (a)[2]=(uint8_t)((x)>>8), (a)[3]=(uint8_t)(x) #define htobe64a(a,x) (a)[0]=(uint8_t)((x)>>56), (a)[1]=(uint8_t)((x)>>48), \\ (a)[2]=(uint8_t)((x)>>40), (a)[3]=(uint8_t)((x)>>32), \\ (a)[4]=(uint8_t)((x)>>24), (a)[5]=(uint8_t)((x)>>16), \\ (a)[6]=(uint8_t)((x)>>8), (a)[7]=(uint8_t)(x) #define htole16a(a,x) (a)[1]=(uint8_t)((x)>>8), (a)[0]=(uint8_t)(x) #define htole32a(a,x) (a)[3]=(uint8_t)((x)>>24), (a)[2]=(uint8_t)((x)>>16), \\ (a)[1]=(uint8_t)((x)>>8), (a)[0]=(uint8_t)(x) #define htole64a(a,x) (a)[7]=(uint8_t)((x)>>56), (a)[6]=(uint8_t)((x)>>48), \\ (a)[5]=(uint8_t)((x)>>40), (a)[4]=(uint8_t)((x)>>32), \\ (a)[3]=(uint8_t)((x)>>24), (a)[2]=(uint8_t)((x)>>16), \\ (a)[1]=(uint8_t)((x)>>8), (a)[0]=(uint8_t)(x) EOF ;; esac ] cat >> "$ac_byteorder" << EOF #endif /*__BYTEORDER_H*/ EOF if cmp -s $ac_byteorder_h $ac_byteorder 2>/dev/null; then AC_MSG_NOTICE([$ac_byteorder_h is unchanged]) rm $ac_byteorder else rm -f $ac_byteorder_h mv $ac_byteorder $ac_byteorder_h fi ]) sane-backends-extras-1.0.22.3ubuntu1/COPYING0000664000000000000000000004312711475557446015237 0ustar GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy 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 of the License, 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 Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. sane-backends-extras-1.0.22.3ubuntu1/LICENSE0000664000000000000000000000372111475557446015205 0ustar Sat Apr 23 2005 This files attempts to clarify the licensing situation for the SANE distribution. In case of doubt, the copyright information contained in each file overrides what is said here. SANE consists of three parts each of which has its own licensing terms: * The frontend programs. These programs are generally protected by the GNU General Public License. (See file COPYING.) * The backend libraries. Most backend libraries are protected by the GNU General Public License (see file COPYING), but as an exception, it is permissible to link against such a library without affecting the licensing status of the program that uses the libraries. For details, see the copyright notice at the head of the backend files (e.g., backend/dll.c). Note that not all of the backends apply the exception and that some have additional licensing constraints. E.g., the DC210 backend uses JPG code that is licensed as described in README.djpeg. * The SANE API and network protocol as put forth in the standard document. The standard is considered to be in the public domain. Anyone is free to implement SANE interface conforming applications or libraries in any way he or she sees fit. Frequently Asked Questions about the SANE licensing: * Why don't you use the GNU LPGL ? The reason SANE isn't licensed under the GNU LGPL is very simple: the GNU LGPL didn't exist at the time SANE was first released. So, the SANE Exception was added to the GNU GPL. * Why don't you relicense SANE, now that the GNU LGPL is available ? To relicense the various pieces of code composing SANE, each and every copyright holder needs to agree with the relicensing. Unfortunately, some of the (original) backend authors cannot be contacted any longer, for various reasons; not to mention each and every contributor who sent in a patch. This effectively makes it impossible for the SANE Project to relicense SANE. sane-backends-extras-1.0.22.3ubuntu1/ChangeLog0000664000000000000000000005416011526102563015734 0ustar ****** Release of sane-backends 1.0.22. End of code freeze ****** 2011-02-10 m. allan noah * po/nl.po: updates from Martin Kho * po/uk.po: updates from Yuri Chornoivan 2011-02-04 Stéphane Voltz * backend/genesys.c: disable image processing options at 16 bits since they can't handle it. 2011-02-02 Stéphane Voltz * backend/genesys.c backend/genesys_low.c backend/genesys_gl843.c: more asynchronous parking issues 2011-01-31 Stéphane Voltz * backend/genesys.c backend/genesys_low.[ch]: don't return EOF too early when applying image processing functions, handle writing of lineart data, improve asynchronous head parking 2011-01-31 m. allan noah * backend/epjitsu.c, doc/descriptions/epjitsu.desc: - comment changes - added new models * backend/fujitsu.c, doc/descriptions/fujitsu.desc, doc/sane-fujitsu.man: fujitsu backend v106, - added new models - dont call mode_select with a page code the scanner does not support 2011-01-28 Mike Kelly * backends/avision.[ch]: - Bumped build number to 294. - Various minor code cleanups. - Fixed initialization and duplexing for AV220-G - Added ADF support for HP8200 series scanner (flipping duplexers). - Return copied values in sane_get_parameters() - Added paper-length option to prevent double feeds - Added a Misc option group to hold misc features 2011-01-26 m. allan noah * backend/canon_dr.[ch], doc/descriptions/canon_dr.desc, backend/canon_dr.conf.in, doc/sane-canon_dr.man: canon_dr backend v37: - don't center window when using flatbed - improve request sense error messages - enable flatbed for all known models - ad usb ids for DR-6030C, CR-135i & CR-190i * doc/descriptions/unsupported.desc: moved DR-2020U from canon_dr.desc 2011-01-20 Stéphane Voltz * backend/genesys_devices.c backend/genesys_gl646.h: tune resolution list and add internal values matching them 2011-01-18 m. allan noah * backend/canon_dr.[ch], doc/desc/canon_dr.desc, doc/sane-canon_dr.man: canon_dr backend v36: - initial support for DR-3080 and DR-5060 - add code to clamp scan width to an arbitrary byte width boundary - add code to prevent setting of brightness/threshold/contrast - don't send dropout color command on non-color scanners - initial support for DR-7090C - update credits * po/pl.po: updated translation from Jakub Bogusz * po/de.po: updated translation from Matthias Mailander * backend/canon.conf.in: improved detection of scsi scanners 2011-01-17 Stéphane Voltz * doc/descriptions/genesys.desc: add DSmobile variant 2011-01-15 Reinhold Kainhofer * sanei/sanei_usb.c: Add function sanei_usb_set_endpoint to change the endpoints for usb communications. * backend/magicolor.c: Add new "magicolor" backend for KONICA MINOLTA magicolor 1690MF devices 2011-01-13 Stéphane Voltz * backend/genesys_devices.c backend/genesys_gl124.c backend/genesys_gl124.h doc/descriptions/genesys.desc: add 2400 dpi mode for LiDE 110 and 210 2011-01-12 Stéphane Voltz * backend/genesys.c backend/genesys_devices.c backend/genesys_gl124.c backend/genesys_gl124.h backend/genesys_low.c backend/genesys_low.h : prepare 2400 dpi modes for LiDE 210/110, add a wait for head to park function and use it in sane_start(). 2011-01-06 Stéphane Voltz * backend/genesys.c backend/genesys_devices.c backend/genesys_gl847.c: fix lineart issue when yres is higher than xres and dynamic lineart is enabled, make gl847 wait for head to park between scans, wait for head ot park in sane_close() 2011-01-05 Nicolas Martin * backend/pixma_mp730.c: pixma: Added patch proposed by Klaus Stengel for Canon imageRunner 1020/1024/1025 support. 2011-01-04 Nicolas Martin * backend/pixma_mp150.c, backend/pixma.c, backend/pixma.h backend/pixma_common.c, backend/pixma_common.h: pixma: several updates for MP830, MP990, memmove bug fix, and 64 bits image size. 2011-01-04 Stéphane Voltz * backend/genesys.c backend/genesys_devices.c backend/genesys_gl124.c: fix 1200 dpi lineart issues for gl124, reenable low resolutions for lineart for gl124, and geometry fine tuning for LiDE 110/210 2011-01-03 Stéphane Voltz * backends/lexmark_low.c: fix compilation issue due to incorrect place for a DBG statement. 2011-01-03 Chris Bagwell * backends/Makefile.am: Add SOCKET_LIBS to xerox_mfp for platforms such as solaris since it uses sanei_tcp.k * doc/sane.tex: removed reference to changelog package since its not used and not installed by Macports (#312596) * doc/Makefile.am: put quotes around TEXINPUTS in case paths have spaces in name. This is so latex can find html.sty package that is referenced by sane.tex. 2011-01-01 Chris Bagwell * */Makefile.in, configure, aclocal.m4: Generate from latest autoconf (2.63 to 2.66). * m4/*: Added new libtool helper files. * ltmain.sh: updated to latest libtool and added back special sane soname work around. * po/Makefile.am: Allow "make dist" to work when translations disabled. * sanei/Makefile.am: allow "make check" to work on cygwin. 2010-12-28 Stéphane Voltz * backend/genesys.conf.in backend/genesys_devices.c backend/genesys_gl646.c backend/genesys_gl847.c backend/genesys_gl847.h: fix HP2300 warming up problem, add LiDE 700F and 5600F to gl847 devices, smooth DSmobile 600 moves. 2010-12-27 Stéphane Voltz * backend/genesys.c backend/genesys.conf.in backend/genesys_devices.c backend/genesys_gl841.c backend/genesys_low.h doc/descriptions/genesys.desc doc/descriptions/unsupported.desc doc/sane-genesys.man: add Plustek OpticBook 3600 support by Chris Berry and Michael Rickmann 2010-12-27 Stéphane Voltz * backend/genesys_devices.c backend/genesys_gl124.c backend/genesys.c doc/descriptions/genesys.desc doc/sane-genesys.man: enable 16 bit gamma for gl124 scanners, models and credits update. 2010-12-24 Stéphane Voltz * backend/genesys_devices.c backend/genesys_gl124.c backend/genesys.c doc/descriptions/genesys.desc: GL847 shading area size fix, GL124 shading area tuning, descriptions update. 2010-12-24 Stéphane Voltz * backend/lexmark*.[ch]: applied X74 support patch by Torsten Houwaart 2010-12-23 Mike Kelly * backends/avision.[ch]: - Bumped build number to 293. - Removed "regularly tested" from various scanners. - Fixed USB id for Avision FB2080E. - Added support for the Avision AV210D2+ scanner. - Moved device init code to sane_get_devices(). - Rewrote indirect "adf_mode" code to be more direct. - Fixed indentation. - Changed AVISION_FILTER_* defines to use final values. - Wrap duplicate USB id entries with ifdefs. - Removed a duplicate entry for Avision AV210C2. - Print out USB ids as four digit hex numbers. - Enhanced sane_get_option_descriptor() debug message. * doc/descriptions/avision.desc: - (Re)generated from avision.c. 2010-12-19 Stéphane Voltz * backend/genesys_gl124.h: LiDE 210 GPIO fix 2010-12-16 Stéphane Voltz * backend/genesys.c backend/genesys.conf.in backend/genesys_devices.c backend/genesys_gl124.h: LiDE 210 support (GL124 based) 2010-12-14 Stéphane Voltz * backend/genesys*.[ch] backend/genesys.conf.in backend/Makefile.am backend/Makefile.in tools/check-usb-chip.c doc/desc/genesys.desc: LiDE 110 support (GL124 based) 2010-12-08 Mike Kelly * doc/descriptions/avision.desc: - (Re)generated from avision.c. * doc/sane-avision.man: - Added myself as maintainer. * backends/avision.desc: - Removed this obsolete file (again). * backends/avision.c: - Bumped version to 292. - Added myself as maintainer. - Added support for DocuMate262i. - Added support entries for HP 8300 series. * backends/avision.conf.in: - Added myself as maintainer. 2010-12-06 Julien Blache * doc/descriptions/espon.desc, doc/descriptions/epson2.desc: add SCSI IDs for the Perfection 3200 (GT-9800) connected through FireWire. Report from Colin Kincaid Williams . Update Perfection 2450 interface list. 2010-12-02 m. allan noah * backend/fujitsu.[ch], backend/fujitsu-scsi.h: Fujitsu backend version 105 - backup and restore image params around image processing code - cache software crop/deskew parameters for use on backside of duplex - fi-6110 does not support bgcolor or prepick 2010-11-29 Olaf Meeuwissen * backend/epson2-ops.c: fix list of supported commands for levels D1 and D2. 2010-11-24 m. allan noah * backend/fujitsu.c, backend/fujitsu.conf.in, doc/descriptions/fujitsu.desc, doc/sane-fujitsu.man: Fujitsu backend versions 103 and 104 - remove compiled-in default config file - initial support for new fi-6xxx machines - never request more than s->buffer_size from scanner - silence noisy set_window() calls from init_interlace() 2010-11-19 Julien Blache * doc/descriptions-external/epkowa.desc: update for iScan 2.26.1, from Olaf Meeuwissen . 2010-11-17 Stéphane Voltz * backend/genesys.c: don't write scan data unless specified by debug level. 2010-11-08 Marc Deslauriers * backend/v4l.c: convert v4l1 BGR data to RGB; v4l1 always returns BGR for RGB due to a coding error way back. 2010-11-07 Marc Deslauriers * backend/v4l.c: loop through the read buffers in the v4l backend so we don't get stale frames. 2010-11-06 Stéphane Voltz * frontend/scanimage.c doc/scanimage.man: add -A/--all-options to list all control options exposed by a backend. 2010-11-01 Stéphane Voltz * frontend/scanimage.c: don't print readonly device options since they can't be set on command line 2010-11-01 Stéphane Voltz * backend/genesys.c backend/genesys_devices.c backend/genesys_gl843.c backend/genesys_gl843.h backend/genesys_gl847.c: up build number to 41, rework head parking, fixed clear-calibration option reading, make calibration cache expire for non sheetfed gl847 scanners, tuned KV-SS080 timings to improve image quality, raised LiDE 100/200 defaukt gamma to 1.7 2010-10-31 Julien Blache * doc/descriptions/hp.desc: add SCSI IDs for ScanJet 4c. 2010-10-30 Julien Blache * backend/xerox_mfp.conf.in, doc/descriptions/xerox_mfp.desc: add Samsung SCX 4824 & 4825FN (Debian #601748). Resync desc file with config file. 2010-10-13 Stéphane Voltz * backend/genesys_devices.c backend/genesys_gl843.c backend/genesys_gl843.h: added 100, 150, 400 and 600 dpi modes for G4050 and G4010. Added 500 and 400 dpi modes for KV-SS080 2010-09-30 Alex Belkin * Makefile.in backend/Makefile.am backend/Makefile.in backend/xerox_mfp-tcp.c backend/xerox_mfp-usb.c backend/xerox_mfp.c backend/xerox_mfp.conf.in backend/xerox_mfp.h doc/Makefile.in doc/descriptions/xerox_mfp.desc doc/sane-xerox_mfp.man frontend/Makefile.in include/Makefile.in japi/Makefile.in lib/Makefile.in po/Makefile.in sanei/Makefile.in testsuite/Makefile.in tools/Makefile.in: Added Samsung SCX-4500W scan over network support for xerox_mfp backend (by Alexander Kuznetsov). autoconf and automake reconfigure to support new files. 2010-09-28 Stéphane Voltz * backend/genesys.c backend/genesys.conf.in backend/genesys_devices.c backend/genesys_gl843.c backend/genesys_gl843.h: add minimal support (200 and 300 dpi) for HP G4050. Add a device entry for G4010. 2010-09-18 Reinhold Kainhofer * include/sane/sanei_config.h sanei/sanei_config.c: Add function sanei_config_get_paths to obtain all configuration pathes (from env var SANE_CONFIG_DIR and default paths); fix pointers to invalid/freed strings when SANE_CONFIG_DIR is set. * backend/dll.c: When searching for the dll.d/ directory, also use the SANE_CONFIG_DIR env variable. 2010-07-12 Julien Blache * doc/descriptions-external/epkowa.desc: update for iScan 2.26.0, from Alesh Slovak . 2010-09-17 Stéphane Voltz * backend/genesys.c backend/genesys_low.h sanei/sanei_magic.c backend/genesys_devices.c backend/genesys_gl843.c: do asynchronous head parking for flatbed scanners to save scan time. Fix a couple of memory overwrites detected by valgrind. Optimize shading data writing and fine tune scaneara for gl843. 2010-09-16 Julien Blache * frontend/saned.c: exit Avahi process on error and when the poll loop terminates. 2010-09-13 Stéphane Voltz * doc/descriptions/unsupported.desc: update status of scanners now supported by the genesys backend. 2010-09-13 Stéphane Voltz * doc/sane-genesys.man doc/descriptions/genesys.desc backend/genesys.con.in: update HP3690 status to supported 2010-09-12 Stéphane Voltz * backend/genesys_conv.c backend/genesys.c doc/sane-genesys.man sanei/sanei_magic.c backend/genesys.h backend/genesys_low.h backend/Makefile.in backend/Makefile.am: add software deskep, crop and despeckle for the genesys backend. 2010-09-08 Nicolas Martin * backend/pixma_mp150.c, backend/pixma_mp730.c doc/descriptions/pixma.desc, doc/sane-pixma.man: pixma: several updates for MP375R, MP390, MP460 and docs by Gernot Hassenpflug. 2010-09-07 Nicolas Martin * backend/pixma_mp750.c: pixma: fix for 2400 dpi striping on MP760/770/780/790 by Gernot Hassenpflug. 2010-09-05 Nicolas Martin * doc/sane-pixma.man: pixma: man page update for devices as reported by Gernot Hassenpflug. 2010-09-05 Stéphane Voltz * backend/genesys_gl841.c: end of document detection rework for sheetfed scanners. 2010-09-04 Stéphane Voltz * backend/genesys_devices.c backend/genesys.c backend/genesys_gl843.c: 1200 dpi resolution support for KV-SS080. 2010-09-01 Stéphane Voltz * backend/genesys_devices.c backend/genesys.c backend/genesys_gl843.c: support for scan button, faster move to scan area and calibration fine tuning. 2010-09-01 Nicolas Martin * backend/pixma.c, backend/pixma_mp730.c, backend/pixma_mp150.c doc/descriptions/pixma.desc: pixma: changes supplied by Gernot Hassenpflug for Lineart support to some Pixma devices, and desc updates. 2010-08-31 Stéphane Voltz * backend/genesys_devices.c backend/genesys.conf.in backend/genesys.c backend/genesys_gl843.[ch] backend/Makefile.am backend/Makefile.in: support for gl843 based scanners, starting with KV-SS080. disable true gray for LIDE35/50 since it breaks scanning 2010-08-02 Stéphane Voltz * backend/genesys_devices.c backend/genesys.conf.in: add a device entry for the Canoscan 5600f. 2010-07-25 Nicolas Martin * backend/pixma.c, backend/pixma.h, backend/pixma_common.c, backend/pixma_imageclass.c: pixma: changes for future Lineart scan mode support. some MF8030 settings, but device not yet supported. 2010-07-22 Nicolas Martin * backend/pixma_mp150.c, backend/pixma_imageclass.c, doc/descriptions/pixma.desc, doc/sane-pixma.man: pixma: add support for PIXMA MX870. declared PIXMA MF8030, but not yet working. 2010-07-14 Julien Blache * doc/descriptions/epson.desc, doc/descriptions/epson2.desc: add :scsi keyword for the Perfection 2450 connected through FireWire. Courtesy of Brian Denheyer . 2010-07-12 Julien Blache * doc/descriptions-external/epkowa.desc: update for iScan 2.25.0, from Alesh Slovak . 2010-07-09 Julien Blache * backend/dll.c: allow symlinks under SANE_CONFIG_DIR/dll.d. 2010-07-04 Nicolas Martin * backend/pixma_mp150.c, doc/descriptions/pixma.desc, doc/sane-pixma.man: pixma: changes for PIXMA MX350 support, usb and ethernet. 2010-07-03 Nicolas Martin * doc/descriptions/pixma.desc, backend/pixma.c: pixma: fix ImageClass MF6550 description. fix end of line crop buffer size. 2010-07-02 Nicolas Martin * doc/descriptions/pixma.desc, doc/sane-pixma.man: pixma: update doc to include ImageClass MF6550 support. 2010-07-02 m. allan noah * backend/avision.c: patch for AV122-C2 from Ori Koren 2010-07-01 Nicolas Martin * backend/pixma_mp150.c, doc/descriptions/pixma.desc, doc/sane-pixma.man: pixma: thanks to Dan McGee patch, add support for PIXMA MX340. 2010-06-23 m. allan noah * backend/fujitsu.c: Fix compilation bug when jpeg support is enabled. 2010-06-23 Julien Blache * various: corrected initialization, printing, etc. in many backends 2010-06-21 Julien Blache * tools/sane-desc.c: udev rules: set libsane_matched=yes for SCSI devices too. Used by udev-acl later on. 2010-06-21 Stéphane Voltz * backend/genesys.c backend/genesys_devices.c backend/genesys_gl847.c backend/genesys_low.h: improve scan quality by using double x resolution internally at low resolution. Scan area geometry fine tuning. 2010-06-18 Stéphane Voltz * backend/genesys.c backend/genesys_devices.c backend/genesys_gl847.c: add 400, 200 and 100 dpi resolution to LiDE 100 and LiDE 200 . Disable true gray until it really works. 2010-06-15 Stéphane Voltz * backend/genesys.c backend/genesys_devices.c backend/genesys_gl847.c backend/genesys_gl847.h: Canon LiDE 200 support up to 1200 DPI 2010-06-15 m. allan noah * doc/descriptions/xerox_mfp.desc, backend/xerox_mfp.conf.in: Add Samsung SCX-4600 USB IDs * backend/kvs20xx.h: use sys/param.h instead of endian.h 2010-06-10 Stéphane Voltz * backend/genesys.c: calibration file name double free fix 2010-06-10 m. allan noah * backend/niash.c: patch for HP3300 from Yves Jeanrenaud * po/fr.po: updates from Yann E. MORIN 2010-06-10 Stéphane Voltz * backend/genesys_devices.c backend/genesys_gl847.c: LiDE 100 motor settings rework 2010-06-09 m. allan noah * backend/kvs20xx*, Makefiles, confs and docs: - Add new kvs20xx backend from Panasonic, for KV-S202xC and KV-S204xC 2010-06-09 m. allan noah * backend/fujitsu.[ch]: backend v100: - store more Request Sense data in scanner struct - clear Request Sense data at start of every do_cmd() call - track per-side ILI and global EOM flags - set per-side EOF flag if ILI and EOM are set 2010-06-09 m. allan noah * backend/Makefile.{am|in}: add genesys_gl847 files * po/Makefile.{am|in}: add LINGUAS POTFILES to EXTRA_DIST * Makefile.am: add Changelog-1.0.21 to EXTRA_DIST 2010-06-08 Nicolas Martin * backend/pixma_imageclass.c: pixma: set #1 of modifiations for ImageClass MF65xx series. 2010-06-07 Stéphane Voltz * backend/genesys.c backend/genesys_devices.c backend/genesys_gl847.c: LiDE 100 motor fine tuning 2010-06-03 Stéphane Voltz * backend/genesys.c backend/genesys_devices.c backend/genesys_gl847.c doc/descriptions/genesys.desc: final bits for full LiDE 100 support 2010-05-31 Stéphane Voltz * backend/genesys.c backend/genesys_devices.c backend/genesys_gl847.c: shading calibration is working and led calibration has been tuned 2010-05-30 Stéphane Voltz * backend/genesys.c backend/genesys_devices.c backend/genesys_gl847.c backend/genesys_low.h: Canon LiDE 100 working without shading calibration which is the final bit to fix 2010-05-24 m. allan noah * backend/avision.c, doc/descriptions/avision.desc: add Fujitsu fi-5015C 2010-05-20 Stéphane Voltz * backend/genesys.c backend/genesys_devices.c backend/genesys_gl847.c: make led and shading calibration work for LiDE 100 2010-05-16 Chris Bagwell * README.freebsd: Add suggested hint that configure needs to be told location of external libraries installed through Ports. 2010-05-16 Stéphane Voltz * backend/genesys.[ch] backend/genesys_devices.c backend/genesys.conf.in backend/genesys_gl847.[ch] backend/Makefile.in: start of LiDE 100 and LIDE 200 support 2010-05-16 Stéphane Voltz * sanei/sanei_usb.c include/sane/sanei_usb.h: add a sanei_usb_reset() function. 2010-05-15 m. allan noah * backend/fujitsu.c: backend v99 - sense_handler(): collect rs_info for any ILI, not just EOM - do_usb_cmd(): use rs_info whenever set, not just EOF - read_from_*(): better handling of EOF from lower level functions - sane_read(): improve duplexing logic 2010-05-03 Pierre Willenbrock * Change status of CanoScan LiDE 40 from untested to good 2010-04-27 m. allan noah * po/Makefile.in: include POTFILES and LINGUAS in DIST * doc/releases.txt: more git notes 2010-04-25 Julien Blache * tools/sane-backends.pc.in: syntax fixes. 2010-04-25 m. allan noah * ChangeLog-1.0.21, Makefile.in: ChangeLog for 1.0.21 release * configure, configure.in: version 1.0.22git * doc/descriptions/kodak.desc, doc/descriptions/kvs1025.desc, doc/descriptions/p5.desc: remove :new tag * doc/releases.txt: minor updates due to new git hooks Older entries can be found in ChangeLog-1.0.20. sane-backends-extras-1.0.22.3ubuntu1/depcomp0000775000000000000000000004271311475557446015561 0ustar #! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2007-03-29.01 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 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., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: sane-backends-extras-1.0.22.3ubuntu1/config.sub0000775000000000000000000010460611600674563016155 0ustar #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011 Free Software Foundation, Inc. timestamp='2011-03-23' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file 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 of the License, 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., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | picochip) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile-* | tilegx-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; # This must be matched before tile*. tilegx*) basic_machine=tilegx-unknown os=-linux-gnu ;; tile*) basic_machine=tile-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: sane-backends-extras-1.0.22.3ubuntu1/aclocal.m40000664000000000000000000020077711526065235016035 0ustar # generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009 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. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.66],, [m4_warning([this file was generated for autoconf 2.66. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # 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. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # 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. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # 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. # Generated from ltversion.in. # serial 3175 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.2.10]) m4_define([LT_PACKAGE_REVISION], [1.3175]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.2.10' macro_revision='1.3175' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # 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. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant . # # 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 of the License, 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. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # have to call PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT]) ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .]) ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 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. # 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. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 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. # 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. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # 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. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl 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])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # 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. # serial 10 # 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], UPC, [depcc="$UPC" am_compiler_list=], [$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 # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub 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 am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # 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. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # 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. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; 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 ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi 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_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --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])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # 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. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf 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. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. 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 " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/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"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 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. # serial 16 # 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. # 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_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # 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 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])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) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # 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 AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _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 AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008 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. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 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. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # 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. # serial 5 # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless `enable' is passed literally. # For symmetry, `disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful (and sometimes confusing) to the casual installer], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 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. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit 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 # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 # 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. # serial 6 # AM_PROG_CC_C_O # -------------- # Like AC_PROG_CC_C_O, but changed for automake. AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi dnl Make sure AC_PROG_CC is never called again, or it will override our dnl setting of CC. m4_define([AC_PROG_CC], [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # 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. # serial 6 # 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 AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # 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 ]) # Copyright (C) 2003, 2004, 2005, 2006 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. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008 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. # serial 4 # _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], [m4_foreach_w([_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. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # 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. # serial 5 # 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 # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # 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)]) # Copyright (C) 2001, 2003, 2005 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. # AM_PROG_INSTALL_STRIP # --------------------- # 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="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008 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. # serial 2 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 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. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([acinclude.m4]) sane-backends-extras-1.0.22.3ubuntu1/debian/0000775000000000000000000000000012272267643015410 5ustar sane-backends-extras-1.0.22.3ubuntu1/debian/libsane-extras.postinst0000664000000000000000000000103111077104212022111 0ustar #!/bin/sh set -e case "$1" in configure) if [ "$(uname -s)" = "Linux" ]; then if [ -e /etc/hotplug/usb/libsane-extras.usermap ]; then rm -f /etc/hotplug/usb/libsane-extras.usermap fi if [ -e /etc/sane.d/hotplug/libsane-extras.db ]; then rm -f /etc/sane.d/hotplug/libsane-extras.db rmdir -p --ignore-fail-on-non-empty /etc/sane.d/hotplug fi fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "$0 called with unknown argument '$1'" >&2 exit 1 ;; esac #DEBHELPER# sane-backends-extras-1.0.22.3ubuntu1/debian/copyright0000664000000000000000000000342411200276762017336 0ustar This package was debianized by Julien BLACHE . Backend : geniusvp2 Version : 1.0.16.1 Upstream author : Anderson Lizardo URL : http://geniusvp2.sourceforge.net/ License : GPLv2+ Backend : ls5000 Version : git 20070512 Upstream author : Johannes Berg Copyright 2007 Johannes Berg This code is based on coolscan2.c, Copyright 2001-2002, Andras Major URL : http://johannes.sipsolutions.net/Projects/ls5000 License : GPLv2+ + SANE exception On Debian systems, the complete text of the GNU GPL can be found in the /usr/share/common-licenses/GPL file. SANE exception: As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. sane-backends-extras-1.0.22.3ubuntu1/debian/libsane-extras.udev0000664000000000000000000000164711276075471021225 0ustar # udev rules file for scanners supported by libsane-extras # # # To add a USB device, add a rule to the list below between the # LABEL="libsane_extras_rules_begin" and LABEL="libsane_extras_rules_end" lines. # # To run a script when your scanner is plugged in, add RUN="/path/to/script" # to the appropriate rule. # ACTION!="add", GOTO="libsane_extras_rules_end" ENV{DEVTYPE}=="usb_device", GOTO="libsane_extras_rules_begin" LABEL="libsane_extras_rules_begin" # For Linux >= 2.6.22 without CONFIG_USB_DEVICE_CLASS=y # If the following rule does not exist on your system yet, uncomment it # ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0664", OWNER="root", GROUP="root" # The following rule will disable USB autosuspend for the device ENV{libsane_matched}=="yes", RUN+="/bin/sh -c 'test -e /sys/$env{DEVPATH}/power/level && echo on > /sys/$env{DEVPATH}/power/level'" LABEL="libsane_extras_rules_end" sane-backends-extras-1.0.22.3ubuntu1/debian/libsane-extras.install0000664000000000000000000000006011600674334021706 0ustar debian/tmp/usr/lib/*/sane/*.so.* debian/tmp/etc sane-backends-extras-1.0.22.3ubuntu1/debian/dll.d/0000775000000000000000000000000011200276607016373 5ustar sane-backends-extras-1.0.22.3ubuntu1/debian/dll.d/libsane-extras0000664000000000000000000000007411200276607021240 0ustar # dll.conf snippet for libsane-extras # #geniusvp2 ls5000 sane-backends-extras-1.0.22.3ubuntu1/debian/libsane-extras-common.install0000664000000000000000000000023111600674411023170 0ustar debian/extras-backends/geniusvp2 usr/share/doc/libsane-extras/ debian/extras-backends/ls5000 usr/share/doc/libsane-extras/ debian/tmp/usr/share/man/man5 sane-backends-extras-1.0.22.3ubuntu1/debian/extras-backends/0000775000000000000000000000000011200276574020457 5ustar sane-backends-extras-1.0.22.3ubuntu1/debian/extras-backends/ls5000/0000775000000000000000000000000010621277224021401 5ustar sane-backends-extras-1.0.22.3ubuntu1/debian/extras-backends/ls5000/README0000664000000000000000000000256110621277224022265 0ustar ls5000 SANE backend ===================== Author: Johannes Berg Based on coolscan2.c from Andras Major. This is the source code for a SANE backend for the Nikon LS-5000 ED (Coolscan 5000 ED) scanner. The LS-5000 is a 35mm film scanner capable of 4000dpi resolution and 16-bit colour depth. The ls5000.c file is based on coolscan2.c from the SANE distribution. I have heavily cleaned it up, modernized the code, made it worked with the LS-5000 and added a few features. It should be possible to factor in support for the other scanners again, but I have not made any attempt at it yet since I do now own any such hardware. The sanei* files were copied from the SANE distribution and slightly modified for building outside of the SANE source. Requirements ============== * libusb development headers, libsane development headers (libusb-dev/libsane-dev or similar) * a not-too-shabby C compiler Installation ============== * add "ls5000" to /etc/sane/dll.conf (or, on Debian systems, create /etc/sane/dll.d/ls5000 with just the string ls5000 in it) * copy libsane-ls5000.so.1 to /usr/lib/sane/libsane-ls5000.so.1 Debugging =========== The ls5000 backend, like most SANE backends, honours the SANE_DEBUG_LS5000 environment variable. There are various debug levels: 1: most obvious bugs 2 - 10: some information 20: command trace sane-backends-extras-1.0.22.3ubuntu1/debian/extras-backends/geniusvp2/0000775000000000000000000000000010617364123022400 5ustar sane-backends-extras-1.0.22.3ubuntu1/debian/extras-backends/geniusvp2/geniusvp2.BUGS0000664000000000000000000000153010306653174025005 0ustar BUGS ---- - Scan may sometimes timeout due to the buffer not being filled after some reasonable time (on a graphical frontend you can notice this when scanning "hangs" and after some time it stops, resulting in a truncated image). Just try scanning again and it should work. - Scan at high resolutions (e.g. 600 dpi.) may also be truncated if the selected scan area is too large. Just scan at lower (<= 300 dpi.) resolutions for now if you want a larger image. - the lamp carriage may sometimes go out of its maximum distance (297 mm), forcing the motor engine. You can detect this when the scanner produces a "strange" noise and the carriage is at its maximum distance from home. In this situation, **turn off scanner power imediately**, or you can risk damage your device. This seems to happen more often when scanning full pages at high resolutions. sane-backends-extras-1.0.22.3ubuntu1/debian/extras-backends/geniusvp2/geniusvp2.THANKS0000664000000000000000000000047010306653174025237 0ustar This driver was based on the pxscan program, which in turn is based on primax_scan. I'd like to thank the following people/projects: - Gustaf Kröling, for writing pxscan. - Marco Foglia, Christian Ordig and Thomas Schano, for writing primax_scan. - the SANE developers, for writing such nice scanner platform. sane-backends-extras-1.0.22.3ubuntu1/debian/extras-backends/geniusvp2/geniusvp2.TODO0000664000000000000000000000054210306653174025014 0ustar TODO ---- - Add black & white and gray mode scanning (probably using pxscan code). - Fix calibration code. - Add validation & status checking code (e.g. check if a supported scanner is present right after initialization code, check for timeouts and return code of I/O functions etc.). - Write a SANE driver (DONE). - Document how the scanner works. sane-backends-extras-1.0.22.3ubuntu1/debian/changelog0000664000000000000000000006000012272267572017257 0ustar sane-backends-extras (1.0.22.3ubuntu1) trusty; urgency=low * Use dh-autoreconf for newer arches, resolving FTBFS. -- Daniel T Chen Wed, 29 Jan 2014 16:15:20 -0500 sane-backends-extras (1.0.22.3) unstable; urgency=low * QA upload. * Change maintainer to QA group * debhelper update: + update compat level to 9 + use dh * Incorporate Ubuntu patch to switch to libusb 1.0. (Closes: #687138). Needed to add Build-Dep on pkg-config to make it actually work. -- Frank Lichtenheld Tue, 14 May 2013 00:00:21 +0200 sane-backends-extras (1.0.22.2ubuntu1) quantal; urgency=low * debian/control, debian/rules: Switch to libusb 1.0. (LP: #918774) -- Whoopie Wed, 29 Aug 2012 11:03:14 +0200 sane-backends-extras (1.0.22.2) unstable; urgency=low * Multiarch conversion. * debian/control: + Bump Standards-Version to 3.9.2 (no changes). + Bump debhelper build-dep to >= 8.1.3 for multiarch. + Add Pre-Depends: ${misc:Pre-Depends} to libsane-extras. + Tag libsane-extras with Multi-Arch: same. + New Multi-Arch: foreign libsane-extras-common binary package. + Add libsane-extras-common dependency to libsane-extras. * debian/rules: + Use multiarch path. * debian/libsane-extras-dev.install: + Adapt for multiarch. * debian/libsane-extras.install: + Adapt for multiarch, transfer multiarch-incompatible content to libsane-extras-common. * debian/libsane-extras-common.install.in: + Adopt multiarch-incompatible content previously found in libsane-extras. * README.Debian -> libsane-extras.README.Debian: + Rename. -- Julien BLACHE Thu, 23 Jun 2011 19:38:13 +0200 sane-backends-extras (1.0.22.1) unstable; urgency=low * Based on sane-backends 1.0.22. * debian/control: + Bump Standards-Version to 3.9.1 (no changes). * debian/rules: + Don't install udev rules, as there are no devices listed in the file. -- Julien BLACHE Thu, 17 Feb 2011 20:36:25 +0100 sane-backends-extras (1.0.21.2) unstable; urgency=low * Fix the geniusvp2 build on kfreebsd; add PPB_COMPATIBLE and PPB_EPP definitions to geniusvp2-parport.c, as they're now unavailable to userspace in FreeBSD 8. For no good reason. -- Julien BLACHE Mon, 03 May 2010 19:39:44 +0200 sane-backends-extras (1.0.21.1) unstable; urgency=low * Based on sane-backends 1.0.21. * Moved to source format 3.0 (native). * debian/control: + Bump Standards-Version to 3.8.4 (no changes). + Add ${misc:Depends}. * debian/rules: + --disable-fork-process -> --enable-pthread. -- Julien BLACHE Fri, 30 Apr 2010 18:26:55 +0200 sane-backends-extras (1.0.20.3) unstable; urgency=low * debian/libsane-extras.udev: + Remove support for kernel < 2.6.22. -- Julien BLACHE Mon, 09 Nov 2009 21:27:47 +0100 sane-backends-extras (1.0.20.2) unstable; urgency=low * debian/control: + Bump Standards-Version to 3.8.3 (no changes). + Add build-dep on chrpath. * debian/rules: + Remove rpath from libraries. * debian/libsane-extras.install: + Do not ship .la files. * debian/libsane-extras.NEWS: + Fix typo. -- Julien BLACHE Sat, 29 Aug 2009 16:51:40 +0200 sane-backends-extras (1.0.20.1) unstable; urgency=low * Based on sane-backends 1.0.20. * backends removed: + hp_rts88xx: replaced by the rts8891 backend from sane-backends 1.0.20. * debian/rules: + Do not install the now-empty FDI file. + Use DESTDIR install time. * debian/libsane-extras.preinst: + Remove obsolete conffile /etc/sane.d/hp_rts88xx.conf. * debian/control: + Stop mentioning hp_rts88xx. + Move libsane-extras-dbg to debug section. * debian/README.Debian, debian/copyright: + Stop mentioning hp_rts88xx. * debian/libsane-extras.fdi, debian/libsane-extras.udev: + Remove hardware supported by hp_rts88xx. * debian/libsane-extras.install: + Stop installing hp_rts88xx documentation. * debian/libsane-extras.NEWS: + Document the removal of hp_rts88xx and direct users to rts8891. -- Julien BLACHE Wed, 06 May 2009 14:21:17 +0200 sane-backends-extras (1.0.19.16) unstable; urgency=low * debian/libsane-extras.preinst: + Attempt to remove epkowa.conf only if iscan is not installed (closes: #521528). -- Julien BLACHE Sun, 29 Mar 2009 12:06:56 +0200 sane-backends-extras (1.0.19.15) unstable; urgency=low * debian/libsane-extras.preinst: + Remove obsolete /etc/sane.d/epkowa.conf conffile. -- Julien BLACHE Thu, 12 Mar 2009 14:22:10 +0100 sane-backends-extras (1.0.19.14) unstable; urgency=low * debian/rules: + Remove comment bit breaking configure invocation. -- Julien BLACHE Fri, 20 Feb 2009 10:49:34 +0100 sane-backends-extras (1.0.19.13) unstable; urgency=low * debian/libsane-extras.NEWS: + Rename debian/NEWS.Debian and don't assume it'll be picked up in the same way debian/README.Debian is picked up automatically. -- Julien BLACHE Tue, 17 Feb 2009 15:21:49 +0100 sane-backends-extras (1.0.19.12) unstable; urgency=low * Get rid of the epkowa backend. It is no longer possible to support this backend inside Debian since iScan! broke binary compatibility of its non-free plugins after iScan! 2.10.0 without providing new versions for *all* the affected machines. * debian/rules: + Enable use of pthread instead of fork for reader processes. -- Julien BLACHE Sat, 14 Feb 2009 17:11:04 +0100 sane-backends-extras (1.0.19.11) unstable; urgency=low * debian/control: + Drop dependency on udev; udev will be pulled in by libsane anyway (closes: #493698). * debian/rules: + Remove substitution variable for udev dependency in the call to dh_gencontrol. * debian/libsane-extras.postinst: + Make postinst script set -e. -- Julien BLACHE Mon, 20 Oct 2008 15:33:10 +0200 sane-backends-extras (1.0.19.10) unstable; urgency=low * backend/epkowa.conf.in, backend/geniusvp2.conf.in, backend/hp_rts88xx.conf.in: + Add back config files that went AWOL beginning with the 1.0.19 branch (closes: 493133). -- Julien BLACHE Thu, 31 Jul 2008 21:31:14 +0200 sane-backends-extras (1.0.19.9) unstable; urgency=low * doc/sane-epkowa.man: + Fix typos, patch from Stéphane Blondon (closes: #493137). + Fix hyphen vs. minus sign issues reported by lintian. -- Julien BLACHE Thu, 31 Jul 2008 20:51:24 +0200 sane-backends-extras (1.0.19.8) unstable; urgency=low * debian/control: + Bump Standards-Version to 3.8.0 (no changes). * epkowa: + Add full support for the Perfection 4490 and fix an off-by-one error; patches by Carl Troein and Brad Sawatzky (closes: #487462). -- Julien BLACHE Mon, 07 Jul 2008 16:20:11 +0200 sane-backends-extras (1.0.19.7) unstable; urgency=low * include/sane/sanei_thread.h, sanei/sanei_thread.c: + From CVS, use a long-type variable to hold both pid and pthread id, as pthread_t is 64bit on 64bit platforms but pid_t remains a 32bit integer. -- Julien BLACHE Thu, 15 May 2008 19:09:50 +0200 sane-backends-extras (1.0.19.6) unstable; urgency=low * debian/README.Debian: + Make the whole RPM download procedure more obvious (closes: #475549). -- Julien BLACHE Sat, 19 Apr 2008 17:36:08 +0200 sane-backends-extras (1.0.19.5) unstable; urgency=low * sanei/sanei_scsi.c: + From CVS, continue to iterate over the list of devices even if an attempt to attach one of the devices fails. * debian/libsane-extras.fdi: + Add support for newer HAL version. -- Julien BLACHE Fri, 28 Mar 2008 22:58:08 +0100 sane-backends-extras (1.0.19.4) unstable; urgency=low * debian/libsane-extras.udev: + Update epkowa devices. * debian/libsane-extras.fdi: + Add HAL fdi file for libsane-extras. * debian/rules: + Install the HAL fdi file. + Do not create lib directory for epkowa proprietary libs on kfreebsd. + Do not call dh_installudev on kfreebsd. -- Julien BLACHE Sat, 01 Mar 2008 15:57:24 +0100 sane-backends-extras (1.0.19.3) unstable; urgency=low * geniusvp2: + Fix spurious build-dep on libtiff. (closes: #466319) -- Julien BLACHE Mon, 18 Feb 2008 09:01:25 +0100 sane-backends-extras (1.0.19.2) unstable; urgency=low * debian/control: + Add back libtiff4-dev build-dep. -- Julien BLACHE Sat, 16 Feb 2008 15:48:46 +0100 sane-backends-extras (1.0.19.1) unstable; urgency=low * Based on sane-backends 1.0.19. * debian/control: + Remove unneeded build-deps. -- Julien BLACHE Sat, 16 Feb 2008 12:06:11 +0100 sane-backends-extras (1.0.18.16) unstable; urgency=low * geniusvp2: + Applied patch from Aurélien JARNO for FreeBSD support. -- Julien BLACHE Tue, 08 Jan 2008 15:49:04 +0100 sane-backends-extras (1.0.18.15) unstable; urgency=low * debian/control: + Build-Depends: xutils-dev instead of xutils. + Drop libsane{,-dev} dependencies to avoid circular dependencies now that libsane{,-dev} depend on libsane-extras{,-dev}. -- Julien BLACHE Mon, 07 Jan 2008 12:00:34 +0100 sane-backends-extras (1.0.18.14) unstable; urgency=low * debian/control: + Bump libsane dependency due to the udev rules renaming. * debian/rules: + Use dh_installudev. * debian/libsane-extras.postinst: + Remove udev installation code. * debian/libsane-extras.preinst: + Added; handle upgrade from previous udev code to dh_installudev. * debian/libsane-extras.postrm: + Removed; no longer needed. * debian/libsane-extras.udev: + Moved from debian/udev/libsane-extras.rules. + Fix labels in the udev rules (closes: #457982). -- Julien BLACHE Fri, 28 Dec 2007 11:41:32 +0100 sane-backends-extras (1.0.18.13) unstable; urgency=low * Backend removed: + hp3900; now included in sane-backends. * debian/control: + Bump Standards-Version to 3.7.3 (no changes). + Bump libsane{,-dev} dependencies to >= 1.0.19~cvs20071213-1. -- Julien BLACHE Thu, 13 Dec 2007 21:11:34 +0100 sane-backends-extras (1.0.18.12) unstable; urgency=low * Update backend: + epkowa: from iscan 2.10.0-1 -- Julien BLACHE Wed, 14 Nov 2007 17:46:50 +0100 sane-backends-extras (1.0.18.11) unstable; urgency=low * Updated backend: + epkowa: from iscan 2.8.0-1 * epkowa: + OPT_NUM_OPTS must be of type SANE_TYPE_INT. -- Julien BLACHE Sat, 27 Oct 2007 22:06:17 +0200 sane-backends-extras (1.0.18.10) unstable; urgency=low * Updated backend: + hp3900: v0.9 (closes: #440282). -- Julien BLACHE Fri, 31 Aug 2007 11:46:24 +0200 sane-backends-extras (1.0.18.9) unstable; urgency=low * debian/udev/libsane-extras.rules: + Update udev rules for Linux 2.6.22 and add CONFIG_USB_SUSPEND workaround. * debian/control: + Turn the udev recommendation into a dependency. + Use ${binary:Version} instead of ${Source-Version}. + Do not build-depend on libusb-dev nor libieee1284-dev on hurd-i386. * debian/rules: + Do not ignore make distclean errors. -- Julien BLACHE Mon, 30 Jul 2007 14:16:05 +0200 sane-backends-extras (1.0.18.8) unstable; urgency=low * New backend: + ls5000 (Coolscan 5000 ED) -- Julien BLACHE Sat, 12 May 2007 10:39:18 +0200 sane-backends-extras (1.0.18.7) unstable; urgency=low * Updated backends: + hp3900: v0.8 + geniusvp2: v1.0.16.1 + epkowa: from iscan 2.6.0-0 * debian/dll.d/libsane-extras: + Disable geniusvp2 by default. -- Julien BLACHE Sun, 06 May 2007 16:55:20 +0200 sane-backends-extras (1.0.18.6) unstable; urgency=low * debian/hotplug: + Removed; get rid of hotplug. * debian/rules: + Do not install hotplug files anymore. * debian/libsane-extras.postinst: + Remove old hotplug-ng files. -- Julien BLACHE Sat, 21 Apr 2007 13:27:43 +0200 sane-backends-extras (1.0.18.5) unstable; urgency=low * Updated backend: + epkowa updated from iscan 2.3.0-1. -- Julien BLACHE Sun, 8 Oct 2006 16:03:56 +0200 sane-backends-extras (1.0.18.4) unstable; urgency=low * New backend: + hp3900: HP ScanJet 3970C, HP ScanJet 4070 PhotoSmart, HP ScanJet 4370. * debian/control: + libsane-extras-dbg is Priority: extra. -- Julien BLACHE Sat, 16 Sep 2006 22:02:52 +0200 sane-backends-extras (1.0.18.3) unstable; urgency=low * Update epkowa backend. + Add udev rules for the supported scanners (closes: #350436). + Update README.Debian with the new procedure for the proprietary libs. -- Julien BLACHE Sun, 16 Jul 2006 15:49:43 +0200 sane-backends-extras (1.0.18.2) unstable; urgency=low * Link epkowa against libltdl3. -- Julien BLACHE Sun, 9 Jul 2006 18:30:49 +0200 sane-backends-extras (1.0.18.1) unstable; urgency=low * Based on sane-backends 1.0.18. * This is only an update for sane-backends 1.0.18, updated backends will follow soon. -- Julien BLACHE Mon, 3 Jul 2006 20:51:53 +0200 sane-backends-extras (1.0.17.3) unstable; urgency=low * debian/compat: + Bumped DH_COMPAT to 5. * debian/control: + Bumped Standards-Version to 3.7.2 (no changes). + Build-Depend on debhelper (>= 5.0.0) for DH_COMPAT=5. + New libsane-extras-dbg binary for debugging symbols. * debian/rules: + Tell dh_strip to put debugging symbols into libsane-extras-dbg. -- Julien BLACHE Fri, 26 May 2006 17:51:58 +0200 sane-backends-extras (1.0.17.2) unstable; urgency=low * debian/udev/libsane-extras.rules: + Fixed test, removed RUN rules. -- Julien BLACHE Sun, 16 Apr 2006 11:58:44 +0200 sane-backends-extras (1.0.17.1) unstable; urgency=low * Based on sane-backends 1.0.17. * Backends removed: + lexmark, hp4200, mustek_usb2; included in sane-backends 1.0.17. -- Julien BLACHE Sun, 18 Dec 2005 17:23:01 +0100 sane-backends-extras (1.0.16.9) unstable; urgency=low * libsane-extras.rules: + Explicitly call libsane.hotplug to make coldplugging work. * debian/libsane-extras.postrm: + Added; remove /etc/udev/rules.d/025_libsane-extras.rules on purge. -- Julien BLACHE Thu, 27 Oct 2005 20:53:24 +0200 sane-backends-extras (1.0.16.8) unstable; urgency=low * New backend: + mustek_usb2 (Mustek Bearpaw 2448 TA Pro) -- Julien BLACHE Sat, 1 Oct 2005 18:42:27 +0200 sane-backends-extras (1.0.16.7) unstable; urgency=low * The udev release. * debian/rules: + Install the udev rules file. * debian/libsane-extras.postinst: + Symlink the udev rules file under /etc/udev/rules.d; do that only once. -- Julien BLACHE Wed, 28 Sep 2005 22:51:02 +0200 sane-backends-extras (1.0.16.6) unstable; urgency=low * New backend: + lexmark * Updated backend: + epkowa -- Julien BLACHE Sun, 25 Sep 2005 15:09:35 +0200 sane-backends-extras (1.0.16.5) unstable; urgency=low * backend/Makefile.in: call install-becfg to actually install the backends config files. Thanks to Anderson Lizardo for noticing. -- Julien BLACHE Mon, 29 Aug 2005 13:26:41 +0200 sane-backends-extras (1.0.16.4) unstable; urgency=low * hp4200: + Pulled from SANE CVS; Henning Meier-Geinitz made some fixes and improvements. -- Julien BLACHE Sun, 28 Aug 2005 17:41:42 +0200 sane-backends-extras (1.0.16.3) unstable; urgency=low * epkowa: + Close the scanner fd when libesintXX.so fails to load. -- Julien BLACHE Sat, 13 Aug 2005 21:01:12 +0200 sane-backends-extras (1.0.16.2) unstable; urgency=low * The geniusvp2 backend went missing; fixed. -- Julien BLACHE Sun, 7 Aug 2005 19:18:50 +0200 sane-backends-extras (1.0.16.1) unstable; urgency=low * Based on sane-backends 1.0.16. * Backends removed: + sm3840; included in sane-backends 1.0.16. -- Julien BLACHE Sun, 7 Aug 2005 15:03:08 +0200 sane-backends-extras (1.0.15.11) unstable; urgency=low * Use the -V option of dpkg-gencontrol instead of building control from control.in * Added a build-dependency on libltdl3-dev (was in control but not in control.in). * Use DEB_HOST_ARCH_OS instead of DEB_HOST_GNU_SYSTEM. -- Aurelien Jarno Thu, 28 Jul 2005 19:04:10 +0200 sane-backends-extras (1.0.15.10) unstable; urgency=low * Updated backends: + epkowa (from iscan 1.15.0 -- support added for the Perfection 2480/2580 PHOTO) *** EPKOWA USERS: the location of the proprietary libraries for use with the epkowa backend has changed from /usr/lib to /usr/lib/epkowa *** * debian/control: + Bumped Standards-Version to 3.6.2 (no changes). -- Julien BLACHE Fri, 22 Jul 2005 21:01:25 +0200 sane-backends-extras (1.0.15.9) unstable; urgency=medium * Fixed the geniusvp2 backend to correctly release the parallel port when sane_geniusvp2_parport_open() fails. Thanks to Jochen Eisinger and Rainer Dorsch (closes: #300317, #300825). -- Julien BLACHE Sun, 3 Apr 2005 15:13:40 +0200 sane-backends-extras (1.0.15.8) unstable; urgency=low * New backend: epkowa (closes: #200265). + Extracted from iscan 1.13.1. * Updated backend: sm3840. + Adds support for the ScanMaker 4800. + Updated hotplug db accordingly. -- Julien BLACHE Thu, 24 Mar 2005 19:44:40 +0100 sane-backends-extras (1.0.15.7) unstable; urgency=low * Transition to the new SANE hotplug scripts. * debian/control: + Depends: libsane (>= 1.0.15-8). * Added support for GNU/kFreeBSD. -- Julien BLACHE Sun, 6 Mar 2005 19:26:44 +0100 sane-backends-extras (1.0.15.6) unstable; urgency=low * Co-maintainer upload. * Added a build-dependency on libtiff4-dev. -- Aurelien Jarno Tue, 22 Feb 2005 00:16:59 +0100 sane-backends-extras (1.0.15.5) unstable; urgency=low * backend/hp4200.c + Removed unused variables leftover from the previous patch. * debian/control + Depends: libsane (>= 1.0.15-7) due to the use of the new dll.d scheme. * Updated backends + sm3840; Updated from the SANE CVS (included in upcoming 1.0.16). + hp_rts88xx; Updated to version 0.18. * New backend + geniusvp2 v0.2 for Genius ColorPage-Vivid Pro II scanners. -- Julien BLACHE Mon, 21 Feb 2005 17:26:08 +0100 sane-backends-extras (1.0.15.4) unstable; urgency=low * hp4200 + Patched to read "usb 0xVVVV 0xPPPP" in its config file. The support for the scanner module is now unavailable in this backend (closes: #293263). -- Julien BLACHE Sat, 5 Feb 2005 19:31:34 +0100 sane-backends-extras (1.0.15.3) unstable; urgency=low * hp4200 + Ship a config file again. Probably got lost at some point when I upgraded the package to a new SANE release. *** If you're using the hp4200 backend, please contact me *** -- Julien BLACHE Tue, 18 Jan 2005 23:26:30 +0100 sane-backends-extras (1.0.15.2) unstable; urgency=low * Backend added: + sm3840 * Added hotplug usermap for the supported scanners. -- Julien BLACHE Mon, 17 Jan 2005 12:29:44 +0100 sane-backends-extras (1.0.15.1) unstable; urgency=low * Based on sane-backends 1.0.15. * Backends removed: + niash; merged into sane-backends. -- Julien BLACHE Tue, 9 Nov 2004 23:44:53 +0100 sane-backends-extras (1.0.14.2) unstable; urgency=low * Make the hp_rts88x backend use libusb instead of the scanner module. + libusb is the preferred access method for USB scanners now, if you still rely on the scanner module, see /usr/share/doc/libsane/README.Debian.gz for instructions about setting up libusb (closes: #250778). -- Julien BLACHE Tue, 25 May 2004 19:01:05 +0200 sane-backends-extras (1.0.14.1) unstable; urgency=low * Based on sane-backends 1.0.14. * Backends updated: + hp_rts88x v0.17g + niash v20031221_1 -- Julien BLACHE Sat, 1 May 2004 17:12:10 +0200 sane-backends-extras (1.0.13.1) unstable; urgency=low * Based on sane-backends 1.0.13. * Added rts88xx backend. * debian/compat, debian/rules: + Moved to DH_COMPAT 4. + Moved from dh_movefiles to dh_install. -- Julien BLACHE Mon, 24 Nov 2003 19:10:26 +0100 sane-backends-extras (1.0.12.2) unstable; urgency=low * Do not link sanei_config2 in the niash backend. * Link sanei_scsi in the hp4200 backend. * Do not run configure twice. * Do not perform unneeded compiler checks (libtool, etc...). -- Julien BLACHE Wed, 4 Jun 2003 17:19:35 +0200 sane-backends-extras (1.0.12.1) unstable; urgency=low * Based on sane-backends 1.0.12. * Updated backends : * niash 20030401_1 * Removed backends : * hp5400 : part of sane-backends 1.0.12. * Bumped Standards-Version to 3.5.10. -- Julien BLACHE Sun, 25 May 2003 21:54:50 +0200 sane-backends-extras (1.0.10.4) unstable; urgency=medium * Do not configure with --with-gphoto2. -- Julien BLACHE Sun, 4 May 2003 14:31:53 +0200 sane-backends-extras (1.0.10.3) unstable; urgency=low * Added hp5400 backend, CVS as of 20030407 (closes: #187968). * Bumped Standards-Version to 3.5.9. * Updated libsane-extras-dev section to libdevel. -- Julien BLACHE Mon, 7 Apr 2003 21:04:48 +0200 sane-backends-extras (1.0.10.2) unstable; urgency=low * hp4200 : * link sanei_usb (closes: #181770) * link sanei_pv8630 -- Julien BLACHE Thu, 20 Feb 2003 18:11:22 +0100 sane-backends-extras (1.0.10.1) unstable; urgency=low * Based on sane-backends 1.0.10. * Updated backends : * hp4200 : patches by Frank Zago, see copyright. * Removed backends : * gt68xx * tevion9693usb (now named artec_eplus48u) => They are now included in libsane. * Bumped Standards-Version to 3.5.8. -- Julien BLACHE Sun, 2 Feb 2003 12:24:52 +0100 sane-backends-extras (1.0.9.3) unstable; urgency=low * Updated backends : * gt68xx : 1.0-35 -- Julien BLACHE Tue, 24 Dec 2002 17:12:01 +0100 sane-backends-extras (1.0.9.2) unstable; urgency=low * Updated backends : * gt68xx : 1.0-31 * tevion9693usb : 0.0.11 * niash : 20021120 * Changed Uploaders: field so that Aurélien's uploads won't be tagged as NMU again. * Do not create libsane-extras.conffiles at build time, this is handled by dh_installdeb. -- Julien BLACHE Sun, 1 Dec 2002 12:11:12 +0100 sane-backends-extras (1.0.9.1) unstable; urgency=low * Based on sane-backends 1.0.9. * Updated backends : * niash backend v20021015_1 * tevion9693usb v0.0.10 * gt68xx v1.0-26 * Fixed typo in backend/Makefile.in wrt niash backend (closes: #166236). * Fixed packages descriptions (wrt #165138). * Added a README.Debian, indicating how to get a new backend included. -- Julien BLACHE Thu, 24 Oct 2002 22:40:12 +0200 sane-backends-extras (1.0.8.2) unstable; urgency=low * Fixed gt68xx search path for firmwares. * Create PATH_SANE_DATA_DIR/gt68xx for gt68xx firmwares. -- Julien BLACHE Sun, 13 Oct 2002 15:31:06 +0200 sane-backends-extras (1.0.8.1) unstable; urgency=low * New source package. * Includes the following backends : * hp4200 (v0.2p1) * gt68xx (v1.0-24) * niash (v20020217) (closes: #160327) * tevion9693 (v0.0.9) -- Julien BLACHE Sun, 13 Oct 2002 10:28:29 +0200 sane-backends-extras-1.0.22.3ubuntu1/debian/libsane-extras-dev.install0000664000000000000000000000007511600674450022467 0ustar debian/tmp/usr/lib/*/sane/*.a debian/tmp/usr/lib/*/sane/*.so sane-backends-extras-1.0.22.3ubuntu1/debian/libsane-extras.preinst0000664000000000000000000000303011200277214021714 0ustar #!/bin/sh set -e # From http://wiki.debian.org/DpkgConffileHandling # Remove a no-longer used conffile rm_conffile() { PKGNAME="$1" CONFFILE="$2" if [ -e "$CONFFILE" ]; then md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`" old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE '{s/ obsolete$//;s/.* //p}\"`" if [ "$md5sum" != "$old_md5sum" ]; then echo "Obsolete conffile $CONFFILE has been modified by you." echo "Saving as $CONFFILE.dpkg-bak ..." mv -f "$CONFFILE" "$CONFFILE".dpkg-bak else echo "Removing obsolete conffile $CONFFILE ..." rm -f "$CONFFILE" fi fi } ## Transition from the old-style udev setup to the old-style dh_installudev setup ## Then dh_installudev will take care of the transition to the new dh_installudev setup if [ "$1" = install ] || [ "$1" = upgrade ]; then if [ -e "/etc/udev/rules.d/025_libsane-extras.rules" ]; then mv /etc/udev/rules.d/025_libsane-extras.rules /etc/udev/rules.d/z60_libsane-extras.rules fi ## Remove obsolete /etc/sane.d/epkowa.conf conffile if dpkg --compare-versions "$2" le "1.0.19.14"; then ## iscan not installed if ! dpkg-query -W -f '${Status}\n' iscan > /dev/null 2>&1; then rm_conffile libsane-extras /etc/sane.d/epkowa.conf fi fi ## Remove obsolete /etc/sane.d/hp_rts88xx.conf if dpkg --compare-versions "$2" le "1.0.19.16"; then rm_conffile libsane-extras /etc/sane.d/hp_rts88xx.conf fi fi #DEBHELPER# sane-backends-extras-1.0.22.3ubuntu1/debian/control0000664000000000000000000000777612272267640017031 0ustar Source: sane-backends-extras Section: graphics Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Debian QA Group Standards-Version: 3.9.2 Build-Depends: debhelper (>= 9~), libusb-1.0-0-dev [!hurd-i386], pkg-config, dh-autoreconf, xutils-dev, chrpath Package: libsane-extras-common Section: libs Architecture: any Multi-Arch: foreign Depends: ${misc:Depends} Replaces: libsane-extras (<< 1.0.22.2~) Description: API library for scanners -- documentation and support files SANE stands for "Scanner Access Now Easy" and is an application programming interface (API) that provides standardized access to any raster image scanner hardware (flatbed scanner, hand-held scanner, video- and still-cameras, frame-grabbers, etc.). The SANE standard is free and its discussion and development are open to everybody. The current source code is written to support several operating systems, including GNU/Linux, OS/2, Win32 and various Unices and is available under the GNU General Public License (commercial applications and backends are welcome, too, however). . This package includes documentation for libsane-extras, such as the man pages and other support files. Package: libsane-extras Section: libs Architecture: any Multi-Arch: same Pre-Depends: ${misc:Pre-Depends} Depends: ${shlibs:Depends}, ${misc:Depends}, libsane-extras-common (= ${binary:Version}) Description: API library for scanners -- extra backends SANE stands for "Scanner Access Now Easy" and is an application programming interface (API) that provides standardized access to any raster image scanner hardware (flatbed scanner, hand-held scanner, video- and still-cameras, frame-grabbers, etc.). The SANE standard is free and its discussion and development are open to everybody. The current source code is written to support several operating systems, including GNU/Linux, OS/2, Win32 and various Unices and is available under the GNU General Public License (commercial applications and backends are welcome, too, however). . This package includes some backends that are not yet included into the official SANE distribution. Currently, they are : * geniusvp2 (Genius ColorPage-Vivid Pro II) * ls5000 (Nikon LS-5000 ED, Coolscan 5000 ED) Package: libsane-extras-dev Section: libdevel Architecture: any Depends: libsane-extras (= ${binary:Version}), , ${misc:Depends} Description: API development library for scanners [development files] SANE stands for "Scanner Access Now Easy" and is an application programming interface (API) that provides standardized access to any raster image scanner hardware (flatbed scanner, hand-held scanner, video- and still-cameras, frame-grabbers, etc.). The SANE standard is free and its discussion and development are open to everybody. The current source code is written to support several operating systems, including GNU/Linux, OS/2, Win32 and various Unices and is available under the GNU General Public License (commercial applications and backends are welcome, too, however). . This package contains the development files relative to the extra backends provided by libsane-extras. Package: libsane-extras-dbg Section: debug Priority: extra Architecture: any Depends: libsane-extras (= ${binary:Version}), , ${misc:Depends} Description: API library for scanners -- extra backends [debug symbols] SANE stands for "Scanner Access Now Easy" and is an application programming interface (API) that provides standardized access to any raster image scanner hardware (flatbed scanner, hand-held scanner, video- and still-cameras, frame-grabbers, etc.). The SANE standard is free and its discussion and development are open to everybody. The current source code is written to support several operating systems, including GNU/Linux, OS/2, Win32 and various Unices and is available under the GNU General Public License (commercial applications and backends are welcome, too, however). . This package contains the debugging symbols for the extras SANE backends. sane-backends-extras-1.0.22.3ubuntu1/debian/source/0000775000000000000000000000000011366520655016706 5ustar sane-backends-extras-1.0.22.3ubuntu1/debian/source/format0000664000000000000000000000001511366520655020115 0ustar 3.0 (native) sane-backends-extras-1.0.22.3ubuntu1/debian/libsane-extras.NEWS0000664000000000000000000000202711246237304021017 0ustar sane-backends-extras (1.0.20.1) unstable; urgency=low Starting with this release, the hp_rts88xx backend for the HP ScanJet 4400C and 4470C is no longer distributed in sane-backends-extras. It is superseded by the rts8891 backend from sane-backends 1.0.20. -- Julien BLACHE Wed, 6 May 2009 14:17:23 +0200 sane-backends-extras (1.0.19.12) unstable; urgency=low Starting with sane-backends-extras 1.0.19.12, the epkowa backend for EPSON scanners is no longer provided. It was no longer possible to satisfactorily support this backend inside Debian after the iScan! 2.10.0 release, due to a number of issues that could not be resolved or otherwise settled. Users relying on this backend should now use the Debian packages provided by Avasys/EPSON for i386 and amd64, available at (switch to english, follow the Linux driver link or search for Linux driver, follow the scanner link then fill out the form). -- Julien BLACHE Sat, 14 Feb 2009 16:46:14 +0100 sane-backends-extras-1.0.22.3ubuntu1/debian/compat0000664000000000000000000000000212144252330016567 0ustar 9 sane-backends-extras-1.0.22.3ubuntu1/debian/libsane-extras.README.Debian0000664000000000000000000000256311200300063022345 0ustar README for libsane-extras ------------------------- The libsane-extras package provides some SANE backends not yet included in the regular SANE distribution. Backends currently included in libsane-extras : * geniusvp2 * ls5000 For an history of this package, see changelog.Debian.gz. => How to use the backends: --------------------------- The backends are automatically enabled when libsane-extras is installed. See the libsane-extras file in /etc/sane.d/dll.d to enable or disable the backends provided by this package. This file is similar to SANE's dll.conf file. Edit the backend's configuration file, located in /etc/sane.d/, and named after the backend. => How to get a backend included in this package? ------------------------------------------------- File a bug with severity "wishlist" against the libsane-extras package, in the Debian Bug Tracking System (BTS). See http://bugs.debian.org for more information on how to file a bug. Include a short description of the backend in your bug report, along with a URL where more information can be found, and the place where the backend can be downloaded. If all goes well, a new revision of the package will be rolled out a few days later, including this new backend. For any questions or suggestions, feel free to contact me. -- Julien BLACHE , Wed, 6 May 2009 14:08:12 +0200 sane-backends-extras-1.0.22.3ubuntu1/debian/rules0000775000000000000000000000262412272267545016475 0ustar #!/usr/bin/make -f DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) ifeq ($(DEB_HOST_ARCH_OS),) DEB_HOST_ARCH_OS := $(subst -gnu,,$(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM)) ifeq ($(DEB_HOST_ARCH_OS),gnu) DEB_HOST_ARCH_OS := hurd endif endif %: dh $@ --with=autoreconf override_dh_auto_configure: dh_auto_configure -- \ --with-snmp=no \ --disable-locking \ --enable-static \ --enable-pthread \ --enable-libusb=yes \ --enable-libusb_1_0 \ --without-gphoto2 # udev file is currently not useful but leave as an example override_dh_installudev: # not really needed, but it thinks otherwise override_dh_makeshlibs: override_dh_install: dh_install ifeq (kfreebsd,$(DEB_HOST_ARCH_OS)) rm -f debian/libsane-extras-common/usr/share/man/man5/sane-geniusvp2.5 rm -rf debian/libsane-extras-common/usr/share/doc/libsane-extras/geniusvp2 endif # remove wrong libsane.so.1 symlink rm -f debian/libsane-extras/usr/lib/$(DEB_HOST_MULTIARCH)/sane/libsane.so.1 # remove damn rpath find debian/libsane-extras/usr/lib/$(DEB_HOST_MULTIARCH)/sane -name "libsane-*.so.1" -exec chrpath -d {} \; # install the dll.d config file install -d debian/libsane-extras/etc/sane.d/dll.d cp debian/dll.d/libsane-extras debian/libsane-extras/etc/sane.d/dll.d override_dh_strip-arch: dh_strip --dbg-package=libsane-extras-dbg sane-backends-extras-1.0.22.3ubuntu1/debian/libsane-extras.fdi0000664000000000000000000000024311200277013020772 0ustar sane-backends-extras-1.0.22.3ubuntu1/AUTHORS0000664000000000000000000002220311514441550015222 0ustar Authors of the SANE standard: Andreas Beck and David Mosberger Java API: Jeff Freedman Backends: abaton: David Huggins-Daines agfafocus: Karl Anders Øygard apple: Milon Firikis artec: Chris Pinkham artec_eplus48u:Sergey Vlasov, Andreas Nowack, David Stevenson, and Michael Herder as6e: Eugene S. Weiss (*) avision: Meino Christian Cramer, Rene Rebe (*) bh: Tom Martone canon: Helmut Koeberle, Manuel Panea, and Markus Mertinat Mitsuru Okaniwa, Ulrich Deiters (*) canon630u: Nathan Rutman (*) canon_dr: m. allan noah (*) canon_pp: Matthew Duggan (*), Simon Krix coolscan: Didier Carlier, Andreas Rick cardscan: m. allan noah (*) coolscan2: Andras Major (*) coolscan3: Alessandro Zummo (*) dc25: Peter Fales (*) dc210: Brian J. Murrell dc240: Peter Fales (*) dell1600n_net: Jon Chambers (*) dll: David Mosberger dmc: David F. Skoll epjitsu: m. allan noah (*) epson: Karl Heinz Kremer (*) epson2: Alessandro Zummo (*) fujitsu: Randolph Bentson, Frederik Ramm, Oliver Schirrmeister (*), m. allan noah (*) gphoto2: Peter Fales (*) genesys: Henning Geinitz (*), Gerhard Jaeger (*), Stéphane Voltz (*), Pierre Willenbrock (*) gt68xx: Sergey Vlasov, Andreas Nowack, David Stevenson, and Henning Geinitz (*) hp: Peter Kirchgessner (*) Geoffrey Dairiki hpsj5s: Max Vorobiev hp3500: Troy Rollo (*) hp3900: Jonathan Bravo Lopez (*) hp4200: Adrian Perez Jorge, Andrew John Lewis, Arnar Mar Hrafnkelsson, Frank Zago, Henning Geinitz (*) hp5400: Martijn van Oosterhout, Thomas Soumarmon (*) hp5590: Ilia Sotnikov (*) hpljm1005: Philippe Rétornaz hs2p: Jeremy Johnson ibm: M.F., Henning Geinitz (*) leo: Frank Zago (*) lexmark: Fred Odendaal, Stéphane Voltz (*) ma1509: Henning Geinitz (*) magicolor: Reinhold Kainhofer (based on epson2 backend) matsushita: Frank Zago (*) microtek: Matthew Marjanovic (*) microtek2: Bernd Schroeder, Karsten Festag mustek: Andreas Bolsch, David Mosberger, Andreas Czechanowski, Henning Geinitz (*), and James Perry. mustek_pp: Jochen Eisinger (*), Eddy De Greef (*) mustek_usb: Tom Wang and Henning Geinitz (*) mustek_usb2: Roy Zhou, Jack Xu, Vinci Cen, and Henning Geinitz (*) nec: Kazuya Fukuda (*) net: Andreas Beck, David Mosberger, Julien Blache (*) niash: Ullrich Sigwanz (*), Bertrik Sikken p5: Stéphane Voltz (*) pie: Simon Munton (*) pint: Gordon Matzigkeit pixma: Wittawat Yamwong (*) Nicolas Martin (*) Louis Lagendijk (*) Dennis Lou plustek: Gerhard Jaeger (*) plustek_pp: Rick Bronson (former pp driver-code), Gerhard Jaeger (*) pnm: Andreas Beck, Gordon Matzigkeit, David Mosberger, Michael Herder, and Henning Geinitz (*) qcam: Scott Laird (original driver), David Mosberger (SANE backend), despeckling filter by Patrick Reynolds, B&W fixes by Andrew Kuchling ricoh: Feico W. Dillema rts8891: Stéphane Voltz (*) s9036: Ingo Schneider sceptre: Frank Zago (*) sharp: Kazuya Fukuda (*) and Abel Deuring (*) sm3600: Marian Eichholz (*) and Glenn Ramsey sm3840: Earle F. Philhower III (*) snapscan: Kevin Charter, Franck Schneider, Michel Roelofs, Sebastien Sable, Henrik Johansson, Chris Bagwell, and Oliver Schwartz (*) sp15c: Randolph Bentson st400: Ingo Wilken stv680: Gerard Klaver (*) tamarack: Rogier Wolff teco1: Frank Zago (*) teco2: Frank Zago, Gerard Klaver (*) teco3: Frank Zago (*) test: Henning Geinitz (*) u12: Gerhard Jaeger (*) umax: Oliver Rauch (*) and Michael K. Johnson umax_pp: Stéphane Voltz (*) umax1220u: Marcio L. Teixeira, Patrick Lessard v4l: Juergen G. Schimmer, and Henning Geinitz (*) xerox_mfp: Alex Belkin (*) Frontends: jscanimage: Jeff Freedman and Guido Muesch saned: Andreas Beck, David Mosberger, Julien Blache (*) scanimage: Andreas Beck, David Mosberger, Gordon Matzigkeit, m. allan noah (*), Julien Blache (*), Stéphane Voltz (*) tstbackend: Frank Zago (*) Sanei internal code: Adrian Perez Jorge, Andreas Beck, Andreas Czechanowski, Christian Bucher, David Mosberger-Tang, Frank Zago (*), Henning Geinitz (*), Jeff Freedman, Jochen Eisinger (*), Marcio Teixeira, Yuri Dario, Gerhard Jaeger (*), m. allan noah (*) Miscellaneous coding: Julien Blache (*), Mattias Ellert (*), Petter Reinholdtsen (*), Chris Bagwell (*) Translators: Giuseppe Sacco (*) (*) Maintainer with CVS write access Please also read the file PROJECTS for projects that are planned or not yet included into the SANE distribution. Email addresses: Abel Deuring Alessandro Zummo Alex Belkin Andras Major Andreas Beck Andreas Bolsch Andreas Czechanowski Andreas Nowack Andreas Rick Andrew Kuchling Bernd Schroeder Bertrik Sikken Brian J. Murrell Chris Bagwell Chris Pinkham Christian Bucher David Etherton David F. Skoll David Huggins-Daines David Mosberger David Stevenson Didier Carlier Earle F. Philhower III Eddy De Greef Eugene S. Weiss Feico W. Dillema Franck Schneider Frank Zago Fred Odendaal Frederik Ramm Gerard Klaver Gerhard Jaeger Giuseppe Sacco Glenn Ramsey Gordon Matzigkeit Guido Muesch Helmut Koeberle Henning Geinitz Henrik Johansson Ilia Sotnikov Ingo Schneider Ingo Wilken James Perry Jeff Freedman Jochen Eisinger Jon Chambers Jonathan Bravo Lopez Juergen G. Schimmer Julien Blache Karl Anders Øygard Karl Heinz Kremer Karsten Festag Kazuhiro Sasayama Kazuya Fukuda Kevin Charter Louis Lagendijk M.F. Manuel Panea Marcio Teixeira Marian Eichholz Markus Mertinat Martijn van Oosterhout Matthew Duggan Matthew Marjanovic Mattias Ellert Max Vorobiev Meino Christian Cramer Michael Herder Michael K. Johnson Michel Roelofs Milon Firikis Mitsuru Okaniwa Nathan Rutman Nicolas Martin Oliver Rauch Oliver Schirrmeister Oliver Schwartz Patrick Lessard Patrick Reynolds Peter Fales Peter Kirchgessner Petter Reinholdtsen Pierre Willenbrock Randolph Bentson Reinhold Kainhofer Rene Rebe Roger Wolff Roy Zhou Sebastien Sable Sergey Vlasov Simon Krix Simon Munton Stéphane Voltz Thomas Soumarmon Tom Martone Tom Wang Tristan Tarrant Troy Rollo Ullrich Sigwanz Ulrich Deiters Wittawat Yamwong m. allan noah sane-backends-extras-1.0.22.3ubuntu1/configure.in0000664000000000000000000006425211527266506016507 0ustar dnl Process this file with autoconf to produce a configure script. -*-m4-*- dnl *********************************************************************** dnl When preparing a release, increase the numeric and string version numbers, dnl remove the "cvs" suffix, and set is_release=yes AC_INIT([sane-backends],[1.0.22],[sane-devel@lists.alioth.debian.org]) V_MAJOR=1 V_MINOR=0 V_REV=22 is_release=yes dnl *********************************************************************** m4_ifdef([AC_CONFIG_MACRO_DIR], [AC_CONFIG_MACRO_DIR([m4])]) AM_INIT_AUTOMAKE dnl Turn off feature were automake will automatically run autoreconf. dnl This is because we check in generated files into CVS which has dnl known timestamp issues. AM_MAINTAINER_MODE AC_CONFIG_HEADERS([include/sane/config.h]) AC_PREREQ(2.54) dnl Minimum Autoconf version required. PACKAGE=AC_PACKAGE_NAME VERSION=AC_PACKAGE_VERSION NUMBER_VERSION=${V_MAJOR}.${V_MINOR}.${V_REV} AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define to the name of the distribution.]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Define to the version of the distribution.]) AC_DEFINE_UNQUOTED(SANE_DLL_V_MAJOR, $V_MAJOR, [SANE DLL major number]) AC_DEFINE_UNQUOTED(SANE_DLL_V_MINOR, $V_MINOR, [SANE DLL minor number]) AC_DEFINE_UNQUOTED(SANE_DLL_V_BUILD, $V_REV, [SANE DLL revision number]) AC_SUBST(V_MAJOR) AC_SUBST(V_MINOR) AC_SUBST(V_REV) AC_SUBST(PACKAGE) AC_SUBST(VERSION) AC_SUBST(NUMBER_VERSION) AC_CANONICAL_BUILD AC_CANONICAL_HOST dnl no bloody way to have a decent --docdir... AC_ARG_WITH(docdir, AC_HELP_STRING([--with-docdir=DIR], [documentation @<:@PREFIX/doc/sane-VERSION@:>@]), [ docdir="${withval}" AC_SUBST([docdir])dnl ], [ AC_SUBST([docdir], ['${prefix}/doc/sane-${VERSION}'])dnl ]) dnl *********************************************************************** dnl Checks for programs. dnl *********************************************************************** AC_PROG_CC AM_PROG_CC_C_O AC_PROG_INSTALL AC_PROG_MAKE_SET AC_PROG_CPP AC_PROG_GCC_TRADITIONAL AC_PATH_PROG(SANE_CONFIG_PATH, sane-config, no) AC_PATH_PROG(MSGFMT, msgfmt$EXEEXT, no) AC_PATH_PROG(XGETTEXT, xgettext$EXEEXT, no) AC_PATH_PROG(MSGMERGE, msgmerge$EXEEXT, no) AC_PATH_PROG(LATEX, latex$EXEEXT, no) AC_PATH_PROG(DVIPS, dvips$EXEEXT, no) AC_PATH_PROG(MAKEINDEX, makeindex$EXEEXT, no) AC_SUBST(MSGFMT) AC_SUBST(XGETTEXT) AC_SUBST(MSGMERGE) AC_SUBST(LATEX) AC_SUBST(DVIPS) AC_SUBST(MAKEINDEX) dnl Call explicitely before using PKG_* PKG_PROG_PKG_CONFIG AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes) dnl *********************************************************************** dnl set compiler/linker flags dnl *********************************************************************** INCLUDES="${INCLUDES} -I/usr/local/include" AC_SUBST(INCLUDES) SANE_SET_CFLAGS([$is_release]) SANE_SET_LDFLAGS dnl SANE_LINKER_RPATH dnl *********************************************************************** dnl Checks for unix variants dnl *********************************************************************** m4_ifdef([AC_USE_SYSTEM_EXTENSIONS], [AC_USE_SYSTEM_EXTENSIONS]) m4_ifndef([AC_USE_SYSTEM_EXTENSIONS],[AC_GNU_SOURCE]) m4_ifndef([AC_USE_SYSTEM_EXTENSIONS],[AC_AIX]) m4_ifndef([AC_USE_SYSTEM_EXTENSIONS],[AC_MINIX]) AC_ISC_POSIX AC_NEED_BYTEORDER_H([include/byteorder.h]) AX_CREATE_STDINT_H([include/_stdint.h]) dnl *********************************************************************** dnl Checks for libraries dnl *********************************************************************** SANE_CHECK_DLL_LIB dnl Checks for Backend libraries. AC_CHECK_LIB(m, sqrt, MATH_LIB="-lm") AC_SUBST(MATH_LIB) case ${host_os} in os2*) AC_CHECK_LIB(syslog, sylog, SYSLOG_LIBS="-lsyslog") ;; beos*) AC_CHECK_LIB(be, syslog, SYSLOG_LIBS="-lbe") ;; esac AC_SUBST(SYSLOG_LIBS) SANE_CHECK_JPEG SANE_CHECK_TIFF SANE_CHECK_IEEE1284 SANE_CHECK_PTHREAD SANE_CHECK_LOCKING SANE_CHECK_GPHOTO2 PKG_CHECK_MODULES(LIBV4L, libv4l1, have_libv4l1=yes, have_libv4l1=no) AC_SUBST(LIBV4L_LIBS) AC_SUBST(LIBV4L_CFLAGS) AC_ARG_ENABLE(avahi, AC_HELP_STRING([--enable-avahi], [enable Avahi support for saned and the net backend]), [enable_avahi=$enableval], [enable_avahi=no]) if test "$enable_avahi" = "yes"; then PKG_CHECK_MODULES(AVAHI, [ avahi-client >= 0.6.24 ], [AC_DEFINE(WITH_AVAHI, 1, [define if Avahi support is enabled for saned and the net backend])], enable_avahi=no) fi dnl check sane to make sure we don't have two installations AC_CHECK_LIB(sane, sane_init, LIBSANE_EXISTS="yes") dnl ************************************************************** dnl SNMP CHECKS dnl ************************************************************** AC_ARG_WITH(snmp, AC_HELP_STRING([--with-snmp], [enable SNMP support @<:@default=yes@:>@])) if test "$with_snmp" = "no"; then echo "Not including SNMP support" else AC_PATH_PROG(SNMP_CONFIG_PATH, net-snmp-config, "no") AC_CHECK_LIB([netsnmp], [snmp_timeout], LIBSNMP_EXISTS="yes") AC_MSG_CHECKING(for proper SNMP version) if test "$SNMP_CONFIG_PATH" != "no" ; then snmp_version=`$SNMP_CONFIG_PATH --version 2>/dev/null` vers=`echo $snmp_version | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2);}'` if test -n "$vers" && test "$vers" -ge 5006; then SNMP_LIBS=`$SNMP_CONFIG_PATH --libs` SNMP_CFLAGS=`$SNMP_CONFIG_PATH --cflags` AC_MSG_RESULT(yes) with_snmp="yes" else AC_MSG_RESULT(no) AC_MSG_WARN([You need at least net-snmp 5.6, your version is $snmp_version]) with_snmp="no" fi else with_snmp="no" AC_MSG_RESULT(no) fi fi if test "$with_snmp" = "yes"; then LIBS="$LIBS $SNMP_LIBS" CFLAGS="$CFLAGS $SNMP_CFLAGS" AC_DEFINE(HAVE_LIBSNMP, 1, [Define to 1 if you have the net-snmp library.]) else AC_MSG_WARN([*** Warning: net-snmp library disabled, autodetecting network scanners will not be supported.]) fi dnl *********************************************************************** dnl Checks for header files. dnl *********************************************************************** AC_HEADER_STDC AC_CHECK_HEADERS(fcntl.h unistd.h libc.h sys/dsreq.h sys/select.h \ sys/time.h sys/shm.h sys/ipc.h sys/signal.h sys/scanio.h os2.h \ sys/socket.h sys/io.h sys/hw.h sys/types.h linux/ppdev.h \ dev/ppbus/ppi.h machine/cpufunc.h sys/bitypes.h sys/sem.h sys/poll.h \ windows.h be/kernel/OS.h limits.h sys/ioctl.h asm/types.h\ netinet/in.h tiffio.h ifaddrs.h pwd.h getopt.h) AC_CHECK_HEADERS([asm/io.h],,,[#include ]) SANE_CHECK_MISSING_HEADERS AC_CHECK_HEADER(resmgr.h,[ AC_CHECK_LIB( resmgr, rsm_open_device,[ AC_DEFINE(HAVE_RESMGR,1,[define if you have the resmgr library]) RESMGR_LIBS="-lresmgr" ] ) ]) AC_SUBST(RESMGR_LIBS) dnl *********************************************************************** dnl Checks for types and structures dnl *********************************************************************** AC_TYPE_SIGNAL AC_TYPE_SIZE_T AC_TYPE_PID_T AC_CHECK_TYPE(ssize_t, long) SANE_CHECK_U_TYPES # from Python, check for "long long" type AC_MSG_CHECKING(for long long support) have_long_long=no AC_TRY_COMPILE([], [long long x; x = (long long)0;], AC_DEFINE(HAVE_LONG_LONG, 1, [Define if the long long type is available.]) have_long_long=yes) AC_MSG_RESULT($have_long_long) AC_MSG_CHECKING([for socklen_t in ]) AC_TRY_COMPILE([ #include ],[socklen_t len],AC_MSG_RESULT(yes), [AC_MSG_RESULT(no); AC_DEFINE(socklen_t,int, [Define socklen_t as \'int\' if necessary.])]) AC_MSG_CHECKING([for union semun in ]) AC_TRY_COMPILE([ #include #include #include ],[union semun test_semun],[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_UNION_SEMUN,1,[Define if union semun is available.])], AC_MSG_RESULT(no)) AC_MSG_CHECKING([for struct flock in fcntl.h]) AC_EGREP_HEADER([struct flock], fcntl.h, [AC_MSG_RESULT(yes) ; AC_DEFINE(HAVE_STRUCT_FLOCK, 1, [Define if struct flock is available.])], AC_MSG_RESULT(no)) AC_MSG_CHECKING([for Linux ioctl defines]) AC_TRY_COMPILE([ #include #include ],[ __u32 houba = _IOR('v',14, unsigned long); ],[AC_MSG_RESULT(yes); have_linux_ioctl_defines="yes";],AC_MSG_RESULT(no)) dnl *********************************************************************** dnl Checks for compiler characteristics dnl *********************************************************************** AC_C_BIGENDIAN AC_C_CONST AC_C_INLINE dnl *********************************************************************** dnl Checks for library functions dnl *********************************************************************** dnl Define SOCKET_LIB, NSL_LIB, BIND_LIB, and RESOLV_LIB when required dnl for functions we use. AC_CHECK_FUNC(gethostbyaddr,, [AC_CHECK_LIB(bind, gethostbyaddr, BIND_LIB="-lbind")]) AC_CHECK_FUNC(gethostbyaddr,, [AC_CHECK_LIB(nsl, gethostbyaddr, NSL_LIB="-lnsl")]) AC_CHECK_FUNC(socket, [SOCKET_LIBS=], [AC_CHECK_LIB(socket, socket, SOCKET_LIB="-lsocket")]) AC_CHECK_FUNC(inet_aton,, [AC_CHECK_LIB(resolv, inet_aton, RESOLV_LIB="-lresolv")]) dnl Group related network libraries together so they can always be linked dnl in. SOCKET_LIBS="$SOCKET_LIB $NSL_LIB $BIND_LIB $RESOLV_LIB" AC_SUBST(SOCKET_LIBS) dnl define HAVE_* values for network functions. This may require dnl SOCKET_LIBS so set LIBS temporarily. save_LIBS="$LIBS" LIBS="$LIBS $SOCKET_LIBS" AC_CHECK_FUNCS(inet_addr inet_aton inet_ntoa) AC_REPLACE_FUNCS(inet_ntop inet_pton) LIBS="$save_LIBS" if test "$ac_cv_header_be_kernel_OS_h" = "yes" ; then dnl those are known to be broken in BeOS (BONE) ac_cv_func_getaddrinfo=no ac_cv_func_getnameinfo=no fi AC_FUNC_ALLOCA AC_FUNC_MMAP AC_CHECK_FUNCS(atexit ioperm i386_set_ioperm \ mkdir strftime strstr strtod \ cfmakeraw tcsendbreak strcasecmp strncasecmp _portaccess \ getaddrinfo getnameinfo poll setitimer iopl ) AC_REPLACE_FUNCS(getenv isfdtype sigprocmask snprintf \ strcasestr strdup strndup strsep usleep vsyslog) SANE_PROTOTYPES if test "$ac_cv_header_os2_h" = "yes" ; then AC_DEFINE(strncasecmp, strnicmp, [Define for OS/2 only]) AC_DEFINE(strcasecmp, stricmp, [Define for OS/2 only]) fi if test "$ac_cv_header_getopt_h" = "yes" ; then AC_CHECK_FUNCS(getopt_long) fi dnl *********************************************************************** dnl checks for system services dnl *********************************************************************** if test -c /dev/urandom ; then AC_DEFINE(HAVE_DEV_URANDOM, 1, [Is /dev/urandom available?]) fi dnl *********** dnl USB Support dnl *********** dnl Enable libusb-1.0, if available AC_ARG_ENABLE(libusb_1_0, AC_HELP_STRING([--enable-libusb_1_0], [enable libusb-1.0 support if available]), [enable_libusb_1_0=$enableval], [enable_libusb_1_0=no]) dnl USB support enabled by default (if found). Note: Overloading libusb dnl option right now to disable USB support on any platform; even dnl if they use a different library name. AC_ARG_ENABLE(libusb, AC_HELP_STRING([--disable-libusb], [disable support for USB in SANE]),, enable_libusb=auto) HAVE_USB=no if test "$enable_libusb" != "no"; then case ${host_os} in beos*) AC_CHECK_HEADERS(be/drivers/USB_scanner.h, HAVE_USB=yes, AC_MSG_ERROR([USB_scanner.h is required on BeOS])) ;; os2*) AC_CHECK_HEADER(usbcalls.h, AC_CHECK_LIB(usbcall, UsbQueryNumberDevices, [USB_LIBS="$USB_LIBS -lusbcall" HAVE_USB=yes]),,[#include #include ]) ;; *) dnl If libusb-1.0 is enabled and available, prefer that to the old libusb have_libusb_1_0=no if test "$enable_libusb_1_0" = "yes"; then PKG_CHECK_MODULES(LIBUSB_1_0, [ libusb-1.0 >= 1.0.0 ], have_libusb_1_0=yes, have_libusb_1_0=no) if test "$have_libusb_1_0" = "yes"; then CFLAGS="$CFLAGS $LIBUSB_1_0_CFLAGS" USB_LIBS="$USB_LIBS $LIBUSB_1_0_LIBS" HAVE_USB=yes fi fi if test "$have_libusb_1_0" = "no"; then dnl Fallback to the old libusb dnl libusb >= 0.1.8 is required, as we need usb_interrupt_read() AC_CHECK_HEADER(usb.h, AC_CHECK_LIB(usb, usb_interrupt_read, [USB_LIBS="$USB_LIBS -lusb" HAVE_USB=yes])) fi ;; esac fi dnl The following logic is useful for distributions. If they force dnl USB support with --enable-libusb=yes then configure will fail dnl when its detected that it can not be supported. Default is dnl "auto" which means only enable if libraries are found and do dnl not error out. if test "$enable_libusb" = "yes" && test "$HAVE_USB" = "no"; then AC_MSG_ERROR([USB support requested but required libraries not found.]) fi if test "$HAVE_USB" = "yes"; then case ${host_os} in os2*) AC_DEFINE(HAVE_USBCALL, 1, [Define to 1 if you have usbcall.dll.]) ;; *) if test "$have_libusb_1_0" = "yes"; then AC_DEFINE(HAVE_LIBUSB_1_0, 1, [Define to 1 if you have libusb-1.0.]) else AC_DEFINE(HAVE_LIBUSB, 1, [Define to 1 if you have libusb.]) fi ;; esac fi AC_SUBST(USB_LIBS) dnl ************ dnl SCSI Support dnl ************ dnl FIXME: These are a lot of header files to scan. We should dnl scan for just one that is unique per platform and then do dnl conditional scans for more specific only as needed. AC_CHECK_HEADERS(IOKit/scsi/SCSITaskLib.h IOKit/cdb/IOSCSILib.h \ IOKit/scsi/SCSICommandOperationCodes.h \ IOKit/scsi-commands/SCSICommandOperationCodes.h scsi.h sys/scsi.h \ sys/scsicmd.h sys/scsiio.h bsd/dev/scsireg.h scsi/sg.h \ camlib.h scdds.h sys/scsi/scsi.h sys/scsi/sgdefs.h \ sys/scsi/targets/scgio.h apollo/scsi.h sys/sdi_comm.h \ sys/passthrudef.h) AC_CHECK_HEADERS([io/cam/cam.h],,,[#include ]) dnl FreeBSD < 3 if test "$ac_cv_header_sys_scsiio_h" = "yes" \ -a "$ac_cv_header_scsi_h" = "yes"; then AC_MSG_CHECKING([if 'scsireq_t' needs to be defined as 'struct scsireq']) AC_TRY_COMPILE([ #include #include ],[scsireq_t req],, [AC_MSG_RESULT(yes); AC_DEFINE(scsireq_t, struct scsireq_t, [Define scsireq_t as \'struct scsireq\' if necessary.])], AC_MSG_RESULT(no)) fi AC_CHECK_LIB(scsi, scsireq_enter, SCSI_LIBS="-lscsi") # FreeBSD needs this dnl FreeBSD >= 3 AC_CHECK_LIB(cam, cam_open_device, SCSI_LIBS="-lcam") # FreeBSD 3+ needs this AC_CHECK_FUNCS(scsireq_enter) if test "$ac_cv_header_scsi_sg_h" = "yes"; then AC_MSG_CHECKING([for sg_header.target_status in ]) AC_TRY_COMPILE([ #include #include ],[ struct sg_header hdr; hdr.target_status = 1; return 0; ],[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SG_TARGET_STATUS,1, [Define if sg_header.target_status is available.])], AC_MSG_RESULT(no)) fi if test "$ac_cv_header_IOKit_scsi_SCSITaskLib_h" = "yes"; then AC_MSG_CHECKING([for SCSITaskSGElement in IOKit/scsi/SCSITaskLib.h]) AC_TRY_COMPILE([ #undef VERSION #include ],[ SCSITaskSGElement range; return 0; ],[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SCSITASKSGELEMENT, 1, [Define if SCSITaskSGElement is available.])], AC_MSG_RESULT(no)) fi dnl disable Linux SCSI generic version 3 to avoid 32/64 bit problems if sparc64 -q > /dev/null 2>&1 ; then AC_DEFINE(DISABLE_LINUX_SG_IO, 1, [Should we disable SCSI generic v3?]) fi # Multiple platforms can set SCSI_LIBS so do substitution at end. AC_SUBST(SCSI_LIBS) AC_ARG_ENABLE(scsibuffersize, AC_HELP_STRING([--enable-scsibuffersize=N], [specify the default size in bytes of the buffer for SCSI commands [[default=131072]]]), [set_scsibuffersize="$enableval"], [set_scsibuffersize=131072]) AC_DEFINE_UNQUOTED(SCSIBUFFERSIZE, $set_scsibuffersize, [SCSI command buffer size]) dnl FIXME: Move tihs to configuration printout area but probably dnl but probably needs to be wrapped by what ever uses it so its dnl only printed when used. echo "scsi buffersize: $set_scsibuffersize" AC_ARG_ENABLE(scsi-directio, AC_HELP_STRING([--enable-scsi-directio], [enable SCSI direct IO (Linux only, dangerous, see README.linux)]), [ if eval "test x$enable_scsi_directio = xyes"; then CFLAGS="$CFLAGS -DENABLE_SCSI_DIRECTIO" fi ]) dnl **** dnl IPv6 dnl **** dnl check for IPv6 (can be overriden by --enable-ipv6) if test "$ac_cv_func_getnameinfo" = "yes" \ && test "$ac_cv_func_getaddrinfo" = "yes" ; then SANE_CHECK_IPV6 else ipv6="no" fi dnl *********************************************************************** dnl initialize libtool dnl *********************************************************************** AC_LIBTOOL_WIN32_DLL AC_DISABLE_STATIC AC_PROG_LIBTOOL dnl Windows (cygwin/mingw), BeOS, and OS/2 need this. case $host_os in cygwin* | mingw* | beos* | os2*) LDFLAGS="$LDFLAGS -no-undefined" esac dnl Check for lock dir AC_ARG_WITH(lockdir, AC_HELP_STRING([--with-lockdir=DIR], [set SANE lockdir @<:@localstatedir/lock/sane@:>@]), [locksanedir=$withval],[locksanedir=${localstatedir}/lock/sane]) AC_SUBST(locksanedir) configdir="${sysconfdir}/sane.d" AC_SUBST(configdir) dnl *********************************************************************** dnl enable/disable backends and features based on previous tests and user's dnl choice dnl *********************************************************************** CPPFLAGS="${CPPFLAGS} -DPATH_SANE_CONFIG_DIR=\$(configdir) \ -DPATH_SANE_DATA_DIR=\$(datadir) \ -DPATH_SANE_LOCK_DIR=\$(locksanedir) \ -DV_MAJOR=${V_MAJOR} -DV_MINOR=${V_MINOR}" if test "${ac_cv_header_sys_socket_h}" = "no"; then echo "*** disabling saned (sys/socket.h not found)" SANED= else SANED=saned fi AM_CONDITIONAL(COMPILE_SANED, test x$SANED = xsaned) dnl These are the backends that are build in any case: AC_ARG_ENABLE(local-backends, AC_HELP_STRING([--disable-local-backends], [turn off compilation of all backends but net])) ALL_BACKENDS="geniusvp2 ls5000" # If user specifies backends manually then cause configure # to fail if its detected it can't be compiled. If we # are in automatic mode then remove backend from list instead. user_selected_backends="yes" if eval "test x$enable_local_backends = xno"; then BACKENDS="net" else if test "${BACKENDS}" != "" ; then AC_MSG_NOTICE([Manually selected backends: ${BACKENDS}]) else BACKENDS="$ALL_BACKENDS" user_selected_backends="no" fi fi SANE_CHECK_BACKENDS if test "${sane_cv_use_libjpeg}" = "yes"; then SANEI_SANEI_JPEG_LO="../sanei/sanei_jpeg.lo" fi AM_CONDITIONAL(HAVE_JPEG, test x$sane_cv_use_libjpeg = xyes) AC_SUBST(SANEI_SANEI_JPEG_LO) BACKENDS="$FILTERED_BACKENDS" BACKEND_LIBS_ENABLED="" BACKEND_CONFS_ENABLED="" BACKEND_MANS_ENABLED="" for backend in ${BACKENDS} ; do BACKEND_LIBS_ENABLED="${BACKEND_LIBS_ENABLED} libsane-${backend}.la" BACKEND_CONFS_ENABLED="${BACKEND_CONFS_ENABLED} ${backend}.conf" BACKEND_MANS_ENABLED="${BACKEND_MANS_ENABLED} sane-${backend}.5" done AC_SUBST(BACKEND_LIBS_ENABLED) if test "${enable_shared}" = "no"; then enable_preload=yes fi if test "${enable_dynamic}" != yes || test "${enable_preload}" = "yes"; then echo "preloading backends into DLL" # If user specifies backends manually then cause configure # to fail if its detected it can't be compiled. If we # are in automatic mode then remove backend from list instead. user_selected_backends="yes" if eval "test x$enable_local_backends = xno"; then PRELOADABLE_BACKENDS="net" else if test "${PRELOADABLE_BACKENDS}" != "" ; then AC_MSG_NOTICE([Manually selected preloadable backends: ${PRELOADABLE_BACKENDS}]) else PRELOADABLE_BACKENDS="$ALL_BACKENDS" user_selected_backends="no" fi fi saved_BACKENDS="$BACKENDS" BACKENDS="${PRELOADABLE_BACKENDS}" SANE_CHECK_BACKENDS PRELOADABLE_BACKENDS="$FILTERED_BACKENDS" BACKENDS="$saved_BACKENDS" else PRELOADABLE_BACKENDS="" fi PRELOADABLE_BACKENDS_ENABLED="" # Do not initialize BACKEND_CONFS_ENABLED so that its a combination # of all backends. for backend in ${PRELOADABLE_BACKENDS} ; do BACKEND_CONFS_ENABLED="${BACKEND_CONFS_ENABLED} ${backend}.conf" BACKEND_MANS_ENABLED="${BACKEND_MANS_ENABLED} sane-${backend}.5" # Special hacks. Normally, we create a convenience library that # matches the backend's name but in some cases that will conflict # with an external library name that also matches backend name. # Work around that here by renaming internal library. if test "${backend}" = "gphoto2"; then backend=gphoto2_i fi PRELOADABLE_BACKENDS_ENABLED="${PRELOADABLE_BACKENDS_ENABLED} lib${backend}.la" done AC_SUBST(PRELOADABLE_BACKENDS) AC_SUBST(PRELOADABLE_BACKENDS_ENABLED) AC_SUBST(BACKEND_CONFS_ENABLED) AC_SUBST(BACKEND_MANS_ENABLED) dnl in BeOS, backends are not installed in lib/sane, but add-ons/sane/ dnl we account for both installing in /boot/beos and ~/config case $host_os in beos*) libdir='${exec_prefix}/add-ons' ;; esac AC_ARG_ENABLE(parport-directio, AC_HELP_STRING([--enable-parport-directio], [enable direct hardware access to the parallel port, so frontends will require special permission level]), [ if eval "test x$enable_parport_directio = xyes"; then CFLAGS="$CFLAGS -DENABLE_PARPORT_DIRECTIO" fi ]) AC_ARG_ENABLE(translations, AC_HELP_STRING([--disable-translations], [don't install translations of backend options]),, enable_translations=yes) if eval "test x$enable_translations = xyes" ; then if test x$MSGFMT = xno || test x$XGETTEXT = xno || test $MSGMERGE = no ; then enable_translations=no echo "disabling translations (missing msgfmt, xgettext or msgmerge)" else echo "enabling translations" fi else echo "disabling translations" fi AM_CONDITIONAL(ENABLE_TRANSLATIONS, test x$enable_translations = xyes) AC_ARG_ENABLE(latex, AC_HELP_STRING([--disable-latex], [disable use of latex, et.al., to generate documentation]),, enable_latex=yes) if test "x$enable_latex" = "xyes" ; then if test "x$LATEX" = "xno" || test "x$DVIPS" = "xno" || test "x$MAKEINDEX" = "xno" ; then enable_latex=no echo "disabling latex (missing latex, dvips or makeindex)" else echo "enabling latex" fi else echo "disabling latex" fi AM_CONDITIONAL(USE_LATEX, test x$enable_latex = xyes) dnl *********************************************************************** dnl Write output files dnl *********************************************************************** DISTCLEAN_FILES="*~ .*~ *.log *.bak *.old *.orig *.out *.rej \"\#\"* \".\\#\"*" AC_SUBST(DISTCLEAN_FILES) AC_CONFIG_FILES([Makefile lib/Makefile sanei/Makefile \ backend/Makefile include/Makefile doc/Makefile]) AC_OUTPUT dnl *********************************************************************** dnl print configuration information dnl *********************************************************************** echo "-> Variables used for compilation/linking:" echo CPPFLAGS=\"${CPPFLAGS}\" echo CFLAGS=\"${CFLAGS}\" echo LDFLAGS=\"${LDFLAGS}\" echo LIBS=\"${LIBS}\" echo "-> Installation directories:" echo "Configuration: `eval eval echo ${sysconfdir}`" echo "Libraries: `eval eval echo ${libdir}`" echo "Binaries: `eval eval echo ${bindir}` and `eval eval echo ${sbindir}`" echo "Manpages: `eval eval echo ${mandir}`" echo "Documentation: `eval eval echo ${docdir}`" if eval "test x$INSTALL_LOCKPATH = xinstall-lockpath" ; then echo "Lockfiles: `eval eval echo ${locksanedir}`" else echo "Lockfiles: Feature is disabled!" fi echo "-> Network parameters:" if test "${SANED}" = "saned" ; then echo "Build saned: yes" else echo "Build saned: no" fi echo "IPv6 support: `eval eval echo ${ipv6}`" echo "Avahi support: `eval eval echo ${enable_avahi}`" echo "SNMP support: `eval eval echo ${with_snmp}`" echo "-> The following backends will be built:" for backend in ${BACKENDS} ; do echo $ECHO_N "${backend} " done echo echo echo "-> The following preload backends will be built:" for backend in ${PRELOADABLE_BACKENDS} ; do echo $ECHO_N "${backend} " done echo if test "$SANE_CONFIG_PATH" != "no" ; then SANE_INSTALLED_VERSION=`$SANE_CONFIG_PATH --version` SANE_INSTALLED_PREFIX=`$SANE_CONFIG_PATH --prefix` if test "$SANE_INSTALLED_PREFIX" != "$prefix" ; then echo "*** WARNING: SANE is already installed (version $SANE_INSTALLED_VERSION). The old" echo "*** installation is at $SANE_INSTALLED_PREFIX while SANE will now be installed" echo "*** at $prefix. It is recommended to uninstall the old SANE version" echo "*** before installing the new one to avoid problems." fi else if test "$LIBSANE_EXISTS" = "yes" ; then echo "*** Warning: An old version of SANE was detected but the sane-config program" echo "*** couldn't be found. If you encounter any problems with SANE remove the old" echo "*** SANE files and reinstall this version." fi fi if eval "test x${sysconfdir} = x/usr/etc" ; then echo "*** WARNING: Configuration files are stored in /usr/etc. If this is not" echo "*** intended, use --sysconfdir to set another path (e.g. "/etc")." fi if test "$SELECTED_BACKENDS" != "" ; then echo "*** Warning: Local backends have been disabled. This means that scanners" echo "*** connected to your local computer won't be supported. Only a network" echo "*** connection to a remote host is possible." fi if test "$enable_libusb" != "no" && test "$HAVE_USB" != "yes" ; then echo "*** Warning: sane-backends will be built without libusb support. There may" echo "*** be valid reasons to do so, e.g. if you don't use USB scanners or on" echo "*** platforms without libusb support but generally this means that you" echo "*** can't use USB devices with SANE. The most probable cause is that" if test "${ac_cv_header_usb_h}" != "yes"; then echo "*** the libusb header file usb.h is not installed. If you use Linux" echo "*** you may need a package called 'libusb-dev', 'libusb-devel' or similar." else echo "*** libusb is not installed at all or is too old. See README." fi fi echo "****************************************************************" echo "* Please be sure to read file PROBLEMS in this directory *" echo "* BEFORE running any of the SANE applications. Some devices *" echo "* may be damaged by improper operation, so please do heed this *" echo "* advice. *" echo "****************************************************************" sane-backends-extras-1.0.22.3ubuntu1/Makefile.in0000664000000000000000000006461611527266664016254 0ustar # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/configure \ $(top_srcdir)/include/sane/config.h.in AUTHORS COPYING \ ChangeLog INSTALL NEWS compile config.guess config.sub depcomp \ install-sh ltmain.sh missing mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/byteorder.m4 \ $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/sane/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d "$(distdir)" \ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr "$(distdir)"; }; } am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AWK = @AWK@ BACKEND_CONFS_ENABLED = @BACKEND_CONFS_ENABLED@ BACKEND_LIBS_ENABLED = @BACKEND_LIBS_ENABLED@ BACKEND_MANS_ENABLED = @BACKEND_MANS_ENABLED@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISTCLEAN_FILES = @DISTCLEAN_FILES@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DVIPS = @DVIPS@ DYNAMIC_FLAG = @DYNAMIC_FLAG@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GPHOTO2_CPPFLAGS = @GPHOTO2_CPPFLAGS@ GPHOTO2_LDFLAGS = @GPHOTO2_LDFLAGS@ GPHOTO2_LIBS = @GPHOTO2_LIBS@ GREP = @GREP@ HAVE_GPHOTO2 = @HAVE_GPHOTO2@ IEEE1284_LIBS = @IEEE1284_LIBS@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_LOCKPATH = @INSTALL_LOCKPATH@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JPEG_LIBS = @JPEG_LIBS@ LATEX = @LATEX@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUSB_1_0_CFLAGS = @LIBUSB_1_0_CFLAGS@ LIBUSB_1_0_LIBS = @LIBUSB_1_0_LIBS@ LIBV4L_CFLAGS = @LIBV4L_CFLAGS@ LIBV4L_LIBS = @LIBV4L_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LOCKPATH_GROUP = @LOCKPATH_GROUP@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINDEX = @MAKEINDEX@ MAKEINFO = @MAKEINFO@ MATH_LIB = @MATH_LIB@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ NUMBER_VERSION = @NUMBER_VERSION@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PRELOADABLE_BACKENDS = @PRELOADABLE_BACKENDS@ PRELOADABLE_BACKENDS_ENABLED = @PRELOADABLE_BACKENDS_ENABLED@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RESMGR_LIBS = @RESMGR_LIBS@ SANEI_SANEI_JPEG_LO = @SANEI_SANEI_JPEG_LO@ SANE_CONFIG_PATH = @SANE_CONFIG_PATH@ SCSI_LIBS = @SCSI_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SNMP_CONFIG_PATH = @SNMP_CONFIG_PATH@ SOCKET_LIBS = @SOCKET_LIBS@ STRICT_LDFLAGS = @STRICT_LDFLAGS@ STRIP = @STRIP@ SYSLOG_LIBS = @SYSLOG_LIBS@ TIFF_LIBS = @TIFF_LIBS@ USB_LIBS = @USB_LIBS@ VERSION = @VERSION@ V_MAJOR = @V_MAJOR@ V_MINOR = @V_MINOR@ V_REV = @V_REV@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ configdir = @configdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ effective_target = @effective_target@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ locksanedir = @locksanedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = include lib sanei backend doc DIST_SUBDIRS = include lib sanei backend doc EXTRA_DIST = ChangeLog-1.0.0 ChangeLog-1.0.1 ChangeLog-1.0.2 \ ChangeLog-1.0.3 ChangeLog-1.0.4 ChangeLog-1.0.5 ChangeLog-1.0.6 \ ChangeLog-1.0.7 ChangeLog-1.0.8 ChangeLog-1.0.9 ChangeLog-1.0.10 \ ChangeLog-1.0.12 ChangeLog-1.0.13 ChangeLog-1.0.14 ChangeLog-1.0.15 \ ChangeLog-1.0.16 ChangeLog-1.0.17 ChangeLog-1.0.18 ChangeLog-1.0.19 \ ChangeLog-1.0.20 ChangeLog-1.0.21 \ $(PACKAGE).lsm # # Keep the .cvsignore files sorted, and use this target to do it. # PERL = perl all: all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): include/sane/config.h: include/sane/stamp-h1 @if test ! -f $@; then \ rm -f include/sane/stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) include/sane/stamp-h1; \ else :; fi include/sane/stamp-h1: $(top_srcdir)/include/sane/config.h.in $(top_builddir)/config.status @rm -f include/sane/stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status include/sane/config.h $(top_srcdir)/include/sane/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f include/sane/stamp-h1 touch $@ distclean-hdr: -rm -f include/sane/config.h include/sane/stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -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 $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | 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 case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__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 \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 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 in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-recursive clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-local distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: installcheck-local maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool clean-local ctags ctags-recursive dist dist-all \ dist-bzip2 dist-gzip dist-lzma dist-shar dist-tarZ dist-xz \ dist-zip distcheck distclean distclean-generic distclean-hdr \ distclean-libtool distclean-local distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installcheck-local installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am sort-cvsignore: for f in `find . -name .cvsignore`; do \ $(PERL) -e 'print sort <>;' < $$f > $$f.tmptmp; \ mv $$f.tmptmp $$f; \ done # # Check to make sure only sane_ and sanei_ symbols are exported from # the libraries # libcheck: @echo "Libraries exporting 'illegal' symbols:" @for lib in backend/.libs/*.so backend/.libs/*.a; do \ lines=`nm -g $$lib|grep '\( T \)\|\( D \)'|egrep -v ' _fini| _init'|egrep -v ' sane_| sanei_'`; \ if test -n "$$lines" ; then \ echo -e "*** $$lib:\n$$lines"; \ found_errors="yes"; \ fi \ done; \ echo; \ echo "Libraries exporting 'non-standard sane_*' symbols:"; \ for lib in backend/.libs/*.so backend/.libs/*.a; do \ lines=`nm -g $$lib|grep '\( T \)\|\( D \)'|egrep ' sane_' | egrep -v 'sane_.*init|sane_.*exit|sane_.*get_devices|sane_.*open|sane_.*close|sane_.*get_option_descriptor|sane_.*control_option|sane_.*get_parameters|sane_.*start|sane_.*read|sane_.*cancel|sane_.*set_io_mode|sane_.*get_select_fd|sane_strstatus'` ; \ if test -n "$$lines" ; then \ echo -e "*** $$lib:\n$$lines"; \ found_errors="yes"; \ fi \ done; if test ! -z $$found_errors ; then \ exit 1; \ fi # Verify that backends do not contain any unwanted public symbols # anytime check or distcheck is ran. # TODO: Currently this doesn't pass. Uncomment once symbols have # been cleaned up. #check-am: libcheck # Run testsuite any time installcheck or distcheck is ran. # Must run testsuite after install or else shared library backends # will not be found (including test backend). installcheck-local: cd testsuite && $(MAKE) test.local $(distdir).lsm: dist $(PACKAGE).lsm ( cat $(PACKAGE).lsm | \ sed -e "s|_DATE_|`date +%d%b%y`|g" |\ sed -e "s|_VERSION_|$(VERSION)|g" | \ sed -e "s|_T_S_|`find $(distdir).tar.gz -printf "%4k"`|g" |\ sed -e "s|_L_S_|`find $(PACKAGE).lsm -printf "%4k"`|g" >\ $(distdir).lsm \ ) lsm: $(distdir).lsm md5: dist md5sum $(distdir).tar.gz > $(distdir).tar.gz.md5 sane-backends: lsm md5 # Clean files created by custom targets in this file. clean-local: rm -f sane-backends-*.lsm rm -f $(distdir).tar.gz.md5 # Clean files created by configure distclean-local: rm -f include/_stdint.h rm -f include/byteorder.h # 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: sane-backends-extras-1.0.22.3ubuntu1/lib/0000775000000000000000000000000011600675053014724 5ustar sane-backends-extras-1.0.22.3ubuntu1/lib/md5.c0000664000000000000000000003343211475557446015601 0ustar /* Functions to compute MD5 message digest of files or memory blocks. according to the definition of MD5 in RFC 1321 from April 1992. Copyright (C) 1995,1996,1997,1999,2000,2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /* Written by Ulrich Drepper , 1995. */ #ifdef HAVE_CONFIG_H # include #endif #include #if STDC_HEADERS || defined _LIBC # include # include #else # ifndef HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # endif #endif #include "md5.h" #ifdef _LIBC # include # if __BYTE_ORDER == __BIG_ENDIAN # define WORDS_BIGENDIAN 1 # endif /* We need to keep the namespace clean so define the MD5 function protected using leading __ . */ # define md5_init_ctx __md5_init_ctx # define md5_process_block __md5_process_block # define md5_process_bytes __md5_process_bytes # define md5_finish_ctx __md5_finish_ctx # define md5_read_ctx __md5_read_ctx # define md5_stream __md5_stream # define md5_buffer __md5_buffer #endif #ifdef WORDS_BIGENDIAN # define SWAP(n) \ (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24)) #else # define SWAP(n) (n) #endif /* This array contains the bytes used to pad the buffer to the next 64-byte boundary. (RFC 1321, 3.1: Step 1) */ static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ }; void md5_init_ctx (struct md5_ctx *ctx); void * md5_read_ctx (const struct md5_ctx *ctx, void *resbuf); void * md5_finish_ctx (struct md5_ctx *ctx, void *resbuf); int md5_stream (FILE *stream, void *resblock); void * md5_buffer (const char *buffer, size_t len, void *resblock); void md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx); void md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx); /* Initialize structure containing state of computation. (RFC 1321, 3.3: Step 3) */ void md5_init_ctx (struct md5_ctx *ctx) { ctx->A = 0x67452301; ctx->B = 0xefcdab89; ctx->C = 0x98badcfe; ctx->D = 0x10325476; ctx->total[0] = ctx->total[1] = 0; ctx->buflen = 0; } /* Put result from CTX in first 16 bytes following RESBUF. The result must be in little endian byte order. IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ void * md5_read_ctx (const struct md5_ctx *ctx, void *resbuf) { ((md5_uint32 *) resbuf)[0] = SWAP (ctx->A); ((md5_uint32 *) resbuf)[1] = SWAP (ctx->B); ((md5_uint32 *) resbuf)[2] = SWAP (ctx->C); ((md5_uint32 *) resbuf)[3] = SWAP (ctx->D); return resbuf; } /* Process the remaining bytes in the internal buffer and the usual prolog according to the standard and write the result to RESBUF. IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ void * md5_finish_ctx (struct md5_ctx *ctx, void *resbuf) { /* Take yet unprocessed bytes into account. */ md5_uint32 bytes = ctx->buflen; size_t pad; /* Now count remaining bytes. */ ctx->total[0] += bytes; if (ctx->total[0] < bytes) ++ctx->total[1]; pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes; memcpy (&ctx->buffer[bytes], fillbuf, pad); /* Put the 64-bit file length in *bits* at the end of the buffer. */ *(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3); *(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29)); /* Process last bytes. */ md5_process_block (ctx->buffer, bytes + pad + 8, ctx); return md5_read_ctx (ctx, resbuf); } /* Compute MD5 message digest for bytes read from STREAM. The resulting message digest number will be written into the 16 bytes beginning at RESBLOCK. */ int md5_stream (FILE *stream, void *resblock) { /* Important: BLOCKSIZE must be a multiple of 64. */ #define BLOCKSIZE 4096 struct md5_ctx ctx; char buffer[BLOCKSIZE + 72]; size_t sum; /* Initialize the computation context. */ md5_init_ctx (&ctx); /* Iterate over full file contents. */ while (1) { /* We read the file in blocks of BLOCKSIZE bytes. One call of the computation function processes the whole buffer so that with the next round of the loop another block can be read. */ size_t n; sum = 0; /* Read block. Take care for partial reads. */ do { n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream); sum += n; } while (sum < BLOCKSIZE && n != 0); if (n == 0 && ferror (stream)) return 1; /* If end of file is reached, end the loop. */ if (n == 0) break; /* Process buffer with BLOCKSIZE bytes. Note that BLOCKSIZE % 64 == 0 */ md5_process_block (buffer, BLOCKSIZE, &ctx); } /* Add the last bytes if necessary. */ if (sum > 0) md5_process_bytes (buffer, sum, &ctx); /* Construct result in desired memory. */ md5_finish_ctx (&ctx, resblock); return 0; } /* Compute MD5 message digest for LEN bytes beginning at BUFFER. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. */ void * md5_buffer (const char *buffer, size_t len, void *resblock) { struct md5_ctx ctx; /* Initialize the computation context. */ md5_init_ctx (&ctx); /* Process whole buffer but last len % 64 bytes. */ md5_process_bytes (buffer, len, &ctx); /* Put result in desired memory area. */ return md5_finish_ctx (&ctx, resblock); } void md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx) { /* When we already have some bits in our internal buffer concatenate both inputs first. */ if (ctx->buflen != 0) { size_t left_over = ctx->buflen; size_t add = 128 - left_over > len ? len : 128 - left_over; memcpy (&ctx->buffer[left_over], buffer, add); ctx->buflen += add; if (ctx->buflen > 64) { md5_process_block (ctx->buffer, ctx->buflen & ~63, ctx); ctx->buflen &= 63; /* The regions in the following copy operation cannot overlap. */ memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~63], ctx->buflen); } buffer = (const char *) buffer + add; len -= add; } /* Process available complete blocks. */ if (len >= 64) { #if !_STRING_ARCH_unaligned /* To check alignment gcc has an appropriate operator. Other compilers don't. */ # if __GNUC__ >= 2 # define UNALIGNED_P(p) (((md5_uintptr) p) % __alignof__ (md5_uint32) != 0) # else # define UNALIGNED_P(p) (((md5_uintptr) p) % sizeof (md5_uint32) != 0) # endif if (UNALIGNED_P (buffer)) while (len > 64) { md5_process_block (memcpy (ctx->buffer, buffer, 64), 64, ctx); buffer = (const char *) buffer + 64; len -= 64; } else #endif { md5_process_block (buffer, len & ~63, ctx); buffer = (const char *) buffer + (len & ~63); len &= 63; } } /* Move remaining bytes in internal buffer. */ if (len > 0) { size_t left_over = ctx->buflen; memcpy (&ctx->buffer[left_over], buffer, len); left_over += len; if (left_over >= 64) { md5_process_block (ctx->buffer, 64, ctx); left_over -= 64; memcpy (ctx->buffer, &ctx->buffer[64], left_over); } ctx->buflen = left_over; } } /* These are the four functions used in the four steps of the MD5 algorithm and defined in the RFC 1321. The first function is a little bit optimized (as found in Colin Plumbs public domain implementation). */ /* #define FF(b, c, d) ((b & c) | (~b & d)) */ #define FF(b, c, d) (d ^ (b & (c ^ d))) #define FG(b, c, d) FF (d, b, c) #define FH(b, c, d) (b ^ c ^ d) #define FI(b, c, d) (c ^ (b | ~d)) /* Process LEN bytes of BUFFER, accumulating context into CTX. It is assumed that LEN % 64 == 0. */ void md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx) { md5_uint32 correct_words[16]; const md5_uint32 *words = buffer; size_t nwords = len / sizeof (md5_uint32); const md5_uint32 *endp = words + nwords; md5_uint32 A = ctx->A; md5_uint32 B = ctx->B; md5_uint32 C = ctx->C; md5_uint32 D = ctx->D; /* First increment the byte count. RFC 1321 specifies the possible length of the file up to 2^64 bits. Here we only compute the number of bytes. Do a double word increment. */ ctx->total[0] += len; if (ctx->total[0] < len) ++ctx->total[1]; /* Process all bytes in the buffer with 64 bytes in each round of the loop. */ while (words < endp) { md5_uint32 *cwp = correct_words; md5_uint32 A_save = A; md5_uint32 B_save = B; md5_uint32 C_save = C; md5_uint32 D_save = D; /* First round: using the given function, the context and a constant the next context is computed. Because the algorithms processing unit is a 32-bit word and it is determined to work on words in little endian byte order we perhaps have to change the byte order before the computation. To reduce the work for the next steps we store the swapped words in the array CORRECT_WORDS. */ #define OP(a, b, c, d, s, T) \ do \ { \ a += FF (b, c, d) + (*cwp++ = SWAP (*words)) + T; \ ++words; \ CYCLIC (a, s); \ a += b; \ } \ while (0) /* It is unfortunate that C does not provide an operator for cyclic rotation. Hope the C compiler is smart enough. */ #define CYCLIC(w, s) (w = (w << s) | (w >> (32 - s))) /* Before we start, one word to the strange constants. They are defined in RFC 1321 as T[i] = (int) (4294967296.0 * fabs (sin (i))), i=1..64 */ /* Round 1. */ OP (A, B, C, D, 7, 0xd76aa478); OP (D, A, B, C, 12, 0xe8c7b756); OP (C, D, A, B, 17, 0x242070db); OP (B, C, D, A, 22, 0xc1bdceee); OP (A, B, C, D, 7, 0xf57c0faf); OP (D, A, B, C, 12, 0x4787c62a); OP (C, D, A, B, 17, 0xa8304613); OP (B, C, D, A, 22, 0xfd469501); OP (A, B, C, D, 7, 0x698098d8); OP (D, A, B, C, 12, 0x8b44f7af); OP (C, D, A, B, 17, 0xffff5bb1); OP (B, C, D, A, 22, 0x895cd7be); OP (A, B, C, D, 7, 0x6b901122); OP (D, A, B, C, 12, 0xfd987193); OP (C, D, A, B, 17, 0xa679438e); OP (B, C, D, A, 22, 0x49b40821); /* For the second to fourth round we have the possibly swapped words in CORRECT_WORDS. Redefine the macro to take an additional first argument specifying the function to use. */ #undef OP #define OP(f, a, b, c, d, k, s, T) \ do \ { \ a += f (b, c, d) + correct_words[k] + T; \ CYCLIC (a, s); \ a += b; \ } \ while (0) /* Round 2. */ OP (FG, A, B, C, D, 1, 5, 0xf61e2562); OP (FG, D, A, B, C, 6, 9, 0xc040b340); OP (FG, C, D, A, B, 11, 14, 0x265e5a51); OP (FG, B, C, D, A, 0, 20, 0xe9b6c7aa); OP (FG, A, B, C, D, 5, 5, 0xd62f105d); OP (FG, D, A, B, C, 10, 9, 0x02441453); OP (FG, C, D, A, B, 15, 14, 0xd8a1e681); OP (FG, B, C, D, A, 4, 20, 0xe7d3fbc8); OP (FG, A, B, C, D, 9, 5, 0x21e1cde6); OP (FG, D, A, B, C, 14, 9, 0xc33707d6); OP (FG, C, D, A, B, 3, 14, 0xf4d50d87); OP (FG, B, C, D, A, 8, 20, 0x455a14ed); OP (FG, A, B, C, D, 13, 5, 0xa9e3e905); OP (FG, D, A, B, C, 2, 9, 0xfcefa3f8); OP (FG, C, D, A, B, 7, 14, 0x676f02d9); OP (FG, B, C, D, A, 12, 20, 0x8d2a4c8a); /* Round 3. */ OP (FH, A, B, C, D, 5, 4, 0xfffa3942); OP (FH, D, A, B, C, 8, 11, 0x8771f681); OP (FH, C, D, A, B, 11, 16, 0x6d9d6122); OP (FH, B, C, D, A, 14, 23, 0xfde5380c); OP (FH, A, B, C, D, 1, 4, 0xa4beea44); OP (FH, D, A, B, C, 4, 11, 0x4bdecfa9); OP (FH, C, D, A, B, 7, 16, 0xf6bb4b60); OP (FH, B, C, D, A, 10, 23, 0xbebfbc70); OP (FH, A, B, C, D, 13, 4, 0x289b7ec6); OP (FH, D, A, B, C, 0, 11, 0xeaa127fa); OP (FH, C, D, A, B, 3, 16, 0xd4ef3085); OP (FH, B, C, D, A, 6, 23, 0x04881d05); OP (FH, A, B, C, D, 9, 4, 0xd9d4d039); OP (FH, D, A, B, C, 12, 11, 0xe6db99e5); OP (FH, C, D, A, B, 15, 16, 0x1fa27cf8); OP (FH, B, C, D, A, 2, 23, 0xc4ac5665); /* Round 4. */ OP (FI, A, B, C, D, 0, 6, 0xf4292244); OP (FI, D, A, B, C, 7, 10, 0x432aff97); OP (FI, C, D, A, B, 14, 15, 0xab9423a7); OP (FI, B, C, D, A, 5, 21, 0xfc93a039); OP (FI, A, B, C, D, 12, 6, 0x655b59c3); OP (FI, D, A, B, C, 3, 10, 0x8f0ccc92); OP (FI, C, D, A, B, 10, 15, 0xffeff47d); OP (FI, B, C, D, A, 1, 21, 0x85845dd1); OP (FI, A, B, C, D, 8, 6, 0x6fa87e4f); OP (FI, D, A, B, C, 15, 10, 0xfe2ce6e0); OP (FI, C, D, A, B, 6, 15, 0xa3014314); OP (FI, B, C, D, A, 13, 21, 0x4e0811a1); OP (FI, A, B, C, D, 4, 6, 0xf7537e82); OP (FI, D, A, B, C, 11, 10, 0xbd3af235); OP (FI, C, D, A, B, 2, 15, 0x2ad7d2bb); OP (FI, B, C, D, A, 9, 21, 0xeb86d391); /* Add the starting values of the context. */ A += A_save; B += B_save; C += C_save; D += D_save; } /* Put checksum in context given as argument. */ ctx->A = A; ctx->B = B; ctx->C = C; ctx->D = D; } sane-backends-extras-1.0.22.3ubuntu1/lib/inet_ntop.c0000664000000000000000000000114211475557446017104 0ustar #include "../include/sane/config.h" #ifndef HAVE_INET_NTOP #include #include #include #include #include const char * inet_ntop (int af, const void *src, char *dst, size_t cnt) { struct in_addr in; char *text_addr; #ifdef HAVE_INET_NTOA if (af == AF_INET) { memcpy (&in.s_addr, src, sizeof (in.s_addr)); text_addr = inet_ntoa (in); if (text_addr && dst) { strncpy (dst, text_addr, cnt); return dst; } else return 0; } #endif /* HAVE_INET_NTOA */ return 0; } #endif /* !HAVE_INET_NTOP */ sane-backends-extras-1.0.22.3ubuntu1/lib/strsep.c0000664000000000000000000000260311475557446016430 0ustar /* Copyright (C) 1992, 1993, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "../include/sane/config.h" #include #ifndef HAVE_STRSEP char * strsep (char **stringp, const char *delim) { char *begin, *end; begin = *stringp; if (! begin || *begin == '\0') return NULL; /* Find the end of the token. */ end = strpbrk (begin, delim); if (end) { /* Terminate the token and set *STRINGP past NUL character. */ *end++ = '\0'; *stringp = end; } else /* No more delimiters; this is the last token. */ *stringp = NULL; return begin; } #endif /* !HAVE_STRSEP */ sane-backends-extras-1.0.22.3ubuntu1/lib/sigprocmask.c0000664000000000000000000000250511475557446017433 0ustar /* Copyright (C) 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "../include/sane/config.h" #include #ifndef HAVE_SIGPROCMASK #define sigprocmask SOMETHINGELSE #include #undef sigprocmask int sigprocmask (int how, int *new, int *old) { int o, n = *new; switch (how) { case 1: o = sigblock (n); break; case 2: o = sigsetmask (sigblock (0) & ~n); break; case 3: o = sigsetmask (n); break; default: errno = EINVAL; return -1; } if (old) *old = o; return 0; } #endif /* !HAVE_SIGPROCMASK */ sane-backends-extras-1.0.22.3ubuntu1/lib/alloca.c0000664000000000000000000003345311475557446016352 0ustar /* alloca.c -- allocate automatically reclaimed memory (Mostly) portable public-domain implementation -- D A Gwyn This implementation of the PWB library alloca function, which is used to allocate space off the run-time stack so that it is automatically reclaimed upon procedure exit, was inspired by discussions with J. Q. Johnson of Cornell. J.Otto Tennant contributed the Cray support. There are some preprocessor constants that can be defined when compiling for your specific system, for improved efficiency; however, the defaults should be okay. The general concept of this implementation is to keep track of all alloca-allocated blocks, and reclaim any that are found to be deeper in the stack than the current invocation. This heuristic does not reclaim storage as soon as it becomes invalid, but it will do so eventually. As a special case, alloca(0) reclaims storage without allocating any. It is a good idea to use alloca(0) in your main control loop, etc. to force garbage collection. */ #ifdef HAVE_CONFIG_H #include "../include/sane/config.h" #endif #ifndef HAVE_ALLOCA #include "lalloca.h" #ifdef emacs #include "blockinput.h" #endif /* If compiling with GCC 2, this file's not needed. */ #if !defined (__GNUC__) || __GNUC__ < 2 /* If someone has defined alloca as a macro, there must be some other way alloca is supposed to work. */ #ifndef alloca #ifdef emacs #ifdef static /* actually, only want this if static is defined as "" -- this is for usg, in which emacs must undefine static in order to make unexec workable */ #ifndef STACK_DIRECTION you lose -- must know STACK_DIRECTION at compile-time #endif /* STACK_DIRECTION undefined */ #endif /* static */ #endif /* emacs */ /* If your stack is a linked list of frames, you have to provide an "address metric" ADDRESS_FUNCTION macro. */ #if defined (CRAY) && defined (CRAY_STACKSEG_END) long i00afunc (); #define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg)) #else #define ADDRESS_FUNCTION(arg) &(arg) #endif #if __STDC__ typedef void *pointer; #else typedef char *pointer; #endif #define NULL 0 /* Different portions of Emacs need to call different versions of malloc. The Emacs executable needs alloca to call xmalloc, because ordinary malloc isn't protected from input signals. On the other hand, the utilities in lib-src need alloca to call malloc; some of them are very simple, and don't have an xmalloc routine. Non-Emacs programs expect this to call xmalloc. Callers below should use malloc. */ extern pointer malloc (); /* Define STACK_DIRECTION if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #ifndef STACK_DIRECTION #define STACK_DIRECTION 0 /* Direction unknown. */ #endif #if STACK_DIRECTION != 0 #define STACK_DIR STACK_DIRECTION /* Known at compile-time. */ #else /* STACK_DIRECTION == 0; need run-time code. */ static int stack_dir; /* 1 or -1 once known. */ #define STACK_DIR stack_dir static void find_stack_direction () { static char *addr = NULL; /* Address of first `dummy', once known. */ auto char dummy; /* To get stack address. */ if (addr == NULL) { /* Initial entry. */ addr = ADDRESS_FUNCTION (dummy); find_stack_direction (); /* Recurse once. */ } else { /* Second entry. */ if (ADDRESS_FUNCTION (dummy) > addr) stack_dir = 1; /* Stack grew upward. */ else stack_dir = -1; /* Stack grew downward. */ } } #endif /* STACK_DIRECTION == 0 */ /* An "alloca header" is used to: (a) chain together all alloca'ed blocks; (b) keep track of stack depth. It is very important that sizeof(header) agree with malloc alignment chunk size. The following default should work okay. */ #ifndef ALIGN_SIZE #define ALIGN_SIZE sizeof(double) #endif typedef union hdr { char align[ALIGN_SIZE]; /* To force sizeof(header). */ struct { union hdr *next; /* For chaining headers. */ char *deep; /* For stack depth measure. */ } h; } header; static header *last_alloca_header = NULL; /* -> last alloca header. */ /* Return a pointer to at least SIZE bytes of storage, which will be automatically reclaimed upon exit from the procedure that called alloca. Originally, this space was supposed to be taken from the current stack frame of the caller, but that method cannot be made to work for some implementations of C, for example under Gould's UTX/32. */ pointer alloca (size) unsigned size; { auto char probe; /* Probes stack depth: */ register char *depth = ADDRESS_FUNCTION (probe); #if STACK_DIRECTION == 0 if (STACK_DIR == 0) /* Unknown growth direction. */ find_stack_direction (); #endif /* Reclaim garbage, defined as all alloca'd storage that was allocated from deeper in the stack than currently. */ { register header *hp; /* Traverses linked list. */ #ifdef emacs BLOCK_INPUT; #endif for (hp = last_alloca_header; hp != NULL;) if ((STACK_DIR > 0 && hp->h.deep > depth) || (STACK_DIR < 0 && hp->h.deep < depth)) { register header *np = hp->h.next; free ((pointer) hp); /* Collect garbage. */ hp = np; /* -> next header. */ } else break; /* Rest are not deeper. */ last_alloca_header = hp; /* -> last valid storage. */ #ifdef emacs UNBLOCK_INPUT; #endif } if (size == 0) return NULL; /* No allocation required. */ /* Allocate combined header + user data storage. */ { register pointer new = malloc (sizeof (header) + size); /* Address of header. */ ((header *) new)->h.next = last_alloca_header; ((header *) new)->h.deep = depth; last_alloca_header = (header *) new; /* User storage begins just after header. */ return (pointer) ((char *) new + sizeof (header)); } } #if defined (CRAY) && defined (CRAY_STACKSEG_END) #ifdef DEBUG_I00AFUNC #include #endif #ifndef CRAY_STACK #define CRAY_STACK #ifndef CRAY2 /* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */ struct stack_control_header { long shgrow:32; /* Number of times stack has grown. */ long shaseg:32; /* Size of increments to stack. */ long shhwm:32; /* High water mark of stack. */ long shsize:32; /* Current size of stack (all segments). */ }; /* The stack segment linkage control information occurs at the high-address end of a stack segment. (The stack grows from low addresses to high addresses.) The initial part of the stack segment linkage control information is 0200 (octal) words. This provides for register storage for the routine which overflows the stack. */ struct stack_segment_linkage { long ss[0200]; /* 0200 overflow words. */ long sssize:32; /* Number of words in this segment. */ long ssbase:32; /* Offset to stack base. */ long:32; long sspseg:32; /* Offset to linkage control of previous segment of stack. */ long:32; long sstcpt:32; /* Pointer to task common address block. */ long sscsnm; /* Private control structure number for microtasking. */ long ssusr1; /* Reserved for user. */ long ssusr2; /* Reserved for user. */ long sstpid; /* Process ID for pid based multi-tasking. */ long ssgvup; /* Pointer to multitasking thread giveup. */ long sscray[7]; /* Reserved for Cray Research. */ long ssa0; long ssa1; long ssa2; long ssa3; long ssa4; long ssa5; long ssa6; long ssa7; long sss0; long sss1; long sss2; long sss3; long sss4; long sss5; long sss6; long sss7; }; #else /* CRAY2 */ /* The following structure defines the vector of words returned by the STKSTAT library routine. */ struct stk_stat { long now; /* Current total stack size. */ long maxc; /* Amount of contiguous space which would be required to satisfy the maximum stack demand to date. */ long high_water; /* Stack high-water mark. */ long overflows; /* Number of stack overflow ($STKOFEN) calls. */ long hits; /* Number of internal buffer hits. */ long extends; /* Number of block extensions. */ long stko_mallocs; /* Block allocations by $STKOFEN. */ long underflows; /* Number of stack underflow calls ($STKRETN). */ long stko_free; /* Number of deallocations by $STKRETN. */ long stkm_free; /* Number of deallocations by $STKMRET. */ long segments; /* Current number of stack segments. */ long maxs; /* Maximum number of stack segments so far. */ long pad_size; /* Stack pad size. */ long current_address; /* Current stack segment address. */ long current_size; /* Current stack segment size. This number is actually corrupted by STKSTAT to include the fifteen word trailer area. */ long initial_address; /* Address of initial segment. */ long initial_size; /* Size of initial segment. */ }; /* The following structure describes the data structure which trails any stack segment. I think that the description in 'asdef' is out of date. I only describe the parts that I am sure about. */ struct stk_trailer { long this_address; /* Address of this block. */ long this_size; /* Size of this block (does not include this trailer). */ long unknown2; long unknown3; long link; /* Address of trailer block of previous segment. */ long unknown5; long unknown6; long unknown7; long unknown8; long unknown9; long unknown10; long unknown11; long unknown12; long unknown13; long unknown14; }; #endif /* CRAY2 */ #endif /* not CRAY_STACK */ #ifdef CRAY2 /* Determine a "stack measure" for an arbitrary ADDRESS. I doubt that "lint" will like this much. */ static long i00afunc (long *address) { struct stk_stat status; struct stk_trailer *trailer; long *block, size; long result = 0; /* We want to iterate through all of the segments. The first step is to get the stack status structure. We could do this more quickly and more directly, perhaps, by referencing the $LM00 common block, but I know that this works. */ STKSTAT (&status); /* Set up the iteration. */ trailer = (struct stk_trailer *) (status.current_address + status.current_size - 15); /* There must be at least one stack segment. Therefore it is a fatal error if "trailer" is null. */ if (trailer == 0) abort (); /* Discard segments that do not contain our argument address. */ while (trailer != 0) { block = (long *) trailer->this_address; size = trailer->this_size; if (block == 0 || size == 0) abort (); trailer = (struct stk_trailer *) trailer->link; if ((block <= address) && (address < (block + size))) break; } /* Set the result to the offset in this segment and add the sizes of all predecessor segments. */ result = address - block; if (trailer == 0) { return result; } do { if (trailer->this_size <= 0) abort (); result += trailer->this_size; trailer = (struct stk_trailer *) trailer->link; } while (trailer != 0); /* We are done. Note that if you present a bogus address (one not in any segment), you will get a different number back, formed from subtracting the address of the first block. This is probably not what you want. */ return (result); } #else /* not CRAY2 */ /* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP. Determine the number of the cell within the stack, given the address of the cell. The purpose of this routine is to linearize, in some sense, stack addresses for alloca. */ static long i00afunc (long address) { long stkl = 0; long size, pseg, this_segment, stack; long result = 0; struct stack_segment_linkage *ssptr; /* Register B67 contains the address of the end of the current stack segment. If you (as a subprogram) store your registers on the stack and find that you are past the contents of B67, you have overflowed the segment. B67 also points to the stack segment linkage control area, which is what we are really interested in. */ stkl = CRAY_STACKSEG_END (); ssptr = (struct stack_segment_linkage *) stkl; /* If one subtracts 'size' from the end of the segment, one has the address of the first word of the segment. If this is not the first segment, 'pseg' will be nonzero. */ pseg = ssptr->sspseg; size = ssptr->sssize; this_segment = stkl - size; /* It is possible that calling this routine itself caused a stack overflow. Discard stack segments which do not contain the target address. */ while (!(this_segment <= address && address <= stkl)) { #ifdef DEBUG_I00AFUNC fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl); #endif if (pseg == 0) break; stkl = stkl - pseg; ssptr = (struct stack_segment_linkage *) stkl; size = ssptr->sssize; pseg = ssptr->sspseg; this_segment = stkl - size; } result = address - this_segment; /* If you subtract pseg from the current end of the stack, you get the address of the previous stack segment's end. This seems a little convoluted to me, but I'll bet you save a cycle somewhere. */ while (pseg != 0) { #ifdef DEBUG_I00AFUNC fprintf (stderr, "%011o %011o\n", pseg, size); #endif stkl = stkl - pseg; ssptr = (struct stack_segment_linkage *) stkl; size = ssptr->sssize; pseg = ssptr->sspseg; result += size; } return (result); } #endif /* not CRAY2 */ #endif /* CRAY */ #endif /* no alloca */ #endif /* not GCC version 2 */ #endif /* !HAVE_ALLOCA */ sane-backends-extras-1.0.22.3ubuntu1/lib/strndup.c0000664000000000000000000000216611475557446016613 0ustar /* Copyright (C) 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "../include/sane/config.h" #ifndef HAVE_STRNDUP #include #include #include char * strndup (const char * s, size_t n) { char *clone; clone = malloc (n + 1); strncpy (clone, s, n); clone[n] = '\0'; return clone; } #endif /* !HAVE_STRNDUP */ sane-backends-extras-1.0.22.3ubuntu1/lib/getopt.c0000664000000000000000000010351711475557446016420 0ustar /* Getopt for GNU. NOTE: getopt is now part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to drepper@gnu.org before changing it! Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ # include #if !defined(HAVE_GETOPT_H) || !defined(HAVE_GETOPT_LONG) /* This tells Alpha OSF/1 not to define a getopt prototype in . Ditto for AIX 3.2 and . */ #ifndef _NO_PROTO # define _NO_PROTO #endif #if 0 #ifdef HAVE_CONFIG_H # include #endif #endif #if !defined __STDC__ || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ # ifndef const # define const # endif #endif #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 # include # if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION # define ELIDE_CODE # endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ /* Don't include stdlib.h for non-GNU C libraries because some of them contain conflicting prototypes for getopt. */ # include # include #endif /* GNU C library. */ #ifdef VMS # include # if HAVE_STRING_H - 0 # include # endif #endif #ifndef _ /* This is for other GNU distributions with internationalized messages. */ # if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC # include # ifndef _ # define _(msgid) gettext (msgid) # endif # else # define _(msgid) (msgid) # endif # if defined _LIBC && defined USE_IN_LIBIO # include # endif #endif #ifndef attribute_hidden # define attribute_hidden #endif /* This version of `getopt' appears to the caller like standard Unix `getopt' but it behaves differently for the user, since it allows the user to intersperse the options with the other arguments. As `getopt' works, it permutes the elements of ARGV so that, when it is done, all the options precede everything else. Thus all application programs are extended to handle flexible argument order. Setting the environment variable POSIXLY_CORRECT disables permutation. Then the behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. */ #include "../include/lgetopt.h" /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ char *optarg = NULL; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ /* 1003.2 says this must be 1 before any call. */ int optind = 1; /* Formerly, initialization of getopt depended on optind==0, which causes problems with re-calling getopt as programs generally don't know that. */ int __getopt_initialized attribute_hidden; /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element. */ static char *nextchar; /* Callers store zero here to inhibit the error message for unrecognized options. */ int opterr = 1; /* Set to an option character which was unrecognized. This must be initialized on some systems to avoid linking in the system's own getopt implementation. */ int optopt = '?'; /* Describe how to deal with options that follow non-option ARGV-elements. If the caller did not specify anything, the default is REQUIRE_ORDER if the environment variable POSIXLY_CORRECT is defined, PERMUTE otherwise. REQUIRE_ORDER means don't recognize them as options; stop option processing when the first non-option is seen. This is what Unix does. This mode of operation is selected by either setting the environment variable POSIXLY_CORRECT, or using `+' as the first character of the list of option characters. PERMUTE is the default. We permute the contents of ARGV as we scan, so that eventually all the non-options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. RETURN_IN_ORDER is an option available to programs that were written to expect options and other ARGV-elements in any order and that care about the ordering of the two. We describe each non-option ARGV-element as if it were the argument of an option with character code 1. Using `-' as the first character of the list of option characters selects this mode of operation. The special argument `--' forces an end of option-scanning regardless of the value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause `getopt' to return -1 with `optind' != ARGC. */ static enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } ordering; /* Value of POSIXLY_CORRECT environment variable. */ static char *posixly_correct; #ifdef __GNU_LIBRARY__ /* We want to avoid inclusion of string.h with non-GNU libraries because there are many ways it can cause trouble. On some systems, it contains special magic macros that don't work in GCC. */ # include # define my_index strchr #else # if HAVE_STRING_H # include # else # include # endif /* Avoid depending on library functions or files whose names are inconsistent. */ #ifndef getenv extern char *getenv (); #endif static char * my_index (str, chr) const char *str; int chr; { while (*str) { if (*str == chr) return (char *) str; str++; } return 0; } /* If using GCC, we can safely declare strlen this way. If not using GCC, it is ok not to declare it. */ #ifdef __GNUC__ /* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. That was relevant to code that was here before. */ # if (!defined __STDC__ || !__STDC__) && !defined strlen /* gcc with -traditional declares the built-in strlen to return int, and has done so at least since version 2.4.5. -- rms. */ extern int strlen (const char *); # endif /* not __STDC__ */ #endif /* __GNUC__ */ #endif /* not __GNU_LIBRARY__ */ /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have been skipped. `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is the index after the last of them. */ static int first_nonopt; static int last_nonopt; #ifdef _LIBC /* Stored original parameters. XXX This is no good solution. We should rather copy the args so that we can compare them later. But we must not use malloc(3). */ extern int __libc_argc; extern char **__libc_argv; /* Bash 2.0 gives us an environment variable containing flags indicating ARGV elements that should not be considered arguments. */ # ifdef USE_NONOPTION_FLAGS /* Defined in getopt_init.c */ extern char *__getopt_nonoption_flags; static int nonoption_flags_max_len; static int nonoption_flags_len; # endif # ifdef USE_NONOPTION_FLAGS # define SWAP_FLAGS(ch1, ch2) \ if (nonoption_flags_len > 0) \ { \ char __tmp = __getopt_nonoption_flags[ch1]; \ __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ __getopt_nonoption_flags[ch2] = __tmp; \ } # else # define SWAP_FLAGS(ch1, ch2) # endif #else /* !_LIBC */ # define SWAP_FLAGS(ch1, ch2) #endif /* _LIBC */ /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) which contains all the non-options that have been skipped so far. The other is elements [last_nonopt,optind), which contains all the options processed since those non-options were skipped. `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ #if defined __STDC__ && __STDC__ static void exchange (char **); #endif static void exchange (argv) char **argv; { int bottom = first_nonopt; int middle = last_nonopt; int top = optind; char *tem; /* Exchange the shorter segment with the far end of the longer segment. That puts the shorter segment into the right place. It leaves the longer segment in the right place overall, but it consists of two parts that need to be swapped next. */ #if defined _LIBC && defined USE_NONOPTION_FLAGS /* First make sure the handling of the `__getopt_nonoption_flags' string can work normally. Our top argument must be in the range of the string. */ if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) { /* We must extend the array. The user plays games with us and presents new arguments. */ char *new_str = malloc (top + 1); if (new_str == NULL) nonoption_flags_len = nonoption_flags_max_len = 0; else { memset (__mempcpy (new_str, __getopt_nonoption_flags, nonoption_flags_max_len), '\0', top + 1 - nonoption_flags_max_len); nonoption_flags_max_len = top + 1; __getopt_nonoption_flags = new_str; } } #endif while (top > middle && middle > bottom) { if (top - middle > middle - bottom) { /* Bottom segment is the short one. */ int len = middle - bottom; register int i; /* Swap it with the top part of the top segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[top - (middle - bottom) + i]; argv[top - (middle - bottom) + i] = tem; SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); } /* Exclude the moved bottom segment from further swapping. */ top -= len; } else { /* Top segment is the short one. */ int len = top - middle; register int i; /* Swap it with the bottom part of the bottom segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[middle + i]; argv[middle + i] = tem; SWAP_FLAGS (bottom + i, middle + i); } /* Exclude the moved top segment from further swapping. */ bottom += len; } } /* Update records for the slots the non-options now occupy. */ first_nonopt += (optind - last_nonopt); last_nonopt = optind; } /* Initialize the internal data when the first call is made. */ #if defined __STDC__ && __STDC__ static const char *_getopt_initialize (int, char *const *, const char *); #endif static const char * _getopt_initialize (argc, argv, optstring) int argc; char *const *argv; const char *optstring; { /* Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped non-option ARGV-elements is empty. */ first_nonopt = last_nonopt = optind; nextchar = NULL; posixly_correct = getenv ("POSIXLY_CORRECT"); /* Determine how to handle the ordering of options and nonoptions. */ if (optstring[0] == '-') { ordering = RETURN_IN_ORDER; ++optstring; } else if (optstring[0] == '+') { ordering = REQUIRE_ORDER; ++optstring; } else if (posixly_correct != NULL) ordering = REQUIRE_ORDER; else ordering = PERMUTE; #if defined _LIBC && defined USE_NONOPTION_FLAGS if (posixly_correct == NULL && argc == __libc_argc && argv == __libc_argv) { if (nonoption_flags_max_len == 0) { if (__getopt_nonoption_flags == NULL || __getopt_nonoption_flags[0] == '\0') nonoption_flags_max_len = -1; else { const char *orig_str = __getopt_nonoption_flags; int len = nonoption_flags_max_len = strlen (orig_str); if (nonoption_flags_max_len < argc) nonoption_flags_max_len = argc; __getopt_nonoption_flags = (char *) malloc (nonoption_flags_max_len); if (__getopt_nonoption_flags == NULL) nonoption_flags_max_len = -1; else memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), '\0', nonoption_flags_max_len - len); } } nonoption_flags_len = nonoption_flags_max_len; } else nonoption_flags_len = 0; #endif return optstring; } /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. If an element of ARGV starts with '-', and is not exactly "-" or "--", then it is an option element. The characters of this element (aside from the initial '-') are option characters. If `getopt' is called repeatedly, it returns successively each of the option characters from each of the option elements. If `getopt' finds another option character, it returns that character, updating `optind' and `nextchar' so that the next call to `getopt' can resume the scan with the following option character or ARGV-element. If there are no more option characters, `getopt' returns -1. Then `optind' is the index in ARGV of the first ARGV-element that is not an option. (The ARGV-elements have been permuted so that those that are not options now come last.) OPTSTRING is a string containing the legitimate option characters. If an option character is seen that is not listed in OPTSTRING, return '?' after printing an error message. If you set `opterr' to zero, the error message is suppressed but we still return '?'. If a char in OPTSTRING is followed by a colon, that means it wants an arg, so the following text in the same ARGV-element, or the text of the following ARGV-element, is returned in `optarg'. Two colons mean an option that wants an optional arg; if there is text in the current ARGV-element, it is returned in `optarg', otherwise `optarg' is set to zero. If OPTSTRING starts with `-' or `+', it requests different methods of handling the non-option ARGV-elements. See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. Long-named options begin with `--' instead of `-'. Their names may be abbreviated as long as the abbreviation is unique or is an exact match for some defined option. If they have an argument, it follows the option name in the same ARGV-element, separated from the option name by a `=', or else the in next ARGV-element. When `getopt' finds a long-named option, it returns 0 if that option's `flag' field is nonzero, the value of the option's `val' field if the `flag' field is zero. The elements of ARGV aren't really const, because we permute them. But we pretend they're const in the prototype to be compatible with other systems. LONGOPTS is a vector of `struct option' terminated by an element containing a name which is zero. LONGIND returns the index in LONGOPT of the long-named option found. It is only valid when a long-named option has been found by the most recent call. If LONG_ONLY is nonzero, '-' as well as '--' can introduce long-named options. */ int _getopt_internal (argc, argv, optstring, longopts, longind, long_only) int argc; char *const *argv; const char *optstring; const struct option *longopts; int *longind; int long_only; { int print_errors = opterr; if (optstring[0] == ':') print_errors = 0; if (argc < 1) return -1; optarg = NULL; if (optind == 0 || !__getopt_initialized) { if (optind == 0) optind = 1; /* Don't scan ARGV[0], the program name. */ optstring = _getopt_initialize (argc, argv, optstring); __getopt_initialized = 1; } /* Test whether ARGV[optind] points to a non-option argument. Either it does not have option syntax, or there is an environment flag from the shell indicating it is not an option. The later information is only used when the used in the GNU libc. */ #if defined _LIBC && defined USE_NONOPTION_FLAGS # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ || (optind < nonoption_flags_len \ && __getopt_nonoption_flags[optind] == '1')) #else # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') #endif if (nextchar == NULL || *nextchar == '\0') { /* Advance to the next ARGV-element. */ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been moved back by the user (who may also have changed the arguments). */ if (last_nonopt > optind) last_nonopt = optind; if (first_nonopt > optind) first_nonopt = optind; if (ordering == PERMUTE) { /* If we have just processed some options following some non-options, exchange them so that the options come first. */ if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (last_nonopt != optind) first_nonopt = optind; /* Skip any additional non-options and extend the range of non-options previously skipped. */ while (optind < argc && NONOPTION_P) optind++; last_nonopt = optind; } /* The special ARGV-element `--' means premature end of options. Skip it like a null option, then exchange with previous non-options as if it were an option, then skip everything else like a non-option. */ if (optind != argc && !strcmp (argv[optind], "--")) { optind++; if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (first_nonopt == last_nonopt) first_nonopt = optind; last_nonopt = argc; optind = argc; } /* If we have done all the ARGV-elements, stop the scan and back over any non-options that we skipped and permuted. */ if (optind == argc) { /* Set the next-arg-index to point at the non-options that we previously skipped, so the caller will digest them. */ if (first_nonopt != last_nonopt) optind = first_nonopt; return -1; } /* If we have come to a non-option and did not permute it, either stop the scan or describe it to the caller and pass it by. */ if (NONOPTION_P) { if (ordering == REQUIRE_ORDER) return -1; optarg = argv[optind++]; return 1; } /* We have found another option-ARGV-element. Skip the initial punctuation. */ nextchar = (argv[optind] + 1 + (longopts != NULL && argv[optind][1] == '-')); } /* Decode the current option-ARGV-element. */ /* Check whether the ARGV-element is a long option. If long_only and the ARGV-element has the form "-f", where f is a valid short option, don't consider it an abbreviated form of a long option that starts with f. Otherwise there would be no way to give the -f short option. On the other hand, if there's a long option "fubar" and the ARGV-element is "-fu", do consider that an abbreviation of the long option, just like "--fu", and not "-f" with arg "u". This distinction seems to be the most useful approach. */ if (longopts != NULL && (argv[optind][1] == '-' || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = -1; int option_index; for (nameend = nextchar; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == (unsigned int) strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else if (long_only || pfound->has_arg != p->has_arg || pfound->flag != p->flag || pfound->val != p->val) /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("%s: option `%s' is ambiguous\n"), argv[0], argv[optind]) >= 0) { if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); } #else fprintf (stderr, _("%s: option `%s' is ambiguous\n"), argv[0], argv[optind]); #endif } nextchar += strlen (nextchar); optind++; optopt = 0; return '?'; } if (pfound != NULL) { option_index = indfound; optind++; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; int n; #endif if (argv[optind - 1][1] == '-') { /* --option */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("\ %s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); #else fprintf (stderr, _("\ %s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); #endif } else { /* +option or -option */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("\ %s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[optind - 1][0], pfound->name); #else fprintf (stderr, _("\ %s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[optind - 1][0], pfound->name); #endif } #if defined _LIBC && defined USE_IN_LIBIO if (n >= 0) { if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); } #endif } nextchar += strlen (nextchar); optopt = pfound->val; return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("\ %s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]) >= 0) { if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); } #else fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); #endif } nextchar += strlen (nextchar); optopt = pfound->val; return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } /* Can't find it as a long option. If this is not getopt_long_only, or the option starts with '--' or is not a valid short option, then it's an error. Otherwise interpret it as a short option. */ if (!long_only || argv[optind][1] == '-' || my_index (optstring, *nextchar) == NULL) { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; int n; #endif if (argv[optind][1] == '-') { /* --option */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("%s: unrecognized option `--%s'\n"), argv[0], nextchar); #else fprintf (stderr, _("%s: unrecognized option `--%s'\n"), argv[0], nextchar); #endif } else { /* +option or -option */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[optind][0], nextchar); #else fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[optind][0], nextchar); #endif } #if defined _LIBC && defined USE_IN_LIBIO if (n >= 0) { if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); } #endif } nextchar = (char *) ""; optind++; optopt = 0; return '?'; } } /* Look at and handle the next short option-character. */ { char c = *nextchar++; char *temp = my_index (optstring, c); /* Increment `optind' when we start to process its last character. */ if (*nextchar == '\0') ++optind; if (temp == NULL || c == ':') { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; int n; #endif if (posixly_correct) { /* 1003.2 specifies the format of this message. */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("%s: illegal option -- %c\n"), argv[0], c); #else fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); #endif } else { #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("%s: invalid option -- %c\n"), argv[0], c); #else fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); #endif } #if defined _LIBC && defined USE_IN_LIBIO if (n >= 0) { if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); } #endif } optopt = c; return '?'; } /* Convenience. Treat POSIX -W foo same as long option --foo */ if (temp[0] == 'W' && temp[1] == ';') { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = 0; int option_index; /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (print_errors) { /* 1003.2 specifies the format of this message. */ #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("%s: option requires an argument -- %c\n"), argv[0], c) >= 0) { if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); } #else fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); #endif } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; return c; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; /* optarg is now the argument, see if it's in the table of longopts. */ for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("%s: option `-W %s' is ambiguous\n"), argv[0], argv[optind]) >= 0) { if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); } #else fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), argv[0], argv[optind]); #endif } nextchar += strlen (nextchar); optind++; return '?'; } if (pfound != NULL) { option_index = indfound; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("\ %s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name) >= 0) { if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); } #else fprintf (stderr, _("\ %s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name); #endif } nextchar += strlen (nextchar); return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("\ %s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]) >= 0) { if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); } #else fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); #endif } nextchar += strlen (nextchar); return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } nextchar = NULL; return 'W'; /* Let the application handle it. */ } if (temp[1] == ':') { if (temp[2] == ':') { /* This is an option that accepts an argument optionally. */ if (*nextchar != '\0') { optarg = nextchar; optind++; } else optarg = NULL; nextchar = NULL; } else { /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (print_errors) { /* 1003.2 specifies the format of this message. */ #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("\ %s: option requires an argument -- %c\n"), argv[0], c) >= 0) { if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); } #else fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); #endif } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; nextchar = NULL; } } return c; } } int getopt (argc, argv, optstring) int argc; char *const *argv; const char *optstring; { return _getopt_internal (argc, argv, optstring, (const struct option *) 0, (int *) 0, 0); } #endif /* Not ELIDE_CODE. */ #ifdef TEST /* Compile with -DTEST to make an executable for use in testing the above definition of `getopt'. */ int main (argc, argv) int argc; char **argv; { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; c = getopt (argc, argv, "abc:d:0123456789"); if (c == -1) break; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ #endif /* !HAVE_GETOPT_LONG */ sane-backends-extras-1.0.22.3ubuntu1/lib/Makefile.in0000664000000000000000000004204511527266663017011 0ustar # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = lib DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/byteorder.m4 \ $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/sane/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libfelib_la_LIBADD = am_libfelib_la_OBJECTS = getopt.lo getopt1.lo md5.lo vsyslog.lo libfelib_la_OBJECTS = $(am_libfelib_la_OBJECTS) liblib_la_LIBADD = am_liblib_la_OBJECTS = alloca.lo getenv.lo inet_ntop.lo inet_pton.lo \ isfdtype.lo sigprocmask.lo snprintf.lo strcasestr.lo strdup.lo \ strndup.lo strsep.lo usleep.lo liblib_la_OBJECTS = $(am_liblib_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include/sane depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libfelib_la_SOURCES) $(liblib_la_SOURCES) DIST_SOURCES = $(libfelib_la_SOURCES) $(liblib_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AWK = @AWK@ BACKEND_CONFS_ENABLED = @BACKEND_CONFS_ENABLED@ BACKEND_LIBS_ENABLED = @BACKEND_LIBS_ENABLED@ BACKEND_MANS_ENABLED = @BACKEND_MANS_ENABLED@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISTCLEAN_FILES = @DISTCLEAN_FILES@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DVIPS = @DVIPS@ DYNAMIC_FLAG = @DYNAMIC_FLAG@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GPHOTO2_CPPFLAGS = @GPHOTO2_CPPFLAGS@ GPHOTO2_LDFLAGS = @GPHOTO2_LDFLAGS@ GPHOTO2_LIBS = @GPHOTO2_LIBS@ GREP = @GREP@ HAVE_GPHOTO2 = @HAVE_GPHOTO2@ IEEE1284_LIBS = @IEEE1284_LIBS@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_LOCKPATH = @INSTALL_LOCKPATH@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JPEG_LIBS = @JPEG_LIBS@ LATEX = @LATEX@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUSB_1_0_CFLAGS = @LIBUSB_1_0_CFLAGS@ LIBUSB_1_0_LIBS = @LIBUSB_1_0_LIBS@ LIBV4L_CFLAGS = @LIBV4L_CFLAGS@ LIBV4L_LIBS = @LIBV4L_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LOCKPATH_GROUP = @LOCKPATH_GROUP@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINDEX = @MAKEINDEX@ MAKEINFO = @MAKEINFO@ MATH_LIB = @MATH_LIB@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ NUMBER_VERSION = @NUMBER_VERSION@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PRELOADABLE_BACKENDS = @PRELOADABLE_BACKENDS@ PRELOADABLE_BACKENDS_ENABLED = @PRELOADABLE_BACKENDS_ENABLED@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RESMGR_LIBS = @RESMGR_LIBS@ SANEI_SANEI_JPEG_LO = @SANEI_SANEI_JPEG_LO@ SANE_CONFIG_PATH = @SANE_CONFIG_PATH@ SCSI_LIBS = @SCSI_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SNMP_CONFIG_PATH = @SNMP_CONFIG_PATH@ SOCKET_LIBS = @SOCKET_LIBS@ STRICT_LDFLAGS = @STRICT_LDFLAGS@ STRIP = @STRIP@ SYSLOG_LIBS = @SYSLOG_LIBS@ TIFF_LIBS = @TIFF_LIBS@ USB_LIBS = @USB_LIBS@ VERSION = @VERSION@ V_MAJOR = @V_MAJOR@ V_MINOR = @V_MINOR@ V_REV = @V_REV@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ configdir = @configdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ effective_target = @effective_target@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ locksanedir = @locksanedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I. -I$(top_builddir)/include -I$(top_srcdir)/include noinst_LTLIBRARIES = liblib.la libfelib.la libfelib_la_SOURCES = getopt.c getopt1.c md5.c vsyslog.c liblib_la_SOURCES = alloca.c getenv.c inet_ntop.c inet_pton.c \ isfdtype.c sigprocmask.c snprintf.c strcasestr.c strdup.c \ strndup.c strsep.c usleep.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libfelib.la: $(libfelib_la_OBJECTS) $(libfelib_la_DEPENDENCIES) $(LINK) $(libfelib_la_OBJECTS) $(libfelib_la_LIBADD) $(LIBS) liblib.la: $(liblib_la_OBJECTS) $(liblib_la_DEPENDENCIES) $(LINK) $(liblib_la_OBJECTS) $(liblib_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alloca.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getenv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet_ntop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet_pton.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isfdtype.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigprocmask.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snprintf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strcasestr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strdup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strndup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strsep.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/usleep.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vsyslog.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: 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_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # 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: sane-backends-extras-1.0.22.3ubuntu1/lib/snprintf.c0000664000000000000000000003631511475557446016762 0ustar #include "../include/sane/config.h" #ifndef HAVE_SNPRINTF /*************************************************************************** * LPRng - An Extended Print Spooler System * * Copyright 1988-1997, Patrick Powell, San Diego, CA * papowell@sdsu.edu * See below for conditions of use. * *************************************************************************** * MODULE: snprintf.c * PURPOSE: LPRng version of printf - absolutely bombproof (hopefully!) **************************************************************************/ #if 0 The "Artistic License" Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder as specified below. "Copyright Holder" is whoever is named in the copyright or copyrights for the package. "You" is you, if you are thinking about copying or distributing this Package. "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as uunet.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) give non-standard executables non-standard names, and clearly document the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 7. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End #include "lp.h" #endif #include #include #include #define HAVE_STDARGS /* let's hope that works everywhere (mj) */ #define VA_LOCAL_DECL va_list ap; #define VA_START(f) va_start(ap, f) #define VA_SHIFT(v,t) ; /* no-op for ANSI */ #define VA_END va_end(ap) /**** ENDINCLUDE ****/ static char *const _id = "$Id$"; /* * dopr(): poor man's version of doprintf */ static char * plp_Errormsg ( int err ); static void dopr( char *buffer, const char *format, va_list args ); static void fmtstr( char *value, int ljust, int len, int zpad, int precision ); static void fmtnum( long value, int base, int dosign, int ljust, int len, int zpad, int precision ); static void fmtdouble( int fmt, double value, int ljust, int len, int zpad, int precision ); static void dostr( char * ); static char *output; static void dopr_outch( int c ); static char *end; int visible_control = 1; /************************************************************** * Original: * Patrick Powell Tue Apr 11 09:48:21 PDT 1995 * A bombproof version of doprnt (dopr) included. * Sigh. This sort of thing is always nasty do deal with. Note that * the version here does not include floating point... * * plp_snprintf() is used instead of sprintf() as it does limit checks * for string length. This covers a nasty loophole. * * The other functions are there to prevent NULL pointers from * causing nast effects. **************************************************************/ int vsnprintf(char *str, size_t count, const char *fmt, va_list args) { str[0] = 0; end = str+count-1; dopr( str, fmt, args ); if( count>0 ){ end[0] = 0; } return(strlen(str)); } /* VARARGS3 */ #ifdef HAVE_STDARGS int snprintf (char *str,size_t count,const char *fmt,...) #else int snprintf (va_alist) va_dcl #endif { #ifndef HAVE_STDARGS char *str; size_t count; char *fmt; #endif VA_LOCAL_DECL VA_START (fmt); VA_SHIFT (str, char *); VA_SHIFT (count, size_t ); VA_SHIFT (fmt, char *); (void) vsnprintf ( str, count, fmt, ap); VA_END; return( strlen( str ) ); } static void dopr( char *buffer, const char *format, va_list args ) { int ch; long value; int longflag = 0; char *strvalue; int ljust; int len; int zpad; int precision; int set_precision; double dval; int err = errno; output = buffer; while( (ch = *format++) ){ switch( ch ){ case '%': ljust = len = zpad = 0; precision = -1; set_precision = 0; nextch: ch = *format++; switch( ch ){ case 0: dostr( "**end of format**" ); return; case '-': ljust = 1; goto nextch; case '.': set_precision = 1; precision = 0; goto nextch; case '*': len = va_arg( args, int ); goto nextch; case '0': /* set zero padding if len not set */ if(len==0 && set_precision == 0 ) zpad = '0'; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if( set_precision ){ precision = precision*10 + ch - '0'; } else { len = len*10 + ch - '0'; } goto nextch; case 'l': longflag = 1; goto nextch; case 'u': case 'U': /*fmtnum(value,base,dosign,ljust,len, zpad, precision) */ if( longflag ){ value = va_arg( args, long ); } else { value = va_arg( args, int ); } fmtnum( value, 10,0, ljust, len, zpad, precision ); break; case 'o': case 'O': /*fmtnum(value,base,dosign,ljust,len, zpad, precision) */ if( longflag ){ value = va_arg( args, long ); } else { value = va_arg( args, int ); } fmtnum( value, 8,0, ljust, len, zpad, precision ); break; case 'd': case 'D': if( longflag ){ value = va_arg( args, long ); } else { value = va_arg( args, int ); } fmtnum( value, 10,1, ljust, len, zpad, precision ); break; case 'x': if( longflag ){ value = va_arg( args, long ); } else { value = va_arg( args, int ); } fmtnum( value, 16,0, ljust, len, zpad, precision ); break; case 'X': if( longflag ){ value = va_arg( args, long ); } else { value = va_arg( args, int ); } fmtnum( value,-16,0, ljust, len, zpad, precision ); break; case 's': strvalue = va_arg( args, char *); fmtstr( strvalue,ljust,len, zpad, precision ); break; case 'c': ch = va_arg( args, int ); { char b[2]; int vsb = visible_control; b[0] = ch; b[1] = 0; visible_control = 0; fmtstr( b,ljust,len, zpad, precision ); visible_control = vsb; } break; case 'f': case 'g': dval = va_arg( args, double ); fmtdouble( ch, dval,ljust,len, zpad, precision ); break; case 'm': fmtstr( plp_Errormsg(err),ljust,len, zpad, precision ); break; case '%': dopr_outch( ch ); continue; default: dostr( "???????" ); } longflag = 0; break; default: dopr_outch( ch ); break; } } *output = 0; } /* * Format '%[-]len[.precision]s' * - = left justify (ljust) * len = minimum length * precision = numbers of chars in string to use */ static void fmtstr( char *value, int ljust, int len, int zpad, int precision ) { int padlen, strlen, i, c; /* amount to pad */ if( value == 0 ){ value = ""; } if( precision > 0 ){ strlen = precision; } else { /* cheap strlen so you do not have library call */ for( strlen = 0; (c=value[strlen]); ++ strlen ){ if( visible_control && iscntrl( c ) && !isspace( c ) ){ ++strlen; } } } padlen = len - strlen; if( padlen < 0 ) padlen = 0; if( ljust ) padlen = -padlen; while( padlen > 0 ) { dopr_outch( ' ' ); --padlen; } /* output characters */ for( i = 0; (c = value[i]); ++i ){ if( visible_control && iscntrl( c ) && !isspace( c ) ){ dopr_outch('^'); c = ('@' | (c & 0x1F)); } dopr_outch(c); } while( padlen < 0 ) { dopr_outch( ' ' ); ++padlen; } } static void fmtnum( long value, int base, int dosign, int ljust, int len, int zpad, int precision ) { int signvalue = 0; unsigned long uvalue; char convert[20]; int place = 0; int padlen = 0; /* amount to pad */ int caps = 0; /* DEBUGP(("value 0x%x, base %d, dosign %d, ljust %d, len %d, zpad %d\n", value, base, dosign, ljust, len, zpad )); */ uvalue = value; if( dosign ){ if( value < 0 ) { signvalue = '-'; uvalue = -value; } } if( base < 0 ){ caps = 1; base = -base; } do{ convert[place++] = (caps? "0123456789ABCDEF":"0123456789abcdef") [uvalue % (unsigned)base ]; uvalue = (uvalue / (unsigned)base ); }while(uvalue); convert[place] = 0; padlen = len - place; if( padlen < 0 ) padlen = 0; if( ljust ) padlen = -padlen; /* DEBUGP(( "str '%s', place %d, sign %c, padlen %d\n", convert,place,signvalue,padlen)); */ if( zpad && padlen > 0 ){ if( signvalue ){ dopr_outch( signvalue ); --padlen; signvalue = 0; } while( padlen > 0 ){ dopr_outch( zpad ); --padlen; } } while( padlen > 0 ) { dopr_outch( ' ' ); --padlen; } if( signvalue ) dopr_outch( signvalue ); while( place > 0 ) dopr_outch( convert[--place] ); while( padlen < 0 ){ dopr_outch( ' ' ); ++padlen; } } static void fmtdouble( int fmt, double value, int ljust, int len, int zpad, int precision ) { char convert[128]; char fmtstr[128]; int l; if( len == 0 ) len = 10; if( len > sizeof(convert) - 10 ){ len = sizeof(convert) - 10; } if( precision > sizeof(convert) - 10 ){ precision = sizeof(convert) - 10; } if( precision > len ) precision = len; strcpy( fmtstr, "%" ); if( ljust ) strcat(fmtstr, "-" ); if( len ){ sprintf( fmtstr+strlen(fmtstr), "%d", len ); } if( precision > 0 ){ sprintf( fmtstr+strlen(fmtstr), ".%d", precision ); } l = strlen( fmtstr ); fmtstr[l] = fmt; fmtstr[l+1] = 0; sprintf( convert, fmtstr, value ); dostr( convert ); } static void dostr( char *str ) { while(*str) dopr_outch(*str++); } static void dopr_outch( int c ) { if( end == 0 || output < end ){ *output++ = c; } } /**************************************************************************** * static char *plp_errormsg( int err ) * returns a printable form of the * errormessage corresponding to the valie of err. * This is the poor man's version of sperror(), not available on all systems * Patrick Powell Tue Apr 11 08:05:05 PDT 1995 ****************************************************************************/ /****************************************************************************/ #if !defined(HAVE_STRERROR) # if defined(HAVE_SYS_NERR) # if !defined(HAVE_SYS_NERR_DEF) extern int sys_nerr; # endif # define num_errors (sys_nerr) # else # define num_errors (-1) /* always use "errno=%d" */ # endif # if defined(HAVE_SYS_ERRLIST) # if !defined(HAVE_SYS_ERRLIST_DEF) extern const char *const sys_errlist[]; # endif # else # undef num_errors # define num_errors (-1) /* always use "errno=%d" */ # endif #endif static char * plp_Errormsg ( int err ) { char *cp; #if defined(HAVE_STRERROR) cp = (void *)strerror(err); #else # if defined(HAVE_SYS_ERRLIST) if (err >= 0 && err < num_errors) { cp = (void *)sys_errlist[err]; } else # endif { static char msgbuf[32]; /* holds "errno=%d". */ /* SAFE use of sprintf */ (void) sprintf (msgbuf, "errno=%d", err); cp = msgbuf; } #endif return (cp); } #if defined(TEST) #include int main( void ) { char buffer[128]; char *t; char *test1 = "01234"; errno = 1; plp_snprintf( buffer, sizeof(buffer), (t="errno '%m'")); printf( "%s = '%s'\n", t, buffer ); plp_snprintf( buffer, sizeof(buffer), (t = "%s"), test1 ); printf( "%s = '%s'\n", t, buffer ); plp_snprintf( buffer, sizeof(buffer), (t = "%12s"), test1 ); printf( "%s = '%s'\n", t, buffer ); plp_snprintf( buffer, sizeof(buffer), (t = "%-12s"), test1 ); printf( "%s = '%s'\n", t, buffer ); plp_snprintf( buffer, sizeof(buffer), (t = "%12.2s"), test1 ); printf( "%s = '%s'\n", t, buffer ); plp_snprintf( buffer, sizeof(buffer), (t = "%-12.2s"), test1 ); printf( "%s = '%s'\n", t, buffer ); plp_snprintf( buffer, sizeof(buffer), (t = "%g"), 1.25 ); printf( "%s = '%s'\n", t, buffer ); plp_snprintf( buffer, sizeof(buffer), (t = "%g"), 1.2345 ); printf( "%s = '%s'\n", t, buffer ); plp_snprintf( buffer, sizeof(buffer), (t = "%12g"), 1.25 ); printf( "%s = '%s'\n", t, buffer ); plp_snprintf( buffer, sizeof(buffer), (t = "%12.2g"), 1.25 ); printf( "%s = '%s'\n", t, buffer ); plp_snprintf( buffer, sizeof(buffer), (t = "%0*d"), 6, 1 ); printf( "%s = '%s'\n", t, buffer ); return(0); } #endif #endif /* HAVE_SNPRINTF */ sane-backends-extras-1.0.22.3ubuntu1/lib/getenv.c0000664000000000000000000000046411475557446016403 0ustar #include "../include/sane/config.h" #ifndef HAVE_GETENV char * getenv(const char *name) { char *retval = 0; #ifdef HAVE_OS2_H if (0 != DosScanEnv (buf, &retval)) retval = 0; #else # error "Missing getenv() on this platform. Please implement." #endif return retval; } #endif /* !HAVE_GETENV */ sane-backends-extras-1.0.22.3ubuntu1/lib/isfdtype.c0000664000000000000000000000075411475557446016744 0ustar #include "../include/sane/config.h" #ifndef HAVE_ISFDTYPE #include int isfdtype(int fd, int fdtype) { struct stat st; if (fstat(fd, &st) == -1) return 0; /* couldn't stat fd */ if (st.st_mode == 0) return 1; /* At least Irix doesn't seem to know socket type */ #if defined(S_ISSOCK) return S_ISSOCK(st.st_mode) != 0; #elif defined(S_IFSOCK) && defined(S_IFMT) return (st.st_mode & S_IFMT) == S_IFSOCK; #else return 0; #endif } #endif /* !HAVE_ISFDTYPE */ sane-backends-extras-1.0.22.3ubuntu1/lib/strdup.c0000664000000000000000000000214711475557446016434 0ustar /* Copyright (C) 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "../include/sane/config.h" #include #include #ifndef HAVE_STRDUP char * strdup (const char * s) { char *clone; size_t size; size = strlen (s) + 1; clone = malloc (size); memcpy (clone, s, size); return clone; } #endif /* !HAVE_STRDUP */ sane-backends-extras-1.0.22.3ubuntu1/lib/vsyslog.c0000664000000000000000000000046211475557446016617 0ustar #include "../include/sane/config.h" #include "stdio.h" #include #include #ifndef HAVE_VSYSLOG void vsyslog(int priority, const char *format, va_list args) { char buf[1024]; vsnprintf(buf, sizeof(buf), format, args); syslog(priority, "%s", buf); } #endif /* !HAVE_VSYSLOG */ sane-backends-extras-1.0.22.3ubuntu1/lib/strcasestr.c0000775000000000000000000000566211475557446017320 0ustar /* Return the offset of one string within another. Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * My personal strstr() implementation that beats most other algorithms. * Until someone tells me otherwise, I assume that this is the * fastest implementation of strstr() in C. * I deliberately chose not to comment it. You should have at least * as much fun trying to understand it, as I had to write it :-). * * Stephen R. van den Berg, berg@pool.informatik.rwth-aachen.de */ /* added strcasestr support, davidm@lineo.com */ #include "../include/sane/config.h" #ifndef HAVE_STRCASESTR #if defined HAVE_STRING_H # include #endif typedef unsigned chartype; #include #define VAL(x) tolower(x) char * strcasestr ( const char *phaystack, const char *pneedle) { register const unsigned char *haystack, *needle; register chartype b, c; haystack = (const unsigned char *) phaystack; needle = (const unsigned char *) pneedle; b = *needle; if (b != '\0') { haystack--; /* possible ANSI violation */ do { c = *++haystack; if (c == '\0') goto ret0; } while (VAL(c) != VAL(b)); c = *++needle; if (c == '\0') goto foundneedle; ++needle; goto jin; for (;;) { register chartype a; register const unsigned char *rhaystack, *rneedle; do { a = *++haystack; if (a == '\0') goto ret0; if (VAL(a) == VAL(b)) break; a = *++haystack; if (a == '\0') goto ret0; shloop:;} while (VAL(a) != VAL(b)); jin:a = *++haystack; if (a == '\0') goto ret0; if (VAL(a) != VAL(c)) goto shloop; rhaystack = haystack-- + 1; rneedle = needle; a = *rneedle; if (VAL(*rhaystack) == VAL(a)) do { if (a == '\0') goto foundneedle; ++rhaystack; a = *++needle; if (VAL(*rhaystack) != VAL(a)) break; if (a == '\0') goto foundneedle; ++rhaystack; a = *++needle; } while (VAL(*rhaystack) == VAL(a)); needle = rneedle; /* took the register-poor approach */ if (a == '\0') break; } } foundneedle: return (char *) haystack; ret0: return 0; } #endif sane-backends-extras-1.0.22.3ubuntu1/lib/inet_pton.c0000664000000000000000000000150711475557446017111 0ustar #include "../include/sane/config.h" #ifndef HAVE_INET_PTON #include #include #include #include #include int inet_pton (int af, const char *src, void *dst) { if (af == AF_INET) { #if defined(HAVE_INET_ATON) int result; struct in_addr in; result = inet_aton (src, &in); if (result) { memcpy (dst, &in.s_addr, sizeof (in.s_addr)); return 1; } else return 0; #elif defined(HAVE_INET_ADDR) # if !defined(INADDR_NONE) # define INADDR_NONE -1 # endif /* !defined(INADDR_NONE) */ u_int32_t in; in = inet_addr (src); if (in != INADDR_NONE) { memcpy (dst, &in, sizeof (in)); return 1; } else return 0; #endif /* defined(HAVE_INET_ATON) */ } return -1; } #endif /* !HAVE_INET_PTON */ sane-backends-extras-1.0.22.3ubuntu1/lib/getopt1.c0000664000000000000000000001124711475557446016477 0ustar /* getopt_long and getopt_long_only entry points for GNU getopt. Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include #if !defined(HAVE_GETOPT_H) || !defined(HAVE_GETOPT_LONG) #ifdef HAVE_CONFIG_H #include #endif #ifdef _LIBC # include #else # include "../include/lgetopt.h" #endif #if !defined __STDC__ || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ #ifndef const #define const #endif #endif #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 #include #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION #define ELIDE_CODE #endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ #include #endif #ifndef NULL #define NULL 0 #endif int getopt_long (argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal (argc, argv, options, long_options, opt_index, 0); } /* Like getopt_long, but '-' as well as '--' can indicate a long option. If an option that starts with '-' (not '--') doesn't match a long option, but does match a short option, it is parsed as a short option instead. */ int getopt_long_only (argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal (argc, argv, options, long_options, opt_index, 1); } # ifdef _LIBC libc_hidden_def (getopt_long) libc_hidden_def (getopt_long_only) # endif #endif /* Not ELIDE_CODE. */ #ifdef TEST #include int main (argc, argv) int argc; char **argv; { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; int option_index = 0; static struct option long_options[] = { {"add", 1, 0, 0}, {"append", 0, 0, 0}, {"delete", 1, 0, 0}, {"verbose", 0, 0, 0}, {"create", 0, 0, 0}, {"file", 1, 0, 0}, {0, 0, 0, 0} }; c = getopt_long (argc, argv, "abc:d:0123456789", long_options, &option_index); if (c == -1) break; switch (c) { case 0: printf ("option %s", long_options[option_index].name); if (optarg) printf (" with arg %s", optarg); printf ("\n"); break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case 'd': printf ("option d with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ #endif /* HAVE_GETOPT_LONG */ sane-backends-extras-1.0.22.3ubuntu1/lib/usleep.c0000664000000000000000000000320711475557446016406 0ustar /* Copyright (C) 1992 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "../include/sane/config.h" #ifndef HAVE_USLEEP #include #ifdef HAVE_SYS_TIME_H # include #endif #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef apollo # include # include static time_$clock_t DomainTime100mS = { 0, 100000/4 }; static status_$t DomainStatus; #endif /* Sleep USECONDS microseconds, or until a previously set timer goes off. */ unsigned int usleep (unsigned int useconds) { #ifdef apollo /* The usleep function does not work under the SYS5.3 environment. Use the Domain/OS time_$wait call instead. */ time_$wait (time_$relative, DomainTime100mS, &DomainStatus); #else struct timeval delay; delay.tv_sec = 0; delay.tv_usec = useconds; select (0, 0, 0, 0, &delay); return 0; #endif } #endif /* !HAVE_USLEEP */ sane-backends-extras-1.0.22.3ubuntu1/lib/Makefile.am0000664000000000000000000000106211475557446016776 0ustar ## Makefile.am -- an automake template for Makefile.in file ## Copyright (C) 2009 Chris Bagwell and Sane Developers. ## ## This file is part of the "Sane" build infra-structure. See ## included LICENSE file for license information. AM_CPPFLAGS = -I. -I$(top_builddir)/include -I$(top_srcdir)/include noinst_LTLIBRARIES = liblib.la libfelib.la libfelib_la_SOURCES = getopt.c getopt1.c md5.c vsyslog.c liblib_la_SOURCES = alloca.c getenv.c inet_ntop.c inet_pton.c \ isfdtype.c sigprocmask.c snprintf.c strcasestr.c strdup.c \ strndup.c strsep.c usleep.c sane-backends-extras-1.0.22.3ubuntu1/compile0000775000000000000000000000717311475557446015563 0ustar #! /bin/sh # Wrapper for compilers which do not understand `-c -o'. scriptversion=2005-05-14.22 # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # Written by Tom Tromey . # # 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand `-c -o'. Remove `-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file `INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; esac ofile= cfile= eat= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as `compile cc -o foo foo.c'. # So we strip `-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no `-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # `.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` # Create the lock directory. # Note: use `[/.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: sane-backends-extras-1.0.22.3ubuntu1/ltmain.sh0000775000000000000000000075777511514441551016033 0ustar # Local changes for sane-backends (search for "Local change"): # 2003-04-30: Henning Meirer-Geinitz # * soname changed to "libsane" for every backend (all systems but AIX) # Generated from ltmain.m4sh. # libtool (GNU libtool) 2.2.10 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.2.10 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . PROGRAM=libtool PACKAGE=libtool VERSION=2.2.10 TIMESTAMP="" package_revision=1.3175 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${EGREP="/bin/grep -E"} : ${FGREP="/bin/grep -F"} : ${GREP="/bin/grep"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SED="/bin/sed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # Generated shell functions inserted here. # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=: for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname${mode+: }$mode: $*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_version # Echo version message to standard output and exit. func_version () { $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $SED -n '/^# Usage:/,/# Report bugs to/ { s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ p }' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { func_error "missing argument for $1." exit_cmd=exit } exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. # $mode is unset nonopt= execute_dlfiles= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 opt_dry_run=false opt_duplicate_deps=false opt_silent=false opt_debug=: # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # Parse options once, thoroughly. This comes as soon as possible in # the script to make things like `libtool --version' happen quickly. { # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Parse non-mode specific arguments: while test "$#" -gt 0; do opt="$1" shift case $opt in --config) func_config ;; --debug) preserve_args="$preserve_args $opt" func_echo "enabling shell trace mode" opt_debug='set -x' $opt_debug ;; -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break execute_dlfiles="$execute_dlfiles $1" shift ;; --dry-run | -n) opt_dry_run=: ;; --features) func_features ;; --finish) mode="finish" ;; --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break case $1 in # Valid mode arguments: clean) ;; compile) ;; execute) ;; finish) ;; install) ;; link) ;; relink) ;; uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac mode="$1" shift ;; --preserve-dup-deps) opt_duplicate_deps=: ;; --quiet|--silent) preserve_args="$preserve_args $opt" opt_silent=: opt_verbose=false ;; --no-quiet|--no-silent) preserve_args="$preserve_args $opt" opt_silent=false ;; --verbose| -v) preserve_args="$preserve_args $opt" opt_silent=false opt_verbose=: ;; --no-verbose) preserve_args="$preserve_args $opt" opt_verbose=false ;; --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break preserve_args="$preserve_args $opt $1" func_enable_tag "$1" # tagname is set here shift ;; # Separate optargs to long options: -dlopen=*|--mode=*|--tag=*) func_opt_split "$opt" set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} shift ;; -\?|-h) func_usage ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --version) func_version ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) nonopt="$opt" break ;; esac done case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_duplicate_deps ;; esac # Having warned about all mis-specified options, bail out if # anything was wrong. $exit_cmd $EXIT_FAILURE } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } ## ----------- ## ## Main. ## ## ----------- ## $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi test -z "$mode" && func_fatal_error "error: you must specify a MODE." # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$mode' for more information." } # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_ltwrapper_scriptname_result="" if func_ltwrapper_executable_p "$1"; then func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" fi } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_quote_for_eval "$arg" CC_quoted="$CC_quoted $func_quote_for_eval_result" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_quote_for_eval "$arg" CC_quoted="$CC_quoted $func_quote_for_eval_result" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T <?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi removelist="$removelist $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist removelist="$removelist $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir command="$command -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then command="$command -o $obj" fi # Suppress compiler output if we already did a PIC compilation. command="$command$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $execute_dlfiles; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_quote_for_eval "$file" args="$args $func_quote_for_eval_result" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" exit $EXIT_SUCCESS } test "$mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" install_prog="$install_prog$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then files="$files $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" install_prog="$install_prog $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi install_shared_prog="$install_shared_prog $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_verbose "extracting global C symbols from \`$progfile'" $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" } done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; " case $host in *cygwin* | *mingw* | *cegcc* ) echo >> "$output_objdir/$my_dlsyms" "\ /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */" lt_dlsym_const= ;; *osf5*) echo >> "$output_objdir/$my_dlsyms" "\ /* This system does not cope well with relocations in const data */" lt_dlsym_const= ;; *) lt_dlsym_const=const ;; esac echo >> "$output_objdir/$my_dlsyms" "\ extern $lt_dlsym_const lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; $lt_dlsym_const lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) symtab_cflags="$symtab_cflags $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then win32_nmres=`eval $NM -f posix -A $1 | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_to_host_path arg # # Convert paths to host format when used with build tools. # Intended for use with "native" mingw (where libtool itself # is running under the msys shell), or in the following cross- # build environments: # $build $host # mingw (msys) mingw [e.g. native] # cygwin mingw # *nix + wine mingw # where wine is equipped with the `winepath' executable. # In the native mingw case, the (msys) shell automatically # converts paths for any non-msys applications it launches, # but that facility isn't available from inside the cwrapper. # Similar accommodations are necessary for $host mingw and # $build cygwin. Calling this function does no harm for other # $host/$build combinations not listed above. # # ARG is the path (on $build) that should be converted to # the proper representation for $host. The result is stored # in $func_to_host_path_result. func_to_host_path () { func_to_host_path_result="$1" if test -n "$1"; then case $host in *mingw* ) lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' case $build in *mingw* ) # actually, msys # awkward: cmd appends spaces to result func_to_host_path_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` ;; *cygwin* ) func_to_host_path_result=`cygpath -w "$1" | $SED -e "$lt_sed_naive_backslashify"` ;; * ) # Unfortunately, winepath does not exit with a non-zero # error code, so we are forced to check the contents of # stdout. On the other hand, if the command is not # found, the shell will set an exit code of 127 and print # *an error message* to stdout. So we must check for both # error code of zero AND non-empty stdout, which explains # the odd construction: func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then func_to_host_path_result=`$ECHO "$func_to_host_path_tmp1" | $SED -e "$lt_sed_naive_backslashify"` else # Allow warning below. func_to_host_path_result= fi ;; esac if test -z "$func_to_host_path_result" ; then func_error "Could not determine host path corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_path_result="$1" fi ;; esac fi } # end: func_to_host_path # func_to_host_pathlist arg # # Convert pathlists to host format when used with build tools. # See func_to_host_path(), above. This function supports the # following $build/$host combinations (but does no harm for # combinations not listed here): # $build $host # mingw (msys) mingw [e.g. native] # cygwin mingw # *nix + wine mingw # # Path separators are also converted from $build format to # $host format. If ARG begins or ends with a path separator # character, it is preserved (but converted to $host format) # on output. # # ARG is a pathlist (on $build) that should be converted to # the proper representation on $host. The result is stored # in $func_to_host_pathlist_result. func_to_host_pathlist () { func_to_host_pathlist_result="$1" if test -n "$1"; then case $host in *mingw* ) lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_pathlist_tmp1=$func_stripname_result case $build in *mingw* ) # Actually, msys. # Awkward: cmd appends spaces to result. func_to_host_pathlist_result=` ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` ;; *cygwin* ) func_to_host_pathlist_result=`cygpath -w -p "$func_to_host_pathlist_tmp1" | $SED -e "$lt_sed_naive_backslashify"` ;; * ) # unfortunately, winepath doesn't convert pathlists func_to_host_pathlist_result="" func_to_host_pathlist_oldIFS=$IFS IFS=: for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do IFS=$func_to_host_pathlist_oldIFS if test -n "$func_to_host_pathlist_f" ; then func_to_host_path "$func_to_host_pathlist_f" if test -n "$func_to_host_path_result" ; then if test -z "$func_to_host_pathlist_result" ; then func_to_host_pathlist_result="$func_to_host_path_result" else func_append func_to_host_pathlist_result ";$func_to_host_path_result" fi fi fi done IFS=$func_to_host_pathlist_oldIFS ;; esac if test -z "$func_to_host_pathlist_result"; then func_error "Could not determine the host path(s) corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This may break if $1 contains DOS-style drive # specifications. The fix is not to complicate the expression # below, but for the user to provide a working wine installation # with winepath so that path translation in the cross-to-mingw # case works properly. lt_replace_pathsep_nix_to_dos="s|:|;|g" func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ $SED -e "$lt_replace_pathsep_nix_to_dos"` fi # Now, add the leading and trailing path separators back case "$1" in :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" ;; esac case "$1" in *: ) func_append func_to_host_pathlist_result ";" ;; esac ;; esac fi } # end: func_to_host_pathlist # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -e 's/\([\\"]\)/\\\1/g' \ -e 's/^/ fputs ("/' -e 's/$/\\n", f);/' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) deplibs="$deplibs $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) weak_libs="$weak_libs $arg" prev= continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname '-L' '' "$arg" dir=$func_stripname_result if test -z "$dir"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot) compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" arg="$arg $func_quote_for_eval_result" compiler_flags="$compiler_flags $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" arg="$arg $wl$func_quote_for_eval_result" compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" linker_flags="$linker_flags $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" compiler_flags="$compiler_flags $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_duplicate_deps ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= case $lib in *.la) func_source "$lib" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) deplibs="$deplibs $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else compiler_flags="$compiler_flags $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" dir=$func_stripname_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) temp_rpath="$temp_rpath$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded notinst_deplibs="$notinst_deplibs $lib" need_relink=no ;; *) if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_dirname "$deplib" "" "." dir="$func_dirname_result" # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" libobjs="$libobjs $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi # Local change for sane-backends: internal name for every lib # is "libsane" not "libsane-backendname". So linking to each # backend is possible. Also the following test was moved to this # location. # If -module or -export-dynamic was specified, set the dlname if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi case $host in *aix*) ;; *) soname=`echo $soname | sed -e "s/libsane-[A-Za-z_0-9]*/libsane/g"` esac # End of local change lib="$output_objdir/$realname" linknames= for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" delfiles="$delfiles $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" func_len " $cmd" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then func_show_eval "$cmd" 'exit $?' skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $convenience libobjs="$libobjs $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do $ECHO "$obj" >> $output done echo ')' >> $output delfiles="$delfiles $output" elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do $ECHO "$obj" >> $output done delfiles="$delfiles $output" output=$firstobj\"$file_list_spec$output\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi delfiles="$delfiles $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $dlprefiles libobjs="$libobjs $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # Local change for sane-backends; moved up # # If -module or -export-dynamic was specified, set the dlname. # if test "$module" = yes || test "$export_dynamic" = yes; then # # On all known operating systems, these are identical. # dlname="$soname" # fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done compile_deplibs="$new_libs" compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then oldobjs="$oldobjs $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $addlibs oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $dlprefiles oldobjs="$oldobjs $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" oldobjs="$oldobjs $gentop/$newobj" ;; *) oldobjs="$oldobjs $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" newdlfiles="$newdlfiles $libdir/$name" ;; *) newdlfiles="$newdlfiles $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" newdlprefiles="$newdlprefiles $libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$mode" = link || test "$mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) RM="$RM $arg"; rmforce=yes ;; -*) RM="$RM $arg" ;; *) files="$files $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= origobjdir="$objdir" for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then objdir="$origobjdir" else objdir="$dir/$origobjdir" fi func_basename "$file" name="$func_basename_result" test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" case "$mode" in clean) case " $library_names " in # " " in the beginning catches empty $dlname *" $dlname "*) ;; *) rmfiles="$rmfiles $objdir/$dlname" ;; esac test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result rmfiles="$rmfiles $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$mode" = uninstall || test "$mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 sane-backends-extras-1.0.22.3ubuntu1/PROJECTS0000664000000000000000000000177711475557446015365 0ustar PROJECTS (2005-10-03) Here is a list of projects that various people have expressed interest in. Before starting working on one of these projects, it may be a good idea to get in touch with the relevant people. Please also read the files AUTHORS and README for projects that are included into the SANE-package. For frontends, look at the sane-frontends package. For backends or stand-alone drivers, add a .desc file or add an entry to unsupported.desc. Status description --------- ---------------------------------------------------------------- wanted Somebody would like to have this feature but can't do it himself. planned Only plans but no code yet. wip Work in progress. There is (more or less) working code. For details, look at the web page or contact the author. SANE on non-Unix platforms: ---------------------------- OS/2 support (wip) http://home.tiscalinet.de/fbakan/sane-os2.htm Misc: ----- TWAIN interface for xsane-win32 (planned) Oliver Rauch sane-backends-extras-1.0.22.3ubuntu1/config.guess0000775000000000000000000012673011600674563016514 0ustar #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011 Free Software Foundation, Inc. timestamp='2011-05-11' # This file 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 of the License, 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., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner. Please send patches (context # diff format) to and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-gnueabi else echo ${UNAME_MACHINE}-unknown-linux-gnueabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-tilera-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp 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` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: sane-backends-extras-1.0.22.3ubuntu1/install-sh0000775000000000000000000001273611475557446016212 0ustar #!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 sane-backends-extras-1.0.22.3ubuntu1/acinclude.m40000664000000000000000000005002611527266724016363 0ustar dnl dnl Contains the following macros dnl SANE_SET_CFLAGS(is_release) dnl SANE_CHECK_MISSING_HEADERS dnl SANE_SET_LDFLAGS dnl SANE_CHECK_DLL_LIB dnl SANE_EXTRACT_LDFLAGS(LIBS, LDFLAGS) dnl SANE_CHECK_JPEG dnl SANE_CHECK_IEEE1284 dnl SANE_CHECK_PTHREAD dnl SANE_CHECK_LOCKING dnl JAPHAR_GREP_CFLAGS(flag, cmd_if_missing, cmd_if_present) dnl SANE_LINKER_RPATH dnl SANE_CHECK_U_TYPES dnl SANE_CHECK_GPHOTO2 dnl SANE_CHECK_IPV6 dnl SANE_CHECK_BACKENDS dnl SANE_PROTOTYPES dnl AC_PROG_LIBTOOL dnl # SANE_SET_CFLAGS(is_release) # Set CFLAGS. Enable/disable compilation warnings if we gcc is used. # Warnings are enabled by default when in development cycle but disabled # when a release is made. The argument is_release is either yes or no. AC_DEFUN([SANE_SET_CFLAGS], [ if test "${ac_cv_c_compiler_gnu}" = "yes"; then NORMAL_CFLAGS="\ -W \ -Wall" WARN_CFLAGS="\ -W \ -Wall \ -Wcast-align \ -Wcast-qual \ -Wmissing-declarations \ -Wmissing-prototypes \ -Wpointer-arith \ -Wreturn-type \ -Wstrict-prototypes \ -pedantic" # Some platforms are overly strict with -ansi enabled. Exclude those. ANSI_FLAG=-ansi case "${host_os}" in solaris* | hpux* | os2* | darwin* | cygwin* | mingw*) ANSI_FLAG= ;; esac WARN_CFLAGS="${WARN_CFLAGS} ${ANSI_FLAG}" AC_ARG_ENABLE(warnings, AC_HELP_STRING([--enable-warnings], [turn on tons of compiler warnings (GCC only)]), [ if eval "test x$enable_warnings = xyes"; then for flag in $WARN_CFLAGS; do JAPHAR_GREP_CFLAGS($flag, [ CFLAGS="$CFLAGS $flag" ]) done else for flag in $NORMAL_CFLAGS; do JAPHAR_GREP_CFLAGS($flag, [ CFLAGS="$CFLAGS $flag" ]) done fi ], [if test x$1 = xno; then # Warnings enabled by default (development) for flag in $WARN_CFLAGS; do JAPHAR_GREP_CFLAGS($flag, [ CFLAGS="$CFLAGS $flag" ]) done else # Warnings disabled by default (release) for flag in $NORMAL_CFLAGS; do JAPHAR_GREP_CFLAGS($flag, [ CFLAGS="$CFLAGS $flag" ]) done fi]) fi # ac_cv_c_compiler_gnu ]) dnl SANE_CHECK_MISSING_HEADERS dnl Do some sanity checks. It doesn't make sense to proceed if those headers dnl aren't present. AC_DEFUN([SANE_CHECK_MISSING_HEADERS], [ MISSING_HEADERS= if test "${ac_cv_header_fcntl_h}" != "yes" ; then MISSING_HEADERS="${MISSING_HEADERS}\"fcntl.h\" " fi if test "${ac_cv_header_sys_time_h}" != "yes" ; then MISSING_HEADERS="${MISSING_HEADERS}\"sys/time.h\" " fi if test "${ac_cv_header_unistd_h}" != "yes" ; then MISSING_HEADERS="${MISSING_HEADERS}\"unistd.h\" " fi if test "${ac_cv_header_stdc}" != "yes" ; then MISSING_HEADERS="${MISSING_HEADERS}\"ANSI C headers\" " fi if test "${MISSING_HEADERS}" != "" ; then echo "*** The following essential header files couldn't be found:" echo "*** ${MISSING_HEADERS}" echo "*** Maybe the compiler isn't ANSI C compliant or not properly installed?" echo "*** For details on what went wrong see config.log." AC_MSG_ERROR([Exiting now.]) fi ]) # SANE_SET_LDFLAGS # Add special LDFLAGS AC_DEFUN([SANE_SET_LDFLAGS], [ # Define stricter linking policy on GNU systems. This is not # added to global LDFLAGS because we may want to create convenience # libraries that don't require such strick linking. if test "$GCC" = yes; then case ${host_os} in linux* | solaris*) STRICT_LDFLAGS="-Wl,-z,defs" ;; esac fi AC_SUBST(STRICT_LDFLAGS) case "${host_os}" in aix*) #enable .so libraries, disable archives LDFLAGS="$LDFLAGS -Wl,-brtl" ;; darwin*) #include frameworks LIBS="$LIBS -framework CoreFoundation -framework IOKit" ;; esac ]) # SANE_CHECK_DLL_LIB # Find dll library AC_DEFUN([SANE_CHECK_DLL_LIB], [ dnl Checks for dll libraries: dl DL_LIBS="" if test "${enable_dynamic}" != "no"; then # dlopen AC_CHECK_HEADERS(dlfcn.h, [AC_CHECK_LIB(dl, dlopen, DL_LIBS=-ldl) saved_LIBS="${LIBS}" LIBS="${LIBS} ${DL_LIBS}" AC_CHECK_FUNCS(dlopen, enable_dynamic=yes,) LIBS="${saved_LIBS}" ],) # HP/UX DLL handling AC_CHECK_HEADERS(dl.h, [AC_CHECK_LIB(dld,shl_load, DL_LIBS=-ldld) saved_LIBS="${LIBS}" LIBS="${LIBS} ${DL_LIBS}" AC_CHECK_FUNCS(shl_load, enable_dynamic=yes,) LIBS="${saved_LIBS}" ],) if test -z "$DL_LIBS" ; then # old Mac OS X/Darwin (without dlopen) AC_CHECK_HEADERS(mach-o/dyld.h, [AC_CHECK_FUNCS(NSLinkModule, enable_dynamic=yes,) ],) fi fi AC_SUBST(DL_LIBS) DYNAMIC_FLAG= if test "${enable_dynamic}" = yes ; then DYNAMIC_FLAG=-module fi AC_SUBST(DYNAMIC_FLAG) ]) # # Separate LIBS from LDFLAGS to link correctly on HP/UX (and other # platforms who care about the order of params to ld. It removes all # non '-l..'-params from passed in $1(LIBS), and appends them to $2(LDFLAGS). # # Use like this: SANE_EXTRACT_LDFLAGS(PKGNAME_LIBS, PKGNAME_LDFLAGS) AC_DEFUN([SANE_EXTRACT_LDFLAGS], [ tmp_LIBS="" for param in ${$1}; do case "${param}" in -l*) tmp_LIBS="${tmp_LIBS} ${param}" ;; *) $2="${$2} ${param}" ;; esac done $1="${tmp_LIBS}" unset tmp_LIBS unset param ]) # # # Checks for ieee1284 library, needed for canon_pp backend. AC_DEFUN([SANE_CHECK_IEEE1284], [ AC_CHECK_HEADER(ieee1284.h, [ AC_CACHE_CHECK([for libieee1284 >= 0.1.5], sane_cv_use_libieee1284, [ AC_TRY_COMPILE([#include ], [ struct parport p; char *buf; ieee1284_nibble_read(&p, 0, buf, 1); ], [sane_cv_use_libieee1284="yes"; IEEE1284_LIBS="-lieee1284" ],[sane_cv_use_libieee1284="no"]) ],) ],) if test "$sane_cv_use_libieee1284" = "yes" ; then AC_DEFINE(HAVE_LIBIEEE1284,1,[Define to 1 if you have the `ieee1284' library (-lcam).]) fi AC_SUBST(IEEE1284_LIBS) ]) # # Checks for pthread support AC_DEFUN([SANE_CHECK_PTHREAD], [ case "${host_os}" in darwin* | mingw*) # currently only enabled on MacOS X on MINGW use_pthread=yes ;; *) use_pthread=no esac have_pthread=no # # now that we have the systems preferences, we check # the user AC_ARG_ENABLE([pthread], AC_HELP_STRING([--enable-pthread], [use pthread instead of fork (default=yes for MacOS X/MINGW, no for everything else)]), [ if test $enableval = yes ; then use_pthread=yes else use_pthread=no fi ]) if test $use_pthread = yes ; then AC_CHECK_HEADERS(pthread.h, [ AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIBS="-lpthread") have_pthread=yes save_LIBS="$LIBS" LIBS="$LIBS $PTHREAD_LIBS" AC_CHECK_FUNCS([pthread_create pthread_kill pthread_join pthread_detach pthread_cancel pthread_testcancel], ,[ have_pthread=no; use_pthread=no ]) LIBS="$save_LIBS" ],) fi if test $use_pthread = yes ; then AC_DEFINE_UNQUOTED(USE_PTHREAD, "$use_pthread", [Define if pthreads should be used instead of forked processes.]) else dnl Reset library in case it was found but we are not going to use it. PTHREAD_LIBS="" fi if test "$have_pthread" = "yes" ; then CPPFLAGS="${CPPFLAGS} -D_REENTRANT" fi AC_SUBST(PTHREAD_LIBS) AC_MSG_CHECKING([whether to enable pthread support]) AC_MSG_RESULT([$have_pthread]) AC_MSG_CHECKING([whether to use pthread instead of fork]) AC_MSG_RESULT([$use_pthread]) ]) # # Checks for jpeg library >= v6B (61), needed for DC210, DC240, # GPHOTO2 and dell1600n_net backends. AC_DEFUN([SANE_CHECK_JPEG], [ AC_CHECK_LIB(jpeg,jpeg_start_decompress, [ AC_CHECK_HEADER(jconfig.h, [ AC_MSG_CHECKING([for jpeglib - version >= 61 (6a)]) AC_EGREP_CPP(sane_correct_jpeg_lib_version_found, [ #include #if JPEG_LIB_VERSION >= 61 sane_correct_jpeg_lib_version_found #endif ], [sane_cv_use_libjpeg="yes"; JPEG_LIBS="-ljpeg"; AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) ],) ],) if test "$sane_cv_use_libjpeg" = "yes" ; then AC_DEFINE(HAVE_LIBJPEG,1,[Define to 1 if you have the libjpeg library.]) fi AC_SUBST(JPEG_LIBS) ]) # Checks for tiff library dell1600n_net backend. AC_DEFUN([SANE_CHECK_TIFF], [ AC_CHECK_LIB(tiff,TIFFFdOpen, [ AC_CHECK_HEADER(tiffio.h, [sane_cv_use_libtiff="yes"; TIFF_LIBS="-ltiff"],) ],) AC_SUBST(TIFF_LIBS) ]) # # Checks for pthread support AC_DEFUN([SANE_CHECK_LOCKING], [ LOCKPATH_GROUP=uucp use_locking=yes case "${host_os}" in os2* ) use_locking=no ;; esac # # we check the user AC_ARG_ENABLE( [locking], AC_HELP_STRING([--enable-locking], [activate device locking (default=yes, but only used by some backends)]), [ if test $enableval = yes ; then use_locking=yes else use_locking=no fi ]) if test $use_locking = yes ; then AC_ARG_WITH([group], AC_HELP_STRING([--with-group], [use the specified group for lock dir @<:@default=uucp@:>@]), [LOCKPATH_GROUP="$withval"] ) # check if the group does exist lasterror="" touch sanetest.file chgrp $LOCKPATH_GROUP sanetest.file 2>/dev/null || lasterror=$? rm -f sanetest.file if test ! -z "$lasterror"; then AC_MSG_WARN([Group $LOCKPATH_GROUP does not exist on this system.]) AC_MSG_WARN([Locking feature will be disabled.]) use_locking=no fi fi if test $use_locking = yes ; then INSTALL_LOCKPATH=install-lockpath AC_DEFINE([ENABLE_LOCKING], 1, [Define to 1 if device locking should be enabled.]) else INSTALL_LOCKPATH= fi AC_MSG_CHECKING([whether to enable device locking]) AC_MSG_RESULT([$use_locking]) if test $use_locking = yes ; then AC_MSG_NOTICE([Setting lockdir group to $LOCKPATH_GROUP]) fi AC_SUBST(INSTALL_LOCKPATH) AC_SUBST(LOCKPATH_GROUP) ]) dnl dnl JAPHAR_GREP_CFLAGS(flag, cmd_if_missing, cmd_if_present) dnl dnl From Japhar. Report changes to japhar@hungry.com dnl AC_DEFUN([JAPHAR_GREP_CFLAGS], [case "$CFLAGS" in "$1" | "$1 "* | *" $1" | *" $1 "* ) ifelse($#, 3, [$3], [:]) ;; *) $2 ;; esac ]) dnl dnl SANE_LINKER_RPATH dnl dnl Detect how to set runtime link path (rpath). Set variable dnl LINKER_RPATH. Typical content will be '-Wl,-rpath,' or '-R '. If dnl set, add '${LINKER_RPATH}${libdir}' to $LDFLAGS dnl AC_DEFUN([SANE_LINKER_RPATH], [dnl AC_REQUIRE([AC_SUBST])dnl This line resulted in an empty AC_SUBST() !! AC_MSG_CHECKING([whether runtime link path should be used]) AC_ARG_ENABLE([rpath], [AS_HELP_STRING([--enable-rpath], [use runtime library search path @<:@default=yes@:>@])]) LINKER_RPATH= AS_IF([test "x$enable_rpath" != xno], AC_MSG_RESULT([yes]) [AC_CACHE_CHECK([linker parameter to set runtime link path], my_cv_LINKER_RPATH, [my_cv_LINKER_RPATH= case "$host_os" in linux* | freebsd* | netbsd* | openbsd* | irix*) # I believe this only works with GNU ld [pere 2001-04-16] my_cv_LINKER_RPATH="-Wl,-rpath," ;; solaris*) my_cv_LINKER_RPATH="-R " ;; esac ]) LINKER_RPATH="$my_cv_LINKER_RPATH"], [AC_MSG_RESULT([no]) LINKER_RPATH=]) AC_SUBST(LINKER_RPATH)dnl ]) dnl dnl SANE_CHECK_U_TYPES dnl AC_DEFUN([SANE_CHECK_U_TYPES], [ dnl Use new style of check types that doesn't take default to use. dnl The old style would add an #undef of the type check on platforms dnl that defined that type... That is not portable to platform that dnl define it as a #define. AC_CHECK_TYPES([u_char, u_short, u_int, u_long],,,) ]) # # Checks for gphoto2 libs, needed by gphoto2 backend AC_DEFUN([SANE_CHECK_GPHOTO2], [ AC_ARG_WITH(gphoto2, AC_HELP_STRING([--with-gphoto2], [include the gphoto2 backend @<:@default=yes@:>@]), [# If --with-gphoto2=no or --without-gphoto2, disable backend # as "$with_gphoto2" will be set to "no"]) # If --with-gphoto2=yes (or not supplied), first check if # pkg-config exists, then use it to check if libgphoto2 is # present. If all that works, then see if we can actually link # a program. And, if that works, then add the -l flags to # GPHOTO2_LIBS and any other flags to GPHOTO2_LDFLAGS to pass to # sane-config. if test "$with_gphoto2" != "no" ; then AC_CHECK_TOOL(HAVE_GPHOTO2, pkg-config, false) if test ${HAVE_GPHOTO2} != "false" ; then if pkg-config --exists libgphoto2 ; then with_gphoto2="`pkg-config --modversion libgphoto2`" GPHOTO2_CPPFLAGS="`pkg-config --cflags libgphoto2`" GPHOTO2_LIBS="`pkg-config --libs libgphoto2`" saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${GPHOTO2_CPPFLAGS}" saved_LIBS="${LIBS}" LIBS="${LIBS} ${GPHOTO2_LIBS}" # Make sure we an really use the library AC_CHECK_FUNCS(gp_camera_init, HAVE_GPHOTO2=true, HAVE_GPHOTO2=false) if test "${HAVE_GPHOTO2}" = "true"; then AC_CHECK_FUNCS(gp_port_info_get_path) fi CPPFLAGS="${saved_CPPFLAGS}" LIBS="${saved_LIBS}" else HAVE_GPHOTO2=false fi if test "${HAVE_GPHOTO2}" = "false"; then GPHOTO2_CPPFLAGS="" GPHOTO2_LIBS="" else SANE_EXTRACT_LDFLAGS(GPHOTO2_LIBS, GPHOTO2_LDFLAGS) fi fi fi AC_SUBST(GPHOTO2_CPPFLAGS) AC_SUBST(GPHOTO2_LIBS) AC_SUBST(GPHOTO2_LDFLAGS) ]) # # Check for AF_INET6, determines whether or not to enable IPv6 support # Check for ss_family member in struct sockaddr_storage AC_DEFUN([SANE_CHECK_IPV6], [ AC_MSG_CHECKING([whether to enable IPv6]) AC_ARG_ENABLE(ipv6, AC_HELP_STRING([--disable-ipv6],[disable IPv6 support]), [ if test "$enableval" = "no" ; then AC_MSG_RESULT([no, manually disabled]) ipv6=no fi ]) if test "$ipv6" != "no" ; then AC_TRY_COMPILE([ #define INET6 #include #include ], [ /* AF_INET6 available check */ if (socket(AF_INET6, SOCK_STREAM, 0) < 0) exit(1); else exit(0); ],[ AC_MSG_RESULT(yes) AC_DEFINE([ENABLE_IPV6], 1, [Define to 1 if the system supports IPv6]) ipv6=yes ],[ AC_MSG_RESULT([no (couldn't compile test program)]) ipv6=no ]) fi if test "$ipv6" != "no" ; then AC_MSG_CHECKING([whether struct sockaddr_storage has an ss_family member]) AC_TRY_COMPILE([ #define INET6 #include #include ], [ /* test if the ss_family member exists in struct sockaddr_storage */ struct sockaddr_storage ss; ss.ss_family = AF_INET; exit (0); ], [ AC_MSG_RESULT(yes) AC_DEFINE([HAS_SS_FAMILY], 1, [Define to 1 if struct sockaddr_storage has an ss_family member]) ], [ AC_TRY_COMPILE([ #define INET6 #include #include ], [ /* test if the __ss_family member exists in struct sockaddr_storage */ struct sockaddr_storage ss; ss.__ss_family = AF_INET; exit (0); ], [ AC_MSG_RESULT([no, but __ss_family exists]) AC_DEFINE([HAS___SS_FAMILY], 1, [Define to 1 if struct sockaddr_storage has __ss_family instead of ss_family]) ], [ AC_MSG_RESULT([no]) ipv6=no ]) ]) fi ]) # # Verifies that values in $BACKENDS and updates FILTERED_BACKEND # with either backends that can be compiled or fails the script. AC_DEFUN([SANE_CHECK_BACKENDS], [ if test "${user_selected_backends}" = "yes"; then DISABLE_MSG="aborting" else DISABLE_MSG="disabling" fi FILTERED_BACKENDS="" for be in ${BACKENDS}; do backend_supported="yes" case $be in plustek_pp) case "$host_os" in gnu*) echo "*** $be backend not supported on GNU/Hurd - $DISABLE_MSG" backend_supported="no" ;; esac ;; dc210|dc240) if test "${sane_cv_use_libjpeg}" != "yes"; then echo "*** $be backend requires JPEG library - $DISABLE_MSG" backend_supported="no" fi ;; canon_pp|hpsj5s) if test "${sane_cv_use_libieee1284}" != "yes"; then echo "*** $be backend requires libieee1284 library - $DISABLE_MSG" backend_supported="no" fi ;; mustek_pp) if test "${sane_cv_use_libieee1284}" != "yes" && test "${enable_parport_directio}" != "yes"; then echo "*** $be backend requires libieee1284 and paraport-directio libraries - $DISABLE_MSG" backend_supported="no" fi ;; dell1600n_net) if test "${sane_cv_use_libjpeg}" != "yes" || test "${sane_cv_use_libtiff}" != "yes"; then echo "*** $be backend requires JPEG and/or TIFF library - $DISABLE_MSG" backend_supported="no" fi ;; gphoto2) if test "${HAVE_GPHOTO2}" != "true" \ -o "${sane_cv_use_libjpeg}" != "yes"; then echo "*** $be backend requires gphoto2 and JPEG libraries - $DISABLE_MSG" backend_supported="no" fi ;; pint) if test "${ac_cv_header_sys_scanio_h}" = "no"; then echo "*** $be backend requires sys/scanio.h - $DISABLE_MSG" backend_supported="no" fi ;; qcam) if test "${ac_cv_func_ioperm}" = "no" \ && test "${ac_cv_func__portaccess}" = "no"; then echo "*** $be backend requires ioperm and portaccess functions - $DISABLE_MSG" backend_supported="no" fi ;; v4l) if test "${have_linux_ioctl_defines}" != "yes" \ || test "${have_libv4l1}" != "yes"; then echo "*** $be backend requires v4l libraries - $DISABLE_MSG" backend_supported="no" fi ;; net) if test "${ac_cv_header_sys_socket_h}" = "no"; then echo "*** $be backend requires sys/socket.h - $DISABLE_MSG" backend_supported="no" fi ;; mustek_usb2) if test "${have_pthread}" != "yes"; then echo "*** $be backend requires pthread library - $DISABLE_MSG" backend_supported="no" fi ;; esac if test "${backend_supported}" = "no"; then if test "${user_selected_backends}" = "yes"; then exit 1 fi else FILTERED_BACKENDS="${FILTERED_BACKENDS} $be" fi done ]) # # Generate prototypes for functions not available on the system AC_DEFUN([SANE_PROTOTYPES], [ AH_BOTTOM([ #if defined(__MINGW32__) #define _BSDTYPES_DEFINED #endif #ifndef HAVE_U_CHAR #define u_char unsigned char #endif #ifndef HAVE_U_SHORT #define u_short unsigned short #endif #ifndef HAVE_U_INT #define u_int unsigned int #endif #ifndef HAVE_U_LONG #define u_long unsigned long #endif /* Prototype for getenv */ #ifndef HAVE_GETENV #define getenv sanei_getenv char * getenv(const char *name); #endif /* Prototype for inet_ntop */ #ifndef HAVE_INET_NTOP #define inet_ntop sanei_inet_ntop #include const char * inet_ntop (int af, const void *src, char *dst, size_t cnt); #endif /* Prototype for inet_pton */ #ifndef HAVE_INET_PTON #define inet_pton sanei_inet_pton int inet_pton (int af, const char *src, void *dst); #endif /* Prototype for isfdtype */ #ifndef HAVE_ISFDTYPE #define isfdtype sanei_isfdtype int isfdtype(int fd, int fdtype); #endif /* Prototype for sigprocmask */ #ifndef HAVE_SIGPROCMASK #define sigprocmask sanei_sigprocmask int sigprocmask (int how, int *new, int *old); #endif /* Prototype for snprintf */ #ifndef HAVE_SNPRINTF #define snprintf sanei_snprintf #include int snprintf (char *str,size_t count,const char *fmt,...); #endif /* Prototype for strcasestr */ #ifndef HAVE_STRCASESTR #define strcasestr sanei_strcasestr char * strcasestr (const char *phaystack, const char *pneedle); #endif /* Prototype for strdup */ #ifndef HAVE_STRDUP #define strdup sanei_strdup char *strdup (const char * s); #endif /* Prototype for strndup */ #ifndef HAVE_STRNDUP #define strndup sanei_strndup #include char *strndup(const char * s, size_t n); #endif /* Prototype for strsep */ #ifndef HAVE_STRSEP #define strsep sanei_strsep char *strsep(char **stringp, const char *delim); #endif /* Prototype for usleep */ #ifndef HAVE_USLEEP #define usleep sanei_usleep unsigned int usleep (unsigned int useconds); #endif /* Prototype for vsyslog */ #ifndef HAVE_VSYSLOG #include void vsyslog(int priority, const char *format, va_list args); #endif ]) ]) m4_include([m4/libtool.m4]) m4_include([m4/byteorder.m4]) m4_include([m4/stdint.m4]) sane-backends-extras-1.0.22.3ubuntu1/PROBLEMS0000664000000000000000000000205711475557446015347 0ustar Last update: 2006-01-05 - Avoiding damage on flatbed scanners Most flatbed scanners have no protection against exceeding the physical scan area height. That is, if a scan is attempted with a height that exceeds the height of the scan surface, the scanner begins making loud noises and the scan mechanism may be damaged. Thus, if you hear such a noise, IMMEDIATELY turn off the scanner. Normally, the backend will ensure that the maximum scan height is not exceeded. However, if your scanner model has not been tested yet this safety-guard may not work. Please report errors like this to the author of the backend or the sane-devel mailing list. - Security problems with saned (SANE network scanning daemon) saned is not intended to be exposed to the internet or other non-trusted networks. Make sure that access is limited by tcpwrappers and/or a firewall setup. Don't depend only on saned's own authentification. Don't run saned as root if it's not necessary. And do not install saned as setuid root. Read man saned(8) for details. sane-backends-extras-1.0.22.3ubuntu1/README0000664000000000000000000001545011475557446015062 0ustar How to configure, build, and install SANE. Introduction: ============= SANE stands for Scanner Access Now Easy. This package contains the SANE libraries (this means backends and network scanning parts) and the command line frontend scanimage. You always find the most recent version of SANE on: http://www.sane-project.org/ At the same location there are also links to snapshots of the CVS server and sometimes beta releases of sane-backends. These are unstable development versions, so be careful when using them. Please report any problems to us. See contact section for details. There are several graphical frontends available for SANE, see the list at http://www.sane-project.org/sane-frontends.html. Quick install: ============== ./configure make make install man sane Prerequisites ============= In order to build SANE, the following tools and libraries are required: - GNU make: version 3.70 or newer - ANSI C compiler: GNU C (gcc) is recommended for best performance, but any ANSI-compliant compiler should do Some more libraries are not strictly necessary to compile SANE, but some functionality may be lost if they are not available. Make sure that these libraries and their respective header files are available before running configure. On some Linux distributions the header files are part of separate packages (e.g. usb.h in libusb-devel or libusb-dev). These must also be installed. - libusb (>=0.1.8): Strongly recommended if you use a USB scanner. Some backends won't work without libusb at all. - libjpeg (>=6B): For the dc210, dc240, and gphoto2 backends. - libieee1284 (>=0.1.5): For some parallel port backends. - libgphoto2 (>=2.0): For the gphoto2 backend. SANE should build on most Unix-like systems. Support for OS/2, MacOS X, BeOS, and Microsoft Windows is also available. For more details look at the operating system specific README.* files. For a detailed support matrix, see: http://www.sane-project.org/sane-support.html This table may be out of date. Please tell us about any corrections or additions. Please mention your operating system and platform and all the other details mentioned in the table. See also the contact section. Please check that there aren't any older versions of SANE installed on your system. Especially if SANE libraries are installed in a different prefix directory (e.g. /usr/lib/) this may cause problems with external frontends. Please remove these libraries (libsane.*, sane/libsane-*) by using your packet manager or manually before installing this version of SANE. Configuration ============= Simply invoke configure in the top-level directory. Besides the usual GNU configure options, there are the following SANE specific options: --disable-shared Don't use shared libraries. Useful for debugging or when there is a problem building shared libraries. This implicitly turns on --disable-dynamic --enable-static as well. --disable-dynamic Disable dynamic loading of backends (in the dll backend). configure normally turns on dynamic loading when it can find the appropriate header files and libraries ( and -dl). --enable-static Use static libraries (turned off by default). --enable-preload Preload backends into DLL backend. This is useful for debugging, when dynamic loading is unavailable, or to reduce runtime linking overheads. If dynamic loading or shared libraries are unavailable or disabled, this option is turned on automatically. --enable-scsibuffersize=N Specify the buffer size of the buffer for SCSI commands. The default value is 131072 bytes (128 kb). This may be changed at runtime by setting the environment variable SANE_SG_BUFFERSIZE to the desired value. The option is Linux-only at this time. --enable-scsibuffersize and SANE_SG_BUFFERSIZE have no effect for the Mustek, Umax and Sharp backends. For these backends, the buffer size is set automatically and/or can be specified in the backend's configuration file. Please refer to the backend's man pages for details. --disable-translations Disable installation of translated backend options. If you get errors in the po/ directory during build, use this option. See po/README for details. --enable-locking Means, that some backends will use a lockfile for allowing multiple access to one scanner. This is useful, i.e. one frontend is scanning the button status and another one will scan. The path to the lock files is define by --localstatedir at the configure step and is $localstatedir/lock/sane. The default group is uucp and can be changed by using --with-group=newgroup. If you do not want any backend to use a lockfile, simply use --disable-locking. In addition to these configuration options, there are some more SANE-specific options and many standard-options. To get a description of available options, invoke configure with option --help. If you plan on debugging one of the SANE programs, we recommend to run configure like this: CFLAGS="-g -O -Wall" ./configure --disable-shared For operating system specific information, look at the README.* files. Build ===== To build SANE, simply type "make" in the top-level directory. To clean up the executables and libraries in the source directory, type "make clean". To restore everything to the status after unpacking the package, type "make distclean". Installation and Configuration ============================== Once the build has finished, install SANE with "make install". By default, this will place the SANE libraries in /usr/local/lib/, the configuration files in /usr/local/etc/sane.d/, and the manual pages in /usr/local/man/. The location of these directories can be overridden with configure options; see "configure --help" for details. Before running any SANE program, read the PROBLEMS file in this directory. For information on configuring and trouble-shooting the various SANE components, please refer to the manual page sane(7). The tools/ directory contains some small programs that may be helpful. They are described in tools/README. Removing ======== Type "make uninstall" to remove SANE from your system. This will also remove older versions of SANE if they have been installed at the same prefix. Warning: Your configuration files will be deleted also so make sure you have a backup. By default the configuration files are located in the directory /usr/local/etc/sane.d/. Contact ======= For questions and general discussion about SANE contact the sane-devel mailing list. You must be subscribed to the list to send mail. See http://www.sane-project.org/mailing-lists.html for details. If you want to submit a bug report or feature request please use our bug tracking system. See http://www.sane-project.org/bugs.html for details. You may also contact the author of a specific backend directly. See the AUTHORS file for a list of addresses. sane-backends-extras-1.0.22.3ubuntu1/sanei/0000775000000000000000000000000011600675053015255 5ustar sane-backends-extras-1.0.22.3ubuntu1/sanei/sanei_config2.c0000664000000000000000000001050611475557446020150 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 1998 David Mosberger This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. This file provides generic configuration support. */ #include "../include/sane/config.h" #include #include #include #include #ifdef __BEOS__ #include #include #include #endif #include "../include/sane/sanei.h" #include "../include/sane/sanei_config.h" #include "../include/sane/sanei_scsi.h" /* This logically belongs to sanei_config.c but not every backend that uses sanei_config() wants to depend on this function. */ void sanei_config_attach_matching_devices (const char *name, SANE_Status (*attach) (const char *dev)) { int bus = -1, channel = -1, id = -1, lun = -1; char *vendor = 0, *model = 0, *type = 0, *end; if (strncmp (name, "scsi", 4) == 0) { name += 4; name = sanei_config_skip_whitespace (name); if (*name) { name = sanei_config_get_string (name, &vendor); if (vendor && strcmp (vendor, "*") == 0) { free (vendor); vendor = 0; } name = sanei_config_skip_whitespace (name); } name = sanei_config_skip_whitespace (name); if (*name) { name = sanei_config_get_string (name, &model); if (model && strcmp (model, "*") == 0) { free (model); model = 0; } name = sanei_config_skip_whitespace (name); } name = sanei_config_skip_whitespace (name); if (*name) { name = sanei_config_get_string (name, &type); if (type && strcmp (type, "*") == 0) { free (type); type = 0; } name = sanei_config_skip_whitespace (name); } if (isdigit (*name)) { bus = strtol (name, &end, 10); name = sanei_config_skip_whitespace (end); } else if (*name == '*') name = sanei_config_skip_whitespace (++name); if (isdigit (*name)) { channel = strtol (name, &end, 10); name = sanei_config_skip_whitespace (end); } else if (*name == '*') name = sanei_config_skip_whitespace (++name); if (isdigit (*name)) { id = strtol (name, &end, 10); name = sanei_config_skip_whitespace (end); } else if (*name == '*') name = sanei_config_skip_whitespace (++name); if (isdigit (*name)) { lun = strtol (name, &end, 10); name = sanei_config_skip_whitespace (end); } else if (*name == '*') name = sanei_config_skip_whitespace (++name); sanei_scsi_find_devices (vendor, model, type, bus, channel, id, lun, attach); if (vendor) free (vendor); if (model) free (model); if (type) free (type); } else (*attach) (name); } sane-backends-extras-1.0.22.3ubuntu1/sanei/sanei_pa4s2.c0000664000000000000000000014334211475557446017557 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 2000-2003 Jochen Eisinger Copyright (C) 2003 James Perry (scsi_pp functions) This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. This file implements an interface for the Mustek PP chipset A4S2 */ /* debug levels: 0 - nothing 1 - errors 2 - warnings 3 - things nice to know 4 - code flow 5 - detailed flow 6 - everything These debug levels can be set using the environment variable SANE_DEBUG_SANEI_PA4S2 */ #include "../include/sane/config.h" #define BACKEND_NAME sanei_pa4s2 #include "../include/sane/sanei_backend.h" /* pick up compatibility defs */ #ifdef HAVE_UNISTD_H #include #endif #if defined(HAVE_LIBIEEE1284) # include #elif defined(ENABLE_PARPORT_DIRECTIO) # if defined(HAVE_SYS_IO_H) # if defined (__ICC) && __ICC >= 700 # define __GNUC__ 2 # endif # include # if defined (__ICC) && __ICC >= 700 # undef __GNUC__ # elif defined(__ICC) && defined(HAVE_ASM_IO_H) # include # endif # elif defined(HAVE_ASM_IO_H) # include /* ugly, but backwards compatible */ # elif defined(HAVE_SYS_HW_H) # include # elif defined(__i386__) && ( defined (__GNUC__) || defined (__ICC) ) static __inline__ void outb (u_char value, u_long port) { __asm__ __volatile__ ("outb %0,%1"::"a" (value), "d" ((u_short) port)); } static __inline__ u_char inb (u_long port) { u_char value; __asm__ __volatile__ ("inb %1,%0":"=a" (value):"d" ((u_short) port)); return value; } # else # define IO_SUPPORT_MISSING # endif #else # define IO_SUPPORT_MISSING #endif /* HAVE_LIBIEEE1284 */ #include "../include/sane/sane.h" #include "../include/sane/sanei.h" #include "../include/sane/sanei_pa4s2.h" #ifdef NDEBUG #define DBG_INIT() /* basically, this is already done in sanei_debug.h... */ #define TEST_DBG_INIT() #else /* !NDEBUG */ static int sanei_pa4s2_dbg_init_called = SANE_FALSE; #if (!defined __GNUC__ || __GNUC__ < 2 || \ __GNUC_MINOR__ < (defined __cplusplus ? 6 : 4)) #define TEST_DBG_INIT() if (sanei_pa4s2_dbg_init_called == SANE_FALSE) \ { \ DBG_INIT(); \ DBG(6, "sanei_pa4s2: interface called for" \ " the first time\n"); \ sanei_pa4s2_dbg_init_called = SANE_TRUE; \ } #else #define TEST_DBG_INIT() if (sanei_pa4s2_dbg_init_called == SANE_FALSE) \ { \ DBG_INIT(); \ DBG(6, "%s: interface called for" \ " the first time\n", __PRETTY_FUNCTION__); \ sanei_pa4s2_dbg_init_called = SANE_TRUE; \ } #endif #endif /* NDEBUG */ #if defined(STDC_HEADERS) # include # include # include #endif #if defined(HAVE_STRING_H) # include #elif defined(HAVE_STRINGS_H) # include #endif #if defined(HAVE_SYS_TYPES_H) # include #endif #include "../include/sane/saneopts.h" #if (defined (HAVE_IOPERM) || defined (HAVE_LIBIEEE1284)) && !defined (IO_SUPPORT_MISSING) #if defined(STDC_HEADERS) # include # include # include #endif #if defined(HAVE_STRING_H) # include #elif defined(HAVE_STRINGS_H) # include #endif #if defined(HAVE_SYS_TYPES_H) # include #endif #include "../include/sane/saneopts.h" #define PA4S2_MODE_NIB 0 #define PA4S2_MODE_UNI 1 #define PA4S2_MODE_EPP 2 #define PA4S2_ASIC_ID_1013 0xA8 #define PA4S2_ASIC_ID_1015 0xA5 #define PA4S2_ASIC_ID_1505 0xA2 typedef struct { #ifndef HAVE_LIBIEEE1284 const char name[6]; u_long base; /* i/o base address */ #endif u_int in_use; /* port in use? */ u_int enabled; /* port enabled? */ u_int mode; /* protocoll */ u_char prelock[3]; /* state of port */ #ifdef HAVE_LIBIEEE1284 int caps; #endif } PortRec, *Port; #if defined (HAVE_LIBIEEE1284) static struct parport_list pplist; static PortRec *port; #else static PortRec port[] = { {"0x378", 0x378, SANE_FALSE, SANE_FALSE, PA4S2_MODE_NIB, {0, 0, 0}}, {"0x278", 0x278, SANE_FALSE, SANE_FALSE, PA4S2_MODE_NIB, {0, 0, 0}}, {"0x3BC", 0x3BC, SANE_FALSE, SANE_FALSE, PA4S2_MODE_NIB, {0, 0, 0}} }; #endif static u_int sanei_pa4s2_interface_options = SANEI_PA4S2_OPT_DEFAULT; extern int setuid (uid_t); /* should also be in unistd.h */ static int pa4s2_open (const char *dev, SANE_Status * status); static void pa4s2_readbegin_epp (int fd, u_char reg); static u_char pa4s2_readbyte_epp (int fd); static void pa4s2_readend_epp (int fd); static void pa4s2_readbegin_uni (int fd, u_char reg); static u_char pa4s2_readbyte_uni (int fd); static void pa4s2_readend_uni (int fd); static void pa4s2_readbegin_nib (int fd, u_char reg); static u_char pa4s2_readbyte_nib (int fd); static void pa4s2_readend_nib (int fd); static void pa4s2_writebyte_any (int fd, u_char reg, u_char val); static int pa4s2_enable (int fd, u_char * prelock); static int pa4s2_disable (int fd, u_char * prelock); static int pa4s2_close (int fd, SANE_Status * status); #if defined (HAVE_LIBIEEE1284) static const char * pa4s2_libieee1284_errorstr(int error) { switch (error) { case E1284_OK: return "Everything went fine"; case E1284_NOTIMPL: return "Not implemented in libieee1284"; case E1284_NOTAVAIL: return "Not available on this system"; case E1284_TIMEDOUT: return "Operation timed out"; case E1284_REJECTED: return "IEEE 1284 negotiation rejected"; case E1284_NEGFAILED: return "Negotiation went wrong"; case E1284_NOMEM: return "No memory left"; case E1284_INIT: return "Error initializing port"; case E1284_SYS: return "Error interfacing system"; case E1284_NOID: return "No IEEE 1284 ID available"; case E1284_INVALIDPORT: return "Invalid port"; default: return "Unknown error"; } } #endif static int pa4s2_init (SANE_Status *status) { static int first_time = SANE_TRUE; #if defined (HAVE_LIBIEEE1284) int result, n; #endif DBG (6, "pa4s2_init: static int first_time = %u\n", first_time); if (first_time == SANE_FALSE) { DBG (5, "pa4s2_init: sanei already initalized\n"); status = SANE_STATUS_GOOD; return 0; } DBG (5, "pa4s2_init: called for the first time\n"); first_time = SANE_FALSE; #if defined (HAVE_LIBIEEE1284) DBG (4, "pa4s2_init: initializing libieee1284\n"); result = ieee1284_find_ports (&pplist, 0); if (result) { DBG (1, "pa4s2_init: initializing IEEE 1284 failed (%s)\n", pa4s2_libieee1284_errorstr (result)); first_time = SANE_TRUE; *status = SANE_STATUS_INVAL; return -1; } DBG (3, "pa4s2_init: %d ports reported by IEEE 1284 library\n", pplist.portc); for (n=0; nname); DBG (6, "pa4s2_init: allocating port list\n"); if ((port = calloc(pplist.portc, sizeof(PortRec))) == NULL) { DBG (1, "pa4s2_init: not enough free memory\n"); ieee1284_free_ports(&pplist); first_time = SANE_TRUE; *status = SANE_STATUS_NO_MEM; return -1; } #else DBG (4, "pa4s2_init: trying to setuid root\n"); if (0 > setuid (0)) { DBG (1, "pa4s2_init: setuid failed: errno = %d\n", errno); DBG (5, "pa4s2_init: returning SANE_STATUS_INVAL\n"); *status = SANE_STATUS_INVAL; first_time = SANE_TRUE; return -1; } DBG (3, "pa4s2_init: the application is now root\n"); DBG (3, "pa4s2_init: this is a high security risk...\n"); DBG (6, "pa4s2_init: ... you'd better start praying\n"); /* PS: no, i don't trust myself either */ /* PPS: i'd try rsbac or similar if i were you */ #endif DBG (5, "pa4s2_init: initialized successfully\n"); *status = SANE_STATUS_GOOD; return 0; } static int pa4s2_open (const char *dev, SANE_Status * status) { int n, result; #if !defined (HAVE_LIBIEEE1284) u_long base; #endif DBG (4, "pa4s2_open: trying to attach dev `%s`\n", dev); if ((result = pa4s2_init(status)) != 0) { DBG (1, "pa4s2_open: failed to initialize\n"); return result; } #if !defined (HAVE_LIBIEEE1284) { char *end; DBG (5, "pa4s2_open: reading port number\n"); base = strtol (dev, &end, 0); if ((end == dev) || (*end != '\0')) { DBG (1, "pa4s2_open: `%s` is not a valid port number\n", dev); DBG (6, "pa4s2_open: the part I did not understand was ...`%s`\n", end); DBG (5, "pa4s2_open: returning SANE_STATUS_INVAL\n"); *status = SANE_STATUS_INVAL; return -1; } } DBG (6, "pa4s2_open: read port number 0x%03lx\n", base); if (base == 0) { DBG (1, "pa4s2_open: 0x%03lx is not a valid base address\n", base); DBG (5, "pa4s2_open: returning SANE_STATUS_INVAL\n"); *status = SANE_STATUS_INVAL; return -1; } #endif DBG (5, "pa4s2_open: looking up port in list\n"); #if defined (HAVE_LIBIEEE1284) for (n = 0; n < pplist.portc; n++) if (!strcmp(pplist.portv[n]->name, dev)) break; if (pplist.portc <= n) { DBG (1, "pa4s2_open: `%s` is not a valid device name\n", dev); DBG (5, "pa4s2_open: returning SANE_STATUS_INVAL\n"); *status = SANE_STATUS_INVAL; return -1; } #else for (n = 0; n < NELEMS (port); n++) if (port[n].base == base) break; if (NELEMS (port) <= n) { DBG (1, "pa4s2_open: 0x%03lx is not a valid base address\n", base); DBG (5, "pa4s2_open: returning SANE_STATUS_INVAL\n"); *status = SANE_STATUS_INVAL; return -1; } #endif DBG (6, "pa4s2_open: port is in list at port[%d]\n", n); if (port[n].in_use == SANE_TRUE) { #if defined (HAVE_LIBIEEE1284) DBG (1, "pa4s2_open: device `%s` is already in use\n", dev); #else DBG (1, "pa4s2_open: port 0x%03lx is already in use\n", base); #endif DBG (5, "pa4s2_open: returning SANE_STATUS_DEVICE_BUSY\n"); *status = SANE_STATUS_DEVICE_BUSY; return -1; } DBG (5, "pa4s2_open: setting up port data\n"); #if defined (HAVE_LIBIEEE1284) DBG (6, "pa4s2_open: name=%s in_use=SANE_TRUE\n", dev); #else DBG (6, "pa4s2_open: base=0x%03lx in_use=SANE_TRUE\n", base); #endif DBG (6, "pa4s2_open: enabled=SANE_FALSE mode=PA4S2_MODE_NIB\n"); port[n].in_use = SANE_TRUE; port[n].enabled = SANE_FALSE; port[n].mode = PA4S2_MODE_NIB; #if defined (HAVE_LIBIEEE1284) DBG (5, "pa4s2_open: opening device\n"); result = ieee1284_open (pplist.portv[n], 0, &port[n].caps); if (result) { DBG (1, "pa4s2_open: could not open device `%s` (%s)\n", dev, pa4s2_libieee1284_errorstr (result)); port[n].in_use = SANE_FALSE; DBG (6, "pa4s2_open: marking port %d as unused\n", n); *status = SANE_STATUS_ACCESS_DENIED; return -1; } #else DBG (5, "pa4s2_open: getting io permissions\n"); /* TODO: insert FreeBSD compatible code here */ if (ioperm (port[n].base, 5, 1)) { DBG (1, "pa4s2_open: cannot get io privilege for port 0x%03lx\n", port[n].base); DBG (5, "pa4s2_open: marking port[%d] as unused\n", n); port[n].in_use = SANE_FALSE; DBG (5, "pa4s2_open: returning SANE_STATUS_IO_ERROR\n"); *status = SANE_STATUS_IO_ERROR; return -1; } #endif DBG (3, "pa4s2_open: device `%s` opened...\n", dev); DBG (5, "pa4s2_open: returning SANE_STATUS_GOOD\n"); *status = SANE_STATUS_GOOD; DBG (4, "pa4s2_open: open dev `%s` as fd %u\n", dev, n); return n; } #if defined(HAVE_LIBIEEE1284) #define inbyte0(fd) ieee1284_read_data(pplist.portv[fd]); #define inbyte1(fd) (ieee1284_read_status(pplist.portv[fd]) ^ S1284_INVERTED) #define inbyte2(fd) (ieee1284_read_control(pplist.portv[fd]) ^ C1284_INVERTED) static u_char inbyte4(int fd) { char val; ieee1284_epp_read_data(pplist.portv[fd], 0, &val, 1); return (u_char)val; } #define outbyte0(fd,val) ieee1284_write_data(pplist.portv[fd], val) #define outbyte1(fd,val) /* ieee1284_write_status(pplist.portv[fd], (val) ^ S1284_INVERTED) */ #define outbyte2(fd,val) ieee1284_write_control(pplist.portv[fd], (val) ^ C1284_INVERTED) static void outbyte3(int fd, u_char val) { ieee1284_epp_write_addr (pplist.portv[fd], 0, (char *)&val, 1); } #else #define inbyte0(fd) inb(port[fd].base) #define inbyte1(fd) inb(port[fd].base + 1) #define inbyte2(fd) inb(port[fd].base + 2) #define inbyte4(fd) inb(port[fd].base + 4) #define outbyte0(fd,val) outb(val, port[fd].base) #define outbyte1(fd,val) outb(val, port[fd].base + 1) #define outbyte2(fd,val) outb(val, port[fd].base + 2) #define outbyte3(fd,val) outb(val, port[fd].base + 3) #endif static void pa4s2_readbegin_epp (int fd, u_char reg) { #if defined(HAVE_LIBIEEE1284) DBG (6, "pa4s2_readbegin_epp: selecting register %u at '%s'\n", (int) reg, pplist.portv[fd]->name); #else DBG (6, "pa4s2_readbegin_epp: selecting register %u at 0x%03lx\n", (int) reg, port[fd].base); #endif outbyte0 (fd, 0x20); outbyte2 (fd, 0x04); outbyte2 (fd, 0x06); outbyte2 (fd, 0x04); outbyte3 (fd, reg + 0x18); } static u_char pa4s2_readbyte_epp (int fd) { u_char val = inbyte4 (fd); #if defined(HAVE_LIBIEEE1284) DBG (6, "pa4s2_readbyte_epp: reading value 0x%02x from '%s'\n", (int) val, pplist.portv[fd]->name); #else DBG (6, "pa4s2_readbyte_epp: reading value 0x%02x at 0x%03lx\n", (int) val, port[fd].base); #endif return val; } static void pa4s2_readend_epp (int fd) { DBG (6, "pa4s2_readend_epp: end of reading sequence\n"); outbyte2 (fd, 0x04); outbyte2 (fd, 0x00); outbyte2 (fd, 0x04); } static void pa4s2_readbegin_uni (int fd, u_char reg) { #if defined(HAVE_LIBIEEE1284) DBG (6, "pa4s2_readbegin_uni: selecting register %u for '%s'\n", (int) reg, pplist.portv[fd]->name); #else DBG (6, "pa4s2_readbegin_uni: selecting register %u at 0x%03lx\n", (int) reg, port[fd].base); #endif outbyte0 (fd, reg | 0x58); outbyte2 (fd, 0x04); outbyte2 (fd, 0x06); outbyte2 (fd, 0x04); outbyte2 (fd, 0x04); } static u_char pa4s2_readbyte_uni (int fd) { u_char val; outbyte2 (fd, 0x05); val = inbyte2(fd); val <<= 4; val &= 0xE0; val |= (inbyte1(fd) >> 3); outbyte2 (fd, 0x04); #if defined(HAVE_LIBIEEE1284) DBG (6, "pa4s2_readbyte_uni: reading value 0x%02x from '%s'\n", (int) val, pplist.portv[fd]->name); #else DBG (6, "pa4s2_readbyte_uni: reading value 0x%02x at 0x%03lx\n", (int) val, port[fd].base); #endif return val; } static void pa4s2_readend_uni (int fd) { DBG (6, "pa4s2_readend_uni: end of reading sequence for fd %d\n", fd); } static void pa4s2_readbegin_nib (int fd, u_char reg) { #if defined(HAVE_LIBIEEE1284) DBG (6, "pa4s2_readbegin_nib: selecting register %u at '%s'\n", (int) reg, pplist.portv[fd]->name); #else DBG (6, "pa4s2_readbegin_nib: selecting register %u at 0x%03lx\n", (int) reg, port[fd].base); #endif outbyte0 (fd, reg | 0x18); outbyte2 (fd, 0x04); outbyte2 (fd, 0x06); outbyte2 (fd, 0x04); outbyte2 (fd, 0x04); } static u_char pa4s2_readbyte_nib (int fd) { u_char val; outbyte2 (fd, 0x05); val = inbyte1(fd); val >>= 4; outbyte0 (fd, 0x58); val |= inbyte1(fd) & 0xF0; val ^= 0x88; outbyte0 (fd, 0x00); outbyte2 (fd, 0x04); #if defined(HAVE_LIBIEEE1284) DBG (6, "pa4s2_readbyte_nib: reading value 0x%02x from '%s'\n", (int) val, pplist.portv[fd]->name); #else DBG (6, "pa4s2_readbyte_nib: reading value 0x%02x at 0x%03lx\n", (int) val, port[fd].base); #endif return val; } static void pa4s2_readend_nib (int fd) { DBG (6, "pa4s2_readend_nib: end of reading sequence for fd %d\n", fd); } static void pa4s2_writebyte_any (int fd, u_char reg, u_char val) { /* somebody from Mustek asked me once, why I was writing the same value repeatedly to a port. Well, actually I don't know, it just works. Maybe the repeated writes could be replaced by appropriate delays or even left out completly. */ #if defined(HAVE_LIBIEEE1284) DBG (6, "pa4s2_writebyte_any: writing value 0x%02x" " in reg %u to '%s'\n", (int) val, (int) reg, pplist.portv[fd]->name); #else DBG (6, "pa4s2_writebyte_any: writing value 0x%02x" " in reg %u at 0x%03lx\n", (int) val, (int) reg, port[fd].base); #endif outbyte0 (fd, reg | 0x10); outbyte2 (fd, 0x04); outbyte2 (fd, 0x06); outbyte2 (fd, 0x06); outbyte2 (fd, 0x06); outbyte2 (fd, 0x06); outbyte2 (fd, 0x04); outbyte2 (fd, 0x04); outbyte0 (fd, val); outbyte2 (fd, 0x05); outbyte2 (fd, 0x05); outbyte2 (fd, 0x05); outbyte2 (fd, 0x04); outbyte2 (fd, 0x04); outbyte2 (fd, 0x04); outbyte2 (fd, 0x04); } static int pa4s2_enable (int fd, u_char * prelock) { #if defined (HAVE_LIBIEEE1284) int result; result = ieee1284_claim (pplist.portv[fd]); if (result) { DBG (1, "pa4s2_enable: failed to claim the port (%s)\n", pa4s2_libieee1284_errorstr(result)); return -1; } #endif prelock[0] = inbyte0 (fd); prelock[1] = inbyte1 (fd); prelock[2] = inbyte2 (fd); outbyte2 (fd, (prelock[2] & 0x0F) | 0x04); DBG (6, "pa4s2_enable: prelock[] = {0x%02x, 0x%02x, 0x%02x}\n", (int) prelock[0], (int) prelock[1], (int) prelock[2]); outbyte0 (fd, 0x15); outbyte0 (fd, 0x95); outbyte0 (fd, 0x35); outbyte0 (fd, 0xB5); outbyte0 (fd, 0x55); outbyte0 (fd, 0xD5); outbyte0 (fd, 0x75); outbyte0 (fd, 0xF5); outbyte0 (fd, 0x01); outbyte0 (fd, 0x81); return 0; } static int pa4s2_disable (int fd, u_char * prelock) { if ((sanei_pa4s2_interface_options & SANEI_PA4S2_OPT_ALT_LOCK) != 0) { DBG (6, "pa4s2_disable: using alternative command set\n"); outbyte0 (fd, 0x00); outbyte2 (fd, 0x04); outbyte2 (fd, 0x06); outbyte2 (fd, 0x04); } outbyte2 (fd, prelock[2] & 0x0F); outbyte0 (fd, 0x15); outbyte0 (fd, 0x95); outbyte0 (fd, 0x35); outbyte0 (fd, 0xB5); outbyte0 (fd, 0x55); outbyte0 (fd, 0xD5); outbyte0 (fd, 0x75); outbyte0 (fd, 0xF5); outbyte0 (fd, 0x00); outbyte0 (fd, 0x80); outbyte0 (fd, prelock[0]); outbyte1 (fd, prelock[1]); outbyte2 (fd, prelock[2]); #if defined(HAVE_LIBIEEE1284) ieee1284_release (pplist.portv[fd]); #endif DBG (6, "pa4s2_disable: state restored\n"); return 0; } static int pa4s2_close (int fd, SANE_Status * status) { #if defined(HAVE_LIBIEEE1284) int result; #endif DBG (4, "pa4s2_close: fd=%d\n", fd); #if defined(HAVE_LIBIEEE1284) DBG (6, "pa4s2_close: this is port '%s'\n", pplist.portv[fd]->name); #else DBG (6, "pa4s2_close: this is port 0x%03lx\n", port[fd].base); #endif DBG (5, "pa4s2_close: checking whether port is enabled\n"); if (port[fd].enabled == SANE_TRUE) { DBG (6, "pa4s2_close: disabling port\n"); pa4s2_disable (fd, port[fd].prelock); } DBG (5, "pa4s2_close: trying to free io port\n"); #if defined(HAVE_LIBIEEE1284) if ((result = ieee1284_close(pplist.portv[fd])) < 0) #else if (ioperm (port[fd].base, 5, 0)) #endif { #if defined(HAVE_LIBIEEE1284) DBG (1, "pa4s2_close: can't free port '%s' (%s)\n", pplist.portv[fd]->name, pa4s2_libieee1284_errorstr(result)); #else DBG (1, "pa4s2_close: can't free port 0x%03lx\n", port[fd].base); #endif DBG (5, "pa4s2_close: returning SANE_STATUS_IO_ERROR\n"); *status = SANE_STATUS_IO_ERROR; return -1; } DBG (5, "pa4s2_close: marking port as unused\n"); port[fd].in_use = SANE_FALSE; DBG (5, "pa4s2_close: returning SANE_STATUS_GOOD\n"); *status = SANE_STATUS_GOOD; return 0; } const char ** sanei_pa4s2_devices() { SANE_Status status; int n; const char **devices; TEST_DBG_INIT(); DBG (4, "sanei_pa4s2_devices: invoked\n"); if ((n = pa4s2_init(&status)) != 0) { DBG (1, "sanei_pa4s2_devices: failed to initialize (%s)\n", sane_strstatus(status)); return calloc(1, sizeof(char *)); } #if defined(HAVE_LIBIEEE1284) if ((devices = calloc((pplist.portc + 1), sizeof(char *))) == NULL) { DBG (2, "sanei_pa4s2_devices: not enough free memory\n"); return calloc(1, sizeof(char *)); } for (n=0; nname; #else if ((devices = calloc((NELEMS (port) + 1), sizeof(char *))) == NULL) { DBG (2, "sanei_pa4s2_devices: not enough free memory\n"); return calloc(1, sizeof(char *)); } for (n=0 ; n= pplist.portc)) #else if ((fd < 0) || (fd >= NELEMS (port))) #endif { DBG (2, "sanei_pa4s2_scsi_pp_get_status: invalid fd %d\n", fd); DBG (6, "sanei_pa4s2_scsi_pp_get_status: returning SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } if (port[fd].in_use == SANE_FALSE) { DBG (2, "sanei_pa4s2_scsi_pp_get_status: port is not in use\n"); #if defined(HAVE_LIBIEEE1284) DBG (4, "sanei_pa4s2_scsi_pp_get_status: port is '%s'\n", pplist.portv[fd]->name); #else DBG (6, "sanei_pa4s2_scsi_pp_get_status: port is 0x%03lx\n", port[fd].base); #endif DBG (5, "sanei_pa4s2_scsi_pp_get_status: returning SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } if (port[fd].enabled == SANE_FALSE) { DBG (2, "sanei_pa4s2_scsi_pp_get_status: port is not enabled\n"); #if defined(HAVE_LIBIEEE1284) DBG (4, "sanei_pa4s2_scsi_pp_get_status: port is '%s'\n", pplist.portv[fd]->name); #else DBG (6, "sanei_pa4s2_scsi_pp_get_status: port is 0x%03lx\n", port[fd].base); #endif DBG (5, "sanei_pa4s2_scsi_pp_get_status: returning SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } outbyte2 (fd, 0x4); stat = inbyte1 (fd)^0x80; *status = (stat&0x2f)|((stat&0x10)<<2)|((stat&0x40)<<1)|((stat&0x80)>>3); DBG (5, "sanei_pa4s2_scsi_pp_get_status: status=0x%02X\n", *status); DBG (6, "sanei_pa4s2_scsi_pp_get_status: returning SANE_STATUS_GOOD\n"); return SANE_STATUS_GOOD; } /* * SCSI-over-parallel scanners need this done when a register is * selected */ SANE_Status sanei_pa4s2_scsi_pp_reg_select (int fd, int reg) { TEST_DBG_INIT (); #if defined(HAVE_LIBIEEE1284) if ((fd < 0) || (fd >= pplist.portc)) #else if ((fd < 0) || (fd >= NELEMS (port))) #endif { DBG (2, "sanei_pa4s2_scsi_pp_reg_select: invalid fd %d\n", fd); DBG (6, "sanei_pa4s2_scsi_pp_reg_select: returning SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } if (port[fd].in_use == SANE_FALSE) { DBG (2, "sanei_pa4s2_scsi_pp_reg_select: port is not in use\n"); #if defined(HAVE_LIBIEEE1284) DBG (4, "sanei_pa4s2_scsi_pp_get_status: port is '%s'\n", pplist.portv[fd]->name); #else DBG (6, "sanei_pa4s2_scsi_pp_get_status: port is 0x%03lx\n", port[fd].base); #endif DBG (5, "sanei_pa4s2_scsi_pp_reg_select: returning SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } if (port[fd].enabled == SANE_FALSE) { DBG (2, "sanei_pa4s2_scsi_pp_reg_select: port is not enabled\n"); #if defined(HAVE_LIBIEEE1284) DBG (4, "sanei_pa4s2_scsi_pp_get_status: port is '%s'\n", pplist.portv[fd]->name); #else DBG (6, "sanei_pa4s2_scsi_pp_get_status: port is 0x%03lx\n", port[fd].base); #endif DBG (5, "sanei_pa4s2_scsi_pp_reg_select: returning SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } #if defined(HAVE_LIBIEEE1284) DBG (6, "sanei_pa4s2_scsi_pp_reg_select: selecting register %u at port '%s'\n", (int) reg, pplist.portv[fd]->name); #else DBG (6, "sanei_pa4s2_scsi_pp_reg_select: selecting register %u at 0x%03lx\n", (int) reg, (u_long)port[fd].base); #endif outbyte0 (fd, reg | 0x58); outbyte2 (fd, 0x04); outbyte2 (fd, 0x06); outbyte2 (fd, 0x04); outbyte2 (fd, 0x04); return SANE_STATUS_GOOD; } /* * The SCSI-over-parallel scanners need to be handled a bit differently * when opened, as they don't return a valid ASIC ID, so this can't be * used for detecting valid read modes */ SANE_Status sanei_pa4s2_scsi_pp_open (const char *dev, int *fd) { u_char val; SANE_Status status; TEST_DBG_INIT (); DBG(4, "sanei_pa4s2_scsi_pp_open: called for device '%s'\n", dev); DBG(5, "sanei_pa4s2_scsi_pp_open: trying to connect to port\n"); if ((*fd = pa4s2_open (dev, &status)) == -1) { DBG (5, "sanei_pa4s2_scsi_pp_open: connection failed\n"); return status; } DBG (6, "sanei_pa4s2_scsi_pp_open: connected to device using fd %u\n", *fd); DBG (5, "sanei_pa4s2_scsi_pp_open: checking for scanner\n"); if (sanei_pa4s2_enable (*fd, SANE_TRUE)!=SANE_STATUS_GOOD) { DBG (3, "sanei_pa4s2_scsi_pp_open: error enabling device\n"); return SANE_STATUS_IO_ERROR; } /* * Instead of checking ASIC ID, check device status */ if (sanei_pa4s2_scsi_pp_get_status(*fd, &val)!=SANE_STATUS_GOOD) { DBG (3, "sanei_pa4s2_scsi_pp_open: error getting device status\n"); sanei_pa4s2_enable (*fd, SANE_FALSE); return SANE_STATUS_IO_ERROR; } val&=0xf0; if ((val==0xf0)||(val&0x40)||(!(val&0x20))) { DBG (3, "sanei_pa4s2_scsi_pp_open: device returned status 0x%02X\n", val); sanei_pa4s2_enable (*fd, SANE_FALSE); return SANE_STATUS_DEVICE_BUSY; } if (sanei_pa4s2_enable (*fd, SANE_FALSE)!=SANE_STATUS_GOOD) { DBG (3, "sanei_pa4s2_scsi_pp_open: error disabling device\n"); return SANE_STATUS_IO_ERROR; } /* FIXME: it would be nice to try to use a better mode here, but how to * know if it's going to work? */ DBG (4, "sanei_pa4s2_scsi_pp_open: returning SANE_STATUS_GOOD\n"); return SANE_STATUS_GOOD; } SANE_Status sanei_pa4s2_open (const char *dev, int *fd) { u_char asic, val; SANE_Status status; TEST_DBG_INIT (); DBG(4, "sanei_pa4s2_open: called for device '%s'\n", dev); DBG(5, "sanei_pa4s2_open: trying to connect to port\n"); if ((*fd = pa4s2_open (dev, &status)) == -1) { DBG (5, "sanei_pa4s2_open: connection failed\n"); return status; } DBG (6, "sanei_pa4s2_open: connected to device using fd %u\n", *fd); DBG (5, "sanei_pa4s2_open: checking for scanner\n"); sanei_pa4s2_enable (*fd, SANE_TRUE); DBG (6, "sanei_pa4s2_open: reading ASIC id\n"); sanei_pa4s2_readbegin (*fd, 0); sanei_pa4s2_readbyte (*fd, &asic); sanei_pa4s2_readend (*fd); switch (asic) { case PA4S2_ASIC_ID_1013: DBG (3, "sanei_pa4s2_open: detected ASIC id 1013\n"); break; case PA4S2_ASIC_ID_1015: DBG (3, "sanei_pa4s2_open: detected ASIC id 1015\n"); break; case PA4S2_ASIC_ID_1505: DBG (3, "sanei_pa4s2_open: detected ASIC id 1505\n"); break; default: DBG (1, "sanei_pa4s2_open: could not find scanner\n"); DBG (3, "sanei_pa4s2_open: reported ASIC id 0x%02x\n", asic); sanei_pa4s2_enable (*fd, SANE_FALSE); DBG (5, "sanei_pa4s2_open: closing port\n"); sanei_pa4s2_close (*fd); DBG (5, "sanei_pa4s2_open: returning SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } sanei_pa4s2_enable (*fd, SANE_FALSE); DBG (4, "sanei_pa4s2_open: trying better modes\n"); while (port[*fd].mode <= PA4S2_MODE_EPP) { if ((port[*fd].mode == PA4S2_MODE_UNI) && ((sanei_pa4s2_interface_options & SANEI_PA4S2_OPT_TRY_MODE_UNI) == 0)) { DBG (3, "sanei_pa4s2_open: skipping mode UNI\n"); port[*fd].mode++; continue; } if ((port[*fd].mode == PA4S2_MODE_EPP) && ((sanei_pa4s2_interface_options & SANEI_PA4S2_OPT_NO_EPP) != 0)) { DBG (3, "sanei_pa4s2_open: skipping mode EPP\n"); break; } DBG (5, "sanei_pa4s2_open: trying mode %u\n", port[*fd].mode); sanei_pa4s2_enable (*fd, SANE_TRUE); sanei_pa4s2_readbegin (*fd, 0); sanei_pa4s2_readbyte (*fd, &val); if (val != asic) { sanei_pa4s2_readend (*fd); sanei_pa4s2_enable (*fd, SANE_FALSE); DBG (5, "sanei_pa4s2_open: mode failed\n"); DBG (6, "sanei_pa4s2_open: returned ASIC-ID 0x%02x\n", (int) val); break; } sanei_pa4s2_readend (*fd); sanei_pa4s2_enable (*fd, SANE_FALSE); DBG (5, "sanei_pa4s2_open: mode works\n"); port[*fd].mode++; } port[*fd].mode--; if ((port[*fd].mode == PA4S2_MODE_UNI) && ((sanei_pa4s2_interface_options & SANEI_PA4S2_OPT_TRY_MODE_UNI) == 0)) { port[*fd].mode--; } DBG (5, "sanei_pa4s2_open: using mode %u\n", port[*fd].mode); DBG (4, "sanei_pa4s2_open: returning SANE_STATUS_GOOD\n"); return SANE_STATUS_GOOD; } void sanei_pa4s2_close (int fd) { SANE_Status status; TEST_DBG_INIT (); DBG (4, "sanei_pa4s2_close: fd = %d\n", fd); #if defined(HAVE_LIBIEEE1284) if ((fd < 0) || (fd >= pplist.portc)) #else if ((fd < 0) || (fd >= NELEMS (port))) #endif { DBG (2, "sanei_pa4s2_close: fd %d is invalid\n", fd); DBG (5, "sanei_pa4s2_close: failed\n"); return; } if (port[fd].in_use == SANE_FALSE) { DBG (2, "sanei_pa4s2_close: port is not in use\n"); #if defined(HAVE_LIBIEEE1284) DBG (6, "sanei_pa4s2_close: port is '%s'\n", pplist.portv[fd]->name); #else DBG (6, "sanei_pa4s2_close: port is 0x%03lx\n", port[fd].base); #endif DBG (5, "sanei_pa4s2_close: failed\n"); return; } DBG (5, "sanei_pa4s2_close: freeing resources\n"); if (pa4s2_close (fd, &status) == -1) { DBG (2, "sanei_pa4s2_close: could not close scanner\n"); DBG (5, "sanei_pa4s2_close: failed\n"); return; } DBG (5, "sanei_pa4s2_close: finished\n"); } SANE_Status sanei_pa4s2_enable (int fd, int enable) { TEST_DBG_INIT (); DBG (4, "sanei_pa4s2_enable: called for fd %d with value %d\n", fd, enable); #if defined(HAVE_LIBIEEE1284) if ((fd < 0) || (fd >= pplist.portc)) #else if ((fd < 0) || (fd >= NELEMS (port))) #endif { DBG (2, "sanei_pa4s2_enable: fd %d is invalid\n", fd); DBG (5, "sanei_pa4s2_enable: returning SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } if (port[fd].in_use == SANE_FALSE) { DBG (2, "sanei_pa4s2_enable: port is not in use\n"); #if defined(HAVE_LIBIEEE1284) DBG (6, "sanei_pa4s2_close: port is '%s'\n", pplist.portv[fd]->name); #else DBG (6, "sanei_pa4s2_close: port is 0x%03lx\n", port[fd].base); #endif DBG (5, "sanei_pa4s2_enable: returning SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } if ((enable != SANE_TRUE) && (enable != SANE_FALSE)) { DBG (2, "sanei_pa4s2_enable: invalid value %d\n", enable); DBG (5, "sanei_pa4s2_enable: returning SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } if ((unsigned int) enable == port[fd].enabled) { DBG (3, "sanei_pa4s2_enable: senseless call...\n"); DBG (4, "sanei_pa4s2_enable: aborting\n"); DBG (5, "sanei_pa4s2_enable: returning SANE_STATUS_GOOD\n"); return SANE_STATUS_GOOD; } if (enable == SANE_TRUE) { #if defined(HAVE_LIBIEEE1284) DBG (4, "sanei_pa4s2_enable: enable port '%s'\n", pplist.portv[fd]->name); #else DBG (4, "sanei_pa4s2_enable: enable port 0x%03lx\n", port[fd].base); /* io-permissions are not inherited after fork (at least not on linux 2.2, although they seem to be inherited on linux 2.4), so we should make sure we get the permission */ if (ioperm (port[fd].base, 5, 1)) { DBG (1, "sanei_pa4s2_enable: cannot get io privilege for port" " 0x%03lx\n", port[fd].base); DBG (5, "sanei_pa4s2_enable:: marking port[%d] as unused\n", fd); port[fd].in_use = SANE_FALSE; DBG (5, "sanei_pa4s2_enable:: returning SANE_STATUS_IO_ERROR\n"); return SANE_STATUS_IO_ERROR; } #endif if (pa4s2_enable (fd, port[fd].prelock) != 0) { DBG (1, "sanei_pa4s2_enable: failed to enable port\n"); DBG (5, "sanei_pa4s2_enable: returning SANE_STATUS_IO_ERROR\n"); return SANE_STATUS_IO_ERROR; } } else { #if defined(HAVE_LIBIEEE1284) DBG (4, "sanei_pa4s2_enable: disable port '%s'\n", pplist.portv[fd]->name); #else DBG (4, "sanei_pa4s2_enable: disable port 0x%03lx\n", port[fd].base); #endif pa4s2_disable (fd, port[fd].prelock); } port[fd].enabled = enable; DBG (5, "sanei_pa4s2_enable: returning SANE_STATUS_GOOD\n"); return SANE_STATUS_GOOD; } SANE_Status sanei_pa4s2_readbegin (int fd, u_char reg) { TEST_DBG_INIT (); DBG (4, "sanei_pa4s2_readbegin: called for fd %d and register %u\n", fd, (int) reg); #if defined(HAVE_LIBIEEE1284) if ((fd < 0) || (fd >= pplist.portc)) #else if ((fd < 0) || (fd >= NELEMS (port))) #endif { DBG (2, "sanei_pa4s2_readbegin: invalid fd %d\n", fd); DBG (5, "sanei_pa4s2_readbegin: returning SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } if (port[fd].in_use == SANE_FALSE) { DBG (2, "sanei_pa4s2_readbegin: port is not in use\n"); #if defined(HAVE_LIBIEEE1284) DBG (6, "sanei_pa4s2_close: port is '%s'\n", pplist.portv[fd]->name); #else DBG (6, "sanei_pa4s2_close: port is 0x%03lx\n", port[fd].base); #endif DBG (5, "sanei_pa4s2_readbegin: returning SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } if (port[fd].enabled == SANE_FALSE) { DBG (2, "sanei_pa4s2_readbegin: port is not enabled\n"); #if defined(HAVE_LIBIEEE1284) DBG (6, "sanei_pa4s2_close: port is '%s'\n", pplist.portv[fd]->name); #else DBG (6, "sanei_pa4s2_close: port is 0x%03lx\n", port[fd].base); #endif DBG (5, "sanei_pa4s2_readbegin: returning SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } switch (port[fd].mode) { case PA4S2_MODE_EPP: DBG (5, "sanei_pa4s2_readbegin: EPP readbegin\n"); pa4s2_readbegin_epp (fd, reg); break; case PA4S2_MODE_UNI: DBG (5, "sanei_pa4s2_readbegin: UNI readbegin\n"); pa4s2_readbegin_uni (fd, reg); break; case PA4S2_MODE_NIB: DBG (5, "sanei_pa4s2_readbegin: NIB readbegin\n"); pa4s2_readbegin_nib (fd, reg); break; default: DBG (1, "sanei_pa4s2_readbegin: port info broken\n"); DBG (3, "sanei_pa4s2_readbegin: invalid port mode\n"); #if defined(HAVE_LIBIEEE1284) DBG (6, "sanei_pa4s2_close: port is '%s'\n", pplist.portv[fd]->name); #else DBG (6, "sanei_pa4s2_close: port is 0x%03lx\n", port[fd].base); #endif DBG (5, "sanei_pa4s2_readbegin: return SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } DBG (5, "sanei_pa4s2_readbegin: returning SANE_STATUS_GOOD\n"); return SANE_STATUS_GOOD; } SANE_Status sanei_pa4s2_readbyte (int fd, u_char * val) { TEST_DBG_INIT (); DBG (4, "sanei_pa4s2_readbyte: called with fd %d\n", fd); if (val == NULL) { DBG (1, "sanei_pa4s2_readbyte: got NULL pointer as result buffer\n"); return SANE_STATUS_INVAL; } #if defined(HAVE_LIBIEEE1284) if ((fd < 0) || (fd >= pplist.portc)) #else if ((fd < 0) || (fd >= NELEMS (port))) #endif { DBG (2, "sanei_pa4s2_readbyte: invalid fd %d\n", fd); DBG (5, "sanei_pa4s2_readbyte: returning SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } if (port[fd].in_use == SANE_FALSE) { DBG (2, "sanei_pa4s2_readbyte: port is not in use\n"); #if defined(HAVE_LIBIEEE1284) DBG (6, "sanei_pa4s2_close: port is '%s'\n", pplist.portv[fd]->name); #else DBG (6, "sanei_pa4s2_close: port is 0x%03lx\n", port[fd].base); #endif DBG (5, "sanei_pa4s2_readbyte: returning SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } if (port[fd].enabled == SANE_FALSE) { DBG (2, "sanei_pa4s2_readbyte: port is not enabled\n"); #if defined(HAVE_LIBIEEE1284) DBG (6, "sanei_pa4s2_close: port is '%s'\n", pplist.portv[fd]->name); #else DBG (6, "sanei_pa4s2_close: port is 0x%03lx\n", port[fd].base); #endif DBG (5, "sanei_pa4s2_readbyte: returning SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } DBG (4, "sanei_pa4s2_readbyte: we hope, the backend called\n"); DBG (4, "sanei_pa4s2_readbyte: readbegin, so the port is ok...\n"); DBG (6, "sanei_pa4s2_readbyte: this means, I did not check it - it's\n"); DBG (6, "sanei_pa4s2_readbyte: not my fault, if your PC burns down.\n"); switch (port[fd].mode) { case PA4S2_MODE_EPP: DBG (5, "sanei_pa4s2_readbyte: read in EPP mode\n"); *val = pa4s2_readbyte_epp (fd); break; case PA4S2_MODE_UNI: DBG (5, "sanei_pa4s2_readbyte: read in UNI mode\n"); *val = pa4s2_readbyte_uni (fd); break; case PA4S2_MODE_NIB: DBG (5, "sanei_pa4s2_readbyte: read in NIB mode\n"); *val = pa4s2_readbyte_nib (fd); break; default: DBG (1, "sanei_pa4s2_readbyte: port info broken\n"); DBG (2, "sanei_pa4s2_readbyte: probably the port wasn't" " correct configured...\n"); DBG (3, "sanei_pa4s2_readbyte: invalid port mode\n"); DBG (6, "sanei_pa4s2_readbyte: port mode %u\n", port[fd].mode); DBG (6, "sanei_pa4s2_readbyte: I told you!!!\n"); DBG (5, "sanei_pa4s2_readbyte: return" " SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } DBG (5, "sanei_pa4s2_readbyte: read finished\n"); DBG (6, "sanei_pa4s2_readbyte: got value 0x%02x\n", (int) *val); DBG (5, "sanei_pa4s2_readbyte: returning SANE_STATUS_GOOD\n"); return SANE_STATUS_GOOD; } SANE_Status sanei_pa4s2_readend (int fd) { TEST_DBG_INIT (); DBG (4, "sanei_pa4s2_readend: called for fd %d\n", fd); #if defined(HAVE_LIBIEEE1284) if ((fd < 0) || (fd >= pplist.portc)) #else if ((fd < 0) || (fd >= NELEMS (port))) #endif { DBG (2, "sanei_pa4s2_readend: invalid fd %d\n", fd); DBG (5, "sanei_pa4s2_readend: returning SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } if (port[fd].in_use == SANE_FALSE) { DBG (2, "sanei_pa4s2_readend: port is not in use\n"); #if defined(HAVE_LIBIEEE1284) DBG (6, "sanei_pa4s2_close: port is '%s'\n", pplist.portv[fd]->name); #else DBG (6, "sanei_pa4s2_close: port is 0x%03lx\n", port[fd].base); #endif DBG (5, "sanei_pa4s2_readend: returning SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } if (port[fd].enabled == SANE_FALSE) { DBG (2, "sanei_pa4s2_readend: port is not enabled\n"); #if defined(HAVE_LIBIEEE1284) DBG (6, "sanei_pa4s2_close: port is '%s'\n", pplist.portv[fd]->name); #else DBG (6, "sanei_pa4s2_close: port is 0x%03lx\n", port[fd].base); #endif DBG (5, "sanei_pa4s2_readend: returning SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } DBG (4, "sanei_pa4s2_readend: we hope, the backend called\n"); DBG (4, "sanei_pa4s2_readend: readbegin, so the port is ok...\n"); DBG (6, "sanei_pa4s2_readend: this means, I did not check it - it's\n"); DBG (6, "sanei_pa4s2_readend: not my fault, if your PC burns down.\n"); switch (port[fd].mode) { case PA4S2_MODE_EPP: DBG (5, "sanei_pa4s2_readend: EPP mode readend\n"); pa4s2_readend_epp (fd); break; case PA4S2_MODE_UNI: DBG (5, "sanei_pa4s2_readend: UNI mode readend\n"); pa4s2_readend_uni (fd); break; case PA4S2_MODE_NIB: DBG (5, "sanei_pa4s2_readend: NIB mode readend\n"); pa4s2_readend_nib (fd); break; default: DBG (1, "sanei_pa4s2_readend: port info broken\n"); DBG (2, "sanei_pa4s2_readend: probably the port wasn't" " correct configured...\n"); DBG (3, "sanei_pa4s2_readend: invalid port mode\n"); DBG (6, "sanei_pa4s2_readend: port mode %u\n", port[fd].mode); DBG (6, "sanei_pa4s2_readend: I told you!!!\n"); DBG (5, "sanei_pa4s2_readend: return" " SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } DBG (5, "sanei_pa4s2_readend: returning SANE_STATUS_GOOD\n"); return SANE_STATUS_GOOD; } SANE_Status sanei_pa4s2_writebyte (int fd, u_char reg, u_char val) { TEST_DBG_INIT (); DBG (4, "sanei_pa4s2_writebyte: called for fd %d, reg %u and val %u\n", fd, (int) reg, (int) val); #if defined(HAVE_LIBIEEE1284) if ((fd < 0) || (fd >= pplist.portc)) #else if ((fd < 0) || (fd >= NELEMS (port))) #endif { DBG (2, "sanei_pa4s2_writebyte: invalid fd %d\n", fd); DBG (5, "sanei_pa4s2_writebyte: returning SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } if (port[fd].in_use == SANE_FALSE) { DBG (2, "sanei_pa4s2_writebyte: port is not in use\n"); #if defined(HAVE_LIBIEEE1284) DBG (6, "sanei_pa4s2_close: port is '%s'\n", pplist.portv[fd]->name); #else DBG (6, "sanei_pa4s2_close: port is 0x%03lx\n", port[fd].base); #endif DBG (5, "sanei_pa4s2_writebyte: returning SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } if (port[fd].enabled == SANE_FALSE) { DBG (2, "sanei_pa4s2_writebyte: port is not enabled\n"); #if defined(HAVE_LIBIEEE1284) DBG (6, "sanei_pa4s2_close: port is '%s'\n", pplist.portv[fd]->name); #else DBG (6, "sanei_pa4s2_close: port is 0x%03lx\n", port[fd].base); #endif DBG (5, "sanei_pa4s2_readbegin: returning SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } switch (port[fd].mode) { case PA4S2_MODE_EPP: case PA4S2_MODE_UNI: case PA4S2_MODE_NIB: DBG (5, "sanei_pa4s2_writebyte: NIB/UNI/EPP write\n"); pa4s2_writebyte_any (fd, reg, val); break; default: DBG (1, "sanei_pa4s2_writebyte: port info broken\n"); DBG (3, "sanei_pa4s2_writebyte: invalid port mode\n"); DBG (6, "sanei_pa4s2_writebyte: port mode %u\n", port[fd].mode); DBG (5, "sanei_pa4s2_writebyte: return" " SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } DBG (5, "sanei_pa4s2_writebyte: returning SANE_STATUS_GOOD\n"); return SANE_STATUS_GOOD; } SANE_Status sanei_pa4s2_options (u_int * options, int set) { TEST_DBG_INIT (); DBG (4, "sanei_pa4s2_options: called with options %u and set = %d\n", *options, set); if ((set != SANE_TRUE) && (set != SANE_FALSE)) DBG (2, "sanei_pa4s2_options: value of set is invalid\n"); if ((set == SANE_TRUE) && (*options > 7)) DBG (2, "sanei_pa4s2_options: value of *options is invalid\n"); if (set == SANE_TRUE) { DBG (5, "sanei_pa4s2_options: setting options to %u\n", *options); sanei_pa4s2_interface_options = *options; } else { DBG (5, "sanei_pa4s2_options: options are set to %u\n", sanei_pa4s2_interface_options); *options = sanei_pa4s2_interface_options; } DBG (5, "sanei_pa4s2_options: returning SANE_STATUS_GOOD\n"); return SANE_STATUS_GOOD; } #else /* !HAVE_IOPERM */ SANE_Status sanei_pa4s2_open (const char *dev, int *fd) { TEST_DBG_INIT (); if (fd) *fd = -1; DBG (4, "sanei_pa4s2_open: called for device `%s`\n", dev); DBG (3, "sanei_pa4s2_open: A4S2 support not compiled\n"); DBG (6, "sanei_pa4s2_open: basically, this backend does only compile\n"); DBG (6, "sanei_pa4s2_open: on x86 architectures. Furthermore it\n"); DBG (6, "sanei_pa4s2_open: needs ioperm() and inb()/outb() calls.\n"); DBG (6, "sanei_pa4s2_open: alternativly it makes use of libieee1284\n"); DBG (6, "sanei_pa4s2_open: (which isn't present either)\n"); DBG (5, "sanei_pa4s2_open: returning SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } void sanei_pa4s2_close (int fd) { TEST_DBG_INIT (); DBG (4, "sanei_pa4s2_close: called for fd %d\n", fd); DBG (2, "sanei_pa4s2_close: fd %d is invalid\n", fd); DBG (3, "sanei_pa4s2_close: A4S2 support not compiled\n"); DBG (6, "sanei_pa4s2_close: so I wonder, why this function is called" " anyway.\n"); DBG (6, "sanei_pa4s2_close: maybe this is a bug in the backend.\n"); DBG (5, "sanei_pa4s2_close: returning\n"); return; } SANE_Status sanei_pa4s2_enable (int fd, int enable) { TEST_DBG_INIT (); DBG (4, "sanei_pa4s2_enable: called for fd %d with value=%d\n", fd, enable); DBG (2, "sanei_pa4s2_enable: fd %d is invalid\n", fd); if ((enable != SANE_TRUE) && (enable != SANE_FALSE)) DBG (2, "sanei_pa4s2_enable: value %d is invalid\n", enable); DBG (3, "sanei_pa4s2_enable: A4S2 support not compiled\n"); DBG (6, "sanei_pa4s2_enable: oops, I think there's someone going to\n"); DBG (6, "sanei_pa4s2_enable: produce a lot of garbage...\n"); DBG (5, "sanei_pa4s2_enable: returning SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } SANE_Status sanei_pa4s2_readbegin (int fd, u_char reg) { TEST_DBG_INIT (); DBG (4, "sanei_pa4s2_readbegin: called for fd %d and register %d\n", fd, (int) reg); DBG (2, "sanei_pa4s2_readbegin: fd %d is invalid\n", fd); DBG (3, "sanei_pa4s2_readbegin: A4S2 support not compiled\n"); DBG (6, "sanei_pa4s2_readbegin: don't look - this is going to be\n"); DBG (6, "sanei_pa4s2_readbegin: worse then you'd expect...\n"); DBG (5, "sanei_pa4s2_readbegin: returning SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } SANE_Status sanei_pa4s2_readbyte (int fd, u_char * val) { TEST_DBG_INIT (); if (val) *val = 0; DBG (4, "sanei_pa4s2_readbyte: called for fd %d\n", fd); DBG (2, "sanei_pa4s2_readbyte: fd %d is invalid\n", fd); DBG (3, "sanei_pa4s2_readbyte: A4S2 support not compiled\n"); DBG (6, "sanei_pa4s2_readbyte: shit happens\n"); DBG (5, "sanei_pa4s2_readbyte: returning SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } SANE_Status sanei_pa4s2_readend (int fd) { TEST_DBG_INIT (); DBG (4, "sanei_pa4s2_readend: called for fd %d\n", fd); DBG (2, "sanei_pa4s2_readend: fd %d is invalid\n", fd); DBG (3, "sanei_pa4s2_readend: A4S2 support not compiled\n"); DBG (6, "sanei_pa4s2_readend: it's too late anyway\n"); DBG (5, "sanei_pa4s2_readend: returning SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } SANE_Status sanei_pa4s2_writebyte (int fd, u_char reg, u_char val) { TEST_DBG_INIT (); DBG (4, "sanei_pa4s2_writebyte: called for fd %d and register %d, " "value = %u\n", fd, (int) reg, (int) val); DBG (2, "sanei_pa4s2_writebyte: fd %d is invalid\n", fd); DBG (3, "sanei_pa4s2_writebyte: A4S2 support not compiled\n"); DBG (6, "sanei_pa4s2_writebyte: whatever backend you're using, tell\n"); DBG (6, "sanei_pa4s2_writebyte: the maintainer his code has bugs...\n"); DBG (5, "sanei_pa4s2_writebyte: returning SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } SANE_Status sanei_pa4s2_options (u_int * options, int set) { TEST_DBG_INIT (); DBG (4, "sanei_pa4s2_options: called with options %u and set = %d\n", *options, set); if ((set != SANE_TRUE) && (set != SANE_FALSE)) DBG (2, "sanei_pa4s2_options: value of set is invalid\n"); if ((set == SANE_TRUE) && (*options > 3)) DBG (2, "sanei_pa4s2_options: value of *options is invalid\n"); DBG (3, "sanei_pa4s2_options: A4S2 support not compiled\n"); DBG (5, "sanei_pa4s2_options: returning SANE_STATUS_INVAL\n"); return SANE_STATUS_INVAL; } const char ** sanei_pa4s2_devices() { TEST_DBG_INIT (); DBG (4, "sanei_pa4s2_devices: invoked\n"); DBG (3, "sanei_pa4s2_devices: A4S2 support not compiled\n"); DBG (5, "sanei_pa4s2_devices: returning empty list\n"); return calloc(1, sizeof(char *)); } SANE_Status sanei_pa4s2_scsi_pp_get_status(int fd, u_char *status) { TEST_DBG_INIT (); DBG (4, "sanei_pa4s2_scsi_pp_get_status: fd=%d, status=%p\n", fd, (void *) status); DBG (3, "sanei_pa4s2_scsi_pp_get_status: A4S2 support not compiled\n"); return SANE_STATUS_UNSUPPORTED; } SANE_Status sanei_pa4s2_scsi_pp_reg_select (int fd, int reg) { TEST_DBG_INIT (); DBG (4, "sanei_pa4s2_scsi_pp_reg_select: fd=%d, reg=%d\n", fd, reg); DBG (3, "sanei_pa4s2_devices: A4S2 support not compiled\n"); return SANE_STATUS_UNSUPPORTED; } SANE_Status sanei_pa4s2_scsi_pp_open (const char *dev, int *fd) { TEST_DBG_INIT (); DBG (4, "sanei_pa4s2_scsi_pp_open: dev=%s, fd=%p\n", dev, (void *) fd); DBG (3, "sanei_pa4s2_scsi_pp_open: A4S2 support not compiled\n"); return SANE_STATUS_UNSUPPORTED; } #endif /* !HAVE_IOPERM */ sane-backends-extras-1.0.22.3ubuntu1/sanei/test_wire.c0000664000000000000000000001256611475557446017457 0ustar #include "../include/sane/config.h" #include #include #include #include #include #include "../include/sane/sane.h" #include "../include/sane/sanei.h" #include "../include/sane/sanei_wire.h" #include "../include/sane/sanei_codec_ascii.h" #include "../include/sane/sanei_codec_bin.h" static Wire w; static SANE_Word dpi_word_list[] = { 4, /* # of elements */ 3, 30, 300, -600 }; static SANE_String_Const mode_list[] = { "Lineart", "Grayscale", "Color", 0 }; static char *program_name; static char *default_codec = "bin"; static char *default_outfile = "test_wire.out"; static int usage (int code) { if (code == 0) { printf ("Usage: %s [OPTION]...\n\ \n\ Test the SANE wire manipulation library.\n\ \n\ --codec=CODEC set the codec [default=%s]\n\ --help display this message and exit\n\ -o, --output=FILE set the output file [default=%s]\n\ --readonly do not create FILE, just read it\n\ --version print version information\n\ \n\ Valid CODECs are: `ascii' `bin'\n", program_name, default_codec, default_outfile); } else { fprintf (stderr, "Type ``%s --help'' for more information.\n", program_name); } exit (code); } int main (int argc, char ** argv) { SANE_Option_Descriptor desc[2], *desc_ptr; SANE_Word len; char *codec = default_codec; char *outfile = default_outfile; int readonly = 0; program_name = argv[0]; argv ++; while (*argv != 0) { if (!strcmp (*argv, "--codec")) { if (argv[1] == 0) { fprintf (stderr, "%s: option `%s' requires an argument\n", program_name, *argv); usage (1); } argv ++; codec = *argv; } else if (!strncmp (*argv, "--codec=", 8)) { codec = *argv + 8; } else if (!strcmp (*argv, "--help")) { usage (0); } else if (!strcmp (*argv, "-o") || !strcmp (*argv, "--output")) { if (argv[1] == 0) { fprintf (stderr, "%s: option `%s' requires an argument\n", program_name, *argv); usage (1); } argv ++; outfile = *argv; } else if (!strncmp (*argv, "--output=", 9)) { outfile = *argv + 9; } else if (!strcmp (*argv, "--readonly")) { readonly = 1; } else if (!strcmp (*argv, "--version")) { printf ("test_wire (%s) %s\n", PACKAGE, VERSION); exit (0); } else if (**argv == '-') { fprintf (stderr, "%s: unrecognized option `%s'\n", program_name, *argv); usage (1); } else { fprintf (stderr, "%s: too many arguments\n", program_name); } argv ++; } if (!strcmp (codec, "bin")) sanei_w_init (&w, sanei_codec_bin_init); else if (!strcmp (codec, "ascii")) sanei_w_init (&w, sanei_codec_ascii_init); else { fprintf (stderr, "%s: unknown codec type `%s'\n", program_name, codec); usage (1); } desc[0].name = "resolution"; desc[0].title = 0; desc[0].desc = "Determines scan resolution in dots/inch (\"DPI\")."; desc[0].type = SANE_TYPE_FIXED; desc[0].unit = SANE_UNIT_DPI; desc[0].size = sizeof (SANE_Word); desc[0].cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT; desc[0].constraint_type = SANE_CONSTRAINT_WORD_LIST; desc[0].constraint.word_list = dpi_word_list; desc[1].name = "mode"; desc[1].title ="Scan Mode"; desc[1].desc = "Determines scan mode."; desc[1].type = SANE_TYPE_STRING; desc[1].unit = SANE_UNIT_NONE; desc[1].size = 10; desc[1].cap = (SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT | SANE_CAP_AUTOMATIC); desc[1].constraint_type = SANE_CONSTRAINT_STRING_LIST; desc[1].constraint.string_list = mode_list; { int flags; if (readonly) { printf ("reading %s output from %s\n", codec, outfile); flags = O_RDONLY; } else { printf ("creating %s\n", outfile); flags = O_RDWR | O_CREAT | O_TRUNC; } w.io.fd = open (outfile, flags, 0666); if (w.io.fd < 0) { perror (outfile); return -1; } } w.io.read = read; w.io.write = readonly ? 0 : write; if (!readonly) { sanei_w_set_dir (&w, WIRE_ENCODE); w.status = 0; len = NELEMS(desc); desc_ptr = desc; sanei_w_array (&w, &len, (void **) &desc_ptr, (WireCodecFunc) sanei_w_option_descriptor, sizeof (desc[0])); if (w.status == 0) printf ("%s encode successful\n", codec); else fprintf (stderr, "%s: %s encode error %d: %s\n", codec, program_name, w.status, strerror (w.status)); printf ("%s output written to %s\n", codec, outfile); } sanei_w_set_dir (&w, WIRE_DECODE); w.status = 0; if (!readonly) { printf ("reading %s output from %s\n", codec, outfile); lseek (w.io.fd, 0, SEEK_SET); } sanei_w_array (&w, &len, (void **) &desc_ptr, (WireCodecFunc) sanei_w_option_descriptor, sizeof (desc[0])); if (w.status == 0) printf ("%s decode successful\n", codec); else fprintf (stderr, "%s: %s decode error %d: %s\n", program_name, codec, w.status, strerror (w.status)); sanei_w_set_dir (&w, WIRE_FREE); w.status = 0; sanei_w_array (&w, &len, (void **) &desc_ptr, (WireCodecFunc) sanei_w_option_descriptor, sizeof (desc[0])); if (w.status == 0) printf ("free successful\n"); else fprintf (stderr, "%s: free error %d: %s\n", program_name, w.status, strerror (w.status)); close (w.io.fd); return 0; } sane-backends-extras-1.0.22.3ubuntu1/sanei/sanei_thread.c0000664000000000000000000002531611475557446020075 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 1998-2001 Yuri Dario Copyright (C) 2003-2004 Gerhard Jaeger (pthread/process support) This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. OS/2 Helper functions for the OS/2 port (using threads instead of forked processes). Don't use them in the backends, they are used automatically by macros. Other OS: use this lib, if you intend to let run your reader function within its own task (thread or process). Depending on the OS and/or the configure settings pthread or fork is used to achieve this goal. */ #include "../include/sane/config.h" #include #include #include #include #include #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_OS2_H # define INCL_DOSPROCESS # include #endif #ifdef __BEOS__ # undef USE_PTHREAD /* force */ # include #endif #if !defined USE_PTHREAD && !defined HAVE_OS2_H && !defined __BEOS__ # include #endif #if defined USE_PTHREAD # include #endif #define BACKEND_NAME sanei_thread /**< name of this module for debugging */ #include "../include/sane/sane.h" #include "../include/sane/sanei_debug.h" #include "../include/sane/sanei_thread.h" #ifndef _VAR_NOT_USED # define _VAR_NOT_USED(x) ((x)=(x)) #endif typedef struct { int (*func)( void* ); SANE_Status status; void *func_data; } ThreadDataDef, *pThreadDataDef; static ThreadDataDef td; /** for init issues - here only for the debug output */ void sanei_thread_init( void ) { DBG_INIT(); memset( &td, 0, sizeof(ThreadDataDef)); td.status = SANE_STATUS_GOOD; } SANE_Bool sanei_thread_is_forked( void ) { #if defined USE_PTHREAD || defined HAVE_OS2_H || defined __BEOS__ return SANE_FALSE; #else return SANE_TRUE; #endif } int sanei_thread_kill( SANE_Pid pid ) { DBG(2, "sanei_thread_kill() will kill %ld\n", (long) pid); #ifdef USE_PTHREAD #if defined (__APPLE__) && defined (__MACH__) return pthread_kill((pthread_t)pid, SIGUSR2); #else return pthread_cancel((pthread_t)pid); #endif #elif defined HAVE_OS2_H return DosKillThread(pid); #else return kill( pid, SIGTERM ); #endif } #ifdef HAVE_OS2_H static void local_thread( void *arg ) { pThreadDataDef ltd = (pThreadDataDef)arg; DBG( 2, "thread started, calling func() now...\n" ); ltd->status = ltd->func( ltd->func_data ); DBG( 2, "func() done - status = %d\n", ltd->status ); _endthread(); } /* * starts a new thread or process * parameters: * star address of reader function * args pointer to scanner data structure * */ SANE_Pid sanei_thread_begin( int (*func)(void *args), void* args ) { SANE_Pid pid; td.func = func; td.func_data = args; pid = _beginthread( local_thread, NULL, 1024*1024, (void*)&td ); if ( pid == -1 ) { DBG( 1, "_beginthread() failed\n" ); return -1; } DBG( 2, "_beginthread() created thread %d\n", pid ); return pid; } SANE_Pid sanei_thread_waitpid( SANE_Pid pid, int *status ) { if (status) *status = 0; return pid; /* DosWaitThread( (TID*) &pid, DCWW_WAIT);*/ } int sanei_thread_sendsig( SANE_Pid pid, int sig ) { return 0; } #elif defined __BEOS__ static int32 local_thread( void *arg ) { pThreadDataDef ltd = (pThreadDataDef)arg; DBG( 2, "thread started, calling func() now...\n" ); ltd->status = ltd->func( ltd->func_data ); DBG( 2, "func() done - status = %d\n", ltd->status ); return ltd->status; } /* * starts a new thread or process * parameters: * star address of reader function * args pointer to scanner data structure * */ SANE_Pid sanei_thread_begin( int (*func)(void *args), void* args ) { SANE_Pid pid; td.func = func; td.func_data = args; pid = spawn_thread( local_thread, "sane thread (yes they can be)", B_NORMAL_PRIORITY, (void*)&td ); if ( pid < B_OK ) { DBG( 1, "spawn_thread() failed\n" ); return -1; } if ( resume_thread(pid) < B_OK ) { DBG( 1, "resume_thread() failed\n" ); return -1; } DBG( 2, "spawn_thread() created thread %d\n", pid ); return pid; } SANE_Pid sanei_thread_waitpid( SANE_Pid pid, int *status ) { int32 st; if ( wait_for_thread(pid, &st) < B_OK ) return -1; if ( status ) *status = (int)st; return pid; } int sanei_thread_sendsig( SANE_Pid pid, int sig ) { if (sig == SIGKILL) sig = SIGKILLTHR; return kill(pid, sig); } #else /* HAVE_OS2_H, __BEOS__ */ #ifdef USE_PTHREAD /* seems to be undefined in MacOS X */ #ifndef PTHREAD_CANCELED # define PTHREAD_CANCELED ((void *) -1) #endif /** */ #if defined (__APPLE__) && defined (__MACH__) static void thread_exit_handler( int signo ) { DBG( 2, "signal(%i) caught, calling pthread_exit now...\n", signo ); pthread_exit( PTHREAD_CANCELED ); } #endif static void* local_thread( void *arg ) { static int status; pThreadDataDef ltd = (pThreadDataDef)arg; #if defined (__APPLE__) && defined (__MACH__) struct sigaction act; sigemptyset(&(act.sa_mask)); act.sa_flags = 0; act.sa_handler = thread_exit_handler; sigaction( SIGUSR2, &act, 0 ); #else int old; pthread_setcancelstate( PTHREAD_CANCEL_ENABLE, &old ); pthread_setcanceltype ( PTHREAD_CANCEL_ASYNCHRONOUS, &old ); #endif DBG( 2, "thread started, calling func() now...\n" ); status = ltd->func( ltd->func_data ); /* so sanei_thread_get_status() will work correctly... */ ltd->status = status; DBG( 2, "func() done - status = %d\n", status ); /* return the status, so pthread_join is able to get it*/ pthread_exit((void*)&status ); } /** */ static void restore_sigpipe( void ) { struct sigaction act; if( sigaction( SIGPIPE, NULL, &act ) == 0 ) { if( act.sa_handler == SIG_IGN ) { sigemptyset( &act.sa_mask ); act.sa_flags = 0; act.sa_handler = SIG_DFL; DBG( 2, "restoring SIGPIPE to SIG_DFL\n" ); sigaction( SIGPIPE, &act, NULL ); } } } #else /* the process stuff */ static int eval_wp_result( SANE_Pid pid, int wpres, int pf ) { int retval = SANE_STATUS_IO_ERROR; if( wpres == pid ) { if( WIFEXITED(pf)) { retval = WEXITSTATUS(pf); } else { if( !WIFSIGNALED(pf)) { retval = SANE_STATUS_GOOD; } else { DBG( 1, "Child terminated by signal %d\n", WTERMSIG(pf)); if( WTERMSIG(pf) == SIGTERM ) retval = SANE_STATUS_GOOD; } } } return retval; } #endif SANE_Pid sanei_thread_begin( int (func)(void *args), void* args ) { #ifdef USE_PTHREAD struct sigaction act; int result; pthread_t thread; /* if signal handler for SIGPIPE is SIG_DFL, replace by SIG_IGN */ if( sigaction( SIGPIPE, NULL, &act ) == 0 ) { if( act.sa_handler == SIG_DFL ) { sigemptyset( &act.sa_mask ); act.sa_flags = 0; act.sa_handler = SIG_IGN; DBG( 2, "setting SIGPIPE to SIG_IGN\n" ); sigaction( SIGPIPE, &act, NULL ); } } td.func = func; td.func_data = args; result = pthread_create( &thread, NULL, local_thread, &td ); usleep( 1 ); if ( result != 0 ) { DBG( 1, "pthread_create() failed with %d\n", result ); return -1; } DBG( 2, "pthread_create() created thread %ld\n", (SANE_Pid)thread ); return (SANE_Pid)thread; #else SANE_Pid pid; pid = fork(); if( pid < 0 ) { DBG( 1, "fork() failed\n" ); return -1; } if( pid == 0 ) { /* run in child context... */ int status = func( args ); /* don't use exit() since that would run the atexit() handlers */ _exit( status ); } /* parents return */ return pid; #endif } int sanei_thread_sendsig( SANE_Pid pid, int sig ) { #ifdef USE_PTHREAD DBG(2, "sanei_thread_sendsig() %d to thread (id=%ld)\n", sig, pid); return pthread_kill( (pthread_t)pid, sig ); #else DBG(2, "sanei_thread_sendsig() %d to process (id=%d)\n", sig, pid); return kill( pid, sig ); #endif } SANE_Pid sanei_thread_waitpid( SANE_Pid pid, int *status ) { #ifdef USE_PTHREAD int *ls; #else int ls; #endif SANE_Pid result; int stat; stat = 0; DBG(2, "sanei_thread_waitpid() - %ld\n", (long) pid); #ifdef USE_PTHREAD result = pthread_join( (pthread_t)pid, (void*)&ls ); if( 0 == result ) { if( PTHREAD_CANCELED == ls ) { DBG(2, "* thread has been canceled!\n" ); stat = SANE_STATUS_GOOD; } else { stat = *ls; } DBG(2, "* result = %d (%p)\n", stat, (void*)status ); result = pid; } /* call detach in any case to make sure that the thread resources * will be freed, when the thread has terminated */ DBG(2, "* detaching thread(%ld)\n", pid ); pthread_detach((pthread_t)pid); if (status) *status = stat; restore_sigpipe(); #else result = waitpid( pid, &ls, 0 ); if((result < 0) && (errno == ECHILD)) { stat = SANE_STATUS_GOOD; result = pid; } else { stat = eval_wp_result( pid, result, ls ); DBG(2, "* result = %d (%p)\n", stat, (void*)status ); } if( status ) *status = stat; #endif return result; } #endif /* HAVE_OS2_H */ SANE_Status sanei_thread_get_status( SANE_Pid pid ) { #if defined USE_PTHREAD || defined HAVE_OS2_H || defined __BEOS__ _VAR_NOT_USED( pid ); return td.status; #else int ls, stat, result; stat = SANE_STATUS_IO_ERROR; if( pid > 0 ) { result = waitpid( pid, &ls, WNOHANG ); stat = eval_wp_result( pid, result, ls ); } return stat; #endif } /* END sanei_thread.c .......................................................*/ sane-backends-extras-1.0.22.3ubuntu1/sanei/sanei_pp.c0000664000000000000000000007741411475557446017253 0ustar /* sane - Scanner Access Now Easy. * Copyright (C) 2003-2005 Gerhard Jaeger * based on work done by Jochen Eisinger * also parts from libieee1284 by Tim Waugh * This file is part of the SANE package. * * 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 of the * License, 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. * * As a special exception, the authors of SANE give permission for * additional uses of the libraries contained in this release of SANE. * * The exception is that, if you link a SANE library with other files * to produce an executable, this does not by itself cause the * resulting executable to be covered by the GNU General Public * License. Your use of that executable is in no way restricted on * account of linking the SANE library code into it. * * This exception does not, however, invalidate any other reasons why * the executable file might be covered by the GNU General Public * License. * * If you submit changes to SANE to the maintainers to be included in * a subsequent release, you agree by submitting the changes that * those changes may be distributed with this exception intact. * * If you write modifications of your own for SANE, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. * * This file implements an interface for accessing the parallelport */ /* debug levels: * 0 - nothing * 1 - errors * 2 - warnings * 3 - things nice to know * 4 - code flow * 5 - detailed flow * 6 - everything * * These debug levels can be set using the environment variable * SANE_DEBUG_SANEI_PP */ #include "../include/sane/config.h" #define BACKEND_NAME sanei_pp #define _TEST_LOOPS 1000 #define _MAX_PORTS 20 #ifndef _VAR_NOT_USED # define _VAR_NOT_USED(x) ((x)=(x)) #endif /* uncomment this to have some parameter checks on in/out functions, * note: that this will slow down the calls */ #if 0 # define _PARANOIA #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_SYS_TIME_H # include #endif #ifdef HAVE_LIMITS_H # include #else # ifndef ULONG_MAX # define ULONG_MAX 4294967295UL # endif #endif #if defined (ENABLE_PARPORT_DIRECTIO) # undef HAVE_LIBIEEE1284 # if defined(HAVE_SYS_IO_H) # if defined (__ICC) && __ICC >= 700 # define __GNUC__ 2 # endif # include # if defined (__ICC) && __ICC >= 700 # undef __GNUC__ # elif defined(__ICC) && defined(HAVE_ASM_IO_H) # include # endif # elif defined(HAVE_ASM_IO_H) # include # elif defined(HAVE_SYS_HW_H) # include # elif defined(__i386__) && ( defined (__GNUC__) || defined (__ICC) ) static __inline__ void outb( u_char value, u_long port ) { __asm__ __volatile__ ("outb %0,%1"::"a" (value), "d" ((u_short) port)); } static __inline__ u_char inb( u_long port ) { u_char value; __asm__ __volatile__ ("inb %1,%0":"=a" (value):"d" ((u_short) port)); return value; } # endif #elif defined(HAVE_LIBIEEE1284) # include #else # if defined(__GNUC__) # warning "No I/O support for this architecture!" # endif # define IO_SUPPORT_MISSING #endif #include "../include/sane/sane.h" #include "../include/sane/sanei.h" #include "../include/sane/sanei_debug.h" #include "../include/sane/sanei_pp.h" #if defined(STDC_HEADERS) # include # include # include #endif #if defined(HAVE_STRING_H) # include #elif defined(HAVE_STRINGS_H) # include #endif #if defined(HAVE_SYS_TYPES_H) # include #endif /** our global init flag... */ static int first_time = SANE_TRUE; static unsigned long pp_thresh = 0; #if (defined (HAVE_IOPERM) || defined (HAVE_LIBIEEE1284)) && !defined (IO_SUPPORT_MISSING) typedef struct { #ifndef HAVE_LIBIEEE1284 const char name[6]; u_long base; /**< i/o base address */ u_char ctrl; /**< for restoring CTRL register */ u_char ecp_ctrl; /**< for restoring ECP-CTRL register */ #endif u_int in_use; /**< port in use? */ u_int claimed; /**< port claimed? */ int caps; /**< port capabilities */ } PortRec, *Port; #if defined (HAVE_LIBIEEE1284) static struct parport_list pplist; static PortRec port[_MAX_PORTS]; #else /** redefine the CAPability flags */ enum ieee1284_capabilities { CAP1284_RAW = (1<<0), CAP1284_NIBBLE = (1<<1), /* SPP mode */ CAP1284_BYTE = (1<<2), /* PS/2 bidirectional */ CAP1284_COMPAT = (1<<3), CAP1284_BECP = (1<<4), CAP1284_ECP = (1<<5), /* ECP */ CAP1284_ECPRLE = (1<<6), /* ECP with RLE support */ CAP1284_ECPSWE = (1<<7), CAP1284_EPP = (1<<8), /* EPP hardware support */ CAP1284_EPPSL = (1<<9), /* EPP 1.7 */ CAP1284_EPPSWE = (1<<10) /* EPP software support */ }; static PortRec port[] = { { "0x378", 0x378, 0, 0, SANE_FALSE, SANE_FALSE, 0 }, { "0x278", 0x278, 0, 0, SANE_FALSE, SANE_FALSE, 0 }, { "0x3BC", 0x3BC, 0, 0, SANE_FALSE, SANE_FALSE, 0 } }; #endif /** depending on the interface we use, define the port macros */ #if defined(HAVE_LIBIEEE1284) #define inb_data(fd) ieee1284_read_data(pplist.portv[fd]); #define inb_stat(fd) (ieee1284_read_status(pplist.portv[fd]) ^ S1284_INVERTED) #define inb_ctrl(fd) (ieee1284_read_control(pplist.portv[fd]) ^ C1284_INVERTED) static inline u_char inb_eppdata(int fd) { u_char val; ieee1284_epp_read_data(pplist.portv[fd], 0, (char *)&val, 1); return val; } static inline void outb_eppdata(int fd, u_char val) { ieee1284_epp_write_data(pplist.portv[fd], 0, (const char *)&val, 1); } #define outb_data(fd,val) ieee1284_write_data(pplist.portv[fd], val) #define outb_ctrl(fd,val) ieee1284_write_control(pplist.portv[fd], \ (val) ^ C1284_INVERTED) static inline void outb_addr(int fd, u_char val) { ieee1284_epp_write_addr (pplist.portv[fd], 0, (char *)&val, 1); } #else #define inb_data(fd) inb(port[fd].base) #define inb_stat(fd) inb(port[fd].base + 1) #define inb_ctrl(fd) inb(port[fd].base + 2) #define inb_eppdata(fd) inb(port[fd].base + 4) #define outb_data(fd,val) outb(val, port[fd].base) #define outb_stat(fd,val) outb(val, port[fd].base + 1) #define outb_ctrl(fd,val) outb(val, port[fd].base + 2) #define outb_addr(fd,val) outb(val, port[fd].base + 3) #define outb_eppdata(fd,val) outb(val, port[fd].base + 4) #ifdef HAVE_IOPL # define _SET_IOPL() iopl(3) # define inbyte400(fd) inb(port[fd].base + 0x400) # define inbyte402(fd) inb(port[fd].base + 0x402) # define outbyte400(fd,val) outb(val, port[fd].base + 0x400) # define outbyte402(fd,val) outb(val, port[fd].base + 0x402) #else # define _SET_IOPL() # define inbyte400(fd) # define inbyte402(fd,val) # define outbyte400(fd,val) # define outbyte402(fd,val) #endif #endif /* should also be in unistd.h */ extern int setuid (uid_t); #if defined (HAVE_LIBIEEE1284) static const char *pp_libieee1284_errorstr( int error ) { switch (error) { case E1284_OK: return "Everything went fine"; case E1284_NOTIMPL: return "Not implemented in libieee1284"; case E1284_NOTAVAIL: return "Not available on this system"; case E1284_TIMEDOUT: return "Operation timed out"; case E1284_REJECTED: return "IEEE 1284 negotiation rejected"; case E1284_NEGFAILED: return "Negotiation went wrong"; case E1284_NOMEM: return "No memory left"; case E1284_INIT: return "Error initializing port"; case E1284_SYS: return "Error interfacing system"; case E1284_NOID: return "No IEEE 1284 ID available"; case E1284_INVALIDPORT: return "Invalid port"; default: return "Unknown error"; } } #endif /** show the caps */ static int pp_showcaps( int caps ) { int mode = 0; char ct[1024]; ct[0] = '\0'; if( caps & CAP1284_NIBBLE ) { strcat( ct, "SPP " ); mode |= SANEI_PP_MODE_SPP; } if( caps & CAP1284_BYTE ) { strcat( ct, "PS/2 " ); mode |= SANEI_PP_MODE_BIDI; } if( caps & CAP1284_EPP ) { strcat( ct, "EPP " ); mode |= SANEI_PP_MODE_EPP; } if( caps & CAP1284_EPPSWE ) { strcat( ct, "EPPSWE " ); mode |= SANEI_PP_MODE_EPP; } if( caps & CAP1284_ECP ) { strcat( ct, "ECP " ); mode |= SANEI_PP_MODE_ECP; } if( caps & CAP1284_ECPRLE ) { strcat( ct, "ECPRLE " ); mode |= SANEI_PP_MODE_ECP; } DBG( 4, "Supported Modes: %s\n", ct ); return mode; } #ifndef HAVE_LIBIEEE1284 /** probe the parallel port */ static int pp_probe( int fd ) { #ifdef HAVE_IOPL SANE_Byte c; int i, j; #endif SANE_Byte a, b; int retv = 0; DBG( 4, "pp_probe: port 0x%04lx\n", port[fd].base ); /* SPP check */ outbyte402( fd, 0x0c ); outb_ctrl ( fd, 0x0c ); outb_data ( fd, 0x55 ); a = inb_data( fd ); if( a != 0x55 ) { DBG( 4, "pp_probe: nothing supported :-(\n" ); return retv; } DBG( 4, "pp_probe: SPP port present\n" ); retv += CAP1284_NIBBLE; /* check for ECP */ #ifdef HAVE_IOPL /* clear at most 1k of data from FIFO */ for( i = 1024; i > 0; i-- ) { a = inbyte402( fd ); if ((a & 0x03) == 0x03) goto no_ecp; if (a & 0x01) break; inbyte400( fd ); /* Remove byte from FIFO */ } if (i <= 0) goto no_ecp; b = a ^ 3; outbyte402( fd, b ); c = inbyte402( fd ); if (a == c) { outbyte402( fd, 0xc0 ); /* FIFO test */ j = 0; while (!(inbyte402( fd ) & 0x01) && (j < 1024)) { inbyte402( fd ); j++; } if (j >= 1024) goto no_ecp; i = 0; j = 0; while (!(inbyte402( fd ) & 0x02) && (j < 1024)) { outbyte400( fd, 0x00 ); i++; j++; } if (j >= 1024) goto no_ecp; j = 0; while (!(inbyte402( fd ) & 0x01) && (j < 1024)) { inbyte400( fd ); j++; } if (j >= 1024) goto no_ecp; DBG( 4, "pp_probe: ECP with a %i byte FIFO present\n", i ); retv += CAP1284_ECP; } no_ecp: #endif /* check for PS/2 compatible port */ if( retv & CAP1284_ECP ) { outbyte402( fd, 0x20 ); } outb_data( fd, 0x55 ); outb_ctrl( fd, 0x0c ); a = inb_data( fd ); outb_data( fd, 0x55 ); outb_ctrl( fd, 0x2c ); b = inb_data( fd ); if( a != b ) { DBG( 4, "pp_probe: PS/2 bidirectional port present\n"); retv += CAP1284_BYTE; } /* check for EPP support */ if( port[fd].base & 0x007 ) { DBG( 4, "pp_probe: EPP not supported at this address\n" ); return retv; } #ifdef HAVE_IOPL if( retv & CAP1284_ECP ) { for( i = 0x00; i < 0x80; i += 0x20 ) { outbyte402( fd, i ); a = inb_stat( fd ); outb_stat( fd, a ); outb_stat( fd, (a & 0xfe)); a = inb_stat( fd ); if (!(a & 0x01)) { DBG( 2, "pp_probe: " "Failed Intel bug check. (Phony EPP in ECP)\n" ); return retv; } } DBG( 4, "pp_probe: Passed Intel bug check.\n" ); outbyte402( fd, 0x80 ); } #endif a = inb_stat( fd ); outb_stat( fd, a ); outb_stat( fd, (a & 0xfe)); a = inb_stat( fd ); if (a & 0x01) { outbyte402( fd, 0x0c ); outb_ctrl ( fd, 0x0c ); return retv; } outb_ctrl( fd, 0x04 ); inb_eppdata ( fd ); a = inb_stat( fd ); outb_stat( fd, a ); outb_stat( fd, (a & 0xfe)); if( a & 0x01 ) { DBG( 4, "pp_probe: EPP 1.9 with hardware direction protocol\n"); retv += CAP1284_EPP; } else { /* The EPP timeout bit was not set, this could either be: * EPP 1.7 * EPP 1.9 with software direction */ outb_ctrl( fd, 0x24 ); inb_eppdata ( fd ); a = inb_stat( fd ); outb_stat( fd, a ); outb_stat( fd, (a & 0xfe)); if( a & 0x01 ) { DBG( 4, "pp_probe: EPP 1.9 with software direction protocol\n" ); retv += CAP1284_EPPSWE; } else { DBG( 4, "pp_probe: EPP 1.7\n" ); retv += CAP1284_EPPSL; } } outbyte402( fd, 0x0c ); outb_ctrl ( fd, 0x0c ); return retv; } /** */ static int pp_set_scpmode( int fd ) { SANE_Byte tmp; DBG( 4, "pp_set_scpmode\n" ); #ifdef HAVE_IOPL tmp = inbyte402( fd ); tmp &= 0x1f; outbyte402( fd, tmp ); #endif tmp = inb_ctrl( fd ); tmp &= 0x0f; outb_ctrl ( fd, tmp ); return SANE_STATUS_GOOD; } static int pp_set_bidimode( int fd ) { SANE_Byte tmp; DBG( 4, "pp_set_bidimode\n" ); #ifdef HAVE_IOPL tmp = inbyte402( fd ); tmp = (tmp & 0x1f) | 0x20; outbyte402( fd, tmp ); #endif tmp = inb_ctrl( fd ); tmp = (tmp & 0x0f) | 0x20; outb_ctrl ( fd, tmp ); return SANE_STATUS_GOOD; } static int pp_set_eppmode( int fd ) { SANE_Byte tmp; DBG( 4, "pp_set_eppmode\n" ); #ifdef HAVE_IOPL tmp = inbyte402( fd ); tmp = (tmp & 0x1f) | 0x80; outbyte402( fd, tmp ); #endif tmp = inb_ctrl( fd ); tmp = (tmp & 0xf0) | 0x40; outb_ctrl ( fd, tmp ); return SANE_STATUS_GOOD; } static int pp_set_ecpmode( int fd ) { #ifdef HAVE_IOPL SANE_Byte tmp; #endif DBG( 4, "pp_set_ecpmode\n" ); #ifdef HAVE_IOPL tmp = inbyte402( fd ); tmp = (tmp & 0x1f) | 0x60; outbyte402( fd, tmp ); return SANE_STATUS_GOOD; #endif return SANE_STATUS_UNSUPPORTED; } /** set the parallel port mode */ static int pp_setmode( int fd, int mode ) { int ret; if( 0 == (mode & port[fd].caps)) { DBG( 2, "pp_setmode: mode not supported %d\n", mode ); return SANE_STATUS_UNSUPPORTED; } switch( mode ) { case SANEI_PP_MODE_SPP: ret = pp_set_scpmode( fd ); break; case SANEI_PP_MODE_BIDI: ret = pp_set_bidimode( fd ); break; case SANEI_PP_MODE_EPP: ret = pp_set_eppmode( fd ); break; case SANEI_PP_MODE_ECP: ret = pp_set_ecpmode( fd ); break; default: DBG( 2, "pp_setmode: invalid mode %d\n", mode ); return SANE_STATUS_INVAL; } return ret; } #endif static unsigned long pp_time_diff( struct timeval *start, struct timeval *end ) { double s, e, r; s = (double)start->tv_sec * 1000000.0 + (double)start->tv_usec; e = (double)end->tv_sec * 1000000.0 + (double)end->tv_usec; if( e > s ) r = (e - s); else r = (s - e); if( r <= (double)ULONG_MAX ) return (unsigned long)r; return 0; } /** */ static unsigned long pp_calculate_thresh( void ) { unsigned long i, r, ret; struct timeval start, end, deadline; gettimeofday( &start, NULL); for( i = _TEST_LOOPS; i; i-- ) { gettimeofday( &deadline, NULL ); deadline.tv_usec += 10; deadline.tv_sec += deadline.tv_usec / 1000000; deadline.tv_usec %= 1000000; } gettimeofday( &end, NULL); r = pp_time_diff( &start, &end ); ret = r/_TEST_LOOPS; return ret; } /** */ static void pp_calibrate_delay( void ) { unsigned long r, i; struct timeval start, end; for( i = 0; i < 5; i++ ) { pp_thresh = pp_calculate_thresh(); gettimeofday( &start, NULL); for( i = _TEST_LOOPS; i; i-- ) { sanei_pp_udelay( 1 ); } gettimeofday( &end, NULL); r = pp_time_diff( &start, &end ); DBG( 4, "pp_calibrate_delay: Delay expected: " "%u, real %lu, pp_thresh=%lu\n", _TEST_LOOPS, r, pp_thresh ); if( r >= _TEST_LOOPS ) { return; } } DBG( 4, "pp_calibrate_delay: pp_thresh set to 0\n" ); pp_thresh = 0; } static SANE_Status pp_init( void ) { #if defined (HAVE_LIBIEEE1284) int result, i; #endif if( first_time == SANE_FALSE ) { DBG( 5, "pp_init: already initalized\n" ); return SANE_STATUS_GOOD; } DBG( 5, "pp_init: called for the first time\n"); first_time = SANE_FALSE; #if defined (HAVE_LIBIEEE1284) DBG( 4, "pp_init: initializing libieee1284\n"); result = ieee1284_find_ports( &pplist, 0 ); if (result) { DBG (1, "pp_init: initializing IEEE 1284 failed (%s)\n", pp_libieee1284_errorstr( result )); first_time = SANE_TRUE; return SANE_STATUS_INVAL; } DBG( 3, "pp_init: %d ports reported by IEEE 1284 library\n", pplist.portc); for( i = 0; i < pplist.portc; i++ ) DBG( 6, "pp_init: port %d is `%s`\n", i, pplist.portv[i]->name); /* we support only up to _MAX_PORTS... */ if( pplist.portc > _MAX_PORTS ) { DBG (1, "pp_init: Lib IEEE 1284 reports too much ports: %d\n", pplist.portc ); ieee1284_free_ports( &pplist ); first_time = SANE_TRUE; return SANE_STATUS_UNSUPPORTED; } memset( port, 0, sizeof(port)); #else DBG( 4, "pp_init: trying to setuid root\n"); if( 0 > setuid( 0 )) { DBG( 1, "pp_init: setuid failed: errno = %d\n", errno ); DBG( 5, "pp_init: returning SANE_STATUS_INVAL\n" ); first_time = SANE_TRUE; return SANE_STATUS_INVAL; } DBG( 3, "pp_init: the application is now root\n" ); #endif DBG( 5, "pp_init: initialized successfully\n" ); return SANE_STATUS_GOOD; } static int pp_open( const char *dev, SANE_Status * status ) { int i; #if !defined (HAVE_LIBIEEE1284) u_long base; #else int result; #endif DBG( 4, "pp_open: trying to attach dev `%s`\n", dev ); #if !defined (HAVE_LIBIEEE1284) { char *end; DBG( 5, "pp_open: reading port number\n" ); base = strtol( dev, &end, 0 ); if ((end == dev) || (*end != '\0')) { DBG( 1, "pp_open: `%s` is not a valid port number\n", dev); DBG( 6, "pp_open: the part I did not understand was ...`%s`\n", end); *status = SANE_STATUS_INVAL; return -1; } } DBG( 6, "pp_open: read port number 0x%03lx\n", base ); if( base == 0 ) { DBG( 1, "pp_open: 0x%03lx is not a valid base address\n", base ); *status = SANE_STATUS_INVAL; return -1; } #endif DBG( 5, "pp_open: looking up port in list\n" ); #if defined (HAVE_LIBIEEE1284) for( i = 0; i < pplist.portc; i++ ) { DBG( 5, "pp_open: checking >%s<\n", pplist.portv[i]->name ); if( !strcmp(pplist.portv[i]->name, dev)) break; } if( pplist.portc <= i ) { DBG( 1, "pp_open: `%s` is not a valid device name\n", dev ); *status = SANE_STATUS_INVAL; return -1; } #else for( i = 0; i < NELEMS(port); i++ ) { if( port[i].base == base ) break; } if (NELEMS (port) <= i) { DBG( 1, "pp_open: 0x%03lx is not a valid base address\n", base ); *status = SANE_STATUS_INVAL; return -1; } #endif DBG( 6, "pp_open: port is in list at port[%d]\n", i); if( port[i].in_use == SANE_TRUE) { #if defined (HAVE_LIBIEEE1284) DBG( 1, "pp_open: device `%s` is already in use\n", dev ); #else DBG( 1, "pp_open: port 0x%03lx is already in use\n", base ); #endif *status = SANE_STATUS_DEVICE_BUSY; return -1; } port[i].in_use = SANE_TRUE; port[i].claimed = SANE_FALSE; #if defined (HAVE_LIBIEEE1284) DBG( 5, "pp_open: opening device\n" ); result = ieee1284_open( pplist.portv[i], 0, &port[i].caps ); if (result) { DBG( 1, "pp_open: could not open device `%s` (%s)\n", dev, pp_libieee1284_errorstr (result)); port[i].in_use = SANE_FALSE; *status = SANE_STATUS_ACCESS_DENIED; return -1; } #else DBG( 5, "pp_open: getting io permissions\n" ); /* TODO: insert FreeBSD compatible code here */ if( ioperm( port[i].base, 5, 1 )) { DBG( 1, "pp_open: cannot get io privilege for port 0x%03lx\n", port[i].base); port[i].in_use = SANE_FALSE; *status = SANE_STATUS_IO_ERROR; return -1; } /* save the CTRL register settings */ #ifdef HAVE_IOPL _SET_IOPL(); port[i].ecp_ctrl = inbyte402(i); port[i].ctrl = inb_ctrl(i); #endif /* check the capabilities of this port */ port[i].caps = pp_probe( i ); #endif port[i].caps = pp_showcaps( port[i].caps ); DBG( 3, "pp_open: device `%s` opened...\n", dev ); *status = SANE_STATUS_GOOD; return i; } static int pp_close( int fd, SANE_Status *status ) { #if defined(HAVE_LIBIEEE1284) int result; #endif DBG( 4, "pp_close: fd=%d\n", fd ); #if defined(HAVE_LIBIEEE1284) DBG( 6, "pp_close: this is port '%s'\n", pplist.portv[fd]->name ); #else DBG( 6, "pp_close: this is port 0x%03lx\n", port[fd].base ); DBG( 6, "pp_close: restoring the CTRL registers\n" ); outb_ctrl( fd, port[fd].ctrl ); #ifdef HAVE_IOPL outbyte402( fd, port[fd].ecp_ctrl ); #endif #endif if( port[fd].claimed == SANE_TRUE ) { sanei_pp_release( fd ); } DBG( 5, "pp_close: trying to free io port\n" ); #if defined(HAVE_LIBIEEE1284) if((result = ieee1284_close(pplist.portv[fd])) < 0) { #else if( ioperm( port[fd].base, 5, 0 )) { #endif #if defined(HAVE_LIBIEEE1284) DBG( 1, "pp_close: can't free port '%s' (%s)\n", pplist.portv[fd]->name, pp_libieee1284_errorstr(result)); #else DBG( 1, "pp_close: can't free port 0x%03lx\n", port[fd].base ); #endif *status = SANE_STATUS_IO_ERROR; return -1; } DBG( 5, "pp_close: marking port as unused\n" ); port[fd].in_use = SANE_FALSE; *status = SANE_STATUS_GOOD; return 0; } /** exported functions **/ SANE_Status sanei_pp_init( void ) { SANE_Status result; DBG_INIT(); result = pp_init(); if( result != SANE_STATUS_GOOD ) { return result; } pp_calibrate_delay(); return SANE_STATUS_GOOD; } SANE_Status sanei_pp_open( const char *dev, int *fd ) { SANE_Status status; DBG( 4, "sanei_pp_open: called for device '%s'\n", dev); *fd = pp_open( dev, &status ); if( *fd == -1 ) { DBG( 5, "sanei_pp_open: connection failed\n" ); return status; } DBG( 6, "sanei_pp_open: connected to device using fd %u\n", *fd ); return SANE_STATUS_GOOD; } void sanei_pp_close( int fd ) { SANE_Status status; DBG( 4, "sanei_pp_close: fd = %d\n", fd ); #if defined(HAVE_LIBIEEE1284) if((fd < 0) || (fd >= pplist.portc)) { #else if((fd < 0) || (fd >= NELEMS (port))) { #endif DBG( 2, "sanei_pp_close: fd %d is invalid\n", fd ); return; } if( port[fd].in_use == SANE_FALSE ) { DBG( 2, "sanei_pp_close: port is not in use\n" ); #if defined(HAVE_LIBIEEE1284) DBG( 6, "sanei_pp_close: port is '%s'\n", pplist.portv[fd]->name ); #else DBG( 6, "sanei_pp_close: port is 0x%03lx\n", port[fd].base ); #endif return; } DBG( 5, "sanei_pp_close: freeing resources\n" ); if( pp_close (fd, &status) == -1 ) { DBG( 5, "sanei_pp_close: failed\n" ); return; } DBG( 5, "sanei_pp_close: finished\n" ); } SANE_Status sanei_pp_claim( int fd ) { #if defined (HAVE_LIBIEEE1284) int result; #endif DBG( 4, "sanei_pp_claim: fd = %d\n", fd ); #if defined (HAVE_LIBIEEE1284) if((fd < 0) || (fd >= pplist.portc)) { DBG( 2, "sanei_pp_claim: fd %d is invalid\n", fd ); return SANE_STATUS_INVAL; } result = ieee1284_claim (pplist.portv[fd]); if (result) { DBG (1, "sanei_pp_claim: failed (%s)\n", pp_libieee1284_errorstr(result)); return -1; } #endif port[fd].claimed = SANE_TRUE; return SANE_STATUS_GOOD; } SANE_Status sanei_pp_release( int fd ) { DBG( 4, "sanei_pp_release: fd = %d\n", fd ); #if defined(HAVE_LIBIEEE1284) if((fd < 0) || (fd >= pplist.portc)) { DBG( 2, "sanei_pp_release: fd %d is invalid\n", fd ); return SANE_STATUS_INVAL; } ieee1284_release( pplist.portv[fd] ); #endif port[fd].claimed = SANE_FALSE; return SANE_STATUS_GOOD; } SANE_Status sanei_pp_outb_data( int fd, SANE_Byte val ) { #ifdef _PARANOIA DBG( 4, "sanei_pp_outb_data: called for fd %d\n", fd ); #if defined(HAVE_LIBIEEE1284) if ((fd < 0) || (fd >= pplist.portc)) { #else if ((fd < 0) || (fd >= NELEMS (port))) { #endif DBG( 2, "sanei_pp_outb_data: invalid fd %d\n", fd ); return SANE_STATUS_INVAL; } #endif outb_data( fd, val ); return SANE_STATUS_GOOD; } SANE_Status sanei_pp_outb_ctrl( int fd, SANE_Byte val ) { #ifdef _PARANOIA DBG( 4, "sanei_pp_outb_ctrl: called for fd %d\n", fd ); #if defined(HAVE_LIBIEEE1284) if ((fd < 0) || (fd >= pplist.portc)) { #else if ((fd < 0) || (fd >= NELEMS (port))) { #endif DBG( 2, "sanei_pp_outb_ctrl: invalid fd %d\n", fd ); return SANE_STATUS_INVAL; } #endif outb_ctrl( fd, val ); return SANE_STATUS_GOOD; } SANE_Status sanei_pp_outb_addr( int fd, SANE_Byte val ) { #ifdef _PARANOIA DBG( 4, "sanei_pp_outb_addr: called for fd %d\n", fd ); #if defined(HAVE_LIBIEEE1284) if ((fd < 0) || (fd >= pplist.portc)) { #else if ((fd < 0) || (fd >= NELEMS (port))) { #endif DBG( 2, "sanei_pp_outb_addr: invalid fd %d\n", fd ); return SANE_STATUS_INVAL; } #endif outb_addr( fd, val ); return SANE_STATUS_GOOD; } SANE_Status sanei_pp_outb_epp( int fd, SANE_Byte val ) { #ifdef _PARANOIA DBG( 4, "sanei_pp_outb_epp: called for fd %d\n", fd ); #if defined(HAVE_LIBIEEE1284) if ((fd < 0) || (fd >= pplist.portc)) { #else if ((fd < 0) || (fd >= NELEMS (port))) { #endif DBG( 2, "sanei_pp_outb_epp: invalid fd %d\n", fd ); return SANE_STATUS_INVAL; } #endif outb_eppdata( fd, val ); return SANE_STATUS_GOOD; } SANE_Byte sanei_pp_inb_data( int fd ) { #ifdef _PARANOIA DBG( 4, "sanei_pp_inb_data: called for fd %d\n", fd ); #if defined(HAVE_LIBIEEE1284) if ((fd < 0) || (fd >= pplist.portc)) { #else if ((fd < 0) || (fd >= NELEMS (port))) { #endif DBG( 2, "sanei_pp_inb_data: invalid fd %d\n", fd ); return SANE_STATUS_INVAL; } #endif return inb_data( fd ); } SANE_Byte sanei_pp_inb_stat( int fd ) { #ifdef _PARANOIA DBG( 4, "sanei_pp_inb_stat: called for fd %d\n", fd ); #if defined(HAVE_LIBIEEE1284) if ((fd < 0) || (fd >= pplist.portc)) { #else if ((fd < 0) || (fd >= NELEMS (port))) { #endif DBG( 2, "sanei_pp_outb_stat: invalid fd %d\n", fd ); return SANE_STATUS_INVAL; } #endif return inb_stat( fd ); } SANE_Byte sanei_pp_inb_ctrl( int fd ) { #ifdef _PARANOIA DBG( 4, "sanei_pp_inb_ctrl: called for fd %d\n", fd ); #if defined(HAVE_LIBIEEE1284) if ((fd < 0) || (fd >= pplist.portc)) { #else if ((fd < 0) || (fd >= NELEMS (port))) { #endif DBG( 2, "sanei_pp_inb_ctrl: invalid fd %d\n", fd ); return SANE_STATUS_INVAL; } #endif return inb_ctrl( fd ); } SANE_Byte sanei_pp_inb_epp( int fd ) { #ifdef _PARANOIA DBG( 4, "sanei_pp_inb_epp: called for fd %d\n", fd ); #if defined(HAVE_LIBIEEE1284) if ((fd < 0) || (fd >= pplist.portc)) { #else if ((fd < 0) || (fd >= NELEMS (port))) { #endif DBG( 2, "sanei_pp_inb_epp: invalid fd %d\n", fd ); return SANE_STATUS_INVAL; } #endif return inb_eppdata( fd ); } SANE_Status sanei_pp_getmodes( int fd, int *mode ) { #if defined(HAVE_LIBIEEE1284) if ((fd < 0) || (fd >= pplist.portc)) { #else if ((fd < 0) || (fd >= NELEMS (port))) { #endif DBG( 2, "sanei_pp_getmodes: invalid fd %d\n", fd ); return SANE_STATUS_INVAL; } if( mode ) *mode = port[fd].caps; return SANE_STATUS_GOOD; } SANE_Status sanei_pp_setmode( int fd, int mode ) { #if defined(HAVE_LIBIEEE1284) int result; if ((fd < 0) || (fd >= pplist.portc)) { #else if ((fd < 0) || (fd >= NELEMS (port))) { #endif DBG( 2, "sanei_pp_setmode: invalid fd %d\n", fd ); return SANE_STATUS_INVAL; } if((mode != SANEI_PP_MODE_SPP) && (mode != SANEI_PP_MODE_BIDI) && (mode != SANEI_PP_MODE_EPP) && (mode != SANEI_PP_MODE_ECP)) { DBG( 2, "sanei_pp_setmode: invalid mode %d\n", mode ); return SANE_STATUS_INVAL; } #if defined(HAVE_LIBIEEE1284) switch( mode ) { case SANEI_PP_MODE_SPP: mode = M1284_NIBBLE; break; case SANEI_PP_MODE_BIDI: mode = M1284_BYTE; break; case SANEI_PP_MODE_EPP: mode = M1284_EPP; break; case SANEI_PP_MODE_ECP: mode = M1284_ECP; break; default: DBG( 2, "sanei_pp_setmode: invalid mode %d\n", mode ); return SANE_STATUS_INVAL; } result = ieee1284_negotiate( pplist.portv[fd], mode ); /* negotiation might fails, but the port-mode should be set... */ if((E1284_OK != result) && (E1284_NEGFAILED != result)) { DBG( 2, "sanei_pp_setmode failed: %s\n", pp_libieee1284_errorstr( result )); return SANE_STATUS_INVAL; } return SANE_STATUS_GOOD; #else return pp_setmode( fd, mode ); #endif } void sanei_pp_udelay( unsigned long usec ) { struct timeval now, deadline; if( usec == 0 ) return; gettimeofday( &deadline, NULL ); deadline.tv_usec += usec; deadline.tv_sec += deadline.tv_usec / 1000000; deadline.tv_usec %= 1000000; if( usec < pp_thresh ) return; do { gettimeofday( &now, NULL ); } while ((now.tv_sec < deadline.tv_sec) || (now.tv_sec == deadline.tv_sec && now.tv_usec < deadline.tv_usec)); } SANE_Status sanei_pp_set_datadir( int fd, int rev ) { #if defined(HAVE_LIBIEEE1284) if ((fd < 0) || (fd >= pplist.portc)) { #else SANE_Byte tmp; if ((fd < 0) || (fd >= NELEMS (port))) { #endif DBG( 2, "sanei_pp_setdir: invalid fd %d\n", fd ); return SANE_STATUS_INVAL; } #if defined(HAVE_LIBIEEE1284) ieee1284_data_dir( pplist.portv[fd], rev ); #else tmp = inb_ctrl( fd ); if( SANEI_PP_DATAIN == rev ) tmp |= SANEI_PP_CTRL_DIRECTION; else tmp &= ~SANEI_PP_CTRL_DIRECTION; outb_ctrl( fd, tmp ); #endif return SANE_STATUS_GOOD; } SANE_Bool sanei_pp_uses_directio( void ) { #if defined(HAVE_LIBIEEE1284) return SANE_FALSE; #else return SANE_TRUE; #endif } #else /* !HAVE_IOPERM */ SANE_Status sanei_pp_init( void ) { DBG_INIT(); _VAR_NOT_USED( first_time ); return SANE_STATUS_GOOD; } SANE_Status sanei_pp_open( const char *dev, int *fd ) { if (fd) *fd = -1; DBG( 4, "sanei_pp_open: called for device `%s`\n", dev ); DBG( 3, "sanei_pp_open: support not compiled\n" ); DBG( 6, "sanei_pp_open: basically, this backend does only compile\n" ); DBG( 6, "sanei_pp_open: on x86 architectures. Furthermore it\n" ); DBG( 6, "sanei_pp_open: needs ioperm() and inb()/outb() calls.\n" ); DBG( 6, "sanei_pp_open: alternativly it makes use of libieee1284\n" ); DBG( 6, "sanei_pp_open: (which isn't present either)\n"); return SANE_STATUS_INVAL; } void sanei_pp_close( int fd ) { DBG( 4, "sanei_pp_close: called for fd %d\n", fd ); DBG( 2, "sanei_pp_close: fd %d is invalid\n", fd ); return; } SANE_Status sanei_pp_claim( int fd ) { DBG( 4, "sanei_pp_claim: called for fd %d\n", fd ); DBG( 2, "sanei_pp_claim: fd %d is invalid\n", fd ); return SANE_STATUS_INVAL; } SANE_Status sanei_pp_release( int fd ) { DBG( 4, "sanei_pp_release: called for fd %d\n", fd ); DBG( 2, "sanei_pp_release: fd %d is invalid\n", fd ); return SANE_STATUS_INVAL; } SANE_Status sanei_pp_outb_data( int fd, SANE_Byte val ) { _VAR_NOT_USED( val ); DBG( 4, "sanei_pp_outb_data: called for fd %d\n", fd ); DBG( 2, "sanei_pp_outb_data: fd %d is invalid\n", fd ); return SANE_STATUS_INVAL; } SANE_Status sanei_pp_outb_ctrl( int fd, SANE_Byte val ) { _VAR_NOT_USED( val ); DBG( 4, "sanei_pp_outb_ctrl: called for fd %d\n", fd ); DBG( 2, "sanei_pp_outb_ctrl: fd %d is invalid\n", fd ); return SANE_STATUS_INVAL; } SANE_Status sanei_pp_outb_addr( int fd, SANE_Byte val ) { _VAR_NOT_USED( val ); DBG( 4, "sanei_pp_outb_addr: called for fd %d\n", fd ); DBG( 2, "sanei_pp_outb_addr: fd %d is invalid\n", fd ); return SANE_STATUS_INVAL; } SANE_Byte sanei_pp_inb_data( int fd ) { DBG( 4, "sanei_pp_inb_data: called for fd %d\n", fd ); DBG( 2, "sanei_pp_inb_data: fd %d is invalid\n", fd ); return SANE_STATUS_INVAL; } SANE_Byte sanei_pp_inb_stat( int fd ) { DBG( 4, "sanei_pp_inb_stat: called for fd %d\n", fd ); DBG( 2, "sanei_pp_inb_stat: fd %d is invalid\n", fd ); return SANE_STATUS_INVAL; } SANE_Byte sanei_pp_inb_ctrl( int fd ) { DBG( 4, "sanei_pp_inb_ctrl: called for fd %d\n", fd ); DBG( 2, "sanei_pp_inb_ctrl: fd %d is invalid\n", fd ); return SANE_STATUS_INVAL; } SANE_Byte sanei_pp_inb_epp ( int fd ) { DBG( 4, "sanei_pp_inb_epp: called for fd %d\n", fd ); DBG( 2, "sanei_pp_inb_epp: fd %d is invalid\n", fd ); return SANE_STATUS_INVAL; } SANE_Status sanei_pp_getmodes( int fd, int *mode ) { _VAR_NOT_USED( mode ); DBG( 4, "sanei_pp_getmodes: called for fd %d\n", fd ); DBG( 1, "sanei_pp_getmodes: fd %d is invalid\n", fd ); return SANE_STATUS_INVAL; } SANE_Status sanei_pp_setmode( int fd, int mode ) { _VAR_NOT_USED( mode ); DBG( 4, "sanei_pp_setmode: called for fd %d\n", fd ); DBG( 1, "sanei_pp_setmode: fd %d is invalid\n", fd ); return SANE_STATUS_INVAL; } void sanei_pp_udelay( unsigned long usec ) { _VAR_NOT_USED( usec ); _VAR_NOT_USED( pp_thresh ); DBG( 2, "sanei_pp_udelay: not supported\n" ); } SANE_Status sanei_pp_set_datadir( int fd, int rev ) { _VAR_NOT_USED( rev ); DBG( 4, "sanei_pp_setdir: called for fd %d\n", fd ); DBG( 1, "sanei_pp_setdir: fd %d is invalid\n", fd ); return SANE_STATUS_INVAL; } SANE_Bool sanei_pp_uses_directio( void ) { DBG( 1, "sanei_pp_uses_directio: not supported\n" ); return SANE_FALSE; } #endif /* !HAVE_IOPERM */ sane-backends-extras-1.0.22.3ubuntu1/sanei/sanei_pio.c0000664000000000000000000003337211475557446017416 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 1998 Christian Bucher Copyright (C) 1998 Kling & Hautzinger GmbH This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. This file implements the bi-directional parallel-port interface. */ /* RESTRICTIONS: - This interface is very timing sensitive, be carefull with setting debug levels. */ #include "../include/sane/config.h" #define BACKEND_NAME sanei_pio #include "../include/sane/sanei_backend.h" /* pick up compatibility defs */ #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_SYS_IO_H # include /* use where available (glibc 2.x, for example) */ #elif HAVE_ASM_IO_H # include /* ugly, but backwards compatible */ #elif HAVE_SYS_HW_H # include #elif defined(__i386__) && defined (__GNUC__) static __inline__ void outb (u_char value, u_long port) { __asm__ __volatile__ ("outb %0,%1"::"a" (value), "d" ((u_short) port)); } static __inline__ u_char inb (u_long port) { u_char value; __asm__ __volatile__ ("inb %1,%0":"=a" (value):"d" ((u_short) port)); return value; } #else # define IO_SUPPORT_MISSING #endif #include "../include/sane/sane.h" #include "../include/sane/sanei.h" #include "../include/sane/sanei_pio.h" #if defined (HAVE_IOPERM) && !defined (IO_SUPPORT_MISSING) #include #include #include #include #include #include #include #include #include #include #include #include "../include/sane/saneopts.h" #define PORT_DEV "/dev/port" /* base 278 (lpt2) ioport stat ctrl offs 0 1 2 len 1 1 1 */ /* Port definitions (`N' at end begin of label means negated signal) */ #define PIO_IOPORT 0 /* rel. addr io port */ #define PIO_STAT 1 /* rel. addr status port */ #define PIO_STAT_BUSY (1<<7) /* BUSY Pin */ #define PIO_STAT_NACKNLG (1<<6) /* ~ACKNLG Pin */ #define PIO_CTRL 2 /* rel. addr control port */ #define PIO_CTRL_IE (1<<5) /* Input enable */ #define PIO_CTRL_IRQE (1<<4) /* enable IRQ */ #define PIO_CTRL_DIR (1<<3) /* DIR pin, DIR=1 => out */ #define PIO_CTRL_NINIT (1<<2) /* reset output */ #define PIO_CTRL_FDXT (1<<1) /* Paper FEED (unused) */ #define PIO_CTRL_NSTROBE (1<<0) /* strobe pin */ #define PIO_APPLYRESET 2000 /* reset in 10us at init time */ #define DL40 6 #define DL50 7 #define DL60 8 #define DL61 9 #define DL70 10 #define DL71 11 #ifdef NDEBUG # define DBG_INIT() #endif typedef struct { u_long base; /* i/o base address */ int fd; /* >= 0 when using /dev/port */ int max_time_seconds;/* forever if <= 0 */ u_int in_use; /* port in use? */ } PortRec, *Port; static PortRec port[] = { {0x378, -1, 0, 0}, {0x278, -1, 0, 0} }; extern int setuid (uid_t); static inline int pio_outb (const Port port, u_char val, u_long addr); static inline int pio_inb (const Port port, u_char * val, u_long addr); static inline int pio_wait (const Port port, u_char val, u_char mask); static inline void pio_ctrl (const Port port, u_char val); static inline void pio_delay (const Port port); static inline void pio_init (const Port port); static void pio_reset (const Port port); static int pio_write (const Port port, const u_char * buf, int n); static int pio_read (const Port port, u_char * buf, int n); static int pio_open (const char *dev, SANE_Status * status); static inline int pio_outb (const Port port, u_char val, u_long addr) { if (-1 == port->fd) outb (val, addr); else { if (addr != (u_long)lseek (port->fd, addr, SEEK_SET)) return -1; if (1 != write (port->fd, &val, 1)) return -1; } return 0; } static inline int pio_inb (const Port port, u_char * val, u_long addr) { if (-1 == port->fd) *val = inb (addr); else { if (addr != (u_long)lseek (port->fd, addr, SEEK_SET)) return -1; if (1 != read (port->fd, val, 1)) return -1; } return 0; } static inline int pio_wait (const Port port, u_char val, u_char mask) { int stat = 0; long poll_count = 0; time_t start = time(NULL); DBG (DL60, "wait on port 0x%03lx for %02x mask %02x\n", port->base, (int) val, (int) mask); DBG (DL61, " BUSY %s\n", (mask & PIO_STAT_BUSY) ? (val & PIO_STAT_BUSY ? "on" : "off") : "-"); DBG (DL61, " NACKNLG %s\n", (mask & PIO_STAT_NACKNLG) ? (val & PIO_STAT_NACKNLG ? "on" : "off") : "-"); for (;;) { ++poll_count; stat = inb (port->base + PIO_STAT); if ((stat & mask) == (val & mask)) { DBG (DL60, "got %02x after %ld tries\n", stat, poll_count); DBG (DL61, " BUSY %s\n", stat & PIO_STAT_BUSY ? "on" : "off"); DBG (DL61, " NACKNLG %s\n", stat & PIO_STAT_NACKNLG ? "on" : "off"); return stat; } if(poll_count>1000) { if ((port->max_time_seconds>0) && (time(NULL)-start >= port->max_time_seconds)) break; usleep(1); } } DBG (DL60, "got %02x aborting after %ld\n", stat, poll_count); DBG (DL61, " BUSY %s\n", stat & PIO_STAT_BUSY ? "on" : "off"); DBG (DL61, " NACKNLG %s\n", stat & PIO_STAT_NACKNLG ? "on" : "off"); DBG (1, "polling time out, abort\n"); exit (-1); } static inline void pio_ctrl (const Port port, u_char val) { DBG (DL60, "ctrl on port 0x%03lx %02x %02x\n", port->base, (int) val, (int) val ^ PIO_CTRL_NINIT); val ^= PIO_CTRL_NINIT; DBG (DL61, " IE %s\n", val & PIO_CTRL_IE ? "on" : "off"); DBG (DL61, " IRQE %s\n", val & PIO_CTRL_IRQE ? "on" : "off"); DBG (DL61, " DIR %s\n", val & PIO_CTRL_DIR ? "on" : "off"); DBG (DL61, " NINIT %s\n", val & PIO_CTRL_NINIT ? "on" : "off"); DBG (DL61, " FDXT %s\n", val & PIO_CTRL_FDXT ? "on" : "off"); DBG (DL61, " NSTROBE %s\n", val & PIO_CTRL_NSTROBE ? "on" : "off"); outb (val, port->base + PIO_CTRL); return; } static inline void pio_delay (const Port port) { inb (port->base + PIO_STAT); /* delay */ return; } static inline void pio_init (const Port port) { pio_ctrl (port, PIO_CTRL_IE); return; } static void pio_reset (const Port port) { int n; DBG (DL40, "reset\n"); for (n = PIO_APPLYRESET; --n >= 0;) { outb ((PIO_CTRL_IE | PIO_CTRL_NINIT) ^ PIO_CTRL_NINIT, port->base + PIO_CTRL); } pio_init (port); DBG (DL40, "end reset\n"); return; } static int pio_write (const Port port, const u_char * buf, int n) { int k; DBG (DL40, "write\n"); pio_wait (port, PIO_STAT_BUSY, PIO_STAT_BUSY); /* busy */ pio_ctrl (port, PIO_CTRL_DIR | PIO_CTRL_IE); /* praeoutput */ pio_wait (port, PIO_STAT_NACKNLG, PIO_STAT_NACKNLG); /* acknlg */ pio_ctrl (port, PIO_CTRL_DIR); /* output */ for (k = 0; k < n; k++, buf++) { DBG (DL40, "write byte\n"); #ifdef HANDSHAKE_BUSY pio_wait (port, PIO_STAT_BUSY, PIO_STAT_BUSY); /* busy */ #else pio_wait (port, PIO_STAT_BUSY | PIO_STAT_NACKNLG, PIO_STAT_BUSY | PIO_STAT_NACKNLG); /* busyack */ #endif DBG (DL60, "out %02x\n", (int) *buf); outb (*buf, port->base + PIO_IOPORT); pio_delay (port); pio_delay (port); pio_delay (port); pio_ctrl (port, PIO_CTRL_DIR | PIO_CTRL_NSTROBE); /* outputstrobe */ pio_delay (port); pio_delay (port); pio_delay (port); pio_ctrl (port, PIO_CTRL_DIR); /* output */ pio_delay (port); pio_delay (port); pio_delay (port); DBG (DL40, "end write byte\n"); } #ifdef HANDSHAKE_BUSY pio_wait (port, PIO_STAT_BUSY, PIO_STAT_BUSY); /* busy */ #else pio_wait (port, PIO_STAT_BUSY | PIO_STAT_NACKNLG, PIO_STAT_BUSY | PIO_STAT_NACKNLG); /* busyack */ #endif pio_ctrl (port, PIO_CTRL_DIR | PIO_CTRL_IE); /* praeoutput */ DBG (DL40, "end write\n"); return k; } static int pio_read (const Port port, u_char * buf, int n) { int k; DBG (DL40, "read\n"); pio_wait (port, PIO_STAT_BUSY, PIO_STAT_BUSY); /* busy */ pio_ctrl (port, PIO_CTRL_IE); /* input */ for (k = 0; k < n; k++, buf++) { DBG (DL40, "read byte\n"); #ifdef HANDSHAKE_BUSY pio_wait (port, PIO_STAT_BUSY, PIO_STAT_BUSY); /* busy */ #else pio_wait (port, PIO_STAT_BUSY, PIO_STAT_BUSY | PIO_STAT_NACKNLG); /* busynack */ #endif pio_ctrl (port, PIO_CTRL_IE | PIO_CTRL_NSTROBE); /* inputstrobe */ pio_delay (port); pio_delay (port); pio_delay (port); pio_ctrl (port, PIO_CTRL_IE); /* input */ #ifdef HANDSHAKE_BUSY pio_wait (port, PIO_STAT_BUSY, PIO_STAT_BUSY); /* busy */ #else pio_wait (port, PIO_STAT_BUSY, PIO_STAT_BUSY | PIO_STAT_NACKNLG); /* busynack */ #endif *buf = inb (port->base + PIO_IOPORT); DBG (DL60, "in %02x\n", (int) *buf); DBG (DL40, "end read byte\n"); } pio_wait (port, PIO_STAT_BUSY, PIO_STAT_BUSY); /* busy */ pio_ctrl (port, PIO_CTRL_IE); /* input */ DBG (DL40, "end read\n"); return k; } /* Open the device, must contain a valid port number (as string). */ static int pio_open (const char *dev, SANE_Status * status) { static int first_time = 1; u_long base; int n; if (first_time) { first_time = 0; DBG_INIT (); /* set root uid */ if (0 > setuid (0)) { DBG (1, "sanei_pio_open: setuid failed: errno = %d\n", errno); *status = SANE_STATUS_INVAL; return -1; } } /* read port number */ { char *end; base = strtol (dev, &end, 0); if ((end == dev) || *end) { DBG (1, "sanei_pio_open: `%s' is not a valid port number\n", dev); *status = SANE_STATUS_INVAL; return -1; } } if (0 == base) { DBG (1, "sanei_pio_open: 0x%03lx is not a valid base address\n", base); *status = SANE_STATUS_INVAL; return -1; } for (n = 0; n < NELEMS (port); n++) if (port[n].base == base) break; if (NELEMS (port) <= n) { DBG (1, "sanei_pio_open: 0x%03lx is not a valid base address\n", base); *status = SANE_STATUS_INVAL; return -1; } if (port[n].in_use) { DBG (1, "sanei_pio_open: port 0x%03lx is already in use\n", base); *status = SANE_STATUS_DEVICE_BUSY; return -1; } port[n].base = base; port[n].fd = -1; port[n].max_time_seconds = 10; port[n].in_use = 1; if (ioperm (port[n].base, 3, 1)) { DBG (1, "sanei_pio_open: cannot get io privilege for port 0x%03lx\n", port[n].base); *status = SANE_STATUS_IO_ERROR; return -1; } pio_reset (&port[n]); *status = SANE_STATUS_GOOD; return n; } SANE_Status sanei_pio_open (const char *dev, int *fdp) { SANE_Status status; *fdp = pio_open (dev, &status); return status; } void sanei_pio_close (int fd) { Port p = port + fd; if ((0 > fd) && (NELEMS (port) <= fd)) return; if (!p->in_use) return; if (-1 != p->fd) { close (p->fd); p->fd = -1; } p->in_use = 0; return; } int sanei_pio_read (int fd, u_char * buf, int n) { if ((0 > fd) && (NELEMS (port) <= fd)) return -1; if (!port[fd].in_use) return -1; return pio_read (&port[fd], buf, n); } int sanei_pio_write (int fd, const u_char * buf, int n) { if ((0 > fd) && (NELEMS (port) <= fd)) return -1; if (!port[fd].in_use) return -1; return pio_write (&port[fd], buf, n); } #else /* !HAVE_IOPERM */ #ifdef __BEOS__ #include SANE_Status sanei_pio_open (const char *dev, int *fdp) { int fp; /* open internal parallel port */ fp=open("/dev/parallel/parallel1",O_RDWR); *fdp=fp; if(fp<0) return SANE_STATUS_INVAL; return(SANE_STATUS_GOOD); } void sanei_pio_close (int fd) { close(fd); return; } int sanei_pio_read (int fd, u_char * buf, int n) { return(read(fd,buf,n)); } int sanei_pio_write (int fd, const u_char * buf, int n) { return(write(fd,buf,n)); } #else /* !__BEOS__ */ SANE_Status sanei_pio_open (const char *dev, int *fdp) { *fdp = -1; return SANE_STATUS_INVAL; } void sanei_pio_close (int fd) { return; } int sanei_pio_read (int fd, u_char * buf, int n) { return -1; } int sanei_pio_write (int fd, const u_char * buf, int n) { return -1; } #endif /* __BEOS__ */ #endif /* !HAVE_IOPERM */ sane-backends-extras-1.0.22.3ubuntu1/sanei/sanei_scsi.c0000664000000000000000000050604611475557446017573 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 1996, 1997 David Mosberger-Tang Copyright (C) 2003 Frank Zago This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. This file provides a generic SCSI interface. */ #ifdef _AIX # include "../include/lalloca.h" /* MUST come first for AIX! */ #endif #include "../include/sane/config.h" #include "../include/lalloca.h" #include "../include/lassert.h" #include #include #include #include #include #include #include #include #include #define STUBBED_INTERFACE 0 #define LINUX_INTERFACE 1 #define BSD_INTERFACE 2 #define HPUX_INTERFACE 3 #define OPENSTEP_INTERFACE 4 #define DECUNIX_INTERFACE 5 #define SCO_OS5_INTERFACE 6 #define IRIX_INTERFACE 7 #define SOLARIS_INTERFACE 8 #define SOLARIS_SG_INTERFACE 9 #define OS2_INTERFACE 10 #define AIX_GSC_INTERFACE 11 #define DOMAINOS_INTERFACE 12 #define FREEBSD_CAM_INTERFACE 13 #define SYSVR4_INTERFACE 14 #define SCO_UW71_INTERFACE 15 #define SOLARIS_USCSI_INTERFACE 16 #define MACOSX_INTERFACE 17 #define WIN32_INTERFACE 18 #ifdef HAVE_RESMGR # include #endif #if defined (HAVE_SCSI_SG_H) # define USE LINUX_INTERFACE # include #elif defined (HAVE__USR_SRC_LINUX_INCLUDE_SCSI_SG_H) # define USE LINUX_INTERFACE # include "/usr/src/linux/include/scsi/sg.h" #elif defined (HAVE_SYS_SCSICMD) # define USE SCSO_OS5_INTERFACE # include # include #elif defined (HAVE_CAMLIB_H) # define USE FREEBSD_CAM_INTERFACE # include /* there is a bug in scsi_all.h */ # include # include # include # include # include #elif defined (HAVE_SYS_SCSIIO_H) # define USE BSD_INTERFACE # include # ifdef HAVE_SCSI_H # include # endif #elif defined (HAVE_BSD_DEV_SCSIREG_H) # define USE OPENSTEP_INTERFACE # include #elif defined (HAVE_IO_CAM_CAM_H) # define USE DECUNIX_INTERFACE # include # include # include # include # include #elif defined (HAVE_SYS_DSREQ_H) # define USE IRIX_INTERFACE # include # include #elif defined (HAVE_SYS_SCSI_H) # include # ifdef HAVE_SYS_SDI_COMM_H # ifdef HAVE_SYS_PASSTHRUDEF_H # define USE SCO_UW71_INTERFACE # include # include # include # include # else # define USE SYSVR4_INTERFACE /* Unixware 2.x tested */ # define HAVE_SYSV_DRIVER # include # include # endif # else # ifdef SCTL_READ # define USE HPUX_INTERFACE # else # ifdef HAVE_GSCDDS_H # define USE AIX_GSC_INTERFACE # include # else /* This happens for AIX without gsc and possibly other platforms... */ # endif # endif # endif #elif defined (HAVE_OS2_H) # define USE OS2_INTERFACE # define INCL_DOSFILEMGR # define INCL_DOS # define INCL_DOSDEVICES # define INCL_DOSDEVIOCTL # define INCL_DOSMEMMGR # include # include "os2_srb.h" #elif defined (HAVE_SYS_SCSI_SGDEFS_H) # define USE SOLARIS_SG_INTERFACE # include #elif defined (HAVE_SYS_SCSI_TARGETS_SCGIO_H) # define USE SOLARIS_INTERFACE # define SOL2 # include #elif defined (HAVE_SYS_SCSI_SCSI_H) /* * the "offical" solaris uscsi(7I) interface; comes last, so that users * installing the SCG/SG driver can still use these generic scsi interfaces */ # define USE SOLARIS_USCSI_INTERFACE # define SOL2 # include #elif defined (HAVE_APOLLO_SCSI_H) # define USE DOMAINOS_INTERFACE # include /* Only used for signal name for KillDomainServer */ # include # include # include # include # include # include # include # include "sanei_DomainOS.h" #elif defined (HAVE_IOKIT_CDB_IOSCSILIB_H) || \ defined (HAVE_IOKIT_SCSI_SCSICOMMANDOPERATIONCODES_H) || \ defined (HAVE_IOKIT_SCSI_COMMANDS_SCSICOMMANDOPERATIONCODES_H) # define USE MACOSX_INTERFACE # include # include # ifdef HAVE_IOKIT_CDB_IOSCSILIB_H # include # include # endif # ifdef HAVE_IOKIT_SCSI_SCSICOMMANDOPERATIONCODES_H /* The def of VERSION causes problems in the following include files */ # undef VERSION # include # include # include # else # ifdef HAVE_IOKIT_SCSI_COMMANDS_SCSICOMMANDOPERATIONCODES_H /* The def of VERSION causes problems in the following include files */ # undef VERSION # include # include # include # endif # endif #elif defined (HAVE_WINDOWS_H) # define USE WIN32_INTERFACE # include # include # include #endif #ifndef USE # define USE STUBBED_INTERFACE #endif #if USE == LINUX_INTERFACE # include #endif #include "../include/sane/sanei.h" #include "../include/sane/sanei_config.h" #include "../include/sane/sanei_scsi.h" #define BACKEND_NAME sanei_scsi #include "../include/sane/sanei_debug.h" #if USE == DECUNIX_INTERFACE static int cam_fd = -1; /* used for SCSI CAM based interfaces */ #endif #if USE == SOLARIS_INTERFACE || USE == SOLARIS_USCSI_INTERFACE static int unit_ready (int fd); #endif #ifdef SG_BIG_BUFF # define MAX_DATA SG_BIG_BUFF #endif #if USE == SYSVR4_INTERFACE # define MAX_DATA 56*1024 /* don't increase or kernel will dump * tested with adsl, adsa and umax backend * it depends on the lowend scsi * drivers . But the most restriction * is in the UNIXWARE KERNEL witch do * not allow more then 64kB DMA transfers */ static char lastrcmd[16]; /* hold command block of last read command */ #endif #if USE == OPENSTEP_INTERFACE # define MAX_DATA (120*1024) #endif #if USE == IRIX_INTERFACE # define MAX_DATA (256*1024) #endif #if USE == FREEBSD_CAM_INTERFACE # define MAX_DATA (DFLTPHYS - PAGE_SIZE) #endif #if USE == SOLARIS_INTERFACE # define MAX_DATA (128*1024) #endif #if USE == SOLARIS_SG_INTERFACE # define MAX_DATA (128*1024) #endif #if USE == SOLARIS_USCSI_INTERFACE # define MAX_DATA (64*1024) #endif #if USE == OS2_INTERFACE # define MAX_DATA (64*1024) #endif #if USE == MACOSX_INTERFACE # define MAX_DATA (128*1024) #endif #ifndef MAX_DATA # define MAX_DATA (32*1024) #endif #ifdef SG_SET_TIMEOUT # ifdef _SC_CLK_TCK # define GNU_HZ sysconf(_SC_CLK_TCK) # else # ifdef HZ # define GNU_HZ HZ # else # ifdef CLOCKS_PER_SEC # define GNU_HZ CLOCKS_PER_SEC # endif # endif # endif #endif /* default timeout value: 120 seconds */ static int sane_scsicmd_timeout = 120; int sanei_scsi_max_request_size = MAX_DATA; #if USE == LINUX_INTERFACE /* the following #defines follow Douglas Gilbert's sample code to maintain run time compatibility with the old and the new SG driver for Linux */ #include "linux_sg3_err.h" /* contains several definitions of error codes */ #ifndef SG_SET_COMMAND_Q #define SG_SET_COMMAND_Q 0x2271 #endif #ifndef SG_SET_RESERVED_SIZE #define SG_SET_RESERVED_SIZE 0x2275 #endif #ifndef SG_GET_RESERVED_SIZE #define SG_GET_RESERVED_SIZE 0x2272 #endif #ifndef SG_GET_SCSI_ID #define SG_GET_SCSI_ID 0x2276 #else #define SG_GET_SCSI_ID_FOUND #endif #ifndef SG_GET_VERSION_NUM #define SG_GET_VERSION_NUM 0x2282 #endif #ifndef SG_NEXT_CMD_LEN #define SG_NEXT_CMD_LEN 0x2283 #endif #ifndef SCSIBUFFERSIZE #define SCSIBUFFERSIZE (128 * 1024) #endif /* the struct returned by the SG ioctl call SG_GET_SCSI_ID changed from version 2.1.34 to 2.1.35, and we need the informations from the field s_queue_depth, which was introduced in 2.1.35. To get this file compiling also with older versions of sg.h, the struct is re-defined here. */ typedef struct xsg_scsi_id { int host_no; /* as in "scsi" where 'n' is one of 0, 1, 2 etc */ int channel; int scsi_id; /* scsi id of target device */ int lun; int scsi_type; /* TYPE_... defined in scsi/scsi.h */ short h_cmd_per_lun; /* host (adapter) maximum commands per lun */ short d_queue_depth; /* device (or adapter) maximum queue length */ int unused1; /* probably find a good use, set 0 for now */ int unused2; /* ditto */ } SG_scsi_id; typedef struct req { struct req *next; int fd; u_int running:1, done:1; SANE_Status status; size_t *dst_len; void *dst; /* take the definition of the ioctl parameter SG_IO as a compiler flag if the new SG driver is available */ union { struct { struct sg_header hdr; /* Make sure this is the last element, the real size is SG_BIG_BUFF and machine dependant */ u_int8_t data[1]; } cdb; #ifdef SG_IO /* at present, Linux's SCSI system limits the sense buffer to 16 bytes which is definitely too small. Hoping that this will change at some time, let's set the sense buffer size to 64. */ #define SENSE_MAX 64 #define MAX_CDB 12 struct { struct sg_io_hdr hdr; u_char sense_buffer[SENSE_MAX]; u_int8_t data[1]; } sg3; #endif } sgdata; } req; typedef struct Fdparms { int sg_queue_used, sg_queue_max; size_t buffersize; req *sane_qhead, *sane_qtail, *sane_free_list; } fdparms; #endif #if USE == FREEBSD_CAM_INTERFACE # define CAM_MAXDEVS 128 struct cam_device *cam_devices[CAM_MAXDEVS] = { NULL }; #endif static struct { u_int in_use:1; /* is this fd_info in use? */ u_int fake_fd:1; /* is this a fake file descriptor? */ u_int bus, target, lun; /* nexus info; used for some interfaces only */ SANEI_SCSI_Sense_Handler sense_handler; void *sense_handler_arg; void *pdata; /* platform-specific data */ } *fd_info; static u_char cdb_sizes[8] = { 6, 10, 10, 12, 12, 12, 10, 10 }; #define CDB_SIZE(opcode) cdb_sizes[(((opcode) >> 5) & 7)] #if USE == DOMAINOS_INTERFACE /* This includes the server code. Most of these routines are private to the actual server. The only public ones are: sanei_DomainOS_init Used to initialize the server DomainErrorCheck A common error handling routine */ #include "sanei_DomainOS.c" int ServerInitialized = 0; pid_t ServerPID; struct DomainServerCommon *com; long CommandTriggerValue[2]; ec2_$ptr_t CommandAcceptedPtr[2]; long ResultTriggerValue[2]; ec2_$ptr_t ResultReadyPtr[2]; time_$clock_t Wait16S = { 64, 0 }; /* Delay of about 16 Seconds */ /* This function is registered as an exit function. It's purpose is to make sure that the Domain SANE Server is stopped. It tries to send an Exit command, and if that fails, it will send SIGQUIT to the server. It will also unmap the common area before it returns. */ static void KillDomainServer (void) { static boolean GotTheLock; static status_$t status; static pinteger index; DBG (1, "Asking Domain SANE Server to exit\n"); /* First, try to send a command to exit */ if (GotTheLock = mutex_$lock (&com->CommandLock, Wait16S)) { /* Set the wait time to 16 Seconds (units are 4uS) */ com->opcode = Exit; CommandTriggerValue[0] = ec2_$read (com->CommandAccepted) + 1; ec2_$advance (&com->CommandAvailable, &status); DomainErrorCheck (status, "Can't advance CommandAvailable EC"); /* For this wait, we want to allow a timeout as well */ CommandTriggerValue[1] = (ec2_$read (*CommandAcceptedPtr[1]) + DomainECWaitConstant); index = ec2_$wait_svc (CommandAcceptedPtr, CommandTriggerValue, 2, &status); DomainErrorCheck (status, "Error waiting on Exit command acceptance EC"); /* Release the lock */ mutex_$unlock (&com->CommandLock); if (index == 1) DBG (1, "Domain SANE Server responded to exit request\n"); else DBG (1, "Domain SANE Server did not respond to exit request\n"); } else DBG (0, "Could not get mutex lock for killing server\n"); if ((!GotTheLock) || (index != 1)) { /* If we get here, then we never got the mutex lock, or we timed out waiting for an Exit command ack. */ /* It's now time to be brutal with the server */ DBG (1, "Sending QUIT signal to Domain SANE Server\n"); kill (ServerPID, SIGQUIT); } /* unmap the common area */ ms_$unmap (com, sizeof (struct DomainServerCommon), &status); DomainErrorCheck (status, "Error unmapping common area"); } #endif /* USE == DOMAINOS_INTERFACE */ #if USE == OS2_INTERFACE /* Driver info: */ static HFILE driver_handle = 0; /* file handle for device driver */ static PVOID aspi_buf = 0; /* Big data buffer locked by driver. */ static int aspi_ref_count = 0; /* # of fds using ASPI */ static SRB *PSRBlock = 0; /* SCSI Request Block */ static char tmpAspi[MAXPATHLEN]; /* scsi chain scan */ #define INQUIRY 0x12 #define set_inquiry_return_size(icb,val) icb[0x04]=val #define IN_periph_devtype_cpu 0x03 #define IN_periph_devtype_scanner 0x06 #define get_inquiry_vendor(in, buf) strncpy(buf, in + 0x08, 0x08) #define get_inquiry_product(in, buf) strncpy(buf, in + 0x10, 0x010) #define get_inquiry_version(in, buf) strncpy(buf, in + 0x20, 0x04) #define get_inquiry_periph_devtype(in) (in[0] & 0x1f) #define get_inquiry_additional_length(in) in[0x04] #define set_inquiry_length(out,n) out[0x04]=n-5 /* Open OS2 ASPI driver. Output: 0 if error, which is reported. */ static int open_aspi (void) { ULONG rc; ULONG ActionTaken; USHORT lockSegmentReturn; unsigned long cbreturn = 0; unsigned long cbParam = 0; int i, num_adapters; /* no. of scsi adapters installed */ char *devtypes[] = { "disk", "tape", "printer", "processor", "CD-writer", "CD-drive", "scanner", "optical-drive", "jukebox", "communicator" }; FILE *tmp; if (driver_handle) { aspi_ref_count++; /* increment internal usage counter */ return 1; /* Already open. */ } aspi_buf = _tcalloc (sanei_scsi_max_request_size, 1); if (aspi_buf == NULL) { DBG (1, "sanei_scsi_open_aspi: _tcalloc aspi_buf failed"); return 0; } PSRBlock = _tcalloc (sizeof (SRB), 1); if (PSRBlock == NULL) { DBG (1, "sanei_scsi_open_aspi: _tcalloc PSRBlock failed"); return 0; } rc = DosOpen ((PSZ) "aspirou$", /* open driver */ &driver_handle, &ActionTaken, 0, 0, FILE_OPEN, OPEN_SHARE_DENYREADWRITE | OPEN_ACCESS_READWRITE, NULL); if (rc) { /* opening failed -> return false */ DBG (1, "open_aspi: opening failed.\n"); return 0; } /* Lock aspi_buf. */ rc = DosDevIOCtl (driver_handle, 0x92, 0x04, /* pass aspi_buf pointer */ (void *) aspi_buf, sizeof (PVOID), /* to driver */ &cbParam, (void *) &lockSegmentReturn, sizeof (USHORT), &cbreturn); if (rc || lockSegmentReturn) { /* DosDevIOCtl failed */ DBG (1, "sanei_scsi_open_aspi: Can't lock buffer. rc= %lu \n", rc); return 0; } /* query number of installed adapters */ memset (PSRBlock, 0, sizeof (SRB)); PSRBlock->cmd = SRB_Inquiry; /* host adapter inquiry */ PSRBlock->ha_num = 0; /* host adapter number */ PSRBlock->flags = 0; /* no flags set */ rc = DosDevIOCtl (driver_handle, 0x92, 0x02, (void *) PSRBlock, sizeof (SRB), &cbParam, (void *) PSRBlock, sizeof (SRB), &cbreturn); num_adapters = PSRBlock->u.inq.num_ha; DBG (1, "OS/2: installed adapters %d\n", num_adapters); DBG (1, "OS/2: ASPI manager is '%s'\n", PSRBlock->u.inq.aspimgr_id); DBG (1, "OS/2: host adapter is '%s'\n", PSRBlock->u.inq.host_id); DBG (1, "OS/2: unique id is '%s'\n", PSRBlock->u.inq.unique_id); strcpy (tmpAspi, "asXXXXXX"); mktemp (tmpAspi); DBG (2, "open_aspi: open temporary file '%s'\n", tmpAspi); tmp = fopen (tmpAspi, "w"); if (!tmp) { /* can't open tmp file */ DBG (1, "open_aspi: Can't open temporary file.\n"); return 0; } /* scan all installed adapters */ for (i = 0; i < num_adapters; i++) { int id; /* query adapter name */ memset (PSRBlock, 0, sizeof (SRB)); PSRBlock->cmd = SRB_Inquiry; /* host adapter inquiry */ PSRBlock->ha_num = i; /* host adapter number */ PSRBlock->flags = 0; /* no flags set */ rc = DosDevIOCtl (driver_handle, 0x92, 0x02, (void *) PSRBlock, sizeof (SRB), &cbParam, (void *) PSRBlock, sizeof (SRB), &cbreturn); DBG (1, "OS/2: adapter#%02d '%s'\n", i, PSRBlock->u.inq.host_id); /* scan scsi chain (need 15 for wide?) */ for (id = 0; id < 7; id++) { unsigned char len; char vendor[9]; char product[17]; char version[5]; char *pp; memset (PSRBlock, 0, sizeof (SRB)); PSRBlock->cmd = SRB_Device; /* get device type */ PSRBlock->ha_num = i; /* host adapter number */ PSRBlock->flags = 0; /* no flags set */ PSRBlock->u.dev.target = id; /* target id */ PSRBlock->u.dev.lun = 0; /* target LUN */ rc = DosDevIOCtl (driver_handle, 0x92, 0x02, (void *) PSRBlock, sizeof (SRB), &cbParam, (void *) PSRBlock, sizeof (SRB), &cbreturn); DBG (1, "OS/2: id#%02d status=%02xh\n", id, PSRBlock->status); /* skip if device not connected */ if (PSRBlock->status == SRB_BadDevice) continue; DBG (1, "OS/2: type is '%s'\n", PSRBlock->u.dev.devtype < sizeof (devtypes) / sizeof (char *)? devtypes[PSRBlock->u.dev.devtype] : "unknown device"); /* query adapter string id */ memset (PSRBlock, 0, sizeof (SRB)); PSRBlock->cmd = SRB_Command; /* execute SCSI command */ PSRBlock->ha_num = i; /* host adapter number */ PSRBlock->flags = SRB_Read | SRB_Post; /* data transfer, posting */ PSRBlock->u.cmd.target = id; /* Target SCSI ID */ PSRBlock->u.cmd.lun = 0; /* Target SCSI LUN */ PSRBlock->u.cmd.data_len = 5; /* # of bytes transferred */ PSRBlock->u.cmd.sense_len = 32; /* length of sense buffer */ PSRBlock->u.cmd.data_ptr = NULL; /* pointer to data buffer */ PSRBlock->u.cmd.link_ptr = NULL; /* pointer to next SRB */ PSRBlock->u.cmd.cdb_len = 6; /* SCSI command length */ PSRBlock->u.cmd.cdb_st[0] = INQUIRY; /* inquiry command */ PSRBlock->u.cmd.cdb_st[1] = 0; /* ?? length */ PSRBlock->u.cmd.cdb_st[2] = 0; /* transfer length MSB */ PSRBlock->u.cmd.cdb_st[3] = 0; /* transfer length */ PSRBlock->u.cmd.cdb_st[4] = 5; /* transfer length LSB */ PSRBlock->u.cmd.cdb_st[5] = 0; rc = DosDevIOCtl (driver_handle, 0x92, 0x02, (void *) PSRBlock, sizeof (SRB), &cbParam, (void *) PSRBlock, sizeof (SRB), &cbreturn); len = ((char *) aspi_buf)[4]; /* additional length */ /* query id string */ memset (PSRBlock, 0, sizeof (SRB)); PSRBlock->cmd = SRB_Command; /* execute SCSI command */ PSRBlock->ha_num = i; /* host adapter number */ PSRBlock->flags = SRB_Read | SRB_Post; /* data transfer, posting */ PSRBlock->u.cmd.target = id; /* Target SCSI ID */ PSRBlock->u.cmd.lun = 0; /* Target SCSI LUN */ PSRBlock->u.cmd.data_len = 5 + len; /* # of bytes transferred */ PSRBlock->u.cmd.sense_len = 32; /* length of sense buffer */ PSRBlock->u.cmd.data_ptr = NULL; /* pointer to data buffer */ PSRBlock->u.cmd.link_ptr = NULL; /* pointer to next SRB */ PSRBlock->u.cmd.cdb_len = 6; /* SCSI command length */ PSRBlock->u.cmd.cdb_st[0] = 0x12; /* inquiry command */ PSRBlock->u.cmd.cdb_st[1] = 0; /* ?? length */ PSRBlock->u.cmd.cdb_st[2] = 0; /* transfer length MSB */ PSRBlock->u.cmd.cdb_st[3] = 0; /* transfer length */ PSRBlock->u.cmd.cdb_st[4] = 5 + len; /* transfer length LSB */ PSRBlock->u.cmd.cdb_st[5] = 0; rc = DosDevIOCtl (driver_handle, 0x92, 0x02, (void *) PSRBlock, sizeof (SRB), &cbParam, (void *) PSRBlock, sizeof (SRB), &cbreturn); DBG (1, "OS/2 '%s'\n", (char *) aspi_buf + 8); /* write data */ get_inquiry_vendor ((char *) aspi_buf, vendor); get_inquiry_product ((char *) aspi_buf, product); get_inquiry_version ((char *) aspi_buf, version); pp = &vendor[7]; vendor[8] = '\0'; while (pp >= vendor && (*pp == ' ' || *pp >= 127)) *pp-- = '\0'; pp = &product[15]; product[16] = '\0'; while (pp >= product && (*pp == ' ' || *pp >= 127)) *pp-- = '\0'; pp = product; do { if (isspace ((int) *pp)) *pp = '_'; } while (*++pp); pp = &version[3]; version[4] = '\0'; while (pp >= version && (*pp == ' ' || *(pp - 1) >= 127)) *pp-- = '\0'; fprintf (tmp, "Vendor: %s ", vendor); fprintf (tmp, "Model: %s ", product); fprintf (tmp, "Rev: %s ", version); fprintf (tmp, "scsi %d Channel: 0 Id: %d Lun: 0\n", i, id); } } DBG (2, "open_aspi: close temporary file '%s'\n", tmpAspi); fclose (tmp); aspi_ref_count++; /* increment internal usage counter */ return 1; } /* Close driver and free everything. */ static void close_aspi (void) { aspi_ref_count--; /* decrement internal usage counter */ if (aspi_ref_count) return; /* wait for usage==0 */ if (driver_handle) /* Close driver. */ DosClose (driver_handle); driver_handle = 0; if (aspi_buf) /* Free buffer. */ _tfree (aspi_buf); aspi_buf = 0; if (PSRBlock) _tfree (PSRBlock); PSRBlock = 0; errno = 0; if (unlink (tmpAspi)) /* remove scsi descriptions */ DBG (2, "OS/2: error#%d while removing temporary '%s'\n", errno, tmpAspi); strcpy (tmpAspi, ""); DBG (1, "OS/2: ASPI closed\n"); } #endif /* USE_OS2_INTERFACE */ static int num_alloced = 0; #if USE == LINUX_INTERFACE static int sg_version = 0; static SANE_Status get_max_buffer_size (const char *file) { int fd = -1; int buffersize = SCSIBUFFERSIZE, i; size_t len; char *cc, *cc1, buf[32]; #ifdef HAVE_RESMGR fd = rsm_open_device(file, O_RDWR); #endif if (fd == -1) fd = open (file, O_RDWR); if (fd > 0) { cc = getenv ("SANE_SG_BUFFERSIZE"); if (cc) { i = strtol (cc, &cc1, 10); if (cc != cc1 && i >= 32768) buffersize = i; } ioctl (fd, SG_SET_RESERVED_SIZE, &buffersize); if (0 == ioctl (fd, SG_GET_RESERVED_SIZE, &buffersize)) { if (buffersize < sanei_scsi_max_request_size) sanei_scsi_max_request_size = buffersize; close (fd); DBG (4, "get_max_buffer_size for %s: %i\n", file, sanei_scsi_max_request_size); return SANE_STATUS_GOOD; } else { close (fd); /* ioctl not available: we have the old SG driver */ fd = open ("/proc/sys/kernel/sg-big-buff", O_RDONLY); if (fd > 0 && (len = read (fd, buf, sizeof (buf) - 1)) > 0) { buf[len] = '\0'; sanei_scsi_max_request_size = atoi (buf); close (fd); } else sanei_scsi_max_request_size = buffersize < SG_BIG_BUFF ? buffersize : SG_BIG_BUFF; return SANE_STATUS_IO_ERROR; } } else return SANE_STATUS_GOOD; } SANE_Status sanei_scsi_open_extended (const char *dev, int *fdp, SANEI_SCSI_Sense_Handler handler, void *handler_arg, int *buffersize) #else SANE_Status sanei_scsi_open (const char *dev, int *fdp, SANEI_SCSI_Sense_Handler handler, void *handler_arg) #endif { u_int bus = 0, target = 0, lun = 0, fake_fd = 0; char *real_dev = 0; void *pdata = 0; char *cc, *cc1; int fd, i; #if USE == LINUX_INTERFACE static int first_time = 1; #elif USE == MACOSX_INTERFACE UInt8 *guid; int len; u_int d; #endif cc = getenv ("SANE_SCSICMD_TIMEOUT"); if (cc) { i = strtol (cc, &cc1, 10); /* 20 minutes are hopefully enough as a timeout value ;) */ if (cc != cc1 && i > 0 && i <= 1200) { sane_scsicmd_timeout = i; } else { DBG (1, "sanei_scsi_open: timeout value must be between 1 and 1200 seconds\n"); } } DBG_INIT (); #if USE == LINUX_INTERFACE if (first_time) { first_time = 0; /* Try to determine a reliable value for sanei_scsi_max_request_size: With newer versions of the SG driver, check the available buffer size by opening all SG device files belonging to a scanner, issue the ioctl calls for setting and reading the reserved buffer size, and take the smallest value. For older version of the SG driver, which don't support variable buffer size, try to read /proc/sys/kernel/sg-big-biff ; if this fails (SG driver too old, or loaded as a module), use SG_BIG_BUFF */ sanei_scsi_max_request_size = SCSIBUFFERSIZE; cc = getenv ("SANE_SG_BUFFERSIZE"); if (cc) { i = strtol (cc, &cc1, 10); if (cc != cc1 && i >= 32768) sanei_scsi_max_request_size = i; } sanei_scsi_find_devices (0, 0, "Scanner", -1, -1, -1, -1, get_max_buffer_size); sanei_scsi_find_devices (0, 0, "Processor", -1, -1, -1, -1, get_max_buffer_size); DBG (4, "sanei_scsi_open: sanei_scsi_max_request_size=%d bytes\n", sanei_scsi_max_request_size); } #endif #if USE == OS2_INTERFACE if (sscanf (dev, "b%ut%ul%u", &bus, &target, &lun) != 3) { DBG (1, "sanei_scsi_open: device name %s is not valid\n", dev); return SANE_STATUS_INVAL; } if (!open_aspi ()) { /* Open driver if necessary. */ close_aspi (); return SANE_STATUS_INVAL; } /* Find fake fd. */ for (fd = 0; fd < num_alloced; ++fd) if (!fd_info[fd].in_use) break; fake_fd = 1; #elif USE == DECUNIX_INTERFACE { UAGT_CAM_SCAN cam_scan; if (sscanf (dev, "b%dt%dl%d", &bus, &target, &lun) != 3) { DBG (1, "sanei_scsi_open: device name `%sŽ is not valid: %s\n", dev, strerror (errno)); return SANE_STATUS_INVAL; } if (cam_fd < 0) { cam_fd = open ("/dev/cam", O_RDWR); if (cam_fd < 0) { DBG (1, "sanei_scsi_open: open(/dev/cam) failed: %s\n", strerror (errno)); return SANE_STATUS_INVAL; } } cam_scan.ucs_bus = bus; cam_scan.ucs_target = target; cam_scan.ucs_lun = lun; if (ioctl (cam_fd, UAGT_CAM_SINGLE_SCAN, &cam_scan) < 0) { DBG (1, "sanei_scsi_open: ioctl(UAGT_CAM_SINGLE_SCAN) failed: %s\n", strerror (errno)); return SANE_STATUS_INVAL; } for (fd = 0; fd < num_alloced; ++fd) if (!fd_info[fd].in_use) break; fake_fd = 1; } #elif USE == DOMAINOS_INTERFACE { static int index; static status_$t status; static unsigned long length_mapped; DBG (1, "sanei_scsi_open: (dev='%s', int * fdp=%p, " "SANEI_SCSI_Sense_Handler handler=%p)\n", dev, fdp, handler); /* See if the server process has started yet */ if (!ServerInitialized) { static char *CommonAreaPath; /* Initialize the server */ DBG (2, "Initializing Domain Server\n"); /* Map the area */ CommonAreaPath = tmpnam (NULL); DBG (2, "Domain Server Common area name is '%s'\n", CommonAreaPath); com = ms_$crmapl (CommonAreaPath, strlen (CommonAreaPath), 0, sizeof (struct DomainServerCommon), ms_$cowriters, &status); DomainErrorCheck (status, "Can't open common area"); DBG (2, "Domain Server common area mapped\n"); /* Initialize the eventcounts */ ec2_$init (&com->CommandAvailable); ec2_$init (&com->CommandAccepted); ec2_$init (&com->ResultReady); ec2_$init (&com->ResultAccepted); DBG (2, "Domain Server EC's initialized\n"); /* Initialize the mutex locks */ mutex_$init (&com->CommandLock); mutex_$init (&com->ResultLock); DBG (2, "Domain Server MutexLock's initialized\n"); /* Initialize pointers to ECs */ CommandAcceptedPtr[0] = &com->CommandAccepted; ResultReadyPtr[0] = &com->ResultReady; time_$get_ec (time_$clockh_key, &CommandAcceptedPtr[1], &status); DomainErrorCheck (status, "Can't get time EC"); ResultReadyPtr[1] = CommandAcceptedPtr[1]; /* Read the ResultReady EC value, to avoid race with the server */ ResultTriggerValue[0] = ec2_$read (com->ResultReady) + 1; /* Now invoke the server */ ServerPID = fork (); if (!ServerPID) { /* I am the child, call the initialization routine */ sanei_DomainOS_init (CommonAreaPath); /* We get here when the server is done, so we just exit. */ exit (EXIT_SUCCESS); } /* The communication area is open, wait for the initial response */ ResultTriggerValue[1] = (ec2_$read (*ResultReadyPtr[1]) + DomainECWaitConstant); index = ec2_$wait_svc (ResultReadyPtr, ResultTriggerValue, 2, &status); DomainErrorCheck (status, "Error waiting on initial open EC"); if (index != 1) { DBG (0, "Domain SANE Server never responded on startup\n"); /* Send a quit signal to the server */ kill (ServerPID, SIGQUIT); return SANE_STATUS_INVAL; } /* Register a function to kill the server when we are done */ assert (!atexit (KillDomainServer)); ServerInitialized = 1; } /* Find fake fd. */ for (fd = 0; fd < num_alloced; ++fd) if (!fd_info[fd].in_use) break; fake_fd = 1; /* Send the command open to the server */ if (!mutex_$lock (&com->CommandLock, Wait16S)) { DBG (0, "Could not obtain mutex lock for Open\n"); return SANE_STATUS_INVAL; } com->opcode = Open; strcpy (com->open_path, dev); CommandTriggerValue[0] = ec2_$read (com->CommandAccepted) + 1; ec2_$advance (&com->CommandAvailable, &status); DomainErrorCheck (status, "Can't advance CommandAvailable EC"); CommandTriggerValue[1] = (ec2_$read (*CommandAcceptedPtr[1]) + DomainECWaitConstant); index = ec2_$wait_svc (CommandAcceptedPtr, CommandTriggerValue, 2, &status); DomainErrorCheck (status, "Error waiting on Open command acceptance EC"); if (index != 1) { DBG (0, "Domain SANE Server never accepted Open Command\n"); return SANE_STATUS_INVAL; } /* Read the result */ status = com->CommandStatus; DomainErrorCheck (status, "Opening device in server"); /* Now map the data area, and make it temporary */ DBG (2, "Mapping server's data block, name is '%s'\n", com->open_path); pdata = ms_$mapl (com->open_path, strlen (com->open_path), 0, DomainMaxDataSize + DomainSenseSize, ms_$cowriters, ms_$wr, true, &length_mapped, &status); DomainErrorCheck (status, "Mapping Server Data block"); assert (length_mapped >= DomainMaxDataSize + DomainSenseSize); ms_$mk_temporary (pdata, &status); DomainErrorCheck (status, "Can't make data block temporary"); /* Release the lock */ mutex_$unlock (&com->CommandLock); if (status.all != status_$ok) { /* we have a failure, return an error code, and generate debug output */ DBG (1, "sanei_scsi_open: acquire failed, Domain/OS status is %08x\n", status.all); error_$print (status); return SANE_STATUS_INVAL; } else { /* device acquired, what else to do? */ fd = com->fd; } } #elif USE == FREEBSD_CAM_INTERFACE if (1) { /* 'if(1) {' makes my emacs c-mode indent better than just '{' unfortunately, this only works if all of the '{' are that way. */ struct cam_device *curdev; fake_fd = 1; fd = -1; if ((curdev = cam_open_pass (dev, O_RDWR, NULL)) != NULL) { for (fd = 0; fd < CAM_MAXDEVS && cam_devices[fd] != NULL; fd++) ; if (fd == CAM_MAXDEVS) { DBG (1, "sanei_scsi_open: too many CAM devices (%d)\n", fd); cam_close_device (curdev); return SANE_STATUS_INVAL; } cam_devices[fd] = curdev; } else { DBG (1, "sanei_scsi_open: can't open device `%sŽ: %s\n", dev, strerror (errno)); return SANE_STATUS_INVAL; } } #elif USE == SCO_UW71_INTERFACE { pt_scsi_address_t dev_addr; pt_handle_t pt_handle; int bus, cnt, id, lun; if (4 != sscanf (dev, "/dev/passthru0:%d,%d,%d,%d", &bus, &cnt, &id, &lun)) { DBG (1, "sanei_scsi_open: device name `%sŽ is not valid: %s\n", dev, strerror (errno)); return SANE_STATUS_INVAL; } dev_addr.psa_bus = bus; dev_addr.psa_controller = cnt; dev_addr.psa_target = id; dev_addr.psa_lun = lun; if (0 != pt_open (PASSTHRU_SCSI_ADDRESS, &dev_addr, PT_EXCLUSIVE, &pt_handle)) { DBG (1, "sanei_scsi_open: pt_open failed: %s!\n", strerror (errno)); return SANE_STATUS_INVAL; } else fd = (int) pt_handle; } #elif USE == MACOSX_INTERFACE { # if defined (HAVE_IOKIT_SCSI_SCSICOMMANDOPERATIONCODES_H) || \ defined (HAVE_IOKIT_SCSI_COMMANDS_SCSICOMMANDOPERATIONCODES_H) len = strlen (dev); if (len > 2 && len % 2 == 0 && dev [0] == '<' && dev [len - 1] == '>') { len = (len - 2) / 2; guid = (UInt8 *) malloc (len); for (i = 0; i < len; i++) { if (sscanf (&dev [2 * i + 1], "%02x", &d) != 1) break; guid [i] = d; } if (i == len) pdata = (void *) CFDataCreate (kCFAllocatorDefault, guid, len); free (guid); } # endif # ifdef HAVE_IOKIT_CDB_IOSCSILIB_H if ((pdata == NULL) && (sscanf (dev, "u%ut%ul%u", &bus, &target, &lun) != 3)) # else if (pdata == NULL) # endif { DBG (1, "sanei_scsi_open: device name %s is not valid\n", dev); return SANE_STATUS_INVAL; } /* Find fake fd. */ for (fd = 0; fd < num_alloced; ++fd) if (!fd_info[fd].in_use) break; fake_fd = 1; } #elif USE == WIN32_INTERFACE { char scsi_hca_name[20]; u_int hca = 0; if (sscanf (dev, "h%ub%ut%ul%u", &hca, &bus, &target, &lun) != 4) { DBG (1, "sanei_scsi_open: device name %s is not valid\n", dev); return SANE_STATUS_INVAL; } snprintf(scsi_hca_name, 19, "\\\\.\\Scsi%d:", hca); scsi_hca_name[19] = 0; fd = CreateFile(scsi_hca_name, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_RANDOM_ACCESS, NULL ); if (fd == INVALID_HANDLE_VALUE) fd = -1; } #else #if defined(SGIOCSTL) || (USE == SOLARIS_INTERFACE) { size_t len; /* OpenStep and the Solaris SCG driver are a bit broken in that the device name refers to a scsi _bus_, not an individual scsi device. Hence, SANE has to fudge with the device name so we know which target to connect to. For this purpose, we use the last character in the device name as the target index. 'a' is target 0, 'b', target 1, and so on... */ len = strlen (dev); if (len <= 1) { DBG (1, "sanei_scsi_open: devicename `%s' too short\n", dev); return SANE_STATUS_INVAL; } real_dev = strdup (dev); real_dev[len - 1] = '\0'; target = dev[len - 1] - 'a'; if (target > 7) { DBG (1, "sanei_scsi_open: `%c' is not a valid target id\n", dev[len - 1]); return SANE_STATUS_INVAL; } dev = real_dev; } #endif /* defined(SGIOCSTL) || (USE == SOLARIS_INTERFACE) */ fd = -1; #ifdef HAVE_RESMGR fd = rsm_open_device(dev, O_RDWR | O_EXCL | O_NONBLOCK); #endif if (fd == -1) fd = open (dev, O_RDWR | O_EXCL #if USE == LINUX_INTERFACE | O_NONBLOCK #endif ); if (fd < 0) { SANE_Status status = SANE_STATUS_INVAL; if (errno == EACCES) status = SANE_STATUS_ACCESS_DENIED; else if (errno == EBUSY) status = SANE_STATUS_DEVICE_BUSY; DBG (1, "sanei_scsi_open: open of `%s' failed: %s\n", dev, strerror (errno)); return status; } if (real_dev) free (real_dev); #ifdef SG_SET_TIMEOUT /* Set large timeout since some scanners are slow but do not disconnect... ;-( */ { int timeout; timeout = sane_scsicmd_timeout * GNU_HZ; ioctl (fd, SG_SET_TIMEOUT, &timeout); } #endif #ifdef SGIOCSTL { struct scsi_adr sa; sa.sa_target = target; sa.sa_lun = 0; if (ioctl (fd, SGIOCSTL, &sa) == -1) { DBG (1, "sanei_scsi_open: failed to attach to target: %u (%s)\n", sa.sa_target, strerror (errno)); return SANE_STATUS_INVAL; } } #endif /* SGIOCSTL */ #if USE == LINUX_INTERFACE { SG_scsi_id sid; int ioctl_val; int real_buffersize; fdparms *fdpa = 0; SG_scsi_id devinfo; pdata = fdpa = malloc (sizeof (fdparms)); if (!pdata) { close (fd); return SANE_STATUS_NO_MEM; } memset (fdpa, 0, sizeof (fdparms)); /* default: allow only one command to be sent to the SG driver */ fdpa->sg_queue_max = 1; /* Try to read the SG version. If the ioctl call is successful, we have the new SG driver, and we can increase the buffer size using another ioctl call. If we have SG version 2.1.35 or above, we can additionally enable command queueing. */ if (0 == ioctl (fd, SG_GET_VERSION_NUM, &sg_version)) { DBG (1, "sanei_scsi_open: SG driver version: %i\n", sg_version); ioctl_val = ioctl (fd, SG_GET_SCSI_ID, &devinfo); if (ioctl_val == EINVAL || ioctl_val == ENOTTY) { DBG (1, "sanei_scsi_open: The file %s is not an SG device file\n", dev); close (fd); return SANE_STATUS_INVAL; } if (devinfo.scsi_type != 6 && devinfo.scsi_type != 3) { DBG (1, "sanei_scsi_open: The device found for %s does not look like a scanner\n", dev); close (fd); return SANE_STATUS_INVAL; } /* try to reserve a SG buffer of the size specified by *buffersize */ ioctl (fd, SG_SET_RESERVED_SIZE, buffersize); /* the set call may not be able to allocate as much memory as requested, thus we read the actual buffer size. */ if (0 == ioctl (fd, SG_GET_RESERVED_SIZE, &real_buffersize)) { /* if we got more memory than requested, we stick with with the requested value, in order to allow sanei_scsi_open to check the buffer size exactly. */ if (real_buffersize < *buffersize) *buffersize = real_buffersize; fdpa->buffersize = *buffersize; } else { DBG (1, "sanei_scsi_open: cannot read SG buffer size - %s\n", strerror (errno)); close (fd); return SANE_STATUS_NO_MEM; } DBG (1, "sanei_scsi_open_extended: using %i bytes as SCSI buffer\n", *buffersize); if (sg_version >= 20135) { DBG (1, "trying to enable low level command queueing\n"); if (0 == ioctl (fd, SG_GET_SCSI_ID, &sid)) { DBG (1, "sanei_scsi_open: Host adapter queue depth: %i\n", sid.d_queue_depth); ioctl_val = 1; if (0 == ioctl (fd, SG_SET_COMMAND_Q, &ioctl_val)) { fdpa->sg_queue_max = sid.d_queue_depth; if (fdpa->sg_queue_max <= 0) fdpa->sg_queue_max = 1; } } } } else { /* we have a really old SG driver version, or we're not opening an SG device file */ if (ioctl (fd, SG_GET_TIMEOUT, &ioctl_val) < 0) { DBG (1, "sanei_scsi_open: The file %s is not an SG device file\n", dev); close (fd); return SANE_STATUS_INVAL; } if (sanei_scsi_max_request_size < *buffersize) *buffersize = sanei_scsi_max_request_size; fdpa->buffersize = *buffersize; } if (sg_version == 0) { DBG (1, "sanei_scsi_open: using old SG driver logic\n"); } else { DBG (1, "sanei_scsi_open: SG driver can change buffer size at run time\n"); if (fdpa->sg_queue_max > 1) DBG (1, "sanei_scsi_open: low level command queueing enabled\n"); #ifdef SG_IO if (sg_version >= 30000) { DBG (1, "sanei_scsi_open: using new SG header structure\n"); } #endif } } #endif /* LINUX_INTERFACE */ #endif /* !DECUNIX_INTERFACE */ /* Note: this really relies on fd to start small. Windows starts a little higher than 3. */ if (fd >= num_alloced) { size_t new_size, old_size; old_size = num_alloced * sizeof (fd_info[0]); num_alloced = fd + 8; new_size = num_alloced * sizeof (fd_info[0]); if (fd_info) fd_info = realloc (fd_info, new_size); else fd_info = malloc (new_size); memset ((char *) fd_info + old_size, 0, new_size - old_size); if (!fd_info) { if (!fake_fd) close (fd); return SANE_STATUS_NO_MEM; } } fd_info[fd].in_use = 1; fd_info[fd].sense_handler = handler; fd_info[fd].sense_handler_arg = handler_arg; fd_info[fd].fake_fd = fake_fd; fd_info[fd].bus = bus; fd_info[fd].target = target; fd_info[fd].lun = lun; fd_info[fd].pdata = pdata; #if USE == SOLARIS_INTERFACE || USE == SOLARIS_USCSI_INTERFACE /* verify that the device really exists: */ if (!unit_ready (fd)) { sanei_scsi_close (fd); return SANE_STATUS_INVAL; } #endif #if USE == SYSVR4_INTERFACE memset (lastrcmd, 0, 16); /* reinitialize last read command block */ #endif if (fdp) *fdp = fd; return SANE_STATUS_GOOD; } #if USE == LINUX_INTERFACE /* The "wrapper" for the old open call */ SANE_Status sanei_scsi_open (const char *dev, int *fdp, SANEI_SCSI_Sense_Handler handler, void *handler_arg) { int i = 0; int wanted_buffersize = SCSIBUFFERSIZE, real_buffersize; SANE_Status res; char *cc, *cc1; static int first_time = 1; if (first_time) { cc = getenv ("SANE_SG_BUFFERSIZE"); if (cc) { i = strtol (cc, &cc1, 10); if (cc != cc1 && i >= 32768) wanted_buffersize = i; } } else wanted_buffersize = sanei_scsi_max_request_size; real_buffersize = wanted_buffersize; res = sanei_scsi_open_extended (dev, fdp, handler, handler_arg, &real_buffersize); /* make sure that we got as much memory as we wanted, otherwise the backend might be confused */ if (!first_time && real_buffersize != wanted_buffersize) { DBG (1, "sanei_scsi_open: could not allocate SG buffer memory " "wanted: %i got: %i\n", wanted_buffersize, real_buffersize); sanei_scsi_close (*fdp); return SANE_STATUS_NO_MEM; } first_time = 0; return res; } #else /* dummy for the proposed new open call */ SANE_Status sanei_scsi_open_extended (const char *dev, int *fdp, SANEI_SCSI_Sense_Handler handler, void *handler_arg, int *buffersize) { SANE_Status res; res = sanei_scsi_open (dev, fdp, handler, handler_arg); if (sanei_scsi_max_request_size < *buffersize) *buffersize = sanei_scsi_max_request_size; return res; } #endif void sanei_scsi_close (int fd) { #if USE == LINUX_INTERFACE if (fd_info[fd].pdata) { req *req, *next_req; /* make sure that there are no pending SCSI calls */ sanei_scsi_req_flush_all_extended (fd); req = ((fdparms *) fd_info[fd].pdata)->sane_free_list; while (req) { next_req = req->next; free (req); req = next_req; } free (fd_info[fd].pdata); } #endif fd_info[fd].in_use = 0; fd_info[fd].sense_handler = 0; fd_info[fd].sense_handler_arg = 0; #ifdef WIN32 CloseHandle(fd); #else if (!fd_info[fd].fake_fd) close (fd); #endif #if USE == FREEBSD_CAM_INTERFACE cam_close_device (cam_devices[fd]); cam_devices[fd] = NULL; #elif USE == DOMAINOS_INTERFACE { static int index; static status_$t status; DBG (1, "sanei_scsi_close: fd=%d\n", fd); /* Send the command to the server */ if (!mutex_$lock (&com->CommandLock, Wait16S)) { DBG (0, "Could not obtain mutex lock for Close command\n"); } else { com->opcode = Close; com->fd = fd; CommandTriggerValue[0] = ec2_$read (com->CommandAccepted) + 1; ec2_$advance (&com->CommandAvailable, &status); DomainErrorCheck (status, "Can't advance CommandAvailable EC"); CommandTriggerValue[1] = (ec2_$read (*CommandAcceptedPtr[1]) + DomainECWaitConstant); index = ec2_$wait_svc (CommandAcceptedPtr, CommandTriggerValue, 2, &status); DomainErrorCheck (status, "Error waiting on Close command acceptance EC"); if (index != 1) { DBG (0, "Domain SANE Server never accepted Close Command\n"); } /* Read the result */ status = com->CommandStatus; /* Release the lock */ mutex_$unlock (&com->CommandLock); } /* Unmap the data area */ ms_$unmap (fd_info[com->fd].pdata, DomainMaxDataSize + DomainSenseSize, &status); DomainErrorCheck (status, "Error unmapping device data area"); } #endif /* USE == DOMAINOS_INTERFACE */ #if USE == OS2_INTERFACE close_aspi (); #endif /* USE == OS2_INTERFACE */ #if USE == MACOSX_INTERFACE if (fd_info[fd].pdata) CFRelease (fd_info[fd].pdata); #endif /* USE == MACOSX_INTERFACE */ } #if USE == DOMAINOS_INTERFACE # define WE_HAVE_ASYNC_SCSI void sanei_scsi_req_flush_all (void) { status_$t status; DBG (1, "sanei_scsi_req_flush_all: ()\n"); /* I have never seen this called, and I'm not sure what to do with it, so I guarantee that it will generate a fault, and I can add support for it. */ assert (1 == 0); } SANE_Status sanei_scsi_req_enter2 (int fd, const void *cmd, size_t cmd_size, const void *src, size_t src_size, void *dst, size_t * dst_size, void **idp) { SANEI_SCSI_Sense_Handler handler; static int index; static SANE_Status sane_status; static status_$t status; static scsi_$status_t SCSIStatus; static void *buf_ptr; if (dst_size) DBG (1, "sanei_scsi_req_enter2: (fd=%x, cmd=%p, cmd_size=%x, " "src=%p, src_size=%x, dst=%p, dst_size=%x, *idp=%p)\n", fd, cmd, cmd_size, src, src_size, dst, *dst_size, idp); else DBG (1, "sanei_scsi_req_enter2: (fd=%x, cmd=%p, cmd_size=%x, " "src=%p, src_size=%x, dst=%p, dst_size=NULL, *idp=%p)\n", fd, src, src_size, dst, idp); /* Lock the command structure */ if (!mutex_$lock (&com->CommandLock, mutex_$wait_forever)) { DBG (0, "Could not obtain mutex lock for Enter Command\n"); return SANE_STATUS_INVAL; } /* Fill in the command structure */ com->opcode = Enter; com->fd = fd; com->cdb_size = cmd_size; if (dst_size) com->dst_size = *dst_size; memcpy (&com->cdb, cmd, com->cdb_size); /* figure out if this is a read or a write */ if (dst_size && *dst_size) { /* dest buffer specified, must be a read */ /* assert (com->cdb_size == src_size); */ com->direction = scsi_read; buf_ptr = dst; com->buf_size = *dst_size; } else { /* no dest buffer, must be a write */ /* assert (com->cdb_size <= src_size); */ com->direction = scsi_write; buf_ptr = (char *) src; com->buf_size = src_size; if (com->buf_size) memcpy (fd_info[fd].pdata, buf_ptr, com->buf_size); } CommandTriggerValue[0] = ec2_$read (com->CommandAccepted) + 1; ec2_$advance (&com->CommandAvailable, &status); DomainErrorCheck (status, "Can't advance CommandAvailable EC"); CommandTriggerValue[1] = (ec2_$read (*CommandAcceptedPtr[1]) + DomainECWaitConstant); index = ec2_$wait_svc (CommandAcceptedPtr, CommandTriggerValue, 2, &status); DomainErrorCheck (status, "Error waiting on Enter command acceptance EC"); if (index != 1) { DBG (0, "Domain SANE Server never accepted Enter Command\n"); return SANE_STATUS_INVAL; } /* Read the result */ status = com->CommandStatus; SCSIStatus = com->SCSIStatus; /* Release the lock */ mutex_$unlock (&com->CommandLock); /* Now decode the return status */ if (status.all) DBG (1, "Server returned status %08x from Enter command\n", status.all); switch (status.all) { case status_$ok: sane_status = SANE_STATUS_GOOD; break; case scsi_$dma_underrun: sane_status = SANE_STATUS_IO_ERROR; /* This error is generated by the HP and UMAX backends. They ask for too much data. For now, the error is ignored :-( */ sane_status = SANE_STATUS_GOOD; break; case scsi_$operation_timeout: sane_status = SANE_STATUS_DEVICE_BUSY; break; case scsi_$hdwr_failure: /* received when both scanners were active */ sane_status = SANE_STATUS_IO_ERROR; break; case (status_$ok | 0x80000000): /* Special - no Domain/OS error, but fail bit set means to check SCSI operation status. */ DBG (1, "Server returned SCSI status of %08x\n", SCSIStatus); switch (SCSIStatus) { case scsi_check_condition: /* Call the sense handler, if defined */ handler = fd_info[com->fd].sense_handler; if (handler) (*handler) (fd, ((u_char *) fd_info[fd].pdata + DomainMaxDataSize), fd_info[com->fd].sense_handler_arg); sane_status = SANE_STATUS_IO_ERROR; break; case scsi_busy: sane_status = SANE_STATUS_DEVICE_BUSY; break; default: DBG (0, "Error - Unrecognized SCSI status %08x returned from " "Enter command\n", SCSIStatus); sane_status = SANE_STATUS_IO_ERROR; exit (EXIT_FAILURE); } break; default: DBG (0, "Unmapped status (%08x) returned from Domain SANE Server\n", status.all); sane_status = SANE_STATUS_IO_ERROR; } /* If a read, copy the data into the destination buffer */ if ((com->direction == scsi_read) && com->dst_size) memcpy (buf_ptr, fd_info[fd].pdata, com->dst_size); return sane_status; } SANE_Status sanei_scsi_req_wait (void *id) { SANE_Status status; DBG (1, "sanei_scsi_req_wait: (id=%p)\n", id); status = SANE_STATUS_GOOD; return status; } SANE_Status sanei_scsi_cmd2 (int fd, const void *cmd, size_t cmd_size, const void *src, size_t src_size, void *dst, size_t * dst_size) { SANE_Status status; void *id; DBG (1, "sanei_scsi_cmd2: (fd=%d)\n", fd); status = sanei_scsi_req_enter2 (fd, cmd, cmd_size, src, src_size, dst, dst_size, &id); if (status != SANE_STATUS_GOOD) return status; return sanei_scsi_req_wait (id); } #endif /* USE == DOMAINOS_INTERFACE */ #if USE == LINUX_INTERFACE #include #include #include #define WE_HAVE_ASYNC_SCSI #define WE_HAVE_FIND_DEVICES static int pack_id = 0; static int need_init = 1; static sigset_t all_signals; #define ATOMIC(s) \ do \ { \ sigset_t old_mask; \ \ if (need_init) \ { \ need_init = 0; \ sigfillset (&all_signals); \ } \ sigprocmask (SIG_BLOCK, &all_signals, &old_mask); \ {s;} \ sigprocmask (SIG_SETMASK, &old_mask, 0); \ } \ while (0) static void issue (struct req *req) { ssize_t nwritten; fdparms *fdp; struct req *rp; int retries; int ret; if (!req) return; fdp = (fdparms *) fd_info[req->fd].pdata; DBG (4, "sanei_scsi.issue: %p\n", (void *) req); rp = fdp->sane_qhead; while (rp && rp->running) rp = rp->next; while (rp && fdp->sg_queue_used < fdp->sg_queue_max) { retries = 20; while (retries) { errno = 0; #ifdef SG_IO if (sg_version < 30000) { #endif ATOMIC (rp->running = 1; nwritten = write (rp->fd, &rp->sgdata.cdb, rp->sgdata.cdb.hdr.pack_len); ret = 0; if (nwritten != rp->sgdata.cdb.hdr.pack_len) { /* ENOMEM can easily happen, if both command queueing inside the SG driver and large buffers are used. Therefore, if ENOMEM does not occur for the first command in the queue, we simply try to issue it later again. */ if (errno == EAGAIN || (errno == ENOMEM && rp != fdp->sane_qhead)) { /* don't try to send the data again, but wait for the next call to issue() */ rp->running = 0;} } ); #ifdef SG_IO } else { ATOMIC (rp->running = 1; ret = ioctl(rp->fd, SG_IO, &rp->sgdata.sg3.hdr); nwritten = 0; if (ret < 0) { /* ENOMEM can easily happen, if both command queuein inside the SG driver and large buffers are used. Therefore, if ENOMEM does not occur for the first command in the queue, we simply try to issue it later again. */ if (errno == EAGAIN || (errno == ENOMEM && rp != fdp->sane_qhead)) { /* don't try to send the data again, but wait for the next call to issue() */ rp->running = 0; } else /* game over */ { rp->running = 0; rp->done = 1; rp->status = SANE_STATUS_IO_ERROR; } } ); IF_DBG (if (DBG_LEVEL >= 255) system ("cat /proc/scsi/sg/debug 1>&2");) } #endif if (rp == fdp->sane_qhead && errno == EAGAIN) { retries--; usleep (10000); } else retries = 0; } #ifndef SG_IO if (nwritten != rp->sgdata.cdb.hdr.pack_len) #else if ((sg_version < 30000 && nwritten != rp->sgdata.cdb.hdr.pack_len) || (sg_version >= 30000 && ret < 0)) #endif { if (rp->running) { #ifdef SG_IO if (sg_version < 30000) #endif DBG (1, "sanei_scsi.issue: bad write (errno=%i) %s %li\n", errno, strerror (errno), (long)nwritten); #ifdef SG_IO else if (sg_version > 30000) DBG (1, "sanei_scsi.issue: SG_IO ioctl error (errno=%i, ret=%d) %s\n", errno, ret, strerror (errno)); #endif rp->done = 1; if (errno == ENOMEM) { DBG (1, "sanei_scsi.issue: SG_BIG_BUF inconsistency? " "Check file PROBLEMS.\n"); rp->status = SANE_STATUS_NO_MEM; } else rp->status = SANE_STATUS_IO_ERROR; } else { if (errno == ENOMEM) DBG (1, "issue: ENOMEM - cannot queue SCSI command. " "Trying again later.\n"); else DBG (1, "issue: EAGAIN - cannot queue SCSI command. " "Trying again later.\n"); } break; /* in case of an error don't try to queue more commands */ } else { #ifdef SG_IO if (sg_version < 30000) #endif req->status = SANE_STATUS_IO_ERROR; #ifdef SG_IO else if (sg_version > 30000) /* SG_IO is synchronous, we're all set */ req->status = SANE_STATUS_GOOD; #endif } fdp->sg_queue_used++; rp = rp->next; } } void sanei_scsi_req_flush_all_extended (int fd) { fdparms *fdp; struct req *req, *next_req; int len, count; fdp = (fdparms *) fd_info[fd].pdata; for (req = fdp->sane_qhead; req; req = next_req) { if (req->running && !req->done) { count = sane_scsicmd_timeout * 10; while (count) { errno = 0; #ifdef SG_IO if (sg_version < 30000) #endif len = read (fd, &req->sgdata.cdb, req->sgdata.cdb.hdr.reply_len); #ifdef SG_IO else len = read (fd, &req->sgdata.sg3.hdr, sizeof (Sg_io_hdr)); #endif if (len >= 0 || (len < 0 && errno != EAGAIN)) break; usleep (100000); count--; } ((fdparms *) fd_info[req->fd].pdata)->sg_queue_used--; } next_req = req->next; req->next = fdp->sane_free_list; fdp->sane_free_list = req; } fdp->sane_qhead = fdp->sane_qtail = 0; } void sanei_scsi_req_flush_all () { int fd, i, j = 0; /* sanei_scsi_open allows only one open file handle, so we can simply look for the first entry where in_use is set */ fd = num_alloced; for (i = 0; i < num_alloced; i++) if (fd_info[i].in_use) { j++; fd = i; } assert (j < 2); if (fd < num_alloced) sanei_scsi_req_flush_all_extended (fd); } SANE_Status sanei_scsi_req_enter2 (int fd, const void *cmd, size_t cmd_size, const void *src, size_t src_size, void *dst, size_t * dst_size, void **idp) { struct req *req; size_t size; fdparms *fdp; fdp = (fdparms *) fd_info[fd].pdata; if (fdp->sane_free_list) { req = fdp->sane_free_list; fdp->sane_free_list = req->next; req->next = 0; } else { #ifdef SG_IO if (sg_version < 30000) #endif size = (sizeof (*req) - sizeof (req->sgdata.cdb.data) + fdp->buffersize); #ifdef SG_IO else size = sizeof (*req) + MAX_CDB + fdp->buffersize - sizeof (req->sgdata.sg3.data); #endif req = malloc (size); if (!req) { DBG (1, "sanei_scsi_req_enter: failed to malloc %lu bytes\n", (u_long) size); return SANE_STATUS_NO_MEM; } } req->fd = fd; req->running = 0; req->done = 0; req->status = SANE_STATUS_GOOD; req->dst = dst; req->dst_len = dst_size; #ifdef SG_IO if (sg_version < 30000) { #endif memset (&req->sgdata.cdb.hdr, 0, sizeof (req->sgdata.cdb.hdr)); req->sgdata.cdb.hdr.pack_id = pack_id++; req->sgdata.cdb.hdr.pack_len = cmd_size + src_size + sizeof (req->sgdata.cdb.hdr); req->sgdata.cdb.hdr.reply_len = (dst_size ? *dst_size : 0) + sizeof (req->sgdata.cdb.hdr); memcpy (&req->sgdata.cdb.data, cmd, cmd_size); memcpy (&req->sgdata.cdb.data[cmd_size], src, src_size); if (CDB_SIZE (*(const u_char *) cmd) != cmd_size) { if (ioctl (fd, SG_NEXT_CMD_LEN, &cmd_size)) { DBG (1, "sanei_scsi_req_enter2: ioctl to set command length failed\n"); } } #ifdef SG_IO } else { memset (&req->sgdata.sg3.hdr, 0, sizeof (req->sgdata.sg3.hdr)); req->sgdata.sg3.hdr.interface_id = 'S'; req->sgdata.sg3.hdr.cmd_len = cmd_size; req->sgdata.sg3.hdr.iovec_count = 0; req->sgdata.sg3.hdr.mx_sb_len = SENSE_MAX; /* read or write? */ if (dst_size && *dst_size) { req->sgdata.sg3.hdr.dxfer_direction = SG_DXFER_FROM_DEV; req->sgdata.sg3.hdr.dxfer_len = *dst_size; req->sgdata.sg3.hdr.dxferp = dst; } else if (src_size) { req->sgdata.sg3.hdr.dxfer_direction = SG_DXFER_TO_DEV; if (src_size > fdp->buffersize) { DBG (1, "sanei_scsi_req_enter2 warning: truncating write data " "from requested %li bytes to allowed %li bytes\n", (long)src_size, (long)fdp->buffersize); src_size = fdp->buffersize; } req->sgdata.sg3.hdr.dxfer_len = src_size; memcpy (&req->sgdata.sg3.data[MAX_CDB], src, src_size); req->sgdata.sg3.hdr.dxferp = &req->sgdata.sg3.data[MAX_CDB]; } else { req->sgdata.sg3.hdr.dxfer_direction = SG_DXFER_NONE; } if (cmd_size > MAX_CDB) { DBG (1, "sanei_scsi_req_enter2 warning: truncating write data " "from requested %li bytes to allowed %i bytes\n", (long)cmd_size, MAX_CDB); cmd_size = MAX_CDB; } memcpy (req->sgdata.sg3.data, cmd, cmd_size); req->sgdata.sg3.hdr.cmdp = req->sgdata.sg3.data; req->sgdata.sg3.hdr.sbp = &(req->sgdata.sg3.sense_buffer[0]); req->sgdata.sg3.hdr.timeout = 1000 * sane_scsicmd_timeout; #ifdef ENABLE_SCSI_DIRECTIO /* for the adventurous: If direct IO is used, the kernel locks the buffer. This can lead to conflicts, if a backend uses shared memory. OTOH, direct IO may be faster, and it reduces memory usage */ req->sgdata.sg3.hdr.flags = SG_FLAG_DIRECT_IO; #else req->sgdata.sg3.hdr.flags = 0; #endif req->sgdata.sg3.hdr.pack_id = pack_id++; req->sgdata.sg3.hdr.usr_ptr = 0; } #endif req->next = 0; ATOMIC (if (fdp->sane_qtail) { fdp->sane_qtail->next = req; fdp->sane_qtail = req;} else fdp->sane_qhead = fdp->sane_qtail = req); DBG (4, "scsi_req_enter: entered %p\n", (void *) req); *idp = req; issue (req); DBG (10, "scsi_req_enter: queue_used: %i, queue_max: %i\n", ((fdparms *) fd_info[fd].pdata)->sg_queue_used, ((fdparms *) fd_info[fd].pdata)->sg_queue_max); return SANE_STATUS_GOOD; } SANE_Status sanei_scsi_req_wait (void *id) { SANE_Status status = SANE_STATUS_GOOD; struct req *req = id; ssize_t nread = 0; /* we don't support out-of-order completion */ assert (req == ((fdparms *) fd_info[req->fd].pdata)->sane_qhead); DBG (4, "sanei_scsi_req_wait: waiting for %p\n", (void *) req); issue (req); /* ensure the command is running */ if (req->done) { issue (req->next); /* issue next command, if any */ status = req->status; } else { #ifdef SG_IO if (sg_version < 30000) { #endif fd_set readable; /* wait for command completion: */ FD_ZERO (&readable); FD_SET (req->fd, &readable); select (req->fd + 1, &readable, 0, 0, 0); /* now atomically read result and set DONE: */ ATOMIC (nread = read (req->fd, &req->sgdata.cdb, req->sgdata.cdb.hdr.reply_len); req->done = 1); #ifdef SG_IO } else { IF_DBG (if (DBG_LEVEL >= 255) system ("cat /proc/scsi/sg/debug 1>&2");) /* set DONE: */ nread = 0; /* unused in this code path */ req->done = 1; } #endif if (fd_info[req->fd].pdata) ((fdparms *) fd_info[req->fd].pdata)->sg_queue_used--; /* Now issue next command asap, if any. We can't do this earlier since the Linux kernel has space for just one big buffer. */ issue (req->next); DBG (4, "sanei_scsi_req_wait: read %ld bytes\n", (long) nread); if (nread < 0) { DBG (1, "sanei_scsi_req_wait: read returned %ld (errno=%d)\n", (long) nread, errno); status = SANE_STATUS_IO_ERROR; } else { #ifdef SG_IO if (sg_version < 30000) { #endif nread -= sizeof (req->sgdata.cdb.hdr); /* check for errors, but let the sense_handler decide.... */ if ((req->sgdata.cdb.hdr.result != 0) || (((req->sgdata.cdb.hdr.sense_buffer[0] & 0x7f) != 0) #ifdef HAVE_SG_TARGET_STATUS /* this is messy... Sometimes it happens that we have a valid looking sense buffer, but the DRIVER_SENSE bit is not set. Moreover, we can check this only for not tooo old SG drivers */ && (req->sgdata.cdb.hdr.driver_status & DRIVER_SENSE) #endif )) { SANEI_SCSI_Sense_Handler handler = fd_info[req->fd].sense_handler; void *arg = fd_info[req->fd].sense_handler_arg; DBG (1, "sanei_scsi_req_wait: SCSI command complained: %s\n", strerror (req->sgdata.cdb.hdr.result)); DBG (10, "sense buffer: %02x %02x %02x %02x %02x %02x %02x %02x" " %02x %02x %02x %02x %02x %02x %02x %02x\n", req->sgdata.cdb.hdr.sense_buffer[0], req->sgdata.cdb.hdr.sense_buffer[1], req->sgdata.cdb.hdr.sense_buffer[2], req->sgdata.cdb.hdr.sense_buffer[3], req->sgdata.cdb.hdr.sense_buffer[4], req->sgdata.cdb.hdr.sense_buffer[5], req->sgdata.cdb.hdr.sense_buffer[6], req->sgdata.cdb.hdr.sense_buffer[7], req->sgdata.cdb.hdr.sense_buffer[8], req->sgdata.cdb.hdr.sense_buffer[9], req->sgdata.cdb.hdr.sense_buffer[10], req->sgdata.cdb.hdr.sense_buffer[11], req->sgdata.cdb.hdr.sense_buffer[12], req->sgdata.cdb.hdr.sense_buffer[13], req->sgdata.cdb.hdr.sense_buffer[14], req->sgdata.cdb.hdr.sense_buffer[15]); #ifdef HAVE_SG_TARGET_STATUS /* really old SG header do not define target_status, host_status and driver_status */ DBG (10, "target status: %02x host status: %02x" " driver status: %02x\n", req->sgdata.cdb.hdr.target_status, req->sgdata.cdb.hdr.host_status, req->sgdata.cdb.hdr.driver_status); if (req->sgdata.cdb.hdr.host_status == DID_NO_CONNECT || req->sgdata.cdb.hdr.host_status == DID_BUS_BUSY || req->sgdata.cdb.hdr.host_status == DID_TIME_OUT || req->sgdata.cdb.hdr.driver_status == DRIVER_BUSY || req->sgdata.cdb.hdr.target_status == 0x04) /* BUSY */ #else if (req->sgdata.cdb.hdr.result == EBUSY) #endif status = SANE_STATUS_DEVICE_BUSY; else if (handler) /* sense handler should return SANE_STATUS_GOOD if it decided all was ok afterall */ status = (*handler) (req->fd, req->sgdata.cdb.hdr.sense_buffer, arg); else status = SANE_STATUS_IO_ERROR; } /* if we are ok so far, copy over the return data */ if (status == SANE_STATUS_GOOD) { if (req->dst) memcpy (req->dst, req->sgdata.cdb.data, nread); if (req->dst_len) *req->dst_len = nread; } #ifdef SG_IO } else { /* check for errors, but let the sense_handler decide.... */ if (((req->sgdata.sg3.hdr.info & SG_INFO_CHECK) != 0) || ((req->sgdata.sg3.hdr.sb_len_wr > 0) && ((req->sgdata.sg3.sense_buffer[0] & 0x7f) != 0) && (req->sgdata.sg3.hdr. driver_status & DRIVER_SENSE))) { SANEI_SCSI_Sense_Handler handler = fd_info[req->fd].sense_handler; void *arg = fd_info[req->fd].sense_handler_arg; DBG (1, "sanei_scsi_req_wait: SCSI command complained: %s\n", strerror (errno)); DBG (10, "sense buffer: %02x %02x %02x %02x %02x %02x %02x %02x" " %02x %02x %02x %02x %02x %02x %02x %02x\n", req->sgdata.sg3.sense_buffer[0], req->sgdata.sg3.sense_buffer[1], req->sgdata.sg3.sense_buffer[2], req->sgdata.sg3.sense_buffer[3], req->sgdata.sg3.sense_buffer[4], req->sgdata.sg3.sense_buffer[5], req->sgdata.sg3.sense_buffer[6], req->sgdata.sg3.sense_buffer[7], req->sgdata.sg3.sense_buffer[8], req->sgdata.sg3.sense_buffer[9], req->sgdata.sg3.sense_buffer[10], req->sgdata.sg3.sense_buffer[11], req->sgdata.sg3.sense_buffer[12], req->sgdata.sg3.sense_buffer[13], req->sgdata.sg3.sense_buffer[14], req->sgdata.sg3.sense_buffer[15]); DBG (10, "target status: %02x host status: %04x" " driver status: %04x\n", req->sgdata.sg3.hdr.status, req->sgdata.sg3.hdr.host_status, req->sgdata.sg3.hdr.driver_status); /* the first three tests below are an replacement of the error "classification" as it was with the old SG driver, the fourth test is new. */ if (req->sgdata.sg3.hdr.host_status == SG_ERR_DID_NO_CONNECT || req->sgdata.sg3.hdr.host_status == SG_ERR_DID_BUS_BUSY || req->sgdata.sg3.hdr.host_status == SG_ERR_DID_TIME_OUT || req->sgdata.sg3.hdr.driver_status == DRIVER_BUSY || req->sgdata.sg3.hdr.masked_status == 0x04) /* BUSY */ status = SANE_STATUS_DEVICE_BUSY; else if (handler && req->sgdata.sg3.hdr.sb_len_wr) /* sense handler should return SANE_STATUS_GOOD if it decided all was ok afterall */ status = (*handler) (req->fd, req->sgdata.sg3.sense_buffer, arg); /* status bits INTERMEDIATE and CONDITION MET should not result in an error; neither should reserved bits */ else if (((req->sgdata.sg3.hdr.status & 0x2a) == 0) && (req->sgdata.sg3.hdr.host_status == SG_ERR_DID_OK) && ((req->sgdata.sg3.hdr. driver_status & ~SG_ERR_DRIVER_SENSE) == SG_ERR_DRIVER_OK)) status = SANE_STATUS_GOOD; else status = SANE_STATUS_IO_ERROR; } #if 0 /* Sometimes the Linux SCSI system reports bogus resid values. Observed with lk 2.4.5, 2.4.13, aic7xxx and sym53c8xx drivers, if command queueing is used. So we better issue only a warning */ if (status == SANE_STATUS_GOOD) { if (req->dst_len) { *req->dst_len -= req->sgdata.sg3.hdr.resid; } } #endif if (req->sgdata.sg3.hdr.resid) { DBG (1, "sanei_scsi_req_wait: SG driver returned resid %i\n", req->sgdata.sg3.hdr.resid); DBG (1, " NOTE: This value may be bogus\n"); } } #endif } } /* dequeue and release processed request: */ ATOMIC (((fdparms *) fd_info[req->fd].pdata)->sane_qhead = ((fdparms *) fd_info[req->fd].pdata)->sane_qhead->next; if (!((fdparms *) fd_info[req->fd].pdata)->sane_qhead) ((fdparms *) fd_info[req->fd].pdata)->sane_qtail = 0; req->next = ((fdparms *) fd_info[req->fd].pdata)->sane_free_list; ((fdparms *) fd_info[req->fd].pdata)->sane_free_list = req); return status; } SANE_Status sanei_scsi_cmd2 (int fd, const void *cmd, size_t cmd_size, const void *src, size_t src_size, void *dst, size_t * dst_size) { SANE_Status status; void *id; status = sanei_scsi_req_enter2 (fd, cmd, cmd_size, src, src_size, dst, dst_size, &id); if (status != SANE_STATUS_GOOD) return status; return sanei_scsi_req_wait (id); } /* The following code (up to and including sanei_scsi_find_devices() ) is trying to match device/manufacturer names and/or SCSI addressing numbers (i.e. ) with a sg device file name (e.g. /dev/sg3). */ #define PROCFILE "/proc/scsi/scsi" #define DEVFS_MSK "/dev/scsi/host%d/bus%d/target%d/lun%d/generic" #define SCAN_MISSES 5 /* Some headers don't have the following define */ #ifndef SCSI_IOCTL_GET_IDLUN #define SCSI_IOCTL_GET_IDLUN 0x5382 #endif static int lx_sg_dev_base = -1; static int lx_devfs = -1; static const struct lx_device_name_list_tag { const char *prefix; char base; } lx_dnl[] = { { "/dev/sg", 0} , { "/dev/sg", 'a'} , { "/dev/uk", 0} , { "/dev/gsc", 0} }; static int /* Returns open sg file descriptor, or -1 for no access, or -2 for not found (or other error) */ lx_mk_devicename (int guess_devnum, char *name, size_t name_len) { int dev_fd, k, dnl_len; const struct lx_device_name_list_tag *dnp; dnl_len = NELEMS (lx_dnl); k = ((-1 == lx_sg_dev_base) ? 0 : lx_sg_dev_base); for (; k < dnl_len; ++k) { dnp = &lx_dnl[k]; if (dnp->base) snprintf (name, name_len, "%s%c", dnp->prefix, dnp->base + guess_devnum); else snprintf (name, name_len, "%s%d", dnp->prefix, guess_devnum); dev_fd = -1; #ifdef HAVE_RESMGR dev_fd = rsm_open_device (name, O_RDWR | O_NONBLOCK); #endif if (dev_fd == -1) dev_fd = open (name, O_RDWR | O_NONBLOCK); if (dev_fd >= 0) { lx_sg_dev_base = k; return dev_fd; } else if ((EACCES == errno) || (EBUSY == errno)) { lx_sg_dev_base = k; return -1; } if (-1 != lx_sg_dev_base) return -2; } return -2; } static int /* Returns 1 for match, else 0 */ lx_chk_id (int dev_fd, int host, int channel, int id, int lun) { #ifdef SG_GET_SCSI_ID_FOUND struct sg_scsi_id ssid; if ((ioctl (dev_fd, SG_GET_SCSI_ID, &ssid) >= 0)) { DBG (2, "lx_chk_id: %d,%d %d,%d %d,%d %d,%d\n", host, ssid.host_no, channel, ssid.channel, id, ssid.scsi_id, lun, ssid.lun); if ((host == ssid.host_no) && (channel == ssid.channel) && (id == ssid.scsi_id) && (lun == ssid.lun)) return 1; else return 0; } #endif { struct my_scsi_idlun { int dev_id; int host_unique_id; } my_idlun; if (ioctl (dev_fd, SCSI_IOCTL_GET_IDLUN, &my_idlun) >= 0) { if (((my_idlun.dev_id & 0xff) == id) && (((my_idlun.dev_id >> 8) & 0xff) == lun) && (((my_idlun.dev_id >> 16) & 0xff) == channel)) return 1; /* cheating, assume 'host' number matches */ } } return 0; } static int /* Returns 1 if match with 'name' set, else 0 */ lx_scan_sg (int exclude_devnum, char *name, size_t name_len, int host, int channel, int id, int lun) { int dev_fd, k, missed; if (-1 == lx_sg_dev_base) return 0; for (k = 0, missed = 0; (missed < SCAN_MISSES) && (k < 255); ++k, ++missed) { DBG (2, "lx_scan_sg: k=%d, exclude=%d, missed=%d\n", k, exclude_devnum, missed); if (k == exclude_devnum) { missed = 0; continue; /* assumed this one has been checked already */ } if ((dev_fd = lx_mk_devicename (k, name, name_len)) >= 0) { missed = 0; if (lx_chk_id (dev_fd, host, channel, id, lun)) { close (dev_fd); return 1; } close (dev_fd); } else if (-1 == dev_fd) missed = 0; /* no permissions but something found */ } return 0; } static int /* Returns 1 if match, else 0 */ lx_chk_devicename (int guess_devnum, char *name, size_t name_len, int host, int channel, int id, int lun) { int dev_fd; if (host < 0) return 0; if (0 != lx_devfs) { /* simple mapping if we have devfs */ if (-1 == lx_devfs) { if ((dev_fd = lx_mk_devicename (guess_devnum, name, name_len)) >= 0) close (dev_fd); /* hack to load sg driver module */ } snprintf (name, name_len, DEVFS_MSK, host, channel, id, lun); dev_fd = open (name, O_RDWR | O_NONBLOCK); if (dev_fd >= 0) { close (dev_fd); lx_devfs = 1; DBG (1, "lx_chk_devicename: matched device(devfs): %s\n", name); return 1; } else if (ENOENT == errno) lx_devfs = 0; } if ((dev_fd = lx_mk_devicename (guess_devnum, name, name_len)) < -1) { /* no candidate sg device file name found, try /dev/sg0,1 */ if ((dev_fd = lx_mk_devicename (0, name, name_len)) < -1) { if ((dev_fd = lx_mk_devicename (1, name, name_len)) < -1) return 0; /* no luck finding sg fd to open */ } } if (dev_fd >= 0) { /* now check this fd for match on */ if (lx_chk_id (dev_fd, host, channel, id, lun)) { close (dev_fd); DBG (1, "lx_chk_devicename: matched device(direct): %s\n", name); return 1; } close (dev_fd); } /* if mismatch then call scan algorithm */ if (lx_scan_sg (guess_devnum, name, name_len, host, channel, id, lun)) { DBG (1, "lx_chk_devicename: matched device(scan): %s\n", name); return 1; } return 0; } /* Legacy /proc/scsi/scsi */ static void /* calls 'attach' function pointer with sg device file name iff match */ sanei_proc_scsi_find_devices (const char *findvendor, const char *findmodel, const char *findtype, int findbus, int findchannel, int findid, int findlun, SANE_Status (*attach) (const char *dev)) { #define FOUND_VENDOR 1 #define FOUND_MODEL 2 #define FOUND_TYPE 4 #define FOUND_REV 8 #define FOUND_HOST 16 #define FOUND_CHANNEL 32 #define FOUND_ID 64 #define FOUND_LUN 128 #define FOUND_ALL 255 char *me = "sanei_proc_scsi_find_devices"; size_t findvendor_len = 0, findmodel_len = 0, findtype_len = 0; char vendor[32], model[32], type[32], revision[32]; int bus, channel, id, lun; int number, i, j, definedd; char line[256], dev_name[128], *c1, *c2, ctmp; const char *string; FILE *proc_fp; char *end; struct { const char *name; size_t name_len; int is_int; /* integer valued? (not a string) */ union { void *v; /* avoids compiler warnings... */ char *str; int *i; } u; } param[] = { { "Vendor:", 7, 0, { 0} } , { "Model:", 6, 0, { 0} } , { "Type:", 5, 0, { 0} } , { "Rev:", 4, 0, { 0} } , { "scsi", 4, 1, { 0} } , { "Channel:", 8, 1, { 0} } , { "Id:", 3, 1, { 0} } , { "Lun:", 4, 1, { 0} } }; param[0].u.str = vendor; param[1].u.str = model; param[2].u.str = type; param[3].u.str = revision; param[4].u.i = &bus; param[5].u.i = &channel; param[6].u.i = &id; param[7].u.i = &lun; DBG_INIT (); proc_fp = fopen (PROCFILE, "r"); if (!proc_fp) { DBG (1, "%s: could not open %s for reading\n", me, PROCFILE); return; } number = bus = channel = id = lun = -1; vendor[0] = model[0] = type[0] = '\0'; if (findvendor) findvendor_len = strlen (findvendor); if (findmodel) findmodel_len = strlen (findmodel); if (findtype) findtype_len = strlen (findtype); definedd = 0; while (!feof (proc_fp)) { fgets (line, sizeof (line), proc_fp); string = sanei_config_skip_whitespace (line); while (*string) { for (i = 0; i < NELEMS (param); ++i) { if (strncmp (string, param[i].name, param[i].name_len) == 0) { string += param[i].name_len; /* Make sure that we don't read the next parameter name as a value, if the real value consists only of spaces */ c2 = string + strlen (string); for (j = 0; j < NELEMS (param); ++j) { c1 = strstr (string, param[j].name); if ((j != i) && c1 && (c1 < c2)) c2 = c1; } ctmp = *c2; *c2 = 0; string = sanei_config_skip_whitespace (string); if (param[i].is_int) { if (*string) { *param[i].u.i = strtol (string, &end, 10); string = (char *) end; } else *param[i].u.i = 0; } else { strncpy (param[i].u.str, string, 32); param[i].u.str[31] = '\0'; /* while (*string && !isspace (*string)) ++string; */ } /* string = sanei_config_skip_whitespace (string); */ *c2 = ctmp; string = c2; definedd |= 1 << i; if (param[i].u.v == &bus) { ++number; definedd = FOUND_HOST; } break; } } if (i >= NELEMS (param)) ++string; /* no match */ } if (FOUND_ALL != definedd) /* some info is still missing */ continue; definedd = 0; if ((!findvendor || strncmp (vendor, findvendor, findvendor_len) == 0) && (!findmodel || strncmp (model, findmodel, findmodel_len) == 0) && (!findtype || strncmp (type, findtype, findtype_len) == 0) && (findbus == -1 || bus == findbus) && (findchannel == -1 || channel == findchannel) && (findid == -1 || id == findid) && (findlun == -1 || lun == findlun)) { DBG (2, "%s: found: vendor=%s model=%s type=%s\n\t" "bus=%d chan=%d id=%d lun=%d num=%d\n", me, findvendor, findmodel, findtype, bus, channel, id, lun, number); if (lx_chk_devicename (number, dev_name, sizeof (dev_name), bus, channel, id, lun) && ((*attach) (dev_name) != SANE_STATUS_GOOD)) { DBG(1,"sanei_scsi_find_devices: bad attach\n"); } } else { DBG (2, "%s: no match\n", me); } vendor[0] = model[0] = type[0] = 0; bus = channel = id = lun = -1; } fclose (proc_fp); } #define SYSFS_SCSI_DEVICES "/sys/bus/scsi/devices" /* From linux/drivers/scsi/scsi.c */ static char *lnxscsi_device_types[] = { "Direct-Access ", "Sequential-Access", "Printer ", "Processor ", "WORM ", "CD-ROM ", "Scanner ", "Optical Device ", "Medium Changer ", "Communications ", "ASC IT8 ", "ASC IT8 ", "RAID ", "Enclosure ", "Direct-Access-RBC", "Optical card ", "Bridge controller", "Object storage ", "Automation/Drive " }; void /* calls 'attach' function pointer with sg device file name iff match */ sanei_scsi_find_devices (const char *findvendor, const char *findmodel, const char *findtype, int findbus, int findchannel, int findid, int findlun, SANE_Status (*attach) (const char *dev)) { char *me = "sanei_scsi_find_devices"; char path[PATH_MAX]; char dev_name[128]; struct dirent buf; struct dirent *de; DIR *scsidevs; FILE *fp; char *ptr; char *end; int bcil[4]; /* bus, channel, id, lun */ char vmt[3][33]; /* vendor, model, type */ int vmt_len[3]; char *vmtfiles[3] = { "vendor", "model", "type" }; int lastbus; int number; int i; long val; int ret; DBG_INIT (); DBG (2, "%s: looking for: v=%s m=%s t=%s b=%d c=%d i=%d l=%d\n", me, findvendor, findmodel, findtype, findbus, findchannel, findid, findlun); scsidevs = opendir (SYSFS_SCSI_DEVICES); if (!scsidevs) { DBG (1, "%s: could not open %s; falling back to /proc\n", me, SYSFS_SCSI_DEVICES); sanei_proc_scsi_find_devices (findvendor, findmodel, findtype, findbus, findchannel, findid, findlun, attach); return; } vmt_len[0] = (findvendor) ? strlen(findvendor) : 0; vmt_len[1] = (findmodel) ? strlen(findmodel) : 0; vmt_len[2] = (findtype) ? strlen(findtype) : 0; lastbus = -1; number = -1; for (;;) { ret = readdir_r(scsidevs, &buf, &de); if (ret != 0) { DBG (1, "%s: could not read directory %s: %s\n", me, SYSFS_SCSI_DEVICES, strerror(errno)); break; } if (de == NULL) break; if (buf.d_name[0] == '.') continue; /* Extract bus, channel, id, lun from directory name b:c:i:l */ ptr = buf.d_name; for (i = 0; i < 4; i++) { errno = 0; val = strtol (ptr, &end, 10); if (((errno == ERANGE) && ((val == LONG_MAX) || (val == LONG_MIN))) || ((errno != 0) && (val == 0))) { DBG (1, "%s: invalid integer in string (%s): %s\n", me, ptr, strerror(errno)); i = 12; /* Skip */ break; } if (end == ptr) { DBG (1, "%s: no integer found in string: %s (%d)\n", me, ptr, i); i = 12; /* Skip */ break; } if (*end && (*end != ':')) { DBG (1, "%s: parse error on string %s (%d)\n", me, buf.d_name, i); i = 12; /* Skip */ break; } if (val > INT_MAX) { DBG (1, "%s: integer value too large (%s)\n", me, buf.d_name); i = 12; /* Skip */ break; } bcil[i] = (int) val; ptr = end + 1; } /* Skip this one */ if (i == 12) continue; if (bcil[0] != lastbus) { lastbus = bcil[0]; number++; } for (i = 0; i < 3; i++) { ret = snprintf (path, PATH_MAX, "%s/%s/%s", SYSFS_SCSI_DEVICES, buf.d_name, vmtfiles[i]); if ((ret < 0) || (ret >= PATH_MAX)) { DBG (1, "%s: skipping %s/%s, PATH_MAX exceeded on %s\n", me, SYSFS_SCSI_DEVICES, buf.d_name, vmtfiles[i]); i = 12; /* Skip */ break; } memset (vmt[i], 0, sizeof(vmt[i])); fp = fopen(path, "r"); if (!fp) { DBG (1, "%s: could not open %s: %s\n", me, path, strerror(errno)); i = 12; /* Skip */ break; } ret = fread (vmt[i], 1, sizeof(vmt[i]) - 1, fp); if (ret <= 0) { if (ferror(fp)) { DBG (1, "%s: error reading %s\n", me, path); i = 12; /* Skip */ break; } } if (vmt[i][ret - 1] == '\n') vmt[i][ret - 1] = '\0'; fclose (fp); } /* Skip this one */ if (i == 12) continue; /* Type is a numeric string and must be converted back to a well-known string */ errno = 0; val = strtol (vmt[2], &end, 10); if (((errno == ERANGE) && ((val == LONG_MAX) || (val == LONG_MIN))) || ((errno != 0) && (val == 0))) { DBG (1, "%s: invalid integer in type string (%s): %s\n", me, vmt[2], strerror(errno)); continue; } if (end == vmt[2]) { DBG (1, "%s: no integer found in type string: %s\n", me, vmt[2]); continue; } if ((val < 0) || (val >= (int)(sizeof(lnxscsi_device_types) / sizeof(lnxscsi_device_types[0])))) { DBG (1, "%s: invalid type %ld\n", me, val); continue; } strncpy(vmt[2], lnxscsi_device_types[val], sizeof(vmt[2]) - 1); if ((!findvendor || strncmp (vmt[0], findvendor, vmt_len[0]) == 0) && (!findmodel || strncmp (vmt[1], findmodel, vmt_len[1]) == 0) && (!findtype || strncmp (vmt[2], findtype, vmt_len[2]) == 0) && (findbus == -1 || bcil[0] == findbus) && (findchannel == -1 || bcil[1] == findchannel) && (findid == -1 || bcil[2] == findid) && (findlun == -1 || bcil[3] == findlun)) { DBG (2, "%s: found: vendor=%s model=%s type=%s\n\t" "bus=%d chan=%d id=%d lun=%d num=%d\n", me, vmt[0], vmt[1], vmt[2], bcil[0], bcil[1], bcil[2], bcil[3], number); if (lx_chk_devicename (number, dev_name, sizeof (dev_name), bcil[0], bcil[1], bcil[2], bcil[3]) && ((*attach) (dev_name) != SANE_STATUS_GOOD)) { DBG (1, "%s: bad attach\n", me); } } else { DBG (2, "%s: no match\n", me); } } closedir(scsidevs); } #endif /* USE == LINUX_INTERFACE */ #if USE == BSD_INTERFACE #ifndef HAVE_SCSIREQ_ENTER static int scsireq_enter (int fd, scsireq_t * hdr) { return ioctl (fd, SCIOCCOMMAND, hdr); } #endif /* !HAVE_SCSIREQ_ENTER */ SANE_Status sanei_scsi_cmd2 (int fd, const void *cmd, size_t cmd_size, const void *src, size_t src_size, void *dst, size_t * dst_size) { /* xxx obsolete: size_t cdb_size; */ scsireq_t hdr; int result; /* xxx obsolete: cdb_size = CDB_SIZE (*(u_char *) src); */ memset (&hdr, 0, sizeof (hdr)); memcpy (hdr.cmd, cmd, cmd_size); if (dst_size && *dst_size) { /* xxx obsolete: assert (cdb_size == src_size); */ hdr.flags = SCCMD_READ; hdr.databuf = dst; hdr.datalen = *dst_size; } else { /* xxx obsolete: assert (cdb_size <= src_size); */ hdr.flags = SCCMD_WRITE; /* The old variant: hdr.databuf = (char *) src + cdb_size; hdr.datalen = src_size; xxxxxx huh? ShouldnŽt the above line have been src_size - cdb_size) */ hdr.databuf = (char *) src; hdr.datalen = src_size; } hdr.timeout = sane_scsicmd_timeout * 1000; hdr.cmdlen = cmd_size; hdr.senselen = sizeof (hdr.sense); result = scsireq_enter (fd, &hdr); if (result < 0) { DBG (1, "sanei_scsi_cmd: scsi_reqenter() failed: %s\n", strerror (errno)); return SANE_STATUS_IO_ERROR; } if (hdr.retsts != SCCMD_OK) { SANEI_SCSI_Sense_Handler handler; DBG (1, "sanei_scsi_cmd: scsi returned with status %d\n", hdr.retsts); switch (hdr.retsts) { case SCCMD_TIMEOUT: case SCCMD_BUSY: return SANE_STATUS_DEVICE_BUSY; case SCCMD_SENSE: handler = fd_info[fd].sense_handler; if (handler) return (*handler) (fd, &hdr.sense[0], fd_info[fd].sense_handler_arg); /* fall through */ default: return SANE_STATUS_IO_ERROR; } } if (dst_size) *dst_size = hdr.datalen_used; return SANE_STATUS_GOOD; } #endif /* USE == BSD_INTERFACE */ #if USE == FREEBSD_CAM_INTERFACE SANE_Status sanei_scsi_cmd2 (int fd, const void *cmd, size_t cmd_size, const void *src, size_t src_size, void *dst, size_t * dst_size) { struct cam_device *dev; union ccb *ccb; int rv; u_int32_t ccb_flags; char *data_buf; size_t data_len; SANE_Status status; if (fd < 0 || fd > CAM_MAXDEVS || cam_devices[fd] == NULL) { fprintf (stderr, "attempt to reference invalid unit %d\n", fd); return SANE_STATUS_INVAL; } dev = cam_devices[fd]; ccb = cam_getccb (dev); /* Build the CCB */ bzero (&(&ccb->ccb_h)[1], sizeof (struct ccb_scsiio)); bcopy (cmd, &ccb->csio.cdb_io.cdb_bytes, cmd_size); /* * Set the data direction flags. */ if (dst_size && *dst_size) { /* xxx obsolete: assert (cdb_size == src_size); */ ccb_flags = CAM_DIR_IN; data_buf = ((char *) (dst)); data_len = *dst_size; } else if (src_size > 0) { ccb_flags = CAM_DIR_OUT; data_buf = ((char *) (src)); data_len = src_size; } else { ccb_flags = CAM_DIR_NONE; data_buf = NULL; data_len = 0; } cam_fill_csio (&ccb->csio, /* retries */ 1, /* cbfncp */ NULL, /* flags */ ccb_flags, /* tag_action */ MSG_SIMPLE_Q_TAG, /* data_ptr */ (u_int8_t *) data_buf, /* dxfer_len */ data_len, /* sense_len */ SSD_FULL_SIZE, /* cdb_len */ cmd_size, /* timeout */ sane_scsicmd_timeout * 1000); /* Run the command */ errno = 0; if ((rv = cam_send_ccb (dev, ccb)) == -1) { cam_freeccb (ccb); return (SANE_STATUS_IO_ERROR); } if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { SANEI_SCSI_Sense_Handler handler; DBG (1, "sanei_scsi_cmd: scsi returned with status %d\n", (ccb->ccb_h.status & CAM_STATUS_MASK)); switch (ccb->ccb_h.status & CAM_STATUS_MASK) { case CAM_BUSY: case CAM_SEL_TIMEOUT: case CAM_SCSI_BUSY: status = SANE_STATUS_DEVICE_BUSY; break; default: status = SANE_STATUS_IO_ERROR; } handler = fd_info[fd].sense_handler; if (handler && (ccb->ccb_h.status & CAM_AUTOSNS_VALID)) { SANE_Status st = (*handler) (fd, ((u_char *) (&ccb->csio.sense_data)), fd_info[fd].sense_handler_arg); cam_freeccb (ccb); return st; } else { cam_freeccb (ccb); return status; } } cam_freeccb (ccb); return SANE_STATUS_GOOD; } #define WE_HAVE_FIND_DEVICES int cam_compare_inquiry (int fd, path_id_t path_id, target_id_t target_id, lun_id_t target_lun, const char *vendor, const char *product, const char *type) { struct ccb_dev_match cdm; struct device_match_pattern *pattern; struct scsi_inquiry_data *inq; int retval = 0; /* build ccb for device match */ bzero (&cdm, sizeof (cdm)); cdm.ccb_h.func_code = XPT_DEV_MATCH; /* result buffer */ cdm.match_buf_len = sizeof (struct dev_match_result); cdm.matches = (struct dev_match_result *) malloc (cdm.match_buf_len); cdm.num_matches = 0; /* pattern buffer */ cdm.num_patterns = 1; cdm.pattern_buf_len = sizeof (struct dev_match_pattern); cdm.patterns = (struct dev_match_pattern *) malloc (cdm.pattern_buf_len); /* assemble conditions */ cdm.patterns[0].type = DEV_MATCH_DEVICE; pattern = &cdm.patterns[0].pattern.device_pattern; pattern->flags = DEV_MATCH_PATH | DEV_MATCH_TARGET | DEV_MATCH_LUN; pattern->path_id = path_id; pattern->target_id = target_id; pattern->target_lun = target_lun; if (ioctl (fd, CAMIOCOMMAND, &cdm) == -1) { DBG (1, "error sending CAMIOCOMMAND ioctl"); retval = -1; goto ret; } if ((cdm.ccb_h.status != CAM_REQ_CMP) || ((cdm.status != CAM_DEV_MATCH_LAST) && (cdm.status != CAM_DEV_MATCH_MORE))) { DBG (1, "got CAM error %#x, CDM error %d\n", cdm.ccb_h.status, cdm.status); retval = -1; goto ret; } if (cdm.num_matches == 0) { DBG (1, "not found\n"); retval = -1; goto ret; } if (cdm.matches[0].type != DEV_MATCH_DEVICE) { DBG (1, "no device match\n"); retval = -1; goto ret; } inq = &cdm.matches[0].result.device_result.inq_data; if ((vendor && cam_strmatch (inq->vendor, vendor, SID_VENDOR_SIZE)) || (product && cam_strmatch (inq->product, product, SID_PRODUCT_SIZE))) retval = 1; ret: free (cdm.patterns); free (cdm.matches); return (retval); } void sanei_scsi_find_devices (const char *findvendor, const char *findmodel, const char *findtype, int findbus, int findchannel, int findid, int findlun, SANE_Status (*attach) (const char *dev)) { int fd; struct ccb_dev_match cdm; struct periph_match_pattern *pattern; struct periph_match_result *result; int i; char devname[16]; DBG_INIT (); if ((fd = open (XPT_DEVICE, O_RDWR)) == -1) { DBG (1, "could not open %s\n", XPT_DEVICE); return; } /* build ccb for device match */ bzero (&cdm, sizeof (cdm)); cdm.ccb_h.func_code = XPT_DEV_MATCH; /* result buffer */ cdm.match_buf_len = sizeof (struct dev_match_result) * 100; cdm.matches = (struct dev_match_result *) malloc (cdm.match_buf_len); cdm.num_matches = 0; /* pattern buffer */ cdm.num_patterns = 1; cdm.pattern_buf_len = sizeof (struct dev_match_pattern); cdm.patterns = (struct dev_match_pattern *) malloc (cdm.pattern_buf_len); /* assemble conditions ... findchannel is ignored */ cdm.patterns[0].type = DEV_MATCH_PERIPH; pattern = &cdm.patterns[0].pattern.periph_pattern; pattern->flags = PERIPH_MATCH_NAME; strcpy (pattern->periph_name, "pass"); if (findbus != -1) { pattern->path_id = findbus; pattern->flags |= PERIPH_MATCH_PATH; } if (findid != -1) { pattern->target_id = findid; pattern->flags |= PERIPH_MATCH_TARGET; } if (findlun != -1) { pattern->target_lun = findlun; pattern->flags |= PERIPH_MATCH_LUN; } /* result loop */ do { if (ioctl (fd, CAMIOCOMMAND, &cdm) == -1) { DBG (1, "error sending CAMIOCOMMAND ioctl"); break; } if ((cdm.ccb_h.status != CAM_REQ_CMP) || ((cdm.status != CAM_DEV_MATCH_LAST) && (cdm.status != CAM_DEV_MATCH_MORE))) { DBG (1, "got CAM error %#x, CDM error %d\n", cdm.ccb_h.status, cdm.status); break; } for (i = 0; i < cdm.num_matches; i++) { if (cdm.matches[i].type != DEV_MATCH_PERIPH) continue; result = &cdm.matches[i].result.periph_result; DBG (4, "%s%d on scbus%d %d:%d\n", result->periph_name, result->unit_number, result->path_id, result->target_id, result->target_lun); if (cam_compare_inquiry (fd, result->path_id, result->target_id, result->target_lun, findvendor, findmodel, findtype) == 0) { sprintf (devname, "/dev/%s%d", result->periph_name, result->unit_number); (*attach) (devname); } } } while ((cdm.ccb_h.status == CAM_REQ_CMP) && (cdm.status == CAM_DEV_MATCH_MORE)); free (cdm.patterns); free (cdm.matches); close (fd); return; } #endif #if USE == HPUX_INTERFACE /* XXX untested code! */ SANE_Status sanei_scsi_cmd2 (int fd, const void *cmd, size_t cmd_size, const void *src, size_t src_size, void *dst, size_t * dst_size) { struct sctl_io hdr; /* xxx obsolete size_t cdb_size; cdb_size = CDB_SIZE (*(u_char *) src); */ memset (&hdr, 0, sizeof (hdr)); memcpy (hdr.cdb, cmd, cmd_size); if (dst_size && *dst_size) { /* xxx obsolete assert (cdb_size == src_size); */ hdr.flags = SCTL_READ; hdr.data = dst; hdr.data_length = *dst_size; } else { /* xxx obsolete assert (cdb_size <= src_size); */ hdr.data = (char *) src; hdr.data_length = src_size; } hdr.cdb_length = cmd_size; hdr.max_msecs = sane_scsicmd_timeout * 1000; if (ioctl (fd, SIOC_IO, &hdr) < 0) { DBG (1, "sanei_scsi_cmd: ioctl(SIOC_IO) failed: %s\n", strerror (errno)); return SANE_STATUS_IO_ERROR; } if (hdr.cdb_status) DBG (1, "sanei_scsi_cmd: SCSI completed with cdb_status=%d\n", hdr.cdb_status); if (dst_size) *dst_size = hdr.data_xfer; if (hdr.sense_xfer > 0 && (hdr.sense[0] & 0x80) && fd_info[fd].sense_handler) return (*fd_info[fd].sense_handler) (fd, hdr.sense, fd_info[fd].sense_handler_arg); return SANE_STATUS_GOOD; } #endif /* USE == HPUX_INTERFACE */ #if USE == OPENSTEP_INTERFACE SANE_Status sanei_scsi_cmd2 (int fd, const void *cmd, size_t cmd_size, const void *src, size_t src_size, void *dst, size_t * dst_size) { struct scsi_req hdr; /* xxx obsolete size_t cdb_size; cdb_size = CDB_SIZE (*(u_char *) src); */ memset (&hdr, 0, sizeof (hdr)); memcpy (&hdr.sr_cdb, cmd, cmd_size); hdr.sr_cdb_length = cmd_size; if (dst_size && *dst_size) { /* xxx obsolete assert (cdb_size == src_size); */ hdr.sr_dma_dir = SR_DMA_RD; hdr.sr_addr = dst; hdr.sr_dma_max = *dst_size; } else { /* xxx obsolete assert (cdb_size <= src_size); */ hdr.sr_dma_dir = SR_DMA_WR; hdr.sr_addr = (char *) src; hdr.sr_dma_max = src_size; } hdr.sr_ioto = sane_scsicmd_timeout; if (ioctl (fd, SGIOCREQ, &hdr) == -1) { DBG (1, "sanei_scsi_cmd: ioctl(SGIOCREQ) failed: %s\n", strerror (errno)); return SANE_STATUS_IO_ERROR; } if (hdr.sr_io_status != 1) DBG (1, "sanei_scsi_cmd: SGIOCREQ completed with sr_io_status=%d\n", hdr.sr_io_status); if (hdr.sr_io_status == SR_IOST_CHKSNV) { struct scsi_req sr; struct cdb_6 *cdbp = &sr.sr_cdb.cdb_c6; struct esense_reply sense_reply; int i; char *p; /* clear struct */ p = (char *) cdbp; for (i = 0; i < sizeof (union cdb); i++) *p++ = 0; memset (&sr, 0, sizeof (struct scsi_req)); cdbp->c6_opcode = C6OP_REQSENSE; cdbp->c6_lun = 0; /* where do I get the lun from? */ cdbp->c6_len = 0x20; cdbp->c6_ctrl = 0; sr.sr_dma_dir = SR_DMA_RD; sr.sr_addr = (char *) &sense_reply; sr.sr_dma_max = sizeof (struct esense_reply); sr.sr_ioto = sane_scsicmd_timeout; sr.sr_cdb_length = 6; ioctl (fd, SGIOCREQ, &sr); if (sense_reply.er_ibvalid) { sr.sr_esense = sense_reply; if (fd_info[fd].sense_handler) return (*fd_info[fd].sense_handler) (fd, (u_char *) & sr.sr_esense, fd_info[fd].sense_handler_arg); } /* sense reply is invalid */ return SANE_STATUS_INVAL; } if (hdr.sr_scsi_status == SR_IOST_CHKSV && fd_info[fd].sense_handler) return (*fd_info[fd].sense_handler) (fd, (u_char *) & hdr.sr_esense, fd_info[fd].sense_handler_arg); if (dst_size) *dst_size = hdr.sr_dma_xfr; return SANE_STATUS_GOOD; } #endif /* USE == OPENSTEP_INTERFACE */ #if USE == DECUNIX_INTERFACE SANE_Status sanei_scsi_cmd2 (int fd, const void *cmd, size_t cmd_size, const void *src, size_t src_size, void *dst, size_t * dst_size) { u_char sense[64]; UAGT_CAM_CCB hdr; CCB_SCSIIO ccb; /* xxx obsolete size_t cdb_size; cdb_size = CDB_SIZE (*(u_char *) src); */ memset (&ccb, 0, sizeof (ccb)); ccb.cam_ch.my_addr = (CCB_HEADER *) & ccb; ccb.cam_ch.cam_ccb_len = sizeof (ccb); ccb.cam_ch.cam_func_code = XPT_SCSI_IO; ccb.cam_ch.cam_path_id = fd_info[fd].bus; ccb.cam_ch.cam_target_id = fd_info[fd].target; ccb.cam_ch.cam_target_lun = fd_info[fd].lun; ccb.cam_ch.cam_flags = 0; if (dst_size && *dst_size) { /* xxx obsolete assert (cdb_size == src_size); */ ccb.cam_ch.cam_flags |= CAM_DIR_IN; ccb.cam_data_ptr = (u_char *) dst; ccb.cam_dxfer_len = *dst_size; } else { /* xxx obsolete assert (cdb_size <= src_size); */ if (0 == src_size) ccb.cam_ch.cam_flags |= CAM_DIR_NONE; else ccb.cam_ch.cam_flags |= CAM_DIR_OUT; ccb.cam_data_ptr = (u_char *) src; ccb.cam_dxfer_len = src_size; } ccb.cam_timeout = sane_scsicmd_timeout; ccb.cam_cdb_len = cmd_size; memcpy (&ccb.cam_cdb_io.cam_cdb_bytes[0], cmd, cmd_size); memset (&hdr, 0, sizeof (hdr)); hdr.uagt_ccb = (CCB_HEADER *) & ccb; hdr.uagt_ccblen = sizeof (ccb); hdr.uagt_buffer = ccb.cam_data_ptr; hdr.uagt_buflen = ccb.cam_dxfer_len; hdr.uagt_snsbuf = sense; hdr.uagt_snslen = sizeof (sense); hdr.uagt_cdb = 0; /* indicate that CDB is in CCB */ hdr.uagt_cdblen = 0; if (ioctl (cam_fd, UAGT_CAM_IO, &hdr) < 0) { DBG (1, "sanei_scsi_cmd: ioctl(UAGT_CAM_IO) failed: %s\n", strerror (errno)); return SANE_STATUS_IO_ERROR; } if (ccb.cam_ch.cam_status != CAM_REQ_CMP) { DBG (1, "sanei_scsi_cmd: UAGT_CAM_IO completed with cam_status=%d\n", ccb.cam_ch.cam_status); if (ccb.cam_ch.cam_status == CAM_AUTOSNS_VALID && fd_info[fd].sense_handler) return (*fd_info[fd].sense_handler) (fd, sense, fd_info[fd].sense_handler_arg); else return SANE_STATUS_INVAL; } if (dst_size) *dst_size = ccb.cam_dxfer_len; return SANE_STATUS_GOOD; } #endif /* USE == DECUNIX_INTERFACE */ #if USE == SCO_OS5_INTERFACE SANE_Status sanei_scsi_cmd2 (int fd, const void *cmd, size_t cmd_size, const void *src, size_t src_size, void *dst, size_t * dst_size) { static u_char sense_buffer[256]; struct scsicmd2 sc2; struct scsicmd *sc; /* xxx obsolete int cdb_size; */ int opcode; int i; if (fd < 0) return SANE_STATUS_IO_ERROR; memset (&sc2, 0, sizeof (sc2)); sc = &sc2.cmd; sc2.sense_len = sizeof (sense_buffer); sc2.sense_ptr = sense_buffer; /* xxx obsolete cdb_size = CDB_SIZE (*(u_char *) src); */ if (dst_size && *dst_size) { sc->is_write = 0; sc->data_ptr = dst; sc->data_len = *dst_size; } else { sc->data_len = src_size; sc->data_ptr = (char *) src; sc->is_write = 1; } memcpy (sc->cdb, cmd, cmd_size); sc->cdb_len = cmd_size; /* Send the command down via the "pass-through" interface */ if (ioctl (fd, SCSIUSERCMD2, &sc2) < 0) { DBG (1, "sanei_scsi_cmd: ioctl(SCSIUSERCMD2) failed: %s\n", strerror (errno)); return SANE_STATUS_IO_ERROR; } if (sc->host_sts || sc->target_sts) { DBG (1, "sanei_scsi_cmd: SCSIUSERCMD2 completed with " "host_sts=%x, target_sts=%x\n", sc->host_sts, sc->target_sts); if (fd_info[fd].sense_handler) return (*fd_info[fd].sense_handler) (fd, sense_buffer, fd_info[fd].sense_handler_arg); return SANE_STATUS_IO_ERROR; } return SANE_STATUS_GOOD; } #endif /* USE == SCO_OS5_INTERFACE */ #if USE == SYSVR4_INTERFACE /* * UNIXWARE 2.x interface * (c) R=I+S Rapp Informatik System Germany * Email: wolfgang@rapp-informatik.de * * The driver version should run with other scsi componets like disk * attached to the same controller at the same time. * * Attention : This port needs a sane kernel driver for Unixware 2.x * The driver is available in binary pkgadd format * Plese mail me. * */ SANE_Status sanei_scsi_cmd2 (int fd, const void *cmd, size_t cmd_size, const void *src, size_t src_size, void *dst, size_t * dst_size) { struct sb sb, *sb_ptr; /* Command block and pointer */ struct scs *scs; /* group 6 command pointer */ struct scm *scm; /* group 10 command pointer */ struct scv *scv; /* group 12 command pointer */ char sense[32]; /* for call of sens req */ char cmd[16]; /* global for right alignment */ char *cp; /* xxx obsolete size_t cdb_size; cdb_size = CDB_SIZE (*(u_char *) src); */ memset (&cmd, 0, 16); sb_ptr = &sb; sb_ptr->sb_type = ISCB_TYPE; cp = (char *) cmd; DBG (1, "cdb_size = %d src = {0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x ...}\n", cmd_size, cp[0], cp[1], cp[2], cp[3], cp[4], cp[5], cp[6], cp[7], cp[8], cp[9]); switch (cmd_size) { default: return SANE_STATUS_IO_ERROR; case 6: scs = (struct scs *) cmd; memcpy (SCS_AD (scs), cmd, SCS_SZ); scs->ss_lun = 0; sb_ptr->SCB.sc_cmdpt = SCS_AD (scs); sb_ptr->SCB.sc_cmdsz = SCS_SZ; break; case 10: scm = (struct scm *) cmd; memcpy (SCM_AD (scm), cmd, SCM_SZ); scm->sm_lun = 0; sb_ptr->SCB.sc_cmdpt = SCM_AD (scm); sb_ptr->SCB.sc_cmdsz = SCM_SZ; break; case 12: scv = (struct scv *) cmd; memcpy (SCV_AD (scv), cmd, SCV_SZ); scv->sv_lun = 0; sb_ptr->SCB.sc_cmdpt = SCV_AD (scv); sb_ptr->SCB.sc_cmdsz = SCV_SZ; break; } if (dst_size && *dst_size) { assert (0 == src_size); sb_ptr->SCB.sc_mode = SCB_READ; sb_ptr->SCB.sc_datapt = dst; sb_ptr->SCB.sc_datasz = *dst_size; } else { assert (0 <= src_size); sb_ptr->SCB.sc_mode = SCB_WRITE; sb_ptr->SCB.sc_datapt = (char *) src; if ((sb_ptr->SCB.sc_datasz = src_size) > 0) { sb_ptr->SCB.sc_mode = SCB_WRITE; } else { /* also use READ mode if the backends have write with length 0 */ sb_ptr->SCB.sc_mode = SCB_READ; } } sb_ptr->SCB.sc_time = sane_scsicmd_timeout * 1000; DBG (1, "sanei_scsi_cmd: sc_mode = %d, sc_cmdsz = %d, sc_datasz = %d\n", sb_ptr->SCB.sc_mode, sb_ptr->SCB.sc_cmdsz, sb_ptr->SCB.sc_datasz); { /* do read write by normal read or write system calls */ /* the driver will lock process in momory and do optimized transfer */ cp = (char *) cmd; switch (*cp) { case 0x0: /* test unit ready */ if (ioctl (fd, SS_TEST, NULL) < 0) { return SANE_STATUS_DEVICE_BUSY; } break; case SS_READ: case SM_READ: if (*dst_size > 0x2048) { sb_ptr->SCB.sc_datapt = NULL; sb_ptr->SCB.sc_datasz = 0; if (memcmp (sb_ptr->SCB.sc_cmdpt, lastrcmd, sb_ptr->SCB.sc_cmdsz)) { /* set the command block for the next read or write */ memcpy (lastrcmd, sb_ptr->SCB.sc_cmdpt, sb_ptr->SCB.sc_cmdsz); if (!ioctl (fd, SDI_SEND, sb_ptr)) { *dst_size = read (fd, dst, *dst_size); if (*dst_size == -1) { perror ("sanei-scsi:UW-driver read "); return SANE_STATUS_IO_ERROR; } break; } } else { *dst_size = read (fd, dst, *dst_size); if (*dst_size == -1) { perror ("sanei-scsi:UW-driver read "); return SANE_STATUS_IO_ERROR; } break; } return SANE_STATUS_IO_ERROR; } /* fall through for small read */ default: if (ioctl (fd, SDI_SEND, sb_ptr) < 0) { DBG (1, "sanei_scsi_cmd: ioctl(SDI_SEND) FAILED: %s\n", strerror (errno)); return SANE_STATUS_IO_ERROR; } if (dst_size) *dst_size = sb_ptr->SCB.sc_datasz; #ifdef UWSUPPORTED /* at this time not supported by driver */ if (sb_ptr->SCB.sc_comp_code != SDI_ASW) { DBG (1, "sanei_scsi_cmd: scsi_cmd failture %x\n", sb_ptr->SCB.sc_comp_code); if (sb_ptr->SCB.sc_comp_code == SDI_CKSTAT && sb_ptr->SCB.sc_status == S_CKCON) if (fd_info[fd].sense_handler) { void *arg = fd_info[fd].sense_handler_arg; return (*fd_info[fd].sense_handler) (fd, (u_char *) & sb_ptr-> SCB.sc_link, arg); } return SANE_STATUS_IO_ERROR; } #endif break; } return SANE_STATUS_GOOD; } } #endif /* USE == SYSVR4_INTERFACE */ #if USE == SCO_UW71_INTERFACE SANE_Status sanei_scsi_cmd2 (int fd, const void *cmd, size_t cmd_size, const void *src, size_t src_size, void *dst, size_t * dst_size) { static u_char sense_buffer[24]; struct scb cmdblk; time_t elapsed; uint_t compcode, status; /* xxx obsolete int cdb_size, mode; */ int mode; int i; if (fd < 0) return SANE_STATUS_IO_ERROR; cmdblk.sc_cmdpt = (caddr_t) cmd; /* xxx obsolete cdb_size = CDB_SIZE (*(u_char *) src); */ cmdblk.sc_cmdsz = cmd_size; cmdblk.sc_time = 60000; /* 60 secs */ if (dst_size && *dst_size) { /* xxx obsolete assert (cdb_size == src_size); */ cmdblk.sc_datapt = (caddr_t) dst; cmdblk.sc_datasz = *dst_size; mode = SCB_READ; } else { /* xxx obsolete assert (cdb_size <= src_size); */ cmdblk.sc_datapt = (char *) src; cmdblk.sc_datasz = src_size; mode = SCB_WRITE; } if (pt_send (fd, cmdblk.sc_cmdpt, cmdblk.sc_cmdsz, cmdblk.sc_datapt, cmdblk.sc_datasz, mode, cmdblk.sc_time, &elapsed, &compcode, &status, sense_buffer, sizeof (sense_buffer)) != 0) { DBG (1, "sanei_scsi_cmd: pt_send failed: %s!\n", strerror (errno)); } else { DBG (2, "sanei_scsi_cmd completed with: compcode = %x, status = %x\n", compcode, status); switch (compcode) { case SDI_ASW: /* All seems well */ return SANE_STATUS_GOOD; case SDI_CKSTAT: DBG (2, "Sense Data:\n"); for (i = 0; i < sizeof (sense_buffer); i++) DBG (2, "%.2X ", sense_buffer[i]); DBG (2, "\n"); if (fd_info[fd].sense_handler) return (*fd_info[fd].sense_handler) (fd, sense_buffer, fd_info[fd]. sense_handler_arg); /* fall through */ default: return SANE_STATUS_IO_ERROR; } } } #endif /* USE == SCO_UW71_INTERFACE */ #if USE == OS2_INTERFACE #define WE_HAVE_FIND_DEVICES static int get_devicename (int bus, int target, int lun, char *name, size_t name_len) { snprintf (name, name_len, "b%dt%dl%d", bus, target, lun); DBG (1, "OS/2 searched device is %s\n", name); return 0; } void sanei_scsi_find_devices (const char *findvendor, const char *findmodel, const char *findtype, int findbus, int findchannel, int findid, int findlun, SANE_Status (*attach) (const char *dev)) { size_t findvendor_len = 0, findmodel_len = 0, findtype_len = 0; char vendor[32], model[32], type[32], revision[32]; int bus, channel, id, lun, number, i; char line[256], dev_name[128]; const char *string; FILE *proc_fp; char *end; struct { const char *name; size_t name_len; int is_int; /* integer valued? (not a string) */ union { void *v; /* avoids compiler warnings... */ char *str; int *i; } u; } param[] = { { "Vendor:", 7, 0, { 0} } , { "Model:", 6, 0, { 0} } , { "Type:", 5, 0, { 0} } , { "Rev:", 4, 0, { 0} } , { "scsi", 4, 1, { 0} } , { "Channel:", 8, 1, { 0} } , { "Id:", 3, 1, { 0} } , { "Lun:", 4, 1, { 0} } }; param[0].u.str = vendor; param[1].u.str = model; param[2].u.str = type; param[3].u.str = revision; param[4].u.i = &bus; param[5].u.i = &channel; param[6].u.i = &id; param[7].u.i = &lun; DBG_INIT (); open_aspi (); /* open aspi manager if not already done */ DBG (2, "find_devices: open temporary file '%s'\n", tmpAspi); proc_fp = fopen (tmpAspi, "r"); if (!proc_fp) { DBG (1, "could not open %s for reading\n", tmpAspi); return; } number = bus = channel = id = lun = -1; vendor[0] = model[0] = type[0] = '\0'; if (findvendor) findvendor_len = strlen (findvendor); if (findmodel) findmodel_len = strlen (findmodel); if (findtype) findtype_len = strlen (findtype); while (!feof (proc_fp)) { if (!fgets (line, sizeof (line), proc_fp)) break; /* at eof exit */ string = sanei_config_skip_whitespace (line); while (*string) { for (i = 0; i < NELEMS (param); ++i) { if (strncmp (string, param[i].name, param[i].name_len) == 0) { string += param[i].name_len; string = sanei_config_skip_whitespace (string); if (param[i].is_int) { *param[i].u.i = strtol (string, &end, 10); string = (char *) end; } else { strncpy (param[i].u.str, string, 32); param[i].u.str[31] = '\0'; while (*string && !isspace ((int) *string)) ++string; } string = sanei_config_skip_whitespace (string); if (param[i].u.v == &bus) ++number; break; } } if (i >= NELEMS (param)) ++string; /* no match */ } if ((findvendor && !vendor[0]) || (findmodel && !model[0]) || (findtype && !type[0]) || (findbus >= 0 && bus == -1) || (findchannel >= 0 && channel == -1) || (findlun >= 0 && lun == -1)) /* some info is still missing */ continue; if ((!findvendor || strncmp (vendor, findvendor, findvendor_len) == 0) && (!findmodel || strncmp (model, findmodel, findmodel_len) == 0) && (!findtype || strncmp (type, findtype, findtype_len) == 0) && (findbus == -1 || bus == findbus) && (findchannel == -1 || channel == findchannel) && (findid == -1 || id == findid) && (findlun == -1 || lun == findlun) && get_devicename (bus, id, lun, dev_name, sizeof (dev_name)) >= 0 && (*attach) (dev_name) != SANE_STATUS_GOOD) return; vendor[0] = model[0] = type[0] = 0; bus = channel = id = lun = -1; } DBG (2, "find_devices: close temporary file '%s'\n", tmpAspi); fclose (proc_fp); close_aspi (); /* close aspi manager */ } /* XXX untested code! */ SANE_Status sanei_scsi_cmd2 (int fd, const void *cmd, size_t cmd_size, const void *src, size_t src_size, void *dst, size_t * dst_size) { ULONG rc; /* Returns. */ unsigned long cbreturn; unsigned long cbParam; if (aspi_buf == NULL) /* avoid SIGSEGV in memcpy() when calling sanei_scsi_cmd2() while aspi-driver is closed */ { DBG (1, "sanei_scsi_cmd: Error no device (aspi_buf == NULL)\n"); return SANE_STATUS_INVAL; } if (PSRBlock == NULL) /* avoid SIGSEGV in memcpy() when calling sanei_scsi_cmd2() while aspi-driver is closed */ { DBG (1, "sanei_scsi_cmd: Error no device (PSRBlock == NULL)\n"); return SANE_STATUS_INVAL; } memset (PSRBlock, 0, sizeof (SRB)); /* Okay, I'm paranoid. */ PSRBlock->cmd = SRB_Command; /* execute SCSI cmd */ PSRBlock->ha_num = fd_info[fd].bus; /* host adapter number */ PSRBlock->u.cmd.target = fd_info[fd].target; /* Target SCSI ID */ PSRBlock->u.cmd.lun = fd_info[fd].lun; /* Target SCSI LUN */ PSRBlock->flags = SRB_Post; /* posting enabled */ if (dst_size && *dst_size) { /* Reading. */ assert (*dst_size <= (size_t) sanei_scsi_max_request_size); PSRBlock->u.cmd.data_len = *dst_size; DBG (1, "sanei_scsi_cmd: Reading PSRBlock->u.cmd.data_len= %lu\n", PSRBlock->u.cmd.data_len); PSRBlock->flags |= SRB_Read; } else { /* Writing. */ PSRBlock->u.cmd.data_len = src_size; DBG (1, "sanei_scsi_cmd: Writing PSRBlock->u.cmd.data_len= %lu\n", PSRBlock->u.cmd.data_len); assert (PSRBlock->u.cmd.data_len <= (unsigned long) sanei_scsi_max_request_size); if (PSRBlock->u.cmd.data_len) PSRBlock->flags |= SRB_Write; else PSRBlock->flags |= SRB_NoTransfer; memcpy (aspi_buf, src, PSRBlock->u.cmd.data_len); } PSRBlock->u.cmd.sense_len = 32; /* length of sense buffer */ PSRBlock->u.cmd.data_ptr = NULL; /* pointer to data buffer already registered */ PSRBlock->u.cmd.link_ptr = NULL; /* pointer to next SRB */ PSRBlock->u.cmd.cdb_len = cmd_size; /* SCSI command length */ memcpy (PSRBlock->u.cmd.cdb_st, cmd, cmd_size); /* Do the command. */ rc = DosDevIOCtl (driver_handle, 0x92, 0x02, (void *) PSRBlock, sizeof (SRB), &cbParam, (void *) PSRBlock, sizeof (SRB), &cbreturn); if (rc) { DBG (1, "sanei_scsi_cmd: DosDevIOCtl failed. rc= %lu \n", rc); return SANE_STATUS_IO_ERROR; } /* Get sense data if available. */ if ((PSRBlock->status == SRB_Aborted || PSRBlock->status == SRB_Error) && PSRBlock->u.cmd.target_status == SRB_CheckStatus && fd_info[fd].sense_handler != 0) { SANEI_SCSI_Sense_Handler s_handler = fd_info[fd].sense_handler; return (*s_handler) (fd, &PSRBlock->u.cmd.cdb_st[cmd_size], fd_info[fd].sense_handler_arg); } if (PSRBlock->status != SRB_Done || PSRBlock->u.cmd.ha_status != SRB_NoError || PSRBlock->u.cmd.target_status != SRB_NoStatus) { DBG (1, "sanei_scsi_cmd: command 0x%02x failed.\n" "PSRBlock->status= 0x%02x\n" "PSRBlock->u.chm.ha_status= 0x%02x\n" "PSRBlock->u.cmd.target_status= 0x%02x\n", PSRBlock->u.cmd.cdb_st[0], PSRBlock->status, PSRBlock->u.cmd.ha_status, PSRBlock->u.cmd.target_status); return SANE_STATUS_IO_ERROR; } if (dst_size && *dst_size) /* Reading? */ memcpy ((char *) dst, aspi_buf, *dst_size); return SANE_STATUS_GOOD; } #endif /* USE == OS2_INTERFACE */ #if USE == STUBBED_INTERFACE SANE_Status sanei_scsi_cmd2 (int fd, const void *cmd, size_t cmd_size, const void *src, size_t src_size, void *dst, size_t * dst_size) { return SANE_STATUS_UNSUPPORTED; } #endif /* USE == STUBBED_INTERFACE */ #if USE == IRIX_INTERFACE #define WE_HAVE_FIND_DEVICES SANE_Status sanei_scsi_cmd2 (int fd, const void *cmd, size_t cmd_size, const void *src, size_t src_size, void *dst, size_t * dst_size) { dsreq_t scsi_req; /* SCSI request */ /* xxx obsolete size_t cdb_size; *//* Size of SCSI command */ static u_char *cmdbuf = NULL, /* Command buffer */ *sensebuf = NULL, /* Request sense buffer */ *databuf = NULL; /* Data buffer */ /* * Allocate the sense and command data buffers as necessary; we have * to do this to avoid buffer alignment problems, since some * hardware requires these buffers to be 32-bit aligned. */ if (cmdbuf == NULL) { cmdbuf = malloc (64); sensebuf = malloc (1024); /* may be can reduced to 128 */ databuf = malloc (MAX_DATA); if (cmdbuf == NULL || sensebuf == NULL || databuf == NULL) return SANE_STATUS_NO_MEM; } /* * Build the SCSI request... */ /* xxx obsolete cdb_size = CDB_SIZE (*(u_char *) src); */ DBG (1, "sanei_scsi_cmd: cmd_size = %d\n", cmd_size); if (dst != NULL) { /* * SCSI command returning/reading data... */ scsi_req.ds_flags = DSRQ_READ | DSRQ_SENSE; scsi_req.ds_time = 120 * 1000; scsi_req.ds_cmdbuf = (caddr_t) cmdbuf; scsi_req.ds_cmdlen = cmd_size; scsi_req.ds_databuf = (caddr_t) databuf; scsi_req.ds_datalen = *dst_size; scsi_req.ds_sensebuf = (caddr_t) sensebuf; scsi_req.ds_senselen = 128; /* 1024 does not work, 128 is tested (O.Rauch) */ /* * Copy command to cmdbuf to assure 32-bit alignment. */ memcpy (cmdbuf, cmd, cmd_size); } else { /* * SCSI command sending/writing data... */ scsi_req.ds_flags = DSRQ_WRITE | DSRQ_SENSE; scsi_req.ds_time = 120 * 1000; scsi_req.ds_cmdbuf = (caddr_t) cmdbuf; scsi_req.ds_cmdlen = cmd_size; scsi_req.ds_databuf = (caddr_t) databuf; scsi_req.ds_datalen = src_size; scsi_req.ds_sensebuf = (caddr_t) sensebuf; scsi_req.ds_senselen = 128; /* * Copy command and data to local buffers to ensure 32-bit alignment... */ memcpy (cmdbuf, (u_char *) cmd, cmd_size); memcpy (databuf, (u_char *) src, src_size); } bzero (sensebuf, 128); /* * Do SCSI request... */ if (ioctl (fd, DS_ENTER, &scsi_req) < 0) { DBG (1, "sanei_scsi_cmd: ioctl failed - %s\n", strerror (errno)); return SANE_STATUS_IO_ERROR; } DBG (1, "sanei_scsi_cmd: status = %d\n", scsi_req.ds_status); /* * Set the incoming data size and copy the destination data as needed... */ if (dst != NULL) { *dst_size = scsi_req.ds_datasent; DBG (1, "sanei_scsi_cmd: read %d bytes\n", scsi_req.ds_datasent); if (scsi_req.ds_datasent > 0) memcpy (dst, databuf, scsi_req.ds_datasent); } /* * Return the appropriate status code... */ if (scsi_req.ds_status != 0) { if (scsi_req.ds_status == STA_BUSY) return SANE_STATUS_DEVICE_BUSY; else if (fd_info[fd].sense_handler) return (*fd_info[fd].sense_handler) (fd, sensebuf, fd_info[fd].sense_handler_arg); else return SANE_STATUS_IO_ERROR; } return SANE_STATUS_GOOD; } void sanei_scsi_find_devices (const char *findvendor, const char *findmodel, const char *findtype, int findbus, int findchannel, int findid, int findlun, SANE_Status (*attach) (const char *dev)) { size_t findvendor_len = 0, findmodel_len = 0; /* Lengths of search strings */ inventory_t *inv; /* Current hardware inventory entry */ int bus, id, lun; /* Current Bus, ID, and LUN */ char dev_name[128]; /* SCSI device name */ int fd; /* SCSI file */ size_t inqsize; /* Size of returned inquiry data */ char vendor[9], /* Vendor name */ model[17]; /* Model/product name */ u_char inqdata[128], /* Inquiry data buffer */ inqcommand[6]; /* Inquiry command (0x12) buffer */ DBG_INIT (); vendor[0] = model[0] = '\0'; if (findvendor) findvendor_len = strlen (findvendor); if (findmodel) findmodel_len = strlen (findmodel); if (findvendor != NULL) DBG (1, "sanei_scsi_find_devices: looking for vendors starting " "with \"%s\".\n", findvendor); if (findmodel != NULL) DBG (1, "sanei_scsi_find_devices: looking for models starting " "with \"%s\".\n", findmodel); setinvent (); while ((inv = getinvent ()) != NULL) { if (inv->inv_class != INV_SCSI || (inv->inv_type != INV_SCANNER && inv->inv_type != INV_CPU)) continue; bus = inv->inv_controller; id = inv->inv_unit; lun = inv->inv_state >> 8; DBG (1, "sanei_scsi_find_devices: found %s on controller %d, " "ID %d, LUN %d.\n", inv->inv_type == INV_SCANNER ? "scanner" : "processor", bus, id, lun); if ((findbus >= 0 && bus != findbus) || (findid >= 0 && id != findid) || (findlun >= 0 && lun != findlun)) { DBG (1, "sanei_scsi_find_devices: ignoring this device.\n"); continue; } sprintf (dev_name, "/dev/scsi/sc%dd%dl%d", bus, id, lun); DBG (1, "sanei_scsi_find_devices: device name is \"%s\".\n", dev_name); /* * Open the SCSI device and get the inquiry data... */ if (sanei_scsi_open (dev_name, &fd, NULL, NULL) != SANE_STATUS_GOOD) { DBG (1, "sanei_scsi_find_devices: unable to open device file - %s.\n", strerror (errno)); continue; } DBG (1, "sanei_scsi_find_devices: device fd = %d.\n", fd); inqsize = sizeof (inqdata); inqcommand[0] = 0x12; inqcommand[1] = 0; inqcommand[2] = 0; inqcommand[3] = sizeof (inqdata) >> 8; inqcommand[4] = sizeof (inqdata); inqcommand[5] = 0; if (sanei_scsi_cmd (fd, inqcommand, sizeof (inqcommand), inqdata, &inqsize) != SANE_STATUS_GOOD) { DBG (1, "sanei_scsi_find_devices: unable to get inquiry data - %s.\n", strerror (errno)); continue; } sanei_scsi_close (fd); strncpy (vendor, (char *) inqdata + 8, 8); vendor[8] = '\0'; strncpy (model, (char *) inqdata + 16, 16); model[16] = '\0'; DBG (1, "sanei_scsi_find_devices: vendor = \'%s\', model = \'%s'.\n", vendor, model); /* * Compare as necessary... */ if ((findvendor != NULL && strncmp (findvendor, vendor, findvendor_len)) || (findmodel != NULL && strncmp (findmodel, model, findmodel_len))) { DBG (1, "sanei_scsi_find_devices: ignoring this device.\n"); continue; } /* * OK, this one matches, so use it! */ DBG (1, "sanei_scsi_find_devices: attaching this device.\n"); (*attach) (dev_name); } } #endif /* USE == IRIX_INTERFACE */ #if USE == AIX_GSC_INTERFACE SANE_Status sanei_scsi_cmd2 (int fd, const void *cmd, size_t cmd_size, const void *src, size_t src_size, void *dst, size_t * dst_size) { scmd_t scmd; /* xxx obsolete size_t cdb_size; */ char sense_buf[32]; char status; /* xxx obsolete cdb_size = CDB_SIZE (*(u_char *) src); */ memset (&scmd, 0, sizeof (scmd)); if (dst_size && *dst_size) { /* xxx obsolete assert (cdb_size == src_size); */ scmd.rw = 1; scmd.data_buf = dst; scmd.datalen = *dst_size; } else { /* assert (cdb_size <= src_size); */ scmd.data_buf = (char *) src; scmd.datalen = src_size; } scmd.cdb = (char *) cmd; scmd.cdblen = cmd_size; scmd.timeval = sane_scsicmd_timeout; scmd.sense_buf = sense_buf; scmd.senselen = sizeof (sense_buf); scmd.statusp = &status; DBG (1, "sanei_scsi_cmd: scmd.rw = %d, scmd.cdblen = %d, ", scmd.rw, scmd.cdblen); DBG (1, "scmd.cdb = {0x%x,0x%x,0x%x,0x%x,0x%x,0x%x, ...}\n", scmd.cdb[0], scmd.cdb[1], scmd.cdb[2], scmd.cdb[3], scmd.cdb[4], scmd.cdb[5]); if (ioctl (fd, GSC_CMD, &scmd) < 0) { DBG (1, "sanei_scsi_cmd: ioctl(SIOC_IO) failed: %s\n", strerror (errno)); return SANE_STATUS_IO_ERROR; } if (*scmd.statusp) DBG (1, "sanei_scsi_cmd: SCSI completed with status=%d\n", *scmd.statusp); DBG (1, "sanei_scsi_cmd: dst = {0x%x,0x%x,0x%x,0x%x,0x%x,0x%x, ...}\n", *((char *) dst + 0), *((char *) dst + 1), *((char *) dst + 2), *((char *) dst + 3), *((char *) dst + 4), *((char *) dst + 5)); if (dst_size) *dst_size = scmd.datalen; if (scmd.senselen > 0 && (scmd.sense_buf[0] & 0x80) && fd_info[fd].sense_handler) return (*fd_info[fd].sense_handler) (fd, (u_char *) scmd.sense_buf, fd_info[fd].sense_handler_arg); return SANE_STATUS_GOOD; } #endif /* USE == AIX_GSC_INTERFACE */ #if USE == SOLARIS_SG_INTERFACE #ifndef CCS_SENSE_LEN # define CCS_SENSE_LEN 18 #endif SANE_Status sanei_scsi_cmd2 (int fd, const void *cmd, size_t cmd_size, const void *src, size_t src_size, void *dst, size_t * dst_size) { struct user_scsi us; /* xxx obsolete size_t cdb_size; */ char sensebf[CCS_SENSE_LEN]; /* xxx obsolete cdb_size = CDB_SIZE (*(u_char *) src); */ /* first put the user scsi structure together. */ memset (&us, 0, sizeof (us)); us.us_cdbp = (caddr_t) cmd; us.us_cdblen = cmd_size; us.us_sensep = sensebf; us.us_senselen = CCS_SENSE_LEN; if (dst && dst_size && *dst_size) { us.us_bufp = (caddr_t) dst; us.us_buflen = *dst_size; us.us_flags = USER_SCSI_READ; } else { us.us_bufp = (caddr_t) src; us.us_buflen = src_size; us.us_flags = USER_SCSI_WRITE; } /* now run it */ if (ioctl (fd, USER_SCSI, &us) < 0) return SANE_STATUS_IO_ERROR; if (dst_size) *dst_size -= us.us_resid; return SANE_STATUS_GOOD; } #endif /* USE == SOLARIS_SG_INTERFACE */ #if USE == SOLARIS_INTERFACE #ifndef SC_NOT_READ # define SC_NOT_READY 0x02 #endif #ifndef SC_BUSY # define SC_BUSY 0x08 #endif #define DEF_TIMEOUT sane_scsicmd_timeout; /* Choosing one of the following DEF_SCG_FLG's SCG_DISRE_ENA allows the SCSI driver to disconnect/reconnect. SCG_CMD_RETRY allows a retry if a retryable error occurs. Disallowing SCG_DISRE_ENA slows down the operation of the SCSI bus while the scanner is working. If you have severe problems try to set it to 0. SCG_CMD_RETRY allows the driver to retry some commands. It should normally be set. For some kinds of odd problems, it may cause the machine to hang for some time. */ #define DEF_SCG_FLG SCG_DISRE_ENA /* #define DEF_SCG_FLG 0 */ /* #define DEF_SCG_FLG SCG_DISRE_ENA | SCG_CMD_RETRY */ /* #define DEF_SCG_FLG SCG_CMD_RETRY */ static int d_errs = 100; static SANE_Status scsi_cmd (int fd, const void *cmd, size_t cmd_size, const void *src, size_t src_size, void *dst, size_t * dst_size, int probing) { struct scg_cmd scmd; /* xxx obsolete size_t cdb_size; */ SANEI_SCSI_Sense_Handler handler; /* xxx obsolete cdb_size = CDB_SIZE (*(u_char *) src); */ memset (&scmd, 0, sizeof (scmd)); scmd.flags = DEF_SCG_FLG | (probing ? SCG_SILENT : 0); if (dst && dst_size && *dst_size) { /* xxx obsolete assert (cdb_size == src_size); */ scmd.flags |= SCG_RECV_DATA; scmd.addr = dst; scmd.size = *dst_size; } else { /* xxx obsolete assert (cdb_size <= src_size); */ scmd.addr = (caddr_t) src; scmd.size = src_size; } scmd.cdb_len = cmd_size; scmd.sense_len = CCS_SENSE_LEN; scmd.target = fd_info[fd].target; /* use 2 second timeout when probing, 60 seconds otherwise: */ scmd.timeout = probing ? 2 : DEF_TIMEOUT; memcpy (&scmd.cdb.g0_cdb.cmd, cmd, cmd_size); scmd.cdb.cmd_cdb[1] |= fd_info[fd].lun << 5; if (ioctl (fd, SCGIO_CMD, &scmd) < 0) return SANE_STATUS_IO_ERROR; if (dst_size) *dst_size = scmd.size - scmd.resid; if (scmd.error == 0 && scmd.errno == 0 && *(u_char *) & scmd.scb == 0) return SANE_STATUS_GOOD; if (scmd.error == SCG_TIMEOUT) DBG (0, "sanei_scsi_cmd %x: timeout\n", scmd.cdb.g0_cdb.cmd); else if (probing) { struct scsi_ext_sense *ext_sense = (struct scsi_ext_sense *) &scmd.sense; if (scmd.error < SCG_FATAL && ((scmd.sense.code < 0x70 && scmd.sense.code != 0x04) || (scmd.sense.code >= 0x70 && ext_sense->key != SC_NOT_READY))) return SANE_STATUS_GOOD; } else { char errbf[128]; int i, rv, lifes; handler = fd_info[fd].sense_handler; DBG (3, "cmd=%x, error=%d:%s, bsiz=%d, stat=%x,%x,%x, slen=%d\n", scmd.cdb.g0_cdb.cmd, scmd.error, strerror (scmd.errno), ((dst_size != NULL) ? (*dst_size) : 0), scmd.u_scb.cmd_scb[0], scmd.u_scb.cmd_scb[1], scmd.u_scb.cmd_scb[2], scmd.sense_count); *errbf = '\0'; for (i = 0; i < scmd.sense_count; i++) sprintf (errbf + strlen (errbf), "%x,", scmd.u_sense.cmd_sense[i]); DBG (3, "sense=%s\n", errbf); /* test_unit_ready on a busy unit returns error = 0 or 2 with errno=EIO. I've seen 0 on a CDrom without a CD, and 2 on a scanner just busy. If (SANE_DEBUG_SANEI_SCSI > 100) lifes = SANE_DEBUG_SANEI_SCSI - 100 use up one life for every scmd.error abort and dump core when no lifes left test_unit_ready commands are not counted. */ if (scmd.error) { if (sanei_debug_sanei_scsi > 100 && scmd.cdb.g0_cdb.cmd != SC_TEST_UNIT_READY) { lifes = sanei_debug_sanei_scsi - ++d_errs; DBG (1, "sanei_scsi_cmd: %d lifes left\n", lifes); assert (lifes > 0); } return SANE_STATUS_IO_ERROR; } if (scmd.u_scb.cmd_scb[0] == SC_BUSY) return SANE_STATUS_DEVICE_BUSY; if (*(u_char *) & scmd.sense && handler) { rv = (*handler) (fd, scmd.u_sense.cmd_sense, fd_info[fd].sense_handler_arg); DBG (2, "sanei_scsi_cmd: sense-handler returns %d\n", rv); return rv; } } return SANE_STATUS_IO_ERROR; } SANE_Status sanei_scsi_cmd2 (int fd, const void *cmd, size_t cmd_size, const void *src, size_t src_size, void *dst, size_t * dst_size) { return scsi_cmd (fd, cmd, cmd_size, src, src_size, dst, dst_size, 0); } static int unit_ready (int fd) { static const u_char test_unit_ready[] = { 0, 0, 0, 0, 0, 0 }; int status; status = scsi_cmd (fd, test_unit_ready, sizeof (test_unit_ready), 0, 0, 0, 0, 1); return (status == SANE_STATUS_GOOD); } #endif /* USE == SOLARIS_INTERFACE */ #if USE == SOLARIS_USCSI_INTERFACE #define DEF_TIMEOUT sane_scsicmd_timeout; static int d_errs = 100; typedef struct scsi_extended_sense extended_sense_t; typedef struct scsi_inquiry scsi_inquiry_t; static SANE_Status scsi_cmd (int fd, const void *cmd, size_t cmd_size, const void *src, size_t src_size, void *dst, size_t * dst_size, int probing) { struct uscsi_cmd us; scsi_inquiry_t inquiry, *iq = &inquiry; extended_sense_t sense, *sp = &sense; SANEI_SCSI_Sense_Handler handler; memset (&us, 0, sizeof (us)); memset (sp, 0, sizeof (*sp)); us.uscsi_flags = USCSI_SILENT | USCSI_RQENABLE | USCSI_DIAGNOSE; us.uscsi_timeout = probing ? 2 : DEF_TIMEOUT; us.uscsi_rqbuf = (caddr_t) sp; /* sense data address */ us.uscsi_rqlen = sizeof (extended_sense_t); /* length of sense data */ if (dst && dst_size && *dst_size) { us.uscsi_flags |= USCSI_READ; us.uscsi_bufaddr = (caddr_t) dst; us.uscsi_buflen = *dst_size; } else { us.uscsi_flags |= USCSI_WRITE; us.uscsi_bufaddr = (caddr_t) src; us.uscsi_buflen = src_size; } us.uscsi_cdblen = cmd_size; us.uscsi_cdb = (caddr_t) cmd; if (ioctl (fd, USCSICMD, &us) < 0) return SANE_STATUS_IO_ERROR; if (dst_size) *dst_size = us.uscsi_buflen - us.uscsi_resid; if ((us.uscsi_status & STATUS_MASK) == STATUS_GOOD) return SANE_STATUS_GOOD; if (sp->es_key == SUN_KEY_TIMEOUT) DBG (0, "sanei_scsi_cmd %x: timeout\n", *(char *) cmd); else { char errbf[128]; int i, rv, lifes; handler = fd_info[fd].sense_handler; DBG (3, "cmd=%x, scsi_status=%x\n", *(char *) cmd, us.uscsi_status); *errbf = '\0'; for (i = 0; i < us.uscsi_rqlen; i++) sprintf (errbf + strlen (errbf), "%x,", *(sp + i)); DBG (3, "sense=%s\n", errbf); #if 0 if (us.error) { if (sanei_debug_sanei_scsi > 100 && scmd.cdb.g0_cdb.cmd != SC_TEST_UNIT_READY) { lifes = sanei_debug_sanei_scsi - ++d_errs; DBG (1, "sanei_scsi_cmd: %d lifes left\n", lifes); assert (lifes > 0); } return SANE_STATUS_IO_ERROR; } if (scmd.u_scb.cmd_scb[0] == SC_BUSY) return SANE_STATUS_DEVICE_BUSY; #endif if (handler) { rv = (*handler) (fd, (unsigned char *) sp, fd_info[fd].sense_handler_arg); DBG (2, "sanei_scsi_cmd: sense-handler returns %d\n", rv); return rv; } } return SANE_STATUS_IO_ERROR; } SANE_Status sanei_scsi_cmd2 (int fd, const void *cmd, size_t cmd_size, const void *src, size_t src_size, void *dst, size_t * dst_size) { return scsi_cmd (fd, cmd, cmd_size, src, src_size, dst, dst_size, 0); } static int unit_ready (int fd) { static const u_char test_unit_ready[] = { 0, 0, 0, 0, 0, 0 }; int status; status = scsi_cmd (fd, test_unit_ready, sizeof (test_unit_ready), 0, 0, 0, 0, 1); return (status == SANE_STATUS_GOOD); } #endif /* USE == SOLARIS_USCSI_INTERFACE */ #if USE == WIN32_INTERFACE SANE_Status sanei_scsi_cmd2 (int fd, const void *cmd, size_t cmd_size, const void *src, size_t src_size, void *dst, size_t * dst_size) { struct pkt { SCSI_PASS_THROUGH_DIRECT sptd; unsigned char sense[255]; } pkt; DWORD BytesReturned; BOOL ret; memset(&pkt, 0, sizeof( pkt )); pkt.sptd.Length = sizeof( SCSI_PASS_THROUGH_DIRECT ); pkt.sptd.PathId = fd_info[fd].bus; pkt.sptd.TargetId = fd_info[fd].target; pkt.sptd.Lun = fd_info[fd].lun; assert(cmd_size == 6 || cmd_size == 10 || cmd_size == 12 || cmd_size == 16); memcpy(pkt.sptd.Cdb, cmd, cmd_size); pkt.sptd.CdbLength = cmd_size; if (dst_size && *dst_size) { pkt.sptd.DataIn = SCSI_IOCTL_DATA_IN; pkt.sptd.DataTransferLength = *dst_size; pkt.sptd.DataBuffer = dst; } else if (src_size) { pkt.sptd.DataIn = SCSI_IOCTL_DATA_OUT; pkt.sptd.DataTransferLength = src_size; pkt.sptd.DataBuffer = src; } else { pkt.sptd.DataIn = SCSI_IOCTL_DATA_UNSPECIFIED; } pkt.sptd.TimeOutValue = sane_scsicmd_timeout; pkt.sptd.SenseInfoOffset = offsetof(struct pkt, sense); pkt.sptd.SenseInfoLength = sizeof(pkt.sense); ret = DeviceIoControl(fd, IOCTL_SCSI_PASS_THROUGH_DIRECT, &pkt.sptd, sizeof( pkt ), &pkt.sptd, sizeof( pkt ), &BytesReturned, NULL ); if (ret == 0) { DBG (1, "sanei_scsi_cmd2: DeviceIoControl() failed: %ld\n", GetLastError()); return SANE_STATUS_IO_ERROR; } if (pkt.sptd.ScsiStatus == 2){ /* Check condition. */ SANEI_SCSI_Sense_Handler handler; handler = fd_info[fd].sense_handler; if (handler) { return handler(fd, pkt.sense, fd_info[fd].sense_handler_arg); } else { return SANE_STATUS_IO_ERROR; } } else if (pkt.sptd.ScsiStatus != 0) { DBG (1, "sanei_scsi_cmd2: ScsiStatus is %d\n", pkt.sptd.ScsiStatus); return SANE_STATUS_IO_ERROR; } if (dst_size) { *dst_size = pkt.sptd.DataTransferLength; } return SANE_STATUS_GOOD; } #define WE_HAVE_FIND_DEVICES /* This is almost the same algorithm used in sane-find-scanner. */ void sanei_scsi_find_devices (const char *findvendor, const char *findmodel, const char *findtype, int findbus, int findchannel, int findid, int findlun, SANE_Status (*attach) (const char *dev)) { int hca; HANDLE fd; char scsi_hca_name[20]; char buffer[4096]; DWORD BytesReturned; BOOL ret; PSCSI_ADAPTER_BUS_INFO adapter; PSCSI_INQUIRY_DATA inquiry; int i; DBG_INIT(); hca = 0; for(hca = 0; ; hca++) { /* Open the adapter */ snprintf(scsi_hca_name, 20, "\\\\.\\Scsi%d:", hca); fd = CreateFile(scsi_hca_name, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_RANDOM_ACCESS, NULL ); if (fd == INVALID_HANDLE_VALUE) { /* Assume there is no more adapter. This is wrong in the case * of hot-plug stuff, but I have yet to see it on a user * machine. */ break; } /* Get the inquiry info for the devices on that hca. */ ret = DeviceIoControl(fd, IOCTL_SCSI_GET_INQUIRY_DATA, NULL, 0, buffer, sizeof(buffer), &BytesReturned, FALSE); if(ret == 0) { CloseHandle(fd); continue; } adapter = (PSCSI_ADAPTER_BUS_INFO)buffer; for(i = 0; i < adapter->NumberOfBuses; i++) { if (adapter->BusData[i].InquiryDataOffset == 0) { /* No device here */ continue; } inquiry = (PSCSI_INQUIRY_DATA) (buffer + adapter->BusData[i].InquiryDataOffset); while(1) { if ((findvendor == NULL || strncmp(findvendor, (char *)&inquiry->InquiryData[8], 8) == 0)) { DBG(1, "OK1\n"); } else { DBG(1, "failed for [%s] and [%s]\n",findvendor, (char *)&inquiry->InquiryData[8] ); } /* Check if this device fits the criteria. */ if ((findvendor == NULL || strncmp(findvendor, (char *)&inquiry->InquiryData[8], strlen(findvendor)) == 0) && (findmodel == NULL || strncmp(findmodel, (char *)&inquiry->InquiryData[16], strlen(findmodel)) == 0) && (findbus == -1 || findbus == hca) && (findchannel == -1 || findchannel == inquiry->PathId) && (findid == -1 || findid == inquiry->TargetId) && (findlun == -1 || findlun == inquiry->Lun)) { char device_name[20]; sprintf(device_name, "h%db%dt%dl%d", hca, inquiry->PathId, inquiry->TargetId, inquiry->Lun); attach(device_name); } if (inquiry->NextInquiryDataOffset == 0) { /* No device here */ break; } else { inquiry = (PSCSI_INQUIRY_DATA) (buffer + inquiry->NextInquiryDataOffset); } } } CloseHandle(fd); } } #endif /* USE == WIN32_INTERFACE */ #if USE == MACOSX_INTERFACE # ifdef HAVE_IOKIT_CDB_IOSCSILIB_H static SANE_Status sanei_scsi_cmd2_old_api (int fd, const void *cmd, size_t cmd_size, const void *src, size_t src_size, void *dst, size_t * dst_size) { mach_port_t masterPort; IOReturn ioReturnValue; io_object_t scsiDevice; int i; CFMutableDictionaryRef scsiMatchDictionary; int deviceTypeNumber; CFNumberRef deviceTypeRef; io_iterator_t scsiObjectIterator; io_object_t device; CFNumberRef IOUnitRef; int iounit; CFNumberRef scsiTargetRef; int scsitarget; CFNumberRef scsiLunRef; int scsilun; IOCFPlugInInterface **plugInInterface; SInt32 score; HRESULT plugInResult; IOSCSIDeviceInterface **scsiDeviceInterface; IOCDBCommandInterface **cdbCommandInterface; CDBInfo cdb; IOVirtualRange range; UInt32 transferCount; Boolean isWrite; SCSIResults results; UInt32 seqNumber; masterPort = 0; ioReturnValue = IOMasterPort (MACH_PORT_NULL, &masterPort); if (ioReturnValue != kIOReturnSuccess || masterPort == 0) { DBG (5, "Could not get I/O master port (0x%08x)\n", ioReturnValue); return SANE_STATUS_IO_ERROR; } scsiDevice = 0; for (i = 0; !scsiDevice && i < 2; i++) { scsiMatchDictionary = IOServiceMatching (kIOSCSIDeviceClassName); if (scsiMatchDictionary == NULL) { DBG (5, "Could not create SCSI matching dictionary\n"); return SANE_STATUS_NO_MEM; } deviceTypeNumber = (i == 0 ? kSCSIDevTypeScanner : kSCSIDevTypeProcessor); deviceTypeRef = CFNumberCreate (NULL, kCFNumberIntType, &deviceTypeNumber); CFDictionarySetValue (scsiMatchDictionary, CFSTR (kSCSIPropertyDeviceTypeID), deviceTypeRef); CFRelease (deviceTypeRef); scsiObjectIterator = 0; ioReturnValue = IOServiceGetMatchingServices (masterPort, scsiMatchDictionary, &scsiObjectIterator); if (ioReturnValue != kIOReturnSuccess) { DBG (5, "Could not match services (0x%08x)\n", ioReturnValue); return SANE_STATUS_NO_MEM; } while ((device = IOIteratorNext (scsiObjectIterator))) { IOUnitRef = IORegistryEntryCreateCFProperty (device, CFSTR (kSCSIPropertyIOUnit), NULL, 0); CFNumberGetValue (IOUnitRef, kCFNumberIntType, &iounit); CFRelease (IOUnitRef); scsiTargetRef = IORegistryEntryCreateCFProperty (device, CFSTR (kSCSIPropertyTarget), NULL, 0); CFNumberGetValue (scsiTargetRef, kCFNumberIntType, &scsitarget); CFRelease (scsiTargetRef); scsiLunRef = IORegistryEntryCreateCFProperty (device, CFSTR (kSCSIPropertyLun), NULL, 0); CFNumberGetValue (scsiLunRef, kCFNumberIntType, &scsilun); CFRelease (scsiLunRef); if (fd_info[fd].bus == iounit && fd_info[fd].target == scsitarget && fd_info[fd].lun == scsilun) scsiDevice = device; else IOObjectRelease (device); } IOObjectRelease (scsiObjectIterator); } if (!scsiDevice) { DBG (5, "Device not found (unit %i, target %i, lun %i)\n", fd_info[fd].bus, fd_info[fd].target, fd_info[fd].lun); return SANE_STATUS_INVAL; } plugInInterface = NULL; score = 0; ioReturnValue = IOCreatePlugInInterfaceForService (scsiDevice, kIOSCSIUserClientTypeID, kIOCFPlugInInterfaceID, &plugInInterface, &score); if (ioReturnValue != kIOReturnSuccess || plugInInterface == NULL) { DBG (5, "Error creating plugin interface (0x%08x)\n", ioReturnValue); return SANE_STATUS_NO_MEM; } scsiDeviceInterface = NULL; plugInResult = (*plugInInterface)-> QueryInterface (plugInInterface, CFUUIDGetUUIDBytes (kIOSCSIDeviceInterfaceID), (LPVOID) & scsiDeviceInterface); if (plugInResult != S_OK || scsiDeviceInterface == NULL) { DBG (5, "Couldn't create SCSI device interface (%ld)\n", plugInResult); return SANE_STATUS_NO_MEM; } (*plugInInterface)->Release (plugInInterface); IOObjectRelease (scsiDevice); ioReturnValue = (*scsiDeviceInterface)->open (scsiDeviceInterface); if (ioReturnValue != kIOReturnSuccess) { DBG (5, "Error opening SCSI interface (0x%08x)\n", ioReturnValue); return SANE_STATUS_IO_ERROR; } cdbCommandInterface = NULL; plugInResult = (*scsiDeviceInterface)-> QueryInterface (scsiDeviceInterface, CFUUIDGetUUIDBytes (kIOCDBCommandInterfaceID), (LPVOID) & cdbCommandInterface); if (plugInResult != S_OK || cdbCommandInterface == NULL) { DBG (5, "Error creating CDB interface (%ld)\n", plugInResult); return SANE_STATUS_NO_MEM; } cdb.cdbLength = cmd_size; memcpy (&cdb.cdb, cmd, cmd_size); if (dst && dst_size) { bzero (dst, *dst_size); range.address = (IOVirtualAddress) dst; range.length = *dst_size; transferCount = *dst_size; isWrite = false; } else { range.address = (IOVirtualAddress) src; range.length = src_size; transferCount = src_size; isWrite = true; } seqNumber = 0; ioReturnValue = (*cdbCommandInterface)-> setAndExecuteCommand (cdbCommandInterface, &cdb, transferCount, &range, 1, isWrite, sane_scsicmd_timeout * 1000, 0, 0, 0, &seqNumber); if (ioReturnValue != kIOReturnSuccess && ioReturnValue != kIOReturnUnderrun) { DBG (5, "Error executing CDB command (0x%08x)\n", ioReturnValue); return SANE_STATUS_IO_ERROR; } ioReturnValue = (*cdbCommandInterface)->getResults (cdbCommandInterface, &results); if (ioReturnValue != kIOReturnSuccess && ioReturnValue != kIOReturnUnderrun) { DBG (5, "Error getting results from CDB Interface (0x%08x)\n", ioReturnValue); return SANE_STATUS_IO_ERROR; } if (dst && dst_size) *dst_size = results.bytesTransferred; (*cdbCommandInterface)->Release (cdbCommandInterface); (*scsiDeviceInterface)->close (scsiDeviceInterface); (*scsiDeviceInterface)->Release (scsiDeviceInterface); return SANE_STATUS_GOOD; } static void sanei_scsi_find_devices_old_api (const char *findvendor, const char *findmodel, const char *findtype, int findbus, int findchannel, int findid, int findlun, SANE_Status (*attach) (const char *dev)) { mach_port_t masterPort; IOReturn ioReturnValue; int i; CFMutableDictionaryRef scsiMatchDictionary; int deviceTypeNumber; CFNumberRef deviceTypeRef; io_iterator_t scsiObjectIterator; io_object_t scsiDevice; CFNumberRef IOUnitRef; int iounit; CFNumberRef scsiTargetRef; int scsitarget; CFNumberRef scsiLunRef; int scsilun; IOCFPlugInInterface **plugInInterface; SInt32 score; HRESULT plugInResult; IOSCSIDeviceInterface **scsiDeviceInterface; SCSIInquiry inquiry; UInt32 inquirySize; char devname[16]; masterPort = 0; ioReturnValue = IOMasterPort (MACH_PORT_NULL, &masterPort); if (ioReturnValue != kIOReturnSuccess || masterPort == 0) { DBG (5, "Could not get I/O master port (0x%08x)\n", ioReturnValue); return; } for (i = 0; i < 2; i++) { scsiMatchDictionary = IOServiceMatching (kIOSCSIDeviceClassName); if (scsiMatchDictionary == NULL) { DBG (5, "Could not create SCSI matching dictionary\n"); return; } deviceTypeNumber = (i == 0 ? kSCSIDevTypeScanner : kSCSIDevTypeProcessor); deviceTypeRef = CFNumberCreate (NULL, kCFNumberIntType, &deviceTypeNumber); CFDictionarySetValue (scsiMatchDictionary, CFSTR (kSCSIPropertyDeviceTypeID), deviceTypeRef); CFRelease (deviceTypeRef); scsiObjectIterator = 0; ioReturnValue = IOServiceGetMatchingServices (masterPort, scsiMatchDictionary, &scsiObjectIterator); if (ioReturnValue != kIOReturnSuccess) { DBG (5, "Could not match services (0x%08x)\n", ioReturnValue); return; } while ((scsiDevice = IOIteratorNext (scsiObjectIterator))) { IOUnitRef = IORegistryEntryCreateCFProperty (scsiDevice, CFSTR (kSCSIPropertyIOUnit), NULL, 0); CFNumberGetValue (IOUnitRef, kCFNumberIntType, &iounit); CFRelease (IOUnitRef); scsiTargetRef = IORegistryEntryCreateCFProperty (scsiDevice, CFSTR (kSCSIPropertyTarget), NULL, 0); CFNumberGetValue (scsiTargetRef, kCFNumberIntType, &scsitarget); CFRelease (scsiTargetRef); scsiLunRef = IORegistryEntryCreateCFProperty (scsiDevice, CFSTR (kSCSIPropertyLun), NULL, 0); CFNumberGetValue (scsiLunRef, kCFNumberIntType, &scsilun); CFRelease (scsiLunRef); plugInInterface = NULL; score = 0; ioReturnValue = IOCreatePlugInInterfaceForService (scsiDevice, kIOSCSIUserClientTypeID, kIOCFPlugInInterfaceID, &plugInInterface, &score); if (ioReturnValue != kIOReturnSuccess || plugInInterface == NULL) { DBG (5, "Error creating plugin interface (0x%08x)\n", ioReturnValue); return; } scsiDeviceInterface = NULL; plugInResult = (*plugInInterface)-> QueryInterface (plugInInterface, CFUUIDGetUUIDBytes (kIOSCSIDeviceInterfaceID), (LPVOID) & scsiDeviceInterface); if (plugInResult != S_OK || scsiDeviceInterface == NULL) { DBG (5, "Couldn't create SCSI device interface (%ld)\n", plugInResult); return; } (*plugInInterface)->Release (plugInInterface); IOObjectRelease (scsiDevice); ioReturnValue = (*scsiDeviceInterface)-> getInquiryData (scsiDeviceInterface, &inquiry, sizeof (SCSIInquiry), &inquirySize); (*scsiDeviceInterface)->Release (scsiDeviceInterface); if ((findlun < 0 || findlun == scsilun) && (findvendor == NULL || strncmp (findvendor, inquiry.vendorName, strlen (findvendor)) == 0) && (findmodel == NULL || strncmp (findmodel, inquiry.productName, strlen (findmodel)) == 0)) { sprintf (devname, "u%dt%dl%d", iounit, scsitarget, scsilun); (*attach) (devname); } } IOObjectRelease (scsiObjectIterator); } } # endif /* ifdef HAVE_IOKIT_CDB_IOSCSILIB_H */ # if defined (HAVE_IOKIT_SCSI_SCSICOMMANDOPERATIONCODES_H) || \ defined (HAVE_IOKIT_SCSI_COMMANDS_SCSICOMMANDOPERATIONCODES_H) static void CreateMatchingDictionaryForSTUC (SInt32 peripheralDeviceType, const char *findvendor, const char *findmodel, const CFDataRef scsiguid, CFMutableDictionaryRef * matchingDict) { CFMutableDictionaryRef subDict; CFNumberRef deviceTypeRef; CFStringRef str; /* Create the dictionaries */ *matchingDict = CFDictionaryCreateMutable (kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); if (*matchingDict == NULL) { return; } subDict = CFDictionaryCreateMutable (kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); if (subDict == NULL) { CFRelease (*matchingDict); *matchingDict = NULL; return; } /* Create a dictionary with the "SCSITaskDeviceCategory" key with the appropriate value for the device type we're interested in.*/ CFDictionarySetValue (subDict, CFSTR (kIOPropertySCSITaskDeviceCategory), CFSTR (kIOPropertySCSITaskUserClientDevice)); deviceTypeRef = CFNumberCreate (kCFAllocatorDefault, kCFNumberIntType, &peripheralDeviceType); CFDictionarySetValue (subDict, CFSTR (kIOPropertySCSIPeripheralDeviceType), deviceTypeRef); CFRelease (deviceTypeRef); /* Add search for a vendor or model */ if (findvendor) { str = CFStringCreateWithCString (kCFAllocatorDefault, findvendor, kCFStringEncodingUTF8); CFDictionarySetValue (subDict, CFSTR (kIOPropertySCSIVendorIdentification), str); CFRelease (str); } if (findmodel) { str = CFStringCreateWithCString (kCFAllocatorDefault, findmodel, kCFStringEncodingUTF8); CFDictionarySetValue (subDict, CFSTR (kIOPropertySCSIProductIdentification), str); CFRelease (str); } if (scsiguid) { CFDictionarySetValue (subDict, CFSTR (kIOPropertySCSITaskUserClientInstanceGUID), scsiguid); } /* Add the dictionary to the main dictionary with the key "IOPropertyMatch" to narrow the search to the above dictionary. */ CFDictionarySetValue (*matchingDict, CFSTR (kIOPropertyMatchKey), subDict); CFRelease (subDict); } static void CreateDeviceInterfaceUsingSTUC (io_object_t scsiDevice, IOCFPlugInInterface *** thePlugInInterface, SCSITaskDeviceInterface *** theInterface) { IOReturn ioReturnValue; IOCFPlugInInterface **plugInInterface = NULL; SInt32 score = 0; HRESULT plugInResult; SCSITaskDeviceInterface **interface = NULL; /* Create the base interface of type IOCFPlugInInterface. This object will be used to create the SCSI device interface object. */ ioReturnValue = IOCreatePlugInInterfaceForService (scsiDevice, kIOSCSITaskDeviceUserClientTypeID, kIOCFPlugInInterfaceID, &plugInInterface, &score); if (ioReturnValue != kIOReturnSuccess) { DBG (5, "Error creating plugin interface (0x%08x)\n", ioReturnValue); return; } /* Query the base plugin interface for an instance of the specific SCSI device interface object. */ plugInResult = (*plugInInterface)->QueryInterface (plugInInterface, CFUUIDGetUUIDBytes (kIOSCSITaskDeviceInterfaceID), (LPVOID) & interface); if (plugInResult != S_OK) { DBG (5, "Couldn't create SCSI device interface (%ld)\n", (long) plugInResult); return; } /* Set the return values. */ *thePlugInInterface = plugInInterface; *theInterface = interface; } static SANE_Status ExecuteSCSITask (SCSITaskInterface ** task, const void *cmd, size_t cmd_size, const void *src, size_t src_size, void *dst, size_t * dst_size) { SCSITaskStatus taskStatus; SCSI_Sense_Data senseData; SCSICommandDescriptorBlock cdb; IOReturn ioReturnValue; #ifdef HAVE_SCSITASKSGELEMENT SCSITaskSGElement range; #else IOVirtualRange range; #endif UInt64 transferCount = 0; UInt64 data_length = 0; UInt8 transferType = 0; if (dst && dst_size) /* isRead */ { DBG (6, "isRead dst_size:%ld\n", *dst_size); /* Zero the buffer. */ bzero (dst, *dst_size); /* Configure the virtual range for the buffer. */ range.address = (long) dst; range.length = *dst_size; data_length = *dst_size; transferType = kSCSIDataTransfer_FromTargetToInitiator; } else { DBG (6, "isWrite src_size:%ld\n", src_size); /* Configure the virtual range for the buffer. */ range.address = (long) src; range.length = src_size; data_length = src_size; transferType = kSCSIDataTransfer_FromInitiatorToTarget; } /* zero the senseData and CDB */ bzero (&senseData, sizeof (senseData)); bzero (cdb, sizeof (cdb)); /* copy the command data */ memcpy (cdb, cmd, cmd_size); /* Set the actual cdb in the task */ ioReturnValue = (*task)->SetCommandDescriptorBlock (task, cdb, cmd_size); if (ioReturnValue != kIOReturnSuccess) { DBG (5, "Error setting CDB (0x%08x)\n", ioReturnValue); return SANE_STATUS_IO_ERROR; } /* Set the scatter-gather entry in the task */ ioReturnValue = (*task)->SetScatterGatherEntries (task, &range, 1, data_length, transferType); if (ioReturnValue != kIOReturnSuccess) { DBG (5, "Error setting scatter-gather entries (0x%08x)\n", ioReturnValue); return SANE_STATUS_IO_ERROR; } /* Set the timeout in the task */ ioReturnValue = (*task)->SetTimeoutDuration (task, sane_scsicmd_timeout * 1000); if (ioReturnValue != kIOReturnSuccess) { DBG (5, "Error setting timeout (0x%08x)\n", ioReturnValue); return SANE_STATUS_IO_ERROR; } DBG (5, "Executing command\n"); /* Send it! */ ioReturnValue = (*task)->ExecuteTaskSync (task, &senseData, &taskStatus, &transferCount); if (ioReturnValue != kIOReturnSuccess) { DBG (5, "Error executing task (0x%08x)\n", ioReturnValue); return SANE_STATUS_IO_ERROR; } DBG (5, "ExecuteTaskSync OK Transferred %lld bytes\n", transferCount); if (taskStatus != kSCSITaskStatus_GOOD) { DBG (5, "taskStatus = 0x%08x\n", taskStatus); return SANE_STATUS_IO_ERROR; } /* Task worked correctly */ if (dst && dst_size) *dst_size = transferCount; return SANE_STATUS_GOOD; } static SANE_Status ExecuteCommandUsingSTUC (SCSITaskDeviceInterface ** interface, const void *cmd, size_t cmd_size, const void *src, size_t src_size, void *dst, size_t * dst_size) { SCSITaskInterface **task; IOReturn ioReturnValue; SANE_Status returnValue; /* Get exclusive access for the device if we can. This must be done before any SCSITasks can be created and sent to the device. */ ioReturnValue = (*interface)->ObtainExclusiveAccess (interface); if (ioReturnValue != kIOReturnSuccess) { DBG (5, "ObtainExclusiveAccess failed (0x%08x)\n", ioReturnValue); return SANE_STATUS_NO_MEM; } /* Create a task now that we have exclusive access */ task = (*interface)->CreateSCSITask (interface); if (task == NULL) { DBG (5, "CreateSCSITask returned NULL\n"); (*interface)->ReleaseExclusiveAccess (interface); return SANE_STATUS_NO_MEM; } returnValue = ExecuteSCSITask (task, cmd, cmd_size, src, src_size, dst, dst_size); /* Release the task interface */ (*task)->Release (task); /* Release exclusive access */ (*interface)->ReleaseExclusiveAccess (interface); return returnValue; } static SANE_Status sanei_scsi_cmd2_stuc_api (int fd, const void *cmd, size_t cmd_size, const void *src, size_t src_size, void *dst, size_t * dst_size) { CFDataRef guid; mach_port_t masterPort; int i; io_object_t scsiDevice; SInt32 peripheralDeviceType; CFMutableDictionaryRef matchingDict; io_iterator_t iokIterator; IOReturn ioReturnValue; IOCFPlugInInterface **plugInInterface = NULL; SCSITaskDeviceInterface **interface = NULL; io_object_t nextDevice; SANE_Status returnValue; guid = fd_info[fd].pdata; if (!guid) { DBG (5, "No GUID\n"); return SANE_STATUS_INVAL; } DBG (2, "cmd2: cmd_size:%ld src_size:%ld dst_size:%ld isWrite:%d\n", cmd_size, src_size, (!dst_size) ? 0 : *dst_size, (!dst_size) ? 1 : 0); /* Use default master port */ masterPort = 0; ioReturnValue = IOMasterPort (MACH_PORT_NULL, &masterPort); if (ioReturnValue != kIOReturnSuccess || masterPort == 0) { DBG (5, "Could not get I/O master port (0x%08x)\n", ioReturnValue); return SANE_STATUS_IO_ERROR; } /* Search for both Scanner type and Processor type devices */ /* GB TDB This should only be needed for find */ scsiDevice = 0; for (i = 0; !scsiDevice && i < 2; i++) { peripheralDeviceType = (i == 0 ? kINQUIRY_PERIPHERAL_TYPE_ScannerSCSI2Device : kINQUIRY_PERIPHERAL_TYPE_ProcessorSPCDevice); /* Set up a matching dictionary to search the I/O Registry for the SCSI device */ /* we are interested in, specifying the SCSITaskUserClient GUID. */ matchingDict = NULL; CreateMatchingDictionaryForSTUC (peripheralDeviceType, NULL, NULL, guid, &matchingDict); if (matchingDict == NULL) { DBG (5, "CreateMatchingDictionaryForSTUC Failed\n"); return SANE_STATUS_NO_MEM; } /* Now search I/O Registry for the matching device */ iokIterator = 0; ioReturnValue = IOServiceGetMatchingServices (masterPort, matchingDict, &iokIterator); if (ioReturnValue != kIOReturnSuccess) { DBG (5, "IOServiceGetMatchingServices Failed\n"); return SANE_STATUS_NO_MEM; } scsiDevice = IOIteratorNext (iokIterator); while ((nextDevice = IOIteratorNext (iokIterator))) { IOObjectRelease (nextDevice); } IOObjectRelease (iokIterator); } if (!scsiDevice) { DBG (5, "Device not found\n"); return SANE_STATUS_INVAL; } /* Found Device */ /* Create interface */ CreateDeviceInterfaceUsingSTUC (scsiDevice, &plugInInterface, &interface); /* Done with SCSI object from I/O Registry. */ ioReturnValue = IOObjectRelease (scsiDevice); returnValue = SANE_STATUS_IO_ERROR; if (ioReturnValue != kIOReturnSuccess) { DBG (5, "Error releasing SCSI device. (0x%08x)\n", ioReturnValue); } else if (interface != NULL) { /* Execute the command */ returnValue = ExecuteCommandUsingSTUC (interface, cmd, cmd_size, src, src_size, dst, dst_size); } if (interface != NULL) { (*interface)->Release (interface); } if (plugInInterface != NULL) { IODestroyPlugInInterface (plugInInterface); } return returnValue; } static void sanei_scsi_find_devices_stuc_api (const char *findvendor, const char *findmodel, const char *findtype, int findbus, int findchannel, int findid, int findlun, SANE_Status (*attach) (const char *dev)) { mach_port_t masterPort; IOReturn ioReturnValue; int i; SInt32 peripheralDeviceType; CFMutableDictionaryRef matchingDict; io_iterator_t iokIterator; io_object_t scsiDevice; CFDataRef GUIDRef; char *devname; int len; const unsigned char *p; CFDictionaryRef protocolCharacteristics; CFNumberRef scsiLunRef; int scsilun; masterPort = 0; ioReturnValue = IOMasterPort (MACH_PORT_NULL, &masterPort); if (ioReturnValue != kIOReturnSuccess || masterPort == 0) return; DBG (5, "Search for Vendor: %s Model: %s\n", (findvendor) ? findvendor : "(none)", (findmodel) ? findmodel : "(none)"); /* Search for both Scanner type and Processor type devices */ for (i = 0; i < 2; i++) { peripheralDeviceType = (i == 0 ? kINQUIRY_PERIPHERAL_TYPE_ScannerSCSI2Device : kINQUIRY_PERIPHERAL_TYPE_ProcessorSPCDevice); /* Set up a matching dictionary to search the I/O Registry for SCSI devices we are interested in. */ matchingDict = NULL; CreateMatchingDictionaryForSTUC (peripheralDeviceType, findvendor, findmodel, NULL, &matchingDict); if (matchingDict == NULL) { DBG (5, "CreateMatchingDictionaryForSTUC Failed\n"); return; } /* Now search I/O Registry for matching devices. */ iokIterator = 0; ioReturnValue = IOServiceGetMatchingServices (masterPort, matchingDict, &iokIterator); if (ioReturnValue != kIOReturnSuccess) { DBG (5, "IOServiceGetMatchingServices Failed\n"); return; } /* Check devices */ while ((scsiDevice = IOIteratorNext (iokIterator))) { scsilun = 0; protocolCharacteristics = IORegistryEntryCreateCFProperty (scsiDevice, CFSTR ("Protocol Characteristics"), NULL, 0); if (protocolCharacteristics) { scsiLunRef = CFDictionaryGetValue (protocolCharacteristics, CFSTR ("SCSI Logical Unit Number")); if (scsiLunRef) CFNumberGetValue (scsiLunRef, kCFNumberIntType, &scsilun); CFRelease (protocolCharacteristics); } if (findlun < 0 || findlun == scsilun) { /* Create device name from the SCSITaskUserClient GUID */ GUIDRef = IORegistryEntryCreateCFProperty (scsiDevice, CFSTR (kIOPropertySCSITaskUserClientInstanceGUID), NULL, 0); if (GUIDRef) { len = CFDataGetLength (GUIDRef); p = CFDataGetBytePtr (GUIDRef); devname = (char *) malloc (2 * len + 3); devname [0] = '<'; for (i = 0; i < len; i++) sprintf (&devname [2 * i + 1], "%02x", p [i]); devname [2 * len + 1] = '>'; devname [2 * len + 2] = '\0'; CFRelease (GUIDRef); DBG (1, "Found: %s\n", devname); /* Attach to the device */ (*attach) (devname); free (devname); } else DBG (1, "Can't find SCSITaskUserClient GUID\n"); } } IOObjectRelease (iokIterator); } } # endif /* HAVE_IOKIT_SCSI_COMMANDS_SCSICOMMANDOPERATIONCODES_H */ SANE_Status sanei_scsi_cmd2 (int fd, const void *cmd, size_t cmd_size, const void *src, size_t src_size, void *dst, size_t * dst_size) { if (fd_info[fd].pdata) # if defined (HAVE_IOKIT_SCSI_SCSICOMMANDOPERATIONCODES_H) || \ defined (HAVE_IOKIT_SCSI_COMMANDS_SCSICOMMANDOPERATIONCODES_H) return sanei_scsi_cmd2_stuc_api (fd, cmd, cmd_size, src, src_size, dst, dst_size); # else return SANE_STATUS_INVAL; # endif else # ifdef HAVE_IOKIT_CDB_IOSCSILIB_H return sanei_scsi_cmd2_old_api (fd, cmd, cmd_size, src, src_size, dst, dst_size); # else return SANE_STATUS_INVAL; # endif } void sanei_scsi_find_devices (const char *findvendor, const char *findmodel, const char *findtype, int findbus, int findchannel, int findid, int findlun, SANE_Status (*attach) (const char *dev)) { # if defined (HAVE_IOKIT_SCSI_SCSICOMMANDOPERATIONCODES_H) || \ defined (HAVE_IOKIT_SCSI_COMMANDS_SCSICOMMANDOPERATIONCODES_H) sanei_scsi_find_devices_stuc_api (findvendor, findmodel, findtype, findbus, findchannel, findid, findlun, attach); # endif # ifdef HAVE_IOKIT_CDB_IOSCSILIB_H sanei_scsi_find_devices_old_api (findvendor, findmodel, findtype, findbus, findchannel, findid, findlun, attach); # endif } #define WE_HAVE_FIND_DEVICES #endif /* USE == MACOSX_INTERFACE */ #ifndef WE_HAVE_ASYNC_SCSI SANE_Status sanei_scsi_req_enter2 (int fd, const void *cmd, size_t cmd_size, const void *src, size_t src_size, void *dst, size_t * dst_size, void **idp) { return sanei_scsi_cmd2 (fd, cmd, cmd_size, src, src_size, dst, dst_size); } SANE_Status sanei_scsi_req_wait (void *id) { return SANE_STATUS_GOOD; } void sanei_scsi_req_flush_all (void) { } void sanei_scsi_req_flush_all_extended (int fd) { } #endif /* WE_HAVE_ASYNC_SCSI */ SANE_Status sanei_scsi_req_enter (int fd, const void *src, size_t src_size, void *dst, size_t * dst_size, void **idp) { size_t cmd_size = CDB_SIZE (*(const char *) src); if (dst_size && *dst_size) assert (src_size == cmd_size); else assert (src_size >= cmd_size); return sanei_scsi_req_enter2 (fd, src, cmd_size, (const char *) src + cmd_size, src_size - cmd_size, dst, dst_size, idp); } SANE_Status sanei_scsi_cmd (int fd, const void *src, size_t src_size, void *dst, size_t * dst_size) { size_t cmd_size = CDB_SIZE (*(const char *) src); if (dst_size && *dst_size) assert (src_size == cmd_size); else assert (src_size >= cmd_size); return sanei_scsi_cmd2 (fd, src, cmd_size, (const char *) src + cmd_size, src_size - cmd_size, dst, dst_size); } #ifndef WE_HAVE_FIND_DEVICES void sanei_scsi_find_devices (const char *findvendor, const char *findmodel, const char *findtype, int findbus, int findchannel, int findid, int findlun, SANE_Status (*attach) (const char *dev)) { DBG_INIT (); DBG (1, "sanei_scsi_find_devices: not implemented for this platform\n"); } #endif /* WE_HAVE_FIND_DEVICES */ sane-backends-extras-1.0.22.3ubuntu1/sanei/sanei_jpeg.c0000664000000000000000000001534611475557446017555 0ustar /* Code for JPEG decompression by the Independent JPEG Group. Please see README.jpeg in the top level directory. */ #include "../include/sane/config.h" #ifdef HAVE_LIBJPEG #include "../include/sane/sanei_jpeg.h" typedef struct { struct djpeg_dest_struct pub; /* public fields */ /* Usually these two pointers point to the same place: */ char *iobuffer; /* fwrite's I/O buffer */ JSAMPROW pixrow; /* decompressor output buffer */ size_t buffer_width; /* width of I/O buffer */ JDIMENSION samples_per_row; /* JSAMPLEs per output row */ } ppm_dest_struct; typedef ppm_dest_struct *ppm_dest_ptr; /* * For 12-bit JPEG data, we either downscale the values to 8 bits * (to write standard byte-per-sample PPM/PGM files), or output * nonstandard word-per-sample PPM/PGM files. Downscaling is done * if PPM_NORAWWORD is defined (this can be done in the Makefile * or in jconfig.h). * (When the core library supports data precision reduction, a cleaner * implementation will be to ask for that instead.) */ #if BITS_IN_JSAMPLE==8 #define PUTPPMSAMPLE(ptr,v) *ptr++=(char) (v) #define BYTESPERSAMPLE 1 #define PPM_MAXVAL 255 #else #ifdef PPM_NORAWWORD #define PUTPPMSAMPLE(ptr,v) *ptr++=(char) ((v) >> (BITS_IN_JSAMPLE-8)) #define BYTESPERSAMPLE 1 #define PPM_MAXVAL 255 #else /* The word-per-sample format always puts the LSB first. */ #define PUTPPMSAMPLE(ptr,v) \ { register int val_=v; \ *ptr++=(char) (val_ & 0xFF); \ *ptr++=(char) ((val_ >> 8) & 0xFF); \ } #define BYTESPERSAMPLE 2 #define PPM_MAXVAL ((1<iobuffer, dest->buffer_width); } /* * This code is used when we have to copy the data and apply a pixel * format translation. Typically this only happens in 12-bit mode. */ METHODDEF (void) sanei_jpeg_copy_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, JDIMENSION rows_supplied, char *data) { ppm_dest_ptr dest = (ppm_dest_ptr) dinfo; register char *bufferptr; register JSAMPROW ptr; register JDIMENSION col; cinfo = cinfo; dinfo = dinfo; rows_supplied = rows_supplied; ptr = dest->pub.buffer[0]; bufferptr = dest->iobuffer; for (col = dest->samples_per_row; col > 0; col--) { PUTPPMSAMPLE (bufferptr, GETJSAMPLE (*ptr++)); } memcpy (data, dest->iobuffer, dest->buffer_width); } /* * Write some pixel data when color quantization is in effect. * We have to demap the color index values to straight data. */ METHODDEF (void) sanei_jpeg_put_demapped_rgb (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, JDIMENSION rows_supplied, char *data) { ppm_dest_ptr dest = (ppm_dest_ptr) dinfo; register char *bufferptr; register int pixval; register JSAMPROW ptr; register JSAMPROW color_map0 = cinfo->colormap[0]; register JSAMPROW color_map1 = cinfo->colormap[1]; register JSAMPROW color_map2 = cinfo->colormap[2]; register JDIMENSION col; rows_supplied = rows_supplied; ptr = dest->pub.buffer[0]; bufferptr = dest->iobuffer; for (col = cinfo->output_width; col > 0; col--) { pixval = GETJSAMPLE (*ptr++); PUTPPMSAMPLE (bufferptr, GETJSAMPLE (color_map0[pixval])); PUTPPMSAMPLE (bufferptr, GETJSAMPLE (color_map1[pixval])); PUTPPMSAMPLE (bufferptr, GETJSAMPLE (color_map2[pixval])); } memcpy (data, dest->iobuffer, dest->buffer_width); } METHODDEF (void) sanei_jpeg_put_demapped_gray (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, JDIMENSION rows_supplied, char *data) { ppm_dest_ptr dest = (ppm_dest_ptr) dinfo; register char *bufferptr; register JSAMPROW ptr; register JSAMPROW color_map = cinfo->colormap[0]; register JDIMENSION col; rows_supplied = rows_supplied; ptr = dest->pub.buffer[0]; bufferptr = dest->iobuffer; for (col = cinfo->output_width; col > 0; col--) { PUTPPMSAMPLE (bufferptr, GETJSAMPLE (color_map[GETJSAMPLE (*ptr++)])); } memcpy (data, dest->iobuffer, dest->buffer_width); } GLOBAL (djpeg_dest_ptr) sanei_jpeg_jinit_write_ppm (j_decompress_ptr cinfo) { ppm_dest_ptr dest; /* Create module interface object, fill in method pointers */ dest = (ppm_dest_ptr) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF (ppm_dest_struct)); dest->pub.start_output = sanei_jpeg_start_output_ppm; dest->pub.finish_output = sanei_jpeg_finish_output_ppm; /* Calculate output image dimensions so we can allocate space */ jpeg_calc_output_dimensions (cinfo); /* Create physical I/O buffer. Note we make this near on a PC. */ dest->samples_per_row = cinfo->output_width * cinfo->out_color_components; dest->buffer_width = dest->samples_per_row * (BYTESPERSAMPLE * SIZEOF (char)); dest->iobuffer = (char *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, dest->buffer_width); if (cinfo->quantize_colors || BITS_IN_JSAMPLE != 8 || SIZEOF (JSAMPLE) != SIZEOF (char)) { /* When quantizing, we need an output buffer for clrmap indexes * that's separate from the physical I/O buffer. We also need a * separate buffer if pixel format translation must take place. */ dest->pub.buffer = (*cinfo->mem->alloc_sarray) ((j_common_ptr) cinfo, JPOOL_IMAGE, cinfo->output_width * cinfo->output_components, (JDIMENSION) 1); dest->pub.buffer_height = 1; if (!cinfo->quantize_colors) dest->pub.put_pixel_rows = sanei_jpeg_copy_pixel_rows; else if (cinfo->out_color_space == JCS_GRAYSCALE) dest->pub.put_pixel_rows = sanei_jpeg_put_demapped_gray; else dest->pub.put_pixel_rows = sanei_jpeg_put_demapped_rgb; } else { /* We will fwrite() directly from decompressor output buffer. */ /* Synthesize a JSAMPARRAY pointer structure */ /* Cast here implies near->far pointer conversion on PCs */ dest->pixrow = (JSAMPROW) dest->iobuffer; dest->pub.buffer = &dest->pixrow; dest->pub.buffer_height = 1; dest->pub.put_pixel_rows = sanei_jpeg_put_pixel_rows; } return (djpeg_dest_ptr) dest; } #endif sane-backends-extras-1.0.22.3ubuntu1/sanei/sanei_lm983x.c0000664000000000000000000001770011475557446017670 0ustar /* sane - Scanner Access Now Easy. based on sources acquired from Plustek Inc. Copyright (C) 2002-2004 Gerhard Jaeger This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. Interface files for the LM9831/2/3 chip, a chip used in many USB scanners. */ #include "../include/sane/config.h" #include #include #include #include #include #define BACKEND_NAME sanei_lm983x /**< the name of this module for dbg */ #include "../include/sane/sane.h" #include "../include/sane/sanei_debug.h" #include "../include/sane/sanei_usb.h" #include "../include/sane/sanei_lm983x.h" /***************************** some definitions ******************************/ #define _MIN(a,b) ((a) < (b) ? (a) : (b)) #define _MAX(a,b) ((a) > (b) ? (a) : (b)) #define _CMD_BYTE_CNT 4 /**< header for LM983x transfers */ #define _MAX_RETRY 20 /**< number of tries for reset */ #define _LM9831_MAX_REG 0x7f /**< number of LM983x bytes */ #define _MAX_TRANSFER_SIZE 60 /**< max. number of bytes to transfer */ /******************************* the functions *******************************/ void sanei_lm983x_init( void ) { DBG_INIT(); } SANE_Status sanei_lm983x_write_byte( SANE_Int fd, SANE_Byte reg, SANE_Byte value ) { return sanei_lm983x_write( fd, reg, &value, 1, SANE_FALSE ); } SANE_Status sanei_lm983x_write( SANE_Int fd, SANE_Byte reg, SANE_Byte *buffer, SANE_Word len, SANE_Bool increment ) { size_t size; SANE_Byte command_buffer[_MAX_TRANSFER_SIZE + _CMD_BYTE_CNT]; SANE_Status result; SANE_Word bytes, max_len; DBG( 15, "sanei_lm983x_write: fd=%d, reg=%d, len=%d, increment=%d\n", fd, reg, len, increment); if( reg > _LM9831_MAX_REG ) { DBG( 1, "sanei_lm983x_write: register out of range (%u>%u)\n", reg, _LM9831_MAX_REG ); return SANE_STATUS_INVAL; } for( bytes = 0; len > 0; ) { max_len = _MIN( len, _MAX_TRANSFER_SIZE ); command_buffer[0] = 0; /* write */ command_buffer[1] = reg; /* LM983x register */ if( increment == SANE_TRUE ) { command_buffer[0] += 0x02; /* increase reg? */ command_buffer[1] += bytes; } command_buffer[2] = (max_len >> 8) & 0xff; /* bytes to write MSB */ command_buffer[3] = max_len & 0xff; /* bytes to write LSB */ memcpy( command_buffer + _CMD_BYTE_CNT, buffer + bytes, max_len ); size = (max_len + _CMD_BYTE_CNT); result = sanei_usb_write_bulk( fd, command_buffer, &size ); if( SANE_STATUS_GOOD != result ) return result; if( size != (size_t)(max_len + _CMD_BYTE_CNT)) { DBG( 2, "sanei_lm983x_write: short write (%d/%d)\n", result, max_len + _CMD_BYTE_CNT); if( size < _CMD_BYTE_CNT ) { DBG( 1, "sanei_lm983x_write: couldn't even send command\n" ); return SANE_STATUS_IO_ERROR; } DBG( 1, "sanei_lm983x_write: trying again\n" ); } len -= (size - _CMD_BYTE_CNT); bytes += (size - _CMD_BYTE_CNT); } DBG( 15, "sanei_lm983x_write: succeeded\n" ); return SANE_STATUS_GOOD; } SANE_Status sanei_lm983x_read( SANE_Int fd, SANE_Byte reg, SANE_Byte *buffer, SANE_Word len, SANE_Bool increment ) { size_t size; SANE_Byte command_buffer[_CMD_BYTE_CNT]; SANE_Status result; SANE_Word bytes, max_len, read_bytes; DBG( 15, "sanei_lm983x_read: fd=%d, reg=%d, len=%d, increment=%d\n", fd, reg, len, increment ); if( reg > _LM9831_MAX_REG ) { DBG( 1, "sanei_lm983x_read: register out of range (%u>%u)\n", reg, _LM9831_MAX_REG ); return SANE_STATUS_INVAL; } for( bytes = 0; len > 0; ) { max_len = _MIN(len, 0xFFFF ); command_buffer[0] = 1; /* read */ command_buffer[1] = reg; /* LM9831 register */ if( increment ) { command_buffer[0] += 0x02; command_buffer[1] += bytes; } command_buffer[2] = (max_len >> 8) & 0xff; /* bytes to read MSB */ command_buffer[3] = max_len & 0xff; /* bytes to read LSB */ DBG( 15, "sanei_lm983x_read: writing command: " "%02x %02x %02x %02x\n", command_buffer[0], command_buffer[1], command_buffer[2], command_buffer[3]); size = _CMD_BYTE_CNT; result = sanei_usb_write_bulk( fd, command_buffer, &size ); if( SANE_STATUS_GOOD != result ) return result; if( size != _CMD_BYTE_CNT) { DBG( 1, "sanei_lm983x_read: short write while writing command " "(%d/_CMD_BYTE_CNT)\n", result); return SANE_STATUS_IO_ERROR; } read_bytes = 0; do { size = (max_len - read_bytes); result = sanei_usb_read_bulk( fd, (buffer + bytes + read_bytes), &size ); if( SANE_STATUS_GOOD != result ) return result; read_bytes += size; DBG( 15, "sanei_lm983x_read: read %lu bytes\n", (u_long) size ); if( read_bytes != max_len ) { DBG( 2, "sanei_lm983x_read: short read (%d/%d)\n", result, max_len ); /* wait a little bit before retrying */ usleep( 10000 ); DBG( 2, "sanei_lm983x_read: trying again\n" ); } } while( read_bytes < max_len ); bytes += (max_len); len -= (max_len); } DBG( 15, "sanei_lm983x_read: succeeded\n" ); return SANE_STATUS_GOOD; } SANE_Bool sanei_lm983x_reset( SANE_Int fd ) { SANE_Status res; SANE_Byte tmp; SANE_Int i; DBG( 15, "sanei_lm983x_reset()\n" ); for( i = 0; i < _MAX_RETRY; i++ ) { /* Read the command register and check that the reset bit is not set * If it is set, clear it and return false to indicate that * the bit has only now been cleared * * Write the command bytes for a register read * without increment */ if( SANE_STATUS_GOOD != sanei_lm983x_read_byte( fd, 0x07, &tmp )) continue; if( tmp & 0x20 ) { res = sanei_lm983x_write_byte( fd, 0x07, 0 ); /* We will attempt to reset it but we really don't do * anything if this fails */ if( res == SANE_STATUS_GOOD ) { DBG( 15, "Resetting the LM983x already done\n" ); return SANE_TRUE; } } else { res = sanei_lm983x_write_byte( fd, 0x07, 0x20 ); if( res == SANE_STATUS_GOOD ) { DBG( 15, "Resetting the LM983x done\n" ); return SANE_TRUE; } } } return SANE_FALSE; } /* END sanei_lm983x.c .......................................................*/ sane-backends-extras-1.0.22.3ubuntu1/sanei/sanei_udp.c0000664000000000000000000001110011475557446017400 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 2006 Tower Technologies Author: Alessandro Zummo This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ #include "../include/sane/config.h" #include #include #include #include #include #include #include #include #define BACKEND_NAME sanei_udp #include "../include/sane/sane.h" #include "../include/sane/sanei_debug.h" #include "../include/sane/sanei_udp.h" static SANE_Status sanei_udp_socket(int *fdp, int broadcast) { int fd; if ((fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) return SANE_STATUS_INVAL; if (broadcast) { int opt = 1; if (setsockopt(fd, SOL_SOCKET, SO_BROADCAST, (char *) &opt, sizeof(opt)) < 0) { close(fd); return SANE_STATUS_INVAL; } } *fdp = fd; return SANE_STATUS_GOOD; } static SANE_Status sanei_udp_connect(int fd, const char *host, int port) { int err; struct sockaddr_in saddr; struct hostent *h; h = gethostbyname(host); if (h == NULL || h->h_addr_list[0] == NULL || h->h_addrtype != AF_INET) return SANE_STATUS_INVAL; memset(&saddr, 0x00, sizeof(struct sockaddr_in)); saddr.sin_family = AF_INET; saddr.sin_port = htons(port); memcpy(&saddr.sin_addr, h->h_addr_list[0], h->h_length); if ((err = connect(fd, (struct sockaddr *) &saddr, sizeof(struct sockaddr_in))) != 0) { return SANE_STATUS_INVAL; } return SANE_STATUS_GOOD; } SANE_Status sanei_udp_open(const char *host, int port, int *fdp) { int status; DBG_INIT(); DBG(1, "%s\n", __func__); status = sanei_udp_socket(fdp, 0); if (status != SANE_STATUS_GOOD) return status; status = sanei_udp_connect(*fdp, host, port); if (status != SANE_STATUS_GOOD) { close(*fdp); return status; } return status; } SANE_Status sanei_udp_open_broadcast(int *fdp) { int status; DBG_INIT(); DBG(1, "%s\n", __func__); status = sanei_udp_socket(fdp, 1); if (status != SANE_STATUS_GOOD) return status; return status; } void sanei_udp_close(int fd) { close(fd); } ssize_t sanei_udp_write(int fd, const u_char * buf, int count) { return send(fd, buf, count, 0); } ssize_t sanei_udp_write_broadcast(int fd, int port, const u_char * buf, int count) { struct sockaddr_in saddr; memset(&saddr, 0x00, sizeof(struct sockaddr_in)); saddr.sin_family = AF_INET; saddr.sin_port = htons(port); saddr.sin_addr.s_addr = htonl(INADDR_BROADCAST); return sendto(fd, buf, count, 0, (struct sockaddr *)&saddr, sizeof(saddr)); } ssize_t sanei_udp_read(int fd, u_char * buf, int count) { return recv(fd, buf, count, 0); } ssize_t sanei_udp_recvfrom(int fd, u_char * buf, int count, char **fromp) { ssize_t l; socklen_t fl; struct sockaddr_in from; fl = sizeof(from); l = recvfrom(fd, buf, count, 0, (struct sockaddr *) &from, &fl); if (l > 0 && fromp) { *fromp = inet_ntoa(from.sin_addr); } return l; } sane-backends-extras-1.0.22.3ubuntu1/sanei/sanei_auth.c0000664000000000000000000001511611475557446017564 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 2000 Jochen Eisinger This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. This file implements an interface for user authorization using MD5 digest */ #include "../include/sane/config.h" #include #include #include #ifdef HAVE_UNISTD_H #include #endif #include #define BACKEND_NAME sanei_auth #include "../include/sane/sanei_backend.h" #include "../include/sane/sanei_debug.h" #include "../include/sane/sane.h" #include "../include/sane/sanei.h" #include "../include/sane/sanei_auth.h" #include "../include/sane/sanei_config.h" #include "../include/md5.h" static int random_seeded = 0; #define INIT_RND() do { \ if (random_seeded == 0) { \ random_seeded = 1; \ srand(time(NULL)); \ DBG_INIT(); \ } \ } while (0) #ifdef HAVE_DEV_URANDOM static unsigned long randombits (void) { FILE *dev_urandom; unsigned long result = 0; char buffer[4]; if ((dev_urandom = fopen ("/dev/urandom", "r")) == NULL) { DBG (2, "randombits: could not open /dev/urandom...\n"); return rand (); } fread (buffer, 1, 4, dev_urandom); fclose (dev_urandom); result = buffer[0]; result <<= 8; result += buffer[1]; result <<= 8; result += buffer[2]; result <<= 8; result += buffer[3]; return result; } #else #define randombits rand #endif static int check_passwd (const char *upassword, const char *password, const char *randomstring, const char *username) { unsigned char md5digest[16]; char tmpstr[512]; if (strncmp (upassword, "$MD5$", 5) == 0) { sprintf (tmpstr, "%s%.128s", strstr (randomstring, "$MD5$") + 5, password); md5_buffer (tmpstr, strlen (tmpstr), md5digest); sprintf (tmpstr, "$MD5$%02x%02x%02x%02x%02x%02x%02x%02x" "%02x%02x%02x%02x%02x%02x%02x%02x", md5digest[0], md5digest[1], md5digest[2], md5digest[3], md5digest[4], md5digest[5], md5digest[6], md5digest[7], md5digest[8], md5digest[9], md5digest[10], md5digest[11], md5digest[12], md5digest[13], md5digest[14], md5digest[15]); return (strcmp (upassword, tmpstr) == 0); } else { DBG (1, "check_passwd: received plain-text reply from user ``%s''\n", username); return (strcmp (upassword, password) == 0); } } SANE_Status sanei_authorize (const char *resource, const char *backend, SANE_Auth_Callback authorize) { FILE *passwd_file; char passwd_filename[256]; char line[1024], *linep; SANE_Bool entry_found = SANE_FALSE; char md5resource[256]; char username[SANE_MAX_USERNAME_LEN]; char password[SANE_MAX_PASSWORD_LEN]; INIT_RND (); DBG (4, "called for ``%s'' by %s\n", resource, backend); if (strlen (resource) > 127) DBG (1, "resource is longer than 127 chars...\n"); sprintf (passwd_filename, "%s.users", backend); passwd_file = sanei_config_open (passwd_filename); if (passwd_file == NULL) { DBG (3, "could not open ``%s''...\n", passwd_filename); return SANE_STATUS_GOOD; } while (sanei_config_read (line, 1024, passwd_file)) { if (strchr (line, ':') != NULL) { if (strchr (strchr (line, ':') + 1, ':') != NULL) { if (strcmp (strchr (strchr (line, ':') + 1, ':') + 1, resource) == 0) { entry_found = SANE_TRUE; break; } } } } if (entry_found == SANE_FALSE) { fclose (passwd_file); DBG (3, "could not find resource ``%s''...\n", resource); return SANE_STATUS_GOOD; } if (authorize == NULL) { DBG (2, "no authorization callback supplied by frontend\n"); return SANE_STATUS_ACCESS_DENIED; } sprintf (md5resource, "%.128s$MD5$%x%lx%08lx", resource, getpid (), (long int) time (NULL), randombits ()); DBG(0, "resource=%s\n", md5resource); memset (username, 0, SANE_MAX_USERNAME_LEN); memset (password, 0, SANE_MAX_PASSWORD_LEN); (*authorize) (md5resource, username, password); fseek (passwd_file, 0L, SEEK_SET); while (sanei_config_read (line, 1024, passwd_file)) { if ((strlen (line) > 0) && (line[strlen (line) - 1] == '\n')) line[strlen (line) - 1] = '\n'; if ((strlen (line) > 0) && (line[strlen (line) - 1] == '\r')) line[strlen (line) - 1] = '\r'; if ((strncmp (line, username, strlen (username)) == 0) && (((strchr (line, ':')) - line) == (signed) strlen (username))) { linep = strchr (line, ':') + 1; if ((strchr (linep, ':') != NULL) && (strcmp (strchr (linep, ':') + 1, resource) == 0)) { *(strchr (linep, ':')) = 0; if (check_passwd (password, linep, md5resource, username)) { fclose (passwd_file); DBG (2, "authorization succeeded\n"); return SANE_STATUS_GOOD; } } } } fclose (passwd_file); DBG (1, "authorization failed\n"); return SANE_STATUS_ACCESS_DENIED; } sane-backends-extras-1.0.22.3ubuntu1/sanei/sanei_usb.c0000664000000000000000000025163611526062332017403 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 2001 - 2005 Henning Meier-Geinitz Copyright (C) 2001 Frank Zago (sanei_usb_control_msg) Copyright (C) 2003 Rene Rebe (sanei_read_int,sanei_set_timeout) Copyright (C) 2005 Paul Smedley (OS/2 usbcalls) Copyright (C) 2008 m. allan noah (bus rescan support, sanei_usb_clear_halt) Copyright (C) 2009 Julien BLACHE (libusb-1.0) Copyright (C) 2011 Reinhold Kainhofer (sanei_usb_set_endpoint) This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. This file provides a generic USB interface. */ #include "../include/sane/config.h" #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_RESMGR #include #endif #ifdef HAVE_LIBUSB #include #endif /* HAVE_LIBUSB */ #ifdef HAVE_LIBUSB_1_0 #include #endif /* HAVE_LIBUSB_1_0 */ #ifdef HAVE_USBCALLS #include #include #include #define MAX_RW 64000 static int usbcalls_timeout = 30 * 1000; /* 30 seconds */ USBHANDLE dh; PHEV pUsbIrqStartHev=NULL; static struct usb_descriptor_header * GetNextDescriptor( struct usb_descriptor_header *currHead, UCHAR *lastBytePtr) { UCHAR *currBytePtr, *nextBytePtr; if (!currHead->bLength) return (NULL); currBytePtr=(UCHAR *)currHead; nextBytePtr=currBytePtr+currHead->bLength; if (nextBytePtr>=lastBytePtr) return (NULL); return ((struct usb_descriptor_header*)nextBytePtr); } #endif /* HAVE_USBCALLS */ #if defined (__FreeBSD__) #include #endif /* __FreeBSD__ */ #if defined (__DragonFly__) #include #endif #define BACKEND_NAME sanei_usb #include "../include/sane/sane.h" #include "../include/sane/sanei_debug.h" #include "../include/sane/sanei_usb.h" #include "../include/sane/sanei_config.h" typedef enum { sanei_usb_method_scanner_driver = 0, /* kernel scanner driver (Linux, BSD) */ sanei_usb_method_libusb, sanei_usb_method_usbcalls } sanei_usb_access_method_type; typedef struct { SANE_Bool open; sanei_usb_access_method_type method; int fd; SANE_String devname; SANE_Int vendor; SANE_Int product; SANE_Int bulk_in_ep; SANE_Int bulk_out_ep; SANE_Int iso_in_ep; SANE_Int iso_out_ep; SANE_Int int_in_ep; SANE_Int int_out_ep; SANE_Int control_in_ep; SANE_Int control_out_ep; SANE_Int interface_nr; SANE_Int missing; #ifdef HAVE_LIBUSB usb_dev_handle *libusb_handle; struct usb_device *libusb_device; #endif /* HAVE_LIBUSB */ #ifdef HAVE_LIBUSB_1_0 libusb_device *lu_device; libusb_device_handle *lu_handle; #endif /* HAVE_LIBUSB_1_0 */ } device_list_type; /** * total number of devices that can be found at the same time */ #define MAX_DEVICES 100 /** * per-device information, using the functions' parameters dn as index */ static device_list_type devices[MAX_DEVICES]; /** * total number of detected devices in devices array */ static int device_number=0; #if defined(HAVE_LIBUSB) || defined(HAVE_LIBUSB_1_0) static int libusb_timeout = 30 * 1000; /* 30 seconds */ #endif /* HAVE_LIBUSB */ #ifdef HAVE_LIBUSB_1_0 static libusb_context *sanei_usb_ctx; #endif /* HAVE_LIBUSB_1_0 */ #if defined (__linux__) /* From /usr/src/linux/driver/usb/scanner.h */ #define SCANNER_IOCTL_VENDOR _IOR('U', 0x20, int) #define SCANNER_IOCTL_PRODUCT _IOR('U', 0x21, int) #define SCANNER_IOCTL_CTRLMSG _IOWR('U', 0x22, devrequest) /* Older (unofficial) IOCTL numbers for Linux < v2.4.13 */ #define SCANNER_IOCTL_VENDOR_OLD _IOR('u', 0xa0, int) #define SCANNER_IOCTL_PRODUCT_OLD _IOR('u', 0xa1, int) /* From /usr/src/linux/include/linux/usb.h */ typedef struct { unsigned char requesttype; unsigned char request; unsigned short value; unsigned short index; unsigned short length; } devrequest; /* From /usr/src/linux/driver/usb/scanner.h */ struct ctrlmsg_ioctl { devrequest req; void *data; } cmsg; #elif defined(__BEOS__) #include #include #endif /* __linux__ */ /* Debug level from sanei_init_debug */ static SANE_Int debug_level; static void print_buffer (const SANE_Byte * buffer, SANE_Int size) { #define NUM_COLUMNS 16 #define PRINT_BUFFER_SIZE (4 + NUM_COLUMNS * (3 + 1) + 1 + 1) char line_str[PRINT_BUFFER_SIZE]; char *pp; int column; int line; memset (line_str, 0, PRINT_BUFFER_SIZE); for (line = 0; line < ((size + NUM_COLUMNS - 1) / NUM_COLUMNS); line++) { pp = line_str; sprintf (pp, "%03X ", line * NUM_COLUMNS); pp += 4; for (column = 0; column < NUM_COLUMNS; column++) { if ((line * NUM_COLUMNS + column) < size) sprintf (pp, "%02X ", buffer[line * NUM_COLUMNS + column]); else sprintf (pp, " "); pp += 3; } for (column = 0; column < NUM_COLUMNS; column++) { if ((line * NUM_COLUMNS + column) < size) sprintf (pp, "%c", (buffer[line * NUM_COLUMNS + column] < 127) && (buffer[line * NUM_COLUMNS + column] > 31) ? buffer[line * NUM_COLUMNS + column] : '.'); else sprintf (pp, " "); pp += 1; } DBG (11, "%s\n", line_str); } } static void kernel_get_vendor_product (int fd, const char *name, int *vendorID, int *productID) { #if defined (__linux__) /* read the vendor and product IDs via the IOCTLs */ if (ioctl (fd, SCANNER_IOCTL_VENDOR, vendorID) == -1) { if (ioctl (fd, SCANNER_IOCTL_VENDOR_OLD, vendorID) == -1) DBG (3, "kernel_get_vendor_product: ioctl (vendor) " "of device %s failed: %s\n", name, strerror (errno)); } if (ioctl (fd, SCANNER_IOCTL_PRODUCT, productID) == -1) { if (ioctl (fd, SCANNER_IOCTL_PRODUCT_OLD, productID) == -1) DBG (3, "sanei_usb_get_vendor_product: ioctl (product) " "of device %s failed: %s\n", name, strerror (errno)); } #elif defined(__BEOS__) { uint16 vendor, product; if (ioctl (fd, B_SCANNER_IOCTL_VENDOR, &vendor) != B_OK) DBG (3, "kernel_get_vendor_product: ioctl (vendor) " "of device %d failed: %s\n", fd, strerror (errno)); if (ioctl (fd, B_SCANNER_IOCTL_PRODUCT, &product) != B_OK) DBG (3, "sanei_usb_get_vendor_product: ioctl (product) " "of device %d failed: %s\n", fd, strerror (errno)); /* copy from 16 to 32 bit value */ *vendorID = vendor; *productID = product; } #elif defined (__FreeBSD__) || defined (__DragonFly__) { int controller; int ctrl_fd; char buf[40]; int dev; for (controller = 0; ; controller++ ) { snprintf (buf, sizeof (buf) - 1, "/dev/usb%d", controller); ctrl_fd = open (buf, O_RDWR); /* If we can not open the usb controller device, treat it as the end of controller devices */ if (ctrl_fd < 0) break; /* Search for the scanner device on this bus */ for (dev = 1; dev < USB_MAX_DEVICES; dev++) { struct usb_device_info devInfo; devInfo.udi_addr = dev; if (ioctl (ctrl_fd, USB_DEVICEINFO, &devInfo) == -1) break; /* Treat this as the end of devices for this controller */ snprintf (buf, sizeof (buf), "/dev/%s", devInfo.udi_devnames[0]); if (strncmp (buf, name, sizeof (buf)) == 0) { *vendorID = (int) devInfo.udi_vendorNo; *productID = (int) devInfo.udi_productNo; close (ctrl_fd); return; } } close (ctrl_fd); } DBG (3, "kernel_get_vendor_product: Could not retrieve " "vendor/product ID from device %s\n", name); } #endif /* defined (__linux__), defined(__BEOS__), ... */ /* put more os-dependant stuff ... */ } /** * store the given device in device list if it isn't already * in it * @param device device to store if new */ static void store_device (device_list_type device) { int i = 0; int pos = -1; /* if there are already some devices present, check against * them and leave if an equal one is found */ for (i = 0; i < device_number; i++) { if (devices[i].method == device.method && !strcmp (devices[i].devname, device.devname) && devices[i].vendor == device.vendor && devices[i].product == device.product) { /* * Need to update the LibUSB device pointer, since it might * have changed after the latest USB scan. */ #ifdef HAVE_LIBUSB devices[i].libusb_device = device.libusb_device; #endif #ifdef HAVE_LIBUSB_1_0 devices[i].lu_device = device.lu_device; #endif devices[i].missing=0; DBG (3, "store_device: not storing device %s\n", device.devname); return; } if (devices[i].missing >= 2) pos = i; } if(pos > -1){ DBG (3, "store_device: overwrite dn %d with %s\n", pos, device.devname); } else{ if(device_number >= MAX_DEVICES){ DBG (3, "store_device: no room for %s\n", device.devname); return; } pos = device_number; device_number++; DBG (3, "store_device: add dn %d with %s\n", pos, device.devname); } memcpy (&(devices[pos]), &device, sizeof (device)); devices[pos].open = SANE_FALSE; } #ifdef HAVE_LIBUSB_1_0 static char * sanei_libusb_strerror (int errcode) { /* Error codes & descriptions from the libusb-1.0 documentation */ switch (errcode) { case LIBUSB_SUCCESS: return "Success (no error)"; case LIBUSB_ERROR_IO: return "Input/output error"; case LIBUSB_ERROR_INVALID_PARAM: return "Invalid parameter"; case LIBUSB_ERROR_ACCESS: return "Access denied (insufficient permissions)"; case LIBUSB_ERROR_NO_DEVICE: return "No such device (it may have been disconnected)"; case LIBUSB_ERROR_NOT_FOUND: return "Entity not found"; case LIBUSB_ERROR_BUSY: return "Resource busy"; case LIBUSB_ERROR_TIMEOUT: return "Operation timed out"; case LIBUSB_ERROR_OVERFLOW: return "Overflow"; case LIBUSB_ERROR_PIPE: return "Pipe error"; case LIBUSB_ERROR_INTERRUPTED: return "System call interrupted (perhaps due to signal)"; case LIBUSB_ERROR_NO_MEM: return "Insufficient memory"; case LIBUSB_ERROR_NOT_SUPPORTED: return "Operation not supported or unimplemented on this platform"; case LIBUSB_ERROR_OTHER: return "Other error"; default: return "Unknown libusb-1.0 error code"; } return "Unknown libusb-1.0 error code"; } #endif /* HAVE_LIBUSB_1_0 */ void sanei_usb_init (void) { SANE_String *prefix; SANE_String prefixlist[] = { #if defined(__linux__) "/dev/", "usbscanner", "/dev/usb/", "scanner", #elif defined(__FreeBSD__) || defined(__NetBSD__) || defined (__OpenBSD__) || defined (__DragonFly__) "/dev/", "uscanner", #elif defined(__BEOS__) "/dev/scanner/usb/", "", #endif 0, 0 }; SANE_Int vendor, product; SANE_Char devname[1024]; int fd; int i; device_list_type device; #ifdef HAVE_LIBUSB struct usb_bus *bus; struct usb_device *dev; #endif /* HAVE_LIBUSB */ #ifdef HAVE_LIBUSB_1_0 libusb_device **devlist; ssize_t ndev; libusb_device *dev; libusb_device_handle *hdl; struct libusb_device_descriptor desc; struct libusb_config_descriptor *config0; unsigned short vid, pid; unsigned char busno, address; int config; int interface; int ret; #endif /* HAVE_LIBUSB_1_0 */ DBG_INIT (); #ifdef DBG_LEVEL debug_level = DBG_LEVEL; #else debug_level = 0; #endif /* if no device yet, clean up memory */ if(device_number==0) memset (devices, 0, sizeof (devices)); DBG (4, "sanei_usb_init: marking existing devices\n"); for (i = 0; i < device_number; i++) { devices[i].missing++; } DBG (4, "sanei_usb_init: Looking for kernel scanner devices\n"); /* Check for devices using the kernel scanner driver */ for (prefix = prefixlist; *prefix; prefix += 2) { SANE_String dir_name = *prefix; SANE_String base_name = *(prefix + 1); struct stat stat_buf; DIR *dir; struct dirent *dir_entry; if (stat (dir_name, &stat_buf) < 0) { DBG (5, "sanei_usb_init: can't stat %s: %s\n", dir_name, strerror (errno)); continue; } if (!S_ISDIR (stat_buf.st_mode)) { DBG (5, "sanei_usb_init: %s is not a directory\n", dir_name); continue; } if ((dir = opendir (dir_name)) == 0) { DBG (5, "sanei_usb_init: cannot read directory %s: %s\n", dir_name, strerror (errno)); continue; } while ((dir_entry = readdir (dir)) != 0) { /* skip standard dir entries */ if (strcmp (dir_entry->d_name, ".") == 0 || strcmp (dir_entry->d_name, "..") == 0) continue; if (strncmp (base_name, dir_entry->d_name, strlen (base_name)) == 0) { if (strlen (dir_name) + strlen (dir_entry->d_name) + 1 > sizeof (devname)) continue; sprintf (devname, "%s%s", dir_name, dir_entry->d_name); fd = -1; #ifdef HAVE_RESMGR fd = rsm_open_device (devname, O_RDWR); #endif if (fd == -1) fd = open (devname, O_RDWR); if (fd < 0) { DBG (5, "sanei_usb_init: couldn't open %s: %s\n", devname, strerror (errno)); continue; } vendor = -1; product = -1; kernel_get_vendor_product (fd, devname, &vendor, &product); close (fd); memset (&device, 0, sizeof (device)); device.devname = strdup (devname); if (!device.devname) { closedir (dir); return; } device.vendor = vendor; device.product = product; device.method = sanei_usb_method_scanner_driver; DBG (4, "sanei_usb_init: found kernel scanner device (0x%04x/0x%04x) at %s\n", vendor, product, devname); store_device(device); } } closedir (dir); } /* Check for devices using (old) libusb */ #ifdef HAVE_LIBUSB DBG (4, "sanei_usb_init: Looking for libusb devices\n"); usb_init (); #ifdef DBG_LEVEL if (DBG_LEVEL > 4) usb_set_debug (255); #endif /* DBG_LEVEL */ usb_find_busses (); usb_find_devices (); /* Check for the matching device */ for (bus = usb_get_busses (); bus; bus = bus->next) { for (dev = bus->devices; dev; dev = dev->next) { int interface; SANE_Bool found = SANE_FALSE; if (!dev->config) { DBG (1, "sanei_usb_init: device 0x%04x/0x%04x is not configured\n", dev->descriptor.idVendor, dev->descriptor.idProduct); continue; } if (dev->descriptor.idVendor == 0 || dev->descriptor.idProduct == 0) { DBG (5, "sanei_usb_init: device 0x%04x/0x%04x looks like a root hub\n", dev->descriptor.idVendor, dev->descriptor.idProduct); continue; } for (interface = 0; interface < dev->config[0].bNumInterfaces && !found; interface++) { switch (dev->descriptor.bDeviceClass) { case USB_CLASS_VENDOR_SPEC: found = SANE_TRUE; break; case USB_CLASS_PER_INTERFACE: if (dev->config[0].interface[interface].num_altsetting == 0 || !dev->config[0].interface[interface].altsetting) { DBG (1, "sanei_usb_init: device 0x%04x/0x%04x doesn't " "have an altsetting for interface %d\n", dev->descriptor.idVendor, dev->descriptor.idProduct, interface); continue; } switch (dev->config[0].interface[interface].altsetting[0]. bInterfaceClass) { case USB_CLASS_VENDOR_SPEC: case USB_CLASS_PER_INTERFACE: case 6: /* imaging? */ case 16: /* data? */ found = SANE_TRUE; break; } break; } if (!found) DBG (5, "sanei_usb_init: device 0x%04x/0x%04x, interface %d " "doesn't look like a " "scanner (%d/%d)\n", dev->descriptor.idVendor, dev->descriptor.idProduct, interface, dev->descriptor.bDeviceClass, dev->config[0].interface[interface].altsetting != 0 ? dev->config[0].interface[interface].altsetting[0]. bInterfaceClass : -1); } interface--; if (!found) { DBG (5, "sanei_usb_init: device 0x%04x/0x%04x: no suitable interfaces\n", dev->descriptor.idVendor, dev->descriptor.idProduct); continue; } memset (&device, 0, sizeof (device)); device.libusb_device = dev; snprintf (devname, sizeof (devname), "libusb:%s:%s", dev->bus->dirname, dev->filename); device.devname = strdup (devname); if (!device.devname) return; device.vendor = dev->descriptor.idVendor; device.product = dev->descriptor.idProduct; device.method = sanei_usb_method_libusb; device.interface_nr = interface; DBG (4, "sanei_usb_init: found libusb device (0x%04x/0x%04x) interface " "%d at %s\n", dev->descriptor.idVendor, dev->descriptor.idProduct, interface, devname); store_device(device); } } #endif /* HAVE_LIBUSB */ /* Check for devices using libusb-1.0 */ #ifdef HAVE_LIBUSB_1_0 if (!sanei_usb_ctx) { DBG (4, "sanei_usb_init: initializing libusb-1.0\n"); ret = libusb_init (&sanei_usb_ctx); if (ret < 0) { DBG (1, "sanei_usb_init: failed to initialize libusb-1.0, error %d\n", ret); goto failed_libusb_1_0; } #ifdef DBG_LEVEL if (DBG_LEVEL > 4) libusb_set_debug (sanei_usb_ctx, 3); #endif /* DBG_LEVEL */ } DBG (4, "sanei_usb_init: Looking for libusb-1.0 devices\n"); ndev = libusb_get_device_list (sanei_usb_ctx, &devlist); if (ndev < 0) { DBG (1, "sanei_usb_init: failed to get libusb-1.0 device list, error %d\n", (int) ndev); goto failed_libusb_1_0; } for (i = 0; i < ndev; i++) { SANE_Bool found = SANE_FALSE; dev = devlist[i]; busno = libusb_get_bus_number (dev); address = libusb_get_device_address (dev); ret = libusb_get_device_descriptor (dev, &desc); if (ret < 0) { DBG (1, "sanei_usb_init: could not get device descriptor for device at %03d:%03d (err %d)\n", busno, address, ret); continue; } vid = desc.idVendor; pid = desc.idProduct; if ((vid == 0) || (pid == 0)) { DBG (5, "sanei_usb_init: device 0x%04x/0x%04x at %03d:%03d looks like a root hub\n", vid, pid, busno, address); continue; } ret = libusb_open (dev, &hdl); if (ret < 0) { DBG (1, "sanei_usb_init: skipping device 0x%04x/0x%04x at %03d:%03d: cannot open: %s\n", vid, pid, busno, address, sanei_libusb_strerror (ret)); continue; } ret = libusb_get_configuration (hdl, &config); libusb_close (hdl); if (ret < 0) { DBG (1, "sanei_usb_init: could not get configuration for device 0x%04x/0x%04x at %03d:%03d (err %d)\n", vid, pid, busno, address, ret); continue; } if (config == 0) { DBG (1, "sanei_usb_init: device 0x%04x/0x%04x at %03d:%03d is not configured\n", vid, pid, busno, address); continue; } ret = libusb_get_config_descriptor (dev, 0, &config0); if (ret < 0) { DBG (1, "sanei_usb_init: could not get config[0] descriptor for device 0x%04x/0x%04x at %03d:%03d (err %d)\n", vid, pid, busno, address, ret); continue; } for (interface = 0; (interface < config0->bNumInterfaces) && !found; interface++) { switch (desc.bDeviceClass) { case LIBUSB_CLASS_VENDOR_SPEC: found = SANE_TRUE; break; case LIBUSB_CLASS_PER_INTERFACE: if ((config0->interface[interface].num_altsetting == 0) || !config0->interface[interface].altsetting) { DBG (1, "sanei_usb_init: device 0x%04x/0x%04x doesn't " "have an altsetting for interface %d\n", vid, pid, interface); continue; } switch (config0->interface[interface].altsetting[0].bInterfaceClass) { case LIBUSB_CLASS_VENDOR_SPEC: case LIBUSB_CLASS_PER_INTERFACE: case LIBUSB_CLASS_PTP: case 16: /* data? */ found = SANE_TRUE; break; } break; } if (!found) DBG (5, "sanei_usb_init: device 0x%04x/0x%04x, interface %d " "doesn't look like a scanner (%d/%d)\n", vid, pid, interface, desc.bDeviceClass, (config0->interface[interface].altsetting != 0) ? config0->interface[interface].altsetting[0].bInterfaceClass : -1); } libusb_free_config_descriptor (config0); interface--; if (!found) { DBG (5, "sanei_usb_init: device 0x%04x/0x%04x at %03d:%03d: no suitable interfaces\n", vid, pid, busno, address); continue; } memset (&device, 0, sizeof (device)); device.lu_device = libusb_ref_device(dev); snprintf (devname, sizeof (devname), "libusb:%03d:%03d", busno, address); device.devname = strdup (devname); if (!device.devname) return; device.vendor = vid; device.product = pid; device.method = sanei_usb_method_libusb; device.interface_nr = interface; DBG (4, "sanei_usb_init: found libusb-1.0 device (0x%04x/0x%04x) interface " "%d at %s\n", vid, pid, interface, devname); store_device (device); } libusb_free_device_list (devlist, 1); failed_libusb_1_0: /* libusb 1.0 failed to initialize */ #endif /* HAVE_LIBUSB_1_0 */ #if !defined(HAVE_LIBUSB) && !defined(HAVE_LIBUSB_1_0) DBG (4, "sanei_usb_init: SANE is built without support for libusb\n"); #endif #ifdef HAVE_USBCALLS /* Check for devices using OS/2 USBCALLS Interface */ CHAR ucData[2048]; struct usb_device_descriptor *pDevDesc; struct usb_config_descriptor *pCfgDesc; struct usb_interface_descriptor *intf; struct usb_endpoint_descriptor *ep; struct usb_descriptor_header *pDescHead; APIRET rc; ULONG ulNumDev, ulDev, ulBufLen; ulBufLen = sizeof(ucData); memset(&ucData,0,sizeof(ucData)); rc = UsbQueryNumberDevices( &ulNumDev); if(rc==0 && ulNumDev) { for (ulDev=1; ulDev<=ulNumDev; ulDev++) { rc = UsbQueryDeviceReport( ulDev, &ulBufLen, ucData); pDevDesc = (struct usb_device_descriptor*)ucData; pCfgDesc = (struct usb_config_descriptor*) (ucData+sizeof(struct usb_device_descriptor)); int interface=0; SANE_Bool found; if (!pCfgDesc->bConfigurationValue) { DBG (1, "sanei_usb_init: device 0x%04x/0x%04x is not configured\n", pDevDesc->idVendor, pDevDesc->idProduct); continue; } if (pDevDesc->idVendor == 0 || pDevDesc->idProduct == 0) { DBG (5, "sanei_usb_init: device 0x%04x/0x%04x looks like a root hub\n", pDevDesc->idVendor, pDevDesc->idProduct); continue; } found = SANE_FALSE; if (pDevDesc->bDeviceClass == USB_CLASS_VENDOR_SPEC) { found = SANE_TRUE; } if (!found) { DBG (5, "sanei_usb_init: device 0x%04x/0x%04x: no suitable interfaces\n", pDevDesc->idVendor, pDevDesc->idProduct); continue; } snprintf (devname, sizeof (devname), "usbcalls:%d", ulDev); memset (&device, 0, sizeof (device)); device.devname = strdup (devname); device.fd = ulDev; /* store usbcalls device number */ device.vendor = pDevDesc->idVendor; device.product = pDevDesc->idProduct; device.method = sanei_usb_method_usbcalls; device.interface_nr = interface; DBG (4, "sanei_usb_init: found usbcalls device (0x%04x/0x%04x) as device number %s\n", pDevDesc->idVendor, pDevDesc->idProduct,device.devname); store_device(device); } } #endif /* HAVE_USBCALLS */ DBG (5, "sanei_usb_init: found %d devices\n", device_number); if (debug_level > 5) { for (i = 0; i < device_number; i++) { if(devices[i].missing) continue; DBG (6, "sanei_usb_init: device %02d is %s\n", i, devices[i].devname); } } } /* This logically belongs to sanei_config.c but not every backend that uses sanei_config() wants to depend on sanei_usb. */ void sanei_usb_attach_matching_devices (const char *name, SANE_Status (*attach) (const char *dev)) { char *vendor, *product; if (strncmp (name, "usb", 3) == 0) { SANE_Word vendorID = 0, productID = 0; name += 3; name = sanei_config_skip_whitespace (name); if (*name) { name = sanei_config_get_string (name, &vendor); if (vendor) { vendorID = strtol (vendor, 0, 0); free (vendor); } name = sanei_config_skip_whitespace (name); } name = sanei_config_skip_whitespace (name); if (*name) { name = sanei_config_get_string (name, &product); if (product) { productID = strtol (product, 0, 0); free (product); } } sanei_usb_find_devices (vendorID, productID, attach); } else (*attach) (name); } SANE_Status sanei_usb_get_vendor_product_byname (SANE_String_Const devname, SANE_Word * vendor, SANE_Word * product) { int i; SANE_Bool found = SANE_FALSE; for (i = 0; i < device_number && devices[i].devname; i++) { if(devices[i].missing) continue; if (strcmp (devices[i].devname, devname) == 0) { found = SANE_TRUE; break; } } if (!found) { DBG (1, "sanei_usb_get_vendor_product_byname: can't find device `%s' in list\n", devname); return SANE_STATUS_INVAL; } if ((devices[i].vendor == 0) && (devices[i].product == 0)) { DBG (1, "sanei_usb_get_vendor_product_byname: not support for this method\n"); return SANE_STATUS_UNSUPPORTED; } if (vendor) *vendor = devices[i].vendor; if (product) *product = devices[i].product; return SANE_STATUS_GOOD; } SANE_Status sanei_usb_get_vendor_product (SANE_Int dn, SANE_Word * vendor, SANE_Word * product) { SANE_Word vendorID = 0; SANE_Word productID = 0; if (dn >= device_number || dn < 0) { DBG (1, "sanei_usb_get_vendor_product: dn >= device number || dn < 0\n"); return SANE_STATUS_INVAL; } if (devices[dn].method == sanei_usb_method_scanner_driver) kernel_get_vendor_product (devices[dn].fd, devices[dn].devname, &vendorID, &productID); else if (devices[dn].method == sanei_usb_method_libusb) { #ifdef HAVE_LIBUSB vendorID = usb_device (devices[dn].libusb_handle)->descriptor.idVendor; productID = usb_device (devices[dn].libusb_handle)->descriptor.idProduct; #elif defined(HAVE_LIBUSB_1_0) vendorID = devices[dn].vendor; productID = devices[dn].product; #else DBG (1, "sanei_usb_get_vendor_product: libusb support missing\n"); return SANE_STATUS_UNSUPPORTED; #endif /* HAVE_LIBUSB */ } else if (devices[dn].method == sanei_usb_method_usbcalls) { #ifdef HAVE_USBCALLS vendorID = devices[dn].vendor; productID = devices[dn].product; #else DBG (1, "sanei_usb_get_vendor_product: usbcalls support missing\n"); return SANE_STATUS_UNSUPPORTED; #endif /* HAVE_USBCALLS */ } else { DBG (1, "sanei_usb_get_vendor_product: access method %d not " "implemented\n", devices[dn].method); return SANE_STATUS_INVAL; } if (vendor) *vendor = vendorID; if (product) *product = productID; if (!vendorID || !productID) { DBG (3, "sanei_usb_get_vendor_product: device %d: Your OS doesn't " "seem to support detection of vendor+product ids\n", dn); return SANE_STATUS_UNSUPPORTED; } else { DBG (3, "sanei_usb_get_vendor_product: device %d: vendorID: 0x%04x, " "productID: 0x%04x\n", dn, vendorID, productID); return SANE_STATUS_GOOD; } } SANE_Status sanei_usb_find_devices (SANE_Int vendor, SANE_Int product, SANE_Status (*attach) (SANE_String_Const dev)) { SANE_Int dn = 0; DBG (3, "sanei_usb_find_devices: vendor=0x%04x, product=0x%04x\n", vendor, product); while (devices[dn].devname && dn < device_number) { if (devices[dn].vendor == vendor && devices[dn].product == product && !devices[dn].missing && attach) attach (devices[dn].devname); dn++; } return SANE_STATUS_GOOD; } void sanei_usb_set_endpoint (SANE_Int dn, SANE_Int ep_type, SANE_Int ep) { if (dn >= device_number || dn < 0) { DBG (1, "sanei_usb_set_endpoint: dn >= device number || dn < 0\n"); return; } DBG (5, "sanei_usb_set_endpoint: Setting endpoint of type 0x%02x to 0x%02x\n", ep_type, ep); switch (ep_type) { case USB_DIR_IN|USB_ENDPOINT_TYPE_BULK: devices[dn].bulk_in_ep = ep; break; case USB_DIR_OUT|USB_ENDPOINT_TYPE_BULK: devices[dn].bulk_out_ep = ep; break; case USB_DIR_IN|USB_ENDPOINT_TYPE_ISOCHRONOUS: devices[dn].iso_in_ep = ep; break; case USB_DIR_OUT|USB_ENDPOINT_TYPE_ISOCHRONOUS: devices[dn].iso_out_ep = ep; break; case USB_DIR_IN|USB_ENDPOINT_TYPE_INTERRUPT: devices[dn].int_in_ep = ep; break; case USB_DIR_OUT|USB_ENDPOINT_TYPE_INTERRUPT: devices[dn].int_out_ep = ep; break; case USB_DIR_IN|USB_ENDPOINT_TYPE_CONTROL: devices[dn].control_in_ep = ep; break; case USB_DIR_OUT|USB_ENDPOINT_TYPE_CONTROL: devices[dn].control_out_ep = ep; break; } } SANE_Int sanei_usb_get_endpoint (SANE_Int dn, SANE_Int ep_type) { if (dn >= device_number || dn < 0) { DBG (1, "sanei_usb_get_endpoint: dn >= device number || dn < 0\n"); return 0; } switch (ep_type) { case USB_DIR_IN|USB_ENDPOINT_TYPE_BULK: return devices[dn].bulk_in_ep; case USB_DIR_OUT|USB_ENDPOINT_TYPE_BULK: return devices[dn].bulk_out_ep; case USB_DIR_IN|USB_ENDPOINT_TYPE_ISOCHRONOUS: return devices[dn].iso_in_ep; case USB_DIR_OUT|USB_ENDPOINT_TYPE_ISOCHRONOUS: return devices[dn].iso_out_ep; case USB_DIR_IN|USB_ENDPOINT_TYPE_INTERRUPT: return devices[dn].int_in_ep; case USB_DIR_OUT|USB_ENDPOINT_TYPE_INTERRUPT: return devices[dn].int_out_ep; case USB_DIR_IN|USB_ENDPOINT_TYPE_CONTROL: return devices[dn].control_in_ep; case USB_DIR_OUT|USB_ENDPOINT_TYPE_CONTROL: return devices[dn].control_out_ep; default: return 0; } } SANE_Status sanei_usb_open (SANE_String_Const devname, SANE_Int * dn) { int devcount; SANE_Bool found = SANE_FALSE; int c, i, a; DBG (5, "sanei_usb_open: trying to open device `%s'\n", devname); if (!dn) { DBG (1, "sanei_usb_open: can't open `%s': dn == NULL\n", devname); return SANE_STATUS_INVAL; } for (devcount = 0; devcount < device_number && devices[devcount].devname != 0; devcount++) { if(devices[devcount].missing) continue; if (strcmp (devices[devcount].devname, devname) == 0) { if (devices[devcount].open) { DBG (1, "sanei_usb_open: device `%s' already open\n", devname); return SANE_STATUS_INVAL; } found = SANE_TRUE; break; } } if (!found) { DBG (1, "sanei_usb_open: can't find device `%s' in list\n", devname); return SANE_STATUS_INVAL; } if (devices[devcount].method == sanei_usb_method_libusb) { #ifdef HAVE_LIBUSB struct usb_device *dev; struct usb_interface_descriptor *interface; int result, num; devices[devcount].libusb_handle = usb_open (devices[devcount].libusb_device); if (!devices[devcount].libusb_handle) { SANE_Status status = SANE_STATUS_INVAL; DBG (1, "sanei_usb_open: can't open device `%s': %s\n", devname, strerror (errno)); if (errno == EPERM) { DBG (1, "Make sure you run as root or set appropriate " "permissions\n"); status = SANE_STATUS_ACCESS_DENIED; } else if (errno == EBUSY) { DBG (1, "Maybe the kernel scanner driver claims the " "scanner's interface?\n"); status = SANE_STATUS_DEVICE_BUSY; } return status; } dev = usb_device (devices[devcount].libusb_handle); /* Set the configuration */ if (!dev->config) { DBG (1, "sanei_usb_open: device `%s' not configured?\n", devname); return SANE_STATUS_INVAL; } if (dev->descriptor.bNumConfigurations > 1) { DBG (3, "sanei_usb_open: more than one " "configuration (%d), choosing first config (%d)\n", dev->descriptor.bNumConfigurations, dev->config[0].bConfigurationValue); } result = usb_set_configuration (devices[devcount].libusb_handle, dev->config[0].bConfigurationValue); if (result < 0) { SANE_Status status = SANE_STATUS_INVAL; DBG (1, "sanei_usb_open: libusb complained: %s\n", usb_strerror ()); if (errno == EPERM) { DBG (1, "Make sure you run as root or set appropriate " "permissions\n"); status = SANE_STATUS_ACCESS_DENIED; } else if (errno == EBUSY) { DBG (3, "Maybe the kernel scanner driver or usblp claims the " "interface? Ignoring this error...\n"); status = SANE_STATUS_GOOD; } if (status != SANE_STATUS_GOOD) { usb_close (devices[devcount].libusb_handle); return status; } } /* Claim the interface */ result = usb_claim_interface (devices[devcount].libusb_handle, devices[devcount].interface_nr); if (result < 0) { SANE_Status status = SANE_STATUS_INVAL; DBG (1, "sanei_usb_open: libusb complained: %s\n", usb_strerror ()); if (errno == EPERM) { DBG (1, "Make sure you run as root or set appropriate " "permissions\n"); status = SANE_STATUS_ACCESS_DENIED; } else if (errno == EBUSY) { DBG (1, "Maybe the kernel scanner driver claims the " "scanner's interface?\n"); status = SANE_STATUS_DEVICE_BUSY; } usb_close (devices[devcount].libusb_handle); return status; } /* Loop through all of the configurations */ for (c = 0; c < dev->descriptor.bNumConfigurations; c++) { /* Loop through all of the interfaces */ for (i = 0; i < dev->config[c].bNumInterfaces; i++) { /* Loop through all of the alternate settings */ for (a = 0; a < dev->config[c].interface[i].num_altsetting; a++) { DBG (5, "sanei_usb_open: configuration nr: %d\n", c); DBG (5, "sanei_usb_open: interface nr: %d\n", i); DBG (5, "sanei_usb_open: alt_setting nr: %d\n", a); /* Start by interfaces found in sanei_usb_init */ if (c == 0 && i != devices[devcount].interface_nr) { DBG (5, "sanei_usb_open: interface %d not detected as " "a scanner by sanei_usb_init, ignoring.\n", i); continue; } interface = &dev->config[c].interface[i].altsetting[a]; /* Now we look for usable endpoints */ for (num = 0; num < interface->bNumEndpoints; num++) { struct usb_endpoint_descriptor *endpoint; int address, direction, transfer_type; endpoint = &interface->endpoint[num]; DBG (5, "sanei_usb_open: endpoint nr: %d\n", num); transfer_type = endpoint->bmAttributes & USB_ENDPOINT_TYPE_MASK; address = endpoint-> bEndpointAddress & USB_ENDPOINT_ADDRESS_MASK; direction = endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK; DBG (5, "sanei_usb_open: direction: %d\n", direction); transfer_type = endpoint->bmAttributes & USB_ENDPOINT_TYPE_MASK; DBG (5, "sanei_usb_open: address: %d transfertype: %d\n", address, transfer_type); /* save the endpoints we need later */ if (transfer_type == USB_ENDPOINT_TYPE_INTERRUPT) { DBG (5, "sanei_usb_open: found interrupt-%s endpoint (address 0x%02x)\n", direction ? "in" : "out", address); if (direction) /* in */ { if (devices[devcount].int_in_ep) DBG (3, "sanei_usb_open: we already have a int-in endpoint " "(address: 0x%02x), ignoring the new one\n", devices[devcount].int_in_ep); else devices[devcount].int_in_ep = endpoint->bEndpointAddress; } else { if (devices[devcount].int_out_ep) DBG (3, "sanei_usb_open: we already have a int-out endpoint " "(address: 0x%02x), ignoring the new one\n", devices[devcount].int_out_ep); else devices[devcount].int_out_ep = endpoint->bEndpointAddress; } } else if (transfer_type == USB_ENDPOINT_TYPE_BULK) { DBG (5, "sanei_usb_open: found bulk-%s endpoint (address 0x%02x)\n", direction ? "in" : "out", address); if (direction) /* in */ { if (devices[devcount].bulk_in_ep) DBG (3, "sanei_usb_open: we already have a bulk-in endpoint " "(address: 0x%02x), ignoring the new one\n", devices[devcount].bulk_in_ep); else devices[devcount].bulk_in_ep = endpoint->bEndpointAddress; } else { if (devices[devcount].bulk_out_ep) DBG (3, "sanei_usb_open: we already have a bulk-out endpoint " "(address: 0x%02x), ignoring the new one\n", devices[devcount].bulk_out_ep); else devices[devcount].bulk_out_ep = endpoint->bEndpointAddress; } } else if (transfer_type == USB_ENDPOINT_TYPE_ISOCHRONOUS) { DBG (5, "sanei_usb_open: found isochronous-%s endpoint (address 0x%02x)\n", direction ? "in" : "out", address); if (direction) /* in */ { if (devices[devcount].iso_in_ep) DBG (3, "sanei_usb_open: we already have a isochronous-in endpoint " "(address: 0x%02x), ignoring the new one\n", devices[devcount].iso_in_ep); else devices[devcount].iso_in_ep = endpoint->bEndpointAddress; } else { if (devices[devcount].iso_out_ep) DBG (3, "sanei_usb_open: we already have a isochronous-out endpoint " "(address: 0x%02x), ignoring the new one\n", devices[devcount].iso_out_ep); else devices[devcount].iso_out_ep = endpoint->bEndpointAddress; } } else if (transfer_type == USB_ENDPOINT_TYPE_CONTROL) { DBG (5, "sanei_usb_open: found control-%s endpoint (address 0x%02x)\n", direction ? "in" : "out", address); if (direction) /* in */ { if (devices[devcount].control_in_ep) DBG (3, "sanei_usb_open: we already have a control-in endpoint " "(address: 0x%02x), ignoring the new one\n", devices[devcount].control_in_ep); else devices[devcount].control_in_ep = endpoint->bEndpointAddress; } else { if (devices[devcount].control_out_ep) DBG (3, "sanei_usb_open: we already have a control-out endpoint " "(address: 0x%02x), ignoring the new one\n", devices[devcount].control_out_ep); else devices[devcount].control_out_ep = endpoint->bEndpointAddress; } } } } } } #elif defined(HAVE_LIBUSB_1_0) /* libusb-1.0 */ int config; libusb_device *dev; struct libusb_device_descriptor desc; struct libusb_config_descriptor *config0; int result, num; dev = devices[devcount].lu_device; result = libusb_open (dev, &devices[devcount].lu_handle); if (result < 0) { SANE_Status status = SANE_STATUS_INVAL; DBG (1, "sanei_usb_open: can't open device `%s': %s\n", devname, sanei_libusb_strerror (result)); if (result == LIBUSB_ERROR_ACCESS) { DBG (1, "Make sure you run as root or set appropriate " "permissions\n"); status = SANE_STATUS_ACCESS_DENIED; } else if (result == LIBUSB_ERROR_BUSY) { DBG (1, "Maybe the kernel scanner driver claims the " "scanner's interface?\n"); status = SANE_STATUS_DEVICE_BUSY; } else if (result == LIBUSB_ERROR_NO_MEM) { status = SANE_STATUS_NO_MEM; } return status; } result = libusb_get_configuration (devices[devcount].lu_handle, &config); if (result < 0) { DBG (1, "sanei_usb_open: could not get configuration for device `%s' (err %d)\n", devname, result); return SANE_STATUS_INVAL; } if (config == 0) { DBG (1, "sanei_usb_open: device `%s' not configured?\n", devname); return SANE_STATUS_INVAL; } result = libusb_get_device_descriptor (dev, &desc); if (result < 0) { DBG (1, "sanei_usb_open: could not get device descriptor for device `%s' (err %d)\n", devname, result); return SANE_STATUS_INVAL; } result = libusb_get_config_descriptor (dev, 0, &config0); if (result < 0) { DBG (1, "sanei_usb_open: could not get config[0] descriptor for device `%s' (err %d)\n", devname, result); return SANE_STATUS_INVAL; } /* Set the configuration */ if (desc.bNumConfigurations > 1) { DBG (3, "sanei_usb_open: more than one " "configuration (%d), choosing first config (%d)\n", desc.bNumConfigurations, config0->bConfigurationValue); } result = libusb_set_configuration (devices[devcount].lu_handle, config0->bConfigurationValue); libusb_free_config_descriptor (config0); if (result < 0) { SANE_Status status = SANE_STATUS_INVAL; DBG (1, "sanei_usb_open: libusb complained: %s\n", sanei_libusb_strerror (result)); if (result == LIBUSB_ERROR_ACCESS) { DBG (1, "Make sure you run as root or set appropriate " "permissions\n"); status = SANE_STATUS_ACCESS_DENIED; } else if (result == LIBUSB_ERROR_BUSY) { DBG (3, "Maybe the kernel scanner driver or usblp claims the " "interface? Ignoring this error...\n"); status = SANE_STATUS_GOOD; } if (status != SANE_STATUS_GOOD) { libusb_close (devices[devcount].lu_handle); return status; } } /* Claim the interface */ result = libusb_claim_interface (devices[devcount].lu_handle, devices[devcount].interface_nr); if (result < 0) { SANE_Status status = SANE_STATUS_INVAL; DBG (1, "sanei_usb_open: libusb complained: %s\n", sanei_libusb_strerror (result)); if (result == LIBUSB_ERROR_ACCESS) { DBG (1, "Make sure you run as root or set appropriate " "permissions\n"); status = SANE_STATUS_ACCESS_DENIED; } else if (result == LIBUSB_ERROR_BUSY) { DBG (1, "Maybe the kernel scanner driver claims the " "scanner's interface?\n"); status = SANE_STATUS_DEVICE_BUSY; } libusb_close (devices[devcount].lu_handle); return status; } /* Loop through all of the configurations */ for (c = 0; c < desc.bNumConfigurations; c++) { struct libusb_config_descriptor *config; result = libusb_get_config_descriptor (dev, c, &config); if (result < 0) { DBG (1, "sanei_usb_open: could not get config[%d] descriptor for device `%s' (err %d)\n", c, devname, result); continue; } /* Loop through all of the interfaces */ for (i = 0; i < config->bNumInterfaces; i++) { /* Loop through all of the alternate settings */ for (a = 0; a < config->interface[i].num_altsetting; a++) { const struct libusb_interface_descriptor *interface; DBG (5, "sanei_usb_open: configuration nr: %d\n", c); DBG (5, "sanei_usb_open: interface nr: %d\n", i); DBG (5, "sanei_usb_open: alt_setting nr: %d\n", a); /* Start by interfaces found in sanei_usb_init */ if (c == 0 && i != devices[devcount].interface_nr) { DBG (5, "sanei_usb_open: interface %d not detected as " "a scanner by sanei_usb_init, ignoring.\n", i); continue; } interface = &config->interface[i].altsetting[a]; /* Now we look for usable endpoints */ for (num = 0; num < interface->bNumEndpoints; num++) { const struct libusb_endpoint_descriptor *endpoint; int address, direction, transfer_type; endpoint = &interface->endpoint[num]; DBG (5, "sanei_usb_open: endpoint nr: %d\n", num); transfer_type = endpoint->bmAttributes & LIBUSB_TRANSFER_TYPE_MASK; address = endpoint->bEndpointAddress & LIBUSB_ENDPOINT_ADDRESS_MASK; direction = endpoint->bEndpointAddress & LIBUSB_ENDPOINT_DIR_MASK; DBG (5, "sanei_usb_open: direction: %d\n", direction); DBG (5, "sanei_usb_open: address: %d transfertype: %d\n", address, transfer_type); /* save the endpoints we need later */ if (transfer_type == LIBUSB_TRANSFER_TYPE_INTERRUPT) { DBG (5, "sanei_usb_open: found interrupt-%s endpoint (address 0x%02x)\n", direction ? "in" : "out", address); if (direction) /* in */ { if (devices[devcount].int_in_ep) DBG (3, "sanei_usb_open: we already have a int-in endpoint " "(address: 0x%02x), ignoring the new one\n", devices[devcount].int_in_ep); else devices[devcount].int_in_ep = endpoint->bEndpointAddress; } else { if (devices[devcount].int_out_ep) DBG (3, "sanei_usb_open: we already have a int-out endpoint " "(address: 0x%02x), ignoring the new one\n", devices[devcount].int_out_ep); else devices[devcount].int_out_ep = endpoint->bEndpointAddress; } } else if (transfer_type == LIBUSB_TRANSFER_TYPE_BULK) { DBG (5, "sanei_usb_open: found bulk-%s endpoint (address 0x%02x)\n", direction ? "in" : "out", address); if (direction) /* in */ { if (devices[devcount].bulk_in_ep) DBG (3, "sanei_usb_open: we already have a bulk-in endpoint " "(address: 0x%02x), ignoring the new one\n", devices[devcount].bulk_in_ep); else devices[devcount].bulk_in_ep = endpoint->bEndpointAddress; } else { if (devices[devcount].bulk_out_ep) DBG (3, "sanei_usb_open: we already have a bulk-out endpoint " "(address: 0x%02x), ignoring the new one\n", devices[devcount].bulk_out_ep); else devices[devcount].bulk_out_ep = endpoint->bEndpointAddress; } } else if (transfer_type == LIBUSB_TRANSFER_TYPE_ISOCHRONOUS) { DBG (5, "sanei_usb_open: found isochronous-%s endpoint (address 0x%02x)\n", direction ? "in" : "out", address); if (direction) /* in */ { if (devices[devcount].iso_in_ep) DBG (3, "sanei_usb_open: we already have a isochronous-in endpoint " "(address: 0x%02x), ignoring the new one\n", devices[devcount].iso_in_ep); else devices[devcount].iso_in_ep = endpoint->bEndpointAddress; } else { if (devices[devcount].iso_out_ep) DBG (3, "sanei_usb_open: we already have a isochronous-out endpoint " "(address: 0x%02x), ignoring the new one\n", devices[devcount].iso_out_ep); else devices[devcount].iso_out_ep = endpoint->bEndpointAddress; } } else if (transfer_type == LIBUSB_TRANSFER_TYPE_CONTROL) { DBG (5, "sanei_usb_open: found control-%s endpoint (address 0x%02x)\n", direction ? "in" : "out", address); if (direction) /* in */ { if (devices[devcount].control_in_ep) DBG (3, "sanei_usb_open: we already have a control-in endpoint " "(address: 0x%02x), ignoring the new one\n", devices[devcount].control_in_ep); else devices[devcount].control_in_ep = endpoint->bEndpointAddress; } else { if (devices[devcount].control_out_ep) DBG (3, "sanei_usb_open: we already have a control-out endpoint " "(address: 0x%02x), ignoring the new one\n", devices[devcount].control_out_ep); else devices[devcount].control_out_ep = endpoint->bEndpointAddress; } } } } } libusb_free_config_descriptor (config); } #else /* not HAVE_LIBUSB && not HAVE_LIBUSB_1_0 */ DBG (1, "sanei_usb_open: can't open device `%s': " "libusb support missing\n", devname); return SANE_STATUS_UNSUPPORTED; #endif /* not HAVE_LIBUSB && not HAVE_LIBUSB_1_0 */ } else if (devices[devcount].method == sanei_usb_method_scanner_driver) { long int flag; /* Using kernel scanner driver */ devices[devcount].fd = -1; #ifdef HAVE_RESMGR devices[devcount].fd = rsm_open_device (devname, O_RDWR); #endif if (devices[devcount].fd == -1) devices[devcount].fd = open (devname, O_RDWR); if (devices[devcount].fd < 0) { SANE_Status status = SANE_STATUS_INVAL; if (errno == EACCES) status = SANE_STATUS_ACCESS_DENIED; else if (errno == ENOENT) { DBG (5, "sanei_usb_open: open of `%s' failed: %s\n", devname, strerror (errno)); return status; } DBG (1, "sanei_usb_open: open of `%s' failed: %s\n", devname, strerror (errno)); return status; } flag = fcntl (devices[devcount].fd, F_GETFD); if (flag >= 0) { if (fcntl (devices[devcount].fd, F_SETFD, flag | FD_CLOEXEC) < 0) DBG (1, "sanei_usb_open: fcntl of `%s' failed: %s\n", devname, strerror (errno)); } } else if (devices[devcount].method == sanei_usb_method_usbcalls) { #ifdef HAVE_USBCALLS CHAR ucData[2048]; struct usb_device_descriptor *pDevDesc; struct usb_config_descriptor *pCfgDesc; struct usb_interface_descriptor *interface; struct usb_endpoint_descriptor *endpoint; struct usb_descriptor_header *pDescHead; ULONG ulBufLen; ulBufLen = sizeof(ucData); memset(&ucData,0,sizeof(ucData)); int result, num,rc; int address, direction, transfer_type; DBG (5, "devname = %s, devcount = %d\n",devices[devcount].devname,devcount); DBG (5, "USBCalls device number to open = %d\n",devices[devcount].fd); DBG (5, "USBCalls Vendor/Product to open = 0x%04x/0x%04x\n", devices[devcount].vendor,devices[devcount].product); rc = UsbOpen (&dh, devices[devcount].vendor, devices[devcount].product, USB_ANY_PRODUCTVERSION, USB_OPEN_FIRST_UNUSED); DBG (1, "sanei_usb_open: UsbOpen rc = %d\n",rc); if (rc!=0) { SANE_Status status = SANE_STATUS_INVAL; DBG (1, "sanei_usb_open: can't open device `%s': %s\n", devname, strerror (rc)); return status; } rc = UsbQueryDeviceReport( devices[devcount].fd, &ulBufLen, ucData); DBG (1, "sanei_usb_open: UsbQueryDeviceReport rc = %d\n",rc); pDevDesc = (struct usb_device_descriptor*)ucData; pCfgDesc = (struct usb_config_descriptor*) (ucData+sizeof(struct usb_device_descriptor)); UCHAR *pCurPtr = (UCHAR*) pCfgDesc; UCHAR *pEndPtr = pCurPtr+ pCfgDesc->wTotalLength; pDescHead = (struct usb_descriptor_header *) (pCurPtr+pCfgDesc->bLength); /* Set the configuration */ if (pDevDesc->bNumConfigurations > 1) { DBG (3, "sanei_usb_open: more than one " "configuration (%d), choosing first config (%d)\n", pDevDesc->bNumConfigurations, pCfgDesc->bConfigurationValue); } DBG (5, "UsbDeviceSetConfiguration parameters: dh = %p, bConfigurationValue = %d\n", dh,pCfgDesc->bConfigurationValue); result = UsbDeviceSetConfiguration (dh, pCfgDesc->bConfigurationValue); DBG (1, "sanei_usb_open: UsbDeviceSetConfiguration rc = %d\n",result); if (result) { SANE_Status status = SANE_STATUS_INVAL; DBG (1, "sanei_usb_open: usbcalls complained on UsbDeviceSetConfiguration, rc= %d\n", result); status = SANE_STATUS_ACCESS_DENIED; UsbClose (dh); return status; } /* Now we look for usable endpoints */ for (pDescHead = (struct usb_descriptor_header *) (pCurPtr+pCfgDesc->bLength); pDescHead;pDescHead = GetNextDescriptor(pDescHead,pEndPtr) ) { switch(pDescHead->bDescriptorType) { case USB_DT_INTERFACE: interface = (struct usb_interface_descriptor *) pDescHead; DBG (5, "Found %d endpoints\n",interface->bNumEndpoints); DBG (5, "bAlternateSetting = %d\n",interface->bAlternateSetting); break; case USB_DT_ENDPOINT: endpoint = (struct usb_endpoint_descriptor*)pDescHead; address = endpoint->bEndpointAddress; direction = endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK; transfer_type = endpoint->bmAttributes & USB_ENDPOINT_TYPE_MASK; /* save the endpoints we need later */ if (transfer_type == USB_ENDPOINT_TYPE_INTERRUPT) { DBG (5, "sanei_usb_open: found interupt-%s endpoint (address %2x)\n", direction ? "in" : "out", address); if (direction) /* in */ { if (devices[devcount].int_in_ep) DBG (3, "sanei_usb_open: we already have a int-in endpoint " "(address: %d), ignoring the new one\n", devices[devcount].int_in_ep); else devices[devcount].int_in_ep = endpoint->bEndpointAddress; } else if (devices[devcount].int_out_ep) DBG (3, "sanei_usb_open: we already have a int-out endpoint " "(address: %d), ignoring the new one\n", devices[devcount].int_out_ep); else devices[devcount].int_out_ep = endpoint->bEndpointAddress; } else if (transfer_type == USB_ENDPOINT_TYPE_BULK) { DBG (5, "sanei_usb_open: found bulk-%s endpoint (address %2x)\n", direction ? "in" : "out", address); if (direction) /* in */ { if (devices[devcount].bulk_in_ep) DBG (3, "sanei_usb_open: we already have a bulk-in endpoint " "(address: %d), ignoring the new one\n", devices[devcount].bulk_in_ep); else devices[devcount].bulk_in_ep = endpoint->bEndpointAddress; } else { if (devices[devcount].bulk_out_ep) DBG (3, "sanei_usb_open: we already have a bulk-out endpoint " "(address: %d), ignoring the new one\n", devices[devcount].bulk_out_ep); else devices[devcount].bulk_out_ep = endpoint->bEndpointAddress; } } /* ignore currently unsupported endpoints */ else { DBG (5, "sanei_usb_open: ignoring %s-%s endpoint " "(address: %d)\n", transfer_type == USB_ENDPOINT_TYPE_CONTROL ? "control" : transfer_type == USB_ENDPOINT_TYPE_ISOCHRONOUS ? "isochronous" : "interrupt", direction ? "in" : "out", address); continue; } break; } } #else DBG (1, "sanei_usb_open: can't open device `%s': " "usbcalls support missing\n", devname); return SANE_STATUS_UNSUPPORTED; #endif /* HAVE_USBCALLS */ } else { DBG (1, "sanei_usb_open: access method %d not implemented\n", devices[devcount].method); return SANE_STATUS_INVAL; } devices[devcount].open = SANE_TRUE; *dn = devcount; DBG (3, "sanei_usb_open: opened usb device `%s' (*dn=%d)\n", devname, devcount); return SANE_STATUS_GOOD; } void sanei_usb_close (SANE_Int dn) { DBG (5, "sanei_usb_close: closing device %d\n", dn); if (dn >= device_number || dn < 0) { DBG (1, "sanei_usb_close: dn >= device number || dn < 0\n"); return; } if (!devices[dn].open) { DBG (1, "sanei_usb_close: device %d already closed or never opened\n", dn); return; } if (devices[dn].method == sanei_usb_method_scanner_driver) close (devices[dn].fd); else if (devices[dn].method == sanei_usb_method_usbcalls) { #ifdef HAVE_USBCALLS int rc; rc=UsbClose (dh); DBG (5,"rc of UsbClose = %d\n",rc); #else DBG (1, "sanei_usb_close: usbcalls support missing\n"); #endif } else #ifdef HAVE_LIBUSB { #if 0 /* Should only be done in case of a stall */ usb_clear_halt (devices[dn].libusb_handle, devices[dn].bulk_in_ep); usb_clear_halt (devices[dn].libusb_handle, devices[dn].bulk_out_ep); usb_clear_halt (devices[dn].libusb_handle, devices[dn].iso_in_ep); /* be careful, we don't know if we are in DATA0 stage now */ usb_resetep (devices[dn].libusb_handle, devices[dn].bulk_in_ep); usb_resetep (devices[dn].libusb_handle, devices[dn].bulk_out_ep); usb_resetep (devices[dn].libusb_handle, devices[dn].iso_in_ep); #endif /* 0 */ usb_release_interface (devices[dn].libusb_handle, devices[dn].interface_nr); usb_close (devices[dn].libusb_handle); } #elif defined(HAVE_LIBUSB_1_0) { libusb_release_interface (devices[dn].lu_handle, devices[dn].interface_nr); libusb_close (devices[dn].lu_handle); } #else /* not HAVE_LIBUSB && not HAVE_LIBUSB_1_0 */ DBG (1, "sanei_usb_close: libusb support missing\n"); #endif devices[dn].open = SANE_FALSE; return; } void sanei_usb_set_timeout (SANE_Int timeout) { #if defined(HAVE_LIBUSB) || defined(HAVE_LIBUSB_1_0) libusb_timeout = timeout; #else DBG (1, "sanei_usb_set_timeout: libusb support missing\n"); #endif /* HAVE_LIBUSB || HAVE_LIBUSB_1_0 */ } SANE_Status sanei_usb_clear_halt (SANE_Int dn) { #ifdef HAVE_LIBUSB int ret; if (dn >= device_number || dn < 0) { DBG (1, "sanei_usb_clear_halt: dn >= device number || dn < 0\n"); return SANE_STATUS_INVAL; } ret = usb_clear_halt (devices[dn].libusb_handle, devices[dn].bulk_in_ep); if (ret){ DBG (1, "sanei_usb_clear_halt: BULK_IN ret=%d\n", ret); return SANE_STATUS_INVAL; } ret = usb_clear_halt (devices[dn].libusb_handle, devices[dn].bulk_out_ep); if (ret){ DBG (1, "sanei_usb_clear_halt: BULK_OUT ret=%d\n", ret); return SANE_STATUS_INVAL; } /* be careful, we don't know if we are in DATA0 stage now ret = usb_resetep (devices[dn].libusb_handle, devices[dn].bulk_in_ep); ret = usb_resetep (devices[dn].libusb_handle, devices[dn].bulk_out_ep); */ #elif defined(HAVE_LIBUSB_1_0) int ret; if (dn >= device_number || dn < 0) { DBG (1, "sanei_usb_clear_halt: dn >= device number || dn < 0\n"); return SANE_STATUS_INVAL; } ret = libusb_clear_halt (devices[dn].lu_handle, devices[dn].bulk_in_ep); if (ret){ DBG (1, "sanei_usb_clear_halt: BULK_IN ret=%d\n", ret); return SANE_STATUS_INVAL; } ret = libusb_clear_halt (devices[dn].lu_handle, devices[dn].bulk_out_ep); if (ret){ DBG (1, "sanei_usb_clear_halt: BULK_OUT ret=%d\n", ret); return SANE_STATUS_INVAL; } #else /* not HAVE_LIBUSB && not HAVE_LIBUSB_1_0 */ DBG (1, "sanei_usb_clear_halt: libusb support missing\n"); #endif /* HAVE_LIBUSB || HAVE_LIBUSB_1_0 */ return SANE_STATUS_GOOD; } SANE_Status sanei_usb_reset (SANE_Int dn) { #ifdef HAVE_LIBUSB int ret; ret = usb_reset (devices[dn].libusb_handle); if (ret){ DBG (1, "sanei_usb_reset: ret=%d\n", ret); return SANE_STATUS_INVAL; } #elif defined(HAVE_LIBUSB_1_0) int ret; ret = libusb_reset_device (devices[dn].lu_handle); if (ret){ DBG (1, "sanei_usb_reset: ret=%d\n", ret); return SANE_STATUS_INVAL; } #else /* not HAVE_LIBUSB && not HAVE_LIBUSB_1_0 */ DBG (1, "sanei_usb_reset: libusb support missing\n"); #endif /* HAVE_LIBUSB || HAVE_LIBUSB_1_0 */ return SANE_STATUS_GOOD; } SANE_Status sanei_usb_read_bulk (SANE_Int dn, SANE_Byte * buffer, size_t * size) { ssize_t read_size = 0; if (!size) { DBG (1, "sanei_usb_read_bulk: size == NULL\n"); return SANE_STATUS_INVAL; } if (dn >= device_number || dn < 0) { DBG (1, "sanei_usb_read_bulk: dn >= device number || dn < 0\n"); return SANE_STATUS_INVAL; } DBG (5, "sanei_usb_read_bulk: trying to read %lu bytes\n", (unsigned long) *size); if (devices[dn].method == sanei_usb_method_scanner_driver) { read_size = read (devices[dn].fd, buffer, *size); if (read_size < 0) DBG (1, "sanei_usb_read_bulk: read failed: %s\n", strerror (errno)); } else if (devices[dn].method == sanei_usb_method_libusb) #ifdef HAVE_LIBUSB { if (devices[dn].bulk_in_ep) { read_size = usb_bulk_read (devices[dn].libusb_handle, devices[dn].bulk_in_ep, (char *) buffer, (int) *size, libusb_timeout); if (read_size < 0) DBG (1, "sanei_usb_read_bulk: read failed: %s\n", strerror (errno)); } else { DBG (1, "sanei_usb_read_bulk: can't read without a bulk-in " "endpoint\n"); return SANE_STATUS_INVAL; } } #elif defined(HAVE_LIBUSB_1_0) { if (devices[dn].bulk_in_ep) { int ret; ret = libusb_bulk_transfer (devices[dn].lu_handle, devices[dn].bulk_in_ep, buffer, (int) *size, (int *) &read_size, libusb_timeout); if (ret < 0) { DBG (1, "sanei_usb_read_bulk: read failed: %s\n", sanei_libusb_strerror (ret)); read_size = -1; } } else { DBG (1, "sanei_usb_read_bulk: can't read without a bulk-in " "endpoint\n"); return SANE_STATUS_INVAL; } } #else /* not HAVE_LIBUSB && not HAVE_LIBUSB_1_0 */ { DBG (1, "sanei_usb_read_bulk: libusb support missing\n"); return SANE_STATUS_UNSUPPORTED; } #endif /* not HAVE_LIBUSB */ else if (devices[dn].method == sanei_usb_method_usbcalls) { #ifdef HAVE_USBCALLS int rc; char* buffer_ptr = (char*) buffer; while (*size) { ULONG ulToRead = (*size>MAX_RW)?MAX_RW:*size; ULONG ulNum = ulToRead; DBG (5, "Entered usbcalls UsbBulkRead with dn = %d\n",dn); DBG (5, "Entered usbcalls UsbBulkRead with dh = %p\n",dh); DBG (5, "Entered usbcalls UsbBulkRead with bulk_in_ep = 0x%02x\n",devices[dn].bulk_in_ep); DBG (5, "Entered usbcalls UsbBulkRead with interface_nr = %d\n",devices[dn].interface_nr); DBG (5, "Entered usbcalls UsbBulkRead with usbcalls_timeout = %d\n",usbcalls_timeout); if (devices[dn].bulk_in_ep){ rc = UsbBulkRead (dh, devices[dn].bulk_in_ep, devices[dn].interface_nr, &ulToRead, buffer_ptr, usbcalls_timeout); DBG (1, "sanei_usb_read_bulk: rc = %d\n",rc);} else { DBG (1, "sanei_usb_read_bulk: can't read without a bulk-in endpoint\n"); return SANE_STATUS_INVAL; } if (rc || (ulNum!=ulToRead)) return SANE_STATUS_INVAL; *size -=ulToRead; buffer_ptr += ulToRead; read_size += ulToRead; } #else /* not HAVE_USBCALLS */ { DBG (1, "sanei_usb_read_bulk: usbcalls support missing\n"); return SANE_STATUS_UNSUPPORTED; } #endif /* not HAVE_USBCALLS */ } else { DBG (1, "sanei_usb_read_bulk: access method %d not implemented\n", devices[dn].method); return SANE_STATUS_INVAL; } if (read_size < 0) { #ifdef HAVE_LIBUSB if (devices[dn].method == sanei_usb_method_libusb) usb_clear_halt (devices[dn].libusb_handle, devices[dn].bulk_in_ep); #elif defined(HAVE_LIBUSB_1_0) if (devices[dn].method == sanei_usb_method_libusb) libusb_clear_halt (devices[dn].lu_handle, devices[dn].bulk_in_ep); #endif *size = 0; return SANE_STATUS_IO_ERROR; } if (read_size == 0) { DBG (3, "sanei_usb_read_bulk: read returned EOF\n"); *size = 0; return SANE_STATUS_EOF; } if (debug_level > 10) print_buffer (buffer, read_size); DBG (5, "sanei_usb_read_bulk: wanted %lu bytes, got %ld bytes\n", (unsigned long) *size, (unsigned long) read_size); *size = read_size; return SANE_STATUS_GOOD; } SANE_Status sanei_usb_write_bulk (SANE_Int dn, const SANE_Byte * buffer, size_t * size) { ssize_t write_size = 0; if (!size) { DBG (1, "sanei_usb_write_bulk: size == NULL\n"); return SANE_STATUS_INVAL; } if (dn >= device_number || dn < 0) { DBG (1, "sanei_usb_write_bulk: dn >= device number || dn < 0\n"); return SANE_STATUS_INVAL; } DBG (5, "sanei_usb_write_bulk: trying to write %lu bytes\n", (unsigned long) *size); if (debug_level > 10) print_buffer (buffer, *size); if (devices[dn].method == sanei_usb_method_scanner_driver) { write_size = write (devices[dn].fd, buffer, *size); if (write_size < 0) DBG (1, "sanei_usb_write_bulk: write failed: %s\n", strerror (errno)); } else if (devices[dn].method == sanei_usb_method_libusb) #ifdef HAVE_LIBUSB { if (devices[dn].bulk_out_ep) { write_size = usb_bulk_write (devices[dn].libusb_handle, devices[dn].bulk_out_ep, (const char *) buffer, (int) *size, libusb_timeout); if (write_size < 0) DBG (1, "sanei_usb_write_bulk: write failed: %s\n", strerror (errno)); } else { DBG (1, "sanei_usb_write_bulk: can't write without a bulk-out " "endpoint\n"); return SANE_STATUS_INVAL; } } #elif defined(HAVE_LIBUSB_1_0) { if (devices[dn].bulk_out_ep) { int ret; int trans_bytes; ret = libusb_bulk_transfer (devices[dn].lu_handle, devices[dn].bulk_out_ep, buffer, (int) *size, &trans_bytes, libusb_timeout); if (ret < 0) { DBG (1, "sanei_usb_write_bulk: write failed: %s\n", sanei_libusb_strerror (ret)); write_size = -1; } else write_size = trans_bytes; } else { DBG (1, "sanei_usb_write_bulk: can't write without a bulk-out " "endpoint\n"); return SANE_STATUS_INVAL; } } #else /* not HAVE_LIBUSB && not HAVE_LIBUSB_1_0 */ { DBG (1, "sanei_usb_write_bulk: libusb support missing\n"); return SANE_STATUS_UNSUPPORTED; } #endif /* not HAVE_LIBUSB && not HAVE_LIBUSB_1_0 */ else if (devices[dn].method == sanei_usb_method_usbcalls) { #ifdef HAVE_USBCALLS int rc; DBG (5, "Entered usbcalls UsbBulkWrite with dn = %d\n",dn); DBG (5, "Entered usbcalls UsbBulkWrite with dh = %p\n",dh); DBG (5, "Entered usbcalls UsbBulkWrite with bulk_out_ep = 0x%02x\n",devices[dn].bulk_out_ep); DBG (5, "Entered usbcalls UsbBulkWrite with interface_nr = %d\n",devices[dn].interface_nr); DBG (5, "Entered usbcalls UsbBulkWrite with usbcalls_timeout = %d\n",usbcalls_timeout); while (*size) { ULONG ulToWrite = (*size>MAX_RW)?MAX_RW:*size; DBG (5, "size requested to write = %lu, ulToWrite = %lu\n",(unsigned long) *size,ulToWrite); if (devices[dn].bulk_out_ep){ rc = UsbBulkWrite (dh, devices[dn].bulk_out_ep, devices[dn].interface_nr, ulToWrite, (char*) buffer, usbcalls_timeout); DBG (1, "sanei_usb_write_bulk: rc = %d\n",rc); } else { DBG (1, "sanei_usb_write_bulk: can't read without a bulk-out endpoint\n"); return SANE_STATUS_INVAL; } if (rc) return SANE_STATUS_INVAL; *size -=ulToWrite; buffer += ulToWrite; write_size += ulToWrite; DBG (5, "size = %d, write_size = %d\n",*size, write_size); } #else /* not HAVE_USBCALLS */ { DBG (1, "sanei_usb_write_bulk: usbcalls support missing\n"); return SANE_STATUS_UNSUPPORTED; } #endif /* not HAVE_USBCALLS */ } else { DBG (1, "sanei_usb_write_bulk: access method %d not implemented\n", devices[dn].method); return SANE_STATUS_INVAL; } if (write_size < 0) { *size = 0; #ifdef HAVE_LIBUSB if (devices[dn].method == sanei_usb_method_libusb) usb_clear_halt (devices[dn].libusb_handle, devices[dn].bulk_out_ep); #elif defined(HAVE_LIBUSB_1_0) if (devices[dn].method == sanei_usb_method_libusb) libusb_clear_halt (devices[dn].lu_handle, devices[dn].bulk_out_ep); #endif return SANE_STATUS_IO_ERROR; } DBG (5, "sanei_usb_write_bulk: wanted %lu bytes, wrote %ld bytes\n", (unsigned long) *size, (unsigned long) write_size); *size = write_size; return SANE_STATUS_GOOD; } SANE_Status sanei_usb_control_msg (SANE_Int dn, SANE_Int rtype, SANE_Int req, SANE_Int value, SANE_Int index, SANE_Int len, SANE_Byte * data) { if (dn >= device_number || dn < 0) { DBG (1, "sanei_usb_control_msg: dn >= device number || dn < 0, dn=%d\n", dn); return SANE_STATUS_INVAL; } DBG (5, "sanei_usb_control_msg: rtype = 0x%02x, req = %d, value = %d, " "index = %d, len = %d\n", rtype, req, value, index, len); if (!(rtype & 0x80) && debug_level > 10) print_buffer (data, len); if (devices[dn].method == sanei_usb_method_scanner_driver) { #if defined(__linux__) struct ctrlmsg_ioctl c; c.req.requesttype = rtype; c.req.request = req; c.req.value = value; c.req.index = index; c.req.length = len; c.data = data; if (ioctl (devices[dn].fd, SCANNER_IOCTL_CTRLMSG, &c) < 0) { DBG (5, "sanei_usb_control_msg: SCANNER_IOCTL_CTRLMSG error - %s\n", strerror (errno)); return SANE_STATUS_IO_ERROR; } if ((rtype & 0x80) && debug_level > 10) print_buffer (data, len); return SANE_STATUS_GOOD; #elif defined(__BEOS__) struct usb_scanner_ioctl_ctrlmsg c; c.req.request_type = rtype; c.req.request = req; c.req.value = value; c.req.index = index; c.req.length = len; c.data = data; if (ioctl (devices[dn].fd, B_SCANNER_IOCTL_CTRLMSG, &c) < 0) { DBG (5, "sanei_usb_control_msg: SCANNER_IOCTL_CTRLMSG error - %s\n", strerror (errno)); return SANE_STATUS_IO_ERROR; } if ((rtype & 0x80) && debug_level > 10) print_buffer (data, len); return SANE_STATUS_GOOD; #else /* not __linux__ */ DBG (5, "sanei_usb_control_msg: not supported on this OS\n"); return SANE_STATUS_UNSUPPORTED; #endif /* not __linux__ */ } else if (devices[dn].method == sanei_usb_method_libusb) #ifdef HAVE_LIBUSB { int result; result = usb_control_msg (devices[dn].libusb_handle, rtype, req, value, index, (char *) data, len, libusb_timeout); if (result < 0) { DBG (1, "sanei_usb_control_msg: libusb complained: %s\n", usb_strerror ()); return SANE_STATUS_INVAL; } if ((rtype & 0x80) && debug_level > 10) print_buffer (data, len); return SANE_STATUS_GOOD; } #elif defined(HAVE_LIBUSB_1_0) { int result; result = libusb_control_transfer (devices[dn].lu_handle, rtype, req, value, index, data, len, libusb_timeout); if (result < 0) { DBG (1, "sanei_usb_control_msg: libusb complained: %s\n", sanei_libusb_strerror (result)); return SANE_STATUS_INVAL; } if ((rtype & 0x80) && debug_level > 10) print_buffer (data, len); return SANE_STATUS_GOOD; } #else /* not HAVE_LIBUSB && not HAVE_LIBUSB_1_0*/ { DBG (1, "sanei_usb_control_msg: libusb support missing\n"); return SANE_STATUS_UNSUPPORTED; } #endif /* not HAVE_LIBUSB && not HAVE_LIBUSB_1_0 */ else if (devices[dn].method == sanei_usb_method_usbcalls) { #ifdef HAVE_USBCALLS int result; result = UsbCtrlMessage (dh, rtype, req, value, index, len, (char *) data, usbcalls_timeout); DBG (5, "rc of usb_control_msg = %d\n",result); if (result < 0) { DBG (1, "sanei_usb_control_msg: usbcalls complained: %d\n",result); return SANE_STATUS_INVAL; } if ((rtype & 0x80) && debug_level > 10) print_buffer (data, len); return SANE_STATUS_GOOD; #else /* not HAVE_USBCALLS */ { DBG (1, "sanei_usb_control_msg: usbcalls support missing\n"); return SANE_STATUS_UNSUPPORTED; } #endif /* not HAVE_USBCALLS */ } else { DBG (1, "sanei_usb_control_msg: access method %d not implemented\n", devices[dn].method); return SANE_STATUS_UNSUPPORTED; } } SANE_Status sanei_usb_read_int (SANE_Int dn, SANE_Byte * buffer, size_t * size) { ssize_t read_size = 0; #if defined(HAVE_LIBUSB) || defined(HAVE_LIBUSB_1_0) SANE_Bool stalled = SANE_FALSE; #endif if (!size) { DBG (1, "sanei_usb_read_int: size == NULL\n"); return SANE_STATUS_INVAL; } if (dn >= device_number || dn < 0) { DBG (1, "sanei_usb_read_int: dn >= device number || dn < 0\n"); return SANE_STATUS_INVAL; } DBG (5, "sanei_usb_read_int: trying to read %lu bytes\n", (unsigned long) *size); if (devices[dn].method == sanei_usb_method_scanner_driver) { DBG (1, "sanei_usb_read_int: access method %d not implemented\n", devices[dn].method); return SANE_STATUS_INVAL; } else if (devices[dn].method == sanei_usb_method_libusb) #ifdef HAVE_LIBUSB { if (devices[dn].int_in_ep) { read_size = usb_interrupt_read (devices[dn].libusb_handle, devices[dn].int_in_ep, (char *) buffer, (int) *size, libusb_timeout); if (read_size < 0) DBG (1, "sanei_usb_read_int: read failed: %s\n", strerror (errno)); stalled = (read_size == -EPIPE); } else { DBG (1, "sanei_usb_read_int: can't read without an int " "endpoint\n"); return SANE_STATUS_INVAL; } } #elif defined(HAVE_LIBUSB_1_0) { if (devices[dn].int_in_ep) { int ret; int trans_bytes; ret = libusb_interrupt_transfer (devices[dn].lu_handle, devices[dn].int_in_ep, buffer, (int) *size, &trans_bytes, libusb_timeout); if (ret < 0) read_size = -1; else read_size = trans_bytes; stalled = (ret == LIBUSB_ERROR_PIPE); } else { DBG (1, "sanei_usb_read_int: can't read without an int " "endpoint\n"); return SANE_STATUS_INVAL; } } #else /* not HAVE_LIBUSB && not HAVE_LIBUSB_1_0 */ { DBG (1, "sanei_usb_read_int: libusb support missing\n"); return SANE_STATUS_UNSUPPORTED; } #endif /* not HAVE_LIBUSB && not HAVE_LIBUSB_1_0 */ else if (devices[dn].method == sanei_usb_method_usbcalls) { #ifdef HAVE_USBCALLS int rc; USHORT usNumBytes=*size; DBG (5, "Entered usbcalls UsbIrqStart with dn = %d\n",dn); DBG (5, "Entered usbcalls UsbIrqStart with dh = %p\n",dh); DBG (5, "Entered usbcalls UsbIrqStart with int_in_ep = 0x%02x\n",devices[dn].int_in_ep); DBG (5, "Entered usbcalls UsbIrqStart with interface_nr = %d\n",devices[dn].interface_nr); DBG (5, "Entered usbcalls UsbIrqStart with bytes to read = %u\n",usNumBytes); if (devices[dn].int_in_ep){ rc = UsbIrqStart (dh,devices[dn].int_in_ep,devices[dn].interface_nr, usNumBytes, (char *) buffer, pUsbIrqStartHev); DBG (5, "rc of UsbIrqStart = %d\n",rc); } else { DBG (1, "sanei_usb_read_int: can't read without an int " "endpoint\n"); return SANE_STATUS_INVAL; } if (rc) return SANE_STATUS_INVAL; read_size += usNumBytes; #else DBG (1, "sanei_usb_read_int: usbcalls support missing\n"); return SANE_STATUS_UNSUPPORTED; #endif /* HAVE_USBCALLS */ } else { DBG (1, "sanei_usb_read_int: access method %d not implemented\n", devices[dn].method); return SANE_STATUS_INVAL; } if (read_size < 0) { #ifdef HAVE_LIBUSB if (devices[dn].method == sanei_usb_method_libusb) if (stalled) usb_clear_halt (devices[dn].libusb_handle, devices[dn].int_in_ep); #elif defined(HAVE_LIBUSB_1_0) if (devices[dn].method == sanei_usb_method_libusb) if (stalled) libusb_clear_halt (devices[dn].lu_handle, devices[dn].int_in_ep); #endif *size = 0; return SANE_STATUS_IO_ERROR; } if (read_size == 0) { DBG (3, "sanei_usb_read_int: read returned EOF\n"); *size = 0; return SANE_STATUS_EOF; } DBG (5, "sanei_usb_read_int: wanted %lu bytes, got %ld bytes\n", (unsigned long) *size, (unsigned long) read_size); *size = read_size; if (debug_level > 10) print_buffer (buffer, read_size); return SANE_STATUS_GOOD; } SANE_Status sanei_usb_set_configuration (SANE_Int dn, SANE_Int configuration) { if (dn >= device_number || dn < 0) { DBG (1, "sanei_usb_set_configuration: dn >= device number || dn < 0, dn=%d\n", dn); return SANE_STATUS_INVAL; } DBG (5, "sanei_usb_set_configuration: configuration = %d\n", configuration); if (devices[dn].method == sanei_usb_method_scanner_driver) { #if defined(__linux__) return SANE_STATUS_GOOD; #else /* not __linux__ */ DBG (5, "sanei_usb_set_configuration: not supported on this OS\n"); return SANE_STATUS_UNSUPPORTED; #endif /* not __linux__ */ } else if (devices[dn].method == sanei_usb_method_libusb) #ifdef HAVE_LIBUSB { int result; result = usb_set_configuration (devices[dn].libusb_handle, configuration); if (result < 0) { DBG (1, "sanei_usb_set_configuration: libusb complained: %s\n", usb_strerror ()); return SANE_STATUS_INVAL; } return SANE_STATUS_GOOD; } #elif defined(HAVE_LIBUSB_1_0) { int result; result = libusb_set_configuration (devices[dn].lu_handle, configuration); if (result < 0) { DBG (1, "sanei_usb_set_configuration: libusb complained: %s\n", sanei_libusb_strerror (result)); return SANE_STATUS_INVAL; } return SANE_STATUS_GOOD; } #else /* not HAVE_LIBUSB && not HAVE_LIBUSB_1_0 */ { DBG (1, "sanei_usb_set_configuration: libusb support missing\n"); return SANE_STATUS_UNSUPPORTED; } #endif /* not HAVE_LIBUSB && not HAVE_LIBUSB_1_0 */ else { DBG (1, "sanei_usb_set_configuration: access method %d not implemented\n", devices[dn].method); return SANE_STATUS_UNSUPPORTED; } } SANE_Status sanei_usb_claim_interface (SANE_Int dn, SANE_Int interface_number) { if (dn >= device_number || dn < 0) { DBG (1, "sanei_usb_claim_interface: dn >= device number || dn < 0, dn=%d\n", dn); return SANE_STATUS_INVAL; } DBG (5, "sanei_usb_claim_interface: interface_number = %d\n", interface_number); if (devices[dn].method == sanei_usb_method_scanner_driver) { #if defined(__linux__) return SANE_STATUS_GOOD; #else /* not __linux__ */ DBG (5, "sanei_usb_claim_interface: not supported on this OS\n"); return SANE_STATUS_UNSUPPORTED; #endif /* not __linux__ */ } else if (devices[dn].method == sanei_usb_method_libusb) #ifdef HAVE_LIBUSB { int result; result = usb_claim_interface (devices[dn].libusb_handle, interface_number); if (result < 0) { DBG (1, "sanei_usb_claim_interface: libusb complained: %s\n", usb_strerror ()); return SANE_STATUS_INVAL; } return SANE_STATUS_GOOD; } #elif defined(HAVE_LIBUSB_1_0) { int result; result = libusb_claim_interface (devices[dn].lu_handle, interface_number); if (result < 0) { DBG (1, "sanei_usb_claim_interface: libusb complained: %s\n", sanei_libusb_strerror (result)); return SANE_STATUS_INVAL; } return SANE_STATUS_GOOD; } #else /* not HAVE_LIBUSB && not HAVE_LIBUSB_1_0 */ { DBG (1, "sanei_usb_claim_interface: libusb support missing\n"); return SANE_STATUS_UNSUPPORTED; } #endif /* not HAVE_LIBUSB && not HAVE_LIBUSB_1_0 */ else { DBG (1, "sanei_usb_claim_interface: access method %d not implemented\n", devices[dn].method); return SANE_STATUS_UNSUPPORTED; } } SANE_Status sanei_usb_release_interface (SANE_Int dn, SANE_Int interface_number) { if (dn >= device_number || dn < 0) { DBG (1, "sanei_usb_release_interface: dn >= device number || dn < 0, dn=%d\n", dn); return SANE_STATUS_INVAL; } DBG (5, "sanei_usb_release_interface: interface_number = %d\n", interface_number); if (devices[dn].method == sanei_usb_method_scanner_driver) { #if defined(__linux__) return SANE_STATUS_GOOD; #else /* not __linux__ */ DBG (5, "sanei_usb_release_interface: not supported on this OS\n"); return SANE_STATUS_UNSUPPORTED; #endif /* not __linux__ */ } else if (devices[dn].method == sanei_usb_method_libusb) #ifdef HAVE_LIBUSB { int result; result = usb_release_interface (devices[dn].libusb_handle, interface_number); if (result < 0) { DBG (1, "sanei_usb_release_interface: libusb complained: %s\n", usb_strerror ()); return SANE_STATUS_INVAL; } return SANE_STATUS_GOOD; } #elif defined(HAVE_LIBUSB_1_0) { int result; result = libusb_release_interface (devices[dn].lu_handle, interface_number); if (result < 0) { DBG (1, "sanei_usb_release_interface: libusb complained: %s\n", sanei_libusb_strerror (result)); return SANE_STATUS_INVAL; } return SANE_STATUS_GOOD; } #else /* not HAVE_LIBUSB && not HAVE_LIBUSB_1_0 */ { DBG (1, "sanei_usb_release_interface: libusb support missing\n"); return SANE_STATUS_UNSUPPORTED; } #endif /* not HAVE_LIBUSB && not HAVE_LIBUSB_1_0 */ else { DBG (1, "sanei_usb_release_interface: access method %d not implemented\n", devices[dn].method); return SANE_STATUS_UNSUPPORTED; } } SANE_Status sanei_usb_set_altinterface (SANE_Int dn, SANE_Int alternate) { if (dn >= device_number || dn < 0) { DBG (1, "sanei_usb_set_altinterface: dn >= device number || dn < 0, dn=%d\n", dn); return SANE_STATUS_INVAL; } DBG (5, "sanei_usb_set_altinterface: alternate = %d\n", alternate); if (devices[dn].method == sanei_usb_method_scanner_driver) { #if defined(__linux__) return SANE_STATUS_GOOD; #else /* not __linux__ */ DBG (5, "sanei_usb_set_altinterface: not supported on this OS\n"); return SANE_STATUS_UNSUPPORTED; #endif /* not __linux__ */ } else if (devices[dn].method == sanei_usb_method_libusb) #ifdef HAVE_LIBUSB { int result; result = usb_set_altinterface (devices[dn].libusb_handle, alternate); if (result < 0) { DBG (1, "sanei_usb_set_altinterface: libusb complained: %s\n", usb_strerror ()); return SANE_STATUS_INVAL; } return SANE_STATUS_GOOD; } #elif defined(HAVE_LIBUSB_1_0) { int result; result = libusb_set_interface_alt_setting (devices[dn].lu_handle, devices[dn].interface_nr, alternate); if (result < 0) { DBG (1, "sanei_usb_set_altinterface: libusb complained: %s\n", sanei_libusb_strerror (result)); return SANE_STATUS_INVAL; } return SANE_STATUS_GOOD; } #else /* not HAVE_LIBUSB && not HAVE_LIBUSB_1_0 */ { DBG (1, "sanei_set_altinterface: libusb support missing\n"); return SANE_STATUS_UNSUPPORTED; } #endif /* not HAVE_LIBUSB && not HAVE_LIBUSB_1_0 */ else { DBG (1, "sanei_usb_set_altinterface: access method %d not implemented\n", devices[dn].method); return SANE_STATUS_UNSUPPORTED; } } extern SANE_Status sanei_usb_get_descriptor( SANE_Int dn, struct sanei_usb_dev_descriptor *desc ) { if (dn >= device_number || dn < 0) { DBG (1, "sanei_usb_get_descriptor: dn >= device number || dn < 0, dn=%d\n", dn); return SANE_STATUS_INVAL; } DBG (5, "sanei_usb_get_descriptor\n"); #ifdef HAVE_LIBUSB { struct usb_device_descriptor *usb_descr; usb_descr = &(devices[dn].libusb_device->descriptor); desc->desc_type = usb_descr->bDescriptorType; desc->bcd_usb = usb_descr->bcdUSB; desc->bcd_dev = usb_descr->bcdDevice; desc->dev_class = usb_descr->bDeviceClass; desc->dev_sub_class = usb_descr->bDeviceSubClass; desc->dev_protocol = usb_descr->bDeviceProtocol; desc->max_packet_size = usb_descr->bMaxPacketSize0; return SANE_STATUS_GOOD; } #elif defined(HAVE_LIBUSB_1_0) { struct libusb_device_descriptor lu_desc; int ret; ret = libusb_get_device_descriptor (devices[dn].lu_device, &lu_desc); if (ret < 0) { DBG (1, "sanei_usb_get_descriptor: libusb error: %s\n", sanei_libusb_strerror (ret)); return SANE_STATUS_INVAL; } desc->desc_type = lu_desc.bDescriptorType; desc->bcd_usb = lu_desc.bcdUSB; desc->bcd_dev = lu_desc.bcdDevice; desc->dev_class = lu_desc.bDeviceClass; desc->dev_sub_class = lu_desc.bDeviceSubClass; desc->dev_protocol = lu_desc.bDeviceProtocol; desc->max_packet_size = lu_desc.bMaxPacketSize0; return SANE_STATUS_GOOD; } #else /* not HAVE_LIBUSB && not HAVE_LIBUSB_1_0 */ { DBG (1, "sanei_usb_get_descriptor: libusb support missing\n"); return SANE_STATUS_UNSUPPORTED; } #endif /* not HAVE_LIBUSB && not HAVE_LIBUSB_1_0 */ } sane-backends-extras-1.0.22.3ubuntu1/sanei/Makefile.in0000664000000000000000000005403711527266664017347 0ustar # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ check_PROGRAMS = test_wire$(EXEEXT) @HAVE_JPEG_TRUE@am__append_1 = sanei_jpeg.c subdir = sanei DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/byteorder.m4 \ $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/sane/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libsanei_la_LIBADD = am__libsanei_la_SOURCES_DIST = sanei_ab306.c sanei_constrain_value.c \ sanei_init_debug.c sanei_net.c sanei_wire.c \ sanei_codec_ascii.c sanei_codec_bin.c sanei_scsi.c \ sanei_config.c sanei_config2.c sanei_pio.c sanei_pa4s2.c \ sanei_auth.c sanei_usb.c sanei_thread.c sanei_pv8630.c \ sanei_pp.c sanei_lm983x.c sanei_access.c sanei_tcp.c \ sanei_udp.c sanei_magic.c sanei_jpeg.c @HAVE_JPEG_TRUE@am__objects_1 = sanei_jpeg.lo am_libsanei_la_OBJECTS = sanei_ab306.lo sanei_constrain_value.lo \ sanei_init_debug.lo sanei_net.lo sanei_wire.lo \ sanei_codec_ascii.lo sanei_codec_bin.lo sanei_scsi.lo \ sanei_config.lo sanei_config2.lo sanei_pio.lo sanei_pa4s2.lo \ sanei_auth.lo sanei_usb.lo sanei_thread.lo sanei_pv8630.lo \ sanei_pp.lo sanei_lm983x.lo sanei_access.lo sanei_tcp.lo \ sanei_udp.lo sanei_magic.lo $(am__objects_1) libsanei_la_OBJECTS = $(am_libsanei_la_OBJECTS) am_test_wire_OBJECTS = test_wire.$(OBJEXT) test_wire_OBJECTS = $(am_test_wire_OBJECTS) test_wire_DEPENDENCIES = libsanei.la ../lib/liblib.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include/sane depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libsanei_la_SOURCES) $(test_wire_SOURCES) DIST_SOURCES = $(am__libsanei_la_SOURCES_DIST) $(test_wire_SOURCES) ETAGS = etags CTAGS = ctags am__tty_colors = \ red=; grn=; lgn=; blu=; std= DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AWK = @AWK@ BACKEND_CONFS_ENABLED = @BACKEND_CONFS_ENABLED@ BACKEND_LIBS_ENABLED = @BACKEND_LIBS_ENABLED@ BACKEND_MANS_ENABLED = @BACKEND_MANS_ENABLED@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISTCLEAN_FILES = @DISTCLEAN_FILES@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DVIPS = @DVIPS@ DYNAMIC_FLAG = @DYNAMIC_FLAG@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GPHOTO2_CPPFLAGS = @GPHOTO2_CPPFLAGS@ GPHOTO2_LDFLAGS = @GPHOTO2_LDFLAGS@ GPHOTO2_LIBS = @GPHOTO2_LIBS@ GREP = @GREP@ HAVE_GPHOTO2 = @HAVE_GPHOTO2@ IEEE1284_LIBS = @IEEE1284_LIBS@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_LOCKPATH = @INSTALL_LOCKPATH@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JPEG_LIBS = @JPEG_LIBS@ LATEX = @LATEX@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUSB_1_0_CFLAGS = @LIBUSB_1_0_CFLAGS@ LIBUSB_1_0_LIBS = @LIBUSB_1_0_LIBS@ LIBV4L_CFLAGS = @LIBV4L_CFLAGS@ LIBV4L_LIBS = @LIBV4L_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LOCKPATH_GROUP = @LOCKPATH_GROUP@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINDEX = @MAKEINDEX@ MAKEINFO = @MAKEINFO@ MATH_LIB = @MATH_LIB@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ NUMBER_VERSION = @NUMBER_VERSION@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PRELOADABLE_BACKENDS = @PRELOADABLE_BACKENDS@ PRELOADABLE_BACKENDS_ENABLED = @PRELOADABLE_BACKENDS_ENABLED@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RESMGR_LIBS = @RESMGR_LIBS@ SANEI_SANEI_JPEG_LO = @SANEI_SANEI_JPEG_LO@ SANE_CONFIG_PATH = @SANE_CONFIG_PATH@ SCSI_LIBS = @SCSI_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SNMP_CONFIG_PATH = @SNMP_CONFIG_PATH@ SOCKET_LIBS = @SOCKET_LIBS@ STRICT_LDFLAGS = @STRICT_LDFLAGS@ STRIP = @STRIP@ SYSLOG_LIBS = @SYSLOG_LIBS@ TIFF_LIBS = @TIFF_LIBS@ USB_LIBS = @USB_LIBS@ VERSION = @VERSION@ V_MAJOR = @V_MAJOR@ V_MINOR = @V_MINOR@ V_REV = @V_REV@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ configdir = @configdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ effective_target = @effective_target@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ locksanedir = @locksanedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_builddir)/include \ -I$(top_srcdir)/include TESTS = $(check_PROGRAMS) noinst_LTLIBRARIES = libsanei.la libsanei_la_SOURCES = sanei_ab306.c sanei_constrain_value.c \ sanei_init_debug.c sanei_net.c sanei_wire.c \ sanei_codec_ascii.c sanei_codec_bin.c sanei_scsi.c \ sanei_config.c sanei_config2.c sanei_pio.c sanei_pa4s2.c \ sanei_auth.c sanei_usb.c sanei_thread.c sanei_pv8630.c \ sanei_pp.c sanei_lm983x.c sanei_access.c sanei_tcp.c \ sanei_udp.c sanei_magic.c $(am__append_1) EXTRA_DIST = linux_sg3_err.h os2_srb.h sanei_DomainOS.c sanei_DomainOS.h test_wire_SOURCES = test_wire.c test_wire_LDADD = libsanei.la ../lib/liblib.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu sanei/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu sanei/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libsanei.la: $(libsanei_la_OBJECTS) $(libsanei_la_DEPENDENCIES) $(LINK) $(libsanei_la_OBJECTS) $(libsanei_la_LIBADD) $(LIBS) clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list test_wire$(EXEEXT): $(test_wire_OBJECTS) $(test_wire_DEPENDENCIES) @rm -f test_wire$(EXEEXT) $(LINK) $(test_wire_OBJECTS) $(test_wire_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanei_ab306.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanei_access.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanei_auth.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanei_codec_ascii.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanei_codec_bin.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanei_config.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanei_config2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanei_constrain_value.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanei_init_debug.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanei_jpeg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanei_lm983x.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanei_magic.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanei_net.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanei_pa4s2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanei_pio.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanei_pp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanei_pv8630.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanei_scsi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanei_tcp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanei_thread.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanei_udp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanei_usb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanei_wire.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_wire.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ echo "$$grn$$dashes"; \ else \ echo "$$red$$dashes"; \ fi; \ echo "$$banner"; \ test -z "$$skipped" || echo "$$skipped"; \ test -z "$$report" || echo "$$report"; \ echo "$$dashes$$std"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: 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_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-checkPROGRAMS clean-generic clean-libtool clean-local \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ clean-checkPROGRAMS clean-generic clean-libtool clean-local \ clean-noinstLTLIBRARIES ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am clean-local: rm -f test_wire.out # 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: sane-backends-extras-1.0.22.3ubuntu1/sanei/sanei_DomainOS.c0000775000000000000000000005625211475557446020305 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 1996, 1997 David Mosberger-Tang This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. This file defines a server for Apollo Domain/OS systems. It does all of the scsi_$ calls that are needed for SANE. This is necessary because Domain/OS will not allow a child process to access a parent's SCSI device. The interface is through a common, mapped area. Mutex locks are used to prevent concurrency problems, and eventcounts are used to notify a waiting process that its request has completed. This program is intended to support only one device at a time, although multiple instances of this program may run concurrently. It is intended that this program be forked/execd by a SANE application, and that it will exit when the application exits. Upon startup, the program is invoked with the path to an object that needs to be mapped for communication. The parent process will have already initialized the 'public' eventcounts and locks, and will be waiting for the ResultReady eventcount to be incremented. After initialization, the server will increment this eventcount, and wait for an incoming request, which is signified by the CommandAvailable eventcount. This EC will be incremented after another process has filled in the parameter area. DBG levels: 0 Error - always printed. 1 Basic monitor - print entry to main functions, or errors that are normally suppressed because they are reported at a higher level. 2 Medium monitor - show intermediate steps in functions 3 Detailed monitor - if its there, print it */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "../include/sane/config.h" #include "../include/sane/sanei_scsi.h" #include "../include/sane/sanei_debug.h" #include "sanei_DomainOS.h" /* Timeout period for SCSI wait, in milliseconds. We are using 100 seconds here. */ #define DomainScsiTimeout 100000 /* Communication Area pointer */ struct DomainServerCommon *com; /* Handle for fault handler */ pfm_$fh_handle_t FaultHandle; static struct { void *DomainSCSIPtr; /* Pointer to the data block for this device */ void *DomainSensePtr; /* Pointer to the sense area for this device */ u_int in_use : 1; /* is this DomainFdInfo in use? */ u_int fake_fd : 1; /* is this a fake file descriptor? */ scsi_$handle_t scsi_handle; /* SCSI handle */ scsi_$operation_id_t op_id; /* op_id of current request */ } *DomainFdInfo; /* This function is called error might have occured, but it would be one that I don't know how to handle, or never expect to happen. */ static void DomainErrorCheck(status_$t status, const char *message) { char *subsystem, *module, *code; short subsystem_length, module_length, code_length; if (status.all) { DBG(0, "Unrecoverable Domain/OS Error 0x%08x: %s\n", status.all, message); error_$find_text(status, &subsystem, &subsystem_length, &module, &module_length, &code, &code_length); if (subsystem_length && module_length && code_length) DBG(0, "%.*s (%.*s/%.*s)\n", code_length, code, subsystem_length, subsystem, module_length, module); exit(EXIT_FAILURE); } } /* This function is the fault handler for the server. Currently, it only handles asynchronous faults. It always returns to the faulting code, but it disables the handler, so that the server can be killed if the parent is unable to do so. */ pfm_$fh_func_val_t FaultHandler(pfm_$fault_rec_t *FaultStatusPtr) { status_$t status; DBG(1, "In fault handler, status is %08x\n", FaultStatusPtr->status.all); switch (FaultStatusPtr->status.all) { case fault_$quit: pfm_$release_fault_handler(FaultHandle, &status); DomainErrorCheck(status, "Can't release fault handler"); return pfm_$return_to_faulting_code; default: DBG(0, "Unrecognized fault type %08x, exiting\n", FaultStatusPtr->status.all); exit(EXIT_FAILURE); } } static void DomainSCSIOpen(void) { static int num_alloced = 0; int fd; scsi_$handle_t scsi_handle; pinteger len; void *DataBasePtr; /* Find fake fd. */ for (fd = 0; fd < num_alloced; ++fd) if (!DomainFdInfo[fd].in_use) break; /* Acquire the device */ DBG(1, "DomainSCSIOpen: dev='%s', fd=%d\n", com->open_path, fd); len = strlen(com->open_path); scsi_$acquire((char *)com->open_path, len, &scsi_handle, &com->CommandStatus); if (com->CommandStatus.all != status_$ok) { /* we have a failure, return an error code, and generate debug output */ DBG(1, "DomainSCSIOpen: acquire failed, Domain/OS status is %08x\n", com->CommandStatus.all); error_$print(com->CommandStatus); return; } else { /* device acquired, setup buffers and buffer pointers */ DBG(2, "DomainSCSIOpen: acquire OK, handle is %x\n", scsi_handle); /* Create/map the data area */ tmpnam(com->open_path); DBG(2, "DomainSCSIOpen: Data block name will be '%s'\n", com->open_path); DataBasePtr = ms_$crmapl(com->open_path, strlen(com->open_path), 0, DomainMaxDataSize + DomainSenseSize, ms_$cowriters, &com->CommandStatus); DomainErrorCheck(com->CommandStatus, "Creating Data Area"); assert((((int)DataBasePtr) & 0x3ff) == 0); /* Relies on Domain/OS mapping new objects on page boundary */ DBG(2, "Data Buffer block created at %p, length = 0x%lx\n", DataBasePtr, DomainMaxDataSize + DomainSenseSize); /* Wire the buffer */ scsi_$wire(scsi_handle, (void *)DataBasePtr, DomainMaxDataSize + DomainSenseSize, &com->CommandStatus); if (com->CommandStatus.all == status_$ok) { /* success, indicate status */ DBG(2, "Buffer wire was successful\n"); } else { /* failure, print detail and return code */ DBG(1, "Buffer wire failed, Domain/OS status is %08x\n", com->CommandStatus.all); error_$print(com->CommandStatus); return; } } if (fd >= num_alloced) { size_t new_size, old_size; old_size = num_alloced * sizeof (DomainFdInfo[0]); num_alloced = fd + 8; new_size = num_alloced * sizeof (DomainFdInfo[0]); if (DomainFdInfo) DomainFdInfo = realloc (DomainFdInfo, new_size); else DomainFdInfo = malloc (new_size); memset ((char *) DomainFdInfo + old_size, 0, new_size - old_size); assert(DomainFdInfo); } DomainFdInfo[fd].in_use = 1; DomainFdInfo[fd].scsi_handle = scsi_handle; DomainFdInfo[fd].DomainSCSIPtr = DataBasePtr; DomainFdInfo[fd].DomainSensePtr = ((char *)DataBasePtr) + DomainMaxDataSize; com->fd = fd; } static void DomainSCSIClose(void) { DomainFdInfo[com->fd].in_use = 0; DBG(1, "sanei_scsi_close: fd=%d\n", com->fd); /* Unwire the buffer */ scsi_$unwire(DomainFdInfo[com->fd].scsi_handle, DomainFdInfo[com->fd].DomainSCSIPtr, DomainMaxDataSize + DomainSenseSize, true, &com->CommandStatus); DomainErrorCheck(com->CommandStatus, "Unwiring SCSI buffers"); /* Release the device */ scsi_$release(DomainFdInfo[com->fd].scsi_handle, &com->CommandStatus); DomainErrorCheck(com->CommandStatus, "Releasing device"); /* Unmap the buffer area */ ms_$unmap(DomainFdInfo[com->fd].DomainSCSIPtr, DomainMaxDataSize + DomainSenseSize, &com->CommandStatus); DomainErrorCheck(com->CommandStatus, "Unmapping device data area"); } /* I have never seen this called, and I'm not sure what to do with it, so I guarantee that it will generate a fault, and I can add support for it. */ static void DomainSCSIFlushAll(void) { status_$t status; DBG(1, "DomainSCSIFlushAll: ()\n"); DBG(0, "Error - unimplemented feature in module" "BACKEND_NAME"); assert(1==0); } /* This function must only be called from DomainSCSIEnter. The current server architecture requires that the Wait immediately follow the Enter command. */ static void DomainSCSIWait(void) { int count; char *ascii_wait_status, *ascii_op_status; pinteger return_count; scsi_$op_status_t status_list[1]; scsi_$wait_index_t wait_index; /* wait for the command completion */ wait_index = scsi_$wait(DomainFdInfo[com->fd].scsi_handle, DomainScsiTimeout, true, DomainFdInfo[com->fd].op_id, 1, status_list, &return_count, &com->CommandStatus); DBG(2, " scsi_$wait returned status = %08x\n", com->CommandStatus.all); if (com->CommandStatus.all == status_$ok) { switch (wait_index) { case scsi_device_advance: ascii_wait_status = "scsi_device_advance"; break; case scsi_timeout: ascii_wait_status = "scsi_timeout"; break; case scsi_async_fault: ascii_wait_status = "scsi_async_fault"; break; default: ascii_wait_status = "unknown"; break; } DBG(2, " scsi_$wait status is %s, return_count is %d\n", ascii_wait_status, return_count); if (wait_index != scsi_device_advance) { DBG(1, "Error - SCSI timeout, or async fault\n"); com->CommandStatus.all = scsi_$operation_timeout; } else for (count = 0; count < return_count; count++) { switch (status_list[count].op_status) { case scsi_good_status: ascii_op_status = "scsi_good_status"; break; case scsi_check_condition: ascii_op_status = "scsi_check_condition"; break; case scsi_condition_met: ascii_op_status = "scsi_condition_met"; break; case scsi_rsv1: ascii_op_status = "scsi_rsv1"; break; case scsi_busy: ascii_op_status = "scsi_busy"; break; case scsi_rsv2: ascii_op_status = "scsi_rsv2"; break; case scsi_rsv3: ascii_op_status = "scsi_rsv3"; break; case scsi_rsv4: ascii_op_status = "scsi_rsv4"; break; case scsi_intermediate_good: ascii_op_status = "scsi_intermediate_good"; break; case scsi_rsv5: ascii_op_status = "scsi_rsv5"; break; case scsi_intermediate_condition_met: ascii_op_status = "scsi_intermediate_condition_met"; break; case scsi_rsv6: ascii_op_status = "scsi_rsv6"; break; case scsi_reservation_conflict: ascii_op_status = "scsi_reservation_conflict"; break; case scsi_rsv7: ascii_op_status = "scsi_rsv7"; break; case scsi_rsv8: ascii_op_status = "scsi_rsv8"; break; case scsi_rsv9: ascii_op_status = "scsi_rsv9"; break; case scsi_undefined_status: ascii_op_status = "scsi_undefined_status"; break; default: ascii_op_status = "unknown"; break; } DBG(2, " list[%d]: op=%x cmd_status=%08x, status=%s\n", count, status_list[count].op, status_list[count].cmd_status.all, ascii_op_status); switch (status_list[count].cmd_status.all) { case status_$ok: switch (status_list[count].op_status) { case scsi_good_status: break; case scsi_busy: com->CommandStatus.all = status_$ok | 0x80000000; com->SCSIStatus = scsi_busy; break; case scsi_check_condition: { static unsigned char scanner_sense_cdb[] = {3, 0, 0, 0, DomainSenseSize, 0}; static scsi_$cdb_t sense_cdb; static linteger sense_cdb_size; static scsi_$operation_id_t sense_op_id; static status_$t sense_status; static pinteger sense_return_count; static int temp; /* Issue the sense command (wire, issue, wait, unwire */ sense_cdb_size = sizeof(scanner_sense_cdb); memcpy(&sense_cdb, scanner_sense_cdb, sense_cdb_size); scsi_$do_command_2(DomainFdInfo[com->fd].scsi_handle, sense_cdb, sense_cdb_size, DomainFdInfo[com->fd].DomainSensePtr, DomainSenseSize, scsi_read, &sense_op_id, &sense_status); DomainErrorCheck(sense_status, "Executing sense command"); scsi_$wait(DomainFdInfo[com->fd].scsi_handle, DomainScsiTimeout, true, sense_op_id, 1, status_list, &sense_return_count, &sense_status); /* The following debug output is scanner specific */ DBG(2, "Sense information: Error code=%02x, ASC=%02x, ASCQ=%02x\n", ((u_char *)DomainFdInfo[com->fd].DomainSensePtr)[0], ((char *)DomainFdInfo[com->fd].DomainSensePtr)[0xc], ((char *)DomainFdInfo[com->fd].DomainSensePtr)[0xd]); DBG(2, " Sense dump:\n"); for (temp = 0; temp < DomainSenseSize; temp++) DBG(2, " %02x", ((u_char *)DomainFdInfo[com->fd].DomainSensePtr)[temp]); DBG(2, "\n"); /* see if buffer underrun - ILI/Valid are set, and command was a read */ /* Warning - this might be UMAX specific */ if ((((char *)DomainFdInfo[com->fd].DomainSensePtr)[0] == 0xf0) && (((char *)DomainFdInfo[com->fd].DomainSensePtr)[2] & 0x20) && (com->cdb.g0.cmd == 0x28)) { /* Warning - the following code is specific to endianness and int size */ /* Its also very ugly */ DBG(2, "Shortening destination length by %x bytes\n", *(int *)(((char *)DomainFdInfo[com->fd].DomainSensePtr)+3)); com->dst_size -= *(int *)(((char *)DomainFdInfo[com->fd].DomainSensePtr)+3); DBG(2, "Final dest size is %x\n", com->dst_size); } else { /* Set this status so that the sense handler can be called */ com->CommandStatus.all = status_$ok | 0x80000000; com->SCSIStatus = scsi_check_condition; } } break; default: /* I fault out in this case because I want to know about this error, and this guarantees that it will get attention. */ DBG(0, "Unrecoverable Domain/OS scsi handler error: status=%08x\n", status_list[count].op_status); exit(EXIT_FAILURE); } break; /* Handle recognized error conditions by copying the error code over */ case scsi_$operation_timeout: case scsi_$dma_underrun: /* received by some backend code */ case scsi_$hdwr_failure: /* received when both scanners were active */ com->CommandStatus = status_list[count].cmd_status; break; default: DBG(0, "Unrecoverable DomainOS scsi handler error: status=%08x\n", status_list[count].cmd_status.all); error_$print(status_list[count].cmd_status); exit(EXIT_FAILURE); } } /* Dump the buffer contents */ if (com->direction == scsi_read) { DBG(3, "first words of buffer are:\n"); for (return_count = 0; return_count < com->dst_size; return_count++) DBG(3, "%02X%c", ((unsigned char *)DomainFdInfo[com->fd].DomainSCSIPtr)[return_count], (return_count % 16) == 15 ? '\n' : ' '); DBG(3, "\n"); } } else { /* scsi_$wait failed */ DBG(1, "scsi_$wait failed, status is %08x\n", com->CommandStatus.all); } } static void DomainSCSIEnter(void) { static int count; /* Give some debug info */ DBG(1, "Entering DomainSCSIEnter, fd=%d, opcode=%02X\n", com->fd, com->cdb.all[0]); DBG(2, " CDB Contents: "); for (count = 0; count < com->cdb_size; count++) DBG(2, " %02X", com->cdb.all[count]); DBG(2, "\n"); DBG(2, "Buffer address is 0x%08x\n", DomainFdInfo[com->fd].DomainSCSIPtr); DBG(2, "Buffer size is %x\n", com->buf_size); DBG(2, "Direction is %s\n", (com->direction == scsi_read) ? "READ" : "WRITE"); /* now queue the command */ scsi_$do_command_2(DomainFdInfo[com->fd].scsi_handle, com->cdb, com->cdb_size, DomainFdInfo[com->fd].DomainSCSIPtr, com->buf_size, com->direction, &DomainFdInfo[com->fd].op_id, &com->CommandStatus); if (com->CommandStatus.all == status_$ok) { /* success, indicate status */ DBG(2, " scsi_$do_command_2 was successful, op_id is %x\n", DomainFdInfo[com->fd].op_id); /* If we supported multiple outstanding requests for one device, this would be a good breakpoint. We would store the op_id in a private place, and construct a queue for each device. This complicates things, and SANE doesn't seem to need it, so it won't be implemented. The current server architecture does the wait automatically, and status for the entire operation is returned. This means that the sanei_scsi_req_enter and sanei_scsi_req_wait calls don't make sense, and should generate an error. */ DomainSCSIWait(); } else { /* failure, print detail and return code */ DBG(1, " scsi_$do_command_2 failed, status is %08x\n", com->CommandStatus.all); } } /* This function is not currently used. */ static void DomainSCSIReqWait(void) { DBG(1, "sanei_scsi_req_wait: (id=%p)\n", NULL); return; } /* Startup the server */ static void sanei_DomainOS_init(char *path) { int done, index; long CommandTriggerValue; ec2_$ptr_t CommandAvailablePtr[1]; status_$t status; unsigned long length_mapped; DBG(1, "Starting Domain SANE Server, common area path = '%s'\n", path); com = ms_$mapl(path, strlen(path), 0, sizeof(struct DomainServerCommon), ms_$cowriters, ms_$wr, true, &length_mapped, &status); DomainErrorCheck(status, "Can't open common area"); if (length_mapped < sizeof(struct DomainServerCommon)) { DBG(0, "Error - can't open common area '%s' to required length\n", path); DBG(0, " Required length = %lx, returned length = %lx\n", sizeof(struct DomainServerCommon), length_mapped); exit(EXIT_FAILURE); } /* Make the file temporary, so it will disappear when it is closed */ ms_$mk_temporary(com, &status); DomainErrorCheck(status, "Can't make common file temporary"); DBG(2, "Domain Server common area mapped, length is %lx\n", length_mapped); /* The communication area is open, give the initial response */ ec2_$advance(&com->ResultReady, &status); DomainErrorCheck(status, "Can't advance ResultReady EC after startup"); /* Enter the command loop */ CommandAvailablePtr[0] = &com->CommandAvailable; CommandTriggerValue = ec2_$read(com->CommandAvailable) + 1; /* Inhibit asynchronous faults */ /* pfm_$inhibit();*/ /* Establish the fault handler */ FaultHandle = pfm_$establish_fault_handler(pfm_$all_faults, 0, FaultHandler, &status); DomainErrorCheck(status, "Can't establish fault handler"); done = 0; do { /* Wait for the command */ DBG(2, "Waiting for incoming command\n"); do { index = ec2_$wait_svc(CommandAvailablePtr, &CommandTriggerValue, 1, &status); } while (status.all == ec2_$wait_quit); DomainErrorCheck(status, "Error waiting on CommandAvailable EC"); assert (index == 1); /* Get the trigger value for next time - this avoids a race/deadlock */ CommandTriggerValue = ec2_$read(com->CommandAvailable) + 1; /* decode/execute the command */ DBG(2, "Received a command - opcode is %x\n", com->opcode); switch(com->opcode) { case Open: DomainSCSIOpen(); ec2_$advance(&com->CommandAccepted, &status); DomainErrorCheck(status, "Can't advance CommandAccepted EC on open"); break; case Close: DomainSCSIClose(); ec2_$advance(&com->CommandAccepted, &status); DomainErrorCheck(status, "Can't advance CommandAccepted EC on close"); break; case Enter: DomainSCSIEnter(); ec2_$advance(&com->CommandAccepted, &status); DomainErrorCheck(status, "Can't advance CommandAccepted EC on enter"); break; case Exit: done = 1; /* This lets the parent know that the command was accepted. It can be used to avoid sending a signal. */ ec2_$advance(&com->CommandAccepted, &status); DomainErrorCheck(status, "Can't advance CommandAccepted EC on exit"); break; default: DBG(1, "Invalid command %x received\n", com->opcode); } DBG(2, "Command processing complete\n"); } while (!done); /* This would be a good place to close all devices, but for now we'll assume they have already been closed by a well-behaved program */ /* Unmap the common area */ ms_$unmap(com, sizeof(struct DomainServerCommon), &status); DomainErrorCheck(status, "Error unmapping common area"); DBG(1, "Exiting Domain SANE Server\n"); /* pfm_$enable();*/ exit(EXIT_SUCCESS); } sane-backends-extras-1.0.22.3ubuntu1/sanei/sanei_wire.c0000664000000000000000000004401111475557446017565 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 1997 David Mosberger-Tang This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ #include "../include/sane/config.h" #include #include #include #include #include "../include/sane/sane.h" #include "../include/sane/sanei_wire.h" #define BACKEND_NAME sanei_wire #include "../include/sane/sanei_backend.h" void sanei_w_space (Wire * w, size_t howmuch) { size_t nbytes, left_over; int fd = w->io.fd; ssize_t nread, nwritten; DBG (3, "sanei_w_space: %lu bytes for wire %d\n", (u_long) howmuch, fd); if (howmuch > w->buffer.size) DBG (2, "sanei_w_space: bigger than buffer (%lu bytes), " "may be flush()\n", (u_long) w->buffer.size); if (w->status != 0) { DBG (1, "sanei_w_space: wire is in invalid state %d\n", w->status); return; } if (w->buffer.curr + howmuch > w->buffer.end) { DBG (4, "sanei_w_space: free buffer size is %lu\n", (u_long) (w->buffer.end - w->buffer.curr)); switch (w->direction) { case WIRE_ENCODE: nbytes = w->buffer.curr - w->buffer.start; w->buffer.curr = w->buffer.start; DBG (4, "sanei_w_space: ENCODE: sending %lu bytes\n", (u_long) nbytes); while (nbytes > 0) { nwritten = (*w->io.write) (fd, w->buffer.curr, nbytes); if (nwritten < 0) { DBG (1, "sanei_w_space: ENCODE: write failed (%d)\n", errno); w->status = errno; return; } w->buffer.curr += nwritten; nbytes -= nwritten; } w->buffer.curr = w->buffer.start; w->buffer.end = w->buffer.start + w->buffer.size; DBG (4, "sanei_w_space: ENCODE: free buffer is now %lu\n", (u_long) w->buffer.size); break; case WIRE_DECODE: left_over = w->buffer.end - w->buffer.curr; if ((signed) left_over < 0) { DBG (1, "sanei_w_space: DECODE: buffer underflow\n"); return; } if (left_over) { DBG (4, "sanei_w_space: DECODE: %lu bytes left in buffer\n", (u_long) left_over); memmove (w->buffer.start, w->buffer.curr, left_over); } w->buffer.curr = w->buffer.start; w->buffer.end = w->buffer.start + left_over; DBG (4, "sanei_w_space: DECODE: receiving data\n"); do { nread = (*w->io.read) (fd, w->buffer.end, w->buffer.size - left_over); if (nread <= 0) { DBG (2, "sanei_w_space: DECODE: no data received (%d)\n", errno); if (nread == 0) errno = EINVAL; w->status = errno; return; } left_over += nread; w->buffer.end += nread; } while (left_over < howmuch); DBG (4, "sanei_w_space: DECODE: %lu bytes read\n", (u_long) (w->buffer.end - w->buffer.start)); break; case WIRE_FREE: DBG (4, "sanei_w_space: FREE: doing nothing for free operation\n"); break; } } DBG (4, "sanei_w_space: done\n"); } void sanei_w_void (Wire * w) { DBG (3, "sanei_w_void: wire %d (void debug output)\n", w->io.fd); } void sanei_w_array (Wire * w, SANE_Word * len_ptr, void **v, WireCodecFunc w_element, size_t element_size) { SANE_Word len; char *val; int i; DBG (3, "sanei_w_array: wire %d, elements of size %lu\n", w->io.fd, (u_long) element_size); if (w->direction == WIRE_FREE) { if (*len_ptr && *v) { DBG (4, "sanei_w_array: FREE: freeing array (%d elements)\n", *len_ptr); val = *v; for (i = 0; i < *len_ptr; ++i) { (*w_element) (w, val); val += element_size; } free (*v); w->allocated_memory -= (*len_ptr * element_size); } else DBG (1, "sanei_w_array: FREE: tried to free array but *len_ptr or *v " "was NULL\n"); DBG (4, "sanei_w_array: FREE: done\n"); return; } if (w->direction == WIRE_ENCODE) len = *len_ptr; DBG (4, "sanei_w_array: send/receive array length\n"); sanei_w_word (w, &len); if (w->status) { DBG (1, "sanei_w_array: bad status: %d\n", w->status); return; } DBG (4, "sanei_w_array: array has %d elements\n", len); if (w->direction == WIRE_DECODE) { *len_ptr = len; if (len) { if (((unsigned int) len) > MAX_MEM || ((unsigned int) len * element_size) > MAX_MEM || (w->allocated_memory + len * element_size) > MAX_MEM) { DBG (0, "sanei_w_array: DECODE: maximum amount of allocated memory " "exceeded (limit: %u, new allocation: %lu, total: %lu bytes)\n", MAX_MEM, (unsigned long)(len * element_size), (unsigned long)(MAX_MEM + len * element_size)); w->status = ENOMEM; return; } *v = malloc (len * element_size); if (*v == 0) { /* Malloc failed, so return an error. */ DBG (1, "sanei_w_array: DECODE: not enough free memory\n"); w->status = ENOMEM; return; } memset (*v, 0, len * element_size); w->allocated_memory += (len * element_size); } else *v = 0; } val = *v; DBG (4, "sanei_w_array: transferring array elements\n"); for (i = 0; i < len; ++i) { (*w_element) (w, val); val += element_size; if (w->status) { DBG (1, "sanei_w_array: bad status: %d\n", w->status); return; } } DBG (4, "sanei_w_array: done\n"); } void sanei_w_ptr (Wire * w, void **v, WireCodecFunc w_value, size_t value_size) { SANE_Word is_null; DBG (3, "sanei_w_ptr: wire %d, value pointer at is %lu bytes\n", w->io.fd, (u_long) value_size); if (w->direction == WIRE_FREE) { if (*v && value_size) { DBG (4, "sanei_w_ptr: FREE: freeing value\n"); (*w_value) (w, *v); free (*v); w->allocated_memory -= value_size; } else DBG (1, "sanei_w_ptr: FREE: tried to free value but *v or value_size " "was NULL\n"); DBG (4, "sanei_w_ptr: FREE: done\n"); return; } if (w->direction == WIRE_ENCODE) is_null = (*v == 0); DBG (4, "sanei_w_ptr: send/receive is_null\n"); sanei_w_word (w, &is_null); if (w->status) { DBG (1, "sanei_w_ptr: bad status: %d\n", w->status); return; } if (!is_null) { if (w->direction == WIRE_DECODE) { DBG (4, "sanei_w_ptr: DECODE: receive data pointed at\n"); if (value_size > MAX_MEM) { DBG (0, "sanei_w_ptr: DECODE: maximum amount of allocated memory " "exceeded (limit: %u, new allocation: %lu, total: %lu bytes)\n", MAX_MEM, (unsigned long)value_size, (unsigned long)(w->allocated_memory + value_size)); w->status = ENOMEM; return; } *v = malloc (value_size); if (*v == 0) { /* Malloc failed, so return an error. */ DBG (1, "sanei_w_ptr: DECODE: not enough free memory\n"); w->status = ENOMEM; return; } w->allocated_memory += value_size; memset (*v, 0, value_size); } (*w_value) (w, *v); } else if (w->direction == WIRE_DECODE) *v = 0; DBG (4, "sanei_w_ptr: done\n"); } void sanei_w_byte (Wire * w, SANE_Byte * v) { DBG (3, "sanei_w_byte: wire %d\n", w->io.fd); (*w->codec.w_byte) (w, v); if (w->direction != WIRE_FREE) DBG (4, "sanei_w_byte: value = %d\n", *v); } void sanei_w_char (Wire * w, SANE_Char * v) { DBG (3, "sanei_w_char: wire %d\n", w->io.fd); (*w->codec.w_char) (w, v); if (w->direction != WIRE_FREE) DBG (4, "sanei_w_char: value = %d\n", *v); } void sanei_w_word (Wire * w, SANE_Word * v) { DBG (3, "sanei_w_word: wire %d\n", w->io.fd); (*w->codec.w_word) (w, v); if (w->direction != WIRE_FREE) DBG (4, "sanei_w_word: value = %d\n", *v); } void sanei_w_string (Wire * w, SANE_String * v) { DBG (3, "sanei_w_string: wire %d\n", w->io.fd); (*w->codec.w_string) (w, v); if (w->direction != WIRE_FREE && w->status == 0) DBG (4, "sanei_w_string: value = %s\n", *v); } void sanei_w_status (Wire * w, SANE_Status * v) { SANE_Word word = *v; DBG (3, "sanei_w_status: wire %d\n", w->io.fd); sanei_w_word (w, &word); if (w->direction == WIRE_DECODE) *v = word; if (w->direction != WIRE_FREE) DBG (4, "sanei_w_status: value = %d\n", word); } void sanei_w_bool (Wire * w, SANE_Bool * v) { SANE_Word word = *v; DBG (3, "sanei_w_bool: wire %d\n", w->io.fd); sanei_w_word (w, &word); if (w->direction == WIRE_DECODE) *v = word; if (w->direction != WIRE_FREE) DBG (4, "sanei_w_bool: value = %s\n", ((word == SANE_TRUE) ? ("true") : ("false"))); } void sanei_w_constraint_type (Wire * w, SANE_Constraint_Type * v) { SANE_Word word = *v; DBG (3, "sanei_w_constraint_type: wire %d\n", w->io.fd); sanei_w_word (w, &word); if (w->direction == WIRE_DECODE) *v = word; if (w->direction != WIRE_FREE) DBG (4, "sanei_w_constraint_type: value = %d\n", word); } void sanei_w_value_type (Wire * w, SANE_Value_Type * v) { SANE_Word word = *v; DBG (3, "sanei_w_value_type: wire %d\n", w->io.fd); sanei_w_word (w, &word); if (w->direction == WIRE_DECODE) *v = word; if (w->direction != WIRE_FREE) DBG (4, "sanei_w_value_type: value = %d\n", word); } void sanei_w_unit (Wire * w, SANE_Unit * v) { SANE_Word word = *v; DBG (3, "sanei_w_unit: wire %d\n", w->io.fd); sanei_w_word (w, &word); if (w->direction == WIRE_DECODE) *v = word; if (w->direction != WIRE_FREE) DBG (4, "sanei_w_unit: value = %d\n", word); /* gosh... all the sane_w_something should be a macro or something */ } void sanei_w_action (Wire * w, SANE_Action * v) { SANE_Word word = *v; DBG (3, "sanei_w_action: wire %d\n", w->io.fd); sanei_w_word (w, &word); if (w->direction == WIRE_DECODE) *v = word; if (w->direction != WIRE_FREE) DBG (4, "sanei_w_action: value = %d\n", word); } void sanei_w_frame (Wire * w, SANE_Frame * v) { SANE_Word word = *v; DBG (3, "sanei_w_frame: wire %d\n", w->io.fd); sanei_w_word (w, &word); if (w->direction == WIRE_DECODE) *v = word; if (w->direction != WIRE_FREE) DBG (4, "sanei_w_frame: value = %d\n", word); } void sanei_w_range (Wire * w, SANE_Range * v) { DBG (3, "sanei_w_range: wire %d\n", w->io.fd); sanei_w_word (w, &v->min); sanei_w_word (w, &v->max); sanei_w_word (w, &v->quant); if (w->direction != WIRE_FREE) DBG (4, "sanei_w_range: min/max/step = %f/%f/%f\n", SANE_UNFIX (v->min), SANE_UNFIX (v->max), SANE_UNFIX (v->quant)); } void sanei_w_device (Wire * w, SANE_Device * v) { DBG (3, "sanei_w_device: wire %d\n", w->io.fd); sanei_w_string (w, (SANE_String *) & v->name); sanei_w_string (w, (SANE_String *) & v->vendor); sanei_w_string (w, (SANE_String *) & v->model); sanei_w_string (w, (SANE_String *) & v->type); if (w->direction != WIRE_FREE) DBG (4, "sanei_w_device: %s %s from %s (%s)\n", v->name, v->model, v->vendor, v->type); } void sanei_w_device_ptr (Wire * w, SANE_Device ** v) { DBG (3, "sanei_w_device_ptr: wire %d\n", w->io.fd); sanei_w_ptr (w, (void **) v, (WireCodecFunc) sanei_w_device, sizeof (**v)); if (w->direction != WIRE_FREE) DBG (4, "sanei_w_device_ptr: device struct at %p\n", (void*) *v); } void sanei_w_option_descriptor (Wire * w, SANE_Option_Descriptor * v) { SANE_Word len; DBG (3, "sanei_w_option_descriptor: wire %d\n", w->io.fd); sanei_w_string (w, (SANE_String *) & v->name); sanei_w_string (w, (SANE_String *) & v->title); sanei_w_string (w, (SANE_String *) & v->desc); sanei_w_value_type (w, &v->type); sanei_w_unit (w, &v->unit); sanei_w_word (w, &v->size); sanei_w_word (w, &v->cap); sanei_w_constraint_type (w, &v->constraint_type); if (w->direction != WIRE_FREE) DBG (4, "sanei_w_option_descriptor: option %s\n", v->name); switch (v->constraint_type) { case SANE_CONSTRAINT_NONE: break; case SANE_CONSTRAINT_RANGE: sanei_w_ptr (w, (void **) &v->constraint.range, (WireCodecFunc) sanei_w_range, sizeof (SANE_Range)); break; case SANE_CONSTRAINT_WORD_LIST: if (w->direction != WIRE_DECODE) len = v->constraint.word_list[0] + 1; sanei_w_array (w, &len, (void **) &v->constraint.word_list, w->codec.w_word, sizeof (SANE_Word)); break; case SANE_CONSTRAINT_STRING_LIST: if (w->direction != WIRE_DECODE) { for (len = 0; v->constraint.string_list[len]; ++len); ++len; /* send NULL string, too */ } sanei_w_array (w, &len, (void **) &v->constraint.string_list, w->codec.w_string, sizeof (SANE_String)); break; } DBG (4, "sanei_w_option_descriptor: done\n"); } void sanei_w_option_descriptor_ptr (Wire * w, SANE_Option_Descriptor ** v) { DBG (3, "sanei_w_option_descriptor_ptr: wire %d\n", w->io.fd); sanei_w_ptr (w, (void **) v, (WireCodecFunc) sanei_w_option_descriptor, sizeof (**v)); DBG (4, "sanei_w_option_descriptor_ptr: done\n"); } void sanei_w_parameters (Wire * w, SANE_Parameters * v) { DBG (3, "sanei_w_parameters: wire %d\n", w->io.fd); sanei_w_frame (w, &v->format); sanei_w_bool (w, &v->last_frame); sanei_w_word (w, &v->bytes_per_line); sanei_w_word (w, &v->pixels_per_line); sanei_w_word (w, &v->lines); sanei_w_word (w, &v->depth); if (w->direction != WIRE_FREE) DBG (4, "sanei_w_parameters: format/last/bpl/ppl/lines/depth = " "%d/%d/%d/%d/%d/%d\n", v->format, v->last_frame, v->bytes_per_line, v->pixels_per_line, v->lines, v->depth); } static void flush (Wire * w) { DBG (3, "flush: wire %d\n", w->io.fd); if (w->direction == WIRE_ENCODE) sanei_w_space (w, w->buffer.size + 1); else if (w->direction == WIRE_DECODE) w->buffer.curr = w->buffer.end = w->buffer.start; if (w->status != 0) DBG (2, "flush: error status %d\n", w->status); DBG (4, "flush: wire flushed\n"); } void sanei_w_set_dir (Wire * w, WireDirection dir) { DBG (3, "sanei_w_set_dir: wire %d, old direction WIRE_%s\n", w->io.fd, w->direction == WIRE_ENCODE ? "ENCODE" : (w->direction == WIRE_DECODE ? "DECODE" : "FREE")); if (w->direction == WIRE_DECODE && w->buffer.curr != w->buffer.end) DBG (1, "sanei_w_set_dir: WARNING: will delete %lu bytes from buffer\n", (u_long) (w->buffer.end - w->buffer.curr)); flush (w); w->direction = dir; DBG (4, "sanei_w_set_dir: direction changed\n"); flush (w); DBG (3, "sanei_w_set_dir: wire %d, new direction WIRE_%s\n", w->io.fd, dir == WIRE_ENCODE ? "ENCODE" : (dir == WIRE_DECODE ? "DECODE" : "FREE")); } void sanei_w_call (Wire * w, SANE_Word procnum, WireCodecFunc w_arg, void *arg, WireCodecFunc w_reply, void *reply) { DBG (3, "sanei_w_call: wire %d (old status %d)\n", w->io.fd, w->status); w->status = 0; sanei_w_set_dir (w, WIRE_ENCODE); DBG (4, "sanei_w_call: sending request (procedure number: %d)\n", procnum); sanei_w_word (w, &procnum); (*w_arg) (w, arg); if (w->status == 0) { DBG (4, "sanei_w_call: receiving reply\n"); sanei_w_set_dir (w, WIRE_DECODE); (*w_reply) (w, reply); } if (w->status != 0) DBG (2, "sanei_w_call: error status %d\n", w->status); DBG (4, "sanei_w_call: done\n"); } void sanei_w_reply (Wire * w, WireCodecFunc w_reply, void *reply) { DBG (3, "sanei_w_reply: wire %d (old status %d)\n", w->io.fd, w->status); w->status = 0; sanei_w_set_dir (w, WIRE_ENCODE); (*w_reply) (w, reply); flush (w); if (w->status != 0) DBG (2, "sanei_w_reply: error status %d\n", w->status); DBG (4, "sanei_w_reply: done\n"); } void sanei_w_free (Wire * w, WireCodecFunc w_reply, void *reply) { WireDirection saved_dir = w->direction; DBG (3, "sanei_w_free: wire %d\n", w->io.fd); w->direction = WIRE_FREE; (*w_reply) (w, reply); w->direction = saved_dir; if (w->status != 0) DBG (2, "sanei_w_free: error status %d\n", w->status); DBG (4, "sanei_w_free: done\n"); } void sanei_w_init (Wire * w, void (*codec_init_func) (Wire *)) { DBG_INIT (); DBG (3, "sanei_w_init: initializing\n"); w->status = 0; w->direction = WIRE_ENCODE; w->buffer.size = 8192; w->buffer.start = malloc (w->buffer.size); if (w->buffer.start == 0) { /* Malloc failed, so return an error. */ w->status = ENOMEM; DBG (1, "sanei_w_init: not enough free memory\n"); } w->buffer.curr = w->buffer.start; w->buffer.end = w->buffer.start + w->buffer.size; if (codec_init_func != 0) { DBG (4, "sanei_w_init: initializing codec\n"); (*codec_init_func) (w); } w->allocated_memory = 0; DBG (4, "sanei_w_init: done\n"); } void sanei_w_exit (Wire * w) { DBG (3, "sanei_w_exit: wire %d\n", w->io.fd); if (w->buffer.start) { DBG (4, "sanei_w_exit: freeing buffer\n"); free (w->buffer.start); } w->buffer.start = 0; w->buffer.size = 0; DBG (4, "sanei_w_exit: done\n"); } sane-backends-extras-1.0.22.3ubuntu1/sanei/sanei_pv8630.c0000664000000000000000000001406611475557446017574 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 2000 Adrian Perez Jorge Copyright (C) 2001 Frank Zago Copyright (C) 2001 Marcio Teixeira This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. Interface files for the PowerVision 8630 chip, a USB to parallel converter used in many scanners. */ #include "../include/sane/config.h" #include #include #define BACKEND_NAME sanei_pv8630 #include "../include/sane/sane.h" #include "../include/sane/sanei_debug.h" #include "../include/sane/sanei_usb.h" #include "../include/sane/sanei_pv8630.h" #define DBG_error 1 #define DBG_info 5 void sanei_pv8630_init (void) { DBG_INIT(); } /* Write one control byte */ SANE_Status sanei_pv8630_write_byte (int fd, SANEI_PV_Index index, SANE_Byte byte) { SANE_Status status; DBG(DBG_info, "sanei_pv8630_write_byte - index=%d, byte=%d\n", index, byte); status = sanei_usb_control_msg (fd, 0x40, PV8630_REQ_WRITEBYTE, byte, index, 0, NULL); if (status != SANE_STATUS_GOOD) DBG (DBG_error, "sanei_pv8630_write_byte error\n"); return status; } /* Read one control byte */ SANE_Status sanei_pv8630_read_byte (int fd, SANEI_PV_Index index, SANE_Byte * byte) { SANE_Status status; DBG(DBG_info, "sanei_pv8630_read_byte - index=%d, byte=%p\n", index, byte); status = sanei_usb_control_msg (fd, 0xc0, PV8630_REQ_READBYTE, 0, index, 1, byte); if (status != SANE_STATUS_GOOD) DBG (DBG_error, "sanei_pv8630_read_byte error\n"); return status; } /* Prepare a bulk read. len is the size of the data going to be * read by pv8630_bulkread(). */ SANE_Status sanei_pv8630_prep_bulkread (int fd, int len) { SANE_Status status; status = sanei_usb_control_msg (fd, 0x40, PV8630_REQ_EPPBULKREAD, len & 0xffff, len >> 16, 0, NULL); if (status != SANE_STATUS_GOOD) DBG (DBG_error, "sanei_pv8630_prep_bulkread error\n"); return status; } /* Prepare a bulk write. len is the size of the data going to be * written by pv8630_bulkwrite(). */ SANE_Status sanei_pv8630_prep_bulkwrite (int fd, int len) { SANE_Status status; status = sanei_usb_control_msg (fd, 0x40, PV8630_REQ_EPPBULKWRITE, len & 0xffff, len >> 16, 0, NULL); if (status != SANE_STATUS_GOOD) DBG (DBG_error, "sanei_pv8630_prep_bulkwrite error\n"); return status; } /* Flush the buffer. */ SANE_Status sanei_pv8630_flush_buffer (int fd) { SANE_Status status; status = sanei_usb_control_msg (fd, 0x40, PV8630_REQ_FLUSHBUFFER, 0, 0, 0, NULL); if (status != SANE_STATUS_GOOD) DBG (DBG_error, "sanei_pv8630_flush_buffer error\n"); return status; } /* Do a bulk write. The length must have previously been sent via * pv8630_prep_bulkwrite(). */ SANE_Status sanei_pv8630_bulkwrite (int fd, const void *data, size_t * len) { SANE_Status status; status = sanei_usb_write_bulk (fd, (const SANE_Byte *) data, len); if (status != SANE_STATUS_GOOD) DBG (DBG_error, "sanei_pv8630_bulkwrite error\n"); return status; } /* Do a bulk read. The length must have previously been sent via * pv8630_prep_bulkread(). */ SANE_Status sanei_pv8630_bulkread (int fd, void *data, size_t * len) { SANE_Status status; status = sanei_usb_read_bulk (fd, data, len); if (status != SANE_STATUS_GOOD) DBG (DBG_error, "sanei_pv8630_bulkread error\n"); return status; } /* Expects a specific byte in a register */ SANE_Status sanei_pv8630_xpect_byte (int fd, SANEI_PV_Index index, SANE_Byte value, SANE_Byte mask) { SANE_Status status; SANE_Byte s; status = sanei_pv8630_read_byte (fd, index, &s); if (status != SANE_STATUS_GOOD) return status; if ((s & mask) != value) { DBG (DBG_error, "sanei_pv8630_xpect_byte: expected %x, got %x\n", value, s); return SANE_STATUS_IO_ERROR; } return SANE_STATUS_GOOD; } /* Wait for the status register to present a given status. A timeout value is given in tenths of a second. */ SANE_Status sanei_pv8630_wait_byte (int fd, SANEI_PV_Index index, SANE_Byte value, SANE_Byte mask, int timeout) { SANE_Status status; SANE_Byte s; int n; for (n = 0; n < timeout; n++) { status = sanei_pv8630_read_byte (fd, index, &s); if (status != SANE_STATUS_GOOD) return status; if ((s & mask) == value) return SANE_STATUS_GOOD; usleep (100000); } DBG (DBG_error, "sanei_pv8630_wait_byte: timeout waiting for %x (got %x)\n", value, s); return SANE_STATUS_IO_ERROR; } sane-backends-extras-1.0.22.3ubuntu1/sanei/sanei_constrain_value.c0000664000000000000000000001710011475557446022012 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 1996, 1997 David Mosberger-Tang and Andreas Beck This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ #include "../include/sane/config.h" #include #include #include #include #include "../include/sane/sane.h" #include "../include/sane/sanei.h" SANE_Status sanei_check_value (const SANE_Option_Descriptor * opt, void *value) { const SANE_String_Const *string_list; const SANE_Word *word_list; int i, count; const SANE_Range *range; SANE_Word w, v, *array; SANE_Bool *barray; size_t len; switch (opt->constraint_type) { case SANE_CONSTRAINT_RANGE: /* single values are treated as arrays of length 1 */ array = (SANE_Word *) value; /* compute number of elements */ if (opt->size > 0) { count = opt->size / sizeof (SANE_Word); } else { count = 1; } range = opt->constraint.range; /* for each element of the array, we check according to the constraint */ for (i = 0; i < count; i++) { /* test for min and max */ if (array[i] < range->min || array[i] > range->max) return SANE_STATUS_INVAL; /* check quantization */ if (range->quant) { v = (unsigned int) (array[i] - range->min + range->quant / 2) / range->quant; v = v * range->quant + range->min; if (v != array[i]) return SANE_STATUS_INVAL; } } break; case SANE_CONSTRAINT_WORD_LIST: w = *(SANE_Word *) value; word_list = opt->constraint.word_list; for (i = 1; w != word_list[i]; ++i) if (i >= word_list[0]) return SANE_STATUS_INVAL; break; case SANE_CONSTRAINT_STRING_LIST: string_list = opt->constraint.string_list; len = strlen (value); for (i = 0; string_list[i]; ++i) if (strncmp (value, string_list[i], len) == 0 && len == strlen (string_list[i])) return SANE_STATUS_GOOD; return SANE_STATUS_INVAL; case SANE_CONSTRAINT_NONE: switch (opt->type) { case SANE_TYPE_BOOL: /* single values are treated as arrays of length 1 */ array = (SANE_Word *) value; /* compute number of elements */ if (opt->size > 0) { count = opt->size / sizeof (SANE_Bool); } else { count = 1; } barray = (SANE_Bool *) value; /* test each boolean value in the array */ for (i = 0; i < count; i++) { if (barray[i] != SANE_TRUE && barray[i] != SANE_FALSE) return SANE_STATUS_INVAL; } break; default: break; } default: break; } return SANE_STATUS_GOOD; } /** * This function apply the constraint defined by the option descriptor * to the given value, and update the info flags holder if needed. It * return SANE_STATUS_INVAL if the constraint cannot be applied, else * it returns SANE_STATUS_GOOD. */ SANE_Status sanei_constrain_value (const SANE_Option_Descriptor * opt, void *value, SANE_Word * info) { const SANE_String_Const *string_list; const SANE_Word *word_list; int i, k, num_matches, match; const SANE_Range *range; SANE_Word w, v, *array; SANE_Bool b; size_t len; switch (opt->constraint_type) { case SANE_CONSTRAINT_RANGE: /* single values are treated as arrays of length 1 */ array = (SANE_Word *) value; /* compute number of elements */ if (opt->size > 0) { k = opt->size / sizeof (SANE_Word); } else { k = 1; } range = opt->constraint.range; /* for each element of the array, we apply the constraint */ for (i = 0; i < k; i++) { /* constrain min */ if (array[i] < range->min) { array[i] = range->min; if (info) { *info |= SANE_INFO_INEXACT; } } /* constrain max */ if (array[i] > range->max) { array[i] = range->max; if (info) { *info |= SANE_INFO_INEXACT; } } /* quantization */ if (range->quant) { v = (unsigned int) (array[i] - range->min + range->quant / 2) / range->quant; v = v * range->quant + range->min; if (v != array[i]) { array[i] = v; if (info) *info |= SANE_INFO_INEXACT; } } } break; case SANE_CONSTRAINT_WORD_LIST: /* If there is no exact match in the list, use the nearest value */ w = *(SANE_Word *) value; word_list = opt->constraint.word_list; for (i = 1, k = 1, v = abs (w - word_list[1]); i <= word_list[0]; i++) { SANE_Word vh; if ((vh = abs (w - word_list[i])) < v) { v = vh; k = i; } } if (w != word_list[k]) { *(SANE_Word *) value = word_list[k]; if (info) *info |= SANE_INFO_INEXACT; } break; case SANE_CONSTRAINT_STRING_LIST: /* Matching algorithm: take the longest unique match ignoring case. If there is an exact match, it is admissible even if the same string is a prefix of a longer option name. */ string_list = opt->constraint.string_list; len = strlen (value); /* count how many matches of length LEN characters we have: */ num_matches = 0; match = -1; for (i = 0; string_list[i]; ++i) if (strncasecmp (value, string_list[i], len) == 0 && len <= strlen (string_list[i])) { match = i; if (len == strlen (string_list[i])) { /* exact match... */ if (strcmp (value, string_list[i]) != 0) /* ...but case differs */ strcpy (value, string_list[match]); return SANE_STATUS_GOOD; } ++num_matches; } if (num_matches > 1) return SANE_STATUS_INVAL; else if (num_matches == 1) { strcpy (value, string_list[match]); return SANE_STATUS_GOOD; } return SANE_STATUS_INVAL; case SANE_CONSTRAINT_NONE: switch (opt->type) { case SANE_TYPE_BOOL: b = *(SANE_Bool *) value; if (b != SANE_TRUE && b != SANE_FALSE) return SANE_STATUS_INVAL; break; default: break; } default: break; } return SANE_STATUS_GOOD; } sane-backends-extras-1.0.22.3ubuntu1/sanei/sanei_net.c0000664000000000000000000001241711475557446017412 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 1997 David Mosberger-Tang This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ #include "../include/sane/config.h" #include #include #include "../include/sane/sane.h" #include "../include/sane/sanei_net.h" void sanei_w_init_req (Wire *w, SANE_Init_Req *req) { sanei_w_word (w, &req->version_code); sanei_w_string (w, &req->username); } void sanei_w_init_reply (Wire *w, SANE_Init_Reply *reply) { sanei_w_status (w, &reply->status); sanei_w_word (w, &reply->version_code); } void sanei_w_get_devices_reply (Wire *w, SANE_Get_Devices_Reply *reply) { SANE_Word len; if (w->direction != WIRE_DECODE) { if (reply->device_list) { for (len = 0; reply->device_list[len]; ++len); ++len; } else len = 0; } sanei_w_status (w, &reply->status); sanei_w_array (w, &len, (void *) &reply->device_list, (WireCodecFunc) sanei_w_device_ptr, sizeof (reply->device_list[0])); } void sanei_w_open_reply (Wire *w, SANE_Open_Reply *reply) { sanei_w_status (w, &reply->status); sanei_w_word (w, &reply->handle); sanei_w_string (w, &reply->resource_to_authorize); } static void w_option_value (Wire *w, SANE_Word type, SANE_Word size, void **value) { SANE_Word len, element_size; WireCodecFunc w_value; switch (type) { case SANE_TYPE_BOOL: case SANE_TYPE_INT: case SANE_TYPE_FIXED: w_value = (WireCodecFunc) sanei_w_word; element_size = sizeof (SANE_Word); len = size / element_size; break; case SANE_TYPE_STRING: w_value = (WireCodecFunc) sanei_w_char; element_size = sizeof (SANE_Char); len = size; break; case SANE_TYPE_BUTTON: case SANE_TYPE_GROUP: w_value = (WireCodecFunc) sanei_w_void; len = 0; element_size = 0; break; default: w->status = EINVAL; return; } sanei_w_array (w, &len, value, w_value, element_size); } void sanei_w_option_descriptor_array (Wire *w, SANE_Option_Descriptor_Array *a) { sanei_w_array (w, &a->num_options, (void **) &a->desc, (WireCodecFunc) sanei_w_option_descriptor_ptr, sizeof (a->desc[0])); } void sanei_w_control_option_req (Wire *w, SANE_Control_Option_Req *req) { sanei_w_word (w, &req->handle); sanei_w_word (w, &req->option); sanei_w_word (w, &req->action); /* Up to and including version 2, we incorrectly attempted to encode the option value even the action was SANE_ACTION_SET_AUTO. */ if (w->version < 3 || req->action != SANE_ACTION_SET_AUTO) { sanei_w_word (w, &req->value_type); sanei_w_word (w, &req->value_size); w_option_value (w, req->value_type, req->value_size, &req->value); } } void sanei_w_control_option_reply (Wire *w, SANE_Control_Option_Reply *reply) { sanei_w_status (w, &reply->status); sanei_w_word (w, &reply->info); sanei_w_word (w, &reply->value_type); sanei_w_word (w, &reply->value_size); w_option_value (w, reply->value_type, reply->value_size, &reply->value); sanei_w_string (w, &reply->resource_to_authorize); } void sanei_w_get_parameters_reply (Wire *w, SANE_Get_Parameters_Reply *reply) { sanei_w_status (w, &reply->status); sanei_w_parameters (w, &reply->params); } void sanei_w_start_reply (Wire *w, SANE_Start_Reply *reply) { sanei_w_status (w, &reply->status); sanei_w_word (w, &reply->port); sanei_w_word (w, &reply->byte_order); sanei_w_string (w, &reply->resource_to_authorize); } void sanei_w_authorization_req (Wire *w, SANE_Authorization_Req *req) { sanei_w_string (w, &req->resource); sanei_w_string (w, &req->username); sanei_w_string (w, &req->password); } sane-backends-extras-1.0.22.3ubuntu1/sanei/os2_srb.h0000664000000000000000000001635211475557446017025 0ustar /*************************************************************************** * * * ASPI Router Library * * * * This is a sample library which shows how to send SRB's to the * * ASPI Router device driver. USE AT YOUR OWN RISK!! * * * * Version 1.01 - June 1997 * * Daniel Dorau (woodst@cs.tu-berlin.de) * * * * Changes since 1.00: * * abort(), AbortSRB added * * * ***************************************************************************/ #pragma pack(1) /* SRB command */ #define SRB_Inquiry 0x00 #define SRB_Device 0x01 #define SRB_Command 0x02 #define SRB_Abort 0x03 #define SRB_Reset 0x04 #define SRB_Param 0x05 /* SRB status */ #define SRB_Busy 0x00 /* SCSI request in progress */ #define SRB_Done 0x01 /* SCSI request completed without error */ #define SRB_Aborted 0x02 /* SCSI aborted by host */ #define SRB_BadAbort 0x03 /* Unable to abort SCSI request */ #define SRB_Error 0x04 /* SCSI request completed with error */ #define SRB_BusyPost 0x10 /* SCSI request in progress with POST - Nokia */ #define SRB_InvalidCmd 0x80 /* Invalid SCSI request */ #define SRB_InvalidHA 0x81 /* Invalid Hhost adapter number */ #define SRB_BadDevice 0x82 /* SCSI device not installed */ /* SRB flags */ #define SRB_Post 0x01 /* Post vector valid */ #define SRB_Link 0x02 /* Link vector valid */ #define SRB_SG 0x04 /* Nokia: scatter/gather */ /* S/G: n * (4 bytes length, 4 bytes addr) */ /* No of s/g items not limited by HA spec. */ #define SRB_NoCheck 0x00 /* determined by command, not checked */ #define SRB_Read 0x08 /* target to host, length checked */ #define SRB_Write 0x10 /* host to target, length checked */ #define SRB_NoTransfer 0x18 /* no data transfer */ #define SRB_DirMask 0x18 /* bit mask */ /* SRB host adapter status */ #define SRB_NoError 0x00 /* No host adapter detected error */ #define SRB_Timeout 0x11 /* Selection timeout */ #define SRB_DataLength 0x12 /* Data over/underrun */ #define SRB_BusFree 0x13 /* Unexpected bus free */ #define SRB_BusSequence 0x14 /* Target bus sequence failure */ /* SRB target status field */ #define SRB_NoStatus 0x00 /* No target status */ #define SRB_CheckStatus 0x02 /* Check status (sense data valid) */ #define SRB_LUN_Busy 0x08 /* Specified LUN is busy */ #define SRB_Reserved 0x18 /* Reservation conflict */ #define MaxCDBStatus 64 /* max size of CDB + status */ typedef struct SRB SRB; struct SRB { unsigned char cmd, /* 00 */ status, /* 01 */ ha_num, /* 02 */ flags; /* 03 */ unsigned long res_04_07; /* 04..07 */ union { /* 08 */ /* SRB_Inquiry */ struct { unsigned char num_ha, /* 08 */ ha_target, /* 09 */ aspimgr_id[16], /* 0A..19 */ host_id[16], /* 1A..29 */ unique_id[16]; /* 2A..39 */ } inq; /* SRB_Device */ struct { unsigned char target, /* 08 */ lun, /* 09 */ devtype; /* 0A */ } dev; /* SRB_Command */ struct { unsigned char target, /* 08 */ lun; /* 09 */ unsigned long data_len; /* 0A..0D */ unsigned char sense_len; /* 0E */ void * _Seg16 data_ptr; /* 0F..12 */ void * _Seg16 link_ptr; /* 13..16 */ unsigned char cdb_len, /* 17 */ ha_status, /* 18 */ target_status; /* 19 */ void (* _Seg16 post) (SRB *); /* 1A..1D */ unsigned char res_1E_29[12]; /* 1E..29 */ unsigned char res_2A_3F[22]; /* 2A..3F */ unsigned char cdb_st[64]; /* 40..7F CDB+status */ unsigned char res_80_BF[64]; /* 80..BF */ } cmd; /* SRB_Abort */ struct { void * _Seg16 srb; /* 08..0B */ } abt; /* SRB_Reset */ struct { unsigned char target, /* 08 */ lun, /* 09 */ res_0A_17[14], /* 0A..17 */ ha_status, /* 18 */ target_status; /* 19 */ } res; /* SRB_Param - unused by ASPI4OS2 */ struct { unsigned char unique[16]; /* 08..17 */ } par; } u; }; /* SCSI sense codes */ /* Note! This list may not be complete. I did this compilation for use with tape drives.*/ #define Sense_Current 0x70; /* Current Error */ #define Sense_Deferred 0x71; /* Deferred Error */ #define Sense_Filemark 0x80; /* Filemark detected */ #define Sense_EOM 0x40; /* End of medium detected */ #define Sense_ILI 0x20; /* Incorrect length indicator */ /* Sense Keys */ #define SK_NoSense 0x00; /* No Sense */ #define SK_RcvrdErr 0x01; /* Recovered Error */ #define SK_NotReady 0x02; /* Not ready */ #define SK_MedErr 0x03; /* Medium Error */ #define SK_HWErr 0x04; /* Hardware Error */ #define SK_IllReq 0x05; /* Illegal Request */ #define SK_UnitAtt 0x06; /* Unit attention */ #define SK_DataProt 0x07: /* Data Protect */ #define SK_BlankChk 0x08: /* Blank Check */ #define SK_VndSpec 0x09; /* Vendor Specific */ #define SK_CopyAbort 0x0A; /* Copy Aborted */ #define SK_AbtdCmd 0x0B; /* Aborted Command */ #define SK_Equal 0x0C; /* Equal */ #define SK_VolOvfl 0x0D; /* Volume Overflow */ #define SK_MisComp 0x0E; /* Miscompare */ #define SK_Reserved 0x0F; /* Reserved */ sane-backends-extras-1.0.22.3ubuntu1/sanei/sanei_codec_ascii.c0000664000000000000000000001563711475557446021060 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 1997 David Mosberger-Tang This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ #include "../include/sane/config.h" #include #include #include #include #include "../include/sane/sane.h" #include "../include/sane/sanei_wire.h" #include "../include/sane/sanei_codec_ascii.h" static const char *hexdigit = "0123456789abcdef"; static void skip_ws (Wire *w) { while (1) { sanei_w_space (w, 1); if (w->status != 0) return; if (!isspace (*w->buffer.curr)) return; ++w->buffer.curr; } } static unsigned get_digit (Wire *w) { unsigned digit; sanei_w_space (w, 1); digit = tolower(*w->buffer.curr++) - '0'; if (digit > 9) digit -= 'a' - ('9' + 1); if (digit > 0xf) { w->status = EINVAL; return 0; } return digit; } static SANE_Byte get_byte (Wire *w) { return get_digit (w) << 4 | get_digit (w); } static void ascii_w_byte (Wire *w, void *v) { SANE_Byte *b = v; switch (w->direction) { case WIRE_ENCODE: sanei_w_space (w, 3); *w->buffer.curr++ = hexdigit[(*b >> 4) & 0x0f]; *w->buffer.curr++ = hexdigit[(*b >> 0) & 0x0f]; *w->buffer.curr++ = '\n'; break; case WIRE_DECODE: skip_ws (w); *b = get_byte (w); break; case WIRE_FREE: break; } } static void ascii_w_char (Wire *w, void *v) { SANE_Char *c = v; switch (w->direction) { case WIRE_ENCODE: sanei_w_space (w, 5); *w->buffer.curr++ = '\''; if (*c == '\'' || *c == '\\') *w->buffer.curr++ = '\\'; *w->buffer.curr++ = *c; *w->buffer.curr++ = '\''; *w->buffer.curr++ = '\n'; break; case WIRE_DECODE: sanei_w_space (w, 4); if (*w->buffer.curr++ != '\'') { w->status = EINVAL; return; } *c = *w->buffer.curr++; if (*c == '\\') { sanei_w_space (w, 2); *c = *w->buffer.curr++; } if (*w->buffer.curr++ != '\'') { w->status = EINVAL; return; } break; case WIRE_FREE: break; } } static void ascii_w_string (Wire *w, void *v) { size_t len, alloced_len; SANE_String *s = v; char * str, ch; int done; switch (w->direction) { case WIRE_ENCODE: if (*s) { sanei_w_space (w, 1); *w->buffer.curr++ = '"'; str = *s; while ((ch = *str++)) { sanei_w_space (w, 2); if (ch == '"' || ch == '\\') *w->buffer.curr++ = '\\'; *w->buffer.curr++ = ch; } *w->buffer.curr++ = '"'; } else { sanei_w_space (w, 5); *w->buffer.curr++ = '('; *w->buffer.curr++ = 'n'; *w->buffer.curr++ = 'i'; *w->buffer.curr++ = 'l'; *w->buffer.curr++ = ')'; } sanei_w_space (w, 1); *w->buffer.curr++ = '\n'; break; case WIRE_DECODE: skip_ws (w); sanei_w_space (w, 1); ch = *w->buffer.curr++; if (ch == '"') { alloced_len = len = 0; str = 0; done = 0; do { sanei_w_space (w, 1); if (w->status != 0) return; ch = *w->buffer.curr++; if (ch == '"') done = 1; if (ch == '\\') { sanei_w_space (w, 1); ch = *w->buffer.curr++; } if (len >= alloced_len) { alloced_len += 1024; if (!str) str = malloc (alloced_len); else str = realloc (str, alloced_len); if (str == 0) { /* Malloc failed, so return an error. */ w->status = ENOMEM; return; } } str[len++] = ch; } while (!done); str[len - 1] = '\0'; *s = realloc (str, len); if (*s == 0) { /* Malloc failed, so return an error. */ w->status = ENOMEM; return; } } else if (ch == '(') { sanei_w_space (w, 4); if ( *w->buffer.curr++ != 'n' || *w->buffer.curr++ != 'i' || *w->buffer.curr++ != 'l' || *w->buffer.curr++ != ')') { w->status = EINVAL; return; } *s = 0; } else { w->status = EINVAL; return; } break; case WIRE_FREE: if (*s) free (*s); break; } } static void ascii_w_word (Wire *w, void *v) { SANE_Word val, *word = v; int i, is_negative = 0; char buf[16]; switch (w->direction) { case WIRE_ENCODE: val = *word; i = sizeof (buf) - 1; if (val < 0) { is_negative = 1; val = -val; } do { buf[i--] = '0' + (val % 10); val /= 10; } while (val); if (is_negative) buf[i--] = '-'; sanei_w_space (w, sizeof (buf) - i); memcpy (w->buffer.curr, buf + i + 1, sizeof (buf) - i - 1); w->buffer.curr += sizeof (buf) - i - 1; *w->buffer.curr++ = '\n'; break; case WIRE_DECODE: skip_ws (w); val = 0; sanei_w_space (w, 1); if (*w->buffer.curr == '-') { is_negative = 1; ++w->buffer.curr; } while (1) { sanei_w_space (w, 1); if (w->status != 0) return; if (!isdigit (*w->buffer.curr)) break; val = 10*val + (*w->buffer.curr++ - '0'); } *word = is_negative ? -val : val; break; case WIRE_FREE: break; } } void sanei_codec_ascii_init (Wire *w) { w->codec.w_byte = ascii_w_byte; w->codec.w_char = ascii_w_char; w->codec.w_word = ascii_w_word; w->codec.w_string = ascii_w_string; } sane-backends-extras-1.0.22.3ubuntu1/sanei/sanei_config.c0000664000000000000000000002664011475557446020074 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 1997 Jeffrey S. Freedman This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. This file provides generic configuration support. */ #include "../include/sane/config.h" #include #include #include #include #include #include "../include/sane/sanei.h" #include "../include/sane/sanei_config.h" #define BACKEND_NAME sanei_config #include "../include/sane/sanei_debug.h" #ifndef PATH_MAX # define PATH_MAX 1024 #endif #if defined(HAVE_OS2_H) # define DIR_SEP ";" # define PATH_SEP '\\' #elif defined(HAVE_WINDOWS_H) # define DIR_SEP ";" # define PATH_SEP '\\' #else # define DIR_SEP ":" # define PATH_SEP '/' #endif #define DEFAULT_DIRS "." DIR_SEP STRINGIFY(PATH_SANE_CONFIG_DIR) #ifdef __BEOS__ #include #endif static char *dir_list; const char * sanei_config_get_paths () { #ifdef __BEOS__ char result[PATH_MAX]; #endif void *mem; char *dlist; size_t len; if (!dir_list) { DBG_INIT(); dlist = getenv ("SANE_CONFIG_DIR"); if (dlist) dir_list = strdup (dlist); #ifdef __BEOS__ /* ~/config/settings/SANE takes precedence over /etc/sane.d/ */ if (!dir_list) { if (find_directory(B_USER_SETTINGS_DIRECTORY, 0, true, result, PATH_MAX) == B_OK) { strcat(result,"/SANE"); strcat(result,DIR_SEP); /* do append the default ones */ dir_list = strdup (result); } } #endif if (dir_list) { len = strlen (dir_list); if ((len > 0) && (dir_list[len - 1] == DIR_SEP[0])) { /* append default search directories: */ mem = malloc (len + sizeof (DEFAULT_DIRS)); memcpy (mem, dir_list, len); memcpy ((char *) mem + len, DEFAULT_DIRS, sizeof (DEFAULT_DIRS)); free (dir_list); dir_list = mem; } } else { /* Create a copy, since we might call free on it */ dir_list = strdup (DEFAULT_DIRS); } } DBG (5, "sanei_config_get_paths: using config directories %s\n", dir_list); return dir_list; } FILE * sanei_config_open (const char *filename) { char *next, *dir, result[PATH_MAX]; const char *cfg_dir_list; FILE *fp; char *copy; cfg_dir_list = sanei_config_get_paths (); if (!cfg_dir_list) { DBG(2, "sanei_config_open: could not find config file `%s'\n", filename); return NULL; } copy = strdup (cfg_dir_list); for (next = copy; (dir = strsep (&next, DIR_SEP)) != 0; ) { snprintf (result, sizeof (result), "%s%c%s", dir, PATH_SEP, filename); DBG(4, "sanei_config_open: attempting to open `%s'\n", result); fp = fopen (result, "r"); if (fp) { DBG(3, "sanei_config_open: using file `%s'\n", result); break; } } free (copy); if (!fp) DBG(2, "sanei_config_open: could not find config file `%s'\n", filename); return fp; } const char * sanei_config_skip_whitespace (const char *str) { while (str && *str && isspace (*str)) ++str; return str; } const char * sanei_config_get_string (const char *str, char **string_const) { const char *start; size_t len; str = sanei_config_skip_whitespace (str); if (*str == '"') { start = ++str; while (*str && *str != '"') ++str; len = str - start; if (*str == '"') ++str; else start = 0; /* final double quote is missing */ } else { start = str; while (*str && !isspace (*str)) ++str; len = str - start; } if (start) *string_const = strndup (start, len); else *string_const = 0; return str; } char * sanei_config_read (char *str, int n, FILE *stream) { char* rc; char* start; int len; /* read line from stream */ rc = fgets( str, n, stream); if (rc == NULL) return NULL; /* remove ending whitespaces */ len = strlen( str); while( (0 < len) && (isspace( str[--len])) ) str[len] = '\0'; /* remove starting whitespaces */ start = str; while( isspace( *start)) start++; if (start != str) do { *str++ = *start++; } while( *str); return rc; } SANE_Status sanei_configure_attach (const char *config_file, SANEI_Config * config, SANE_Status (*attach) (SANEI_Config * config, const char *devname)) { SANE_Char line[PATH_MAX]; SANE_Char *token, *string; SANE_Int len; const char *lp, *lp2; FILE *fp; SANE_Status status = SANE_STATUS_GOOD; int i, j, count; void *value = NULL; int size=0; SANE_Bool found; SANE_Word *wa; SANE_Bool *ba; DBG (3, "sanei_configure_attach: start\n"); /* open configuration file */ fp = sanei_config_open (config_file); if (!fp) { DBG (2, "sanei_configure_attach: couldn't access %s\n", config_file); DBG (3, "sanei_configure_attach: exit\n"); return SANE_STATUS_ACCESS_DENIED; } /* loop reading the configuration file, all line beginning by "option " are * parsed for value to store in configuration structure, other line are * used are device to try to attach */ while (sanei_config_read (line, PATH_MAX, fp) && status == SANE_STATUS_GOOD) { /* skip white spaces at beginning of line */ lp = sanei_config_skip_whitespace (line); /* skip empty lines */ if (*lp == 0) continue; /* skip comment line */ if (line[0] == '#') continue; len = strlen (line); /* delete newline characters at end */ if (line[len - 1] == '\n') line[--len] = '\0'; lp2 = lp; /* to ensure maximum compatibility, we accept line like: * option "option_name" "option_value" * "option_name" "option_value" * So we parse the line 2 time to find an option */ /* check if it is an option */ lp = sanei_config_get_string (lp, &token); if (strncmp (token, "option", 6) == 0) { /* skip the "option" token */ free (token); lp = sanei_config_get_string (lp, &token); } /* search for a matching descriptor */ i = 0; found = SANE_FALSE; while (config!=NULL && i < config->count && !found) { if (strcmp (config->descriptors[i]->name, token) == 0) { found = SANE_TRUE; switch (config->descriptors[i]->type) { case SANE_TYPE_INT: size=config->descriptors[i]->size; value = malloc (size); wa = (SANE_Word *) value; count = config->descriptors[i]->size / sizeof (SANE_Word); for (j = 0; j < count; j++) { lp = sanei_config_get_string (lp, &string); if (string == NULL) { DBG (2, "sanei_configure_attach: couldn't find a string to parse"); return SANE_STATUS_INVAL; } wa[j] = strtol (string, NULL, 0); free (string); } break; case SANE_TYPE_BOOL: size=config->descriptors[i]->size; value = malloc (size); ba = (SANE_Bool *) value; count = config->descriptors[i]->size / sizeof (SANE_Bool); for (j = 0; j < count; j++) { lp = sanei_config_get_string (lp, &string); if (string == NULL) { DBG (2, "sanei_configure_attach: couldn't find a string to parse"); return SANE_STATUS_INVAL; } if ((strcmp (string, "1") == 0) || (strcmp (string, "true") == 0)) { ba[j] = SANE_TRUE; } else { if ((strcmp (string, "0") == 0) || (strcmp (string, "false") == 0)) ba[j] = SANE_FALSE; else { DBG (2, "sanei_configure_attach: couldn't find a valid boolean value"); return SANE_STATUS_INVAL; } } free (string); } break; case SANE_TYPE_FIXED: size=config->descriptors[i]->size; value = malloc (size); wa = (SANE_Word *) value; count = config->descriptors[i]->size / sizeof (SANE_Word); for (j = 0; j < count; j++) { lp = sanei_config_get_string (lp, &string); if (string == NULL) { DBG (2, "sanei_configure_attach: couldn't find a string to parse"); return SANE_STATUS_INVAL; } wa[j] = SANE_FIX(strtod (string, NULL)); free (string); } break; case SANE_TYPE_STRING: sanei_config_get_string (lp, &string); if (string == NULL) { DBG (2, "sanei_configure_attach: couldn't find a string value to parse"); return SANE_STATUS_INVAL; } value = string; size=strlen(string)+1; if(size>config->descriptors[i]->size) { size=config->descriptors[i]->size-1; string[size]=0; } break; default: DBG (1, "sanei_configure_attach: incorrect type %d for option %s, skipping option ...\n", config->descriptors[i]->type, config->descriptors[i]->name); } /* check decoded value */ status = sanei_check_value (config->descriptors[i], value); /* if value OK, copy it in configuration struct */ if (status == SANE_STATUS_GOOD) { memcpy (config->values[i], value, size); } if (value != NULL) { free (value); value = NULL; } } if (status != SANE_STATUS_GOOD) { DBG (1, "sanei_configure_attach: failed to parse option '%s', line '%s'\n", token, line); } i++; } free (token); /* not detected as an option, so we call the attach function * with it */ if (!found && status == SANE_STATUS_GOOD) { /* if not an option, try to attach */ /* to avoid every backend to depend on scsi and usb functions * we call back the backend for attach. In turn it will call * sanei_usb_attach_matching_devices, sanei_config_attach_matching_devices * or other. This means 2 callback functions per backend using this * function. */ DBG (3, "sanei_configure_attach: trying to attach with '%s'\n", lp2); if(attach!=NULL) attach (config, lp2); } } fclose (fp); DBG (3, "sanei_configure_attach: exit\n"); return status; } sane-backends-extras-1.0.22.3ubuntu1/sanei/sanei_access.c0000664000000000000000000001405311475557446020063 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 2005 Gerhard Jaeger This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ #include "../include/sane/config.h" #include #include #include #include #include #include #ifdef HAVE_UNISTD_H # include #endif #include #define BACKEND_NAME sanei_access /**< name of this module for debugging */ #include "../include/sane/sane.h" #include "../include/sane/sanei_debug.h" #include "../include/sane/sanei_access.h" #ifndef PATH_MAX # define PATH_MAX 1024 #endif #if defined(HAVE_OS2_H) || defined(HAVE_WINDOWS_H) # define PATH_SEP '\\' #else # define PATH_SEP '/' #endif #define REPLACEMENT_CHAR '_' #define PID_BUFSIZE 50 #define PROCESS_SELF 0 #define PROCESS_DEAD -1 #define PROCESS_OTHER 1 #ifdef ENABLE_LOCKING /** get the status/owner of a lock file * * The function tries to open an existing lockfile. On success, it reads out * the pid which is stored inside and tries to find out more about the status * of the process with the corresponding PID. * * @param fn - the complete filename of the lockfile to check * @return * - PROCESS_SELF - the calling process is owner of the lockfile * - PROCESS_DEAD - the process who created the lockfile is already dead * - PROCESS_OTHER - the process who created the lockfile is still alive */ static int get_lock_status( char *fn ) { char pid_buf[PID_BUFSIZE]; int fd, status; pid_t pid; fd = open( fn, O_RDONLY ); if( fd < 0 ) { DBG( 2, "does_process_exist: open >%s< failed: %s\n", fn, strerror(errno)); return PROCESS_OTHER; } read( fd, pid_buf, (PID_BUFSIZE-1)); pid_buf[PID_BUFSIZE-1] = '\0'; close( fd ); pid_buf[24] = '\0'; pid = strtol( pid_buf, NULL, 10 ); DBG( 2, "does_process_exist: PID %i\n", pid ); status = kill( pid, 0 ); if( status == -1 ) { if( errno == ESRCH ) { DBG( 2, "does_process_exist: process %i does not exist!\n", pid ); return PROCESS_DEAD; } DBG( 1, "does_process_exist: kill failed: %s\n", strerror(errno)); } else { DBG( 2, "does_process_exist: process %i does exist!\n", pid ); if( pid == getpid()){ DBG( 2, "does_process_exist: it's me!!!\n" ); return PROCESS_SELF; } } return PROCESS_OTHER; } static void create_lock_filename( char *fn, const char *devname ) { char *p; strcpy( fn, STRINGIFY(PATH_SANE_LOCK_DIR)"/LCK.." ); p = &fn[strlen(fn)]; strcat( fn, devname ); while( *p != '\0' ) { if( *p == PATH_SEP ) *p = REPLACEMENT_CHAR; p++; } DBG( 2, "sanei_access: lockfile name >%s<\n", fn ); } #endif void sanei_access_init( const char *backend ) { DBG_INIT(); DBG( 2, "sanei_access_init: >%s<\n", backend); } SANE_Status sanei_access_lock( const char *devicename, SANE_Word timeout ) { #ifdef ENABLE_LOCKING char fn[PATH_MAX]; char pid_buf[PID_BUFSIZE]; int fd, to, i; #endif DBG( 2, "sanei_access_lock: devname >%s<, timeout: %u\n", devicename, timeout ); #ifndef ENABLE_LOCKING return SANE_STATUS_GOOD; #else to = timeout; if (to <= 0) to = 1; create_lock_filename( fn, devicename ); for (i = 0; i < to; i++) { fd = open( fn, O_CREAT | O_EXCL | O_WRONLY, 0644 ); if (fd < 0) { if (errno == EEXIST) { switch( get_lock_status( fn )) { case PROCESS_DEAD: DBG( 2, "sanei_access_lock: " "deleting old lock file, retrying...\n" ); unlink( fn ); continue; break; case PROCESS_SELF: DBG( 2, "sanei_access_lock: success\n" ); return SANE_STATUS_GOOD; break; default: break; } DBG( 2, "sanei_access_lock: lock exists, waiting...\n" ); sleep(1); } else { DBG( 1, "sanei_access_lock: open >%s< failed: %s\n", fn, strerror(errno)); return SANE_STATUS_ACCESS_DENIED; } } else { DBG( 2, "sanei_access_lock: success\n" ); sprintf( pid_buf, "% 11i sane\n", getpid()); write(fd, pid_buf, strlen(pid_buf)); close( fd ); return SANE_STATUS_GOOD; } } DBG( 1, "sanei_access_lock: timeout!\n"); return SANE_STATUS_ACCESS_DENIED; #endif } SANE_Status sanei_access_unlock( const char *devicename ) { #ifdef ENABLE_LOCKING char fn[PATH_MAX]; #endif DBG( 2, "sanei_access_unlock: devname >%s<\n", devicename ); #ifdef ENABLE_LOCKING create_lock_filename( fn, devicename ); unlink( fn ); #endif return SANE_STATUS_GOOD; } /* END sanei_access.c .......................................................*/ sane-backends-extras-1.0.22.3ubuntu1/sanei/sanei_ab306.c0000664000000000000000000003300111475557446017427 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 1997 Andreas Czechanowski and David Mosberger This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. This file implements the Mustek-proprietary SCSI-over-parallel-port interface. */ #include "../include/sane/config.h" #ifdef HAVE_UNISTD_H # include #endif #include #ifdef HAVE_SYS_IO_H # include /* use where available (glibc 2.x, for example) */ #elif HAVE_ASM_IO_H # include /* ugly, but backwards compatible */ #elif defined (__i386__) && defined (__GNUC__) static __inline__ void outb (u_char value, u_long port) { __asm__ __volatile__ ("outb %0,%1" : : "a" (value), "d" ((u_short) port)); } static __inline__ u_char inb (u_long port) { u_char value; __asm__ __volatile__ ("inb %1,%0" : "=a" (value) : "d" ((u_short)port)); return value; } #else # define IO_SUPPORT_MISSING #endif #include "../include/sane/sane.h" #include "../include/sane/sanei.h" #include "../include/sane/sanei_ab306.h" #if (defined(HAVE_IOPERM) || defined(__FreeBSD__)) && !defined(IO_SUPPORT_MISSING) #include #include #include #include #include #include #include #include #include #include #include "../include/sane/saneopts.h" #define BACKEND_NAME sanei_ab306 #include "../include/sane/sanei_debug.h" #define PORT_DEV "/dev/port" #define AB306_CIO 0x379 /* control i/o port */ #if defined(__FreeBSD__) static int dev_io_fd = 0; #endif typedef struct port { u_long base; /* i/o base address */ int port_fd; /* >= 0 when using /dev/port */ u_int lstat; u_int in_use : 1, /* port in use? */ active : 1; /* port was active at some point */ } Port; static Port port[] = { {0x26b, -1, 0, 0, 0}, {0x2ab, -1, 0, 0, 0}, {0x2eb, -1, 0, 0, 0}, {0x22b, -1, 0, 0, 0}, {0x32b, -1, 0, 0, 0}, {0x36b, -1, 0, 0, 0}, {0x3ab, -1, 0, 0, 0}, {0x3eb, -1, 0, 0, 0} }; static const SANE_Byte wakeup[] = { 0x47, 0x55, 0x54, 0x53, 0x02, 0x01, 0x80 }; static u_char cdb_sizes[8] = { 6, 10, 10, 12, 12, 12, 10, 10 }; #define CDB_SIZE(opcode) cdb_sizes[(((opcode) >> 5) & 7)] static void ab306_outb (Port *p, u_long addr, u_char val) { if (p->port_fd >= 0) { if ((u_long) lseek (p->port_fd, addr, SEEK_SET) != addr) return; if (write (p->port_fd, &val, 1) != 1) return; } else outb (val, addr); } static int ab306_inb (Port *p, u_long addr) { u_char ch; if (p->port_fd >= 0) { if ((u_long) lseek (p->port_fd, addr, SEEK_SET) != addr) return -1; if (read (p->port_fd, &ch, 1) != 1) return -1; return ch; } else return inb (addr); } /* Send a single command-byte over the AB306N-interface. */ static void ab306_cout (Port *p, int val) { u_long base = p->base; while ((ab306_inb (p, base + 1) & 0x80)); /* wait for dir flag */ ab306_outb (p, base, val); ab306_outb (p, base + 1, 0xe0); while ((ab306_inb (p, base + 1) & 0x80) == 0); /* wait for ack */ ab306_outb (p, base + 1, 0x60); } /* Read a single response-byte from the SANEI_AB306N-interface. */ static int ab306_cin (Port *p) { u_long base = p->base; u_char val; while ((ab306_inb (p, base + 1) & 0x80) == 0); /* wait for dir flag */ val = ab306_inb (p, base); ab306_outb (p, base + 1, 0xe0); /* ack received byte */ while (ab306_inb (p, base + 1) & 0x80); ab306_outb (p, base + 1, 0x60); /* reset ack */ return val; } static SANE_Status ab306_write (Port *p, const void *buf, size_t len) { u_long base = p->base; u_int i; int cksum = 0; DBG(3, "ab306_write: waiting for scanner to be ready %02x\n", ab306_inb (p, base + 1)); while ((ab306_inb (p, base + 1) & 0x20) == 0); usleep (10000); DBG(4, "ab306_write: writing data\n"); for (i = 0; i < len; ++i) { ab306_cout (p, ((const u_char *) buf)[i]); cksum += ((const u_char *) buf)[i]; } DBG(4, "ab306_write: writing checksum\n"); ab306_cout (p, -cksum & 0xff); DBG(3, "ab306_write: waiting for scanner to be NOT ready %02x\n", ab306_inb (p, base + 1)); while ((ab306_inb (p, base + 1) & 0x20) != 0); usleep (10000); DBG(4, "ab306_write: reading ack\n"); cksum = ab306_cin (p); if (cksum != 0xa5) { DBG(0, "ab306_write: checksum error (%02x!=a5) when sending command!\n", cksum); return SANE_STATUS_IO_ERROR; } return SANE_STATUS_GOOD; } /* Abort a running scan by pulling C6 low for a while. */ static void ab306_abort (Port *p) { ab306_outb (p, p->base + 1, 0x20); while ((ab306_inb (p, p->base + 1) & 0x80)); ab306_outb (p, p->base + 1, 0x60); } /* Open the device, must contain a valid port number (as string) returns port number and I/O method in <*fdp> (not a file descriptor) turns the scanner on setting C5 and C6. */ SANE_Status sanei_ab306_open (const char *dev, int *fdp) { static int first_time = 1; SANE_Status status; u_char byte; u_long base; char *end; int i, j; if (first_time) { first_time = 0; DBG_INIT(); } base = strtol (dev, &end, 0); if (end == dev || *end) { DBG(1, "sanei_ab306_open: `%s' is not a valid port number\n", dev); return SANE_STATUS_INVAL; } for (i = 0; i < NELEMS(port); ++i) if (port[i].base == base) break; if (i >= NELEMS(port)) { DBG(1, "sanei_ab306_open: %lx is not a valid base address\n", base); return SANE_STATUS_INVAL; } if (port[i].in_use) { DBG(1, "sanei_ab306_open: port %lx is already in use\n", base); return SANE_STATUS_DEVICE_BUSY; } status = sanei_ab306_get_io_privilege (i); #if defined(__FreeBSD__) status = sanei_ab306_get_io_privilege (i); if (status != SANE_STATUS_GOOD) return status; DBG(1, "sanei_ab306_ioport: using inb/outb access\n"); for (j = 0; j < NELEMS(wakeup); ++j) { byte = wakeup[j]; if (j == NELEMS(wakeup) - 1) byte |= i; outb (byte, AB306_CIO); } #else /* !defined(__FreeBSD__) */ if (ioperm (AB306_CIO, 1, 1) != 0) { DBG(1, "sanei_ab306_ioport: using /dev/port access\n"); if (port[i].port_fd < 0) port[i].port_fd = open (PORT_DEV, O_RDWR); if (port[i].port_fd < 0) return SANE_STATUS_IO_ERROR; for (j = 0; j < NELEMS(wakeup); ++j) { if (lseek (port[i].port_fd, AB306_CIO, SEEK_SET) != AB306_CIO) return SANE_STATUS_IO_ERROR; byte = wakeup[j]; if (j == NELEMS(wakeup) - 1) byte |= i; if (write (port[i].port_fd, &byte, 1) != 1) return SANE_STATUS_IO_ERROR; } } else { DBG(1, "sanei_ab306_ioport: using inb/outb access\n"); for (j = 0; j < NELEMS(wakeup); ++j) { byte = wakeup[j]; if (j == NELEMS(wakeup) - 1) byte |= i; outb (byte, AB306_CIO); } status = sanei_ab306_get_io_privilege (i); if (status != SANE_STATUS_GOOD) return status; } #endif /* !defined(__FreeBSD__) */ ab306_outb (port + i, port[i].base + 1, 0x60); port[i].in_use = 1; port[i].active = 1; *fdp = i; return SANE_STATUS_GOOD; } void sanei_ab306_close (int fd) { Port *p = port + fd; if (p->in_use) { if (p->port_fd >= 0) { close (p->port_fd); p->port_fd = -1; } p->in_use = 0; } } /* Get I/O permission to the configuration port and the desired operating ports. */ SANE_Status sanei_ab306_get_io_privilege (int fd) { if (port[fd].port_fd < 0) { #if defined(__FreeBSD__) if (dev_io_fd == 0) dev_io_fd = open ("/dev/io", O_RDONLY); if (dev_io_fd < 0) return SANE_STATUS_IO_ERROR; #else /* !defined(__FreeBSD__) */ if (ioperm (port[fd].base, 3, 1) != 0) return SANE_STATUS_IO_ERROR; #endif /* !defined(__FreeBSD__) */ } return SANE_STATUS_GOOD; } /* Send a command via the SANEI_AB306N-interface, get response when is > 0. */ SANE_Status sanei_ab306_cmd (int fd, const void *src, size_t src_size, void *dst, size_t * dst_size) { Port *p = port + fd; const u_char *cp = src; size_t cdb_size = CDB_SIZE(cp[0]); SANE_Status status; u_char byte; /* If this is a READ_SCANNED_DATA command, reset lstat: */ switch (cp[0]) { case 0x08: /* scsi READ_SCANNED_DATA command */ /* Initialize lstat to the current status, because we need bit 4 (0x10) as toggle bit for reading lines. */ p->lstat = 0x34; break; case 0x1b: /* scsi START_STOP command */ if (!cp[4]) { /* it's a STOP */ ab306_abort (p); return SANE_STATUS_GOOD; } break; default: break; } status = ab306_write (p, src, 6); if (status != SANE_STATUS_GOOD) return status; if (src_size > cdb_size) { status = ab306_write (p, cp + cdb_size, src_size - cdb_size); if (status != SANE_STATUS_GOOD) return status; } if (dst && *dst_size > 0) { u_int i, cksum = 0; DBG(3, "sanei_ab306_cmd: waiting for scanner to be NOT ready %02x\n", ab306_inb (p, p->base + 1)); while ((ab306_inb (p, p->base + 1) & 0x20) != 0); for (i = 0; i < *dst_size; i++) { byte = ab306_cin (p); cksum += byte; ((u_char *) dst)[i] = byte; } cksum += ab306_cin (p); /* add in checksum */ if ((cksum & 0xff) != 0) { DBG(0, "sanei_ab306_cmd: checksum error (%2x!=0) when receiving " "after command!\n", cksum); return SANE_STATUS_IO_ERROR; } ab306_cout (p, 0); /* dummy byte (will be discarded) */ } return SANE_STATUS_GOOD; } /* Read scan-data from the AB306N-device. Read lines, of which every one has bytes. */ SANE_Status sanei_ab306_rdata (int fd, int planes, SANE_Byte * buf, int lines, int bpl) { Port *p = port + fd; int lcnt, pcnt, bcnt, xmax; SANE_Byte *lsave_bp; int nstat; DBG(2, "sanei_ab306_rdata: start\n"); /* lstat should be set by a call to sanei_ab306_init_toggle before ! */ while ((ab306_inb (p, p->base + 1) & 0x80) == 0); /* the lines-loop: */ for (lcnt = 0; lcnt < lines; ++lcnt) { lsave_bp = buf; /* the planes-loop: */ for (pcnt = 0; pcnt < planes; ++pcnt) { xmax = bpl / planes; do nstat = ab306_inb (p, p->base + 1); while (((p->lstat ^ nstat) & 0x10) == 0); if (p->port_fd >= 0) { /* the pixel-loop: */ for (bcnt = 0; bcnt < xmax; bcnt++) { if ((u_long) lseek (p->port_fd, p->base, SEEK_SET) != p->base) return SANE_STATUS_IO_ERROR; if (read (p->port_fd, buf, 1) != 1) return SANE_STATUS_IO_ERROR; ++buf; } } else { /* the pixel-loop: */ for (bcnt = 0; bcnt < xmax; bcnt++) { *(u_char *) buf = inb (p->base); ++buf; } } p->lstat = nstat; } } DBG(2, "sanei_ab306_rdata: done\n"); return SANE_STATUS_GOOD; } void sanei_ab306_exit (void) { int i; for (i = 0; i < NELEMS(port); ++i) if (port[i].active) { port[i].active = 0; /* power off the scanner: */ ab306_outb (port + i, port[i].base + 1, 0x00); } #if defined(__FreeBSD) if (dev_io_fd >0) close (dev_io_fd); #endif /* defined(__FreeBSD__) */ } SANE_Status sanei_ab306_test_ready (int fd) { Port *p = port + fd; u_char byte; byte = ab306_inb (p, p->base + 1); if (byte & 0x20) return SANE_STATUS_GOOD; return SANE_STATUS_DEVICE_BUSY; } #else /* !HAVE_IOPERM */ SANE_Status sanei_ab306_open (const char *devname, int *fdp) { *fdp = -1; return SANE_STATUS_INVAL; } void sanei_ab306_close (int fd) { } void sanei_ab306_exit (void) { } SANE_Status sanei_ab306_get_io_privilege (int fd) { return SANE_STATUS_INVAL; } SANE_Status sanei_ab306_test_ready (int fd) { return SANE_STATUS_GOOD; /* non-existent device is always ready... */ } SANE_Status sanei_ab306_cmd (int fd, const void *src, size_t src_size, void *dst, size_t *dst_size) { return SANE_STATUS_INVAL; } SANE_Status sanei_ab306_rdata (int fd, int planes, SANE_Byte *buf, int lines, int bpl) { return SANE_STATUS_INVAL; } #endif /* !HAVE_IOPERM */ sane-backends-extras-1.0.22.3ubuntu1/sanei/sanei_magic.c0000664000000000000000000010317711475557446017710 0ustar /* * sanei_magic - Image processing functions for despeckle, deskew, and autocrop Copyright (C) 2009 m. allan noah This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ #include "../include/sane/config.h" #include #include #include #include #include #define BACKEND_NAME sanei_magic /* name of this module for debugging */ #include "../include/sane/sane.h" #include "../include/sane/sanei_debug.h" #include "../include/sane/sanei_magic.h" /* prototypes for utility functions defined at bottom of file */ int * sanei_magic_getTransY ( SANE_Parameters * params, int dpi, SANE_Byte * buffer, int top); int * sanei_magic_getTransX ( SANE_Parameters * params, int dpi, SANE_Byte * buffer, int left); SANE_Status getTopEdge (int width, int height, int resolution, int * buff, double * finSlope, int * finXInter, int * finYInter); SANE_Status getLeftEdge (int width, int height, int * top, int * bot, double slope, int * finXInter, int * finYInter); SANE_Status getLine (int height, int width, int * buff, int slopes, double minSlope, double maxSlope, int offsets, int minOffset, int maxOffset, double * finSlope, int * finOffset, int * finDensity); void sanei_magic_init( void ) { DBG_INIT(); } /* find small spots and replace them with image background color */ SANE_Status sanei_magic_despeck (SANE_Parameters * params, SANE_Byte * buffer, SANE_Int diam) { SANE_Status ret = SANE_STATUS_GOOD; int pw = params->pixels_per_line; int bw = params->bytes_per_line; int h = params->lines; int bt = bw*h; int i,j,k,l,n; DBG (10, "sanei_magic_despeck: start\n"); if(params->format == SANE_FRAME_RGB){ for(i=bw; iformat == SANE_FRAME_GRAY && params->depth == 8){ for(i=bw; iformat == SANE_FRAME_GRAY && params->depth == 1){ for(i=bw; i> (7-(j+l)%8) & 1; } } if(!curr) continue; /*loop over rows and columns around window */ for(k=-1; k> (7-(j+l)%8) & 1; if(hits) break; } } /*no hits, overwrite with white*/ if(!hits){ for(k=0; kpixels_per_line; int height = params->lines; int * topBuf = NULL, * botBuf = NULL; int * leftBuf = NULL, * rightBuf = NULL; int topCount = 0, botCount = 0; int leftCount = 0, rightCount = 0; int i; DBG (10, "sanei_magic_findEdges: start\n"); /* get buffers to find sides and bottom */ topBuf = sanei_magic_getTransY(params,dpiY,buffer,1); if(!topBuf){ DBG (5, "sanei_magic_findEdges: no topBuf\n"); ret = SANE_STATUS_NO_MEM; goto cleanup; } botBuf = sanei_magic_getTransY(params,dpiY,buffer,0); if(!botBuf){ DBG (5, "sanei_magic_findEdges: no botBuf\n"); ret = SANE_STATUS_NO_MEM; goto cleanup; } leftBuf = sanei_magic_getTransX(params,dpiX,buffer,1); if(!leftBuf){ DBG (5, "sanei_magic_findEdges: no leftBuf\n"); ret = SANE_STATUS_NO_MEM; goto cleanup; } rightBuf = sanei_magic_getTransX(params,dpiX,buffer,0); if(!rightBuf){ DBG (5, "sanei_magic_findEdges: no rightBuf\n"); ret = SANE_STATUS_NO_MEM; goto cleanup; } /* loop thru left and right lists, look for top and bottom extremes */ *top = height; for(i=0; i leftBuf[i]){ if(*top > i){ *top = i; } topCount++; if(topCount > 3){ break; } } else{ topCount = 0; *top = height; } } *bot = -1; for(i=height-1; i>=0; i--){ if(rightBuf[i] > leftBuf[i]){ if(*bot < i){ *bot = i; } botCount++; if(botCount > 3){ break; } } else{ botCount = 0; *bot = -1; } } /* could not find top/bot edges */ if(*top > *bot){ DBG (5, "sanei_magic_findEdges: bad t/b edges\n"); ret = SANE_STATUS_UNSUPPORTED; goto cleanup; } /* loop thru top and bottom lists, look for l and r extremes * NOTE: We dont look above the top or below the bottom found previously. * This prevents issues with adf scanners that pad the image after the * paper runs out (usually with white) */ DBG (5, "sanei_magic_findEdges: bb0:%d tb0:%d b:%d t:%d\n", botBuf[0], topBuf[0], *bot, *top); *left = width; for(i=0; i topBuf[i] && (botBuf[i]-10 < *bot || topBuf[i]+10 > *top)){ if(*left > i){ *left = i; } leftCount++; if(leftCount > 3){ break; } } else{ leftCount = 0; *left = width; } } *right = -1; for(i=width-1; i>=0; i--){ if(botBuf[i] > topBuf[i] && (botBuf[i]-10 < *bot || topBuf[i]+10 > *top)){ if(*right < i){ *right = i; } rightCount++; if(rightCount > 3){ break; } } else{ rightCount = 0; *right = -1; } } /* could not find left/right edges */ if(*left > *right){ DBG (5, "sanei_magic_findEdges: bad l/r edges\n"); ret = SANE_STATUS_UNSUPPORTED; goto cleanup; } DBG (15, "sanei_magic_findEdges: t:%d b:%d l:%d r:%d\n", *top,*bot,*left,*right); cleanup: if(topBuf) free(topBuf); if(botBuf) free(botBuf); if(leftBuf) free(leftBuf); if(rightBuf) free(rightBuf); DBG (10, "sanei_magic_findEdges: finish\n"); return ret; } /* crop image to given size. updates params with new dimensions */ SANE_Status sanei_magic_crop(SANE_Parameters * params, SANE_Byte * buffer, int top, int bot, int left, int right) { SANE_Status ret = SANE_STATUS_GOOD; int bwidth = params->bytes_per_line; int pixels = 0; int bytes = 0; unsigned char * line = NULL; int pos = 0, i; DBG (10, "sanei_magic_crop: start\n"); /*convert left and right to bytes, figure new byte and pixel width */ if(params->format == SANE_FRAME_RGB){ pixels = right-left; bytes = pixels * 3; left *= 3; right *= 3; } else if(params->format == SANE_FRAME_GRAY && params->depth == 8){ pixels = right-left; bytes = right-left; } else if(params->format == SANE_FRAME_GRAY && params->depth == 1){ left /= 8; right = (right+7)/8; bytes = right-left; pixels = bytes * 8; } else{ DBG (5, "sanei_magic_crop: unsupported format/depth\n"); ret = SANE_STATUS_INVAL; goto cleanup; } DBG (15, "sanei_magic_crop: l:%d r:%d p:%d b:%d\n",left,right,pixels,bytes); line = malloc(bytes); if(!line){ DBG (5, "sanei_magic_crop: no line\n"); ret = SANE_STATUS_NO_MEM; goto cleanup; } for(i=top; ilines = bot-top; params->pixels_per_line = pixels; params->bytes_per_line = bytes; cleanup: if(line) free(line); DBG (10, "sanei_magic_crop: finish\n"); return ret; } /* find angle of media rotation against image background */ SANE_Status sanei_magic_findSkew(SANE_Parameters * params, SANE_Byte * buffer, int dpiX, int dpiY, int * centerX, int * centerY, double * finSlope) { SANE_Status ret = SANE_STATUS_GOOD; int pwidth = params->pixels_per_line; int height = params->lines; double TSlope = 0; int TXInter = 0; int TYInter = 0; double TSlopeHalf = 0; int TOffsetHalf = 0; double LSlope = 0; int LXInter = 0; int LYInter = 0; double LSlopeHalf = 0; int LOffsetHalf = 0; int rotateX = 0; int rotateY = 0; int * topBuf = NULL, * botBuf = NULL; DBG (10, "sanei_magic_findSkew: start\n"); /* get buffers for edge detection */ topBuf = sanei_magic_getTransY(params,dpiY,buffer,1); if(!topBuf){ DBG (5, "sanei_magic_findSkew: cant gTY\n"); ret = SANE_STATUS_NO_MEM; goto cleanup; } botBuf = sanei_magic_getTransY(params,dpiY,buffer,0); if(!botBuf){ DBG (5, "sanei_magic_findSkew: cant gTY\n"); ret = SANE_STATUS_NO_MEM; goto cleanup; } /* find best top line */ ret = getTopEdge (pwidth, height, dpiY, topBuf, &TSlope, &TXInter, &TYInter); if(ret){ DBG(5,"sanei_magic_findSkew: gTE error: %d",ret); goto cleanup; } DBG(15,"top: %04.04f %d %d\n",TSlope,TXInter,TYInter); /* slope is too shallow, don't want to divide by 0 */ if(fabs(TSlope) < 0.0001){ DBG(15,"sanei_magic_findSkew: slope too shallow: %0.08f\n",TSlope); ret = SANE_STATUS_UNSUPPORTED; goto cleanup; } /* find best left line, perpendicular to top line */ LSlope = (double)-1/TSlope; ret = getLeftEdge (pwidth, height, topBuf, botBuf, LSlope, &LXInter, &LYInter); if(ret){ DBG(5,"sanei_magic_findSkew: gLE error: %d",ret); goto cleanup; } DBG(15,"sanei_magic_findSkew: left: %04.04f %d %d\n",LSlope,LXInter,LYInter); /* find point about which to rotate */ TSlopeHalf = tan(atan(TSlope)/2); TOffsetHalf = LYInter; DBG(15,"sanei_magic_findSkew: top half: %04.04f %d\n",TSlopeHalf,TOffsetHalf); LSlopeHalf = tan((atan(LSlope) + ((LSlope < 0)?-M_PI_2:M_PI_2))/2); LOffsetHalf = - LSlopeHalf * TXInter; DBG(15,"sanei_magic_findSkew: left half: %04.04f %d\n",LSlopeHalf,LOffsetHalf); rotateX = (LOffsetHalf-TOffsetHalf) / (TSlopeHalf-LSlopeHalf); rotateY = TSlopeHalf * rotateX + TOffsetHalf; DBG(15,"sanei_magic_findSkew: rotate: %d %d\n",rotateX,rotateY); *centerX = rotateX; *centerY = rotateY; *finSlope = TSlope; cleanup: if(topBuf) free(topBuf); if(botBuf) free(botBuf); DBG (10, "sanei_magic_findSkew: finish\n"); return ret; } /* function to do a simple rotation by a given slope, around * a given point. The point can be outside of image to get * proper edge alignment. Unused areas filled with bg color * FIXME: Do in-place rotation to save memory */ SANE_Status sanei_magic_rotate (SANE_Parameters * params, SANE_Byte * buffer, int centerX, int centerY, double slope, int bg_color) { SANE_Status ret = SANE_STATUS_GOOD; double slopeRad = -atan(slope); double slopeSin = sin(slopeRad); double slopeCos = cos(slopeRad); int pwidth = params->pixels_per_line; int bwidth = params->bytes_per_line; int height = params->lines; int depth = 1; unsigned char * outbuf; int i, j, k; DBG(10,"sanei_magic_rotate: start: %d %d\n",centerX,centerY); outbuf = malloc(bwidth*height); if(!outbuf){ DBG(15,"sanei_magic_rotate: no outbuf\n"); ret = SANE_STATUS_NO_MEM; goto cleanup; } if(params->format == SANE_FRAME_RGB || (params->format == SANE_FRAME_GRAY && params->depth == 8) ){ if(params->format == SANE_FRAME_RGB) depth = 3; memset(outbuf,bg_color,bwidth*height); for (i=0; i= pwidth) continue; sourceY = centerY + (int)(-shiftY * slopeCos + shiftX * slopeSin); if (sourceY < 0 || sourceY >= height) continue; for (k=0; kformat == SANE_FRAME_GRAY && params->depth == 1){ if(bg_color) bg_color = 0xff; memset(outbuf,bg_color,bwidth*height); for (i=0; i= pwidth) continue; sourceY = centerY + (int)(-shiftY * slopeCos + shiftX * slopeSin); if (sourceY < 0 || sourceY >= height) continue; /* wipe out old bit */ outbuf[i*bwidth + j/8] &= ~(1 << (7-(j%8))); /* fill in new bit */ outbuf[i*bwidth + j/8] |= ((buffer[sourceY*bwidth + sourceX/8] >> (7-(sourceX%8))) & 1) << (7-(j%8)); } } } else{ DBG (5, "sanei_magic_rotate: unsupported format/depth\n"); ret = SANE_STATUS_INVAL; goto cleanup; } memcpy(buffer,outbuf,bwidth*height); cleanup: if(outbuf) free(outbuf); DBG(10,"sanei_magic_rotate: finish\n"); return 0; } /* Utility functions, not used outside this file */ /* Repeatedly call getLine to find the best range of slope and offset. * Shift the ranges thru 4 different positions to avoid splitting data * across multiple bins (false positive). Home-in on the most likely upper * line of the paper inside the image. Return the 'best' edge. */ SANE_Status getTopEdge(int width, int height, int resolution, int * buff, double * finSlope, int * finXInter, int * finYInter) { SANE_Status ret = SANE_STATUS_GOOD; int slopes = 31; int offsets = 31; double maxSlope = 1; double minSlope = -1; int maxOffset = resolution/6; int minOffset = -resolution/6; double topSlope = 0; int topOffset = 0; int topDensity = 0; int i,j; int pass = 0; DBG(10,"getTopEdge: start\n"); while(pass++ < 7){ double sStep = (maxSlope-minSlope)/slopes; int oStep = (maxOffset-minOffset)/offsets; double slope = 0; int offset = 0; int density = 0; int go = 0; topSlope = 0; topOffset = 0; topDensity = 0; /* find lines 4 times with slightly moved params, * to bypass binning errors, highest density wins */ for(i=0;i<2;i++){ double sStep2 = sStep*i/2; for(j=0;j<2;j++){ int oStep2 = oStep*j/2; ret = getLine(height,width,buff,slopes,minSlope+sStep2,maxSlope+sStep2,offsets,minOffset+oStep2,maxOffset+oStep2,&slope,&offset,&density); if(ret){ DBG(5,"getTopEdge: getLine error %d\n",ret); return ret; } DBG(15,"getTopEdge: %d %d %+0.4f %d %d\n",i,j,slope,offset,density); if(density > topDensity){ topSlope = slope; topOffset = offset; topDensity = density; } } } DBG(15,"getTopEdge: ok %+0.4f %d %d\n",topSlope,topOffset,topDensity); /* did not find anything promising on first pass, * give up instead of fixating on some small, pointless feature */ if(pass == 1 && topDensity < width/5){ DBG(5,"getTopEdge: density too small %d %d\n",topDensity,width); topOffset = 0; topSlope = 0; break; } /* if slope can zoom in some more, do so. */ if(sStep >= 0.0001){ minSlope = topSlope - sStep; maxSlope = topSlope + sStep; go = 1; } /* if offset can zoom in some more, do so. */ if(oStep){ minOffset = topOffset - oStep; maxOffset = topOffset + oStep; go = 1; } /* cannot zoom in more, bail out */ if(!go){ break; } DBG(15,"getTopEdge: zoom: %+0.4f %+0.4f %d %d\n", minSlope,maxSlope,minOffset,maxOffset); } /* topOffset is in the center of the image, * convert to x and y intercept */ if(topSlope != 0){ *finYInter = topOffset - topSlope * width/2; *finXInter = *finYInter / -topSlope; *finSlope = topSlope; } else{ *finYInter = 0; *finXInter = 0; *finSlope = 0; } DBG(10,"getTopEdge: finish\n"); return 0; } /* Loop thru a transition array, and use a simplified Hough transform * to divide likely edges into a 2-d array of bins. Then weight each * bin based on its angle and offset. Return the 'best' bin. */ SANE_Status getLine (int height, int width, int * buff, int slopes, double minSlope, double maxSlope, int offsets, int minOffset, int maxOffset, double * finSlope, int * finOffset, int * finDensity) { SANE_Status ret = 0; int ** lines = NULL; int i, j; int rise, run; double slope; int offset; int sIndex, oIndex; int hWidth = width/2; double * slopeCenter = NULL; int * slopeScale = NULL; double * offsetCenter = NULL; int * offsetScale = NULL; int maxDensity = 1; double absMaxSlope = fabs(maxSlope); double absMinSlope = fabs(minSlope); int absMaxOffset = abs(maxOffset); int absMinOffset = abs(minOffset); DBG(10,"getLine: start %+0.4f %+0.4f %d %d\n", minSlope,maxSlope,minOffset,maxOffset); /*silence compiler*/ height = height; if(absMaxSlope < absMinSlope) absMaxSlope = absMinSlope; if(absMaxOffset < absMinOffset) absMaxOffset = absMinOffset; /* build an array of pretty-print values for slope */ slopeCenter = calloc(slopes,sizeof(double)); if(!slopeCenter){ DBG(5,"getLine: cant load slopeCenter\n"); ret = SANE_STATUS_NO_MEM; goto cleanup; } /* build an array of scaling factors for slope */ slopeScale = calloc(slopes,sizeof(int)); if(!slopeScale){ DBG(5,"getLine: cant load slopeScale\n"); ret = SANE_STATUS_NO_MEM; goto cleanup; } for(j=0;j= maxSlope || slope < minSlope) continue; /* offset in center of width, not y intercept! */ offset = slope * hWidth + buff[i] - slope * i; if(offset >= maxOffset || offset < minOffset) continue; sIndex = (slope - minSlope) * slopes/(maxSlope-minSlope); if(sIndex >= slopes) continue; oIndex = (offset - minOffset) * offsets/(maxOffset-minOffset); if(oIndex >= offsets) continue; lines[sIndex][oIndex]++; } } /* go thru array, and find most dense line (highest number) */ for(i=0;i maxDensity) maxDensity = lines[i][j]; } } DBG(15,"getLine: maxDensity %d\n",maxDensity); *finSlope = 0; *finOffset = 0; *finDensity = 0; /* go thru array, and scale densities to % of maximum, plus adjust for * prefered (smaller absolute value) slope and offset */ for(i=0;i *finDensity){ *finDensity = lines[i][j]; *finSlope = slopeCenter[i]; *finOffset = offsetCenter[j]; } } } if(0){ DBG(15,"offsetCenter: "); for(j=0;j txi){ topXInter = txi; topYInter = tyi; } leftCount++; if(leftCount > 5){ break; } } else{ topXInter = width; topYInter = 0; leftCount = 0; } } botXInter = width; botYInter = 0; leftCount = 0; for(i=0;i -1){ int byi = bot[i] - (slope * i); int bxi = byi/-slope; if(botXInter > bxi){ botXInter = bxi; botYInter = byi; } leftCount++; if(leftCount > 5){ break; } } else{ botXInter = width; botYInter = 0; leftCount = 0; } } if(botXInter < topXInter){ *finXInter = botXInter; *finYInter = botYInter; } else{ *finXInter = topXInter; *finYInter = topYInter; } DBG(10,"getEdgeSlope: finish\n"); return 0; } /* Loop thru the image and look for first color change in each column. * Return a malloc'd array. Caller is responsible for freeing. */ int * sanei_magic_getTransY ( SANE_Parameters * params, int dpi, SANE_Byte * buffer, int top) { int * buff; int i, j, k; int winLen = 9; int width = params->pixels_per_line; int height = params->lines; int depth = 1; /* defaults for bottom-up */ int firstLine = height-1; int lastLine = -1; int direction = -1; DBG (10, "sanei_magic_getTransY: start\n"); /* override for top-down */ if(top){ firstLine = 0; lastLine = height; direction = 1; } /* build output and preload with impossible value */ buff = calloc(width,sizeof(int)); if(!buff){ DBG (5, "sanei_magic_getTransY: no buff\n"); return NULL; } for(i=0; iformat == SANE_FRAME_RGB || (params->format == SANE_FRAME_GRAY && params->depth == 8) ){ if(params->format == SANE_FRAME_RGB) depth = 3; /* loop over all columns, find first transition */ for(i=0; i= height){ farLine = firstLine; } if(nearLine < 0 || nearLine >= height){ nearLine = firstLine; } for(k=0; k 50*winLen*depth - near*40/255){ buff[i] = j; break; } } } } else if(params->format == SANE_FRAME_GRAY && params->depth == 1){ int near = 0; for(i=0; i> (7-(i%8)) & 1; /* move */ for(j=firstLine+direction; j!=lastLine; j+=direction){ if((buffer[(j*width+i)/8] >> (7-(i%8)) & 1) != near){ buff[i] = j; break; } } } } /* some other format? */ else{ DBG (5, "sanei_magic_getTransY: unsupported format/depth\n"); free(buff); return NULL; } /* ignore transitions with few neighbors within .5 inch */ for(i=0;ibytes_per_line; int width = params->pixels_per_line; int height = params->lines; int depth = 1; /* defaults for right-first */ int firstCol = width-1; int lastCol = -1; int direction = -1; DBG (10, "sanei_magic_getTransX: start\n"); /* override for left-first*/ if(left){ firstCol = 0; lastCol = width; direction = 1; } /* build output and preload with impossible value */ buff = calloc(height,sizeof(int)); if(!buff){ DBG (5, "sanei_magic_getTransX: no buff\n"); return NULL; } for(i=0; iformat == SANE_FRAME_RGB || (params->format == SANE_FRAME_GRAY && params->depth == 8) ){ if(params->format == SANE_FRAME_RGB) depth = 3; /* loop over all columns, find first transition */ for(i=0; i= width){ farCol = firstCol; } if(nearCol < 0 || nearCol >= width){ nearCol = firstCol; } for(k=0; k 50*winLen*depth - near*40/255){ buff[i] = j; break; } } } } else if (params->format == SANE_FRAME_GRAY && params->depth == 1){ int near = 0; for(i=0; i> (7-(firstCol%8)) & 1; /* move */ for(j=firstCol+direction; j!=lastCol; j+=direction){ if((buffer[i*bwidth + j/8] >> (7-(j%8)) & 1) != near){ buff[i] = j; break; } } } } /* some other format? */ else{ DBG (5, "sanei_magic_getTransX: unsupported format/depth\n"); free(buff); return NULL; } /* ignore transitions with few neighbors within .5 inch */ for(i=0;i #include #include #include "../include/sane/sane.h" #include "../include/sane/sanei_wire.h" #include "../include/sane/sanei_codec_bin.h" static void bin_w_byte (Wire *w, void *v) { SANE_Byte *b = v; sanei_w_space (w, 1); if (w->status) return; switch (w->direction) { case WIRE_ENCODE: *w->buffer.curr++ = *b; break; case WIRE_DECODE: *b = *w->buffer.curr++; break; case WIRE_FREE: break; } } static void bin_w_string (Wire *w, void *v) { SANE_Word len; SANE_String *s = v; if (w->direction != WIRE_DECODE) { len = 0; if (*s) len = strlen (*s) + 1; } sanei_w_array (w, &len, v, w->codec.w_byte, 1); if (w->direction == WIRE_DECODE) { if (len == 0) *s = 0; else if (w->status == 0) *(*s + len - 1) = '\0'; } } static void bin_w_word (Wire *w, void *v) { SANE_Word val, *word = v; sanei_w_space (w, 4); if (w->status) return; switch (w->direction) { case WIRE_ENCODE: val = *word; /* store in bigendian byte-order: */ w->buffer.curr[0] = (val >> 24) & 0xff; w->buffer.curr[1] = (val >> 16) & 0xff; w->buffer.curr[2] = (val >> 8) & 0xff; w->buffer.curr[3] = (val >> 0) & 0xff; w->buffer.curr += 4; break; case WIRE_DECODE: val = ( ((w->buffer.curr[0] & 0xff) << 24) | ((w->buffer.curr[1] & 0xff) << 16) | ((w->buffer.curr[2] & 0xff) << 8) | ((w->buffer.curr[3] & 0xff) << 0)); *word = val; w->buffer.curr += 4; break; case WIRE_FREE: break; } } void sanei_codec_bin_init (Wire *w) { w->codec.w_byte = bin_w_byte; w->codec.w_char = bin_w_byte; w->codec.w_word = bin_w_word; w->codec.w_string = bin_w_string; } sane-backends-extras-1.0.22.3ubuntu1/sanei/sanei_init_debug.c0000664000000000000000000000674111475557446020740 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 1996, 1997 David Mosberger-Tang and Andreas Beck This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ #include "../include/sane/config.h" #include #include #include #ifdef HAVE_UNISTD_H #include #endif #include #include #include #ifdef HAVE_OS2_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #include #ifdef HAVE_OS2_H # define INCL_DOS # include #endif #define BACKEND_NAME sanei_debug #include "../include/sane/sanei_debug.h" void sanei_init_debug (const char * backend, int * var) { char ch, buf[256] = "SANE_DEBUG_"; const char * val; unsigned int i; *var = 0; for (i = 11; (ch = backend[i - 11]) != 0; ++i) { if (i >= sizeof (buf) - 1) break; buf[i] = toupper(ch); } buf[i] = '\0'; val = getenv (buf); if (!val) return; *var = atoi (val); DBG (0, "Setting debug level of %s to %d.\n", backend, *var); } void sanei_debug_msg (int level, int max_level, const char *be, const char *fmt, va_list ap) { char *msg; if (max_level >= level) { #ifdef S_IFSOCK if ( 1 == isfdtype(fileno(stderr), S_IFSOCK) ) { msg = (char *)malloc (sizeof(char) * (strlen(be) + strlen(fmt) + 4)); if (msg == NULL) { syslog (LOG_DEBUG, "[sanei_debug] malloc() failed\n"); vsyslog (LOG_DEBUG, fmt, ap); } else { sprintf (msg, "[%s] %s", be, fmt); vsyslog(LOG_DEBUG, msg, ap); free (msg); } } else #endif { fprintf (stderr, "[%s] ", be); vfprintf (stderr, fmt, ap); } } } #ifdef NDEBUG void sanei_debug_ndebug (int level, const char *fmt, ...) { /* this function is never called */ } #endif sane-backends-extras-1.0.22.3ubuntu1/sanei/sanei_tcp.c0000664000000000000000000000645711475557446017421 0ustar /* sane - Scanner Access Now Easy. Copyright (C) 2006 Tower Technologies Author: Alessandro Zummo This file is part of the SANE package. 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 of the License, 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. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ #include "../include/sane/config.h" #include #include #include #include #include #define BACKEND_NAME sanei_tcp #include "../include/sane/sane.h" #include "../include/sane/sanei_debug.h" #include "../include/sane/sanei_tcp.h" SANE_Status sanei_tcp_open(const char *host, int port, int *fdp) { int fd, err; struct sockaddr_in saddr; struct hostent *h; DBG_INIT(); DBG(1, "%s: host = %s, port = %d\n", __FUNCTION__, host, port); h = gethostbyname(host); if (h == NULL || h->h_addr_list[0] == NULL || h->h_addrtype != AF_INET) return SANE_STATUS_INVAL; if ((fd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) return SANE_STATUS_INVAL; memset(&saddr, 0x00, sizeof(struct sockaddr_in)); saddr.sin_family = AF_INET; saddr.sin_port = htons(port); memcpy(&saddr.sin_addr, h->h_addr_list[0], h->h_length); if ((err = connect(fd, (struct sockaddr *) &saddr, sizeof(struct sockaddr_in))) != 0) { close(fd); return SANE_STATUS_INVAL; } *fdp = fd; return SANE_STATUS_GOOD; } void sanei_tcp_close(int fd) { close(fd); } ssize_t sanei_tcp_write(int fd, const u_char * buf, int count) { return send(fd, buf, count, 0); } ssize_t sanei_tcp_read(int fd, u_char * buf, int count) { ssize_t bytes_recv = 0, rc = 1; while (bytes_recv < count && rc > 0) { rc = recv(fd, buf+bytes_recv, count-bytes_recv, 0); if (rc > 0) bytes_recv += rc; } return bytes_recv; } sane-backends-extras-1.0.22.3ubuntu1/sanei/linux_sg3_err.h0000664000000000000000000001213311475557446020230 0ustar /* sane - Scanner Access Now Easy. This file is part of the SANE package. SANE 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 of the License, or (at your option) any later version. SANE 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 sane; see the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. If you do not wish that, delete this exception notice. */ #ifndef SG_ERR_H #define SG_ERR_H /* Linux sg error codes taken from Doug Gilbert's sg_utils: http://www.torque.net/sg/ */ /* Some of the following error/status codes are exchanged between the various layers of the SCSI sub-system in Linux and should never reach the user. They are placed here for completeness. What appears here is copied from drivers/scsi/scsi.h which is not visible in the user space. */ /* The following are 'host_status' codes */ #ifndef DID_OK #define DID_OK 0x00 #endif #ifndef DID_NO_CONNECT #define DID_NO_CONNECT 0x01 /* Unable to connect before timeout */ #define DID_BUS_BUSY 0x02 /* Bus remain busy until timeout */ #define DID_TIME_OUT 0x03 /* Timed out for some other reason */ #define DID_BAD_TARGET 0x04 /* Bad target (id?) */ #define DID_ABORT 0x05 /* Told to abort for some other reason */ #define DID_PARITY 0x06 /* Parity error (on SCSI bus) */ #define DID_ERROR 0x07 /* Internal error */ #define DID_RESET 0x08 /* Reset by somebody */ #define DID_BAD_INTR 0x09 /* Received an unexpected interrupt */ #define DID_PASSTHROUGH 0x0a /* Force command past mid-level */ #define DID_SOFT_ERROR 0x0b /* The low-level driver wants a retry */ #endif /* These defines are to isolate applictaions from kernel define changes */ #define SG_ERR_DID_OK DID_OK #define SG_ERR_DID_NO_CONNECT DID_NO_CONNECT #define SG_ERR_DID_BUS_BUSY DID_BUS_BUSY #define SG_ERR_DID_TIME_OUT DID_TIME_OUT #define SG_ERR_DID_BAD_TARGET DID_BAD_TARGET #define SG_ERR_DID_ABORT DID_ABORT #define SG_ERR_DID_PARITY DID_PARITY #define SG_ERR_DID_ERROR DID_ERROR #define SG_ERR_DID_RESET DID_RESET #define SG_ERR_DID_BAD_INTR DID_BAD_INTR #define SG_ERR_DID_PASSTHROUGH DID_PASSTHROUGH #define SG_ERR_DID_SOFT_ERROR DID_SOFT_ERROR /* The following are 'driver_status' codes */ #ifndef DRIVER_OK #define DRIVER_OK 0x00 #endif #ifndef DRIVER_BUSY #define DRIVER_BUSY 0x01 #define DRIVER_SOFT 0x02 #define DRIVER_MEDIA 0x03 #define DRIVER_ERROR 0x04 #define DRIVER_INVALID 0x05 #define DRIVER_TIMEOUT 0x06 #define DRIVER_HARD 0x07 #define DRIVER_SENSE 0x08 /* Sense_buffer has been set */ /* Following "suggests" are "or-ed" with one of previous 8 entries */ #define SUGGEST_RETRY 0x10 #define SUGGEST_ABORT 0x20 #define SUGGEST_REMAP 0x30 #define SUGGEST_DIE 0x40 #define SUGGEST_SENSE 0x80 #define SUGGEST_IS_OK 0xff #endif #ifndef DRIVER_MASK #define DRIVER_MASK 0x0f #endif #ifndef SUGGEST_MASK #define SUGGEST_MASK 0xf0 #endif /* These defines are to isolate applictaions from kernel define changes */ #define SG_ERR_DRIVER_OK DRIVER_OK #define SG_ERR_DRIVER_BUSY DRIVER_BUSY #define SG_ERR_DRIVER_SOFT DRIVER_SOFT #define SG_ERR_DRIVER_MEDIA DRIVER_MEDIA #define SG_ERR_DRIVER_ERROR DRIVER_ERROR #define SG_ERR_DRIVER_INVALID DRIVER_INVALID #define SG_ERR_DRIVER_TIMEOUT DRIVER_TIMEOUT #define SG_ERR_DRIVER_HARD DRIVER_HARD #define SG_ERR_DRIVER_SENSE DRIVER_SENSE #define SG_ERR_SUGGEST_RETRY SUGGEST_RETRY #define SG_ERR_SUGGEST_ABORT SUGGEST_ABORT #define SG_ERR_SUGGEST_REMAP SUGGEST_REMAP #define SG_ERR_SUGGEST_DIE SUGGEST_DIE #define SG_ERR_SUGGEST_SENSE SUGGEST_SENSE #define SG_ERR_SUGGEST_IS_OK SUGGEST_IS_OK #define SG_ERR_DRIVER_MASK DRIVER_MASK #define SG_ERR_SUGGEST_MASK SUGGEST_MASK #endif sane-backends-extras-1.0.22.3ubuntu1/sanei/Makefile.am0000664000000000000000000000177311514441551017317 0ustar ## Makefile.am -- an automake template for Makefile.in file ## Copyright (C) 2009 Chris Bagwell and Sane Developers. ## ## This file is part of the "Sane" build infra-structure. See ## included LICENSE file for license information. AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_builddir)/include \ -I$(top_srcdir)/include check_PROGRAMS = test_wire TESTS = $(check_PROGRAMS) noinst_LTLIBRARIES = libsanei.la libsanei_la_SOURCES = sanei_ab306.c sanei_constrain_value.c \ sanei_init_debug.c sanei_net.c sanei_wire.c sanei_codec_ascii.c \ sanei_codec_bin.c sanei_scsi.c sanei_config.c sanei_config2.c \ sanei_pio.c sanei_pa4s2.c sanei_auth.c sanei_usb.c sanei_thread.c \ sanei_pv8630.c sanei_pp.c sanei_lm983x.c sanei_access.c sanei_tcp.c \ sanei_udp.c sanei_magic.c if HAVE_JPEG libsanei_la_SOURCES += sanei_jpeg.c endif EXTRA_DIST = linux_sg3_err.h os2_srb.h sanei_DomainOS.c sanei_DomainOS.h test_wire_SOURCES = test_wire.c test_wire_LDADD = libsanei.la ../lib/liblib.la clean-local: rm -f test_wire.out sane-backends-extras-1.0.22.3ubuntu1/missing0000775000000000000000000002557711475557446015614 0ustar #! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2006-05-10.23 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # 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., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case $1 in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $1 in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: sane-backends-extras-1.0.22.3ubuntu1/doc/0000775000000000000000000000000011600675052014722 5ustar sane-backends-extras-1.0.22.3ubuntu1/doc/sane-geniusvp2.man0000664000000000000000000000732511527030341020266 0ustar .\" .IX sane-geniusvp2 .TH "sane-geniusvp2" "5" "08 Feb 2005" "@PACKAGEVERSION@" "SANE Scanner Access Now Easy" .SH "NAME" sane\-geniusvp2 \- SANE backend for Genius ColorPage\-Vivid Pro II (PP) scanner .SH "DESCRIPTION" The .B sane\-geniusvp2 backend supports EICI 091000 based parallel port flatbed scanners. This ASIC can be found on some Primax devices, and on the Genius ColorPage\-Vivid Pro II scanner (which is actually a Primax OEM device). .SH "SUPPORTED DEVICES" The following scanner should work with this backend: Device Details .br \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- .br Vendor: Genius .br Model: ColorPage\-Vivid Pro II .br FCC ID: EMJFB308C .br MODEL NO: FB601C Chipset Details .br \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- .br ASIC ID: 0xE1 .br Product ID: 0x06 .br ASIC: EICI 091000 .br AFE: Wolfson WM\-8143\-12 .br Memory: NEC uPD424210\-60 (256 Kb?) .SH "CONFIGURATION" .PP This section decribes the backend's configuration file entries. The file is located at: .IP .I @CONFIGDIR@/geniusvp2.conf .PP For a proper setup, you will need at least this entry: .IP .I device parport0 .PP Currently, only access through ppdev is supported. .SH "PARALLEL PORT MODES" .PP Only EPP mode (including "EPP+ECP") is supported. Future versions may include support for the (slower) SPP mode. .SH "FILES" .TP .I @CONFIGDIR@/geniusvp2.conf The backend configuration file .TP .I @LIBDIR@/libsane\-geniusvp2.a The static library implementing this backend. .TP .I @LIBDIR@/libsane\-geniusvp2.so The shared library implementing this backend (present on systems that support dynamic loading). .SH "ENVIRONMENT" .TP .B SANE_CONFIG_DIR This environment variable specifies the list of directories that may contain the configuration file. Under UNIX, the directories are separated by a colon (`:'), under OS/2, they are separated by a semi\-colon (`;'). If this variable is not set, the configuration file is searched in two default directories: first, the current working directory (".") and then in @CONFIGDIR@. If the value of the environment variable ends with the directory separator character, then the default directories are searched after the explicitly specified directories. For example, setting .B SANE_CONFIG_DIR to "/tmp/config:" would result in directories "/tmp/config", ".", and "@CONFIGDIR@" being searched (in this order). .TP .B SANE_DEBUG_GENIUSVP2 If the library was compiled with debug support enabled, this environment variable controls the debug level for this backend. Higher debug levels increase the verbosity of the output. Example: export SANE_DEBUG_GENIUSVP2=10 To obtain debug messages from the backend, set this environment variable before calling your favorite frontend (e.g. xscanimage). Example: export SANE_DEBUG_GENIUSVP2=10 ; xscanimage .SH "KNOWN BUGS AND RESTRICTIONS" .PP Scan may sometimes timeout due to the scanner's buffer not being filled after some reasonable time, and you get a truncated image. Just try scanning again and it should work. .PP Scans at high resolutions (e.g. 600 dpi.) may also be truncated if the selected scan area is too large. Just scan at lower (<= 300 dpi.) resolutions for now if you want a larger image. .PP The lamp carriage may sometimes go out of its maximum distance (297 mm), forcing the motor engine. You can detect this when the scanner produces a "strange" noise and the carriage is at its maximum distance from home. In this situation, .B turn off scanner power imediately, or you may risk damage your device. This seems to happen more often when scanning full pages at high resolutions. .SH "SEE ALSO" .BR sane (7), .br .I http://sourceforge.net/projects/geniusvp2/ .SH "AUTHOR" .PP Anderson Lizardo sane-backends-extras-1.0.22.3ubuntu1/doc/Makefile.in0000664000000000000000000006734111527266663017016 0ustar # Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/byteorder.m4 \ $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/sane/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man7dir)" \ "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(docdir)" man7dir = $(mandir)/man7 man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man1_MANS) $(man7_MANS) $(man8_MANS) DATA = $(doc_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AWK = @AWK@ BACKEND_CONFS_ENABLED = @BACKEND_CONFS_ENABLED@ BACKEND_LIBS_ENABLED = @BACKEND_LIBS_ENABLED@ # Create a list of man pages for only backends that are compiled in so # that is all that gets installed. Also, build a complete list of all # backend man pages. This allows a user to optionally generate all # man pages in HTML form for things like posting to a web site. # # Backend man pages bypass standard automake man5_MANS because there is not # a man page for every supported backend. We could get rid of # custom install/uninstall if we required man pages for every backend. BACKEND_MANS_ENABLED = @BACKEND_MANS_ENABLED@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISTCLEAN_FILES = @DISTCLEAN_FILES@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DVIPS = @DVIPS@ DYNAMIC_FLAG = @DYNAMIC_FLAG@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GPHOTO2_CPPFLAGS = @GPHOTO2_CPPFLAGS@ GPHOTO2_LDFLAGS = @GPHOTO2_LDFLAGS@ GPHOTO2_LIBS = @GPHOTO2_LIBS@ GREP = @GREP@ HAVE_GPHOTO2 = @HAVE_GPHOTO2@ IEEE1284_LIBS = @IEEE1284_LIBS@ INCLUDES = @INCLUDES@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_LOCKPATH = @INSTALL_LOCKPATH@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JPEG_LIBS = @JPEG_LIBS@ LATEX = TEXINPUTS="$(srcdir):$$TEXINPUTS" @LATEX@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUSB_1_0_CFLAGS = @LIBUSB_1_0_CFLAGS@ LIBUSB_1_0_LIBS = @LIBUSB_1_0_LIBS@ LIBV4L_CFLAGS = @LIBV4L_CFLAGS@ LIBV4L_LIBS = @LIBV4L_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LOCKPATH_GROUP = @LOCKPATH_GROUP@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINDEX = @MAKEINDEX@ MAKEINFO = @MAKEINFO@ MATH_LIB = @MATH_LIB@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ NUMBER_VERSION = @NUMBER_VERSION@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PRELOADABLE_BACKENDS = @PRELOADABLE_BACKENDS@ PRELOADABLE_BACKENDS_ENABLED = @PRELOADABLE_BACKENDS_ENABLED@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RESMGR_LIBS = @RESMGR_LIBS@ SANEI_SANEI_JPEG_LO = @SANEI_SANEI_JPEG_LO@ SANE_CONFIG_PATH = @SANE_CONFIG_PATH@ SCSI_LIBS = @SCSI_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SNMP_CONFIG_PATH = @SNMP_CONFIG_PATH@ SOCKET_LIBS = @SOCKET_LIBS@ STRICT_LDFLAGS = @STRICT_LDFLAGS@ STRIP = @STRIP@ SYSLOG_LIBS = @SYSLOG_LIBS@ TIFF_LIBS = @TIFF_LIBS@ USB_LIBS = @USB_LIBS@ VERSION = @VERSION@ V_MAJOR = @V_MAJOR@ V_MINOR = @V_MINOR@ V_REV = @V_REV@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ configdir = @configdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ effective_target = @effective_target@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ locksanedir = @locksanedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ man1_MANS = EXTRA_DIST = scanimage.man sane-config.man sane-find-scanner.man \ gamma4scanimage.man sane.tex net.tex html.sty $(DESC_FILES) \ descriptions/template.desc. $(DESC_EXT_FILES) \ descriptions-external/template.desc. figs/area.eps \ figs/area.fig figs/flow.eps figs/flow.fig figs/hierarchy.eps \ figs/hierarchy.fig figs/image-data.eps figs/image-data.fig \ figs/xfer.eps figs/xfer.fig icons/contents.gif icons/index.gif \ icons/next.gif icons/next_gr.gif icons/previous.gif \ icons/previous_gr.gif icons/references.gif \ icons/references_gr.gif icons/up.gif icons/up_gr.gif BACKEND_5MANS = sane-geniusvp2.5 man7_MANS = man8_MANS = MANPAGES = $(man1_MANS) $(BACKEND_5MANS) $(man7_MANS) $(man8_MANS) HTML_PAGES = doc_DATA = @USE_LATEX_FALSE@STANDARD = @USE_LATEX_TRUE@STANDARD = sane.ps DLH = TEXINPUTS="$(srcdir):$$TEXINPUTS" dlh MAN2HTML = nroff -man |\ man2html -compress -topm 6 -botm 6 -nodepage -title $${page} \ -cgiurl '$$title.$$section.html'|\ sed 's,,

,' beman5dir = $(mandir)/man5 BEDOCS = canon/canon.changes canon/canon.install2700F.txt \ gt68xx/gt68xx.CHANGES gt68xx/gt68xx.TODO leo/leo.txt \ matsushita/matsushita.txt mustek/mustek.CHANGES \ mustek_usb/mustek_usb.CHANGES mustek_usb/mustek_usb.TODO \ mustek_usb2/mustek_usb2.CHANGES mustek_usb2/mustek_usb2.TODO \ niash/niash.TODO plustek/FAQ plustek/MakeModule.sh \ plustek/Makefile.kernel24 plustek/Makefile.kernel26 \ plustek/Plustek-PARPORT-TODO.txt \ plustek/Plustek-PARPORT.changes plustek/Plustek-PARPORT.txt \ plustek/Plustek-USB-TODO.txt plustek/Plustek-USB.changes \ plustek/Plustek-USB.txt sceptre/s1200.txt teco/teco1.txt \ teco/teco2.txt teco/teco3.txt u12/U12.changes u12/U12.todo \ umax/negative-types.txt umax/sane-logo.jpg \ umax/sane-umax-advanced-options-doc.html \ umax/sane-umax-advanced.jpg umax/sane-umax-astra-doc.html \ umax/sane-umax-config-doc.html umax/sane-umax-doc.html \ umax/sane-umax-histogram.jpg umax/sane-umax-mirage-doc.html \ umax/sane-umax-not-listed-doc.html \ umax/sane-umax-others-doc.html umax/sane-umax-parport-doc.html \ umax/sane-umax-powerlook-doc.html \ umax/sane-umax-scanner-clones-doc.html \ umax/sane-umax-speed-doc.html \ umax/sane-umax-standard-options-doc.html \ umax/sane-umax-standard.jpg umax/sane-umax-text.jpg \ umax/sane-umax-text2.jpg umax/sane-umax-text4.jpg \ umax/sane-umax-uc-doc.html umax/sane-umax-vista-doc.html \ umax/sane-umax.jpg umax/umax.BUGS umax/umax.CHANGES \ umax/umax.FAQ umax/umax.TODO DESC_FILES = descriptions/abaton.desc descriptions/agfafocus.desc \ descriptions/apple.desc descriptions/artec.desc \ descriptions/artec_eplus48u.desc descriptions/as6e.desc \ descriptions/avision.desc descriptions/bh.desc descriptions/canon630u.desc \ descriptions/canon.desc descriptions/canon_dr.desc \ descriptions/canon_pp.desc descriptions/cardscan.desc \ descriptions/coolscan2.desc descriptions/coolscan.desc \ descriptions/coolscan3.desc \ descriptions/dc210.desc descriptions/dc240.desc descriptions/dc25.desc \ descriptions/dell1600n_net.desc descriptions/dll.desc descriptions/dmc.desc \ descriptions/epjitsu.desc descriptions/epson2.desc descriptions/epson.desc \ descriptions/fujitsu.desc descriptions/genesys.desc \ descriptions/gphoto2.desc descriptions/gt68xx.desc descriptions/hp3500.desc \ descriptions/hp3900.desc descriptions/hp4200.desc descriptions/hp5400.desc \ descriptions/hp5590.desc descriptions/hp.desc descriptions/hpljm1005.desc \ descriptions/hpsj5s.desc descriptions/hs2p.desc descriptions/ibm.desc \ descriptions/kodak.desc descriptions/kvs1025.desc descriptions/kvs20xx.desc \ descriptions/leo.desc descriptions/lexmark.desc descriptions/ma1509.desc \ descriptions/magicolor.desc \ descriptions/matsushita.desc descriptions/microtek2.desc \ descriptions/microtek.desc descriptions/mustek.desc \ descriptions/mustek_pp.desc descriptions/mustek_usb2.desc \ descriptions/mustek_usb.desc descriptions/nec.desc descriptions/net.desc \ descriptions/niash.desc descriptions/pie.desc descriptions/pint.desc \ descriptions/p5.desc descriptions/pixma.desc descriptions/plustek.desc \ descriptions/plustek_pp.desc descriptions/pnm.desc descriptions/qcam.desc \ descriptions/ricoh.desc descriptions/rts8891.desc descriptions/s9036.desc \ descriptions/sceptre.desc descriptions/sharp.desc descriptions/sm3600.desc \ descriptions/sm3840.desc descriptions/snapscan.desc descriptions/sp15c.desc \ descriptions/st400.desc descriptions/stv680.desc descriptions/tamarack.desc \ descriptions/teco1.desc descriptions/teco2.desc descriptions/teco3.desc \ descriptions/test.desc descriptions/u12.desc \ descriptions/umax1220u.desc descriptions/umax.desc \ descriptions/umax_pp.desc descriptions/unsupported.desc \ descriptions/v4l.desc descriptions/xerox_mfp.desc DESC_EXT_FILES = descriptions-external/brother2.desc \ descriptions-external/brother.desc \ descriptions-external/brother-mfc4600.desc \ descriptions-external/canon_mfp.desc \ descriptions-external/cs3200f.desc \ descriptions-external/epkowa.desc \ descriptions-external/geniusvp2.desc \ descriptions-external/hp3770.desc \ descriptions-external/hp8200.desc \ descriptions-external/hpaio.desc \ descriptions-external/hpoj.desc \ descriptions-external/kodak-twain.desc \ descriptions-external/lhii.desc \ descriptions-external/mustek_a3p1.desc \ descriptions-external/primascan.desc \ descriptions-external/primax.desc \ descriptions-external/samsung.desc \ descriptions-external/scanwit.desc \ descriptions-external/v4l2.desc \ descriptions-external/viceo.desc all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man1_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ test -z "$$files" || { \ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } install-man7: $(man7_MANS) @$(NORMAL_INSTALL) test -z "$(man7dir)" || $(MKDIR_P) "$(DESTDIR)$(man7dir)" @list='$(man7_MANS)'; test -n "$(man7dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^7][0-9a-z]*$$,7,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man7dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man7dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man7dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man7dir)" || exit $$?; }; \ done; } uninstall-man7: @$(NORMAL_UNINSTALL) @list='$(man7_MANS)'; test -n "$(man7dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^7][0-9a-z]*$$,7,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ test -z "$$files" || { \ echo " ( cd '$(DESTDIR)$(man7dir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(man7dir)" && rm -f $$files; } install-man8: $(man8_MANS) @$(NORMAL_INSTALL) test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)" @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ done; } uninstall-man8: @$(NORMAL_UNINSTALL) @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ test -z "$$files" || { \ echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(man8dir)" && rm -f $$files; } install-docDATA: $(doc_DATA) @$(NORMAL_INSTALL) test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)" @list='$(doc_DATA)'; test -n "$(docdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ done uninstall-docDATA: @$(NORMAL_UNINSTALL) @list='$(doc_DATA)'; test -n "$(docdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(docdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(docdir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) $(DATA) installdirs: for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man7dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(docdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-local dvi: dvi-am dvi-am: html-am: info: info-am info-am: install-data-am: install-data-local install-docDATA install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-man7 install-man8 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-docDATA uninstall-local uninstall-man uninstall-man: uninstall-man1 uninstall-man7 uninstall-man8 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ clean-local distclean distclean-generic distclean-libtool \ distclean-local distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-local install-docDATA install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ install-man7 install-man8 install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-docDATA uninstall-local uninstall-man uninstall-man1 \ uninstall-man7 uninstall-man8 all: bemans %.1 %.5 %.7 %.8: %.man @echo "Generating manpage $@..."; @sed -e 's|@DATADIR@|$(datadir)|g' \ -e 's|@CONFIGDIR@|$(configdir)|g' \ -e 's|@DOCDIR@|$(docdir)|g' \ -e 's|@LIBDIR@|$(libdir)/sane|g' \ -e 's|@BINDIR@|$(bindir)|g' \ -e 's|@SBINDIR@|$(sbindir)|g' \ -e 's|@PACKAGEVERSION@|$(package_version)|g' $^ >$@ bemans: $(BACKEND_5MANS) install-beman5: $(BACKEND_5MANS) test -z "$(beman5dir)" || $(MKDIR_P) "$(DESTDIR)$(beman5dir)" @list="$(BACKEND_MANS_ENABLED)"; for man in $$list; do \ if test ! -r $${man}; then continue; fi; \ echo "installing $${man} in $(beman5dir)/$${man}..."; \ $(INSTALL_DATA) $${man} $(DESTDIR)$(beman5dir)/$${man} \ || exit 1; \ done install-data-local: install-beman5 uninstall-local: rm -rf $(DESTDIR)$(beman5dir)/sane-*.5 sane.ind: $(srcdir)/sane.tex @echo Generating index for sane.tex... @touch sane.ind @$(LATEX) $(srcdir)/sane
/dev/null && \ $(MAKEINDEX) sane.idx 2>/dev/null && \ $(LATEX) $(srcdir)/sane
/dev/null sane.dvi: sane.ind @echo Generating sane.dvi from sane.tex... @$(LATEX) $(srcdir)/sane
/dev/null sane.ps: sane.dvi @echo Generating sane.ps from sane.dvi... @$(DVIPS) sane.dvi -o sane.ps 2>/dev/null sane-html: sane.dvi $(DLH) $(srcdir)/sane.tex html-man: $(MANPAGES) @for page in $(MANPAGES); do \ echo "translating $${page} to $${page}.html..."; \ cat $${page} | $(MAN2HTML) > $${page}.html; \ done ../tools/sane-desc: cd ../tools ; $(MAKE) sane-desc sane-backends.html: $(DESC_FILES) ../tools/sane-desc @../tools/sane-desc -m html-backends-split -s ${srcdir}/descriptions \ -i "The following table summarizes the backends/drivers distributed \ with $(PACKAGE)-$(VERSION), and the hardware or software they \ support." -d 0 > sane-backends.html sane-backends-external.html: $(DESC_EXT_FILES) ../tools/sane-desc @../tools/sane-desc -m html-backends-split \ -s ${srcdir}/descriptions-external \ -i "The following table summarizes the backends/drivers that \ have not yet been included in the SANE distribution, and the \ hardware or software they support." \ -t "SANE: External Backends (Drivers)" -d 0 \ > sane-backends-external.html sane-mfgs.html: $(DESC_FILES) ../tools/sane-desc @../tools/sane-desc -m html-mfgs -s ${srcdir}/descriptions \ -i "The following table summarizes the devices supported \ by $(PACKAGE)-$(VERSION)." \ -d 0 > sane-mfgs.html sane-mfgs-external.html: $(DESC_EXT_FILES) ../tools/sane-desc @../tools/sane-desc -m html-mfgs -s ${srcdir}/descriptions-external \ -i "The following table summarizes the devices that \ are supported by external backends." \ -t "SANE: Devices Supported by External Backends" -d 0 \ > sane-mfgs-external.html descriptions.db: $(DESC_FILES) ../tools/sane-desc @../tools/sane-desc -m ascii -s ${srcdir}/descriptions \ > descriptions.db descriptions-external.db: $(DESC_FILES) ../tools/sane-desc @../tools/sane-desc -m ascii -s ${srcdir}/descriptions-external \ > descriptions-external.db html-pages: $(HTML_PAGES) html: html-pages html-man sane-html clean-local: rm -f *.toc *.aux *.log *.cp *.fn *.tp *.vr *.pg *.ky *.blg *.idx *.cb rm -f *.ilg distclean-local: rm -f $(MANPAGES) rm -f *.lot *.lof *.ind rm -f sane.dvi sane.ps sane-backends.html sane-backends-external.html rm -f sane-mfgs.html sane-mfgs-external.html rm -f sane/*.html sane/*.gif rm -f doxygen-sanei.conf -rm -rf sane sanei-html for manpage in $(MANPAGES) ; do \ rm -f $${manpage}.html ; \ done # 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: sane-backends-extras-1.0.22.3ubuntu1/doc/Makefile.am0000664000000000000000000002416011527266611016766 0ustar ## Makefile.am -- an automake template for Makefile.in file ## Copyright (C) 2009 Chris Bagwell and Sane Developers. ## ## This file is part of the "Sane" build infra-structure. See ## included LICENSE file for license information. man1_MANS = EXTRA_DIST = scanimage.man sane-config.man sane-find-scanner.man \ gamma4scanimage.man # Create a list of man pages for only backends that are compiled in so # that is all that gets installed. Also, build a complete list of all # backend man pages. This allows a user to optionally generate all # man pages in HTML form for things like posting to a web site. # # Backend man pages bypass standard automake man5_MANS because there is not # a man page for every supported backend. We could get rid of # custom install/uninstall if we required man pages for every backend. BACKEND_MANS_ENABLED = @BACKEND_MANS_ENABLED@ BACKEND_5MANS = sane-geniusvp2.5 man7_MANS = man8_MANS = MANPAGES = $(man1_MANS) $(BACKEND_5MANS) $(man7_MANS) $(man8_MANS) HTML_PAGES = doc_DATA = if USE_LATEX STANDARD = sane.ps else STANDARD = endif all: bemans LATEX = TEXINPUTS="$(srcdir):$$TEXINPUTS" @LATEX@ DVIPS = @DVIPS@ MAKEINDEX = @MAKEINDEX@ DLH = TEXINPUTS="$(srcdir):$$TEXINPUTS" dlh MAN2HTML= nroff -man |\ man2html -compress -topm 6 -botm 6 -nodepage -title $${page} \ -cgiurl '$$title.$$section.html'|\ sed 's,,

,' %.1 %.5 %.7 %.8: %.man @echo "Generating manpage $@..."; @sed -e 's|@DATADIR@|$(datadir)|g' \ -e 's|@CONFIGDIR@|$(configdir)|g' \ -e 's|@DOCDIR@|$(docdir)|g' \ -e 's|@LIBDIR@|$(libdir)/sane|g' \ -e 's|@BINDIR@|$(bindir)|g' \ -e 's|@SBINDIR@|$(sbindir)|g' \ -e 's|@PACKAGEVERSION@|$(package_version)|g' $^ >$@ bemans: $(BACKEND_5MANS) beman5dir = $(mandir)/man5 install-beman5: $(BACKEND_5MANS) test -z "$(beman5dir)" || $(MKDIR_P) "$(DESTDIR)$(beman5dir)" @list="$(BACKEND_MANS_ENABLED)"; for man in $$list; do \ if test ! -r $${man}; then continue; fi; \ echo "installing $${man} in $(beman5dir)/$${man}..."; \ $(INSTALL_DATA) $${man} $(DESTDIR)$(beman5dir)/$${man} \ || exit 1; \ done BEDOCS = canon/canon.changes canon/canon.install2700F.txt BEDOCS += gt68xx/gt68xx.CHANGES gt68xx/gt68xx.TODO BEDOCS += leo/leo.txt BEDOCS += matsushita/matsushita.txt BEDOCS += mustek/mustek.CHANGES BEDOCS += mustek_usb/mustek_usb.CHANGES mustek_usb/mustek_usb.TODO BEDOCS += mustek_usb2/mustek_usb2.CHANGES mustek_usb2/mustek_usb2.TODO BEDOCS += niash/niash.TODO BEDOCS += plustek/FAQ plustek/MakeModule.sh plustek/Makefile.kernel24 \ plustek/Makefile.kernel26 plustek/Plustek-PARPORT-TODO.txt \ plustek/Plustek-PARPORT.changes plustek/Plustek-PARPORT.txt \ plustek/Plustek-USB-TODO.txt plustek/Plustek-USB.changes \ plustek/Plustek-USB.txt BEDOCS += sceptre/s1200.txt BEDOCS += teco/teco1.txt teco/teco2.txt teco/teco3.txt BEDOCS += u12/U12.changes u12/U12.todo BEDOCS += umax/negative-types.txt umax/sane-logo.jpg \ umax/sane-umax-advanced-options-doc.html \ umax/sane-umax-advanced.jpg umax/sane-umax-astra-doc.html \ umax/sane-umax-config-doc.html umax/sane-umax-doc.html \ umax/sane-umax-histogram.jpg umax/sane-umax-mirage-doc.html \ umax/sane-umax-not-listed-doc.html umax/sane-umax-others-doc.html \ umax/sane-umax-parport-doc.html umax/sane-umax-powerlook-doc.html \ umax/sane-umax-scanner-clones-doc.html umax/sane-umax-speed-doc.html \ umax/sane-umax-standard-options-doc.html \ umax/sane-umax-standard.jpg umax/sane-umax-text.jpg \ umax/sane-umax-text2.jpg umax/sane-umax-text4.jpg \ umax/sane-umax-uc-doc.html umax/sane-umax-vista-doc.html \ umax/sane-umax.jpg umax/umax.BUGS umax/umax.CHANGES umax/umax.FAQ \ umax/umax.TODO EXTRA_DIST += sane.tex net.tex html.sty DESC_FILES = descriptions/abaton.desc descriptions/agfafocus.desc \ descriptions/apple.desc descriptions/artec.desc \ descriptions/artec_eplus48u.desc descriptions/as6e.desc \ descriptions/avision.desc descriptions/bh.desc descriptions/canon630u.desc \ descriptions/canon.desc descriptions/canon_dr.desc \ descriptions/canon_pp.desc descriptions/cardscan.desc \ descriptions/coolscan2.desc descriptions/coolscan.desc \ descriptions/coolscan3.desc \ descriptions/dc210.desc descriptions/dc240.desc descriptions/dc25.desc \ descriptions/dell1600n_net.desc descriptions/dll.desc descriptions/dmc.desc \ descriptions/epjitsu.desc descriptions/epson2.desc descriptions/epson.desc \ descriptions/fujitsu.desc descriptions/genesys.desc \ descriptions/gphoto2.desc descriptions/gt68xx.desc descriptions/hp3500.desc \ descriptions/hp3900.desc descriptions/hp4200.desc descriptions/hp5400.desc \ descriptions/hp5590.desc descriptions/hp.desc descriptions/hpljm1005.desc \ descriptions/hpsj5s.desc descriptions/hs2p.desc descriptions/ibm.desc \ descriptions/kodak.desc descriptions/kvs1025.desc descriptions/kvs20xx.desc \ descriptions/leo.desc descriptions/lexmark.desc descriptions/ma1509.desc \ descriptions/magicolor.desc \ descriptions/matsushita.desc descriptions/microtek2.desc \ descriptions/microtek.desc descriptions/mustek.desc \ descriptions/mustek_pp.desc descriptions/mustek_usb2.desc \ descriptions/mustek_usb.desc descriptions/nec.desc descriptions/net.desc \ descriptions/niash.desc descriptions/pie.desc descriptions/pint.desc \ descriptions/p5.desc descriptions/pixma.desc descriptions/plustek.desc \ descriptions/plustek_pp.desc descriptions/pnm.desc descriptions/qcam.desc \ descriptions/ricoh.desc descriptions/rts8891.desc descriptions/s9036.desc \ descriptions/sceptre.desc descriptions/sharp.desc descriptions/sm3600.desc \ descriptions/sm3840.desc descriptions/snapscan.desc descriptions/sp15c.desc \ descriptions/st400.desc descriptions/stv680.desc descriptions/tamarack.desc \ descriptions/teco1.desc descriptions/teco2.desc descriptions/teco3.desc \ descriptions/test.desc descriptions/u12.desc \ descriptions/umax1220u.desc descriptions/umax.desc \ descriptions/umax_pp.desc descriptions/unsupported.desc \ descriptions/v4l.desc descriptions/xerox_mfp.desc EXTRA_DIST += $(DESC_FILES) descriptions/template.desc. DESC_EXT_FILES = descriptions-external/brother2.desc \ descriptions-external/brother.desc \ descriptions-external/brother-mfc4600.desc \ descriptions-external/canon_mfp.desc \ descriptions-external/cs3200f.desc \ descriptions-external/epkowa.desc \ descriptions-external/geniusvp2.desc \ descriptions-external/hp3770.desc \ descriptions-external/hp8200.desc \ descriptions-external/hpaio.desc \ descriptions-external/hpoj.desc \ descriptions-external/kodak-twain.desc \ descriptions-external/lhii.desc \ descriptions-external/mustek_a3p1.desc \ descriptions-external/primascan.desc \ descriptions-external/primax.desc \ descriptions-external/samsung.desc \ descriptions-external/scanwit.desc \ descriptions-external/v4l2.desc \ descriptions-external/viceo.desc EXTRA_DIST += $(DESC_EXT_FILES) descriptions-external/template.desc. EXTRA_DIST += figs/area.eps figs/area.fig figs/flow.eps figs/flow.fig \ figs/hierarchy.eps figs/hierarchy.fig figs/image-data.eps \ figs/image-data.fig figs/xfer.eps figs/xfer.fig EXTRA_DIST += icons/contents.gif icons/index.gif icons/next.gif \ icons/next_gr.gif icons/previous.gif icons/previous_gr.gif \ icons/references.gif icons/references_gr.gif icons/up.gif icons/up_gr.gif install-data-local: install-beman5 uninstall-local: rm -rf $(DESTDIR)$(beman5dir)/sane-*.5 sane.ind: $(srcdir)/sane.tex @echo Generating index for sane.tex... @touch sane.ind @$(LATEX) $(srcdir)/sane /dev/null && \ $(MAKEINDEX) sane.idx 2>/dev/null && \ $(LATEX) $(srcdir)/sane /dev/null sane.dvi: sane.ind @echo Generating sane.dvi from sane.tex... @$(LATEX) $(srcdir)/sane /dev/null sane.ps: sane.dvi @echo Generating sane.ps from sane.dvi... @$(DVIPS) sane.dvi -o sane.ps 2>/dev/null sane-html: sane.dvi $(DLH) $(srcdir)/sane.tex html-man: $(MANPAGES) @for page in $(MANPAGES); do \ echo "translating $${page} to $${page}.html..."; \ cat $${page} | $(MAN2HTML) > $${page}.html; \ done ../tools/sane-desc: cd ../tools ; $(MAKE) sane-desc sane-backends.html: $(DESC_FILES) ../tools/sane-desc @../tools/sane-desc -m html-backends-split -s ${srcdir}/descriptions \ -i "The following table summarizes the backends/drivers distributed \ with $(PACKAGE)-$(VERSION), and the hardware or software they \ support." -d 0 > sane-backends.html sane-backends-external.html: $(DESC_EXT_FILES) ../tools/sane-desc @../tools/sane-desc -m html-backends-split \ -s ${srcdir}/descriptions-external \ -i "The following table summarizes the backends/drivers that \ have not yet been included in the SANE distribution, and the \ hardware or software they support." \ -t "SANE: External Backends (Drivers)" -d 0 \ > sane-backends-external.html sane-mfgs.html: $(DESC_FILES) ../tools/sane-desc @../tools/sane-desc -m html-mfgs -s ${srcdir}/descriptions \ -i "The following table summarizes the devices supported \ by $(PACKAGE)-$(VERSION)." \ -d 0 > sane-mfgs.html sane-mfgs-external.html: $(DESC_EXT_FILES) ../tools/sane-desc @../tools/sane-desc -m html-mfgs -s ${srcdir}/descriptions-external \ -i "The following table summarizes the devices that \ are supported by external backends." \ -t "SANE: Devices Supported by External Backends" -d 0 \ > sane-mfgs-external.html descriptions.db: $(DESC_FILES) ../tools/sane-desc @../tools/sane-desc -m ascii -s ${srcdir}/descriptions \ > descriptions.db descriptions-external.db: $(DESC_FILES) ../tools/sane-desc @../tools/sane-desc -m ascii -s ${srcdir}/descriptions-external \ > descriptions-external.db html-pages: $(HTML_PAGES) html: html-pages html-man sane-html clean-local: rm -f *.toc *.aux *.log *.cp *.fn *.tp *.vr *.pg *.ky *.blg *.idx *.cb rm -f *.ilg distclean-local: rm -f $(MANPAGES) rm -f *.lot *.lof *.ind rm -f sane.dvi sane.ps sane-backends.html sane-backends-external.html rm -f sane-mfgs.html sane-mfgs-external.html rm -f sane/*.html sane/*.gif rm -f doxygen-sanei.conf -rm -rf sane sanei-html for manpage in $(MANPAGES) ; do \ rm -f $${manpage}.html ; \ done sane-backends-extras-1.0.22.3ubuntu1/mkinstalldirs0000775000000000000000000000451111475557446017004 0ustar #! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id$ errstatus=0 dirmode="" owner="" group="" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHOWNPROG-chgrp}" usage="\ Usage: mkinstalldirs [-h] [--help] [-m mode] [-o owner] [-g group] dir ..." # process command line arguments while test $# -gt 0 ; do case "${1}" in -h | --help | --h* ) # -h for help echo "${usage}" 1>&2; exit 0 ;; -m ) # -m PERM arg shift test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } dirmode="${1}" shift ;; -o ) # -o OWNER arg shift test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } owner="${1}" shift ;; -g ) # -g OWNER arg shift test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } group="${1}" shift ;; -- ) shift; break ;; # stop option processing -* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option * ) break ;; # first non-opt arg esac done for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp" -a ! -d "$pathcomp/"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp" -a ! -d "$pathcomp/"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "$chmodprog $dirmode $pathcomp" lasterr="" $chmodprog $dirmode "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi if test ! -z "$owner"; then echo "$chownprog $owner $pathcomp" lasterr="" $chownprog $owner "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi if test ! -z "$group"; then echo "$chgrpprog $group $pathcomp" lasterr="" $chgrpprog $group "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp="$pathcomp/" done done exit $errstatus # Local Variables: # mode:shell-script # sh-indentation:3 # End: sane-backends-extras-1.0.22.3ubuntu1/configure0000775000000000000000000215252311527266667016116 0ustar #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.67 for sane-backends 1.0.22. # # Report bugs to . # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software # Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: sane-devel@lists.alioth.debian.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # 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 as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sane-backends' PACKAGE_TARNAME='sane-backends' PACKAGE_VERSION='1.0.22' PACKAGE_STRING='sane-backends 1.0.22' PACKAGE_BUGREPORT='sane-devel@lists.alioth.debian.org' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS DISTCLEAN_FILES USE_LATEX_FALSE USE_LATEX_TRUE ENABLE_TRANSLATIONS_FALSE ENABLE_TRANSLATIONS_TRUE BACKEND_MANS_ENABLED BACKEND_CONFS_ENABLED PRELOADABLE_BACKENDS_ENABLED PRELOADABLE_BACKENDS BACKEND_LIBS_ENABLED SANEI_SANEI_JPEG_LO HAVE_JPEG_FALSE HAVE_JPEG_TRUE COMPILE_SANED_FALSE COMPILE_SANED_TRUE configdir locksanedir OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL RANLIB AR LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP SED LIBTOOL OBJDUMP DLLTOOL AS SCSI_LIBS USB_LIBS LIBUSB_1_0_LIBS LIBUSB_1_0_CFLAGS ALLOCA LIBOBJS SOCKET_LIBS RESMGR_LIBS SNMP_CONFIG_PATH AVAHI_LIBS AVAHI_CFLAGS LIBV4L_LIBS LIBV4L_CFLAGS GPHOTO2_LDFLAGS GPHOTO2_LIBS GPHOTO2_CPPFLAGS HAVE_GPHOTO2 LOCKPATH_GROUP INSTALL_LOCKPATH PTHREAD_LIBS IEEE1284_LIBS TIFF_LIBS JPEG_LIBS SYSLOG_LIBS MATH_LIB DYNAMIC_FLAG DL_LIBS effective_target STRICT_LDFLAGS INCLUDES CROSS_COMPILING_FALSE CROSS_COMPILING_TRUE PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG MAKEINDEX DVIPS LATEX MSGMERGE XGETTEXT MSGFMT SANE_CONFIG_PATH EGREP GREP CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build NUMBER_VERSION V_REV V_MINOR V_MAJOR MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_maintainer_mode with_docdir enable_dependency_tracking enable_warnings enable_pthread enable_locking with_group with_gphoto2 enable_avahi with_snmp enable_libusb_1_0 enable_libusb enable_scsibuffersize enable_scsi_directio enable_ipv6 enable_static enable_shared with_pic enable_fast_install with_gnu_ld enable_libtool_lock with_lockdir enable_local_backends enable_parport_directio enable_translations enable_latex ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR LIBV4L_CFLAGS LIBV4L_LIBS AVAHI_CFLAGS AVAHI_LIBS LIBUSB_1_0_CFLAGS LIBUSB_1_0_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # 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. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= 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 case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -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) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$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 ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$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 ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) 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 | -n) 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 ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=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 ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${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'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_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 ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # 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 the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` 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 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # 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 <<_ACEOF \`configure' configures sane-backends 1.0.22 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/sane-backends] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of sane-backends 1.0.22:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-warnings turn on tons of compiler warnings (GCC only) --enable-pthread use pthread instead of fork (default=yes for MacOS X/MINGW, no for everything else) --enable-locking activate device locking (default=yes, but only used by some backends) --enable-avahi enable Avahi support for saned and the net backend --enable-libusb_1_0 enable libusb-1.0 support if available --disable-libusb disable support for USB in SANE --enable-scsibuffersize=N specify the default size in bytes of the buffer for SCSI commands [[default=131072]] --enable-scsi-directio enable SCSI direct IO (Linux only, dangerous, see README.linux) --disable-ipv6 disable IPv6 support --enable-static[=PKGS] build static libraries [default=no] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-local-backends turn off compilation of all backends but net --enable-parport-directio enable direct hardware access to the parallel port, so frontends will require special permission level --disable-translations don't install translations of backend options --disable-latex disable use of latex, et.al., to generate documentation Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-docdir=DIR documentation [PREFIX/doc/sane-VERSION] --with-group use the specified group for lock dir [default=uucp] --with-gphoto2 include the gphoto2 backend [default=yes] --with-snmp enable SNMP support [default=yes] --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-lockdir=DIR set SANE lockdir [localstatedir/lock/sane] Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path LIBV4L_CFLAGS C compiler flags for LIBV4L, overriding pkg-config LIBV4L_LIBS linker flags for LIBV4L, overriding pkg-config AVAHI_CFLAGS C compiler flags for AVAHI, overriding pkg-config AVAHI_LIBS linker flags for AVAHI, overriding pkg-config LIBUSB_1_0_CFLAGS C compiler flags for LIBUSB_1_0, overriding pkg-config LIBUSB_1_0_LIBS linker flags for LIBUSB_1_0, overriding pkg-config 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 . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF sane-backends configure 1.0.22 generated by GNU Autoconf 2.67 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval "test \"\${$3+set}\"" = set; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ------------------------------------------------- ## ## Report this to sane-devel@lists.alioth.debian.org ## ## ------------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_header_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_type # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : echo >>conftest.val; read $3 &5 $as_echo_n "checking for $2... " >&6; } if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_func cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by sane-backends $as_me 1.0.22, which was generated by GNU Autoconf 2.67. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/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` /usr/bin/hostinfo = `(/usr/bin/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` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # 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. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5 ; } 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. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi as_fn_append ac_header_list " stdlib.h" as_fn_append ac_header_list " unistd.h" as_fn_append ac_header_list " sys/param.h" # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## 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 V_MAJOR=1 V_MINOR=0 V_REV=22 is_release=yes am__api_version='1.11' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$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 as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # 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" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /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 for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir 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. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$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' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;; esac # 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". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "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 $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : $as_echo_n "(cached) " >&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 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AWK+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='sane-backends' VERSION='1.0.22' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # 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"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$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 ac_config_headers="$ac_config_headers include/sane/config.h" PACKAGE=sane-backends VERSION=1.0.22 NUMBER_VERSION=${V_MAJOR}.${V_MINOR}.${V_REV} cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define SANE_DLL_V_MAJOR $V_MAJOR _ACEOF cat >>confdefs.h <<_ACEOF #define SANE_DLL_V_MINOR $V_MINOR _ACEOF cat >>confdefs.h <<_ACEOF #define SANE_DLL_V_BUILD $V_REV _ACEOF # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if test "${ac_cv_build+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if test "${ac_cv_host+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Check whether --with-docdir was given. if test "${with_docdir+set}" = set; then : withval=$with_docdir; docdir="${withval}" else docdir='${prefix}/doc/sane-${VERSION}' 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 -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&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 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS 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 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&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 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5 ; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5 ; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; 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 conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5 ; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5 ; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5 ; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : 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 DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-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 depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : $as_echo_n "(cached) " >&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 # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub 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 am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # 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. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # 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. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; 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 ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test "x$CC" != xcc; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 $as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 $as_echo_n "checking whether cc understands -c and -o together... " >&6; } fi set dummy $CC; ac_cc=`$as_echo "$2" | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -f conftest2.$ac_objext && { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. if { ac_try='cc -c conftest.$ac_ext >&5' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -f conftest2.$ac_objext && { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # cc works too. : else # cc exists but doesn't like -o. eval ac_cv_prog_cc_${ac_cc}_c_o=no fi fi fi else eval ac_cv_prog_cc_${ac_cc}_c_o=no fi rm -f core conftest* fi if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h fi # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # 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 : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5 ; } 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" if test $ac_cv_c_compiler_gnu = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 $as_echo_n "checking whether $CC needs -traditional... " >&6; } if test "${ac_cv_prog_gcc_traditional+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_pattern="Autoconf.*'x'" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then : ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then : ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 $as_echo "$ac_cv_prog_gcc_traditional" >&6; } if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi # Extract the first word of "sane-config", so it can be a program name with args. set dummy sane-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_SANE_CONFIG_PATH+set}" = set; then : $as_echo_n "(cached) " >&6 else case $SANE_CONFIG_PATH in [\\/]* | ?:[\\/]*) ac_cv_path_SANE_CONFIG_PATH="$SANE_CONFIG_PATH" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SANE_CONFIG_PATH="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_SANE_CONFIG_PATH" && ac_cv_path_SANE_CONFIG_PATH="no" ;; esac fi SANE_CONFIG_PATH=$ac_cv_path_SANE_CONFIG_PATH if test -n "$SANE_CONFIG_PATH"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SANE_CONFIG_PATH" >&5 $as_echo "$SANE_CONFIG_PATH" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "msgfmt$EXEEXT", so it can be a program name with args. set dummy msgfmt$EXEEXT; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_MSGFMT+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MSGFMT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no" ;; esac fi MSGFMT=$ac_cv_path_MSGFMT if test -n "$MSGFMT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 $as_echo "$MSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "xgettext$EXEEXT", so it can be a program name with args. set dummy xgettext$EXEEXT; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_XGETTEXT+set}" = set; then : $as_echo_n "(cached) " >&6 else case $XGETTEXT in [\\/]* | ?:[\\/]*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_XGETTEXT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT="no" ;; esac fi XGETTEXT=$ac_cv_path_XGETTEXT if test -n "$XGETTEXT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 $as_echo "$XGETTEXT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "msgmerge$EXEEXT", so it can be a program name with args. set dummy msgmerge$EXEEXT; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_MSGMERGE+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MSGMERGE in [\\/]* | ?:[\\/]*) ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MSGMERGE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE="no" ;; esac fi MSGMERGE=$ac_cv_path_MSGMERGE if test -n "$MSGMERGE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 $as_echo "$MSGMERGE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "latex$EXEEXT", so it can be a program name with args. set dummy latex$EXEEXT; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_LATEX+set}" = set; then : $as_echo_n "(cached) " >&6 else case $LATEX in [\\/]* | ?:[\\/]*) ac_cv_path_LATEX="$LATEX" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_LATEX="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_LATEX" && ac_cv_path_LATEX="no" ;; esac fi LATEX=$ac_cv_path_LATEX if test -n "$LATEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LATEX" >&5 $as_echo "$LATEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "dvips$EXEEXT", so it can be a program name with args. set dummy dvips$EXEEXT; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_DVIPS+set}" = set; then : $as_echo_n "(cached) " >&6 else case $DVIPS in [\\/]* | ?:[\\/]*) ac_cv_path_DVIPS="$DVIPS" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_DVIPS="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_DVIPS" && ac_cv_path_DVIPS="no" ;; esac fi DVIPS=$ac_cv_path_DVIPS if test -n "$DVIPS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DVIPS" >&5 $as_echo "$DVIPS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "makeindex$EXEEXT", so it can be a program name with args. set dummy makeindex$EXEEXT; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_MAKEINDEX+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MAKEINDEX in [\\/]* | ?:[\\/]*) ac_cv_path_MAKEINDEX="$MAKEINDEX" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MAKEINDEX="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_MAKEINDEX" && ac_cv_path_MAKEINDEX="no" ;; esac fi MAKEINDEX=$ac_cv_path_MAKEINDEX if test -n "$MAKEINDEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKEINDEX" >&5 $as_echo "$MAKEINDEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi if test x$cross_compiling = xyes; then CROSS_COMPILING_TRUE= CROSS_COMPILING_FALSE='#' else CROSS_COMPILING_TRUE='#' CROSS_COMPILING_FALSE= fi INCLUDES="${INCLUDES} -I/usr/local/include" if test "${ac_cv_c_compiler_gnu}" = "yes"; then NORMAL_CFLAGS="\ -W \ -Wall" WARN_CFLAGS="\ -W \ -Wall \ -Wcast-align \ -Wcast-qual \ -Wmissing-declarations \ -Wmissing-prototypes \ -Wpointer-arith \ -Wreturn-type \ -Wstrict-prototypes \ -pedantic" # Some platforms are overly strict with -ansi enabled. Exclude those. ANSI_FLAG=-ansi case "${host_os}" in solaris* | hpux* | os2* | darwin* | cygwin* | mingw*) ANSI_FLAG= ;; esac WARN_CFLAGS="${WARN_CFLAGS} ${ANSI_FLAG}" # Check whether --enable-warnings was given. if test "${enable_warnings+set}" = set; then : enableval=$enable_warnings; if eval "test x$enable_warnings = xyes"; then for flag in $WARN_CFLAGS; do case "$CFLAGS" in "$flag" | "$flag "* | *" $flag" | *" $flag "* ) : ;; *) CFLAGS="$CFLAGS $flag" ;; esac done else for flag in $NORMAL_CFLAGS; do case "$CFLAGS" in "$flag" | "$flag "* | *" $flag" | *" $flag "* ) : ;; *) CFLAGS="$CFLAGS $flag" ;; esac done fi else if test x$is_release = xno; then # Warnings enabled by default (development) for flag in $WARN_CFLAGS; do case "$CFLAGS" in "$flag" | "$flag "* | *" $flag" | *" $flag "* ) : ;; *) CFLAGS="$CFLAGS $flag" ;; esac done else # Warnings disabled by default (release) for flag in $NORMAL_CFLAGS; do case "$CFLAGS" in "$flag" | "$flag "* | *" $flag" | *" $flag "* ) : ;; *) CFLAGS="$CFLAGS $flag" ;; esac done fi fi fi # ac_cv_c_compiler_gnu # Define stricter linking policy on GNU systems. This is not # added to global LDFLAGS because we may want to create convenience # libraries that don't require such strick linking. if test "$GCC" = yes; then case ${host_os} in linux* | solaris*) STRICT_LDFLAGS="-Wl,-z,defs" ;; esac fi case "${host_os}" in aix*) #enable .so libraries, disable archives LDFLAGS="$LDFLAGS -Wl,-brtl" ;; darwin*) #include frameworks LIBS="$LIBS -framework CoreFoundation -framework IOKit" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" if test "x$ac_cv_header_minix_config_h" = x""yes; then : MINIX=yes else MINIX= fi if test "$MINIX" = yes; then $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h $as_echo "#define _MINIX 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } if test "${ac_cv_safe_to_define___extensions__+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_safe_to_define___extensions__=yes else ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } test $ac_cv_safe_to_define___extensions__ = yes && $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h $as_echo "#define _ALL_SOURCE 1" >>confdefs.h $as_echo "#define _GNU_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5 $as_echo_n "checking for library containing strerror... " >&6; } if test "${ac_cv_search_strerror+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char strerror (); int main () { return strerror (); ; return 0; } _ACEOF for ac_lib in '' cposix; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_strerror=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if test "${ac_cv_search_strerror+set}" = set; then : break fi done if test "${ac_cv_search_strerror+set}" = set; then : else ac_cv_search_strerror=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5 $as_echo "$ac_cv_search_strerror" >&6; } ac_res=$ac_cv_search_strerror if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi ac_byteorder_h=`echo include/byteorder.h` ac_dir=`echo $ac_byteorder_h|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_byteorder" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" fi # We're only interested in the target CPU, but it's not always set effective_target="$target" if test "x$effective_target" = xNONE -o "x$effective_target" = x ; then effective_target="$host" fi ac_byteorder=_byteorder.tmp cat > "$ac_byteorder" << EOF /* This file is generated automatically by configure */ /* It is valid only for the system type ${effective_target} */ #ifndef __BYTEORDER_H #define __BYTEORDER_H EOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if test "${ac_cv_c_bigendian+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. ac_arch= ac_prev= for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do if test -n "$ac_prev"; then case $ac_word in i?86 | x86_64 | ppc | ppc64) if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ac_arch=$ac_word else ac_cv_c_bigendian=universal break fi ;; esac ac_prev= elif test "x$ac_word" = "x-arch"; then ac_prev=arch fi done fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_bigendian=no else ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) as_fn_error $? "unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for le32toh in machine/endian.h" >&5 $as_echo_n "checking for le32toh in machine/endian.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef le32toh symbol is present #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "symbol is present|\" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } HAVE_LE32TOH=1 cat >> "$ac_byteorder" << EOF /* extended byte swapping macros are already available */ #include EOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ntohl in arpa/inet.h" >&5 $as_echo_n "checking for ntohl in arpa/inet.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef ntohl symbol is present #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "symbol is present|\" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >> "$ac_byteorder" << EOF /* ntohl and relatives live here */ #include EOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ntohl in netinet/in.h" >&5 $as_echo_n "checking for ntohl in netinet/in.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef ntohl symbol is present #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "symbol is present|\" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >> "$ac_byteorder" << EOF /* ntohl and relatives live here */ #include EOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } true fi rm -f conftest* fi rm -f conftest* fi rm -f conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: checking for swap32 in machine/endian.h" >&5 $as_echo_n "checking for swap32 in machine/endian.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef swap32 symbol is present #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "symbol is present|\" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >> "$ac_byteorder" << EOF /* swap32 and swap16 are defined in machine/endian.h */ EOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bswap_32 in byteswap.h" >&5 $as_echo_n "checking for bswap_32 in byteswap.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef bswap_32 symbol is present #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "symbol is present|\" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >> "$ac_byteorder" << EOF /* Define generic byte swapping functions */ #include #define swap16(x) bswap_16(x) #define swap32(x) bswap_32(x) #define swap64(x) bswap_64(x) EOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bswap32 in machine/endian.h" >&5 $as_echo_n "checking for bswap32 in machine/endian.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef bswap32 symbol is present #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "symbol is present|\" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >> "$ac_byteorder" << EOF /* Define generic byte swapping functions */ EOF if test "$HAVE_LE32TOH" != "1"; then echo '#include '>> "$ac_byteorder" fi cat >> "$ac_byteorder" << EOF #define swap16(x) bswap16(x) #define swap32(x) bswap32(x) #define swap64(x) bswap64(x) EOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __byte_swap_long in sys/types.h" >&5 $as_echo_n "checking for __byte_swap_long in sys/types.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef __byte_swap_long symbol is present #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "symbol is present|\<__byte_swap_long\>" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >> "$ac_byteorder" << EOF /* Define generic byte swapping functions */ #include #define swap16(x) __byte_swap_word(x) #define swap32(x) __byte_swap_long(x) /* No optimized 64 bit byte swapping macro is available */ #define swap64(x) ((uint64_t)(((uint64_t)(x) << 56) & 0xff00000000000000ULL | \\ ((uint64_t)(x) << 40) & 0x00ff000000000000ULL | \\ ((uint64_t)(x) << 24) & 0x0000ff0000000000ULL | \\ ((uint64_t)(x) << 8) & 0x000000ff00000000ULL | \\ ((x) >> 8) & 0x00000000ff000000ULL | \\ ((x) >> 24) & 0x0000000000ff0000ULL | \\ ((x) >> 40) & 0x000000000000ff00ULL | \\ ((x) >> 56) & 0x00000000000000ffULL)) EOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NXSwapLong in machine/byte_order.h" >&5 $as_echo_n "checking for NXSwapLong in machine/byte_order.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef NXSwapLong symbol is present #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "symbol is present|\" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >> "$ac_byteorder" << EOF /* Define generic byte swapping functions */ #include #define swap16(x) NXSwapShort(x) #define swap32(x) NXSwapLong(x) #define swap64(x) NXSwapLongLong(x) EOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if test $ac_cv_c_bigendian = yes; then cat >> "$ac_byteorder" << EOF /* No other byte swapping functions are available on this big-endian system */ #define swap16(x) ((uint16_t)(((x) << 8) | ((uint16_t)(x) >> 8))) #define swap32(x) ((uint32_t)(((uint32_t)(x) << 24) & 0xff000000UL | \\ ((uint32_t)(x) << 8) & 0x00ff0000UL | \\ ((x) >> 8) & 0x0000ff00UL | \\ ((x) >> 24) & 0x000000ffUL)) #define swap64(x) ((uint64_t)(((uint64_t)(x) << 56) & 0xff00000000000000ULL | \\ ((uint64_t)(x) << 40) & 0x00ff000000000000ULL | \\ ((uint64_t)(x) << 24) & 0x0000ff0000000000ULL | \\ ((uint64_t)(x) << 8) & 0x000000ff00000000ULL | \\ ((x) >> 8) & 0x00000000ff000000ULL | \\ ((x) >> 24) & 0x0000000000ff0000ULL | \\ ((x) >> 40) & 0x000000000000ff00ULL | \\ ((x) >> 56) & 0x00000000000000ffULL)) EOF else cat >> "$ac_byteorder" << EOF /* Use these as generic byteswapping macros on this little endian system */ #define swap16(x) ntohs(x) #define swap32(x) ntohl(x) /* No optimized 64 bit byte swapping macro is available */ #define swap64(x) ((uint64_t)(((uint64_t)(x) << 56) & 0xff00000000000000ULL | \\ ((uint64_t)(x) << 40) & 0x00ff000000000000ULL | \\ ((uint64_t)(x) << 24) & 0x0000ff0000000000ULL | \\ ((uint64_t)(x) << 8) & 0x000000ff00000000ULL | \\ ((x) >> 8) & 0x00000000ff000000ULL | \\ ((x) >> 24) & 0x0000000000ff0000ULL | \\ ((x) >> 40) & 0x000000000000ff00ULL | \\ ((x) >> 56) & 0x00000000000000ffULL)) EOF fi fi rm -f conftest* fi rm -f conftest* fi rm -f conftest* fi rm -f conftest* fi rm -f conftest* if test "$HAVE_LE32TOH" != "1"; then cat >> "$ac_byteorder" << EOF /* The byte swapping macros have the form: */ /* EENN[a]toh or htoEENN[a] where EE is be (big endian) or */ /* le (little-endian), NN is 16 or 32 (number of bits) and a, */ /* if present, indicates that the endian side is a pointer to an */ /* array of uint8_t bytes instead of an integer of the specified length. */ /* h refers to the host's ordering method. */ /* So, to convert a 32-bit integer stored in a buffer in little-endian */ /* format into a uint32_t usable on this machine, you could use: */ /* uint32_t value = le32atoh(&buf[3]); */ /* To put that value back into the buffer, you could use: */ /* htole32a(&buf[3], value); */ /* Define aliases for the standard byte swapping macros */ /* Arguments to these macros must be properly aligned on natural word */ /* boundaries in order to work properly on all architectures */ #ifndef htobe16 #define htobe16(x) htons(x) #endif #ifndef htobe32 #define htobe32(x) htonl(x) #endif #ifndef be16toh #define be16toh(x) ntohs(x) #endif #ifndef be32toh #define be32toh(x) ntohl(x) #endif #define HTOBE16(x) (x) = htobe16(x) #define HTOBE32(x) (x) = htobe32(x) #define BE32TOH(x) (x) = be32toh(x) #define BE16TOH(x) (x) = be16toh(x) EOF if test $ac_cv_c_bigendian = yes; then cat >> "$ac_byteorder" << EOF /* Define our own extended byte swapping macros for big-endian machines */ #ifndef htole16 #define htole16(x) swap16(x) #endif #ifndef htole32 #define htole32(x) swap32(x) #endif #ifndef le16toh #define le16toh(x) swap16(x) #endif #ifndef le32toh #define le32toh(x) swap32(x) #endif #ifndef htobe64 #define htobe64(x) (x) #endif #ifndef be64toh #define be64toh(x) (x) #endif #define HTOLE16(x) (x) = htole16(x) #define HTOLE32(x) (x) = htole32(x) #define LE16TOH(x) (x) = le16toh(x) #define LE32TOH(x) (x) = le32toh(x) #define HTOBE64(x) (void) (x) #define BE64TOH(x) (void) (x) EOF else cat >> "$ac_byteorder" << EOF /* On little endian machines, these macros are null */ #ifndef htole16 #define htole16(x) (x) #endif #ifndef htole32 #define htole32(x) (x) #endif #ifndef htole64 #define htole64(x) (x) #endif #ifndef le16toh #define le16toh(x) (x) #endif #ifndef le32toh #define le32toh(x) (x) #endif #ifndef le64toh #define le64toh(x) (x) #endif #define HTOLE16(x) (void) (x) #define HTOLE32(x) (void) (x) #define HTOLE64(x) (void) (x) #define LE16TOH(x) (void) (x) #define LE32TOH(x) (void) (x) #define LE64TOH(x) (void) (x) /* These don't have standard aliases */ #ifndef htobe64 #define htobe64(x) swap64(x) #endif #ifndef be64toh #define be64toh(x) swap64(x) #endif #define HTOBE64(x) (x) = htobe64(x) #define BE64TOH(x) (x) = be64toh(x) EOF fi fi cat >> "$ac_byteorder" << EOF /* Define the C99 standard length-specific integer types */ #include <_stdint.h> EOF case "${effective_target}" in i[3456]86-*) cat >> "$ac_byteorder" << EOF /* Here are some macros to create integers from a byte array */ /* These are used to get and put integers from/into a uint8_t array */ /* with a specific endianness. This is the most portable way to generate */ /* and read messages to a network or serial device. Each member of a */ /* packet structure must be handled separately. */ /* The i386 and compatibles can handle unaligned memory access, */ /* so use the optimized macros above to do this job */ #define be16atoh(x) be16toh(*(uint16_t*)(x)) #define be32atoh(x) be32toh(*(uint32_t*)(x)) #define be64atoh(x) be64toh(*(uint64_t*)(x)) #define le16atoh(x) le16toh(*(uint16_t*)(x)) #define le32atoh(x) le32toh(*(uint32_t*)(x)) #define le64atoh(x) le64toh(*(uint64_t*)(x)) #define htobe16a(a,x) *(uint16_t*)(a) = htobe16(x) #define htobe32a(a,x) *(uint32_t*)(a) = htobe32(x) #define htobe64a(a,x) *(uint64_t*)(a) = htobe64(x) #define htole16a(a,x) *(uint16_t*)(a) = htole16(x) #define htole32a(a,x) *(uint32_t*)(a) = htole32(x) #define htole64a(a,x) *(uint64_t*)(a) = htole64(x) EOF ;; *) cat >> "$ac_byteorder" << EOF /* Here are some macros to create integers from a byte array */ /* These are used to get and put integers from/into a uint8_t array */ /* with a specific endianness. This is the most portable way to generate */ /* and read messages to a network or serial device. Each member of a */ /* packet structure must be handled separately. */ /* Non-optimized but portable macros */ #define be16atoh(x) ((uint16_t)(((x)[0]<<8)|(x)[1])) #define be32atoh(x) ((uint32_t)(((x)[0]<<24)|((x)[1]<<16)|((x)[2]<<8)|(x)[3])) #define be64atoh(x) ((uint64_t)(((x)[0]<<56)|((x)[1]<<48)|((x)[2]<<40)| \\ ((x)[3]<<32)|((x)[4]<<24)|((x)[5]<<16)|((x)[6]<<8)|(x)[7])) #define le16atoh(x) ((uint16_t)(((x)[1]<<8)|(x)[0])) #define le32atoh(x) ((uint32_t)(((x)[3]<<24)|((x)[2]<<16)|((x)[1]<<8)|(x)[0])) #define le64atoh(x) ((uint64_t)(((x)[7]<<56)|((x)[6]<<48)|((x)[5]<<40)| \\ ((x)[4]<<32)|((x)[3]<<24)|((x)[2]<<16)|((x)[1]<<8)|(x)[0])) #define htobe16a(a,x) (a)[0]=(uint8_t)((x)>>8), (a)[1]=(uint8_t)(x) #define htobe32a(a,x) (a)[0]=(uint8_t)((x)>>24), (a)[1]=(uint8_t)((x)>>16), \\ (a)[2]=(uint8_t)((x)>>8), (a)[3]=(uint8_t)(x) #define htobe64a(a,x) (a)[0]=(uint8_t)((x)>>56), (a)[1]=(uint8_t)((x)>>48), \\ (a)[2]=(uint8_t)((x)>>40), (a)[3]=(uint8_t)((x)>>32), \\ (a)[4]=(uint8_t)((x)>>24), (a)[5]=(uint8_t)((x)>>16), \\ (a)[6]=(uint8_t)((x)>>8), (a)[7]=(uint8_t)(x) #define htole16a(a,x) (a)[1]=(uint8_t)((x)>>8), (a)[0]=(uint8_t)(x) #define htole32a(a,x) (a)[3]=(uint8_t)((x)>>24), (a)[2]=(uint8_t)((x)>>16), \\ (a)[1]=(uint8_t)((x)>>8), (a)[0]=(uint8_t)(x) #define htole64a(a,x) (a)[7]=(uint8_t)((x)>>56), (a)[6]=(uint8_t)((x)>>48), \\ (a)[5]=(uint8_t)((x)>>40), (a)[4]=(uint8_t)((x)>>32), \\ (a)[3]=(uint8_t)((x)>>24), (a)[2]=(uint8_t)((x)>>16), \\ (a)[1]=(uint8_t)((x)>>8), (a)[0]=(uint8_t)(x) EOF ;; esac cat >> "$ac_byteorder" << EOF #endif /*__BYTEORDER_H*/ EOF if cmp -s $ac_byteorder_h $ac_byteorder 2>/dev/null; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_byteorder_h is unchanged" >&5 $as_echo "$as_me: $ac_byteorder_h is unchanged" >&6;} rm $ac_byteorder else rm -f $ac_byteorder_h mv $ac_byteorder $ac_byteorder_h fi # ------ AX CREATE STDINT H ------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint types" >&5 $as_echo_n "checking for stdint types... " >&6; } ac_stdint_h=`echo include/_stdint.h` # try to shortcircuit - if the default include path of the compiler # can find a "stdint.h" header then we assume that all compilers can. if test "${ac_cv_header_stdint_t+set}" = set; then : $as_echo_n "(cached) " >&6 else old_CXXFLAGS="$CXXFLAGS" ; CXXFLAGS="" old_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS="" old_CFLAGS="$CFLAGS" ; CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int_least32_t v = 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_stdint_result="(assuming C99 compatible system)" ac_cv_header_stdint_t="stdint.h"; else ac_cv_header_stdint_t="" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "$GCC" = "yes" && test ".$ac_cv_header_stdint_t" = "."; then CFLAGS="-std=c99" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int_least32_t v = 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: your GCC compiler has a defunct stdint.h for its default-mode" >&5 $as_echo "$as_me: WARNING: your GCC compiler has a defunct stdint.h for its default-mode" >&2;} fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi CXXFLAGS="$old_CXXFLAGS" CPPFLAGS="$old_CPPFLAGS" CFLAGS="$old_CFLAGS" fi v="... $ac_cv_header_stdint_h" if test "$ac_stdint_h" = "stdint.h" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: (are you sure you want them in ./stdint.h?)" >&5 $as_echo "(are you sure you want them in ./stdint.h?)" >&6; } elif test "$ac_stdint_h" = "inttypes.h" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: (are you sure you want them in ./inttypes.h?)" >&5 $as_echo "(are you sure you want them in ./inttypes.h?)" >&6; } elif test "_$ac_cv_header_stdint_t" = "_" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: (putting them into $ac_stdint_h)$v" >&5 $as_echo "(putting them into $ac_stdint_h)$v" >&6; } else ac_cv_header_stdint="$ac_cv_header_stdint_t" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdint (shortcircuit)" >&5 $as_echo "$ac_cv_header_stdint (shortcircuit)" >&6; } fi if test "_$ac_cv_header_stdint_t" = "_" ; then # can not shortcircuit.. inttype_headers=`echo | sed -e 's/,/ /g'` ac_cv_stdint_result="(no helpful system typedefs seen)" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint uintptr_t" >&5 $as_echo_n "checking for stdint uintptr_t... " >&6; } if test "${ac_cv_header_stdint_x+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_header_stdint_x="" # the 1997 typedefs (inttypes.h) { $as_echo "$as_me:${as_lineno-$LINENO}: result: (..)" >&5 $as_echo "(..)" >&6; } for i in stdint.h inttypes.h sys/inttypes.h $inttype_headers do unset ac_cv_type_uintptr_t unset ac_cv_type_uint64_t ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "#include <$i> " if test "x$ac_cv_type_uintptr_t" = x""yes; then : ac_cv_header_stdint_x=$i else continue fi ac_fn_c_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "#include<$i> " if test "x$ac_cv_type_uint64_t" = x""yes; then : and64="/uint64_t" else and64="" fi stdint.h inttypes.h sys/inttypes.h $inttype_headers break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint uintptr_t" >&5 $as_echo_n "checking for stdint uintptr_t... " >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdint_x" >&5 $as_echo "$ac_cv_header_stdint_x" >&6; } if test "_$ac_cv_header_stdint_x" = "_" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint uint32_t" >&5 $as_echo_n "checking for stdint uint32_t... " >&6; } if test "${ac_cv_header_stdint_o+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_header_stdint_o="" # the 1995 typedefs (sys/inttypes.h) { $as_echo "$as_me:${as_lineno-$LINENO}: result: (..)" >&5 $as_echo "(..)" >&6; } for i in inttypes.h sys/inttypes.h stdint.h $inttype_headers do unset ac_cv_type_uint32_t unset ac_cv_type_uint64_t ac_fn_c_check_type "$LINENO" "uint32_t" "ac_cv_type_uint32_t" "#include <$i> " if test "x$ac_cv_type_uint32_t" = x""yes; then : ac_cv_header_stdint_o=$i else continue fi ac_fn_c_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "#include<$i> " if test "x$ac_cv_type_uint64_t" = x""yes; then : and64="/uint64_t" else and64="" fi inttypes.h sys/inttypes.h stdint.h $inttype_headers break break; done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint uint32_t" >&5 $as_echo_n "checking for stdint uint32_t... " >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdint_o" >&5 $as_echo "$ac_cv_header_stdint_o" >&6; } fi if test "_$ac_cv_header_stdint_x" = "_" ; then if test "_$ac_cv_header_stdint_o" = "_" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint u_int32_t" >&5 $as_echo_n "checking for stdint u_int32_t... " >&6; } if test "${ac_cv_header_stdint_u+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_header_stdint_u="" # the BSD typedefs (sys/types.h) { $as_echo "$as_me:${as_lineno-$LINENO}: result: (..)" >&5 $as_echo "(..)" >&6; } for i in sys/types.h inttypes.h sys/inttypes.h $inttype_headers ; do unset ac_cv_type_u_int32_t unset ac_cv_type_u_int64_t ac_fn_c_check_type "$LINENO" "u_int32_t" "ac_cv_type_u_int32_t" "#include <$i> " if test "x$ac_cv_type_u_int32_t" = x""yes; then : ac_cv_header_stdint_u=$i else continue fi ac_fn_c_check_type "$LINENO" "u_int64_t" "ac_cv_type_u_int64_t" "#include<$i> " if test "x$ac_cv_type_u_int64_t" = x""yes; then : and64="/u_int64_t" else and64="" fi sys/types.h inttypes.h sys/inttypes.h $inttype_headers break break; done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint u_int32_t" >&5 $as_echo_n "checking for stdint u_int32_t... " >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdint_u" >&5 $as_echo "$ac_cv_header_stdint_u" >&6; } fi fi if test "_$ac_cv_header_stdint_x" = "_" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint datatype model" >&5 $as_echo_n "checking for stdint datatype model... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: (..)" >&5 $as_echo "(..)" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char" >&5 $as_echo_n "checking size of char... " >&6; } if test "${ac_cv_sizeof_char+set}" = set; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char))" "ac_cv_sizeof_char" "$ac_includes_default"; then : else if test "$ac_cv_type_char" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (char) See \`config.log' for more details" "$LINENO" 5 ; } else ac_cv_sizeof_char=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char" >&5 $as_echo "$ac_cv_sizeof_char" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_CHAR $ac_cv_sizeof_char _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 $as_echo_n "checking size of short... " >&6; } if test "${ac_cv_sizeof_short+set}" = set; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : else if test "$ac_cv_type_short" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (short) See \`config.log' for more details" "$LINENO" 5 ; } else ac_cv_sizeof_short=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 $as_echo "$ac_cv_sizeof_short" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SHORT $ac_cv_sizeof_short _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 $as_echo_n "checking size of int... " >&6; } if test "${ac_cv_sizeof_int+set}" = set; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : else if test "$ac_cv_type_int" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int) See \`config.log' for more details" "$LINENO" 5 ; } else ac_cv_sizeof_int=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 $as_echo "$ac_cv_sizeof_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 $as_echo_n "checking size of long... " >&6; } if test "${ac_cv_sizeof_long+set}" = set; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : else if test "$ac_cv_type_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) See \`config.log' for more details" "$LINENO" 5 ; } else ac_cv_sizeof_long=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 $as_echo "$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void*" >&5 $as_echo_n "checking size of void*... " >&6; } if test "${ac_cv_sizeof_voidp+set}" = set; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void*))" "ac_cv_sizeof_voidp" "$ac_includes_default"; then : else if test "$ac_cv_type_voidp" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (void*) See \`config.log' for more details" "$LINENO" 5 ; } else ac_cv_sizeof_voidp=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_voidp" >&5 $as_echo "$ac_cv_sizeof_voidp" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_VOIDP $ac_cv_sizeof_voidp _ACEOF ac_cv_char_data_model="" ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_char" ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_short" ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_int" ac_cv_long_data_model="" ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_int" ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_long" ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_voidp" { $as_echo "$as_me:${as_lineno-$LINENO}: checking data model" >&5 $as_echo_n "checking data model... " >&6; } case "$ac_cv_char_data_model/$ac_cv_long_data_model" in 122/242) ac_cv_data_model="IP16" ; n="standard 16bit machine" ;; 122/244) ac_cv_data_model="LP32" ; n="standard 32bit machine" ;; 122/*) ac_cv_data_model="i16" ; n="unusual int16 model" ;; 124/444) ac_cv_data_model="ILP32" ; n="standard 32bit unixish" ;; 124/488) ac_cv_data_model="LP64" ; n="standard 64bit unixish" ;; 124/448) ac_cv_data_model="LLP64" ; n="unusual 64bit unixish" ;; 124/*) ac_cv_data_model="i32" ; n="unusual int32 model" ;; 128/888) ac_cv_data_model="ILP64" ; n="unusual 64bit numeric" ;; 128/*) ac_cv_data_model="i64" ; n="unusual int64 model" ;; 222/*2) ac_cv_data_model="DSP16" ; n="strict 16bit dsptype" ;; 333/*3) ac_cv_data_model="DSP24" ; n="strict 24bit dsptype" ;; 444/*4) ac_cv_data_model="DSP32" ; n="strict 32bit dsptype" ;; 666/*6) ac_cv_data_model="DSP48" ; n="strict 48bit dsptype" ;; 888/*8) ac_cv_data_model="DSP64" ; n="strict 64bit dsptype" ;; 222/*|333/*|444/*|666/*|888/*) : ac_cv_data_model="iDSP" ; n="unusual dsptype" ;; *) ac_cv_data_model="none" ; n="very unusual model" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_data_model ($ac_cv_long_data_model, $n)" >&5 $as_echo "$ac_cv_data_model ($ac_cv_long_data_model, $n)" >&6; } fi if test "_$ac_cv_header_stdint_x" != "_" ; then ac_cv_header_stdint="$ac_cv_header_stdint_x" elif test "_$ac_cv_header_stdint_o" != "_" ; then ac_cv_header_stdint="$ac_cv_header_stdint_o" elif test "_$ac_cv_header_stdint_u" != "_" ; then ac_cv_header_stdint="$ac_cv_header_stdint_u" else ac_cv_header_stdint="stddef.h" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for extra inttypes in chosen header" >&5 $as_echo_n "checking for extra inttypes in chosen header... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: ($ac_cv_header_stdint)" >&5 $as_echo "($ac_cv_header_stdint)" >&6; } unset ac_cv_type_int_least32_t unset ac_cv_type_int_fast32_t ac_fn_c_check_type "$LINENO" "int_least32_t" "ac_cv_type_int_least32_t" "#include <$ac_cv_header_stdint> " if test "x$ac_cv_type_int_least32_t" = x""yes; then : fi ac_fn_c_check_type "$LINENO" "int_fast32_t" "ac_cv_type_int_fast32_t" "#include<$ac_cv_header_stdint> " if test "x$ac_cv_type_int_fast32_t" = x""yes; then : fi ac_fn_c_check_type "$LINENO" "intmax_t" "ac_cv_type_intmax_t" "#include <$ac_cv_header_stdint> " if test "x$ac_cv_type_intmax_t" = x""yes; then : fi fi # shortcircut to system "stdint.h" # ------------------ PREPARE VARIABLES ------------------------------ if test "$GCC" = "yes" ; then ac_cv_stdint_message="using gnu compiler "`$CC --version | head -1` else ac_cv_stdint_message="using $CC" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: make use of $ac_cv_header_stdint in $ac_stdint_h $ac_cv_stdint_result" >&5 $as_echo "make use of $ac_cv_header_stdint in $ac_stdint_h $ac_cv_stdint_result" >&6; } # ----------------- DONE inttypes.h checks START header ------------- ac_config_commands="$ac_config_commands $ac_stdint_h" DL_LIBS="" if test "${enable_dynamic}" != "no"; then # dlopen for ac_header in dlfcn.h do : ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" if test "x$ac_cv_header_dlfcn_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : DL_LIBS=-ldl fi saved_LIBS="${LIBS}" LIBS="${LIBS} ${DL_LIBS}" for ac_func in dlopen do : ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLOPEN 1 _ACEOF enable_dynamic=yes fi done LIBS="${saved_LIBS}" fi done # HP/UX DLL handling for ac_header in dl.h do : ac_fn_c_check_header_mongrel "$LINENO" "dl.h" "ac_cv_header_dl_h" "$ac_includes_default" if test "x$ac_cv_header_dl_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DL_H 1 _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : DL_LIBS=-ldld fi saved_LIBS="${LIBS}" LIBS="${LIBS} ${DL_LIBS}" for ac_func in shl_load do : ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SHL_LOAD 1 _ACEOF enable_dynamic=yes fi done LIBS="${saved_LIBS}" fi done if test -z "$DL_LIBS" ; then # old Mac OS X/Darwin (without dlopen) for ac_header in mach-o/dyld.h do : ac_fn_c_check_header_mongrel "$LINENO" "mach-o/dyld.h" "ac_cv_header_mach_o_dyld_h" "$ac_includes_default" if test "x$ac_cv_header_mach_o_dyld_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MACH_O_DYLD_H 1 _ACEOF for ac_func in NSLinkModule do : ac_fn_c_check_func "$LINENO" "NSLinkModule" "ac_cv_func_NSLinkModule" if test "x$ac_cv_func_NSLinkModule" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NSLINKMODULE 1 _ACEOF enable_dynamic=yes fi done fi done fi fi DYNAMIC_FLAG= if test "${enable_dynamic}" = yes ; then DYNAMIC_FLAG=-module fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5 $as_echo_n "checking for sqrt in -lm... " >&6; } if test "${ac_cv_lib_m_sqrt+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char sqrt (); int main () { return sqrt (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_sqrt=yes else ac_cv_lib_m_sqrt=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sqrt" >&5 $as_echo "$ac_cv_lib_m_sqrt" >&6; } if test "x$ac_cv_lib_m_sqrt" = x""yes; then : MATH_LIB="-lm" fi case ${host_os} in os2*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sylog in -lsyslog" >&5 $as_echo_n "checking for sylog in -lsyslog... " >&6; } if test "${ac_cv_lib_syslog_sylog+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsyslog $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char sylog (); int main () { return sylog (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_syslog_sylog=yes else ac_cv_lib_syslog_sylog=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_syslog_sylog" >&5 $as_echo "$ac_cv_lib_syslog_sylog" >&6; } if test "x$ac_cv_lib_syslog_sylog" = x""yes; then : SYSLOG_LIBS="-lsyslog" fi ;; beos*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for syslog in -lbe" >&5 $as_echo_n "checking for syslog in -lbe... " >&6; } if test "${ac_cv_lib_be_syslog+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbe $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char syslog (); int main () { return syslog (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_be_syslog=yes else ac_cv_lib_be_syslog=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_be_syslog" >&5 $as_echo "$ac_cv_lib_be_syslog" >&6; } if test "x$ac_cv_lib_be_syslog" = x""yes; then : SYSLOG_LIBS="-lbe" fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_start_decompress in -ljpeg" >&5 $as_echo_n "checking for jpeg_start_decompress in -ljpeg... " >&6; } if test "${ac_cv_lib_jpeg_jpeg_start_decompress+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ljpeg $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char jpeg_start_decompress (); int main () { return jpeg_start_decompress (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_jpeg_jpeg_start_decompress=yes else ac_cv_lib_jpeg_jpeg_start_decompress=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_start_decompress" >&5 $as_echo "$ac_cv_lib_jpeg_jpeg_start_decompress" >&6; } if test "x$ac_cv_lib_jpeg_jpeg_start_decompress" = x""yes; then : ac_fn_c_check_header_mongrel "$LINENO" "jconfig.h" "ac_cv_header_jconfig_h" "$ac_includes_default" if test "x$ac_cv_header_jconfig_h" = x""yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeglib - version >= 61 (6a)" >&5 $as_echo_n "checking for jpeglib - version >= 61 (6a)... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #if JPEG_LIB_VERSION >= 61 sane_correct_jpeg_lib_version_found #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "sane_correct_jpeg_lib_version_found" >/dev/null 2>&1; then : sane_cv_use_libjpeg="yes"; JPEG_LIBS="-ljpeg"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f conftest* fi fi if test "$sane_cv_use_libjpeg" = "yes" ; then $as_echo "#define HAVE_LIBJPEG 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIFFFdOpen in -ltiff" >&5 $as_echo_n "checking for TIFFFdOpen in -ltiff... " >&6; } if test "${ac_cv_lib_tiff_TIFFFdOpen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ltiff $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char TIFFFdOpen (); int main () { return TIFFFdOpen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_tiff_TIFFFdOpen=yes else ac_cv_lib_tiff_TIFFFdOpen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFFdOpen" >&5 $as_echo "$ac_cv_lib_tiff_TIFFFdOpen" >&6; } if test "x$ac_cv_lib_tiff_TIFFFdOpen" = x""yes; then : ac_fn_c_check_header_mongrel "$LINENO" "tiffio.h" "ac_cv_header_tiffio_h" "$ac_includes_default" if test "x$ac_cv_header_tiffio_h" = x""yes; then : sane_cv_use_libtiff="yes"; TIFF_LIBS="-ltiff" fi fi ac_fn_c_check_header_mongrel "$LINENO" "ieee1284.h" "ac_cv_header_ieee1284_h" "$ac_includes_default" if test "x$ac_cv_header_ieee1284_h" = x""yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libieee1284 >= 0.1.5" >&5 $as_echo_n "checking for libieee1284 >= 0.1.5... " >&6; } if test "${sane_cv_use_libieee1284+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { struct parport p; char *buf; ieee1284_nibble_read(&p, 0, buf, 1); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : sane_cv_use_libieee1284="yes"; IEEE1284_LIBS="-lieee1284" else sane_cv_use_libieee1284="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $sane_cv_use_libieee1284" >&5 $as_echo "$sane_cv_use_libieee1284" >&6; } fi if test "$sane_cv_use_libieee1284" = "yes" ; then $as_echo "#define HAVE_LIBIEEE1284 1" >>confdefs.h fi case "${host_os}" in darwin* | mingw*) # currently only enabled on MacOS X on MINGW use_pthread=yes ;; *) use_pthread=no esac have_pthread=no # # now that we have the systems preferences, we check # the user # Check whether --enable-pthread was given. if test "${enable_pthread+set}" = set; then : enableval=$enable_pthread; if test $enableval = yes ; then use_pthread=yes else use_pthread=no fi fi if test $use_pthread = yes ; then for ac_header in pthread.h do : ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" if test "x$ac_cv_header_pthread_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PTHREAD_H 1 _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 $as_echo_n "checking for pthread_create in -lpthread... " >&6; } if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_create=yes else ac_cv_lib_pthread_pthread_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then : PTHREAD_LIBS="-lpthread" fi have_pthread=yes save_LIBS="$LIBS" LIBS="$LIBS $PTHREAD_LIBS" for ac_func in pthread_create pthread_kill pthread_join pthread_detach pthread_cancel pthread_testcancel do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else have_pthread=no; use_pthread=no fi done LIBS="$save_LIBS" fi done fi if test $use_pthread = yes ; then cat >>confdefs.h <<_ACEOF #define USE_PTHREAD "$use_pthread" _ACEOF else PTHREAD_LIBS="" fi if test "$have_pthread" = "yes" ; then CPPFLAGS="${CPPFLAGS} -D_REENTRANT" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable pthread support" >&5 $as_echo_n "checking whether to enable pthread support... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_pthread" >&5 $as_echo "$have_pthread" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use pthread instead of fork" >&5 $as_echo_n "checking whether to use pthread instead of fork... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_pthread" >&5 $as_echo "$use_pthread" >&6; } LOCKPATH_GROUP=uucp use_locking=yes case "${host_os}" in os2* ) use_locking=no ;; esac # # we check the user # Check whether --enable-locking was given. if test "${enable_locking+set}" = set; then : enableval=$enable_locking; if test $enableval = yes ; then use_locking=yes else use_locking=no fi fi if test $use_locking = yes ; then # Check whether --with-group was given. if test "${with_group+set}" = set; then : withval=$with_group; LOCKPATH_GROUP="$withval" fi # check if the group does exist lasterror="" touch sanetest.file chgrp $LOCKPATH_GROUP sanetest.file 2>/dev/null || lasterror=$? rm -f sanetest.file if test ! -z "$lasterror"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Group $LOCKPATH_GROUP does not exist on this system." >&5 $as_echo "$as_me: WARNING: Group $LOCKPATH_GROUP does not exist on this system." >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Locking feature will be disabled." >&5 $as_echo "$as_me: WARNING: Locking feature will be disabled." >&2;} use_locking=no fi fi if test $use_locking = yes ; then INSTALL_LOCKPATH=install-lockpath $as_echo "#define ENABLE_LOCKING 1" >>confdefs.h else INSTALL_LOCKPATH= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable device locking" >&5 $as_echo_n "checking whether to enable device locking... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_locking" >&5 $as_echo "$use_locking" >&6; } if test $use_locking = yes ; then { $as_echo "$as_me:${as_lineno-$LINENO}: Setting lockdir group to $LOCKPATH_GROUP" >&5 $as_echo "$as_me: Setting lockdir group to $LOCKPATH_GROUP" >&6;} fi # Check whether --with-gphoto2 was given. if test "${with_gphoto2+set}" = set; then : withval=$with_gphoto2; # If --with-gphoto2=no or --without-gphoto2, disable backend # as "$with_gphoto2" will be set to "no" fi # If --with-gphoto2=yes (or not supplied), first check if # pkg-config exists, then use it to check if libgphoto2 is # present. If all that works, then see if we can actually link # a program. And, if that works, then add the -l flags to # GPHOTO2_LIBS and any other flags to GPHOTO2_LDFLAGS to pass to # sane-config. if test "$with_gphoto2" != "no" ; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_HAVE_GPHOTO2+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$HAVE_GPHOTO2"; then ac_cv_prog_HAVE_GPHOTO2="$HAVE_GPHOTO2" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_HAVE_GPHOTO2="${ac_tool_prefix}pkg-config" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi HAVE_GPHOTO2=$ac_cv_prog_HAVE_GPHOTO2 if test -n "$HAVE_GPHOTO2"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_GPHOTO2" >&5 $as_echo "$HAVE_GPHOTO2" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_HAVE_GPHOTO2"; then ac_ct_HAVE_GPHOTO2=$HAVE_GPHOTO2 # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_HAVE_GPHOTO2+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_HAVE_GPHOTO2"; then ac_cv_prog_ac_ct_HAVE_GPHOTO2="$ac_ct_HAVE_GPHOTO2" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_HAVE_GPHOTO2="pkg-config" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_HAVE_GPHOTO2=$ac_cv_prog_ac_ct_HAVE_GPHOTO2 if test -n "$ac_ct_HAVE_GPHOTO2"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_HAVE_GPHOTO2" >&5 $as_echo "$ac_ct_HAVE_GPHOTO2" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_HAVE_GPHOTO2" = x; then HAVE_GPHOTO2="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac HAVE_GPHOTO2=$ac_ct_HAVE_GPHOTO2 fi else HAVE_GPHOTO2="$ac_cv_prog_HAVE_GPHOTO2" fi if test ${HAVE_GPHOTO2} != "false" ; then if pkg-config --exists libgphoto2 ; then with_gphoto2="`pkg-config --modversion libgphoto2`" GPHOTO2_CPPFLAGS="`pkg-config --cflags libgphoto2`" GPHOTO2_LIBS="`pkg-config --libs libgphoto2`" saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${GPHOTO2_CPPFLAGS}" saved_LIBS="${LIBS}" LIBS="${LIBS} ${GPHOTO2_LIBS}" # Make sure we an really use the library for ac_func in gp_camera_init do : ac_fn_c_check_func "$LINENO" "gp_camera_init" "ac_cv_func_gp_camera_init" if test "x$ac_cv_func_gp_camera_init" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GP_CAMERA_INIT 1 _ACEOF HAVE_GPHOTO2=true else HAVE_GPHOTO2=false fi done if test "${HAVE_GPHOTO2}" = "true"; then for ac_func in gp_port_info_get_path do : ac_fn_c_check_func "$LINENO" "gp_port_info_get_path" "ac_cv_func_gp_port_info_get_path" if test "x$ac_cv_func_gp_port_info_get_path" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GP_PORT_INFO_GET_PATH 1 _ACEOF fi done fi CPPFLAGS="${saved_CPPFLAGS}" LIBS="${saved_LIBS}" else HAVE_GPHOTO2=false fi if test "${HAVE_GPHOTO2}" = "false"; then GPHOTO2_CPPFLAGS="" GPHOTO2_LIBS="" else tmp_LIBS="" for param in ${GPHOTO2_LIBS}; do case "${param}" in -l*) tmp_LIBS="${tmp_LIBS} ${param}" ;; *) GPHOTO2_LDFLAGS="${GPHOTO2_LDFLAGS} ${param}" ;; esac done GPHOTO2_LIBS="${tmp_LIBS}" unset tmp_LIBS unset param fi fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBV4L" >&5 $as_echo_n "checking for LIBV4L... " >&6; } if test -n "$LIBV4L_CFLAGS"; then pkg_cv_LIBV4L_CFLAGS="$LIBV4L_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libv4l1\""; } >&5 ($PKG_CONFIG --exists --print-errors "libv4l1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBV4L_CFLAGS=`$PKG_CONFIG --cflags "libv4l1" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBV4L_LIBS"; then pkg_cv_LIBV4L_LIBS="$LIBV4L_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libv4l1\""; } >&5 ($PKG_CONFIG --exists --print-errors "libv4l1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBV4L_LIBS=`$PKG_CONFIG --libs "libv4l1" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBV4L_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libv4l1" 2>&1` else LIBV4L_PKG_ERRORS=`$PKG_CONFIG --print-errors "libv4l1" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBV4L_PKG_ERRORS" >&5 have_libv4l1=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_libv4l1=no else LIBV4L_CFLAGS=$pkg_cv_LIBV4L_CFLAGS LIBV4L_LIBS=$pkg_cv_LIBV4L_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_libv4l1=yes fi # Check whether --enable-avahi was given. if test "${enable_avahi+set}" = set; then : enableval=$enable_avahi; enable_avahi=$enableval else enable_avahi=no fi if test "$enable_avahi" = "yes"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVAHI" >&5 $as_echo_n "checking for AVAHI... " >&6; } if test -n "$AVAHI_CFLAGS"; then pkg_cv_AVAHI_CFLAGS="$AVAHI_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \" avahi-client >= 0.6.24 \""; } >&5 ($PKG_CONFIG --exists --print-errors " avahi-client >= 0.6.24 ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_AVAHI_CFLAGS=`$PKG_CONFIG --cflags " avahi-client >= 0.6.24 " 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$AVAHI_LIBS"; then pkg_cv_AVAHI_LIBS="$AVAHI_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \" avahi-client >= 0.6.24 \""; } >&5 ($PKG_CONFIG --exists --print-errors " avahi-client >= 0.6.24 ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_AVAHI_LIBS=`$PKG_CONFIG --libs " avahi-client >= 0.6.24 " 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then AVAHI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors " avahi-client >= 0.6.24 " 2>&1` else AVAHI_PKG_ERRORS=`$PKG_CONFIG --print-errors " avahi-client >= 0.6.24 " 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$AVAHI_PKG_ERRORS" >&5 enable_avahi=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } enable_avahi=no else AVAHI_CFLAGS=$pkg_cv_AVAHI_CFLAGS AVAHI_LIBS=$pkg_cv_AVAHI_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define WITH_AVAHI 1" >>confdefs.h fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sane_init in -lsane" >&5 $as_echo_n "checking for sane_init in -lsane... " >&6; } if test "${ac_cv_lib_sane_sane_init+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsane $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char sane_init (); int main () { return sane_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_sane_sane_init=yes else ac_cv_lib_sane_sane_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sane_sane_init" >&5 $as_echo "$ac_cv_lib_sane_sane_init" >&6; } if test "x$ac_cv_lib_sane_sane_init" = x""yes; then : LIBSANE_EXISTS="yes" fi # Check whether --with-snmp was given. if test "${with_snmp+set}" = set; then : withval=$with_snmp; fi if test "$with_snmp" = "no"; then echo "Not including SNMP support" else # Extract the first word of "net-snmp-config", so it can be a program name with args. set dummy net-snmp-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_SNMP_CONFIG_PATH+set}" = set; then : $as_echo_n "(cached) " >&6 else case $SNMP_CONFIG_PATH in [\\/]* | ?:[\\/]*) ac_cv_path_SNMP_CONFIG_PATH="$SNMP_CONFIG_PATH" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SNMP_CONFIG_PATH="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_SNMP_CONFIG_PATH" && ac_cv_path_SNMP_CONFIG_PATH=""no"" ;; esac fi SNMP_CONFIG_PATH=$ac_cv_path_SNMP_CONFIG_PATH if test -n "$SNMP_CONFIG_PATH"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SNMP_CONFIG_PATH" >&5 $as_echo "$SNMP_CONFIG_PATH" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for snmp_timeout in -lnetsnmp" >&5 $as_echo_n "checking for snmp_timeout in -lnetsnmp... " >&6; } if test "${ac_cv_lib_netsnmp_snmp_timeout+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnetsnmp $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char snmp_timeout (); int main () { return snmp_timeout (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_netsnmp_snmp_timeout=yes else ac_cv_lib_netsnmp_snmp_timeout=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_netsnmp_snmp_timeout" >&5 $as_echo "$ac_cv_lib_netsnmp_snmp_timeout" >&6; } if test "x$ac_cv_lib_netsnmp_snmp_timeout" = x""yes; then : LIBSNMP_EXISTS="yes" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for proper SNMP version" >&5 $as_echo_n "checking for proper SNMP version... " >&6; } if test "$SNMP_CONFIG_PATH" != "no" ; then snmp_version=`$SNMP_CONFIG_PATH --version 2>/dev/null` vers=`echo $snmp_version | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2);}'` if test -n "$vers" && test "$vers" -ge 5006; then SNMP_LIBS=`$SNMP_CONFIG_PATH --libs` SNMP_CFLAGS=`$SNMP_CONFIG_PATH --cflags` { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } with_snmp="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You need at least net-snmp 5.6, your version is $snmp_version" >&5 $as_echo "$as_me: WARNING: You need at least net-snmp 5.6, your version is $snmp_version" >&2;} with_snmp="no" fi else with_snmp="no" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "$with_snmp" = "yes"; then LIBS="$LIBS $SNMP_LIBS" CFLAGS="$CFLAGS $SNMP_CFLAGS" $as_echo "#define HAVE_LIBSNMP 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Warning: net-snmp library disabled, autodetecting network scanners will not be supported." >&5 $as_echo "$as_me: WARNING: *** Warning: net-snmp library disabled, autodetecting network scanners will not be supported." >&2;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi for ac_header in fcntl.h unistd.h libc.h sys/dsreq.h sys/select.h \ sys/time.h sys/shm.h sys/ipc.h sys/signal.h sys/scanio.h os2.h \ sys/socket.h sys/io.h sys/hw.h sys/types.h linux/ppdev.h \ dev/ppbus/ppi.h machine/cpufunc.h sys/bitypes.h sys/sem.h sys/poll.h \ windows.h be/kernel/OS.h limits.h sys/ioctl.h asm/types.h\ netinet/in.h tiffio.h ifaddrs.h pwd.h getopt.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in asm/io.h do : ac_fn_c_check_header_compile "$LINENO" "asm/io.h" "ac_cv_header_asm_io_h" "#include " if test "x$ac_cv_header_asm_io_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ASM_IO_H 1 _ACEOF fi done MISSING_HEADERS= if test "${ac_cv_header_fcntl_h}" != "yes" ; then MISSING_HEADERS="${MISSING_HEADERS}\"fcntl.h\" " fi if test "${ac_cv_header_sys_time_h}" != "yes" ; then MISSING_HEADERS="${MISSING_HEADERS}\"sys/time.h\" " fi if test "${ac_cv_header_unistd_h}" != "yes" ; then MISSING_HEADERS="${MISSING_HEADERS}\"unistd.h\" " fi if test "${ac_cv_header_stdc}" != "yes" ; then MISSING_HEADERS="${MISSING_HEADERS}\"ANSI C headers\" " fi if test "${MISSING_HEADERS}" != "" ; then echo "*** The following essential header files couldn't be found:" echo "*** ${MISSING_HEADERS}" echo "*** Maybe the compiler isn't ANSI C compliant or not properly installed?" echo "*** For details on what went wrong see config.log." as_fn_error $? "Exiting now." "$LINENO" 5 fi ac_fn_c_check_header_mongrel "$LINENO" "resmgr.h" "ac_cv_header_resmgr_h" "$ac_includes_default" if test "x$ac_cv_header_resmgr_h" = x""yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rsm_open_device in -lresmgr" >&5 $as_echo_n "checking for rsm_open_device in -lresmgr... " >&6; } if test "${ac_cv_lib_resmgr_rsm_open_device+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lresmgr $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char rsm_open_device (); int main () { return rsm_open_device (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_resmgr_rsm_open_device=yes else ac_cv_lib_resmgr_rsm_open_device=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resmgr_rsm_open_device" >&5 $as_echo "$ac_cv_lib_resmgr_rsm_open_device" >&6; } if test "x$ac_cv_lib_resmgr_rsm_open_device" = x""yes; then : $as_echo "#define HAVE_RESMGR 1" >>confdefs.h RESMGR_LIBS="-lresmgr" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } if test "${ac_cv_type_signal+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_signal=int else ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 $as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" if test "x$ac_cv_type_pid_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" if test "x$ac_cv_type_ssize_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define ssize_t long _ACEOF fi ac_fn_c_check_type "$LINENO" "u_char" "ac_cv_type_u_char" "$ac_includes_default" if test "x$ac_cv_type_u_char" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_U_CHAR 1 _ACEOF fi ac_fn_c_check_type "$LINENO" "u_short" "ac_cv_type_u_short" "$ac_includes_default" if test "x$ac_cv_type_u_short" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_U_SHORT 1 _ACEOF fi ac_fn_c_check_type "$LINENO" "u_int" "ac_cv_type_u_int" "$ac_includes_default" if test "x$ac_cv_type_u_int" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_U_INT 1 _ACEOF fi ac_fn_c_check_type "$LINENO" "u_long" "ac_cv_type_u_long" "$ac_includes_default" if test "x$ac_cv_type_u_long" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_U_LONG 1 _ACEOF fi # from Python, check for "long long" type { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long support" >&5 $as_echo_n "checking for long long support... " >&6; } have_long_long=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { long long x; x = (long long)0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : $as_echo "#define HAVE_LONG_LONG 1" >>confdefs.h have_long_long=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_long_long" >&5 $as_echo "$have_long_long" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t in " >&5 $as_echo_n "checking for socklen_t in ... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { socklen_t len ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; }; $as_echo "#define socklen_t int" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for union semun in " >&5 $as_echo_n "checking for union semun in ... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { union semun test_semun ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_UNION_SEMUN 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct flock in fcntl.h" >&5 $as_echo_n "checking for struct flock in fcntl.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "struct flock" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ; $as_echo "#define HAVE_STRUCT_FLOCK 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Linux ioctl defines" >&5 $as_echo_n "checking for Linux ioctl defines... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { __u32 houba = _IOR('v',14, unsigned long); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; have_linux_ioctl_defines="yes"; else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if test "${ac_cv_c_bigendian+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. ac_arch= ac_prev= for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do if test -n "$ac_prev"; then case $ac_word in i?86 | x86_64 | ppc | ppc64) if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ac_arch=$ac_word else ac_cv_c_bigendian=universal break fi ;; esac ac_prev= elif test "x$ac_word" = "x-arch"; then ac_prev=arch fi done fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_bigendian=no else ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) as_fn_error $? "unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if test "${ac_cv_c_const+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if test "${ac_cv_c_inline+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac ac_fn_c_check_func "$LINENO" "gethostbyaddr" "ac_cv_func_gethostbyaddr" if test "x$ac_cv_func_gethostbyaddr" = x""yes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyaddr in -lbind" >&5 $as_echo_n "checking for gethostbyaddr in -lbind... " >&6; } if test "${ac_cv_lib_bind_gethostbyaddr+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbind $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyaddr (); int main () { return gethostbyaddr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bind_gethostbyaddr=yes else ac_cv_lib_bind_gethostbyaddr=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bind_gethostbyaddr" >&5 $as_echo "$ac_cv_lib_bind_gethostbyaddr" >&6; } if test "x$ac_cv_lib_bind_gethostbyaddr" = x""yes; then : BIND_LIB="-lbind" fi fi ac_fn_c_check_func "$LINENO" "gethostbyaddr" "ac_cv_func_gethostbyaddr" if test "x$ac_cv_func_gethostbyaddr" = x""yes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyaddr in -lnsl" >&5 $as_echo_n "checking for gethostbyaddr in -lnsl... " >&6; } if test "${ac_cv_lib_nsl_gethostbyaddr+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyaddr (); int main () { return gethostbyaddr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_gethostbyaddr=yes else ac_cv_lib_nsl_gethostbyaddr=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyaddr" >&5 $as_echo "$ac_cv_lib_nsl_gethostbyaddr" >&6; } if test "x$ac_cv_lib_nsl_gethostbyaddr" = x""yes; then : NSL_LIB="-lnsl" fi fi ac_fn_c_check_func "$LINENO" "socket" "ac_cv_func_socket" if test "x$ac_cv_func_socket" = x""yes; then : SOCKET_LIBS= else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 $as_echo_n "checking for socket in -lsocket... " >&6; } if test "${ac_cv_lib_socket_socket+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char socket (); int main () { return socket (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_socket=yes else ac_cv_lib_socket_socket=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 $as_echo "$ac_cv_lib_socket_socket" >&6; } if test "x$ac_cv_lib_socket_socket" = x""yes; then : SOCKET_LIB="-lsocket" fi fi ac_fn_c_check_func "$LINENO" "inet_aton" "ac_cv_func_inet_aton" if test "x$ac_cv_func_inet_aton" = x""yes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lresolv" >&5 $as_echo_n "checking for inet_aton in -lresolv... " >&6; } if test "${ac_cv_lib_resolv_inet_aton+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lresolv $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inet_aton (); int main () { return inet_aton (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_resolv_inet_aton=yes else ac_cv_lib_resolv_inet_aton=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_inet_aton" >&5 $as_echo "$ac_cv_lib_resolv_inet_aton" >&6; } if test "x$ac_cv_lib_resolv_inet_aton" = x""yes; then : RESOLV_LIB="-lresolv" fi fi SOCKET_LIBS="$SOCKET_LIB $NSL_LIB $BIND_LIB $RESOLV_LIB" save_LIBS="$LIBS" LIBS="$LIBS $SOCKET_LIBS" for ac_func in inet_addr inet_aton inet_ntoa do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop" if test "x$ac_cv_func_inet_ntop" = x""yes; then : $as_echo "#define HAVE_INET_NTOP 1" >>confdefs.h else case " $LIBOBJS " in *" inet_ntop.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS inet_ntop.$ac_objext" ;; esac fi ac_fn_c_check_func "$LINENO" "inet_pton" "ac_cv_func_inet_pton" if test "x$ac_cv_func_inet_pton" = x""yes; then : $as_echo "#define HAVE_INET_PTON 1" >>confdefs.h else case " $LIBOBJS " in *" inet_pton.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS inet_pton.$ac_objext" ;; esac fi LIBS="$save_LIBS" if test "$ac_cv_header_be_kernel_OS_h" = "yes" ; then ac_cv_func_getaddrinfo=no ac_cv_func_getnameinfo=no fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 $as_echo_n "checking for working alloca.h... " >&6; } if test "${ac_cv_working_alloca_h+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { char *p = (char *) alloca (2 * sizeof (int)); if (p) return 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_working_alloca_h=yes else ac_cv_working_alloca_h=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 $as_echo "$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then $as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 $as_echo_n "checking for alloca... " >&6; } if test "${ac_cv_func_alloca_works+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else # ifdef _MSC_VER # include # define alloca _alloca # else # ifdef HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); # endif # endif # endif # endif #endif int main () { char *p = (char *) alloca (1); if (p) return 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_func_alloca_works=yes else ac_cv_func_alloca_works=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 $as_echo "$ac_cv_func_alloca_works" >&6; } if test $ac_cv_func_alloca_works = yes; then $as_echo "#define HAVE_ALLOCA 1" >>confdefs.h else # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. ALLOCA=\${LIBOBJDIR}alloca.$ac_objext $as_echo "#define C_ALLOCA 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 $as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } if test "${ac_cv_os_cray+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined CRAY && ! defined CRAY2 webecray #else wenotbecray #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "webecray" >/dev/null 2>&1; then : ac_cv_os_cray=yes else ac_cv_os_cray=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 $as_echo "$ac_cv_os_cray" >&6; } if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func _ACEOF break fi done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 $as_echo_n "checking stack direction for C alloca... " >&6; } if test "${ac_cv_c_stack_direction+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_c_stack_direction=0 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int find_stack_direction () { static char *addr = 0; auto char dummy; if (addr == 0) { addr = &dummy; return find_stack_direction (); } else return (&dummy > addr) ? 1 : -1; } int main () { return find_stack_direction () < 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_stack_direction=1 else ac_cv_c_stack_direction=-1 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 $as_echo "$ac_cv_c_stack_direction" >&6; } cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF fi for ac_header in $ac_header_list do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in getpagesize do : ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" if test "x$ac_cv_func_getpagesize" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETPAGESIZE 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 $as_echo_n "checking for working mmap... " >&6; } if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_mmap_fixed_mapped=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default /* malloc might have been renamed as rpl_malloc. */ #undef malloc /* Thanks to Mike Haertel and Jim Avera for this test. Here is a matrix of mmap possibilities: mmap private not fixed mmap private fixed at somewhere currently unmapped mmap private fixed at somewhere already mapped mmap shared not fixed mmap shared fixed at somewhere currently unmapped mmap shared fixed at somewhere already mapped For private mappings, we should verify that changes cannot be read() back from the file, nor mmap's back from the file at a different address. (There have been systems where private was not correctly implemented like the infamous i386 svr4.0, and systems where the VM page cache was not coherent with the file system buffer cache like early versions of FreeBSD and possibly contemporary NetBSD.) For shared mappings, we should conversely verify that changes get propagated back to all the places they're supposed to be. Grep wants private fixed already mapped. The main things grep needs to know about mmap are: * does it exist and is it safe to write into the mmap'd area * how to use it (BSD variants) */ #include #include #if !defined STDC_HEADERS && !defined HAVE_STDLIB_H char *malloc (); #endif /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE # ifdef _SC_PAGESIZE # define getpagesize() sysconf(_SC_PAGESIZE) # else /* no _SC_PAGESIZE */ # ifdef HAVE_SYS_PARAM_H # include # ifdef EXEC_PAGESIZE # define getpagesize() EXEC_PAGESIZE # else /* no EXEC_PAGESIZE */ # ifdef NBPG # define getpagesize() NBPG * CLSIZE # ifndef CLSIZE # define CLSIZE 1 # endif /* no CLSIZE */ # else /* no NBPG */ # ifdef NBPC # define getpagesize() NBPC # else /* no NBPC */ # ifdef PAGESIZE # define getpagesize() PAGESIZE # endif /* PAGESIZE */ # endif /* no NBPC */ # endif /* no NBPG */ # endif /* no EXEC_PAGESIZE */ # else /* no HAVE_SYS_PARAM_H */ # define getpagesize() 8192 /* punt totally */ # endif /* no HAVE_SYS_PARAM_H */ # endif /* no _SC_PAGESIZE */ #endif /* no HAVE_GETPAGESIZE */ int main () { char *data, *data2, *data3; const char *cdata2; int i, pagesize; int fd, fd2; pagesize = getpagesize (); /* First, make a file with some known garbage in it. */ data = (char *) malloc (pagesize); if (!data) return 1; for (i = 0; i < pagesize; ++i) *(data + i) = rand (); umask (0); fd = creat ("conftest.mmap", 0600); if (fd < 0) return 2; if (write (fd, data, pagesize) != pagesize) return 3; close (fd); /* Next, check that the tail of a page is zero-filled. File must have non-zero length, otherwise we risk SIGBUS for entire page. */ fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600); if (fd2 < 0) return 4; cdata2 = ""; if (write (fd2, cdata2, 1) != 1) return 5; data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L); if (data2 == MAP_FAILED) return 6; for (i = 0; i < pagesize; ++i) if (*(data2 + i)) return 7; close (fd2); if (munmap (data2, pagesize)) return 8; /* Next, try to mmap the file at a fixed address which already has something else allocated at it. If we can, also make sure that we see the same garbage. */ fd = open ("conftest.mmap", O_RDWR); if (fd < 0) return 9; if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, 0L)) return 10; for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data2 + i)) return 11; /* Finally, make sure that changes to the mapped area do not percolate back to the file as seen by read(). (This is a bug on some variants of i386 svr4.0.) */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; data3 = (char *) malloc (pagesize); if (!data3) return 12; if (read (fd, data3, pagesize) != pagesize) return 13; for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data3 + i)) return 14; close (fd); return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_mmap_fixed_mapped=yes else ac_cv_func_mmap_fixed_mapped=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5 $as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; } if test $ac_cv_func_mmap_fixed_mapped = yes; then $as_echo "#define HAVE_MMAP 1" >>confdefs.h fi rm -f conftest.mmap conftest.txt for ac_func in atexit ioperm i386_set_ioperm \ mkdir strftime strstr strtod \ cfmakeraw tcsendbreak strcasecmp strncasecmp _portaccess \ getaddrinfo getnameinfo poll setitimer iopl do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_func "$LINENO" "getenv" "ac_cv_func_getenv" if test "x$ac_cv_func_getenv" = x""yes; then : $as_echo "#define HAVE_GETENV 1" >>confdefs.h else case " $LIBOBJS " in *" getenv.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS getenv.$ac_objext" ;; esac fi ac_fn_c_check_func "$LINENO" "isfdtype" "ac_cv_func_isfdtype" if test "x$ac_cv_func_isfdtype" = x""yes; then : $as_echo "#define HAVE_ISFDTYPE 1" >>confdefs.h else case " $LIBOBJS " in *" isfdtype.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS isfdtype.$ac_objext" ;; esac fi ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask" if test "x$ac_cv_func_sigprocmask" = x""yes; then : $as_echo "#define HAVE_SIGPROCMASK 1" >>confdefs.h else case " $LIBOBJS " in *" sigprocmask.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS sigprocmask.$ac_objext" ;; esac fi ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" if test "x$ac_cv_func_snprintf" = x""yes; then : $as_echo "#define HAVE_SNPRINTF 1" >>confdefs.h else case " $LIBOBJS " in *" snprintf.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS snprintf.$ac_objext" ;; esac fi ac_fn_c_check_func "$LINENO" "strcasestr" "ac_cv_func_strcasestr" if test "x$ac_cv_func_strcasestr" = x""yes; then : $as_echo "#define HAVE_STRCASESTR 1" >>confdefs.h else case " $LIBOBJS " in *" strcasestr.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strcasestr.$ac_objext" ;; esac fi ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup" if test "x$ac_cv_func_strdup" = x""yes; then : $as_echo "#define HAVE_STRDUP 1" >>confdefs.h else case " $LIBOBJS " in *" strdup.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strdup.$ac_objext" ;; esac fi ac_fn_c_check_func "$LINENO" "strndup" "ac_cv_func_strndup" if test "x$ac_cv_func_strndup" = x""yes; then : $as_echo "#define HAVE_STRNDUP 1" >>confdefs.h else case " $LIBOBJS " in *" strndup.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strndup.$ac_objext" ;; esac fi ac_fn_c_check_func "$LINENO" "strsep" "ac_cv_func_strsep" if test "x$ac_cv_func_strsep" = x""yes; then : $as_echo "#define HAVE_STRSEP 1" >>confdefs.h else case " $LIBOBJS " in *" strsep.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strsep.$ac_objext" ;; esac fi ac_fn_c_check_func "$LINENO" "usleep" "ac_cv_func_usleep" if test "x$ac_cv_func_usleep" = x""yes; then : $as_echo "#define HAVE_USLEEP 1" >>confdefs.h else case " $LIBOBJS " in *" usleep.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS usleep.$ac_objext" ;; esac fi ac_fn_c_check_func "$LINENO" "vsyslog" "ac_cv_func_vsyslog" if test "x$ac_cv_func_vsyslog" = x""yes; then : $as_echo "#define HAVE_VSYSLOG 1" >>confdefs.h else case " $LIBOBJS " in *" vsyslog.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS vsyslog.$ac_objext" ;; esac fi if test "$ac_cv_header_os2_h" = "yes" ; then $as_echo "#define strncasecmp strnicmp" >>confdefs.h $as_echo "#define strcasecmp stricmp" >>confdefs.h fi if test "$ac_cv_header_getopt_h" = "yes" ; then for ac_func in getopt_long do : ac_fn_c_check_func "$LINENO" "getopt_long" "ac_cv_func_getopt_long" if test "x$ac_cv_func_getopt_long" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETOPT_LONG 1 _ACEOF fi done fi if test -c /dev/urandom ; then $as_echo "#define HAVE_DEV_URANDOM 1" >>confdefs.h fi # Check whether --enable-libusb_1_0 was given. if test "${enable_libusb_1_0+set}" = set; then : enableval=$enable_libusb_1_0; enable_libusb_1_0=$enableval else enable_libusb_1_0=no fi # Check whether --enable-libusb was given. if test "${enable_libusb+set}" = set; then : enableval=$enable_libusb; else enable_libusb=auto fi HAVE_USB=no if test "$enable_libusb" != "no"; then case ${host_os} in beos*) for ac_header in be/drivers/USB_scanner.h do : ac_fn_c_check_header_mongrel "$LINENO" "be/drivers/USB_scanner.h" "ac_cv_header_be_drivers_USB_scanner_h" "$ac_includes_default" if test "x$ac_cv_header_be_drivers_USB_scanner_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_BE_DRIVERS_USB_SCANNER_H 1 _ACEOF HAVE_USB=yes else as_fn_error $? "USB_scanner.h is required on BeOS" "$LINENO" 5 fi done ;; os2*) ac_fn_c_check_header_compile "$LINENO" "usbcalls.h" "ac_cv_header_usbcalls_h" "#include #include " if test "x$ac_cv_header_usbcalls_h" = x""yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for UsbQueryNumberDevices in -lusbcall" >&5 $as_echo_n "checking for UsbQueryNumberDevices in -lusbcall... " >&6; } if test "${ac_cv_lib_usbcall_UsbQueryNumberDevices+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lusbcall $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char UsbQueryNumberDevices (); int main () { return UsbQueryNumberDevices (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_usbcall_UsbQueryNumberDevices=yes else ac_cv_lib_usbcall_UsbQueryNumberDevices=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_usbcall_UsbQueryNumberDevices" >&5 $as_echo "$ac_cv_lib_usbcall_UsbQueryNumberDevices" >&6; } if test "x$ac_cv_lib_usbcall_UsbQueryNumberDevices" = x""yes; then : USB_LIBS="$USB_LIBS -lusbcall" HAVE_USB=yes fi fi ;; *) have_libusb_1_0=no if test "$enable_libusb_1_0" = "yes"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBUSB_1_0" >&5 $as_echo_n "checking for LIBUSB_1_0... " >&6; } if test -n "$LIBUSB_1_0_CFLAGS"; then pkg_cv_LIBUSB_1_0_CFLAGS="$LIBUSB_1_0_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \" libusb-1.0 >= 1.0.0 \""; } >&5 ($PKG_CONFIG --exists --print-errors " libusb-1.0 >= 1.0.0 ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBUSB_1_0_CFLAGS=`$PKG_CONFIG --cflags " libusb-1.0 >= 1.0.0 " 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBUSB_1_0_LIBS"; then pkg_cv_LIBUSB_1_0_LIBS="$LIBUSB_1_0_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \" libusb-1.0 >= 1.0.0 \""; } >&5 ($PKG_CONFIG --exists --print-errors " libusb-1.0 >= 1.0.0 ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBUSB_1_0_LIBS=`$PKG_CONFIG --libs " libusb-1.0 >= 1.0.0 " 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBUSB_1_0_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors " libusb-1.0 >= 1.0.0 " 2>&1` else LIBUSB_1_0_PKG_ERRORS=`$PKG_CONFIG --print-errors " libusb-1.0 >= 1.0.0 " 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBUSB_1_0_PKG_ERRORS" >&5 have_libusb_1_0=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_libusb_1_0=no else LIBUSB_1_0_CFLAGS=$pkg_cv_LIBUSB_1_0_CFLAGS LIBUSB_1_0_LIBS=$pkg_cv_LIBUSB_1_0_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_libusb_1_0=yes fi if test "$have_libusb_1_0" = "yes"; then CFLAGS="$CFLAGS $LIBUSB_1_0_CFLAGS" USB_LIBS="$USB_LIBS $LIBUSB_1_0_LIBS" HAVE_USB=yes fi fi if test "$have_libusb_1_0" = "no"; then ac_fn_c_check_header_mongrel "$LINENO" "usb.h" "ac_cv_header_usb_h" "$ac_includes_default" if test "x$ac_cv_header_usb_h" = x""yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for usb_interrupt_read in -lusb" >&5 $as_echo_n "checking for usb_interrupt_read in -lusb... " >&6; } if test "${ac_cv_lib_usb_usb_interrupt_read+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lusb $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char usb_interrupt_read (); int main () { return usb_interrupt_read (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_usb_usb_interrupt_read=yes else ac_cv_lib_usb_usb_interrupt_read=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_usb_usb_interrupt_read" >&5 $as_echo "$ac_cv_lib_usb_usb_interrupt_read" >&6; } if test "x$ac_cv_lib_usb_usb_interrupt_read" = x""yes; then : USB_LIBS="$USB_LIBS -lusb" HAVE_USB=yes fi fi fi ;; esac fi if test "$enable_libusb" = "yes" && test "$HAVE_USB" = "no"; then as_fn_error $? "USB support requested but required libraries not found." "$LINENO" 5 fi if test "$HAVE_USB" = "yes"; then case ${host_os} in os2*) $as_echo "#define HAVE_USBCALL 1" >>confdefs.h ;; *) if test "$have_libusb_1_0" = "yes"; then $as_echo "#define HAVE_LIBUSB_1_0 1" >>confdefs.h else $as_echo "#define HAVE_LIBUSB 1" >>confdefs.h fi ;; esac fi for ac_header in IOKit/scsi/SCSITaskLib.h IOKit/cdb/IOSCSILib.h \ IOKit/scsi/SCSICommandOperationCodes.h \ IOKit/scsi-commands/SCSICommandOperationCodes.h scsi.h sys/scsi.h \ sys/scsicmd.h sys/scsiio.h bsd/dev/scsireg.h scsi/sg.h \ camlib.h scdds.h sys/scsi/scsi.h sys/scsi/sgdefs.h \ sys/scsi/targets/scgio.h apollo/scsi.h sys/sdi_comm.h \ sys/passthrudef.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in io/cam/cam.h do : ac_fn_c_check_header_compile "$LINENO" "io/cam/cam.h" "ac_cv_header_io_cam_cam_h" "#include " if test "x$ac_cv_header_io_cam_cam_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_IO_CAM_CAM_H 1 _ACEOF fi done if test "$ac_cv_header_sys_scsiio_h" = "yes" \ -a "$ac_cv_header_scsi_h" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if 'scsireq_t' needs to be defined as 'struct scsireq'" >&5 $as_echo_n "checking if 'scsireq_t' needs to be defined as 'struct scsireq'... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { scsireq_t req ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define scsireq_t struct scsireq_t" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for scsireq_enter in -lscsi" >&5 $as_echo_n "checking for scsireq_enter in -lscsi... " >&6; } if test "${ac_cv_lib_scsi_scsireq_enter+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lscsi $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char scsireq_enter (); int main () { return scsireq_enter (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_scsi_scsireq_enter=yes else ac_cv_lib_scsi_scsireq_enter=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_scsi_scsireq_enter" >&5 $as_echo "$ac_cv_lib_scsi_scsireq_enter" >&6; } if test "x$ac_cv_lib_scsi_scsireq_enter" = x""yes; then : SCSI_LIBS="-lscsi" fi # FreeBSD needs this { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cam_open_device in -lcam" >&5 $as_echo_n "checking for cam_open_device in -lcam... " >&6; } if test "${ac_cv_lib_cam_cam_open_device+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcam $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char cam_open_device (); int main () { return cam_open_device (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cam_cam_open_device=yes else ac_cv_lib_cam_cam_open_device=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cam_cam_open_device" >&5 $as_echo "$ac_cv_lib_cam_cam_open_device" >&6; } if test "x$ac_cv_lib_cam_cam_open_device" = x""yes; then : SCSI_LIBS="-lcam" fi # FreeBSD 3+ needs this for ac_func in scsireq_enter do : ac_fn_c_check_func "$LINENO" "scsireq_enter" "ac_cv_func_scsireq_enter" if test "x$ac_cv_func_scsireq_enter" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SCSIREQ_ENTER 1 _ACEOF fi done if test "$ac_cv_header_scsi_sg_h" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sg_header.target_status in " >&5 $as_echo_n "checking for sg_header.target_status in ... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct sg_header hdr; hdr.target_status = 1; return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_SG_TARGET_STATUS 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "$ac_cv_header_IOKit_scsi_SCSITaskLib_h" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SCSITaskSGElement in IOKit/scsi/SCSITaskLib.h" >&5 $as_echo_n "checking for SCSITaskSGElement in IOKit/scsi/SCSITaskLib.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #undef VERSION #include int main () { SCSITaskSGElement range; return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_SCSITASKSGELEMENT 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if sparc64 -q > /dev/null 2>&1 ; then $as_echo "#define DISABLE_LINUX_SG_IO 1" >>confdefs.h fi # Multiple platforms can set SCSI_LIBS so do substitution at end. # Check whether --enable-scsibuffersize was given. if test "${enable_scsibuffersize+set}" = set; then : enableval=$enable_scsibuffersize; set_scsibuffersize="$enableval" else set_scsibuffersize=131072 fi cat >>confdefs.h <<_ACEOF #define SCSIBUFFERSIZE $set_scsibuffersize _ACEOF echo "scsi buffersize: $set_scsibuffersize" # Check whether --enable-scsi-directio was given. if test "${enable_scsi_directio+set}" = set; then : enableval=$enable_scsi_directio; if eval "test x$enable_scsi_directio = xyes"; then CFLAGS="$CFLAGS -DENABLE_SCSI_DIRECTIO" fi fi if test "$ac_cv_func_getnameinfo" = "yes" \ && test "$ac_cv_func_getaddrinfo" = "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable IPv6" >&5 $as_echo_n "checking whether to enable IPv6... " >&6; } # Check whether --enable-ipv6 was given. if test "${enable_ipv6+set}" = set; then : enableval=$enable_ipv6; if test "$enableval" = "no" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, manually disabled" >&5 $as_echo "no, manually disabled" >&6; } ipv6=no fi fi if test "$ipv6" != "no" ; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define INET6 #include #include int main () { /* AF_INET6 available check */ if (socket(AF_INET6, SOCK_STREAM, 0) < 0) exit(1); else exit(0); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define ENABLE_IPV6 1" >>confdefs.h ipv6=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (couldn't compile test program)" >&5 $as_echo "no (couldn't compile test program)" >&6; } ipv6=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "$ipv6" != "no" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct sockaddr_storage has an ss_family member" >&5 $as_echo_n "checking whether struct sockaddr_storage has an ss_family member... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define INET6 #include #include int main () { /* test if the ss_family member exists in struct sockaddr_storage */ struct sockaddr_storage ss; ss.ss_family = AF_INET; exit (0); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAS_SS_FAMILY 1" >>confdefs.h else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define INET6 #include #include int main () { /* test if the __ss_family member exists in struct sockaddr_storage */ struct sockaddr_storage ss; ss.__ss_family = AF_INET; exit (0); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, but __ss_family exists" >&5 $as_echo "no, but __ss_family exists" >&6; } $as_echo "#define HAS___SS_FAMILY 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ipv6=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi else ipv6="no" fi enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AS+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AS="${ac_tool_prefix}as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AS=$ac_cv_prog_AS if test -n "$AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 $as_echo "$AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AS"; then ac_ct_AS=$AS # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_AS+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AS"; then ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AS="as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 $as_echo "$ac_ct_AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AS" = x; then AS="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AS=$ac_ct_AS fi else AS="$ac_cv_prog_AS" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_DLLTOOL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OBJDUMP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi ;; esac test -z "$AS" && AS=as test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$OBJDUMP" && OBJDUMP=objdump # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=no fi case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.2.10' macro_revision='1.3175' ltmain="$ac_aux_dir/ltmain.sh" # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`print -r -- -n 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if test "${ac_cv_path_SED+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if test "${ac_cv_path_FGREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if test "${lt_cv_path_LD+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if test "${lt_cv_path_NM+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_DUMPBIN+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if test "${lt_cv_nm_interface+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if test "${lt_cv_sys_max_cmd_len+set}" = set; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if test "${lt_cv_ld_reload_flag+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OBJDUMP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if test "${lt_cv_deplibs_check_method+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AR+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="${ac_tool_prefix}ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi else AR="$ac_cv_prog_AR" fi test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : $as_echo_n "(cached) " >&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 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&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 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ const struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if test "${lt_cv_cc_needs_belf+set}" = set; then : $as_echo_n "(cached) " >&6 else 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 cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_DSYMUTIL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_NMEDIT+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_LIPO+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OTOOL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OTOOL64+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if test "${lt_cv_apple_cc_single_mod+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if test "${lt_cv_ld_exported_symbols_list+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if test "${lt_cv_ld_force_load+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; pic_mode="$withval" else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if test "${lt_cv_objdir+set}" = set; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" 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 # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' lt_prog_compiler_pic='-Xcompiler -fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ F* | *Sun*Fortran*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 $as_echo "$lt_prog_compiler_pic" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if test "${lt_cv_prog_compiler_pic_works+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test "${lt_cv_prog_compiler_static_works+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag= tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld='-rpath $libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if test "${lt_cv_prog_compiler__b+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo(void) {} _ACEOF if ac_fn_c_try_link "$LINENO"; then : archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if test "${lt_cv_archive_cmds_need_lc+set}" = set; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; haiku*) version_type=linux need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = x""yes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) void fnord () __attribute__((visibility("default"))); #endif void fnord () { int i=42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) void fnord () __attribute__((visibility("default"))); #endif void fnord () { int i=42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } 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 CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: case $host_os in cygwin* | mingw* | beos* | os2*) LDFLAGS="$LDFLAGS -no-undefined" esac # Check whether --with-lockdir was given. if test "${with_lockdir+set}" = set; then : withval=$with_lockdir; locksanedir=$withval else locksanedir=${localstatedir}/lock/sane fi configdir="${sysconfdir}/sane.d" CPPFLAGS="${CPPFLAGS} -DPATH_SANE_CONFIG_DIR=\$(configdir) \ -DPATH_SANE_DATA_DIR=\$(datadir) \ -DPATH_SANE_LOCK_DIR=\$(locksanedir) \ -DV_MAJOR=${V_MAJOR} -DV_MINOR=${V_MINOR}" if test "${ac_cv_header_sys_socket_h}" = "no"; then echo "*** disabling saned (sys/socket.h not found)" SANED= else SANED=saned fi if test x$SANED = xsaned; then COMPILE_SANED_TRUE= COMPILE_SANED_FALSE='#' else COMPILE_SANED_TRUE='#' COMPILE_SANED_FALSE= fi # Check whether --enable-local-backends was given. if test "${enable_local_backends+set}" = set; then : enableval=$enable_local_backends; fi ALL_BACKENDS="geniusvp2 ls5000" # If user specifies backends manually then cause configure # to fail if its detected it can't be compiled. If we # are in automatic mode then remove backend from list instead. user_selected_backends="yes" if eval "test x$enable_local_backends = xno"; then BACKENDS="net" else if test "${BACKENDS}" != "" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: Manually selected backends: ${BACKENDS}" >&5 $as_echo "$as_me: Manually selected backends: ${BACKENDS}" >&6;} else BACKENDS="$ALL_BACKENDS" user_selected_backends="no" fi fi if test "${user_selected_backends}" = "yes"; then DISABLE_MSG="aborting" else DISABLE_MSG="disabling" fi FILTERED_BACKENDS="" for be in ${BACKENDS}; do backend_supported="yes" case $be in plustek_pp) case "$host_os" in gnu*) echo "*** $be backend not supported on GNU/Hurd - $DISABLE_MSG" backend_supported="no" ;; esac ;; dc210|dc240) if test "${sane_cv_use_libjpeg}" != "yes"; then echo "*** $be backend requires JPEG library - $DISABLE_MSG" backend_supported="no" fi ;; canon_pp|hpsj5s) if test "${sane_cv_use_libieee1284}" != "yes"; then echo "*** $be backend requires libieee1284 library - $DISABLE_MSG" backend_supported="no" fi ;; mustek_pp) if test "${sane_cv_use_libieee1284}" != "yes" && test "${enable_parport_directio}" != "yes"; then echo "*** $be backend requires libieee1284 and paraport-directio libraries - $DISABLE_MSG" backend_supported="no" fi ;; dell1600n_net) if test "${sane_cv_use_libjpeg}" != "yes" || test "${sane_cv_use_libtiff}" != "yes"; then echo "*** $be backend requires JPEG and/or TIFF library - $DISABLE_MSG" backend_supported="no" fi ;; gphoto2) if test "${HAVE_GPHOTO2}" != "true" \ -o "${sane_cv_use_libjpeg}" != "yes"; then echo "*** $be backend requires gphoto2 and JPEG libraries - $DISABLE_MSG" backend_supported="no" fi ;; pint) if test "${ac_cv_header_sys_scanio_h}" = "no"; then echo "*** $be backend requires sys/scanio.h - $DISABLE_MSG" backend_supported="no" fi ;; qcam) if test "${ac_cv_func_ioperm}" = "no" \ && test "${ac_cv_func__portaccess}" = "no"; then echo "*** $be backend requires ioperm and portaccess functions - $DISABLE_MSG" backend_supported="no" fi ;; v4l) if test "${have_linux_ioctl_defines}" != "yes" \ || test "${have_libv4l1}" != "yes"; then echo "*** $be backend requires v4l libraries - $DISABLE_MSG" backend_supported="no" fi ;; net) if test "${ac_cv_header_sys_socket_h}" = "no"; then echo "*** $be backend requires sys/socket.h - $DISABLE_MSG" backend_supported="no" fi ;; mustek_usb2) if test "${have_pthread}" != "yes"; then echo "*** $be backend requires pthread library - $DISABLE_MSG" backend_supported="no" fi ;; esac if test "${backend_supported}" = "no"; then if test "${user_selected_backends}" = "yes"; then exit 1 fi else FILTERED_BACKENDS="${FILTERED_BACKENDS} $be" fi done if test "${sane_cv_use_libjpeg}" = "yes"; then SANEI_SANEI_JPEG_LO="../sanei/sanei_jpeg.lo" fi if test x$sane_cv_use_libjpeg = xyes; then HAVE_JPEG_TRUE= HAVE_JPEG_FALSE='#' else HAVE_JPEG_TRUE='#' HAVE_JPEG_FALSE= fi BACKENDS="$FILTERED_BACKENDS" BACKEND_LIBS_ENABLED="" BACKEND_CONFS_ENABLED="" BACKEND_MANS_ENABLED="" for backend in ${BACKENDS} ; do BACKEND_LIBS_ENABLED="${BACKEND_LIBS_ENABLED} libsane-${backend}.la" BACKEND_CONFS_ENABLED="${BACKEND_CONFS_ENABLED} ${backend}.conf" BACKEND_MANS_ENABLED="${BACKEND_MANS_ENABLED} sane-${backend}.5" done if test "${enable_shared}" = "no"; then enable_preload=yes fi if test "${enable_dynamic}" != yes || test "${enable_preload}" = "yes"; then echo "preloading backends into DLL" # If user specifies backends manually then cause configure # to fail if its detected it can't be compiled. If we # are in automatic mode then remove backend from list instead. user_selected_backends="yes" if eval "test x$enable_local_backends = xno"; then PRELOADABLE_BACKENDS="net" else if test "${PRELOADABLE_BACKENDS}" != "" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: Manually selected preloadable backends: ${PRELOADABLE_BACKENDS}" >&5 $as_echo "$as_me: Manually selected preloadable backends: ${PRELOADABLE_BACKENDS}" >&6;} else PRELOADABLE_BACKENDS="$ALL_BACKENDS" user_selected_backends="no" fi fi saved_BACKENDS="$BACKENDS" BACKENDS="${PRELOADABLE_BACKENDS}" if test "${user_selected_backends}" = "yes"; then DISABLE_MSG="aborting" else DISABLE_MSG="disabling" fi FILTERED_BACKENDS="" for be in ${BACKENDS}; do backend_supported="yes" case $be in plustek_pp) case "$host_os" in gnu*) echo "*** $be backend not supported on GNU/Hurd - $DISABLE_MSG" backend_supported="no" ;; esac ;; dc210|dc240) if test "${sane_cv_use_libjpeg}" != "yes"; then echo "*** $be backend requires JPEG library - $DISABLE_MSG" backend_supported="no" fi ;; canon_pp|hpsj5s) if test "${sane_cv_use_libieee1284}" != "yes"; then echo "*** $be backend requires libieee1284 library - $DISABLE_MSG" backend_supported="no" fi ;; mustek_pp) if test "${sane_cv_use_libieee1284}" != "yes" && test "${enable_parport_directio}" != "yes"; then echo "*** $be backend requires libieee1284 and paraport-directio libraries - $DISABLE_MSG" backend_supported="no" fi ;; dell1600n_net) if test "${sane_cv_use_libjpeg}" != "yes" || test "${sane_cv_use_libtiff}" != "yes"; then echo "*** $be backend requires JPEG and/or TIFF library - $DISABLE_MSG" backend_supported="no" fi ;; gphoto2) if test "${HAVE_GPHOTO2}" != "true" \ -o "${sane_cv_use_libjpeg}" != "yes"; then echo "*** $be backend requires gphoto2 and JPEG libraries - $DISABLE_MSG" backend_supported="no" fi ;; pint) if test "${ac_cv_header_sys_scanio_h}" = "no"; then echo "*** $be backend requires sys/scanio.h - $DISABLE_MSG" backend_supported="no" fi ;; qcam) if test "${ac_cv_func_ioperm}" = "no" \ && test "${ac_cv_func__portaccess}" = "no"; then echo "*** $be backend requires ioperm and portaccess functions - $DISABLE_MSG" backend_supported="no" fi ;; v4l) if test "${have_linux_ioctl_defines}" != "yes" \ || test "${have_libv4l1}" != "yes"; then echo "*** $be backend requires v4l libraries - $DISABLE_MSG" backend_supported="no" fi ;; net) if test "${ac_cv_header_sys_socket_h}" = "no"; then echo "*** $be backend requires sys/socket.h - $DISABLE_MSG" backend_supported="no" fi ;; mustek_usb2) if test "${have_pthread}" != "yes"; then echo "*** $be backend requires pthread library - $DISABLE_MSG" backend_supported="no" fi ;; esac if test "${backend_supported}" = "no"; then if test "${user_selected_backends}" = "yes"; then exit 1 fi else FILTERED_BACKENDS="${FILTERED_BACKENDS} $be" fi done PRELOADABLE_BACKENDS="$FILTERED_BACKENDS" BACKENDS="$saved_BACKENDS" else PRELOADABLE_BACKENDS="" fi PRELOADABLE_BACKENDS_ENABLED="" # Do not initialize BACKEND_CONFS_ENABLED so that its a combination # of all backends. for backend in ${PRELOADABLE_BACKENDS} ; do BACKEND_CONFS_ENABLED="${BACKEND_CONFS_ENABLED} ${backend}.conf" BACKEND_MANS_ENABLED="${BACKEND_MANS_ENABLED} sane-${backend}.5" # Special hacks. Normally, we create a convenience library that # matches the backend's name but in some cases that will conflict # with an external library name that also matches backend name. # Work around that here by renaming internal library. if test "${backend}" = "gphoto2"; then backend=gphoto2_i fi PRELOADABLE_BACKENDS_ENABLED="${PRELOADABLE_BACKENDS_ENABLED} lib${backend}.la" done case $host_os in beos*) libdir='${exec_prefix}/add-ons' ;; esac # Check whether --enable-parport-directio was given. if test "${enable_parport_directio+set}" = set; then : enableval=$enable_parport_directio; if eval "test x$enable_parport_directio = xyes"; then CFLAGS="$CFLAGS -DENABLE_PARPORT_DIRECTIO" fi fi # Check whether --enable-translations was given. if test "${enable_translations+set}" = set; then : enableval=$enable_translations; else enable_translations=yes fi if eval "test x$enable_translations = xyes" ; then if test x$MSGFMT = xno || test x$XGETTEXT = xno || test $MSGMERGE = no ; then enable_translations=no echo "disabling translations (missing msgfmt, xgettext or msgmerge)" else echo "enabling translations" fi else echo "disabling translations" fi if test x$enable_translations = xyes; then ENABLE_TRANSLATIONS_TRUE= ENABLE_TRANSLATIONS_FALSE='#' else ENABLE_TRANSLATIONS_TRUE='#' ENABLE_TRANSLATIONS_FALSE= fi # Check whether --enable-latex was given. if test "${enable_latex+set}" = set; then : enableval=$enable_latex; else enable_latex=yes fi if test "x$enable_latex" = "xyes" ; then if test "x$LATEX" = "xno" || test "x$DVIPS" = "xno" || test "x$MAKEINDEX" = "xno" ; then enable_latex=no echo "disabling latex (missing latex, dvips or makeindex)" else echo "enabling latex" fi else echo "disabling latex" fi if test x$enable_latex = xyes; then USE_LATEX_TRUE= USE_LATEX_FALSE='#' else USE_LATEX_TRUE='#' USE_LATEX_FALSE= fi DISTCLEAN_FILES="*~ .*~ *.log *.bak *.old *.orig *.out *.rej \"\#\"* \".\\#\"*" ac_config_files="$ac_config_files Makefile lib/Makefile sanei/Makefile backend/Makefile include/Makefile doc/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 overridden 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, we kill variables containing newlines. # 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. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} 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}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CROSS_COMPILING_TRUE}" && test -z "${CROSS_COMPILING_FALSE}"; then as_fn_error $? "conditional \"CROSS_COMPILING\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${COMPILE_SANED_TRUE}" && test -z "${COMPILE_SANED_FALSE}"; then as_fn_error $? "conditional \"COMPILE_SANED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_JPEG_TRUE}" && test -z "${HAVE_JPEG_FALSE}"; then as_fn_error $? "conditional \"HAVE_JPEG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_TRANSLATIONS_TRUE}" && test -z "${ENABLE_TRANSLATIONS_FALSE}"; then as_fn_error $? "conditional \"ENABLE_TRANSLATIONS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_LATEX_TRUE}" && test -z "${USE_LATEX_FALSE}"; then as_fn_error $? "conditional \"USE_LATEX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # 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 ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # 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 ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by sane-backends $as_me 1.0.22, which was generated by GNU Autoconf 2.67. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -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 --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ sane-backends config.status 1.0.22 configured by $0, generated by GNU Autoconf 2.67, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # variables for create stdint.h replacement PACKAGE="$PACKAGE" VERSION="$VERSION" ac_stdint_h="$ac_stdint_h" _ac_stdint_h=`$as_echo "_$PACKAGE-$ac_stdint_h" | $as_tr_cpp` ac_cv_stdint_message="$ac_cv_stdint_message" ac_cv_header_stdint_t="$ac_cv_header_stdint_t" ac_cv_header_stdint_x="$ac_cv_header_stdint_x" ac_cv_header_stdint_o="$ac_cv_header_stdint_o" ac_cv_header_stdint_u="$ac_cv_header_stdint_u" ac_cv_type_uint64_t="$ac_cv_type_uint64_t" ac_cv_type_u_int64_t="$ac_cv_type_u_int64_t" ac_cv_char_data_model="$ac_cv_char_data_model" ac_cv_long_data_model="$ac_cv_long_data_model" ac_cv_type_int_least32_t="$ac_cv_type_int_least32_t" ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t" ac_cv_type_intmax_t="$ac_cv_type_intmax_t" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in AS \ DLLTOOL \ OBJDUMP \ SHELL \ ECHO \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ deplibs_check_method \ file_magic_cmd \ AR \ AR_FLAGS \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ fix_srcfile_path \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "include/sane/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/sane/config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "$ac_stdint_h") CONFIG_COMMANDS="$CONFIG_COMMANDS $ac_stdint_h" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "sanei/Makefile") CONFIG_FILES="$CONFIG_FILES sanei/Makefile" ;; "backend/Makefile") CONFIG_FILES="$CONFIG_FILES backend/Makefile" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; 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_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries 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[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_t=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_t"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf 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. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_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 # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. 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 " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/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_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "$ac_stdint_h":C) { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_stdint_h : $_ac_stdint_h" >&5 $as_echo "$as_me: creating $ac_stdint_h : $_ac_stdint_h" >&6;} ac_stdint=$tmp/_stdint.h echo "#ifndef" $_ac_stdint_h >$ac_stdint echo "#define" $_ac_stdint_h "1" >>$ac_stdint echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint echo "/* generated $ac_cv_stdint_message */" >>$ac_stdint if test "_$ac_cv_header_stdint_t" != "_" ; then echo "#define _STDINT_HAVE_STDINT_H" "1" >>$ac_stdint echo "#include " >>$ac_stdint echo "#endif" >>$ac_stdint echo "#endif" >>$ac_stdint else cat >>$ac_stdint < #else #include /* .................... configured part ............................ */ STDINT_EOF echo "/* whether we have a C99 compatible stdint header file */" >>$ac_stdint if test "_$ac_cv_header_stdint_x" != "_" ; then ac_header="$ac_cv_header_stdint_x" echo "#define _STDINT_HEADER_INTPTR" '"'"$ac_header"'"' >>$ac_stdint else echo "/* #undef _STDINT_HEADER_INTPTR */" >>$ac_stdint fi echo "/* whether we have a C96 compatible inttypes header file */" >>$ac_stdint if test "_$ac_cv_header_stdint_o" != "_" ; then ac_header="$ac_cv_header_stdint_o" echo "#define _STDINT_HEADER_UINT32" '"'"$ac_header"'"' >>$ac_stdint else echo "/* #undef _STDINT_HEADER_UINT32 */" >>$ac_stdint fi echo "/* whether we have a BSD compatible inet types header */" >>$ac_stdint if test "_$ac_cv_header_stdint_u" != "_" ; then ac_header="$ac_cv_header_stdint_u" echo "#define _STDINT_HEADER_U_INT32" '"'"$ac_header"'"' >>$ac_stdint else echo "/* #undef _STDINT_HEADER_U_INT32 */" >>$ac_stdint fi echo "" >>$ac_stdint if test "_$ac_header" != "_" ; then if test "$ac_header" != "stddef.h" ; then echo "#include <$ac_header>" >>$ac_stdint echo "" >>$ac_stdint fi fi echo "/* which 64bit typedef has been found */" >>$ac_stdint if test "$ac_cv_type_uint64_t" = "yes" ; then echo "#define _STDINT_HAVE_UINT64_T" "1" >>$ac_stdint else echo "/* #undef _STDINT_HAVE_UINT64_T */" >>$ac_stdint fi if test "$ac_cv_type_u_int64_t" = "yes" ; then echo "#define _STDINT_HAVE_U_INT64_T" "1" >>$ac_stdint else echo "/* #undef _STDINT_HAVE_U_INT64_T */" >>$ac_stdint fi echo "" >>$ac_stdint echo "/* which type model has been detected */" >>$ac_stdint if test "_$ac_cv_char_data_model" != "_" ; then echo "#define _STDINT_CHAR_MODEL" "$ac_cv_char_data_model" >>$ac_stdint echo "#define _STDINT_LONG_MODEL" "$ac_cv_long_data_model" >>$ac_stdint else echo "/* #undef _STDINT_CHAR_MODEL // skipped */" >>$ac_stdint echo "/* #undef _STDINT_LONG_MODEL // skipped */" >>$ac_stdint fi echo "" >>$ac_stdint echo "/* whether int_least types were detected */" >>$ac_stdint if test "$ac_cv_type_int_least32_t" = "yes"; then echo "#define _STDINT_HAVE_INT_LEAST32_T" "1" >>$ac_stdint else echo "/* #undef _STDINT_HAVE_INT_LEAST32_T */" >>$ac_stdint fi echo "/* whether int_fast types were detected */" >>$ac_stdint if test "$ac_cv_type_int_fast32_t" = "yes"; then echo "#define _STDINT_HAVE_INT_FAST32_T" "1" >>$ac_stdint else echo "/* #undef _STDINT_HAVE_INT_FAST32_T */" >>$ac_stdint fi echo "/* whether intmax_t type was detected */" >>$ac_stdint if test "$ac_cv_type_intmax_t" = "yes"; then echo "#define _STDINT_HAVE_INTMAX_T" "1" >>$ac_stdint else echo "/* #undef _STDINT_HAVE_INTMAX_T */" >>$ac_stdint fi echo "" >>$ac_stdint cat >>$ac_stdint <= 199901L #define _HAVE_UINT64_T #define _HAVE_LONGLONG_UINT64_T typedef long long int64_t; typedef unsigned long long uint64_t; #elif !defined __STRICT_ANSI__ #if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__ #define _HAVE_UINT64_T typedef __int64 int64_t; typedef unsigned __int64 uint64_t; #elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__ /* note: all ELF-systems seem to have loff-support which needs 64-bit */ #if !defined _NO_LONGLONG #define _HAVE_UINT64_T #define _HAVE_LONGLONG_UINT64_T typedef long long int64_t; typedef unsigned long long uint64_t; #endif #elif defined __alpha || (defined __mips && defined _ABIN32) #if !defined _NO_LONGLONG typedef long int64_t; typedef unsigned long uint64_t; #endif /* compiler/cpu type to define int64_t */ #endif #endif #endif #if defined _STDINT_HAVE_U_INT_TYPES /* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */ typedef u_int8_t uint8_t; typedef u_int16_t uint16_t; typedef u_int32_t uint32_t; /* glibc compatibility */ #ifndef __int8_t_defined #define __int8_t_defined #endif #endif #ifdef _STDINT_NEED_INT_MODEL_T /* we must guess all the basic types. Apart from byte-adressable system, */ /* there a few 32-bit-only dsp-systems that we guard with BYTE_MODEL 8-} */ /* (btw, those nibble-addressable systems are way off, or so we assume) */ #if defined _STDINT_BYTE_MODEL #if _STDINT_LONG_MODEL+0 == 242 /* 2:4:2 = IP16 = a normal 16-bit system */ typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned long uint32_t; #ifndef __int8_t_defined #define __int8_t_defined typedef char int8_t; typedef short int16_t; typedef long int32_t; #endif #elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL == 444 /* 2:4:4 = LP32 = a 32-bit system derived from a 16-bit */ /* 4:4:4 = ILP32 = a normal 32-bit system */ typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #ifndef __int8_t_defined #define __int8_t_defined typedef char int8_t; typedef short int16_t; typedef int int32_t; #endif #elif _STDINT_LONG_MODEL+0 == 484 || _STDINT_LONG_MODEL+0 == 488 /* 4:8:4 = IP32 = a 32-bit system prepared for 64-bit */ /* 4:8:8 = LP64 = a normal 64-bit system */ typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #ifndef __int8_t_defined #define __int8_t_defined typedef char int8_t; typedef short int16_t; typedef int int32_t; #endif /* this system has a "long" of 64bit */ #ifndef _HAVE_UINT64_T #define _HAVE_UINT64_T typedef unsigned long uint64_t; typedef long int64_t; #endif #elif _STDINT_LONG_MODEL+0 == 448 /* LLP64 a 64-bit system derived from a 32-bit system */ typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #ifndef __int8_t_defined #define __int8_t_defined typedef char int8_t; typedef short int16_t; typedef int int32_t; #endif /* assuming the system has a "long long" */ #ifndef _HAVE_UINT64_T #define _HAVE_UINT64_T #define _HAVE_LONGLONG_UINT64_T typedef unsigned long long uint64_t; typedef long long int64_t; #endif #else #define _STDINT_NO_INT32_T #endif #else #define _STDINT_NO_INT8_T #define _STDINT_NO_INT32_T #endif #endif /* * quote from SunOS-5.8 sys/inttypes.h: * Use at your own risk. As of February 1996, the committee is squarely * behind the fixed sized types; the "least" and "fast" types are still being * discussed. The probability that the "fast" types may be removed before * the standard is finalized is high enough that they are not currently * implemented. */ #if defined _STDINT_NEED_INT_LEAST_T typedef int8_t int_least8_t; typedef int16_t int_least16_t; typedef int32_t int_least32_t; #ifdef _HAVE_UINT64_T typedef int64_t int_least64_t; #endif typedef uint8_t uint_least8_t; typedef uint16_t uint_least16_t; typedef uint32_t uint_least32_t; #ifdef _HAVE_UINT64_T typedef uint64_t uint_least64_t; #endif /* least types */ #endif #if defined _STDINT_NEED_INT_FAST_T typedef int8_t int_fast8_t; typedef int int_fast16_t; typedef int32_t int_fast32_t; #ifdef _HAVE_UINT64_T typedef int64_t int_fast64_t; #endif typedef uint8_t uint_fast8_t; typedef unsigned uint_fast16_t; typedef uint32_t uint_fast32_t; #ifdef _HAVE_UINT64_T typedef uint64_t uint_fast64_t; #endif /* fast types */ #endif #ifdef _STDINT_NEED_INTMAX_T #ifdef _HAVE_UINT64_T typedef int64_t intmax_t; typedef uint64_t uintmax_t; #else typedef long intmax_t; typedef unsigned long uintmax_t; #endif #endif #ifdef _STDINT_NEED_INTPTR_T #ifndef __intptr_t_defined #define __intptr_t_defined /* we encourage using "long" to store pointer values, never use "int" ! */ #if _STDINT_LONG_MODEL+0 == 242 || _STDINT_LONG_MODEL+0 == 484 typedef unsigned int uintptr_t; typedef int intptr_t; #elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL+0 == 444 typedef unsigned long uintptr_t; typedef long intptr_t; #elif _STDINT_LONG_MODEL+0 == 448 && defined _HAVE_UINT64_T typedef uint64_t uintptr_t; typedef int64_t intptr_t; #else /* matches typical system types ILP32 and LP64 - but not IP16 or LLP64 */ typedef unsigned long uintptr_t; typedef long intptr_t; #endif #endif #endif /* The ISO C99 standard specifies that in C++ implementations these should only be defined if explicitly requested. */ #if !defined __cplusplus || defined __STDC_CONSTANT_MACROS #ifndef UINT32_C /* Signed. */ # define INT8_C(c) c # define INT16_C(c) c # define INT32_C(c) c # ifdef _HAVE_LONGLONG_UINT64_T # define INT64_C(c) c ## L # else # define INT64_C(c) c ## LL # endif /* Unsigned. */ # define UINT8_C(c) c ## U # define UINT16_C(c) c ## U # define UINT32_C(c) c ## U # ifdef _HAVE_LONGLONG_UINT64_T # define UINT64_C(c) c ## UL # else # define UINT64_C(c) c ## ULL # endif /* Maximal type. */ # ifdef _HAVE_LONGLONG_UINT64_T # define INTMAX_C(c) c ## L # define UINTMAX_C(c) c ## UL # else # define INTMAX_C(c) c ## LL # define UINTMAX_C(c) c ## ULL # endif /* literalnumbers */ #endif #endif /* These limits are merily those of a two complement byte-oriented system */ /* Minimum of signed integral types. */ # define INT8_MIN (-128) # define INT16_MIN (-32767-1) # define INT32_MIN (-2147483647-1) # define INT64_MIN (-__INT64_C(9223372036854775807)-1) /* Maximum of signed integral types. */ # define INT8_MAX (127) # define INT16_MAX (32767) # define INT32_MAX (2147483647) # define INT64_MAX (__INT64_C(9223372036854775807)) /* Maximum of unsigned integral types. */ # define UINT8_MAX (255) # define UINT16_MAX (65535) # define UINT32_MAX (4294967295U) # define UINT64_MAX (__UINT64_C(18446744073709551615)) /* Minimum of signed integral types having a minimum size. */ # define INT_LEAST8_MIN INT8_MIN # define INT_LEAST16_MIN INT16_MIN # define INT_LEAST32_MIN INT32_MIN # define INT_LEAST64_MIN INT64_MIN /* Maximum of signed integral types having a minimum size. */ # define INT_LEAST8_MAX INT8_MAX # define INT_LEAST16_MAX INT16_MAX # define INT_LEAST32_MAX INT32_MAX # define INT_LEAST64_MAX INT64_MAX /* Maximum of unsigned integral types having a minimum size. */ # define UINT_LEAST8_MAX UINT8_MAX # define UINT_LEAST16_MAX UINT16_MAX # define UINT_LEAST32_MAX UINT32_MAX # define UINT_LEAST64_MAX UINT64_MAX /* shortcircuit*/ #endif /* once */ #endif #endif STDINT_EOF fi if cmp -s $ac_stdint_h $ac_stdint 2>/dev/null; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_stdint_h is unchanged" >&5 $as_echo "$as_me: $ac_stdint_h is unchanged" >&6;} else ac_dir=`$as_dirname -- "$ac_stdint_h" || $as_expr X"$ac_stdint_h" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_stdint_h" : 'X\(//\)[^/]' \| \ X"$ac_stdint_h" : 'X\(//\)$' \| \ X"$ac_stdint_h" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_stdint_h" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p rm -f $ac_stdint_h mv $ac_stdint $ac_stdint_h fi ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010 Free Software Foundation, # Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="" # ### BEGIN LIBTOOL CONFIG # Assembler program. AS=$lt_AS # DLL creation program. DLLTOOL=$lt_DLLTOOL # Object dumper program. OBJDUMP=$lt_OBJDUMP # Whether or not to build static libraries. build_old_libs=$enable_static # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == "file_magic". file_magic_cmd=$lt_file_magic_cmd # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into a binary # during linking. This must work even if \$libdir does not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) case $xsi_shell in yes) cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac } # func_basename file func_basename () { func_basename_result="${1##*/}" } # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}" } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). func_stripname () { # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"} } # func_opt_split func_opt_split () { func_opt_split_opt=${1%%=*} func_opt_split_arg=${1#*=} } # func_lo2o object func_lo2o () { case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac } # func_xform libobj-or-source func_xform () { func_xform_result=${1%.*}.lo } # func_arith arithmetic-term... func_arith () { func_arith_result=$(( $* )) } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=${#1} } _LT_EOF ;; *) # Bourne compatible functions. cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # sed scripts: my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^-[^=]*=//' # func_opt_split func_opt_split () { func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"` func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"` } # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "$@"` } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } _LT_EOF esac case $lt_shell_append in yes) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$1+=\$2" } _LT_EOF ;; *) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$1=\$$1\$2" } _LT_EOF ;; esac sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # 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=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || 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 || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi echo "-> Variables used for compilation/linking:" echo CPPFLAGS=\"${CPPFLAGS}\" echo CFLAGS=\"${CFLAGS}\" echo LDFLAGS=\"${LDFLAGS}\" echo LIBS=\"${LIBS}\" echo "-> Installation directories:" echo "Configuration: `eval eval echo ${sysconfdir}`" echo "Libraries: `eval eval echo ${libdir}`" echo "Binaries: `eval eval echo ${bindir}` and `eval eval echo ${sbindir}`" echo "Manpages: `eval eval echo ${mandir}`" echo "Documentation: `eval eval echo ${docdir}`" if eval "test x$INSTALL_LOCKPATH = xinstall-lockpath" ; then echo "Lockfiles: `eval eval echo ${locksanedir}`" else echo "Lockfiles: Feature is disabled!" fi echo "-> Network parameters:" if test "${SANED}" = "saned" ; then echo "Build saned: yes" else echo "Build saned: no" fi echo "IPv6 support: `eval eval echo ${ipv6}`" echo "Avahi support: `eval eval echo ${enable_avahi}`" echo "SNMP support: `eval eval echo ${with_snmp}`" echo "-> The following backends will be built:" for backend in ${BACKENDS} ; do echo $ECHO_N "${backend} " done echo echo echo "-> The following preload backends will be built:" for backend in ${PRELOADABLE_BACKENDS} ; do echo $ECHO_N "${backend} " done echo if test "$SANE_CONFIG_PATH" != "no" ; then SANE_INSTALLED_VERSION=`$SANE_CONFIG_PATH --version` SANE_INSTALLED_PREFIX=`$SANE_CONFIG_PATH --prefix` if test "$SANE_INSTALLED_PREFIX" != "$prefix" ; then echo "*** WARNING: SANE is already installed (version $SANE_INSTALLED_VERSION). The old" echo "*** installation is at $SANE_INSTALLED_PREFIX while SANE will now be installed" echo "*** at $prefix. It is recommended to uninstall the old SANE version" echo "*** before installing the new one to avoid problems." fi else if test "$LIBSANE_EXISTS" = "yes" ; then echo "*** Warning: An old version of SANE was detected but the sane-config program" echo "*** couldn't be found. If you encounter any problems with SANE remove the old" echo "*** SANE files and reinstall this version." fi fi if eval "test x${sysconfdir} = x/usr/etc" ; then echo "*** WARNING: Configuration files are stored in /usr/etc. If this is not" echo "*** intended, use --sysconfdir to set another path (e.g. "/etc")." fi if test "$SELECTED_BACKENDS" != "" ; then echo "*** Warning: Local backends have been disabled. This means that scanners" echo "*** connected to your local computer won't be supported. Only a network" echo "*** connection to a remote host is possible." fi if test "$enable_libusb" != "no" && test "$HAVE_USB" != "yes" ; then echo "*** Warning: sane-backends will be built without libusb support. There may" echo "*** be valid reasons to do so, e.g. if you don't use USB scanners or on" echo "*** platforms without libusb support but generally this means that you" echo "*** can't use USB devices with SANE. The most probable cause is that" if test "${ac_cv_header_usb_h}" != "yes"; then echo "*** the libusb header file usb.h is not installed. If you use Linux" echo "*** you may need a package called 'libusb-dev', 'libusb-devel' or similar." else echo "*** libusb is not installed at all or is too old. See README." fi fi echo "****************************************************************" echo "* Please be sure to read file PROBLEMS in this directory *" echo "* BEFORE running any of the SANE applications. Some devices *" echo "* may be damaged by improper operation, so please do heed this *" echo "* advice. *" echo "****************************************************************" sane-backends-extras-1.0.22.3ubuntu1/README.linux0000664000000000000000000001536511475557446016225 0ustar Information about USB scanners: ================================ With Linux 2.4.* you could either use the kernel scanner module or libusb to access USB scanners. In Linux 2.6.4 the kernel scanner module was removed. Therefore with this and later kernels libusb must be used. Permissions: ------------ While SANE automatically uses libusb when the library and its header file were present during the build of sane-backends, setting permissions will require some attention. So if scanimage -L lists your scanner as root but not as normal user read on this text. Most distributions support setting permissions without much manual configuration. Usually you must just add the users that are allowed to access the scanner to group "scanner". To make that change active, the user must login again. For more details, see your distribution's documentation e.g. for Debian: README.debian.gz. If this doesn't work you you want to know more, read on. The device files used by libusb are located in /proc/bus/usb/ (e.g. /proc/bus/usb/001/003) or in /dev/bus/usb/ (e.g. /dev/bus/usb/001/003), if you use udev. The exact file name can be found out by running sane-find-scanner which would print "libusb:001:003" in this case. While setting permissions with e.g. "chmod a+rw /proc/bus/usb/001/003" works, this change is not permanent. The permissions will be reset when the scanner is replugged or Linux is rebooted. One solution to set permissions on-the-fly is Linux udev which comes with current distributions. SANE comes with a udev rules file in the tools/udev directory which may be used by distributions or can be copied to /etc/udev/rules.d manually. The file format is explained on top of the file itself. Either you need libusb 0.1.12 or newer or USB_DEVFS_PATH=/dev/bus/usb must be exported as a system-wide environment variable. Older distributions may use the Linux hot-plug tools (or hotplug-ng). Your distribution should have set up the scripts to automatically change permissions correctly. Look for "libsane.usermap" and "libusbscanner" in /etc/hotplug/usb. If you build SANE from source you can use the hotplug script that comes with SANE. See the tools/hotplug/ directory in the source distribution. Please refer to the README in that directory for the details. Gentoo information: ------------------- Gentoo users: If your USB scanner is not detected at all check that USE=usb is set when emerging. Information about SCSI scanners: ================================ Under Linux, your kernel must have generic SCSI support (sg) as well as a driver for your SCSI adapter. You may want to increase the SCSI buffer size to increase scan speed. Details on all of the above can be found in sane-scsi(5). If your SCSI and sg driver are build as moduls you will need to load them with modprobe: # modprobe your-driver-name # modprobe sg You may find error messages in /var/log/messages. Look at the documentation for your SCSI driver. Maybe you need to add options like the io port. Now the SCSI adapter and your scanner should be visible at /proc/scsi/scsi. Example: # cat /proc/scsi/scsi Host: scsi0 Channel: 00 Id: 06 Lun: 00 Vendor: SCANNER Model: Rev: 2.02 Type: Scanner ANSI SCSI revision: 01 CCS In this case the real vendor and scanner name are not shown (Mustek Scannexpress 12000SP) but SANE will detect it nevertheless. If your scanner is supported by SANE, scanimage -L will list it now: # scanimage -L device mustek:/dev/scanner' is a Mustek ScanExpress 12000SP flatbed scanner If this doesn't work you may have to add the right SCSI generic device name to the configuration file. This should be documented in the man page for your backend. To find out about the right SCSI device use sane-find-scanner: # sane-find-scanner found SCSI scanner "SCANNER 2.02" at /dev/scanner found SCSI scanner "SCANNER 2.02" at /dev/sg0 found SCSI scanner "SCANNER 2.02" at /dev/sga It may help to set a symbolic link /dev/scanner to the respective device if automatic detection does not work. If you need more information on the Linux SCSI subsystem, look at http://www.torque.net/scsi/linux_scsi_24/index.html. Although this documentation is about the 2.4 kernels, large parts are also valid for older kernels. One important exception is the section on "Device Names in devfs". Adaptec 1542 SCSI adapter: Using buffer sizes of more than 32768 bytes with the aha1542 driver can lead to kernel panic with older kernels. To avoid this, run configure with the option --enable-scsibuffersize or set the environment variable SANE_SG_BUFFERSIZE to 32768 before running scanimage or another frontend, or download and install the SG driver 2.1.37 or newer from http://www.torque.net/sg. idescsi: The Linux kernel "Emulation of a SCSI host adapter for IDE ATAPI devices" (idescsi) is reported to cause problems in connection with SANE. If your scanner isn't found or you encounter segmentation faults try to disable idescsi. SCSI Direct IO: Recent versions of the Linux SG driver for the 2.4 kernels support direct IO, i.e., the SCSI adapter's DMA chip copies data directly to/from user memory. Direct IO reduces memory usage, but it can lead to access conflicts, if a backend uses shared memory. SANE does not use direct IO by default. If you want to use it, run configure --enable-scsi-directio=yes Very old Linux distributions are missing the /usr/include/scsi directory. In such a case, it is necessary to copy the relevant files from the kernel distribution. Normally, the command: cp -a /usr/src/linux/include/scsi /usr/include should fix this problem. Don't do this if you don't get compilation errors about missing SCSI headers. Other Information ================= ld.so.conf configuration: "/usr/local/lib/sane" or "/usr/lib/sane" MUST NOT be listed in /etc/ld.so.conf. If your scanner is not detected or only Video for Linux devices are found, check for one of the above lines in ld.so.conf. A line "/usr/local/lib" or "/usr/lib" in ld.so.conf is ok, however. Excessive warnings "pointer of type `void *' used in arithmetic": Some older versions of glibc generate these warnings not related to SANE source code. To suppress these warnings do export CFLAGS="-g -O2 -D__NO_STRING_INLINES" and rerun configure. If you use DEC cc on Linux Alpha, you may need to set LDFLAGS="-N" to be able to build sane-backends. The Intel C++ Compiler for IA32 and IA64 isn't supported yet. If you want to try nevertheless, you will experience undefined references to inb and outb functions. To avoid those replace #include with #if defined(__ICC) && __ICC >= 700 # define __GNUC__ 2 #endif #include #if defined(__ICC) && __ICC >= 700 # undef __GNUC__ #elif defined(__ICC) && defined(HAVE_ASM_IO_H) # include #endif sane-backends-extras-1.0.22.3ubuntu1/NEWS0000664000000000000000000012551211526102371014656 0ustar -*-Mode: outline-*- New with 1.0.22, released 2011-02-13: * New backends: kvs20xx (Panasonic KV-S20xx), magicolor (Konica-Minolta ) * Significant enhancements to several backends. * More than 80 new scanner models supported. * Support many more networked scanners. * Added -A option to scanimage * Improved build system. * Improved USB support. * Improved udev rules. * Documentation updates. * Bugfixes. New with 1.0.21, released 2010-04-25: * New backends: kodak (Kodak i18xx), kvs1025 (Panasonic KV-S10xx), p5 (Primax PagePartner) * 224 more scanner models supported. * Many backends updated. * Improved compilation on uncommon platforms. * More consistent option naming. * Scanimage no longer writes image to tty. * Modern translation infrastructure. * Improved saned network daemon. * Internal SCSI, USB, threading, TCP & UDP code updates. * Updated HAL and udev support. * New sanei_magic image processing library. * Documentation updates. * Bugfixes. New with 1.0.20, released 2009-05-03: * New backends: canon_dr (Canon DR-series), coolscan3 (Nikon LS & Coolscan), rts8891 (Umax & HP 44xx), xerox_mfp (Samsung/Xerox/Dell MFPs) * Many backends updated. * 75 more scanner models supported. * New build system (thanks Chris and Olaf). * Avahi support (thanks Julien). * More network scanners supported * Epson backend deprecated, use epson2 * Coolscan2 backend deprecated, use coolscan3 * Internal SCSI, USB, threading, TCP & UDP code updates. * Updated HAL and udev support. * Improved saned configuration. * Scanimage updates. * Updated translations. * Documentation updates. * Bugfixes. New with 1.0.19, released 2008-02-10: * New backends: cardscan (Corex Cardscan 800c), epjitsu (Epson-based Fujitsu), epson2 (various Epson scanners), hp3900 (HP ScanJet 3970 and more), hp5590 (HP ScanJet 5590 and more), hpljm1005 (HP LaserJet M1005 and more), hs2p (Ricoh IS400 series) * Updated backends: abaton, agfafocus, apple, artec, artec_eplus48u, as6e, avision, canon, coolscan, coolscan2, dc25, dell1600n_net, dll, epson, fujitsu, genesys, gt68xx, hp3500, ibm, lexmark, microtek, microtek2, mustek, nec, net, pie, pint, pixma, plustek, plustek_pp, ricoh, s9036, sm3600, sm3840, snapscan, sp15c, st400, tamarack, teco2, test, u12, umax, umax1220u, umax_pp * Scanimage detects more chipsets. * Internal scsi, usb, tcp and udp code updates. * Basic HAL .fdi creation support * Build system updates. * Updated translations. * Documentation updates. * Bugfixes. New with 1.0.18, released 2006-07-02: * New backends: dell1600n_net (Dell 1600n), hp3500 (HP ScanJet 3500 series), pixma (Canon Pixma series), stv680 (Aiptek Pencam and similar). * Updated backends: avision, canon, dll, epson, fujitsu, genesys, gt68xx, microtek2, mustek_pp, niash, plustek, snapscan, sp15c, test, u12, umax1220u. * Scanimage batch mode fixes. * Scanner lists contain USB vendor/product ids and some statistics now. * Udev/hotplug lists are generated autmatically from the .desc files now. * Portability fixes (especially for DragonFlyBSD and HP/UX). * Build system updates. * Updated translations. * Documentation updates. * Bugfixes. New with 1.0.17, released 2005-12-18: * New backends: hp4200 (HP ScanJet 4200), lexmark (Lexmark X1100 series), mustek_usb2 (Mustek BearPaw 2448 TA Pro) * Updated backends: artec_eplus48u, avision, canon, epson, fujitsu, genesys, gt68xx, microtek2, mustek_pp, plustek, plustek_pp, sm3600, snapscan, umax_pp. * Hotplug/udev updates. * scanimage fixes. * sane-find-scanner finds more chipsets. * Build system fixes/updates. make now calls makedepend. * Several fixes in SANE internal functions (sanei). * Portability fixes (especially for MacOSX, FreeBSD, OpenBSD, OS/2). * Updated translations. * Documentation updates. * Bugfixes. New with 1.0.16, released 2005-08-07: * New backends: genesys, sm3840 * Updated backends: avision, canon, coolscan, epson, gphoto2, gt68xx, mustek, mustek_pp, niash, plustek, plustek_pp, qcam, sm3600, snapscan, teco2, umax_pp, v4l. * More functionality/fixes for sanei_usb and sanei_pp. * Added sanei_access to allow locking of SANE devices. * Hotplug updates. * scanimage updates. * Portability fixes (especially for OS/2, 64bit platforms, BeOS+ZETA). * Added Polish translation. Updated other translations. Fixed format strings. * Documentation updates. * Bugfixes. New with 1.0.15, released 2004-11-07: * New backends: niash. * Updated backends: agfafocus, artec_eplus48u.c, avision, canon, canon_pp, coolscan, dll, epson, fujitsu, gt68xx, hp, hp5400, leo, microtek2, mustek, mustek_pp, net, pie, plustek, plustek_pp, snapscan, sp15c, tamarack, teco2, umax, umax_pp, u12, v4l. * Portability fixes (especially for MacOS X, NetBSD, OS/2, 64 bit platforms). * sane-find-scanner detects more chipsets now. * Added Finnish translation. Updated other translations. * Several saned fixes. * Build system updates. * Documentation updates. * Bugfixes. New with 1.0.14, released 2004-05-01: * New backends: u12 * Updated backends: artec, artec_eplus48u, as6e, avision, canon630u, canon_pp, epson, fujitsu, gphoto2, gt68xx, hp, matsushita, mustek, mustek_pp, mustek_usb, plustek, plustek_pp, sm3600, snapscan, teco1, teco2, u12, umax, umax_pp, v4l. * Added scripts for USB hotplugging (Linux) * Added Danish translation. Updated other translations. * sane-find-scanner knows about more chipsets now. * Portability fixes (especially for MacOS X, NetBSD, OpenBSD, and OS/2). * Build system fixes. * Documentation updates. * Bugfixes. New with 1.0.13, released 2003-11-22: * New backends: mustek_pp_ccd (for Mustek parport CCD scanners), plustek_pp (for Plustek parport scanners, splitted from the plustek backend). * Updated backends: avision, canon630u, coolscan, epson, fujitsu, gphoto2, gt68xx, hp, hp5400, mustek, mustek_pp, pie, plustek, snapscan, teco2, test, umax, umax_pp. * New internal interface for parport scanners. * Networking (IPv6 + subnet support) fixes + updates. * sane-find-scanner can detect some USB scanner chipsets now. * Better support for threading. * Port to MS Windows (Cygwin). * Portability fixes (especially for FreeBSD, MacOS X, OS/2). * Build system improvements. * Added new (Bulgarian, Czech and Italian) and updated existing translations. * The level of support for scanners is now: unsupported, minimal, basic, good, complete or untested (instead of alpha, beta, stable). * Documentation updates. * Bugfixes. New with 1.0.12, released 2003-05-25: * New backends: hp5400 (Hewlett Packard 54XX series), ibm (IBM 2456, Ricoh IS-410, IS-420, and IS-430), and ma1509 (Mustek BearPaw 1200F). * Updated backends: apple, artec_eplus48u, as6e, avision, canon (FB1200S), canon630u, dc210, dc240, dll, epson, fujitsu (fi4220), gphoto2, gt68xx, hp, mustek, mustek_pp, mustek_usb, net, pie, plustek, snapscan (Agfa Arcus 1200, Epson Perfection 660), teco2 (Relisys AVEC II S3, Relisys APOLLO Express 3 and Primax Jewel 4800), test, umax, umax_pp. * Added IPv6 support for saned and net backend. * Added SCSI support for MacOS X. * Build system improvements. * USB access improvements. * Portability fixes (especially for Irix, MacOS X, OS/2 and Linux/m68k). * Added new (nl, no) and updated existing translations. * Documentation updates. * Bugfixes. New with 1.0.11, released 2003-02-09: * Security fixes for saned. New with 1.0.10, released 2003-02-01: * New backends: artec_eplus48u (Artec E+ 48U, Tevion/Medion MD 9693, Medion MD 9705, Trust Easy Webscan 19200), gt68xx (Artec Ultima 2000, some Mustek BearPaws and other GT6801/GT6816 based scanners). * Updated backends: avision, canon, coolscan2, canon_pp, dc210, dc240, dc25, dll, epson, gphoto2, hp, hpsj5s, microtek2, mustek, mustek_pp, plustek, sharp, snapscan, test, umax, umax_pp. * Improved SCSI and USB handling. * Portability fixes (especially for Linux/sparc64, MacOS X, OS/2, Tru64). * New translation system. All backends have translations for the standard options now. Added translations for Portuguese, Russian and Swedish. * Build system updates. * Various documentation updates. * Bugfixes. New with 1.0.9, released 2002-10-24: * New backends: hpsj5s (Hewlett-Packard ScanJet 5S parport scanner), teco2 (some Relisys/Primax SCSI flatbed scanners, models VM3575, VM6565, VM6586 and VM6575), teco3 (some Relisys/Piotech/Trust/Plustek SCSI flatbed scanners, model VM3552). * Updated backends: avision, canon_pp, coolscan2, dc240, dc25, epson, fujitsu, hp, leo, microtek, mustek, mustek_usb, pie, plustek, snapscan, teco1, test, umax, umax_pp, v4l. * sane-find-scanner finds more scanners and has more verbosity options now. * New tool to create gamma tables (gamma4scanimage). * Support for ICC profiles for scanimage. * USB scanner should work on all systems supported by libusb now. * Portability fixes (especially for big-endian sytems, Irix, OpenStep, OS/2, Solaris). * New and updated translations for various backends. * New system for generating lists of manufacturers/backends. * Various documentation updates. * Bugfixes. New with 1.0.8, released 2002-05-27: * New backends: canon_pp (Canon parport scanners), canon630u (CanoScan 630u + 636u), coolscan2 (Nikon Coolscan LS-30, LS-40 ED, LS-4000 ED, and LS-8000 ED), fujitsu (M3091, M3093, M3096 and similar scanners), leo (Leo/Across FS-1130 scanner), matsushita (Panasonic KV-SS scanners), sceptre (Sceptre VividScan S1200), teco1 (some Teco/Relisys flatbed scanners), test (test frontends and SANE installation). * Updated backends: avision, canon, dc240, dll, epson, gphoto2, mustek, mustek_pp, mustek_usb, nec, net, plustek, pnm, sharp, sm3600, snapscan, umax, umax_pp, v4l. * New translations for several backends (de, es, fr). * Networking supports hosts without working DNS now. * SCSI system ignores USB files and doesn't block (Linux). * New test frontend and backend for testing SANE. * Several build system improvements (e.g., new libtool, better make distclean, build only shared libs by default). * Portability fixes (especially for AIX, Linux (2.2, hppa, sparc), HP-UX, NetBSD, OPENSTEP, OS/2). * Better documentation of internal functions (sanei). * Various Documentation updates. * Bugfixes. New with 1.0.7, released 2002-02-04: * New backend: umax1220u (for UMAX Astra 1220U and 2000U scanners). * Updated backends: avision (v 1.0.15), dc240 (v 0.0), dc25 (v 1.2), dll (v 1.0.5), epson (v 1.0.219), gphoto2 (v 0.0), microtek2 (v 0.95), mustek (1.0.118), mustek_usb (v 1.0.10), plustek (v 0.41), pnm (v 1.0.4), sharp (v 0.32), snapscan (v 1.4.7), st400 (v 1.6), umax (v 1.0-32), umax_pp (v 1.0.6). * Added support for translating backend options. * Added support for USB control messages and lm983x and pv6830 chipsets. * Better documentation of internal functions (sanei). * Fixed several security issues with temporary files. * Fixed several issues in the networking code. * Portability fixes (especially for OS/2, FreeBSD, and OpenBSD). * Scanimage fixes concerning TIFF output and signal handling. * Documentation updates. * Bugfixes. New with 1.0.6, released 2001-11-05: * New backends: gphoto2 (backend for gphoto2 supported cameras), mustek_usb (for Mustek USB scanners 600CU, 1200CU(+), 1200UB). * Updated backends: dc240 (v 0.0), epson (v 0.2.12), hp (0.95), m3096g (v 1.11), microtek2 (v 0.95), mustek (v1.0-113), net (v 1.0.5), pie (1.0-7), pnm (1.0-2), snapscan (v 1.4.0), umax (1.0-31), umax_pp (1). * Added generic support for USB devices. * Added USB support to sane-find-scanner. * Code and documentation updates for HP UX compatibility. * Documentation updates. * Bugfixes. New with 1.0.5, released 2001-07-01: * New backends: bh (Bell+Howell Copiscan II series), dc240 (Kodak DC240 Digital Camera), sm3600 (Microtek ScanMaker 3600), umax_pp (Umax paralell port scanners). * Updated backends: artec (v0.5.16), dc25 (v1.2), dll (v1.0.3), epson (v0.2.08), hp (v0.94), microtek (v0.12.3), microtek2(v0.9), mustek (v1.0-107), nec (v0.12), net (v1.0.3), plustek (v0.39), pnm (v1.0.1), snapscan (v1.2), tamarack (v0.5), umax (v1.0-28). * Fixed security bug in saned.c that allowed access to scanner without password. * pnm isn't installed by default anymore due to security risks * Linux-part of sanei_scsi.c was updated concerning buffersizes, devfs, and kernel 2.4. More debug output. * sanei_scsi_find_devices works on FreeBSD now. * Added support for Solaris sgen SCSI driver. * find-scanner was renamed to sane-find-scanner and is installed now. Further more it has a man page now. * There is a testsuite for sane, but only one test is implemented yet. * Better output about versions of backends and frontends. * There is a man page for SANE now (sane(7)). * Install all available documentation. * Bugfixes. New with 1.0.4, released 2000-12-21: * New backends: as6e, nec, pie. * Updated backends: artec (v0.5.15), avision (v0.2.1), epson (v0.1.39), hp (v0.93), mustek (v1.0-102), mustek_pp (v0.9-devel), plustek (v0.38), sharp (v0.32), umax (v1.0-21). * Moved frontends xscanimage and xcam to a new package (sane-frontends). * Added authentification with encrypted passwords. * Installation of shared libraries on AIX is supported now. * Fixed compilation bugs on Irix and FreeBSD. * Better debug output on platforms not supporting vararg macros. * Better documentation about SANE devicenames. * Bugfixes. New with 1.0.3, released 2000-08-12: * New backends: mustek_pp, plustek, st400, v4l. * Updated backends: Artec (v0.5.14), Coolscan (v0.4.3), Epson (v0.1.33), HP (v0.88), Mustek (v1.0-96), Sharp (v0.31), UMAX (v1.0-21). * Removed backend info sagitta.desc due to lack of interest. * Installing no longer depends on 'rev'. * Added and structured documentation. * Every backend has a man page now. * Debug messages are now sent to syslog if stderr is a socket. * New 16 bit support to scanimage. * Bugfixes. New with 1.0.2, released 2000-03-06: * Aliased and hidden backend support. * Port to UnixWare 2.x and UnixWare 7. * New script 'sane-config' to help frontend developers. * Added Ricoh IS50 support. * Updated backends: Artec (v0.5.13), CANON (v991108), DC-25 (1.2), HP (v0.86), Microtek (0.12.0), Microtek2 (v0.8), UMAX (v1.0-build-18), Epson (v0.1.15), Sharp (v0.30), sp15c (1.12) and m3096g (1.11). * Automatic document feeder support for scanimage. * New backend for Avision AV 630 CS. * New Linux SCSI Generic driver. * Upgraded to libtool 1.3.4 * GIMP compatibility patch. * OS/2 patches. * Bugfixes. New with 1.01: * Miscellaneous o configure --disable-shared works again o scanimage -T testing option added (by Nick Lamb) o in dll.conf, the pnm, dc25, and dc210 backends are now disabled (commented out) by default. The net backend is now enabled by default. The pnm backend has been disabled as it often proved confusing to novice users. The dc25 and dc210 backends were disabled because they initialize very slowly if no camera is attached. o Downgraded PNM backend to the version shipped with SANE 0.74. The scan area options as implemented in SANE 1.00 were incorrectly implemented which made the backend unreliable. * New tool to turn off Mustek 600 II N scanner (by Andreas Czechanowski) o the new binary tools/mustk600iin-off allows to turn off a Mustek 600 II N scanner (note: you'll need to install this tool manually if you want it) * New backend for Sharp scanners (by FUKUDA Kazuya & Abel Deuring) o supports the Sharp JX-610, JX-250, and JX-330 SCSI scanner o preview/lineart/haftone/threshold are untested * Updated Kodak DC25 backend (by Peter Fales). * Updated HP backend (by Peter Kirchgessner) o New features: - Option 'unload after scan' for PhotoScanner - Manual page sane-hp updated - hp.desc updated o Bugfixes: - Adjustable scan size for scan from ADF - No blanks in command line options - Segmentation fault for starting scanimage -d hp:/dev/sg0 without /dev/sgo in hp.conf Scanning from the ADF therefore should work now. * Updated Microtek backend (by Matto Marjanovic) o Fixed off-by-1 error in revision-number parsing. o dump_inquiry() now prints the "Vendor Specific String". o Added model code/vendor name for the other 600ZS. o Made get_scan_status() retry delay increase with each try (will this help the poor 600ZS?). o Corrected base resolution for Agfa StudioScan II/IIsi (400dpi). o Disabled backend's clever aspect-ratio correction code for expanded-mode scans with StudioScan II/IIsi (scanner handles it internally - smart scanner.) o Fixed gamma LUT code parsing stupidity: now correctly determines maximum allowed LUT size, and uses it. (Especially necessary for StudioScan II/IIsi.) o The E6 claims to only support 256-byte LUT's, but the backend now ignores that misinformation (and uses 1024). o Now ignores denial of expanded-mode by older E6's (model code 0x63), in addition to newer E6's. * Updated Microtek2 backend (by Bernd Schroeder) o Added support for non-blocking I/O. o Preliminary support for a strip and a slide mode. o For people, who are annoyed, if the the scanhead moves back and fourth during a scan (backtracking): There is a new option 'disable backtracking'. At present this option must be activated by uncommenting the respective entry in the included microtek2.conf file. This is an advanced option. o The X6EL should no longer produce pixel junk after one successful scan. * Updated Mustek backend (by Andreas Bolsch) o larger buffer acquired (speeds up scanning slightly) o for SE models minimal resolution increased from 60 dpi to 75 dpi o for SE models 75 dpi in color mode is no longer used as the newer firware version seems to be even more buggy o bug in calculation of gamma table corrected (applies only to SE models, NOT related to the overflow problem which was corrected via CLIP( ) ) o default resolution is now set according to the minimal resolution (firmware dependent) o for SE models all unsupported options (speed, ... ) explicitly disabled * Updated Nikon Coolscan backend (by Didier Carlier) o Reverse the pixel order for the LS-1000. * Updated snapscan backend to v0.6 (by Kevin Charter and Petter Reinholdtsen) o Fixes the versioning problem. o Add support for SnapScan 1236s (should also work for SnapScan 600). * Updated UMAX backend (by Oliver Rauch) o Added support for Linotype Hell Saphir 2 o Changed bug in gray gamma data conversion o Added support for Nikon AX-210 o Added "Vista S-6E" as supported o Added PowerLook-II (PL-II) as supported o Added Astra 600S as supported New with 1.00: * Upgraded to libtool-1.2. This reportedly gets SANE to build on Solaris versions with a broken printf. * saned Matching of hostnames is no longer case-sensitive. * New Abaton backend (by David Huggins-Daines) Supports "Scan 300/GS" and may work with "Scan 300/S" but the latter is untested. * New Agfa Focus backend (by Karl Anders Øygard) Supports: o AGFA Focus GS (6 bit gray scale) (untested) o AGFA Focus Lineart (lineart) (untested) o AGFA Focus II (8 bit gray scale) (untested) o Siemens S9036 (8 bit gray scale) (untested) o AGFA Focus Color (24 bit color 3-pass) o AGFA Focus Color Plus (24 bit color 3-pass) * New Kodak DC210 still camera backend (by Brian J. Murrell) * New Ricoh backend (by Feico Dillema). * New HP backend. The backend formerly known as "xhp" is now the default HP backend. This backend should support HP scanners much better and was contributed by Geoffrey Dairiki and Peter Kirchgessner. - Added support for HP 6200C - Suppress halftone mode on photosmart (it is not supported) - Show calibrate button on photoscanner only for print media - Add media selection for photoscanner - Cleanup hp_scsi_s structure * Updated apple backend (by Milon Firikis). Now you should be able to scan from ColorOneScanners (in non color modes) and maybe from OneScanners (untested). * Updated Artec backend (by Chris Pinkham). * Updated Kodak DC25 backend (by Peter Fales). * Updated Microtek backend (by Matto Marjanovic). - Fix segfault on exit due to unnecessary free() in sane_close(). - Fix to red channel shift bug (which crept in during rewrite of color-handling code). - Addition of "patch level" to version codes. * Updated Microtek2 backend - Added support for ScanMaker 330, ScanMaker 636, ScanMaker E3plus, ScanMaker X6 and Phantom 636. - Other improvements (this includes support for automatic document feeders and transparency adapters, missing option descriptions were added). - Updated the manual page. * Updated Mustek backend (patches by Andreas Bolsch and Heiko Schroeder) - Heiko's patch should make resolutions >300dpi work for MFS-6000CX. Andreas's patches: - Should work with ScanExpress 6000SP, 12000SP as well as older models - Bug with MFS-12000SP corrected (poined out by Daniel Deckers) - Bug which caused xscanimage to crash after color preview corrected - Improvement(?) in high resolution Important Notes for ScanExpress models: - Resolutions below 60 dpi don't work (firmware problem). - Resolutions >300 dpi (6000 SP) or >600 dpi (12000 SP) result in different x/y-resolution as 6000 SP and 12000 SP have in fact only 300 dpi and 600 dpi CCD sensors, respectively. - Resolutions >300dpi in color mode sometimes result in corrupted images (parts duplicated/shifted *HORIZONTALLY*) depending on hardware configuration. Killing all other applications and disabling swap (if sufficient physical memory available) may help. I added some code which writes to every page of the buffer prior to scanning to fool the memory management and scanned a full page color scan with 600dpi * 1200dpi. Very slow but image seemed ok after pnmscale. - Max. scan area: 0-216mm (hor.), 2.5-294.5mm (ver.) The scanners can't scan the first 2.5mm (ver.), so you *MUST* specify the scan area according to this restriction! - The scanners support only lineart (1 bpp), gray (8 bpp), color (24 bpp). Although the scanners have 10 bit (6000 SP) or 12 bit (12000 SP) A/D-converters, they can send only 8 bit values to the host. The higher resolution may only be used via gamma table. - For compatibility only 256 entry gamma tables may be specified, the actual gamma table sent to the scanner is linearly interpolated from it. - In lineart mode only brightness may be adjusted. - Cover open/closed reported only via debug output and ignored otherwise. - Use of SCSI card supplied with scanner is *NOT* recommended. (Don't forget termination!) * Updated UMAX backend (by Oliver Rauch) - added output of umax-backend-version in sane_init - added Linotype Hell Jade2 (Vobis ScanBoostar Premium) SCSI-ID "LinoHell","Office2" as supported scanner - changed base of calculation of scanwidth and scanlegth from pixel to resolutionbase (1/300, 1/600 or 1/1200 inch) - changed calculation for width in pixels for lineart mode - changed selection for calibration mode - added inquiry for UMUX UC1200SE - corrected 12/36-bit-mode in send_gamma_data and array in umax.h * Updated SnapScan backend to v0.5 (by Kevin Charter) - bug fixes (Wolfgang, David) - addition of threshold control for lineart mode (Mikko) - Vuego 310S support (Wolfgang) - default scan area now maximal (Kevin) New with 0.74: * GIMP auto-detection should work again. * Service name for remote scanning changed from "saned" to "sane". Be sure to update your /etc/services and /etc/inetd.conf if you use remote scanning! We generally try to avoid such incompatible changes, but the name "saned" was definitely wrong, so it seemed better to change it now. * Thanks to Matto Marjanovic work, each backend now comes with a .desc file that describes exactly what devices it supports. These description files can be automatically translated into various other formats, such as HTML. See: http://www.mostang.com/sane/sane-backends.html for an example as to what this can do for you. * New backend for Kodak DC25 digital cameras (by Peter Fales). * Updated Artec backend (by Chris Pinkham). * Updated Microtek backend (by Matthew Marjanovic) o Complete rewrite of bit-shuffling, buffering, and color-handling code. o Improved rescaling algorithm for expanded resolution scans. o Support for 600GS (and maybe ZS, too) (thanks to Oliver Neukum). o Support for document autofeeder and IIG (thanks to Ross Crawford). o Fixed sane_cancel. o sane_get_parameters size estimates are now accurate to the last bit. o get_scan_status timeout increased (for 600GS), status code fixed. o Fixed parsing of 3-pass bit in INQUIRY data. o Stopped sending gamma tables to scanners that don't want them. o Made precalibration a bit more robust (always attempt at least one scan line now). o Much, much code clean-up. o Tested & working with saned. (Atrocious hack so sane_read handles buffers smaller than one scanline.) o Auto-expand pre/post hold buffers as necessary (fixes some problems with single-pass color scans). o Added configuration file option to disable precalibration logic. o Fixed document size calculations. o Added more informative scsi-II note. o Remove misnomer "Highscan" from manpage. o Updated man-page. * Updated Microtek2 backend (by Bernd Schroeder) o changed the code for gamma calculation and added a custom gamma table to the options. In some cases this requires an additional memcpy(), but the code is now leaner and cleaner. o fixed the bugs that the backend didn't compile with non gcc compilers. o added an option to control exposure times. o rewrote the code that processes the data that is received from the scanner and transfers it into the frontend buffer. The smallest unit of data that can be copied into the frontend buffer is now a pixel, no longer a complete line. o added (a yet) undocumented option "strip-height" that allows to control the number of lines that is read from the scanner with one "read image". o fixed a bug that caused scanimage to sigsegv when calling sane_exit() without having written all data into the output file. o added code to support scanners with more than 8 bit output per color. Due to the lack of such a scanner this functionality is COMPLETELY UNTESTED and there are some potential sources of bugs, but at least one could give it try. o added sanei_config_attach_matching_devices() o improved the code for the check if it really is Microtek SCSI-II scanner o fixed the "lineart inverted" bug o The threshold option in lineart mode is now in the enhancement group o changed the default for the resolution o The values for the SANE_Params struct are calculated more precisely o dito the number of scan lines that fit into the frontend buffer o changed some return stati ( replaced SANE_STATUS_INVAL with SANE_STATUS_IO_ERROR where the first one is not allowed) o completely rewrote the end of scan and cancel scan handling o fixed another bug that caused xscanimage to crash with sigsegv under some circumstances (check of the inquiry result was wrong) o added model code for a Vobis Highscan o support for new format of configuration file (including "option ") * Updated Nikon Coolscan backend (by Didier Carlier). * Updated UMAX backend (by Oliver Rauch): o Cancelling a scan now works, cancelling a preview still makes problems! o Preview fix is activated for Astra 600S, Astra 610S and Vista S6E scanners. (calibration by driver still does not work for these scanners). - removed button for preview patch o Quality calibration / calibration by driver now works for same scanners. - added selection for type of shading data calculation o Solved problem with black area at top of the image (happend only with some SCSI-adapters). o Added gamma download format type 0 and type 1 for older scanners. o Added Astra 1220S as supported scanner: - added 36 gamma input bits support for Astra 1220S - added 36 output bits support, but there is no frontend that can handle it! o Added inquiry for Escom Image Scanner 256 (UMAX UG80). * OS/2 (by Yuri Dario): o Updated SCSI support so sanei_scsi_find_devices is supported now. o Epson parallel support added (by Rocco Caputo ) New with 0.73: * In xscanimage, the selection box now gets updated again when changing the geometry option sliders---really! * On Linux, it is now possible to specify SCSI device names by entering their SCSI ids. For example, instead of "/dev/scanner", one can now specify "scsi MUSTEK" to get all scanners manufactured by Mustek. This feature is currently supported by the all SCSI backends except microtek2. This feature is courtesy of Oliver Rauch. * Backend libraries are now installed in $(libdir)/sane (/usr/local/lib/sane/, by default). * Updated Microtek backend (Matto Marjanovic): - ScanMaker 600ZS, Agfa Arcus II, StudioScan, and StudioScan II now supported (or recognized, at least ;-). - Fixed 3-pass scanning. - Various bug-fixes (see ChangeLog for details). * New Microtek2 backend (Bernd Schroeder) This backend supports the ScanMaker 630 and possibly other newer scanners that are not supported by the "old" Microtek backend. Additional info by Bernd: This is the very first release of this backend, so consider this software to be in alpha state. The backend was developed on a Pentium (60 Mhz) with Linux 2.0.29 and a ScanMaker 630 attached to the Adaptec AHA1505E that shipped with the scanner. As frontend xscanimage was used. It is intended to work with other models, too, but there are no experiences yet. The following options are supported: - 8-bit color, 8-bit grayscale, halftone and lineart scans. - brightness, contrast, shadow, midtone and highlight control - scalar gamma correction. Options that are not yet supported include: - 3-pass scanners - more than 8 bit per color output data. Provisions are made here and there in the code, to support more than 8 bit, but that's uncomplete. * configure --disable-static should now work as expected. New with 0.72: * New backend for Artec scanners. This backend is known to work with Artec AT3, but others may work too (A6000C should work). * Updated DMC and Microtek backend. * Updated UMAX backend: ** added exposure time adjustment (for high-end scanners) ** added lamp density control (for high-end scanners) ** UMAX Astra 6X0S works in color-mode now, you have to enable preview_patch! ** added support for UMAX UC1200S and UC1260, but it will not work fine! ** enabled x-resolution greater than 600 dpi if supported by scanner (e.g. UMAX S12) but it sometimes still does not work right! * Updated SnapScan backend: There is now support for the SnapScan 310 and 600 scanner models. * OS/2 and FreeBSD support should be working again. * New backend writer's guide to SANE File backend/GUIDE outlines a few rules that should help in writing a new backend. New with 0.71: * Polaroid Digital Microscope Camera (DMC) backend Written by David Skoll . * Apple scanner backend Written by Milon Firikis . This backend supports AppleScanner and has preliminary support for OneScanner and ColorOneScanner. * Nikon CoolScan backend Written by Didier Carlier . * Apollo Domain/OS support Contributed by Paul Walker . New with 0.70: * Preliminary version of AGFA SnapScan backend is now included. This backend is know to work with AGFA SnapScan scanners but is unlikely to work with any other AGFA See scanner.http://www.cs.ualberta.ca/~charter/snapscan.html for details. * Various minor bug fixes that prevented SANE from building on non-Linux platforms. * xscanimage now honors WM_DELETE message. * Updated UMAX backend. New between 0.6 and 0.69: * Mustek backend now supports the Transparency Adapter on the Paragon 1200SP (MFS-12000SP). * New backend for Canon scanners. This backend was written by Helmut Koeberle . It is known to work with the CanonScan 600 though not all features are supported yet. * Solaris SCSI support now exists. Thanks to Martin Huber , the SCSI backends are now usable under Solaris, too. See README.solaris for details. * AIX SCSI support now exists. Thanks to Fred Hucht & Michael Staats, the SCSI backends are now usable under AIX, too. * New backend for Tamarack and ESCOM scanners. This backend was written by Roger Wolff of BitWizard. * New backend for Siemens S9036 scanner. This backend was written by Ingo Schneider . * find-scanner (by Oliver Rauch) SANE now comes with a program called find-scanner (in the tools subdirectory) that can be used to find the device name of attaches SCSI scanners. Note that this program is not normally installed as part of the normal SANE installation as this program is not something an end-user should ever have to use. * The Mustek backend has preliminary support for the Paragon 600 II N scanner. This scanner attaches directly to a Mustek-supplied ISA card which implements a funky parallel port. For details, see the section entitled PARALLEL PORT SCANNERS in sane-mustek(5). Use at your own risk! * The location of the configuration files can now be overridden with environment variable SANE_CONFIG_DIR (see also man-pages for the backends and programs). * When preloading backends into dll, they now appear in the same order as if they had been loaded dynamically (i.e., in reverse order in which they're listed in dll.conf). * Java frontend (by Jeff Freedman) SANE now includes a Java frontend for SANE. However, the Java files are not built by default. See japi/README.JAVA for details. * There is a Java API for SANE now. See japi/README.JAVA for details. This code is courtesy of Jeff Freedman . * UMAX updates (by Oliver Rauch): - the umax backend is now fully runtime configuable---there are no longer any build-time configuration options. - Umax T630, Astra 610S, and Linotype Hell Office scanners are now supported - gamma-data now works on Astra 1200 S with 30 bits/pixel Note: None of the SANE frontends presently support 30 bits/pixel. If you're interested in fixing this, send mail to sane-devel@mostang.com. * The Mustek backend is now fully runtime configurable---there are no longer any build-time configuration options. To this end, the mustek.conf configuration file now supports options linedistance-fix, lineart-fix, and strip-height (see sane-mustek(5) for details). * New backend for Epson scanners An alpha-quality backend for Epson scanners is now included with SANE thanks to the efforts of Kazuhiro Sasayama . * OS/2 Support Thanks to Jeff Freedman SANE now supports OS/2. * New backend for Microtek scanners Thanks to the excellent work of Matthew Marjanovic , the Microtek is now taking shape. * Irix SCSI support Thanks to the work of Michael Sweet , there is now SCSI support for Irix! * Improvements to the UMAX backend (by Oliver Rauch): ** workaround for preview-bit-problem in RGB-mode (UMAX S6E ...) ** unsupported options are disabled ** now three_pass_scan should work ** new supported scanners: *** UC840 *** Astra 1200S * The Mustek configuration file (mustek.conf) now supports a configuration option to limit the height of the strip that is scanned with a single SCSI read command. The syntax is: option strip-height HEIGHT where HEIGHT is a floating point number that gives the maximum strip height in inches. This option should be set to a small value (e.g., 1 inch) when the scanner is connected to a SCSI bus shared with other devices or when using a broken SCSI driver whose timeouts expire prematurely. For best scan performance, the strip-height should be set to a large value or the option should be removed completely. See the sane-scsi(5) man-page for details on how drivers with premature timeouts can be fixed (the Linux ncr810 driver is the only known driver with this problem at this point). * The preview window now properly draws the initial window-selection. * Mustek backend now uses a SCSI command queue to avoid performance problems with three pass scanners. This can reduce scantimes from 15 minutes down to 3 minutes! * Mustek backend will now wait for up to 1 minute for a scanner to become ready if the scanner name is specified explicitly. E.g., "scanimage -d mustek" will timeout almost right away (since the Mustek device name is not specified explicitly) whereas "scanimage -d mustek:/dev/scanner" will wait for up to a minute. * HP backend now uses pixel-unit commands to accommodate ScanJet 5P. * Platform-specific SCSI setup info is now in sanei-scsi(5). * xscanimage(1) now has a section on how to run it under GIMP. * B&W qcam support should now work (reports on how well it works are welcome). * Exiting xscanimage with preview window open should no longer cause an error. * Support for OpenStep/NeXTStep added (xscanimage and xcam require an X server and the GTK+ libraries, though). User-level SCSI is supported. * SCSI support for NetBSD and FreeBSD should work now. Thanks to NOGAYA Shigeki and Amancio Hasty for relevant patches. * New man-page sane-scsi(5) with platform-specific SCSI tips and tricks. * SANE now builds on HP-UX (SCSI support untested) and IRIX (no SCSI support), too. New in 0.6: * UMAX scanners are now supported! Kudos to Oliver Rauch and Michael K. Johnson . * scan got renamed to scanimage to avoid a nameclash with an MH program by the same name. For consistency, xscan also got renamed to xscanimage. * Man-pages! There finally are at least a few man-pages. At present, the following is covered: saned.1 scanimage.1 xscanimage.1 sane-dll.5 sane-hp.5 sane-mustek.5 sane-net.5 sane-pint.5 sane-pnm.5 sane-qcam.5 sane-umax.5 * SANE no longer insists on using GCC. GCC works best, but other ANSI C compilers will now also produce usable executables. * xscanimage now supports vector options (such as gamma-tables which are also known as intensity or tonemaps). * The gamma-table (intensity/tone-map) handling changed in the Mustek backend. As a result, when using scanimage it is now necessary to specify option --custom-gamma before gamma-tables can be specified. Also, the handling of the intensity table is now handled better in color mode (it no longer overrides the color tables; instead the composition of the intensity and the color channel table is used). * The SANE header files are now isolated in the include/sane directory and those files get now installed as part of "make install". Thanks to Michael K. Johnson for this patch! * xscanimage now displays the options' documentation strings as tooltips (can be disabled via the "Preferences" menu). * scanimage now supports three-pass scanning and scanning of images whose height is not known a priori (e.g., hand-held scanners). * The Mustek backend now supports an option to force preview scans to be monochrome (good to save time on three-pass scanners). * configure can now be run from any directory, as it's supposed to (makes it easier to build SANE for multiple platforms from the same source tree). * xcam and xscanimage should now build on Solaris, too (thanks to Tristan Tarrant). * copyright info in various files have been adjusted. See LICENSE for the general idea behind SANE licensing. * Many, many bugfixes. New in 0.5: * The same xscan binary can now function as a standalone frontend or as a gimp extension. If installed as a GIMP extension, xscan will attach itself as Extensions->Acquire Image. * The pnm backend now has an option to simulate a three-pass scanner. Good for testing. * xscan now supports previewing and (persistent) preferences. * The build process should be much more robust now. It requires GNU make and gcc but should be completely unproblematic otherwise. A simple "configure" should result in a working SANE environment even on systems where dynamic loading is unavailable. Various options are available to tailor the SANE setup. See README for details. * A first implementation of the HP backend now exists (for ScanJet scanners). * A first implementation of the net backend and saned (network daemon) now exists. So it is now possible to scan across the network! See backend/net.README and frontend/saned.README for details. * xcam, a camera frontend is now included. See frontend/xcam.README for details. * Renamed metadl to dll. New in 0.4: * A first implementation of the Connectix quickcam backend now exists. At present, only color cameras are known to work, though it shouldn't be too hard to get the b&w versions to work as well. * Improvements for the command-line frontend scan: ** Option settings are now applied _before_ the help info is printed. This allows to see what the available options are with certain options in effect. ** It can now deal with SANE_INFO_RELOAD_OPTIONS. ** It now prints the current option values in the help message (except for vectors). New in 0.33: * sane_get_devices() now takes a second argument of boolean type. If it's SANE_TRUE, then the backend must return local (non-remote) devices only. * scan now uses the default-unit of `mm' (millimeters) again for lengths. Using `cm' (centimeter) proved confusing since the help messages print length values in millimeters. * Debugging can now be controlled on a per-backend basis. The debug-level of backend is set by environment variable SANE_DEBUG_. For example, to see all debug messages of the metadl backend, set SANE_DEBUG_METADL to a large value (say 128). The sanei.h file provides three macros to assist in using this debug facility: DBG_DECL to declare the integer variable that holds the debug level, DBG_INIT to initialize debugging, and DBG to print a debug message. See backend/sanei.h and backend/metadl.c for details and examples. * scan now supports setting options to "auto" mode (e.g., --brightness=auto would ask the backend to select brightness automatically if that option supports automatic mode * scan now allows abbreviating the values of a string-lists. Case is ignored and the best matches is used (either longest unique match or exact match when ignoring case) New in 0.32: * xscan improved much. See frontend/xscan.README and frontend/xscan.BUGS for details. New in 0.31: * xscan has improved much. See frontend/xscan.CHANGES for details. New in 0.3: * The location of the SANE configuration files moved from /etc/saneconf to ${prefix}/etc/sane.d. This normally expands into /usr/local/etc/sane.d. * Real build environment. It's GNU autoconf based so all you should have to say is: ./configure make make install sane-backends-extras-1.0.22.3ubuntu1/Makefile.am0000664000000000000000000000570311527265636016231 0ustar ## Makefile.am -- an automake template for Makefile.in file ## Copyright (C) 2009 Chris Bagwell and Sane Developers. ## ## This file is part of the "Sane" build infra-structure. See ## included LICENSE file for license information. SUBDIRS = include lib sanei backend doc DIST_SUBDIRS = include lib sanei backend doc EXTRA_DIST = ChangeLog-1.0.0 ChangeLog-1.0.1 ChangeLog-1.0.2 \ ChangeLog-1.0.3 ChangeLog-1.0.4 ChangeLog-1.0.5 ChangeLog-1.0.6 \ ChangeLog-1.0.7 ChangeLog-1.0.8 ChangeLog-1.0.9 ChangeLog-1.0.10 \ ChangeLog-1.0.12 ChangeLog-1.0.13 ChangeLog-1.0.14 ChangeLog-1.0.15 \ ChangeLog-1.0.16 ChangeLog-1.0.17 ChangeLog-1.0.18 ChangeLog-1.0.19 \ ChangeLog-1.0.20 ChangeLog-1.0.21 \ $(PACKAGE).lsm # # Keep the .cvsignore files sorted, and use this target to do it. # PERL=perl sort-cvsignore: for f in `find . -name .cvsignore`; do \ $(PERL) -e 'print sort <>;' < $$f > $$f.tmptmp; \ mv $$f.tmptmp $$f; \ done # # Check to make sure only sane_ and sanei_ symbols are exported from # the libraries # libcheck: @echo "Libraries exporting 'illegal' symbols:" @for lib in backend/.libs/*.so backend/.libs/*.a; do \ lines=`nm -g $$lib|grep '\( T \)\|\( D \)'|egrep -v ' _fini| _init'|egrep -v ' sane_| sanei_'`; \ if test -n "$$lines" ; then \ echo -e "*** $$lib:\n$$lines"; \ found_errors="yes"; \ fi \ done; \ echo; \ echo "Libraries exporting 'non-standard sane_*' symbols:"; \ for lib in backend/.libs/*.so backend/.libs/*.a; do \ lines=`nm -g $$lib|grep '\( T \)\|\( D \)'|egrep ' sane_' | egrep -v 'sane_.*init|sane_.*exit|sane_.*get_devices|sane_.*open|sane_.*close|sane_.*get_option_descriptor|sane_.*control_option|sane_.*get_parameters|sane_.*start|sane_.*read|sane_.*cancel|sane_.*set_io_mode|sane_.*get_select_fd|sane_strstatus'` ; \ if test -n "$$lines" ; then \ echo -e "*** $$lib:\n$$lines"; \ found_errors="yes"; \ fi \ done; if test ! -z $$found_errors ; then \ exit 1; \ fi # Verify that backends do not contain any unwanted public symbols # anytime check or distcheck is ran. # TODO: Currently this doesn't pass. Uncomment once symbols have # been cleaned up. #check-am: libcheck # Run testsuite any time installcheck or distcheck is ran. # Must run testsuite after install or else shared library backends # will not be found (including test backend). installcheck-local: cd testsuite && $(MAKE) test.local $(distdir).lsm: dist $(PACKAGE).lsm ( cat $(PACKAGE).lsm | \ sed -e "s|_DATE_|`date +%d%b%y`|g" |\ sed -e "s|_VERSION_|$(VERSION)|g" | \ sed -e "s|_T_S_|`find $(distdir).tar.gz -printf "%4k"`|g" |\ sed -e "s|_L_S_|`find $(PACKAGE).lsm -printf "%4k"`|g" >\ $(distdir).lsm \ ) lsm: $(distdir).lsm md5: dist md5sum $(distdir).tar.gz > $(distdir).tar.gz.md5 sane-backends: lsm md5 # Clean files created by custom targets in this file. clean-local: rm -f sane-backends-*.lsm rm -f $(distdir).tar.gz.md5 # Clean files created by configure distclean-local: rm -f include/_stdint.h rm -f include/byteorder.h